/* ==========================================================================
   HUB SEARCH - the Search button in the side menu and the search dialog
   (js/shell/search.js). Colours come from the theme tokens, so dark mode
   and admin themes follow automatically.
   ========================================================================== */

/* --- Side menu: a row under the logo, icon only on the folded rail -------- */
.sb-search { padding: 0 12px 8px; }
.sb-search-btn .sb-label { flex: 1; }
.sb-kbd {
  flex: none !important; padding: 1px 6px; border: 1px solid var(--line); border-radius: 5px;
  color: var(--muted); font-family: var(--font-mono); font-size: 10.5px; line-height: 16px;
}

/* --- The dialog ------------------------------------------------------------ */
.modal.hs-modal { max-width: 620px; display: flex; flex-direction: column; }
@media (min-width: 640px) {
  .modal-backdrop:has(.hs-modal) { align-items: flex-start; padding-top: 9vh; }
  .modal.hs-modal { max-height: 80dvh; }
}
.hs-modal .modal-head { margin-bottom: 10px; }
.hs-box { position: relative; }
.hs-box > svg {
  position: absolute; left: 12px; top: 50%; translate: 0 -50%;
  width: 19px; height: 19px; color: var(--muted); pointer-events: none;
}
.hs-input { width: 100%; padding-left: 40px; min-height: 46px; font-size: 16px; }

.hs-status { display: flex; align-items: center; gap: 8px; margin: 14px 2px 4px; color: var(--muted); font-size: 13.5px; }
.hs-status svg { width: 17px; height: 17px; flex: none; }
.hs-status.is-error { color: var(--warn); }
#hs-state .hs-status { margin: 8px 2px 0; font-size: 12.5px; }

.hs-results { margin: 6px -6px 0; overflow-y: auto; min-height: 0; flex: 1 1 auto; }
.hs-group { padding: 8px 0 2px; }
.hs-group + .hs-group { border-top: 1px solid var(--line); }
.hs-head {
  display: flex; align-items: center; gap: 8px; margin: 2px 8px 4px;
  color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.hs-count {
  min-width: 20px; padding: 0 6px; border-radius: 9px; background: var(--panel2);
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0; line-height: 18px; text-align: center;
}

.hs-item {
  display: flex; align-items: center; gap: 11px; width: 100%; min-height: 48px; padding: 7px 8px;
  border: 0; border-radius: var(--radius-sm); background: none; color: var(--ink); text-align: left; font: inherit; cursor: pointer;
}
.hs-item:hover { background: var(--hover); }
.hs-item.is-active, .hs-item:focus-visible { background: var(--brand-wash); outline: none; box-shadow: inset 3px 0 0 var(--brand); }
.hs-ico { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: var(--hover); color: var(--ink2); }
.hs-item.is-active .hs-ico { color: var(--brand-quiet); }
.hs-ico svg { width: 17px; height: 17px; }
.hs-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.hs-title { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hs-sub { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hs-item mark { background: var(--brand-wash); color: var(--brand-quiet); border-radius: 3px; padding: 0 1px; }
.hs-item.is-active mark { background: var(--brand); color: var(--brand-ink); }
.hs-badge {
  flex: none; padding: 1px 8px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--muted); font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.hs-more { margin: 2px 8px 6px; color: var(--muted); font-size: 12px; }

.hs-modal .modal-actions { margin-top: 10px; }
.hs-keys { margin: 0; color: var(--muted); font-size: 12px; }
.hs-keys kbd {
  display: inline-block; min-width: 20px; margin-right: 3px; padding: 0 5px; border: 1px solid var(--line); border-radius: 5px;
  font-family: var(--font-mono); font-size: 11px; line-height: 18px; text-align: center;
}
@media (max-width: 639px) {
  .hs-keys { display: none; }
  .hs-modal .modal-actions { display: none; }
  .modal.hs-modal { min-height: 70dvh; }
}
