/* ---------------------------------------------------------------------------
   HUB COMMAND SURFACE — Slice 2.0-redo, pass-2 (terminal-press dark)
   Hub.md §11. Six tiles + a search bar. No artifact lists.

   Aesthetic continuity with the homepage (terminal-press dark on
   Content/public/home-terminal-press.css). Same palette tokens,
   same publication primitives (masthead, kicker, strip dividers,
   live chip), same display + mono font stack. The Hub is a
   continuation of the brand surface, not a separate admin shell.

   Lifted from Views/GraphSqlPro/Index.cshtml inline <style> block
   in slice 2.2.5 (mechanical extraction, zero behavior change).
   --------------------------------------------------------------------------- */

:root {
    /* Terminal-press palette — mirrors body.htp on the homepage */
    --hs-bg: #0a0a0a;          /* dark background — was the homepage's --hs-ink */
    --hs-surface: #141414;     /* tile / panel surface */
    --hs-surface-2: #1c1c1c;   /* hover / nested surface */
    --hs-ink: #fafafa;          /* primary text */
    --hs-ink-soft: #a3a3a3;    /* secondary text */
    --hs-ink-muted: #525252;   /* tertiary / borders */
    --hs-border: #262626;
    --hs-border-strong: #3a3a3a;

    /* Signal palette — locked against homepage */
    --hs-accent: #0048BA;        /* Absolute Zero blue — GRAPH / logic */
    --hs-accent-2: #1d5dd9;      /* hover variant */
    --hs-accent-good: #16a34a;   /* Emerald — DATASET / action / OK */
    --hs-signal: #F5A300;        /* Amber — needs attention / warning */
    --hs-accent-probe: #8b5cf6;  /* Violet — Analyst, the agentic probe (app identity) */
    --hs-accent-data: #06b6d4;   /* Cyan — Connections, the data-source layer (resting identity) */

    --hs-font-body: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --hs-font-mono: "Space Mono", "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
    --hs-font-display: "Space Grotesk", sans-serif;
}

body.hub-shell {
    margin: 0;
    background: var(--hs-bg);
    color: var(--hs-ink);
    font-family: var(--hs-font-body);
    min-height: 100vh;
    display: flex; flex-direction: column;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
body.hub-shell *,
body.hub-shell *::before,
body.hub-shell *::after { box-sizing: border-box; }
body.hub-shell a { color: inherit; text-decoration: none; }

/* ── Live ribbon: thin amber pulse + mono context, top of page ── */
.hub-ribbon {
    display: flex; align-items: stretch;
    background: var(--hs-bg);
    border-bottom: 1px solid var(--hs-border);
    font-family: var(--hs-font-mono);
    font-size: 10px;
}
.hub-ribbon .ribbon-live {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 16px;
    background: var(--hs-signal); color: #0a0a0a;
    font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
}
.hub-ribbon .ribbon-live .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: #0a0a0a;
    animation: hub-pulse 1.4s ease-in-out infinite;
}
@keyframes hub-pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
.hub-ribbon .ribbon-context {
    display: inline-flex; align-items: center; gap: 14px;
    padding: 6px 18px;
    color: var(--hs-ink-muted);
    font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
    flex: 1; min-width: 0;
}
.hub-ribbon .ribbon-context .ctx-key { color: var(--hs-ink-soft); font-weight: 700; }
.hub-ribbon .ribbon-context .ctx-val { color: var(--hs-ink); font-weight: 400; letter-spacing: 0.02em; text-transform: none; }
.hub-ribbon .ribbon-context .sep { color: var(--hs-ink-muted); }

/* ── Masthead: brand line + tenant edition + identity cluster ── */
.hub-masthead {
    display: flex; align-items: stretch; justify-content: space-between;
    gap: 32px;
    padding: 14px 32px;
    border-bottom: 1px solid var(--hs-border);
    background: var(--hs-bg);
    font-family: var(--hs-font-mono);
}
.hub-masthead .brand {
    display: inline-flex; align-items: baseline; gap: 10px;
    font-size: 13px; font-weight: 700; letter-spacing: 0.10em; text-transform: uppercase;
    color: var(--hs-ink);
}
.hub-masthead .brand .slash { color: var(--hs-ink-muted); font-weight: 400; }
.hub-masthead .brand .accent { color: var(--hs-accent); }
.hub-masthead .brand .ver {
    font-size: 10px; font-weight: 700; letter-spacing: 0.12em;
    color: var(--hs-ink-muted);
    margin-left: 6px;
}
.hub-masthead .id-cluster {
    display: inline-flex; align-items: center; gap: 14px;
    font-family: var(--hs-font-mono);
    font-size: 11px; font-weight: 700; letter-spacing: 0.10em; text-transform: uppercase;
}
.hub-masthead .id-cluster .id-user {
    display: inline-flex; align-items: center; gap: 8px;
    color: var(--hs-ink-soft);
    font-weight: 400; letter-spacing: 0.02em; text-transform: none;
    font-size: 12px;
    max-width: 220px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hub-masthead .id-cluster .id-user .id-avatar {
    width: 22px; height: 22px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--hs-surface); border: 1px solid var(--hs-border-strong);
    font-family: var(--hs-font-mono); font-size: 10px; font-weight: 700;
    color: var(--hs-ink); flex-shrink: 0;
    text-transform: uppercase; letter-spacing: 0;
}
.hub-masthead .id-cluster a {
    color: var(--hs-ink-soft);
    transition: color 120ms ease-out;
    padding: 4px 0;
}
.hub-masthead .id-cluster a:hover { color: var(--hs-accent); }
.hub-masthead .id-cluster .id-sep { width: 1px; height: 14px; background: var(--hs-border-strong); }

/* ── Strip divider — five colored bars, signature homepage motif ── */
.hub-strip { display: flex; height: 4px; }
.hub-strip .s1 { flex: 3; background: var(--hs-accent); }
.hub-strip .s2 { flex: 2; background: var(--hs-signal); }
.hub-strip .s3 { flex: 1; background: var(--hs-ink); }
.hub-strip .s4 { flex: 4; background: var(--hs-border); }
.hub-strip .s5 { flex: 1; background: var(--hs-accent-good); }

/* ── Main canvas ─────────────────────────────────────────────── */
#hub-main {
    flex: 1 0 auto;
    width: 100%; max-width: 1200px; margin: 0 auto;
    padding: 32px 32px 28px;
    display: flex; flex-direction: column; gap: 28px;
}

/* ── Welcome line — eyebrow + display heading, sits above search ─ */
.hub-welcome {
    display: flex; flex-direction: column; gap: 8px;
    margin-bottom: 4px;
}
.hub-welcome .eyebrow {
    display: inline-flex; align-items: center; gap: 10px;
    font-family: var(--hs-font-mono);
    font-size: 10px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
    color: var(--hs-accent);
}
.hub-welcome .eyebrow::before,
.hub-welcome .eyebrow::after {
    content: ''; display: inline-block;
    width: 24px; height: 1px;
    background: var(--hs-accent);
}
.hub-welcome h1 {
    margin: 0;
    font-family: var(--hs-font-display);
    font-size: clamp(22px, 1.6vw + 14px, 30px);
    font-weight: 700; letter-spacing: -0.025em; line-height: 1.1;
    color: var(--hs-ink);
}
.hub-welcome h1 .accent { color: var(--hs-accent); }
.hub-welcome .lede {
    font-size: 13px; color: var(--hs-ink-soft); line-height: 1.55;
    max-width: 620px;
}

/* ── Newcomer orientation strip (section 14) ──────────────────────────
   Self-retiring zero-state only (gated server-side on the three counts in
   Index.cshtml). Two honest tracks: Track A "Try it now" (the Sample is
   live), Track B "Your data" (connect-first three steps). Dense, ink-soft,
   hairline — the same terminal-press idiom as the rest of the Hub. No
   transforms, no marketing weight. Sits between the welcome lede and the
   search bar. */
.hub-orient {
    display: flex; flex-direction: column; gap: 10px;
    padding: 14px 16px;
    background: var(--hs-surface);
    border: 1px solid var(--hs-border);
    border-left: 2px solid var(--hs-accent-good);
}
.hub-orient .orient-line {
    display: flex; align-items: baseline; flex-wrap: wrap;
    gap: 10px;
    font-size: 12px; line-height: 1.5;
    color: var(--hs-ink-soft);
}
.hub-orient .orient-tag {
    flex-shrink: 0;
    font-family: var(--hs-font-mono);
    font-size: 9px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
    padding: 2px 8px;
    border: 1px solid var(--hs-border-strong);
    color: var(--hs-ink-soft);
}
.hub-orient .orient-try .orient-tag {
    color: var(--hs-accent-good);
    border-color: var(--hs-accent-good);
}
.hub-orient .orient-steps .orient-tag {
    color: var(--hs-accent);
    border-color: var(--hs-accent);
}
.hub-orient .orient-text { color: var(--hs-ink-soft); }

/* The two live affordances — quiet inline links, accent on hover, no button chrome. */
.hub-orient .orient-link {
    display: inline-flex; align-items: center; gap: 5px;
    color: var(--hs-ink);
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px solid var(--hs-border-strong);
    transition: color 120ms ease-out, border-color 120ms ease-out;
    cursor: pointer;
}
.hub-orient .orient-try .orient-link:hover {
    color: var(--hs-accent-good);
    border-bottom-color: var(--hs-accent-good);
}
.hub-orient .orient-link .arrow-glyph {
    font-size: 12px; color: var(--hs-ink-muted);
    transition: color 120ms ease-out;
}
.hub-orient .orient-try .orient-link:hover .arrow-glyph { color: var(--hs-accent-good); }

/* Track B — the three connect-first steps. */
.hub-orient .orient-steps-list {
    display: inline-flex; align-items: center; flex-wrap: wrap;
    gap: 8px;
}
.hub-orient .orient-step {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--hs-ink-soft);
    text-decoration: none;
}
.hub-orient .orient-step .step-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; flex-shrink: 0;
    font-family: var(--hs-font-mono);
    font-size: 9px; font-weight: 700;
    color: var(--hs-ink-muted);
    border: 1px solid var(--hs-border-strong);
}
/* Step 1 is the live "Connect a database" affordance — accent the numeral. */
.hub-orient a.orient-step { color: var(--hs-ink); font-weight: 700; cursor: pointer; }
.hub-orient a.orient-step .step-num { color: var(--hs-accent); border-color: var(--hs-accent); }
.hub-orient a.orient-step:hover { color: var(--hs-accent); }
.hub-orient a.orient-step.orient-link { border-bottom: 0; }
.hub-orient .step-arrow {
    color: var(--hs-ink-muted);
    font-size: 11px;
    user-select: none;
}

/* ── Section kicker — used above each tile row ───────────────── */
.hub-kicker {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 12px; margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--hs-border);
}
.hub-kicker .k-tag {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 3px 9px;
    background: var(--hs-accent); color: #ffffff;
    font-family: var(--hs-font-mono);
    font-size: 9px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
}
.hub-kicker.kicker-good .k-tag { background: var(--hs-accent-good); }
.hub-kicker.kicker-soft .k-tag { background: var(--hs-surface); color: var(--hs-ink-soft); border: 1px solid var(--hs-border-strong); }
.hub-kicker .k-title {
    font-family: var(--hs-font-mono);
    font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--hs-ink-soft);
}
.hub-kicker .k-rule {
    flex: 1; height: 1px;
    background: linear-gradient(90deg, var(--hs-border) 0%, transparent 100%);
}

/* ── Search bar — terminal input, premium quiet ─────────────── */
/* ── Clear button injected by hub-search.js when input has content ──
   Sits in the row between the input and the meta column. Posture matches
   the meta column itself (mono-caps, ink-muted, no border, no background)
   so it reads as part of the FIND chrome, not as a new control. The label
   is "clear" rather than the brighter `×` glyph — the word is calmer in
   the dark surface and matches the `FIND` prompt's typography. */
.hub-search-clear {
    display: none; /* .is-visible flips to inline-flex */
    align-items: center;
    justify-content: center;
    align-self: stretch;
    padding: 0 12px;
    margin: 0;
    background: transparent;
    border: 0;
    border-left: 1px solid var(--hs-border);
    color: var(--hs-ink-muted);
    font-family: var(--hs-font-mono);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    transition: color 120ms ease, background 120ms ease;
}
.hub-search-clear.is-visible { display: inline-flex; }
.hub-search-clear:hover,
.hub-search-clear:focus-visible {
    color: var(--hs-ink);
    background: var(--hs-surface-2);
    outline: none;
}

.hub-search {
    position: relative;
    display: flex; align-items: stretch;
    background: var(--hs-surface);
    border: 1px solid var(--hs-border-strong);
    transition: border-color 150ms ease-out, background 150ms ease-out;
}
.hub-search:focus-within {
    border-color: var(--hs-accent);
    background: var(--hs-surface-2);
}
.hub-search .search-prompt {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 0 14px;
    font-family: var(--hs-font-mono);
    font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--hs-accent);
    user-select: none;
    border-right: 1px solid var(--hs-border-strong);
}
.hub-search input.search-input {
    flex: 1 1 auto; min-width: 0;
    border: 0; outline: 0; background: transparent;
    padding: 14px 16px;
    font-family: var(--hs-font-mono);
    font-size: 13px; color: var(--hs-ink);
    letter-spacing: 0.01em;
}
.hub-search input.search-input::placeholder {
    color: var(--hs-ink-muted);
    font-style: normal;
}
.hub-search input.search-input:disabled { cursor: default; }
.hub-search .search-meta {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 0 14px;
    font-family: var(--hs-font-mono);
    font-size: 9px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--hs-ink-muted);
    border-left: 1px solid var(--hs-border);
    user-select: none;
}
.hub-search .search-meta .caret {
    display: inline-block; width: 1px; height: 11px;
    background: var(--hs-accent);
    animation: hub-caret 1.0s steps(2) infinite;
}
@keyframes hub-caret { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }

/* ── Tile rows — three columns at 1200px, fold at 720px ──────── */
.hub-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.hub-row.hub-row-utility { grid-template-columns: repeat(3, 1fr); max-width: 720px; }

/* ── Tile primitive ──────────────────────────────────────────── */
.hub-tile {
    position: relative;
    display: flex; flex-direction: column;
    min-height: 154px;
    padding: 16px 18px 14px;
    background: var(--hs-surface);
    border: 1px solid var(--hs-border-strong);
    cursor: pointer;
    text-decoration: none; color: inherit;
    transition: background 150ms ease-out, border-color 150ms ease-out;
    overflow: hidden;
}
.hub-tile::before {
    /* Subtle corner mark — top-right small triangle, very low contrast */
    content: '';
    position: absolute; top: 0; right: 0;
    width: 0; height: 0;
    border-left: 14px solid transparent;
    border-top: 14px solid var(--hs-border);
    transition: border-top-color 150ms ease-out;
}
.hub-tile:hover {
    background: var(--hs-surface-2);
    border-color: var(--hs-accent);
}
.hub-tile:hover::before { border-top-color: var(--hs-accent); }
.hub-tile:focus-visible {
    outline: 2px solid var(--hs-accent);
    outline-offset: -1px;
}
/* Accent bottom rail — primary signal of tile category */
.hub-tile::after {
    content: "";
    position: absolute; left: 0; right: 0; bottom: 0;
    height: 2px; background: transparent; opacity: 0.55;
    transition: opacity 150ms ease-out, height 150ms ease-out;
}
.hub-tile:hover::after { opacity: 1; height: 3px; }
.hub-tile.rail-graph::after { background: var(--hs-accent); }
.hub-tile.rail-good::after { background: var(--hs-accent-good); }
.hub-tile.rail-probe::after { background: var(--hs-accent-probe); }
.hub-tile.rail-data::after { background: var(--hs-accent-data); }
.hub-tile.rail-soft::after { background: var(--hs-ink-muted); opacity: 0.35; }
.hub-tile.rail-soft:hover::after { opacity: 0.7; }
.hub-tile.rail-signal::after { background: var(--hs-signal); }

.hub-tile .tile-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; margin-bottom: 14px;
}
.hub-tile .tile-label {
    font-family: var(--hs-font-mono);
    font-size: 10px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
    color: var(--hs-ink);
}
.hub-tile.rail-graph .tile-label { color: var(--hs-accent); }
.hub-tile.rail-good .tile-label { color: var(--hs-accent-good); }
.hub-tile.rail-probe .tile-label { color: var(--hs-accent-probe); }
.hub-tile.rail-data .tile-label { color: var(--hs-accent-data); }
.hub-tile.rail-signal .tile-label { color: var(--hs-signal); }
.hub-tile.rail-soft .tile-label { color: var(--hs-ink-soft); }

.hub-tile .tile-glyph {
    font-family: var(--hs-font-mono);
    font-size: 10px; font-weight: 700; letter-spacing: 0.10em;
    color: var(--hs-ink-muted);
}

/* Workspace app-tile icon — replaces the old 01/02/03 ordinal glyph in the
   top-right of the tile head. Sits where .tile-glyph did (the .tile-head
   space-between anchors it to the corner). Sized fluidly so it reads premium
   from phone to desktop; object-fit keeps any aspect ratio / transparency
   intact. Lift + brighten slightly on tile hover for a tactile cue. */
.hub-tile .tile-icon {
    display: block;
    width: clamp(36px, 6.5vw, 52px);
    height: clamp(36px, 6.5vw, 52px);
    object-fit: contain;
    opacity: 0.9;
    transition: opacity 0.18s ease, transform 0.18s ease;
}
.hub-tile:hover .tile-icon {
    opacity: 1;
    transform: scale(1.05);
}


/* Artifact tiles — large display count + signal pip */
.hub-tile.tile-artifact .tile-value {
    font-family: var(--hs-font-mono);
    font-size: 38px; font-weight: 700; letter-spacing: -0.025em; line-height: 1;
    color: var(--hs-ink);
    display: flex; align-items: baseline; gap: 10px;
}
.hub-tile.tile-artifact .tile-value .v-num { letter-spacing: -0.03em; }
.hub-tile.tile-artifact .tile-value .v-unit {
    font-family: var(--hs-font-mono);
    font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--hs-ink-muted);
}
.hub-tile.tile-artifact .tile-pip {
    margin-top: 8px;
    display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--hs-font-mono);
    font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
    color: var(--hs-ink-soft);
}
.hub-tile.tile-artifact .tile-pip .pip-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--hs-ink-muted);
    display: inline-block;
}
.hub-tile.tile-artifact .tile-pip.pip-good { color: var(--hs-accent-good); }
.hub-tile.tile-artifact .tile-pip.pip-good .pip-dot { background: var(--hs-accent-good); }
.hub-tile.tile-artifact .tile-pip.pip-attn { color: var(--hs-signal); }
.hub-tile.tile-artifact .tile-pip.pip-attn .pip-dot {
    background: var(--hs-signal);
    animation: hub-pulse 1.6s ease-in-out infinite;
}

/* Workspace tiles — app name first, verb subtitle, lede description */
.hub-tile.tile-workspace .tile-name {
    font-family: var(--hs-font-display);
    font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1;
    color: var(--hs-ink);
    margin-bottom: 4px;
}
.hub-tile.tile-workspace .tile-verb {
    font-family: var(--hs-font-mono);
    font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--hs-ink-soft);
    margin-bottom: 10px;
}
.hub-tile.tile-workspace.rail-graph .tile-verb { color: var(--hs-accent); }
.hub-tile.tile-workspace.rail-good .tile-verb { color: var(--hs-accent-good); }
.hub-tile.tile-workspace.rail-probe .tile-verb { color: var(--hs-accent-probe); }
.hub-tile.tile-workspace .tile-sub {
    font-size: 12px; line-height: 1.5;
    color: var(--hs-ink-soft);
}

/* Utility tiles — small, quieter */
.hub-row-utility .hub-tile {
    min-height: 108px;
    padding: 14px 16px 12px;
}
.hub-row-utility .hub-tile .tile-value {
    font-family: var(--hs-font-mono);
    font-size: 18px; font-weight: 700; letter-spacing: -0.01em;
    color: var(--hs-ink);
}
.hub-row-utility .hub-tile .tile-sub {
    margin-top: 4px;
    font-family: var(--hs-font-body);
    font-size: 11px; color: var(--hs-ink-soft);
    line-height: 1.45;
}

/* ── tile-action — bottom-anchored "open ↗" footer ───────────── */
.hub-tile .tile-action {
    margin-top: auto; padding-top: 12px;
    display: inline-flex; align-items: center; justify-content: space-between;
    gap: 8px;
    font-family: var(--hs-font-mono);
    font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--hs-ink-soft);
    transition: color 150ms ease-out;
}
.hub-tile:hover .tile-action { color: var(--hs-ink); }
.hub-tile .tile-action .arrow-glyph {
    font-size: 12px; color: var(--hs-ink-muted);
    transition: color 150ms ease-out, transform 150ms ease-out;
}
.hub-tile:hover .tile-action .arrow-glyph {
    color: var(--hs-accent);
    transform: translate(2px, -2px);
}
.hub-tile.rail-good:hover .tile-action .arrow-glyph { color: var(--hs-accent-good); }
.hub-tile.rail-probe:hover .tile-action .arrow-glyph { color: var(--hs-accent-probe); }
.hub-tile.rail-data:hover .tile-action .arrow-glyph { color: var(--hs-accent-data); }
.hub-tile.rail-signal:hover .tile-action .arrow-glyph { color: var(--hs-signal); }

/* ── MFA pill — thin amber strip below utility row ───────────── */
.hub-mfa {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
    padding: 10px 16px;
    background: rgba(245, 163, 0, 0.08);
    border: 1px solid rgba(245, 163, 0, 0.35);
    border-left: 3px solid var(--hs-signal);
    font-size: 12px; color: var(--hs-ink-soft); line-height: 1.4;
}
.hub-mfa.hidden { display: none; }
.hub-mfa .mfa-text { flex: 1; }
.hub-mfa .mfa-text .mfa-tag {
    display: inline-block; margin-right: 8px;
    padding: 2px 8px;
    background: var(--hs-signal); color: #0a0a0a;
    font-family: var(--hs-font-mono);
    font-size: 9px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
}
.hub-mfa a {
    color: var(--hs-signal); font-weight: 700;
    border-bottom: 1px solid rgba(245, 163, 0, 0.4);
}
.hub-mfa a:hover {
    color: #ffffff; border-bottom-color: #ffffff;
}
.hub-mfa .mfa-dismiss {
    background: transparent; border: 1px solid var(--hs-border-strong);
    color: var(--hs-ink-muted);
    font-family: var(--hs-font-mono);
    font-size: 9px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
    padding: 5px 10px; cursor: pointer;
    transition: color 150ms ease-out, border-color 150ms ease-out;
}
.hub-mfa .mfa-dismiss:hover { color: var(--hs-ink); border-color: var(--hs-ink); }

/* ── Sign-in fallback for unauthenticated visitors ───────────── */
.hub-signin-card {
    padding: 36px 40px;
    background: var(--hs-surface);
    border: 1px solid var(--hs-border-strong);
    display: flex; flex-direction: column; gap: 16px;
    max-width: 560px; margin: 32px auto;
}
.hub-signin-card .eyebrow {
    font-family: var(--hs-font-mono);
    font-size: 10px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
    color: var(--hs-accent);
}
.hub-signin-card h2 {
    margin: 0;
    font-family: var(--hs-font-display);
    font-size: 24px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15;
    color: var(--hs-ink);
}
.hub-signin-card p {
    margin: 0;
    font-size: 13px; color: var(--hs-ink-soft); line-height: 1.6;
}
.hub-signin-card a.signin-btn {
    display: inline-flex; align-items: center; gap: 8px;
    align-self: flex-start;
    padding: 12px 22px;
    background: var(--hs-accent); color: #ffffff;
    font-family: var(--hs-font-mono);
    font-size: 11px; font-weight: 700; letter-spacing: 0.10em; text-transform: uppercase;
    border: 2px solid var(--hs-accent);
    transition: background 150ms ease-out, border-color 150ms ease-out, color 150ms ease-out;
}
.hub-signin-card a.signin-btn:hover {
    background: transparent;
    color: var(--hs-accent);
}

/* ── Footer ──────────────────────────────────────────────────── */
.hub-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 32px;
    border-top: 1px solid var(--hs-border);
    background: var(--hs-bg);
    font-family: var(--hs-font-mono);
    font-size: 9px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--hs-ink-muted);
}
.hub-foot a {
    color: var(--hs-ink-soft);
    transition: color 150ms ease-out;
}
.hub-foot a:hover { color: var(--hs-accent); }
.hub-foot .foot-right { display: inline-flex; align-items: center; gap: 14px; }

/* ── Search popover — slice 2.3 ──────────────────────────────────────
   The .hub-search container that wraps the FIND prompt + input is set
   to position: relative below so the popover can absolute-position
   directly under the input. Keep that on .hub-search itself, not on
   .search-input — the input is a flex child and shouldn't be the
   positioning context.

   Visibility is driven by [data-open="true"] toggled by hub-search.js.
*/
.hub-search { position: relative; }

.hub-search-popover {
    position: absolute;
    top: calc(100% + 4px); left: 0; right: 0;
    z-index: 50;
    background: var(--hs-surface);
    border: 1px solid var(--hs-border-strong);
    border-top: 2px solid var(--hs-accent);
    max-height: 420px;
    overflow-y: auto;
    display: none;
    flex-direction: column;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.hub-search-popover[data-open="true"] {
    display: flex;
}

.hub-popover-pane {
    display: flex; flex-direction: column;
    flex: 1 1 auto;
}
.hub-popover-pane[hidden] { display: none; }

.hub-popover-head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 12px;
    padding: 10px 14px 6px;
    border-bottom: 1px solid var(--hs-border);
}
.hub-popover-eyebrow {
    font-family: var(--hs-font-mono);
    font-size: 10px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
    color: var(--hs-accent);
}
.hub-popover-hint {
    font-family: var(--hs-font-mono);
    font-size: 9px; font-weight: 400; letter-spacing: 0.10em; text-transform: uppercase;
    color: var(--hs-ink-muted);
}

.hub-popover-list {
    list-style: none;
    margin: 0;
    padding: 4px 0;
    display: flex; flex-direction: column;
}

/* Group headers — kicker treatment matching the rest of the Hub */
.hub-popover-group {
    padding: 8px 14px 4px;
    font-family: var(--hs-font-mono);
    font-size: 9px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--hs-ink-soft);
    border-top: 1px solid var(--hs-border);
}
.hub-popover-group:first-child { border-top: 0; }

/* Result rows */
.hub-popover-row {
    display: grid;
    grid-template-columns: 24px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background 100ms ease-out;
    font-family: var(--hs-font-body);
}
.hub-popover-row.is-active,
.hub-popover-row:hover {
    background: var(--hs-surface-2);
}
.hub-popover-row.is-active {
    box-shadow: inset 2px 0 0 var(--hs-accent);
}
.hub-popover-row.hub-popover-empty {
    cursor: default;
    grid-template-columns: 1fr;
    color: var(--hs-ink-muted);
    font-size: 12px;
    text-align: center;
    padding: 18px 14px;
    background: transparent;
    box-shadow: none;
}

.hub-popover-glyph {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px;
    font-family: var(--hs-font-mono);
    font-size: 10px; font-weight: 700;
    background: var(--hs-bg);
    border: 1px solid var(--hs-border-strong);
    color: var(--hs-ink-soft);
    user-select: none;
}
.hub-popover-glyph.kind-graph { color: var(--hs-accent); border-color: var(--hs-accent); }
.hub-popover-glyph.kind-dataset { color: var(--hs-accent-good); border-color: var(--hs-accent-good); }
.hub-popover-glyph.kind-connection { color: var(--hs-ink); border-color: var(--hs-border-strong); }
.hub-popover-glyph.is-builtin { color: var(--hs-signal); border-color: var(--hs-signal); }

.hub-popover-name {
    font-size: 13px;
    color: var(--hs-ink);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hub-popover-sub {
    font-family: var(--hs-font-mono);
    font-size: 10px; font-weight: 400; letter-spacing: 0.04em;
    color: var(--hs-ink-muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    max-width: 240px;
    text-align: right;
}

.hub-popover-status {
    padding: 8px 14px;
    font-family: var(--hs-font-mono);
    font-size: 10px; font-weight: 400; letter-spacing: 0.06em;
    color: var(--hs-ink-muted);
    border-top: 1px solid var(--hs-border);
}

.hub-popover-foot {
    display: flex; align-items: center; gap: 16px;
    padding: 8px 14px;
    border-top: 1px solid var(--hs-border);
    background: var(--hs-bg);
    font-family: var(--hs-font-mono);
    font-size: 9px; font-weight: 400; letter-spacing: 0.10em; text-transform: uppercase;
    color: var(--hs-ink-muted);
}
.hub-popover-kbd-row {
    display: inline-flex; align-items: center; gap: 4px;
}
.hub-popover-foot kbd {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px;
    padding: 0 4px;
    background: var(--hs-surface-2);
    border: 1px solid var(--hs-border-strong);
    color: var(--hs-ink);
    font-family: var(--hs-font-mono);
    font-size: 10px; font-weight: 700; letter-spacing: 0;
    text-transform: none;
}

/* ── Mobile: stack to single column ─────────────────────────── */
@media (max-width: 768px) {
    .hub-ribbon { flex-wrap: wrap; }
    .hub-ribbon .ribbon-context { padding: 6px 14px; gap: 10px; font-size: 9px; }
    .hub-masthead { padding: 12px 16px; flex-wrap: wrap; gap: 12px; }
    .hub-masthead .id-cluster { flex-wrap: wrap; gap: 10px; }
    .hub-masthead .id-cluster .id-user { max-width: 160px; }
    #hub-main { padding: 22px 16px 24px; gap: 22px; }
    .hub-orient { padding: 12px 14px; gap: 12px; }
    .hub-orient .orient-line { gap: 8px; }
    .hub-orient .orient-steps-list { gap: 6px; }
    .hub-row, .hub-row.hub-row-utility { grid-template-columns: 1fr; }
    .hub-tile { min-height: 120px; }
    .hub-tile.tile-artifact .tile-value { font-size: 32px; }
    .hub-tile.tile-workspace .tile-name { font-size: 20px; }
    /* Footer wraps to two stacked rows on a phone — left identity over the
       right link cluster — rather than a ragged single-line wrap. */
    .hub-foot { padding: 10px 16px; flex-wrap: wrap; gap: 8px 12px; }
    .hub-search-popover { max-height: 60vh; }
    .hub-popover-sub { max-width: 140px; }
    .hub-popover-foot { flex-wrap: wrap; gap: 10px; }
}

/* ── Narrow phone (≤480px) — tighten the chrome the 768px tier leaves
   a touch generous at ~360px. Tiles already single-column from above;
   this tier only condenses the top plate, the canvas gutter, and the
   footer so nothing crowds or clips on a 360×740 viewport. ── */
@media (max-width: 480px) {
    .hub-ribbon .ribbon-live { padding: 6px 12px; }
    .hub-ribbon .ribbon-context { gap: 8px; letter-spacing: 0.05em; }
    .hub-masthead { padding: 11px 14px; gap: 10px; }
    .hub-masthead .brand { font-size: 12px; }
    .hub-masthead .id-cluster { gap: 8px; font-size: 10px; }
    .hub-masthead .id-cluster .id-user { max-width: 130px; font-size: 11px; }
    #hub-main { padding: 18px 14px 20px; gap: 18px; }
    .hub-welcome h1 { font-size: 22px; }
    .hub-search .search-prompt { padding: 0 10px; }
    .hub-search input.search-input { padding: 12px 12px; }
    /* Footer to its own stacked rows, full-width each, on the smallest phones. */
    .hub-foot { flex-direction: column; align-items: flex-start; gap: 6px; }
    .hub-foot .foot-right { gap: 12px; }
}

/* ---------------------------------------------------------------------------
   hub-dialog -- the section 13 confirm-dialog primitive (Content/hub/hub-dialog.js).
   A premium-quiet modal built on the hub-popover two-tone-border look: dark
   surface, strong border, a 2px top-rail. The destructive (.is-danger) variant
   swaps the rail + primary button to signal-amber -- never a loud resting red.
   Sits above the Graphs/Connections/Portals modals (z 8001) so it stacks on
   top of an open modal. Design truth: Documentation/Hub.md section 13.5.
   --------------------------------------------------------------------------- */

.hub-dialog-backdrop {
    position: fixed; inset: 0;
    z-index: 9000;
    background: rgba(0, 0, 0, 0.66);
    backdrop-filter: blur(2px);
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
}
.hub-dialog-backdrop.hidden { display: none; }

.hub-dialog {
    width: 100%;
    max-width: 420px;
    background: var(--hs-surface);
    border: 1px solid var(--hs-border-strong);
    border-top: 2px solid var(--hs-accent);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    padding: 20px 22px 18px;
    display: flex; flex-direction: column; gap: 14px;
}
/* Destructive intent: the top-rail goes amber (signal), matching the
   amber-border-fill-on-hover primary button below. */
.hub-dialog.is-danger { border-top-color: var(--hs-signal); }

.hub-dialog-title {
    font-family: var(--hs-font-mono);
    font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--hs-ink);
}
.hub-dialog.is-danger .hub-dialog-title { color: var(--hs-signal); }

.hub-dialog-body {
    font-family: var(--hs-font-body);
    font-size: 13px; line-height: 1.55;
    color: var(--hs-ink-soft);
}
/* Blast-radius / dependency lines inside a blocked dialog. Counts + quiet
   summary, mirroring the gm-usedby idiom -- never a grid. */
.hub-dialog-body .hub-dialog-dep {
    display: flex; align-items: baseline; gap: 8px;
    margin-top: 6px;
    font-family: var(--hs-font-mono);
    font-size: 12px;
}
.hub-dialog-body .hub-dialog-dep .dep-count { color: var(--hs-ink); font-weight: 700; }
.hub-dialog-body .hub-dialog-dep .dep-noun  { color: var(--hs-ink-soft); }
.hub-dialog-body .hub-dialog-dep .dep-sum   { color: var(--hs-ink-muted); }
.hub-dialog-body .hub-dialog-next {
    margin-top: 12px;
    color: var(--hs-ink-soft);
}
.hub-dialog-body strong { color: var(--hs-ink); font-weight: 700; }

.hub-dialog-actions {
    display: flex; align-items: center; justify-content: flex-end; gap: 10px;
    margin-top: 2px;
}

.hub-dialog-btn {
    font-family: var(--hs-font-mono);
    font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
    padding: 9px 16px;
    cursor: pointer;
    transition: background 150ms ease-out, border-color 150ms ease-out, color 150ms ease-out;
}

/* Cancel is the safe default -- quiet bordered button, ink-soft. */
.hub-dialog-cancel {
    background: transparent;
    border: 1px solid var(--hs-border-strong);
    color: var(--hs-ink-soft);
}
.hub-dialog-cancel:hover { color: var(--hs-ink); border-color: var(--hs-ink-muted); }
.hub-dialog-cancel:focus-visible { outline: 2px solid var(--hs-accent); outline-offset: 2px; }

/* Confirm primary -- non-danger uses accent; danger uses amber border at rest
   and fills only on hover (section 13.5 / 13.10: no loud resting red). */
.hub-dialog-confirm {
    background: var(--hs-accent);
    border: 1px solid var(--hs-accent);
    color: #ffffff;
}
.hub-dialog-confirm:hover { background: var(--hs-accent-2); border-color: var(--hs-accent-2); }
.hub-dialog-confirm:focus-visible { outline: 2px solid var(--hs-accent); outline-offset: 2px; }

.hub-dialog.is-danger .hub-dialog-confirm {
    background: transparent;
    border: 1px solid var(--hs-signal);
    color: var(--hs-signal);
}
.hub-dialog.is-danger .hub-dialog-confirm:hover {
    background: var(--hs-signal);
    color: #0a0a0a;
}
.hub-dialog.is-danger .hub-dialog-confirm:focus-visible { outline-color: var(--hs-signal); }

/* Disabled (blocked dialog) + busy (async onConfirm in flight). */
.hub-dialog-confirm:disabled,
.hub-dialog-confirm.is-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: transparent;
    border-color: var(--hs-ink-muted);
    color: var(--hs-ink-muted);
}
.hub-dialog-confirm.is-busy { opacity: 0.7; cursor: progress; }
