:root {
    --bg: #020b14;
    --glass: rgba(5, 20, 33, 0.64);
    --glass-strong: rgba(6, 22, 36, 0.86);
    --line: rgba(150, 215, 245, 0.14);
    --line-strong: rgba(150, 215, 245, 0.26);
    --text: #e8f5fc;
    --muted: #9dbccd;
    --dim: #6f91a5;
    --accent: #5fe1ff;
    --accent-2: #45e0a8;
    --risk: #ff7a66;
    --radius: 18px;
    --blur: blur(16px) saturate(140%);
    color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); }
body {
    font-family: Manrope, system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    font-feature-settings: 'tnum' 0;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
b, strong { font-weight: 700; }

#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
#vignette { position: fixed; inset: 0; pointer-events: none; z-index: 4; background: radial-gradient(ellipse at 50% 45%, transparent 52%, rgba(0, 4, 10, 0.6) 100%); }
#flash { position: fixed; inset: 0; pointer-events: none; z-index: 30; opacity: 0; background: radial-gradient(circle at 50% 40%, rgba(220, 250, 255, 0.9), rgba(120, 210, 240, 0.35) 60%, transparent); }
#flash.go { animation: flash 1.1s ease-out; }
@keyframes flash { 0% { opacity: 0; } 12% { opacity: 0.85; } 100% { opacity: 0; } }

/* ── Floating names ─────────────────────────────────────────────────────── */
#labels { position: fixed; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.lbl {
    position: absolute; left: 0; top: 0; white-space: nowrap; will-change: transform;
    font-size: 12px; font-weight: 600; letter-spacing: 0.01em; color: rgba(232, 246, 255, 0.94);
    text-shadow: 0 0 10px rgba(0, 8, 16, 0.95), 0 1px 2px rgba(0, 0, 0, 0.9);
}
.lbl.sel { font-size: 13.5px; font-weight: 800; color: #fff; }
.lbl.group {
    font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--c);
    padding: 4px 10px 4px 8px; border-radius: 999px; background: rgba(2, 14, 24, 0.62);
    border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
    display: inline-flex; align-items: center; gap: 7px; text-shadow: none;
    box-shadow: 0 0 22px color-mix(in srgb, var(--c) 22%, transparent);
}
.lbl.group b { color: rgba(230, 245, 255, 0.7); font-weight: 700; letter-spacing: 0.02em; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; box-shadow: 0 0 8px rgba(255, 255, 255, 0.25); }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.primary {
    background: linear-gradient(135deg, #6ce6ff, #3fb2ff); color: #02131f; font-weight: 800; font-size: 14px;
    padding: 10px 16px; border-radius: 12px; box-shadow: 0 8px 28px rgba(63, 178, 255, 0.32);
    transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
}
.primary:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 10px 34px rgba(63, 178, 255, 0.45); }
.primary:disabled { opacity: 0.55; cursor: default; transform: none; }
.ghost {
    background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); color: var(--text); font-weight: 700; font-size: 14px;
    padding: 10px 16px; border-radius: 12px; transition: background 0.2s, border-color 0.2s;
}
.ghost:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--line-strong); }
.big { padding: 14px 20px; font-size: 15px; }
.small { font-size: 12.5px; padding: 7px 12px; }
button.icon {
    width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
    background: var(--glass); border: 1px solid var(--line); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
    color: var(--muted); transition: color 0.2s, border-color 0.2s;
}
button.icon:hover { color: var(--text); border-color: var(--line-strong); }
button.icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Top bar ────────────────────────────────────────────────────────────── */
#topbar {
    position: fixed; top: 0; left: 0; right: 0; height: 62px; z-index: 20;
    display: flex; align-items: center; justify-content: space-between; padding: 0 18px;
    background: linear-gradient(to bottom, rgba(1, 8, 15, 0.72), transparent); pointer-events: none;
}
#topbar > * { pointer-events: auto; }
.brand { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.logo { font-weight: 800; font-size: 13px; letter-spacing: 0.34em; color: #c4f0ff; text-shadow: 0 0 18px rgba(95, 225, 255, 0.45); }
.ds-name { color: var(--muted); font-weight: 600; font-size: 13px; max-width: 30vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asof {
    align-self: center; display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px 5px 8px; border-radius: 999px;
    font-size: 12px; font-weight: 700; color: var(--muted); background: var(--glass); border: 1px solid var(--line); white-space: nowrap;
    transition: color 0.25s, border-color 0.25s, box-shadow 0.4s;
}
.asof:hover { color: var(--text); border-color: var(--line-strong); }
.asof svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.asof.busy svg { animation: asof-spin 0.9s linear infinite; }
.asof.old { color: #ffcf5c; border-color: rgba(255, 207, 92, 0.4); }
.asof.just { color: #fff; border-color: var(--accent); box-shadow: 0 0 18px rgba(95, 225, 255, 0.45); }
@keyframes asof-spin { to { transform: rotate(360deg); } }
.actions { display: flex; align-items: center; gap: 8px; position: relative; }
.steps {
    position: absolute; left: 50%; transform: translateX(-50%); display: flex; gap: 2px; padding: 4px; border-radius: 999px;
    background: var(--glass); border: 1px solid var(--line); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.steps button { display: flex; align-items: center; gap: 8px; padding: 7px 14px 7px 8px; border-radius: 999px; color: var(--muted); font-weight: 700; font-size: 13px; transition: background 0.25s, color 0.25s; }
.steps button i { font-style: normal; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: rgba(255, 255, 255, 0.08); }
.steps button:hover { color: var(--text); }
.steps button.on { background: rgba(95, 225, 255, 0.15); color: #fff; }
.steps button.on i { background: var(--accent); color: #02131f; }

/* ── Search ─────────────────────────────────────────────────────────────── */
.search { position: absolute; right: 0; top: 46px; width: 300px; }
.search input {
    width: 100%; padding: 11px 14px; border-radius: 12px; background: var(--glass-strong); border: 1px solid var(--line-strong);
    outline: none; -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.search-results { margin-top: 6px; border-radius: 12px; overflow: hidden; background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.search-results:empty { display: none; }
.search-results button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 12px; text-align: left; font-size: 13.5px; font-weight: 600; }
.search-results button:hover { background: rgba(255, 255, 255, 0.07); }
.search-results small { margin-left: auto; color: var(--dim); font-weight: 600; }
.search-results .none { padding: 10px 12px; color: var(--dim); font-size: 13px; }

/* ── Cards ──────────────────────────────────────────────────────────────── */
.card {
    position: fixed; z-index: 15; background: var(--glass); border: 1px solid var(--line); border-radius: 24px;
    -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: 0 30px 80px rgba(0, 6, 14, 0.5);
}
.intro { left: max(24px, 7vw); top: 50%; transform: translateY(-50%); width: min(600px, calc(100vw - 48px)); padding: 34px 36px; animation: rise 0.8s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(calc(-50% + 16px)); } to { opacity: 1; transform: translateY(-50%); } }
.eyebrow { text-transform: uppercase; letter-spacing: 0.3em; font-size: 11.5px; font-weight: 800; color: var(--accent); }
.intro h1 {
    font-size: clamp(32px, 4.4vw, 50px); line-height: 1.04; letter-spacing: -0.025em; margin: 10px 0 14px; font-weight: 800;
    background: linear-gradient(180deg, #ffffff 30%, #9fe6ff); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.intro h1.loading { font-size: 28px; }
.lead { color: var(--muted); font-size: 16px; line-height: 1.6; margin: 0; }
.how { list-style: none; padding: 0; margin: 22px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; counter-reset: how; }
.how li { counter-increment: how; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); border-radius: 14px; padding: 12px 12px 12px; }
.how li::before { content: counter(how); display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(95, 225, 255, 0.16); color: var(--accent); font-size: 11.5px; font-weight: 800; margin-bottom: 8px; }
.how b { display: block; font-size: 14px; }
.how span { display: block; color: var(--dim); font-size: 12.5px; line-height: 1.4; margin-top: 3px; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.link-form { margin-top: 20px; }
.link-form label { display: block; font-size: 12.5px; color: var(--dim); font-weight: 600; margin-bottom: 7px; }
.link-form > div { display: flex; gap: 8px; }
.link-form input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); outline: none; }
.link-form input:focus { border-color: var(--line-strong); }
.intro p.small { font-size: 12.5px; color: var(--dim); margin: 16px 0 0; padding: 0; }
.bar { height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); overflow: hidden; margin-top: 18px; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #45e0a8, #5fe1ff); border-radius: 3px; transition: width 0.2s; }
.intro .bar i { width: 35%; animation: scan 1.4s ease-in-out infinite; }
@keyframes scan { 0% { transform: translateX(-110%); } 100% { transform: translateX(310%); } }

.stage { left: 50%; bottom: 28px; transform: translateX(-50%); width: min(560px, calc(100vw - 32px)); padding: 22px 24px; animation: up 0.6s ease-out both; }
@keyframes up { from { opacity: 0; transform: translate(-50%, 14px); } to { opacity: 1; transform: translate(-50%, 0); } }
.kicker { display: flex; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: 0.16em; font-size: 11.5px; font-weight: 800; color: var(--accent); }
.kicker i { font-style: normal; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #02131f; letter-spacing: 0; }
.stage h2 { font-size: 22px; line-height: 1.25; margin: 10px 0 8px; font-weight: 800; letter-spacing: -0.01em; }
.stage p { color: var(--muted); font-size: 14.5px; line-height: 1.55; margin: 0; }
.stage .cta { margin-top: 18px; }
.counters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.counters div { background: rgba(255, 255, 255, 0.04); border-radius: 12px; padding: 10px 12px; }
.counters b { display: block; font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.counters span { color: var(--dim); font-size: 12px; font-weight: 600; }
.skip { position: fixed; right: 24px; bottom: 26px; z-index: 16; }

/* ── Findings panel ─────────────────────────────────────────────────────── */
.panel {
    position: fixed; left: 18px; top: 76px; bottom: 18px; width: 360px; z-index: 12; display: flex; flex-direction: column;
    background: var(--glass); border: 1px solid var(--line); border-radius: 20px;
    -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: 0 24px 60px rgba(0, 6, 14, 0.4);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), background-color 0.3s, border-color 0.3s, box-shadow 0.3s;
    animation: slideIn 0.6s ease-out backwards;   /* never 'both': a held end state would override .collapsed */
}
@keyframes slideIn { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: none; } }
.panel.collapsed { transform: translateX(calc(-100% + 54px)); }
.panel.collapsed .panel-body, .panel.collapsed .panel-sub, .panel.collapsed .tabs { visibility: hidden; }
.panel.collapsed .panel-toggle svg { transform: rotate(180deg); }
/* Desktop: folded away, only the round arrow stays to bring it back (phones fold it into the bottom bar instead). */
@media (min-width: 761px) {
    .panel.collapsed { background-color: transparent; border-color: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; pointer-events: none; }
    .panel.collapsed .panel-toggle { pointer-events: auto; background: var(--glass-strong); }
}
.handle { display: none; }
.panel-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 0; }
.tabs { display: flex; gap: 2px; padding: 3px; border-radius: 12px; background: rgba(255, 255, 255, 0.045); flex: 1; }
.tabs button { flex: 1; padding: 8px 6px; border-radius: 10px; font-size: 12.5px; font-weight: 700; color: var(--muted); transition: background 0.2s, color 0.2s; white-space: nowrap; }
.tabs button.on { background: rgba(95, 225, 255, 0.15); color: #fff; }
.panel-toggle { width: 34px; height: 34px; flex: none; }
.panel-toggle svg { transition: transform 0.3s; }
.panel-sub { padding: 12px 18px 8px; font-size: 12px; color: var(--dim); font-weight: 600; }
.panel-body { flex: 1; overflow-y: auto; padding: 4px 10px 14px; scrollbar-width: thin; scrollbar-color: rgba(150, 215, 245, 0.2) transparent; }
.empty { color: var(--dim); font-size: 13.5px; line-height: 1.5; padding: 8px 6px; }
.f-item {
    display: block; width: 100%; text-align: left; margin-bottom: 8px; padding: 12px 14px 13px; border-radius: 14px;
    background: rgba(255, 255, 255, 0.035); border: 1px solid transparent; border-left: 3px solid var(--k);
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.f-item:hover { background: rgba(255, 255, 255, 0.07); transform: translateX(2px); }
.f-item.on { background: color-mix(in srgb, var(--k) 12%, rgba(6, 24, 38, 0.9)); border-color: color-mix(in srgb, var(--k) 45%, transparent); border-left-color: var(--k); }
.f-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.f-kind { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.13em; color: var(--k); }
.f-metric { font-size: 17px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.f-metric small { font-size: 10.5px; font-weight: 700; color: var(--dim); margin-left: 5px; }
.f-item strong { display: block; font-size: 14.5px; line-height: 1.3; margin: 6px 0 4px; }
.f-body { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; line-height: 1.45; color: var(--muted); }
.g-item, .s-item {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 12px; text-align: left;
    font-size: 13.5px; font-weight: 600; transition: background 0.2s;
}
.g-item:hover, .s-item:hover { background: rgba(255, 255, 255, 0.055); }
.g-item.on, .s-item.on { background: rgba(95, 225, 255, 0.11); }
.g-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-n { color: var(--dim); font-variant-numeric: tabular-nums; }
.s-item { display: grid; grid-template-columns: 38px 1fr; grid-template-rows: auto auto; column-gap: 12px; }
.s-icon { grid-row: span 2; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: rgba(95, 225, 255, 0.1); color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: 0.06em; }
.s-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-meta { font-size: 12px; color: var(--dim); font-weight: 600; }

/* ── Detail ─────────────────────────────────────────────────────────────── */
.detail {
    position: fixed; right: 18px; top: 76px; max-height: calc(100vh - 94px); width: 380px; z-index: 13; overflow-y: auto;
    padding: 22px 22px 24px; background: var(--glass-strong); border: 1px solid var(--line); border-radius: 20px;
    -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: 0 24px 60px rgba(0, 6, 14, 0.45);
    animation: detailIn 0.35s ease-out both; scrollbar-width: thin; scrollbar-color: rgba(150, 215, 245, 0.2) transparent;
}
@keyframes detailIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
.detail .close { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; font-size: 20px; line-height: 1; }
.detail h2 { font-size: 22px; line-height: 1.22; margin: 12px 30px 8px 0; font-weight: 800; letter-spacing: -0.01em; }
.d-desc { color: var(--muted); font-size: 14px; line-height: 1.55; margin: 0; }
.d-chips { display: flex; flex-wrap: wrap; gap: 6px; padding-right: 30px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); color: var(--muted); }
.chip.kind { color: var(--k); background: color-mix(in srgb, var(--k) 15%, transparent); text-transform: uppercase; letter-spacing: 0.1em; font-size: 10.5px; }
.d-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; margin: 16px 0 4px; }
.d-stats div { background: rgba(255, 255, 255, 0.045); border-radius: 12px; padding: 10px 12px; }
.d-stats b { display: block; font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.d-stats span { display: block; color: var(--dim); font-size: 11.5px; font-weight: 600; margin-top: 2px; }
.d-stats .risk b { color: #ff9384; }
.d-metric { margin: 14px 0 2px; display: flex; align-items: baseline; gap: 10px; }
.d-metric b { font-size: 44px; line-height: 1; font-weight: 800; color: var(--k); font-variant-numeric: tabular-nums; text-shadow: 0 0 28px color-mix(in srgb, var(--k) 40%, transparent); }
.d-metric span { color: var(--muted); font-size: 13px; font-weight: 600; }
.detail h4 { text-transform: uppercase; letter-spacing: 0.14em; font-size: 10.5px; font-weight: 800; color: var(--dim); margin: 22px 0 10px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.fact span { display: block; color: var(--dim); font-size: 11.5px; font-weight: 600; }
.fact b { font-size: 13.5px; font-weight: 700; word-break: break-word; }
.conn-group { margin-bottom: 10px; }
.conn-label { font-size: 12px; font-weight: 800; color: var(--muted); padding: 0 10px 4px; text-transform: capitalize; }
.conn-label span { color: var(--dim); font-weight: 600; margin-left: 4px; }
.conn { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 3px 9px; width: 100%; text-align: left; padding: 8px 10px; border-radius: 10px; font-size: 13.5px; font-weight: 600; transition: background 0.2s; }
.conn:hover { background: rgba(255, 255, 255, 0.055); }
.conn-name { overflow: hidden; text-overflow: ellipsis; }
.conn-ev { grid-column: 2 / -1; font-size: 12px; line-height: 1.45; color: var(--dim); font-weight: 500; }
.conn-ev cite, blockquote cite { font-style: normal; color: #7fb9d3; font-size: 11.5px; font-weight: 600; }
.weak { font-size: 10.5px; font-weight: 700; color: #c3b8ff; border: 1px dashed rgba(180, 167, 255, 0.6); border-radius: 6px; padding: 1px 6px; white-space: nowrap; }
.more { color: var(--dim); font-size: 12px; padding: 4px 10px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 999px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; transition: background 0.2s; }
.pill:hover { background: rgba(255, 255, 255, 0.1); }
.list { display: flex; flex-direction: column; }
blockquote {
    margin: 0 0 8px; padding: 10px 12px; border-left: 2px solid rgba(95, 225, 255, 0.45); background: rgba(255, 255, 255, 0.035);
    border-radius: 0 10px 10px 0; font-size: 13px; line-height: 1.5; color: #d2e8f3;
}
blockquote cite { display: block; margin-top: 6px; }
.d-actions { margin-top: 20px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Ask ────────────────────────────────────────────────────────────────── */
.ask-wrap { position: fixed; left: 396px; right: 196px; bottom: 22px; z-index: 14; display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.ask-wrap > * { pointer-events: auto; width: 100%; max-width: 640px; }
body.detail-open .ask-wrap { right: 416px; }
.ask {
    display: flex; gap: 6px; padding: 6px; border-radius: 16px; background: var(--glass-strong); border: 1px solid var(--line-strong);
    -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: 0 18px 50px rgba(0, 6, 14, 0.5);
}
.ask input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; padding: 10px 12px; font-size: 15px; }
.ask input::placeholder { color: var(--dim); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 8px; }
.chip-q { padding: 6px 12px; border-radius: 999px; background: rgba(2, 14, 24, 0.62); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--muted); transition: color 0.2s, border-color 0.2s; }
.chip-q:hover { color: var(--text); border-color: var(--line-strong); }
body.answering .chips { display: none; }
.answer {
    margin-bottom: 10px; max-height: 46vh; overflow-y: auto; padding: 16px 18px; border-radius: 18px; background: var(--glass-strong);
    border: 1px solid var(--line-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: 0 18px 50px rgba(0, 6, 14, 0.5);
    animation: up2 0.35s ease-out both; scrollbar-width: thin; scrollbar-color: rgba(150, 215, 245, 0.2) transparent;
}
@keyframes up2 { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.a-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.a-q { font-size: 13px; font-weight: 800; color: var(--accent); line-height: 1.4; padding-top: 4px; }
.a-close { width: 28px; height: 28px; font-size: 18px; flex: none; }
.a-body p { font-size: 14.5px; line-height: 1.6; margin: 8px 0; white-space: pre-line; }
.a-body h4 { text-transform: uppercase; letter-spacing: 0.14em; font-size: 10.5px; font-weight: 800; color: var(--dim); margin: 14px 0 4px; }
.claims { list-style: none; padding: 0; margin: 0; }
.claims li { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px; line-height: 1.5; }
.claims details { grid-column: 1 / -1; }
.claims summary { cursor: pointer; color: #7fb9d3; font-size: 12px; font-weight: 700; }
.claims blockquote { margin-top: 6px; }
.conf { font-style: normal; font-size: 11.5px; font-weight: 800; padding: 2px 7px; border-radius: 6px; height: fit-content; }
.conf.hi { color: #45e0a8; background: rgba(69, 224, 168, 0.12); }
.conf.mid { color: #ffcf5c; background: rgba(255, 207, 92, 0.12); }
.conf.lo { color: #ff9384; background: rgba(255, 122, 102, 0.12); }
.a-note { font-size: 12px; color: var(--dim); margin-top: 10px; line-height: 1.45; }
.thinking { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; padding: 10px 0 4px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(95, 225, 255, 0.2); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Timeline (movement over a period) ──────────────────────────────────── */
.timeline {
    position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 18; width: min(640px, calc(100vw - 820px));
    min-width: 420px; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 12px; padding: 8px 14px 8px 8px;
    border-radius: 16px; background: var(--glass); border: 1px solid var(--line); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
    box-shadow: 0 14px 40px rgba(0, 6, 14, 0.35); animation: tlIn 0.5s ease-out both;
}
@keyframes tlIn { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translateX(-50%); } }
.timeline.past { border-color: rgba(255, 207, 92, 0.4); }
.tl-play { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #6ce6ff, #3fb2ff); color: #02131f; }
.tl-play svg { width: 16px; height: 16px; fill: currentColor; }
.tl-play .i-pause { display: none; }
.tl-play.playing .i-play { display: none; }
.tl-play.playing .i-pause { display: inline; }
.tl-track { position: relative; height: 34px; cursor: pointer; touch-action: none; }
.tl-rail { position: absolute; left: 0; right: 0; top: 11px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.tl-rail i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, rgba(95, 225, 255, 0.35), var(--accent)); }
.tl-ticks span { position: absolute; top: 20px; transform: translateX(-50%); font-size: 10px; font-weight: 700; letter-spacing: 0.08em; color: var(--dim); text-transform: uppercase; pointer-events: none; }
.tl-marks .tl-mark { position: absolute; top: 7px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--k); border: 2px solid #031421; opacity: 0.55; transition: transform 0.2s, opacity 0.2s; }
.tl-marks .tl-mark.passed { opacity: 1; box-shadow: 0 0 10px var(--k); }
.tl-marks .tl-mark:hover { transform: scale(1.35); opacity: 1; }
.tl-knob { position: absolute; top: 5px; width: 3px; height: 16px; margin-left: -1.5px; border-radius: 2px; background: #fff; box-shadow: 0 0 12px rgba(255, 255, 255, 0.8); pointer-events: none; }
.tl-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; min-width: 116px; }
.tl-date { font-size: 12.5px; font-weight: 800; color: #fff; white-space: nowrap; font-variant-numeric: tabular-nums; }
.timeline.past .tl-date { color: #ffcf5c; }
.tl-now { font-size: 11.5px; font-weight: 700; color: var(--accent); padding: 0; }
.tl-now:hover { text-decoration: underline; }
.tl-caption {
    position: absolute; left: 50%; top: calc(100% + 8px); transform: translate(-50%, -4px); opacity: 0; white-space: nowrap; max-width: 90vw;
    overflow: hidden; text-overflow: ellipsis; padding: 8px 14px; border-radius: 12px; background: var(--glass-strong); border: 1px solid var(--line-strong);
    font-size: 13px; font-weight: 600; transition: opacity 0.35s, transform 0.35s; pointer-events: none;
}
.tl-caption b { margin-right: 6px; }
.tl-caption.on { opacity: 1; transform: translate(-50%, 0); }
.c-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 4px 12px; }
.c-head .primary { white-space: nowrap; flex: none; }
.c-head b { display: block; font-size: 14px; }
.c-head span { display: block; font-size: 11.5px; color: var(--dim); font-weight: 600; margin-top: 2px; }
.c-date { font-size: 11px; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.c-metric { display: block; margin-top: 6px; font-size: 17px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.c-metric small { font-size: 10.5px; font-weight: 700; color: var(--dim); margin-left: 6px; }
.c-item strong { margin-top: 2px; }
.chip.new { color: #7dffc4; background: rgba(69, 224, 168, 0.12); }
.chip.gone { color: #ff9a8a; background: rgba(255, 122, 102, 0.12); }
.pill.gone { opacity: 0.6; text-decoration: line-through; text-decoration-color: rgba(255, 138, 122, 0.7); }
.trend { background: rgba(255, 255, 255, 0.035); border-radius: 12px; padding: 10px 12px 6px; margin-bottom: 8px; }
.trend-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 12px; color: var(--muted); font-weight: 600; }
.trend-head b { color: #fff; font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.trend-head em { font-style: normal; font-size: 11.5px; margin-left: 4px; }
.trend-head em.down { color: #ff9a8a; }
.trend-head em.up { color: #7dffc4; }
.spark { display: block; width: 100%; height: 46px; margin-top: 4px; }
.callout { margin: 14px 0 0; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.035); }
.callout h5 { margin: 0 0 5px; font-size: 10.5px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.callout p { margin: 0; font-size: 13.5px; line-height: 1.55; color: #d9ecf6; }
.callout.todo { border-color: rgba(95, 225, 255, 0.35); background: rgba(95, 225, 255, 0.07); }
.callout.todo h5 { color: var(--accent); }
.callout.todo h5::before { content: '→ '; }
.ba { width: 100%; border-collapse: collapse; font-size: 13px; }
.ba th { font-size: 10.5px; font-weight: 800; color: var(--dim); text-transform: uppercase; letter-spacing: 0.08em; padding: 0 6px 6px; }
.ba td { padding: 8px 6px; border-top: 1px solid var(--line); color: var(--muted); }
.ba td:first-child { color: #d9ecf6; font-weight: 600; padding-left: 0; }
.ba .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 700; }
.ba .now { color: #fff; }
.ba .arr { width: 16px; text-align: center; color: var(--dim); }
.lc { position: relative; padding-right: 58px; margin-top: 4px; }
.lc svg { display: block; width: 100%; height: 70px; }
.lc-y { position: absolute; right: 0; top: 0; bottom: 18px; display: flex; flex-direction: column; justify-content: space-between; font-size: 10.5px; color: var(--dim); font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.lc-x { position: relative; height: 16px; margin-top: 2px; margin-right: 0; }
.lc-x span { position: absolute; top: 0; transform: translateX(-10%); font-size: 10px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.legend2 { display: flex; flex-wrap: wrap; gap: 12px; margin: 4px 0 4px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.legend2 i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.events { list-style: none; margin: 0; padding: 0 0 0 4px; }
.events li { position: relative; display: grid; grid-template-columns: 50px 1fr; gap: 10px; padding: 0 0 12px 14px; font-size: 13px; line-height: 1.45; color: #d9ecf6; }
.events li::before { content: ''; position: absolute; left: 0; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: #7dffc4; box-shadow: 0 0 8px rgba(125, 255, 196, 0.6); }
.events li.down::before { background: #ff8a7a; box-shadow: 0 0 8px rgba(255, 138, 122, 0.6); }
.events li::after { content: ''; position: absolute; left: 3.5px; top: 16px; bottom: 0; width: 1px; background: var(--line); }
.events li:last-child::after { display: none; }
.events li.more::before { background: var(--dim); box-shadow: none; }
.events time { font-size: 11.5px; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 1px; }
.events cite { display: block; font-style: normal; font-size: 11.5px; font-weight: 600; color: #7fb9d3; margin-top: 2px; }
.rels { display: flex; flex-direction: column; gap: 6px; }
.rel { display: grid; gap: 2px; text-align: left; padding: 9px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); border-left: 3px solid var(--k); font-size: 13px; font-weight: 600; }
.rel:hover { background: rgba(255, 255, 255, 0.08); }
.rel .f-kind { font-size: 10px; }

/* ── Legend, hints, depth, toast, tooltip ───────────────────────────────── */
.legend { position: fixed; right: 18px; bottom: 22px; z-index: 11; display: flex; flex-direction: column-reverse; align-items: flex-end; gap: 8px; }
body.detail-open .legend { display: none; }
#legendToggle { padding: 9px 14px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); font-size: 12.5px; font-weight: 700; color: var(--muted); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
#legendToggle:hover { color: var(--text); }
.legend-body { display: none; width: 290px; padding: 14px 16px; border-radius: 16px; background: var(--glass-strong); border: 1px solid var(--line); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.legend.open .legend-body { display: block; }
.legend-body > div { display: grid; grid-template-columns: 26px 1fr; align-items: center; gap: 8px; margin-bottom: 8px; }
.legend-body p { margin: 10px 0 0; color: var(--dim); font-size: 11.5px; }
.lg-dot { width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle, #fff 20%, #5fe1ff 45%, transparent 72%); justify-self: center; }
.lg-line { width: 24px; height: 2px; background: linear-gradient(90deg, #7cf2c9, #5fe1ff); border-radius: 2px; }
.lg-dash { width: 24px; height: 2px; background: repeating-linear-gradient(90deg, #b4a7ff 0 5px, transparent 5px 8px); }
.lg-glow { width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 184, 107, 0.6), transparent 70%); justify-self: center; }
.lg-beacon { width: 4px; height: 20px; border-radius: 2px; background: linear-gradient(to top, #ff7a66, transparent); justify-self: center; }
.hint {
    position: fixed; top: 72px; left: 50%; transform: translateX(-50%); z-index: 11; padding: 7px 14px; border-radius: 999px;
    background: rgba(2, 14, 24, 0.6); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--muted);
    white-space: nowrap; transition: opacity 1.5s; -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.hint.fade { opacity: 0; pointer-events: none; }
.depth { position: fixed; right: 22px; top: 70px; z-index: 6; font-size: 11px; font-weight: 800; letter-spacing: 0.2em; color: rgba(160, 222, 246, 0.5); text-transform: uppercase; font-variant-numeric: tabular-nums; pointer-events: none; }
.depth::before { content: 'Depth  '; opacity: 0.7; white-space: pre; }
body[data-stage="boot"] .depth, body[data-stage="home"] .depth, body[data-stage="arrival"] .depth, body.detail-open .depth { display: none; }
.toast {
    position: fixed; top: 76px; left: 50%; transform: translate(-50%, -8px); opacity: 0; z-index: 30; max-width: min(560px, calc(100vw - 32px));
    padding: 11px 16px; border-radius: 12px; background: var(--glass-strong); border: 1px solid var(--line-strong); font-size: 13.5px; font-weight: 600;
    transition: opacity 0.3s, transform 0.3s; -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
body.has-tl .toast { top: 122px; }
.tip {
    position: fixed; left: 0; top: 0; z-index: 25; pointer-events: none; padding: 8px 11px; border-radius: 10px; max-width: 280px;
    background: var(--glass-strong); border: 1px solid var(--line-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.tip b { display: block; font-size: 13px; }
.tip span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ── 3D / 2D switch ─────────────────────────────────────────────────────── */
.vswitch {
    display: flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--glass); border: 1px solid var(--line);
    -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.vswitch button { padding: 6px 11px; border-radius: 9px; font-size: 12.5px; font-weight: 800; letter-spacing: 0.04em; color: var(--muted); transition: background 0.2s, color 0.2s; }
.vswitch button:hover { color: var(--text); }
.vswitch button.on { background: rgba(95, 225, 255, 0.16); color: #fff; }

/* ── The flat map ───────────────────────────────────────────────────────── */
.flat { position: fixed; inset: 0; z-index: 3; }
.flat-tools { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 6px; z-index: 11; transition: right 0.3s; }
body.detail-open .flat-tools { right: 414px; }
body.flat-on #gl, body.flat-on #labels, body.flat-on #vignette, body.flat-on .depth, body.flat-on #hint { display: none; }
body.flat-on #topbar { background: var(--glass-strong); border-bottom: 1px solid var(--line); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
/* Over a flat map the panels are solid: a dark frame round a light page, not grey glass. */
body.flat-on { --glass: rgba(6, 21, 34, 0.95); --glass-strong: rgba(6, 21, 34, 0.97); }
.legend-body .lg2, body.flat-on .legend-body .lg3 { display: none; }
body.flat-on .legend-body .lg2 { display: grid; }
body.flat-on .legend-body p.lg2 { display: block; }
.lg-red { width: 24px; height: 2px; background: #ff7a66; border-radius: 2px; }
.lg2-dot { width: 11px; height: 11px; border-radius: 50%; background: #4fd8ff; border: 1.5px solid #fff; justify-self: center; }
.lg2-line { width: 24px; height: 2px; background: #8fb8cf; border-radius: 2px; }
.lg2-region { width: 18px; height: 18px; border-radius: 50%; background: rgba(255, 184, 107, 0.16); border: 1px solid rgba(255, 184, 107, 0.6); justify-self: center; }
.lg2-ring { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #ffcf5c; justify-self: center; }
.intro .cta.also { align-items: center; gap: 8px; margin-top: 12px; color: var(--dim); font-size: 13px; font-weight: 600; }

/* ── Gate ───────────────────────────────────────────────────────────────── */
.gate { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 30%, #0b2a40, #020b14 70%); }
.gate-card { width: min(340px, calc(100vw - 32px)); padding: 30px; border-radius: 20px; text-align: center; background: var(--glass); border: 1px solid var(--line); }
.gate-card p { color: var(--muted); font-size: 13.5px; margin: 10px 0 16px; }
.gate-card input { width: 100%; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); outline: none; margin-bottom: 10px; text-align: center; }
.gate-card .primary { width: 100%; }
.gate-err { color: #ff9384 !important; margin: 10px 0 0 !important; }

/* ── The brief (a light, printable document) ────────────────────────────── */
.brief { position: fixed; inset: 0; z-index: 50; overflow-y: auto; background: rgba(1, 8, 14, 0.84); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.brief-bar { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 22px; background: rgba(2, 12, 20, 0.92); border-bottom: 1px solid var(--line); font-weight: 800; }
.brief-bar div { display: flex; gap: 8px; }
.paper { max-width: 820px; margin: 28px auto 60px; background: #fbfcfd; color: #0f1d27; border-radius: 14px; padding: 56px 64px; font-size: 15px; line-height: 1.6; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); }
.b-eyebrow { text-transform: uppercase; letter-spacing: 0.24em; font-size: 11.5px; font-weight: 800; color: #1a7ea6; }
.paper h1 { font-size: 34px; line-height: 1.12; font-weight: 800; color: #06131c; margin: 8px 0 6px; letter-spacing: -0.02em; }
.b-meta { color: #5b6e7a; font-size: 13px; margin: 0; }
.b-glance { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 26px 0 6px; }
.b-glance div { border: 1px solid #e1e8ed; border-radius: 12px; padding: 14px; }
.b-glance b { display: block; font-size: 26px; font-weight: 800; color: #06131c; font-variant-numeric: tabular-nums; }
.b-glance span { display: block; font-size: 12px; color: #5b6e7a; font-weight: 600; }
.paper h2 { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.16em; color: #1a7ea6; margin: 34px 0 10px; padding-top: 22px; border-top: 1px solid #e1e8ed; font-weight: 800; }
.b-ai p { color: #22323d; }
.b-ai-btn { margin-top: 18px; background: #06131c; color: #fff; border-radius: 10px; padding: 10px 14px; font-size: 13.5px; font-weight: 700; }
.b-ai-btn:disabled { opacity: 0.6; }
.b-findings { list-style: none; padding: 0; margin: 0; }
.b-finding { padding: 14px 0 16px; border-bottom: 1px solid #eef2f5; break-inside: avoid; }
.b-f-head { display: flex; justify-content: space-between; align-items: center; }
.b-tag { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; padding: 3px 8px; border-radius: 6px; color: #0f1d27; background: color-mix(in srgb, var(--k) 26%, white); }
.b-num { color: #9aabb6; font-weight: 800; font-size: 13px; }
.b-finding h3 { font-size: 17px; line-height: 1.3; margin: 8px 0 4px; font-weight: 800; color: #06131c; }
.b-finding p { margin: 0; color: #33434e; }
.b-finding p.b-why { margin-top: 6px; color: #22323d; }
.b-finding p.b-todo { margin-top: 6px; padding: 8px 10px; border-radius: 8px; background: #eef7fb; color: #0f3346; }
.paper blockquote { background: none; border-left: 2px solid #c6d9e3; border-radius: 0; color: #33434e; font-size: 13.5px; padding: 3px 12px; margin: 8px 0 0; }
.paper blockquote cite { color: #7a8b96; font-size: 12px; }
.b-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.b-table th { text-align: left; color: #5b6e7a; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; padding: 8px 6px; border-bottom: 1px solid #d6e0e6; }
.b-table td { padding: 8px 6px; border-bottom: 1px solid #eef2f5; vertical-align: top; }
.b-table .n { text-align: right; font-variant-numeric: tabular-nums; }
.b-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
.b-docs { list-style: none; padding: 0; margin: 0; }
.b-docs li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid #eef2f5; font-size: 14px; }
.b-docs span { color: #5b6e7a; font-size: 12.5px; white-space: nowrap; }
.b-muted { color: #6a7b86; }
.b-foot { margin-top: 34px; padding-top: 16px; border-top: 1px solid #e1e8ed; font-size: 12.5px; color: #6a7b86; line-height: 1.55; }
.b-meta2 { color: #5b6e7a; font-size: 13.5px; margin: -4px 0 12px; }
.b-ptable td { vertical-align: middle; }
.b-sub { color: #6b7d88; font-size: 12px; margin-top: 2px; }
.b-prog { min-width: 130px; }
.b-prog span { display: block; font-size: 11.5px; color: #5b6e7a; margin-top: 5px; }
.b-bar { position: relative; height: 7px; border-radius: 5px; background: #e4ecf0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.b-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; background: var(--k); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.b-bar em { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: #1c2b33; }
.b-state { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; color: color-mix(in srgb, var(--k) 62%, #10222c); }
.b-muted.small { font-size: 12px; margin-top: 8px; }

@media print {
    @page { margin: 16mm; }
    html, body { overflow: visible !important; height: auto !important; background: #fff !important; }
    body > *:not(#brief) { display: none !important; }
    .brief { position: static !important; overflow: visible !important; background: #fff !important; backdrop-filter: none !important; }
    .brief-bar, .b-ai-btn { display: none !important; }
    .paper { box-shadow: none; margin: 0; padding: 0; max-width: none; border-radius: 0; }
}

/* ── No 3D available ────────────────────────────────────────────────────── */
body.no-gl { background: radial-gradient(ellipse at 50% 0%, #0d3a55, #020b14 70%); }
body.no-gl #gl { display: none; }

/* ── Phones and small tablets ───────────────────────────────────────────── */
@media (max-width: 1100px) {
    body.detail-open .ask-wrap { display: none; }
}
@media (max-width: 760px) {
    #topbar { height: 54px; padding: 0 12px; }
    .ds-name { display: none; }
    .asof .w { display: none; }
    .steps { position: fixed; top: 58px; left: 50%; transform: translateX(-50%); }
    .steps button { padding: 6px 10px 6px 6px; font-size: 12px; gap: 6px; white-space: nowrap; }
    .steps button i { width: 18px; height: 18px; font-size: 10.5px; }
    #btnFull { display: none; }
    #btnBrief { padding: 9px 12px; font-size: 13px; }
    .intro { left: 12px; right: 12px; width: auto; top: auto; bottom: 12px; transform: none; padding: 24px 22px; animation: none; }
    .intro h1 { font-size: 32px; }
    .lead { font-size: 15px; }
    .how { grid-template-columns: 1fr; gap: 6px; }
    .how li { display: grid; grid-template-columns: 30px 1fr; padding: 9px 12px; }
    .how li::before { grid-row: span 2; margin: 0; }
    .stage { bottom: 12px; padding: 18px 18px; }
    .stage h2 { font-size: 19px; }
    .panel { left: 0; right: 0; top: auto; bottom: 0; width: auto; height: 56vh; border-radius: 22px 22px 0 0; animation: none; }
    .panel.collapsed { transform: translateY(calc(100% - 64px)); }
    .panel.collapsed .tabs { visibility: visible; }
    #panelToggle { display: none; }
    .handle { display: block; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 120px; height: 16px; }
    .handle::after { content: ''; position: absolute; left: 50%; top: 6px; transform: translateX(-50%); width: 40px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.25); }
    .panel-head { padding-top: 16px; }
    .detail { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 52vh; border-radius: 22px 22px 0 0; z-index: 16; }
    .ask-wrap { left: 10px; right: 10px; bottom: 74px; }
    body:has(#panel:not(.collapsed):not([hidden])) .ask-wrap { display: none; }
    .answer { max-height: 38vh; }
    .chips { display: none; }
    .legend { display: none; }
    .hint { display: none; }
    .timeline { top: 98px; width: calc(100vw - 20px); min-width: 0; grid-template-columns: 30px 1fr auto; gap: 8px; padding: 6px 10px 6px 6px; }
    .tl-play { width: 30px; height: 30px; }
    .tl-side { min-width: 84px; }
    .tl-date { font-size: 11.5px; }
    body.has-tl .toast { top: 150px; }
    .depth { top: 104px; right: 14px; }
    body.has-tl .depth { top: 150px; }
    .search { width: calc(100vw - 24px); right: -110px; }
    .paper { padding: 28px 22px; margin: 12px; }
    .b-glance { grid-template-columns: 1fr 1fr; }
    .skip { right: 12px; bottom: 12px; }
    .vswitch button { padding: 6px 9px; font-size: 12px; }
    .flat-tools { top: 112px; right: 10px; transform: none; }
    body.detail-open .flat-tools { right: 10px; }
    .flat-tools #fSave { display: none; }
    .intro .cta.also { margin-top: 8px; }
}

/* ── A company's plan (Ethos targets) ── */
.tbar { position: relative; height: 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.09); margin: 10px 0 6px; }
.tbar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: var(--k); box-shadow: 0 0 12px color-mix(in srgb, var(--k) 45%, transparent); }
.tbar em { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: 1px; background: #eaf7ff; opacity: 0.9; }
.t-rows { display: grid; gap: 8px; margin-top: 6px; }
.t-row { display: block; width: 100%; text-align: left; padding: 10px 12px 9px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.035); color: inherit; font: inherit; cursor: pointer; }
.t-row:hover { background: rgba(255, 255, 255, 0.07); }
.t-row .tbar { margin: 7px 0 5px; height: 6px; }
.t-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.t-name { font-weight: 700; font-size: 13.5px; line-height: 1.3; }
.t-state { flex: none; font-size: 10.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--k); }
.t-sub { display: block; font-size: 12px; line-height: 1.4; color: var(--muted); }
.chip.state { color: var(--k); }
.d-desc.small { font-size: 12px; color: var(--dim); }
.callout.check-at_risk { border-color: rgba(255, 207, 92, 0.4); background: rgba(255, 207, 92, 0.07); }
.callout.check-off_track { border-color: rgba(255, 122, 102, 0.45); background: rgba(255, 122, 102, 0.08); }
.callout.check-on_track { border-color: rgba(69, 224, 168, 0.35); background: rgba(69, 224, 168, 0.06); }
