/* ════════════════════════════════════════════════════
   top-bar — breadcrumb (Org/Workspace/Space), search center, notifications, user
   ════════════════════════════════════════════════════ */

.shell-top-bar {
    display: flex;
    align-items: center;
    height: 36px;
    padding: 0 12px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    z-index: 20;
    gap: 0;
}

/* ── Left section (breadcrumb) ──────────────────── */
.topbar-left {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    min-width: 0;
    padding-right: 8px;
}

/* ── Center section (search) ────────────────────── */
.topbar-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

/* ── Right section (notif, signin, user) ────────── */
.topbar-right {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 2px;
    padding-left: 8px;
}

/* Dissolve the mount wrapper so the bell is a direct flex child */
#notif-charm-mount {
    display: contents;
}

/* ── Breadcrumb ─────────────────────────────────── */
.topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 2px;
    min-width: 0;
}
.topbar-bc-sep {
    color: var(--text-muted);
    font-weight: 300;
    opacity: 0.4;
    font-size: 14px;
    margin: 0 1px;
    flex-shrink: 0;
    pointer-events: none;
    user-select: none;
}
.topbar-bc-segment {
    display: flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s;
    white-space: nowrap;
    min-width: 0;
    max-width: 160px;
}
.topbar-bc-segment:hover { background: var(--bg-hover); }
.topbar-bc-segment svg { flex-shrink: 0; color: var(--text-muted); }
.topbar-bc-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.topbar-bc-org-icon {
    width: 16px; height: 16px;
    border-radius: 3px;
    background: #10b981;
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 9px; font-weight: 700;
    flex-shrink: 0;
}
/* Non-interactive workspace segment (local = "Local", linked = "Personal") */
.topbar-bc-fixed {
    cursor: default;
    color: var(--text-muted);
    opacity: 0.75;
}
.topbar-bc-fixed:hover { background: none; }

/* ── App breadcrumb — accessible <nav>/<ol>/<li> (AB#12574 / 12574/1/3) ───
   Only the app-segment portion carries breadcrumb semantics; the Org/WS/Space
   switchers above stay context buttons. Separators are CSS-generated (never
   real text nodes) so a screen reader reads the path, not "slash". */
.topbar-breadcrumb-nav {
    display: flex;
    align-items: center;
    min-width: 0;   /* allow the list to shrink instead of forcing page x-scroll */
}
/* No leading separator: since the W5.2 scope-rooted inversion the nav's first
   item IS the Org segment — inter-item separators below cover the whole trail. */
.topbar-breadcrumb-list {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    min-width: 0;
}
.topbar-bc-item {
    display: flex;
    align-items: center;
    min-width: 0;
}
/* Inter-crumb separators — CSS-generated on every crumb after the first. */
.topbar-bc-item + .topbar-bc-item::before {
    content: "/";
    color: var(--text-muted);
    opacity: 0.4;
    font-weight: 300;
    font-size: 14px;
    margin: 0 3px;
    flex-shrink: 0;
    pointer-events: none;
    user-select: none;
}
/* One crumb — link / text / current share the box; per-label ellipsis keeps a
   single long name (container / signal / mission) from blowing the layout even
   at shallow depth (§3.6 point 3). `title` (set in the render) is the tooltip. */
.topbar-bc-crumb {
    display: block;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 3px 6px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    color: var(--text-muted);
    transition: background 0.15s, color 0.15s;
}
/* Navigable parent crumbs are real <a href> — hover + visible focus ring. */
a.topbar-bc-crumb { cursor: pointer; }
a.topbar-bc-crumb:hover { background: var(--bg-hover); color: var(--text-primary); }
a.topbar-bc-crumb:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    color: var(--text-primary);
}
/* Current (last) crumb — non-clickable, emphasized. */
.topbar-bc-current {
    color: var(--text-primary);
    font-weight: 600;
    cursor: default;
}
/* Non-interactive intermediate (grouping / category) node. */
.topbar-bc-text { cursor: default; }

/* The scope prefix never collapses (W5.2), so its labels must be width-bounded
   or a long org/workspace name starves the app chain at any viewport. */
.topbar-bc-segment .topbar-bc-name { max-width: 140px; }

/* Narrow viewports: tighten per-label width so shallow chains still fit; the
   count-based overflow collapse (12574/1/7) handles deep chains. The current
   crumb keeps priority visibility there. The scope prefix shrinks too: tighter
   name clamp + the workspace role pill (decorative context) hides — without
   this, prefix + leaf overflow a 375px phone row (caught by the
   shell/breadcrumb.harness mobile check). */
@media (max-width: 640px) {
    .topbar-bc-crumb { max-width: 110px; }
    .topbar-bc-segment .topbar-bc-name { max-width: 64px; }
    .topbar-bc-current-role { display: none; }
    /* Org collapses to its icon (the title attribute keeps it labeled) —
       the workspace name is the load-bearing context at phone width. */
    #topbar-bc-org .topbar-bc-name,
    .topbar-bc-fixed .topbar-bc-name { display: none; }
}

/* ── Overflow / collapse (§3.6, 12574/1/7) ───────────────────────────────
   Count-based: the middle collapses behind an accessible `…` disclosure. */

/* Screen-reader-only hidden crumbs — keep the FULL path in the a11y tree while
   taking no layout space; non-focusable, so no invisible tab stop. */
.topbar-bc-sr {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.topbar-bc-overflow { position: relative; }

/* The `…` disclosure button — a control, not a crumb. */
.topbar-bc-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 4px;
    background: none;
    border: none;
    border-radius: 5px;
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.topbar-bc-ellipsis:hover { background: var(--bg-hover); color: var(--text-primary); }
.topbar-bc-ellipsis:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    color: var(--text-primary);
}

/* Popover listing the hidden crumbs as real navigable links. */
.topbar-bc-popover {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 40;
    min-width: 160px;
    max-width: 280px;
    max-height: 320px;
    overflow-y: auto;
    padding: 4px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.topbar-bc-popover[hidden] { display: none; }
.topbar-bc-popover-item {
    display: block;
    padding: 6px 10px;
    border-radius: 5px;
    font-size: 13px;
    color: var(--text-primary);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
a.topbar-bc-popover-item:hover { background: var(--bg-hover); }
a.topbar-bc-popover-item:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}
.topbar-bc-popover-text { color: var(--text-muted); cursor: default; }

/* No horizontal PAGE scroll on a deep chain / long label (§3.6 point 5): the
   count-based collapse bounds the crumb COUNT and per-label max-width+ellipsis
   bounds each crumb's WIDTH — so the row never grows unbounded. (We must NOT clip
   the nav itself with overflow:hidden — that would also clip the `…` popover, which
   drops below the bar.) */

/* ── Search bar ─────────────────────────────────── */
.topbar-search {
    width: 100%;
    max-width: 460px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    height: 24px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    transition: border-color 0.15s;
}
.topbar-search:hover { border-color: var(--text-muted); }
.topbar-search-text { flex: 1; text-align: left; }
.topbar-search-kbd {
    font-size: 11px;
    padding: 2px 6px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-muted);
    font-family: inherit;
    flex-shrink: 0;
}

/* ── Get Free Credits CTA button ────────────────── */
.topbar-signin {
    background: linear-gradient(90deg, #24CDFF, #ED1A77);
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 3px 12px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    transition: opacity 0.15s, filter 0.15s;
    white-space: nowrap;
    margin-right: 6px;
}
.topbar-signin:hover {
    opacity: 0.88;
    filter: brightness(1.08);
}

/* ── Credits widget ────────────────────────────── */
#credits-widget-mount {
    display: flex; align-items: center;
}

.credits-widget {
    background: none; border: none; cursor: pointer; padding: 4px 12px;
    color: var(--text-muted);
    display: flex; align-items: center; gap: 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
    user-select: none;
    height: 28px;
}

.credits-widget:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.credits-widget.good { color: #10b981; }
.credits-widget.low { color: #f59e0b; }
.credits-widget.empty { color: #ef4444; }
.credits-widget.error { color: #f59e0b; }
/* When user isn't signed in, the topbar's "Get Free Credits" CTA owns the
   call-to-action — hide the widget's signin state so we don't double up. */
.credits-widget.signin { display: none; }
.credits-widget.loading { opacity: 0.7; }

/* Shimmer fill used while credits are loading. Replaces the static
   em-dash placeholder so the loading state looks like an actual progress
   bar rather than a broken value. Width:100% so the gradient sweep covers
   the full bar; background-size:200% lets keyframes pan a wider gradient
   without clipping. */
.credits-bar-shimmer {
    width: 100%;
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.08) 0%,
        rgba(255, 255, 255, 0.25) 50%,
        rgba(255, 255, 255, 0.08) 100%
    );
    background-size: 200% 100%;
    animation: credits-shimmer 1.4s ease-in-out infinite;
}

@keyframes credits-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.credits-text {
    display: flex; align-items: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    white-space: nowrap;
    flex-shrink: 0;
}

.credits-bar {
    width: 80px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0;
}

.credits-bar-fill {
    height: 100%;
    background: currentColor;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.credits-amount {
    display: flex; align-items: center;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 32px;
}

/* ── User avatar ────────────────────────────────── */
.topbar-user {
    background: none; border: none; cursor: pointer; padding: 5px;
    color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}
.topbar-right .notif-charm:hover,
.topbar-user:hover { color: var(--text-primary); background: var(--bg-hover); }

/* ── Generic icon button (join workspace, etc.) ─── */
.topbar-icon-btn {
    background: none; border: none; cursor: pointer; padding: 4px 6px;
    color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}
.topbar-icon-btn:hover { color: var(--text-primary); background: var(--bg-hover); }
.topbar-assistant.active { color: var(--accent, var(--text-primary)); background: var(--bg-hover); }

/* ── Breadcrumb dropdown menus ──────────────────── */
.topbar-bc-menu {
    position: fixed;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.35);
    width: 240px;
    z-index: 500;
    padding: 8px;
    animation: topbar-menu-in 0.12s ease-out;
}
@keyframes topbar-menu-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.topbar-bc-menu-header {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 6px 10px;
}
.topbar-bc-menu-icon {
    width: 32px; height: 32px;
    border-radius: 6px;
    background: #10b981;
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700;
    flex-shrink: 0;
}
.topbar-bc-menu-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.topbar-bc-menu-meta { font-size: 11px; color: var(--text-muted); }
.topbar-bc-menu-separator { height: 1px; background: var(--border); margin: 4px 0; }
.topbar-bc-menu-label {
    font-size: 10px; font-weight: 500; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.05em;
    padding: 6px 8px 4px;
}
.topbar-bc-menu-item {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px; font-weight: 500;
    color: var(--text-primary);
    transition: background 0.1s;
}
.topbar-bc-menu-item:hover { background: var(--bg-hover); }
.topbar-bc-menu-item.active { background: rgba(255,255,255,0.04); }
.topbar-bc-menu-item-main {
    min-width: 0;
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 2px;
}
.topbar-bc-menu-role {
    width: fit-content;
    border-radius: 999px;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-muted);
    background: rgba(255,255,255,0.06);
}
.topbar-bc-menu-role-member {
    color: #67e8f9;
    background: rgba(6,182,212,0.13);
}
.topbar-bc-current-role {
    border-radius: 999px;
    padding: 1px 6px;
    font-size: 9px;
    font-weight: 650;
    line-height: 1.35;
    letter-spacing: 0.02em;
    color: var(--text-muted);
    background: rgba(255,255,255,0.06);
}
.topbar-bc-current-role-member {
    color: #67e8f9;
    background: rgba(6,182,212,0.13);
}
.topbar-bc-current-role-owner {
    color: #c4b5fd;
    background: rgba(139,92,246,0.15);
}
.topbar-bc-menu-check { margin-left: auto; color: var(--accent); font-size: 13px; }
.topbar-bc-menu-create { color: var(--text-muted); }
.topbar-bc-menu-create:hover { color: var(--text-primary); }
/* Space-lifecycle rows (12573/06): a label that takes the row so the trailing
   trash / restore / purge affordances sit at the right, hover/focus-revealed. */
.topbar-bc-menu-item-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-bc-menu-row-action {
    flex: 0 0 auto; margin-left: 4px;
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; padding: 0;
    border: none; border-radius: 4px; background: transparent;
    color: var(--text-muted); cursor: pointer; opacity: 0;
    transition: opacity 0.1s, background 0.1s, color 0.1s;
}
.topbar-bc-menu-item:hover .topbar-bc-menu-row-action,
.topbar-bc-menu-item:focus-within .topbar-bc-menu-row-action { opacity: 1; }
.topbar-bc-menu-row-action:hover { background: var(--bg-surface); color: var(--text-primary); }
.topbar-bc-menu-row-action:focus-visible { opacity: 1; outline: 2px solid var(--accent); outline-offset: -1px; }
.topbar-bc-menu-row-action.danger:hover { color: var(--danger, #ef4444); }
/* Trashed spaces read as muted, non-switchable rows; their actions stay visible. */
.topbar-bc-menu-item--trashed { color: var(--text-muted); cursor: default; }
.topbar-bc-menu-item--trashed:hover { background: transparent; }
.topbar-bc-menu-item--trashed .topbar-bc-menu-row-action { opacity: 1; }
/* §6 gate: a blocked "+ new" stays VISIBLE but reads as locked (dimmed + lock
   icon). It remains clickable — the click opens the sign-in invite, not a create.
   Dimming conveys "blocked" without relying on color alone (the lock icon +
   title carry the same meaning). */
.topbar-bc-menu-item.topbar-bc-menu-locked { opacity: 0.55; }
.topbar-bc-menu-item.topbar-bc-menu-locked:hover { opacity: 0.8; background: var(--bg-hover); }
/* §4 inline create/rename field. When a row is editing, drop the flex
   row layout so the field + error stack. */
.topbar-bc-menu-create.editing,
.topbar-bc-menu-item.editing { display: block; cursor: default; background: none; }
.topbar-bc-menu-create.editing:hover,
.topbar-bc-menu-item.editing:hover { background: none; }
/* §5 space name takes the row's free width; the check + rename pencil sit at the
   trailing edge. min-width:0 lets a long name ellipsize instead of shoving the
   pencil off-row. */
.topbar-bc-menu-item-name {
    flex: 1 1 auto; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* §5 per-row rename affordance (pencil). Subtle at rest, clearer on row hover;
   never steals the row's own click (the button carries data-action="rename-space",
   the innermost [data-action], so the handler renames instead of switching). */
.topbar-bc-row-rename {
    flex: 0 0 auto;
    width: 22px; height: 22px;
    display: inline-flex; align-items: center; justify-content: center;
    border: none; border-radius: 5px;
    background: transparent; color: var(--text-muted);
    cursor: pointer; opacity: 0.45;
    transition: opacity 0.1s, background 0.1s, color 0.1s;
}
.topbar-bc-menu-item:hover .topbar-bc-row-rename { opacity: 0.8; }
.topbar-bc-row-rename:hover { opacity: 1; background: var(--bg-hover); color: var(--text-primary); }
/* §6 gate: a blocked rename pencil stays visible but reads as locked (dimmed);
   the click opens the sign-in invite rather than the field. */
.topbar-bc-row-rename-locked, .topbar-bc-row-rename-locked:hover { opacity: 0.35; background: transparent; color: var(--text-muted); }
.topbar-bc-inline { display: flex; align-items: center; gap: 4px; }
.topbar-bc-inline-input {
    flex: 1 1 auto; min-width: 0;
    padding: 5px 7px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--bg-input, var(--bg-elevated, rgba(255,255,255,0.04)));
    color: var(--text-primary);
    font-size: 13px;
}
.topbar-bc-inline-input:focus { outline: none; border-color: var(--accent); }
.topbar-bc-inline-btn {
    flex: 0 0 auto;
    width: 24px; height: 24px;
    display: inline-flex; align-items: center; justify-content: center;
    border: none; border-radius: 5px;
    background: transparent; color: var(--text-muted);
    cursor: pointer; font-size: 12px;
}
.topbar-bc-inline-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.topbar-bc-inline-btn:disabled { opacity: 0.5; cursor: default; }
.topbar-bc-inline-error {
    margin-top: 4px; padding: 0 2px;
    color: var(--danger, #e5534b);
    font-size: 11px; font-weight: 500;
}
.topbar-bc-menu-body { max-height: 280px; overflow-y: auto; }
.topbar-bc-menu-loading { padding: 10px 8px; color: var(--text-muted); font-size: 13px; }
.topbar-bc-menu-empty { padding: 8px 8px; color: var(--text-muted); font-size: 13px; font-style: italic; }
/* Space status indicator (§3). Collapsed chip → the dot; open selector → the
   first-letter square. Both are status-colored; "ok" (green) is the only level
   today and is the base color. A real source (sync) adds levels by adding
   [data-status="syncing"]/[data-status="error"] rules here — plus a distinct
   shape/icon so status is never conveyed by color alone (§3 a11y). */
.topbar-bc-space-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
    background: var(--status-ok);
}
.topbar-bc-space-avatar {
    width: 20px; height: 20px; border-radius: 4px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; color: #fff; text-transform: uppercase;
    line-height: 1; background: var(--status-ok);
}
/* No status animation today; when a future level pulses, honor reduced-motion. */
@media (prefers-reduced-motion: reduce) {
    .topbar-bc-space-dot, .topbar-bc-space-avatar { animation: none; }
}

/* ── Unified search/AI/command modal ─────────────── */
.usearch-overlay {
    position: fixed; inset: 0; z-index: 600;
    background: rgba(0,0,0,0.5);
    display: flex; align-items: flex-start; justify-content: center;
    padding-top: 60px;
}
.usearch-dialog {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 640px; max-width: 90vw;
    box-shadow: 0 16px 48px rgba(0,0,0,0.4);
    overflow: hidden;
    display: flex; flex-direction: column;
    max-height: 70vh;
}
.usearch-input-row {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px; border-bottom: 1px solid var(--border);
}
.usearch-mode-badge {
    font-size: 11px; font-weight: 600;
    padding: 2px 8px; border-radius: 4px;
    background: var(--bg-surface); color: var(--text-muted);
    flex-shrink: 0; white-space: nowrap;
}
.usearch-mode-ai { background: rgba(168,85,247,0.15); color: #a855f7; }
.usearch-mode-command { background: rgba(59,130,246,0.15); color: #3b82f6; }
.usearch-input {
    flex: 1; border: none; background: none;
    color: var(--text-primary); font-size: 15px;
    outline: none; font-family: inherit;
}
.usearch-input::placeholder { color: var(--text-muted); }
.usearch-input:disabled { opacity: 0.5; }
.usearch-ai-btn {
    background: none; border: 1px solid rgba(168,85,247,0.3);
    color: #a855f7; padding: 3px 10px; border-radius: 6px;
    font-size: 12px; font-weight: 500; cursor: pointer;
    white-space: nowrap; transition: all 0.15s;
}
.usearch-ai-btn:hover { background: rgba(168,85,247,0.1); }
.usearch-tabs {
    display: flex; gap: 4px;
    padding: 6px 16px;
    border-bottom: 1px solid var(--border);
}
.usearch-tab {
    padding: 4px 12px; border-radius: 6px;
    border: none; background: none;
    color: var(--text-muted); font-size: 13px;
    cursor: pointer; transition: all 0.1s;
}
.usearch-tab:hover { color: var(--text-primary); }
.usearch-tab.active { background: var(--bg-surface); color: var(--text-primary); font-weight: 500; }
.usearch-results {
    flex: 1; overflow-y: auto;
    padding: 8px; min-height: 180px;
}
.usearch-hint {
    color: var(--text-muted); font-size: 14px;
    text-align: center; padding: 40px 0;
}
.usearch-footer {
    display: flex; align-items: center;
    padding: 8px 16px;
    border-top: 1px solid var(--border);
    font-size: 12px; color: var(--text-muted);
}
.usearch-footer kbd {
    padding: 1px 5px; border: 1px solid var(--border);
    border-radius: 3px; font-size: 11px; margin: 0 2px;
}

/* Search results */
.usearch-result-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: 8px;
    cursor: pointer; transition: background 0.1s;
}
.usearch-result-item:hover { background: var(--bg-hover); }
.usearch-result-icon { font-size: 16px; flex-shrink: 0; }
.usearch-result-name { font-size: 14px; color: var(--text-primary); }
.usearch-result-meta { font-size: 12px; color: var(--text-muted); }

/* Command items */
.usearch-section-label {
    font-size: 11px; font-weight: 500; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.05em;
    padding: 8px 10px 4px;
}
.usearch-cmd-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: 8px;
    cursor: pointer; transition: background 0.1s;
}
.usearch-cmd-item:hover { background: var(--bg-hover); }
.usearch-cmd-icon { font-size: 16px; flex-shrink: 0; }
.usearch-cmd-name { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.usearch-cmd-desc { font-size: 12px; color: var(--text-muted); }

/* AI mini-chat */
.usearch-ai-exchange { padding: 8px; }
.usearch-ai-user {
    font-size: 14px; color: var(--text-primary);
    padding: 8px 12px; background: var(--bg-surface);
    border-radius: 8px; margin-bottom: 12px;
}
.usearch-ai-response {
    font-size: 14px; line-height: 1.6;
    color: var(--text-primary);
    padding: 0 4px;
}
.usearch-ai-response p { margin: 6px 0; }
.usearch-ai-response code { background: rgba(255,255,255,0.06); padding: 2px 5px; border-radius: 4px; font-size: 13px; }
.usearch-ai-response pre { background: #09090b; border-radius: 8px; padding: 12px; margin: 8px 0; overflow-x: auto; }
.usearch-ai-response pre code { background: none; padding: 0; }
.usearch-ai-thinking {
    color: var(--text-muted); font-style: italic; font-size: 13px;
    padding: 12px 0;
    animation: usearch-pulse 1.5s ease-in-out infinite;
}
@keyframes usearch-pulse { 0%,100%{ opacity:1; } 50%{ opacity:0.4; } }
.usearch-ai-error { color: #f87171; font-size: 13px; padding: 8px 0; }
.usearch-ai-actions {
    display: flex; justify-content: flex-end;
    margin-top: 12px; padding-top: 8px;
    border-top: 1px solid var(--border);
}
.usearch-ai-open-chat {
    background: none; border: 1px solid var(--border);
    color: var(--text-secondary); padding: 6px 14px;
    border-radius: 6px; font-size: 13px; cursor: pointer;
    transition: all 0.15s;
}
.usearch-ai-open-chat:hover { border-color: var(--accent); color: var(--accent); }

/* Responsive rules for top bar are in core.css alongside other shell breakpoints */

/* ════════════════════════════════════════════════════
   Modal Animations
   ════════════════════════════════════════════════════ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── ⌘K scope toggle + workspace chips + Ask-Lani row (spec-v2 §D) ── */
.usearch-scope {
    display: inline-flex;
    gap: 3px;
    margin-left: auto;
    padding: 3px;
    border-radius: 9px;
    background: var(--bg-hover, rgba(255, 255, 255, 0.05));
}
.usearch-scope-btn {
    border: none;
    background: transparent;
    color: var(--text-secondary, #9ca3af);
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 7px;
    cursor: pointer;
}
.usearch-scope-btn.active {
    background: rgba(59, 130, 246, 0.22);
    color: var(--text-primary, #fff);
}
.usearch-result-chip {
    flex: 0 0 auto;
    align-self: center;
    margin-left: 8px;
    padding: 2px 9px;
    border-radius: 999px;
    border: 1px solid rgba(59, 130, 246, 0.35);
    background: rgba(59, 130, 246, 0.1);
    color: var(--text-secondary, #9ca3af);
    font-size: 11px;
}
/* Dense comprehension-artifact count on any Sanity card hit. */
.usearch-artifacts {
    flex: 0 0 auto;
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 8px;
    font-size: 10.5px;
    color: #b9a6ff;
    border: 1px solid rgba(139, 108, 255, 0.35);
    border-radius: 6px;
    padding: 3px 7px;
    white-space: nowrap;
}
.usearch-artifacts-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #8b6cff;
}
.usearch-ask-lani {
    border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    margin-top: 6px;
    cursor: pointer;
}
.usearch-ask-lani .usearch-result-icon { color: #8b6cff; }
