@layer components {
.app-search {
    position: relative;
    padding: 0 var(--app-spacing);
    margin-bottom: var(--app-spacing);
}

.app-search-shortcut {
  position: absolute;
  right: calc(var(--app-spacing) + 0.5rem);
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid var(--app-border);
  border-radius: 6px;
  background: var(--app-card-background-color);
  color: var(--app-muted-color);
  font-size: 0.75rem;
  line-height: 1;
  padding: 0.2rem 0.4rem;
  pointer-events: none;
}

.app-search-empty-state {
  margin: var(--app-spacing);
  padding: 1rem;
  border: 1px dashed var(--app-border);
  border-radius: var(--app-border-radius);
  text-align: center;
  color: var(--app-muted-color);
  font-size: 0.9rem;
  cursor: text;
}

.app-search-empty-state .bi-search {
  display: inline-block;
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--app-color);
}

.app-search-empty-state p {
  margin: 0 0 0.25rem;
}

.app-search-empty-state small {
  display: block;
}

ul.app-search-results {
  padding: 0;
  margin: 0;
}

ul.app-search-results > li > a {
  justify-content: space-between;
}

ul.app-search-results .badge {
    font-size: 10px;
    padding: 1px;
    min-width: 18px;
    text-align: center;
    border-radius: 999px;
    background: var(--app-accordion-border-color);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    height: 18px;
    position: relative;
    top: -1px;
}

ul.app-search-preview {
    position: relative;
    font-size: 11px;
    padding: 0 0 0 0;
    margin: 0;
    opacity: 0.75;
    list-style: none;
}

/* Hide preview rows (detail results) */
.search-details-hidden ul.app-search-preview {
  display: none;
}
ul.app-search-preview li::before {
    content: "";
    position: absolute;
    left: 17px;
    bottom: 11px;
    width: 8px;
    height: 10px;
    background: transparent;
    border-left: 1px solid var(--app-border);
    border-bottom: 1px solid var(--app-border);
    border-bottom-left-radius: 6px;
}

ul.app-search-preview li {
  position: relative;
  padding: 0;
}

ul.app-search-preview li::before {
    content: "";
    position: absolute;
    left: 17px;
    bottom: 11px;
    width: 8px;
    height: 10px;
    background: transparent;
    border-left: 1px solid var(--app-border);
    border-bottom: 1px solid var(--app-border);
    border-bottom-left-radius: 6px;
}

ul.app-search-preview a {
    padding-inline: 30px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    border: none;
}

ul.app-search-preview a:hover {
    border: none;
}

input#side-search {
    --app-form-element-spacing-horizontal: 10px;
    --app-form-element-spacing-vertical: 6px;
    height: auto;
    font-size: 13px;
    padding-right: 3rem;
    margin-bottom:0;
}

ul.app-search-preview:has(li) {
    margin-bottom: 1rem!important;
}

.search-result-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.search-reuslt-title-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.search-result-avatar,
.search-result-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--app-border);
    background: var(--app-card-background-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--app-muted-color);
    flex-shrink: 0;
    object-fit: cover;
}



.search-result-title {
    font-weight: 600;
    text-decoration: none;
}

.search-result-desc {
    margin: 0;
    color: var(--app-muted-color);
    font-size: small;
}

.search-result-type {
    color: var(--app-muted-color);
    font-weight: 600;
}
}
