/* ════════════════════════════════════════════════════════════════
   KPI Master — enterprise analytics workspace
   Type system: Sora (display / headings / figures-head), Plus Jakarta
   Sans (prose / UI), Spline Sans Mono (tabular readouts / labels).
   Cool white canvas under a deep navy command bar; corporate blue
   accent; muted semantic hues; navy-tinted elevation. The data view
   is a sticky control-rail + scrolling report (BI-tool shell), not a
   top strip over a vertical stack. The intake is a stacked hero with
   a full-width drop band. Feedback = hover lifts, focus rings,
   count-ups, sparkline draw-ins, the quality gauge, reveal-on-render.
   No ambient glow, no blinking dots, no HUD noise.
   ════════════════════════════════════════════════════════════════ */

/* ── Tokens ── */
:root {
    --paper: #F4F6FA; --surface: #FFFFFF; --surface-2: #F7F9FC; --surface-3: #EAEFF5;
    --ink: #10233F; --ink-2: #3C4B63; --ink-3: #5D6E88;
    --line: #E1E7EF; --line-2: #C7D2E0;
    --acc: #0B57D0; --acc-h: #0842A6; --acc-soft: rgba(11,87,208,0.08); --acc-line: rgba(11,87,208,0.32);
    --navy: #0E1F38; --navy-ink: #9AAAC2; --navy-strong: #E8EEF6;
    --ink-btn: #1D4ED8; --ink-btn-h: #1643C0;
    --up: #187A4B; --up-soft: rgba(24,122,75,0.12);
    --dn: #B23A48; --dn-soft: rgba(178,58,72,0.10);
    --warn: #9A6B16; --warn-soft: rgba(154,107,22,0.12);
    --steel: #40617C; --steel-soft: rgba(64,97,124,0.12);
    /* legacy names read by JS-generated inline styles (correlation diagonal) */
    --bg3: var(--surface-3); --t3: var(--ink-3);
    --fd: 'Sora', system-ui, -apple-system, sans-serif;
    --fb: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --fm: 'Spline Sans Mono', ui-monospace, 'SF Mono', monospace;
    --r: 12px; --rs: 8px;
    --sh1: 0 1px 2px rgba(16,35,63,0.05), 0 1px 3px rgba(16,35,63,0.06);
    --sh2: 0 12px 32px rgba(16,35,63,0.11), 0 2px 8px rgba(16,35,63,0.06);
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--fb); color: var(--ink-2); line-height: 1.6; font-size: 15px;
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
    background-color: var(--paper); min-height: 100vh;
}
h1, h2, h3, h4 { font-family: var(--fd); color: var(--ink); font-weight: 700; letter-spacing: -0.025em; line-height: 1.08; }
button, select, input { font-family: inherit; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: 3px; }
::selection { background: rgba(11,87,208,0.16); color: var(--ink); }
.mono { font-family: var(--fm); }

/* ── Command bar (deep navy chrome) ── */
.bar {
    position: sticky; top: 0; z-index: 100; height: 60px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 0 26px; background: rgba(14,31,56,0.97); backdrop-filter: saturate(140%) blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.bar :focus-visible { outline-color: #8AB6F2; }
.bar-l { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand svg { width: 22px; height: 22px; color: #8AB6F2; flex-shrink: 0; }
.brand-name { font-family: var(--fd); font-size: 15px; font-weight: 700; letter-spacing: -0.02em; color: #FFFFFF; }
.bar-sep { width: 1px; height: 18px; background: rgba(255,255,255,0.16); flex-shrink: 0; }
.bar-parent { font-family: var(--fm); font-size: 11px; color: #8FA2BC; text-decoration: none; letter-spacing: 0.02em; transition: color 0.15s; }
.bar-parent:hover { color: #DCE6F2; }
/* status readout — text only, no traffic-light dot */
.bar-status { font-family: var(--fm); font-size: 11px; color: var(--navy-ink); letter-spacing: 0.01em; display: flex; align-items: center; min-width: 0; overflow: hidden; white-space: nowrap; }
.bar-status .st-full { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.bar-status .st-mini { display: none; }
.bar-status strong { color: #FFFFFF; font-weight: 600; }
.bar-status.live { color: var(--navy-strong); }
.bar-r { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ── Buttons ─ */
.btn {
    display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px;
    border-radius: var(--rs); font-size: 12.5px; font-weight: 600; cursor: pointer;
    border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); white-space: nowrap;
    box-shadow: var(--sh1); transition: border-color 0.18s, color 0.18s, background 0.18s, transform 0.12s, box-shadow 0.18s;
}
.btn:hover { border-color: var(--acc-line); color: var(--ink); transform: translateY(-1px); box-shadow: var(--sh2); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn svg { width: 14px; height: 14px; }
.bar .btn { background: transparent; border-color: rgba(255,255,255,0.22); color: #D9E2EE; box-shadow: none; }
.bar .btn:hover { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.42); color: #FFFFFF; box-shadow: none; }
.bar .btn-p { background: var(--ink-btn); border-color: var(--ink-btn); color: #FFFFFF; }
.bar .btn-p:hover { background: var(--ink-btn-h); border-color: var(--ink-btn-h); color: #FFFFFF; }
.btn-p { background: var(--ink-btn); border-color: var(--ink-btn); color: #FFFFFF; }
.btn-p:hover { background: var(--ink-btn-h); border-color: var(--ink-btn-h); color: #FFFFFF; }
.btn-ghost { background: transparent; box-shadow: none; border-color: transparent; }
.btn-ghost:hover { border-color: var(--line-2); background: var(--surface-2); box-shadow: none; }
.btn[disabled] { opacity: 0.4; pointer-events: none; }

/* ── Layout shell ── */
.main { max-width: 1240px; margin: 0 auto; padding: 48px 28px 80px; }

/* ── Opening / hero (stacked: headline block → full-width drop band) ── */
.opening { display: flex; flex-direction: column; gap: 30px; margin-bottom: 56px; position: relative; }
.nameplate { display: flex; flex-direction: column; max-width: 760px; }
.np-eyebrow { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.np-kicker { font-family: var(--fb); font-size: 11px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--acc); white-space: nowrap; }
.np-by { font-family: var(--fm); font-size: 10.5px; color: var(--ink-3); letter-spacing: 0.04em; white-space: nowrap; }
.np-rule { flex: 0 0 56px; height: 1px; background: var(--line-2); }
.opening h1 { font-size: clamp(2.7rem, 6vw, 4.4rem); font-weight: 800; letter-spacing: -0.04em; line-height: 0.98; margin-bottom: 22px; position: relative; }
.opening h1 .h1-dot { color: var(--acc); }
.opening h1::after { content: ''; position: absolute; left: 3px; bottom: -14px; width: 64px; height: 4px; border-radius: 2px; background: var(--acc); transform-origin: left; animation: km-rule 0.9s 0.15s cubic-bezier(0.22,1,0.36,1) both; }
@keyframes km-rule { from { transform: scaleX(0); opacity: 0; } to { transform: scaleX(1); opacity: 1; } }
.lede { font-size: 17.5px; line-height: 1.65; color: var(--ink-2); max-width: 56ch; margin-bottom: 24px; }
.lede strong { color: var(--ink); font-weight: 700; }
.spec-row { list-style: none; display: flex; gap: 0; margin-bottom: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--rs); box-shadow: var(--sh1); align-self: flex-start; }
.spec-row li { display: flex; flex-direction: column; gap: 3px; padding: 13px 26px 12px; border-right: 1px solid var(--line); }
.spec-row li:last-child { border-right: none; }
.spec-row strong { font-family: var(--fd); font-size: 1.7rem; font-weight: 800; color: var(--ink); line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.spec-row span { font-family: var(--fb); font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.privacy { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; line-height: 1.6; color: var(--ink-3); max-width: 56ch; }
.privacy svg { width: 15px; height: 15px; color: var(--acc); flex-shrink: 0; margin-top: 2px; }

/* ── Drop tray (full-width horizontal band) ── */
.tray {
    position: relative; border: 1.5px solid var(--line-2); border-radius: 16px;
    background: var(--surface); box-shadow: var(--sh1);
    display: flex; flex-direction: row; align-items: center; gap: 26px;
    padding: 30px 36px; cursor: pointer; overflow: hidden;
    transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s, background 0.25s;
}
.tray:hover, .tray:focus-visible { border-color: var(--acc-line); box-shadow: var(--sh2); transform: translateY(-2px); background: linear-gradient(180deg, #FFFFFF, var(--surface-2)); }
.tray.drag-over { border-color: var(--acc); background: var(--acc-soft); box-shadow: var(--sh2); }
.tray-sweep { position: absolute; left: 6%; right: 6%; height: 1px; top: 50%; opacity: 0;
    background: linear-gradient(90deg, transparent, var(--acc-line), transparent); pointer-events: none; }
.tray:hover .tray-sweep { animation: km-sweep 1.5s ease-in-out; }
@keyframes km-sweep { 0% { top: 14%; opacity: 0; } 18% { opacity: 1; } 82% { opacity: 1; } 100% { top: 86%; opacity: 0; } }
.tray-glyph { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; background: var(--acc-soft); color: var(--acc); flex-shrink: 0; transition: transform 0.25s, background 0.25s; }
.tray-glyph svg { width: 26px; height: 26px; }
.tray:hover .tray-glyph, .tray.drag-over .tray-glyph { transform: translateY(-2px); background: rgba(11,87,208,0.14); }
.tray-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 auto; }
.tray-title { font-family: var(--fd); font-size: 19px; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; }
.tray-sub { font-size: 13.5px; color: var(--ink-3); }
.tray-fmts { font-family: var(--fm); font-size: 10.5px; letter-spacing: 0.08em; color: var(--ink-3); flex-shrink: 0; padding-left: 26px; border-left: 1px solid var(--line); align-self: stretch; display: flex; align-items: center; }
.fh { display: none; }

/* ── Reference datasets ── */
.sec-label { font-family: var(--fb); font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 18px; display: flex; align-items: center; gap: 14px; }
.sec-label::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.sec-label .sl-hint { letter-spacing: 0.01em; text-transform: none; font-weight: 500; color: var(--ink-3); opacity: 0.8; font-size: 12px; }
.ex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 14px; }
.ex-card {
    text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
    padding: 20px 22px 18px; cursor: pointer; color: inherit; display: flex; flex-direction: column; gap: 10px; width: 100%;
    box-shadow: var(--sh1); transition: border-color 0.22s, transform 0.22s, box-shadow 0.22s;
}
.ex-card:hover { border-color: var(--acc-line); transform: translateY(-3px); box-shadow: var(--sh2); }
.ex-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ex-name { font-family: var(--fd); font-size: 16px; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; }
.fmt-badge { font-family: var(--fm); font-size: 9.5px; font-weight: 600; letter-spacing: 0.08em; color: var(--steel); border: 1px solid rgba(64,97,124,0.28); border-radius: 4px; padding: 3px 8px; flex-shrink: 0; background: var(--steel-soft); }
.ex-spark { height: 42px; margin: 2px 0; }
.ex-spark svg { width: 100%; height: 100%; display: block; overflow: visible; }
.ex-spark .sp-line { fill: none; stroke: var(--acc); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ex-card:hover .sp-line { stroke: var(--acc-h); }
.ex-spark .sp-area { fill: rgba(11,87,208,0.07); stroke: none; }
.ex-spark .sp-dot { fill: var(--acc-h); }
.ex-desc { font-size: 13px; color: var(--ink-2); line-height: 1.55; }
.ex-demo { font-family: var(--fm); font-size: 10.5px; color: var(--ink-3); letter-spacing: 0.01em; }
.ex-demo::before { content: '→ '; color: var(--acc); }

/* ── Messages / loading ── */
.msgs { margin-bottom: 24px; display: none; }
.msg { display: flex; align-items: flex-start; gap: 12px; padding: 14px 18px; border-radius: var(--rs); margin-bottom: 9px; font-size: 13.5px; line-height: 1.55; }
.msg svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
.msg-err { background: var(--dn-soft); border: 1px solid rgba(178,58,72,0.26); color: #8E2A36; }
.msg-err svg { color: var(--dn); }
.msg-note { background: var(--warn-soft); border: 1px solid rgba(154,107,22,0.24); color: #7C5611; }
.msg-note svg { color: var(--warn); }
.msg strong { color: var(--ink); font-weight: 700; }
.msg-close { margin-left: auto; background: none; border: none; color: inherit; cursor: pointer; font-size: 15px; opacity: 0.55; padding: 0 2px; line-height: 1; transition: opacity 0.15s; }
.msg-close:hover { opacity: 1; }
.load { text-align: center; padding: 56px 0; display: none; }
.load-ring { width: 34px; height: 34px; border: 2.5px solid var(--line-2); border-top-color: var(--acc); border-radius: 50%; animation: km-spin 0.8s linear infinite; margin: 0 auto 16px; }
@keyframes km-spin { to { transform: rotate(360deg); } }
.load p { font-family: var(--fm); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }

/* ── Workspace shell: sticky control rail + scrolling report ── */
#workspace { grid-template-columns: 264px minmax(0, 1fr); column-gap: 30px; align-items: start; }
.ws-rail { grid-column: 1; grid-row: 1 / 100; position: sticky; top: 76px; display: flex; flex-direction: column; gap: 16px; max-height: calc(100vh - 92px); overflow: auto; padding-right: 2px; min-width: 0; }
#workspace > .panel { grid-column: 2; min-width: 0; }
.ws-nav { display: flex; flex-direction: column; gap: 2px; }
.ws-nav a { font-family: var(--fb); font-size: 12.5px; font-weight: 600; color: var(--ink-3); text-decoration: none; padding: 7px 12px; border-radius: 6px; border-left: 2px solid transparent; transition: color 0.15s, background 0.15s, border-color 0.15s; }
.ws-nav a:hover { color: var(--ink); background: var(--surface-2); }
.ws-nav a.active { color: var(--acc); background: var(--acc-soft); border-left-color: var(--acc); font-weight: 700; }
.ws-nav a:focus-visible { outline-offset: -2px; }

/* ── Readout strip (vertical, lives in the rail) ── */
.readout { display: none; flex-direction: column; align-items: stretch; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--sh1); }
.readout.on { display: flex; }
.ro-file { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.ro-file .fn { font-family: var(--fd); font-weight: 700; font-size: 14px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; letter-spacing: -0.01em; }
.ro-file .fs { font-family: var(--fm); font-size: 10.5px; color: var(--ink-3); }
.ro-vitals { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px 10px; }
.ro-v { display: flex; flex-direction: column; gap: 2px; }
.ro-v .rv { font-family: var(--fm); font-size: 17px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.1; }
.ro-v .rl { font-family: var(--fb); font-size: 9px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.ro-gauge { display: flex; align-items: center; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.ro-gauge svg { width: 50px; height: 50px; transform: rotate(-90deg); flex-shrink: 0; }
.ro-gauge .g-bg { fill: none; stroke: var(--surface-3); stroke-width: 4; }
.ro-gauge .g-fg { fill: none; stroke: var(--acc); stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(0.22,1,0.36,1), stroke 0.5s; }
.ro-gauge .g-fg.g-up { stroke: var(--up); } .ro-gauge .g-fg.g-warn { stroke: var(--warn); } .ro-gauge .g-fg.g-dn { stroke: var(--dn); }
.ro-gauge .gl { font-family: var(--fd); font-size: 18px; font-weight: 800; color: var(--ink); }
.ro-gauge .glabel { font-family: var(--fb); font-size: 9px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.ro-r { display: flex; flex-direction: column; gap: 8px; position: relative; }
.ro-r > .btn { width: 100%; justify-content: center; }

/* ── Columns popover (opens rightward out of the rail) ── */
.colpop { position: absolute; top: calc(100% + 10px); left: 0; right: auto; width: min(360px, 78vw); max-height: 60vh; overflow: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); padding: 18px; z-index: 120; display: none; box-shadow: var(--sh2); }
.colpop.on { display: block; }
.colpop-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.colpop-h .cols-link { font-size: 11.5px; color: var(--acc); background: none; border: none; cursor: pointer; padding: 3px 7px; border-radius: 4px; font-weight: 700; transition: background 0.15s; }
.colpop-h .cols-link:hover { background: var(--acc-soft); }
.colpop-list { display: flex; flex-wrap: wrap; gap: 8px; }
.col-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: var(--rs); font-size: 12px; font-weight: 500; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); cursor: pointer; transition: border-color 0.18s, opacity 0.18s, background 0.18s; }
.col-chip.excluded { opacity: 0.4; text-decoration: line-through; }
.col-chip:hover { border-color: var(--acc-line); background: #FFFFFF; }
.col-type { font-family: var(--fm); font-size: 8.5px; padding: 2px 6px; border-radius: 3px; background: var(--surface-3); color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.col-type.ty-numeric { color: var(--up); } .col-type.ty-temporal { color: var(--steel); } .col-type.ty-categorical { color: var(--warn); }

/* ── Panels ─ */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 26px 28px; margin-bottom: 24px; display: none; box-shadow: var(--sh1); transition: box-shadow 0.25s, border-color 0.25s; scroll-margin-top: 76px; }
.readout { scroll-margin-top: 76px; }
.panel.on { display: block; }
.panel:hover { box-shadow: var(--sh2); }
.panel-h { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.panel-h h2 { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em; display: flex; align-items: center; gap: 11px; }
.panel-h h2 svg { display: none; }
.ph-sub { font-family: var(--fm); font-size: 11px; color: var(--ink-3); letter-spacing: 0.01em; }
.ph-sub strong { color: var(--ink-2); font-weight: 600; }

/* ── Analyst brief ── */
.brief-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 28px; }
.brief-text p { font-size: 15px; line-height: 1.8; color: var(--ink-2); margin-bottom: 12px; }
.brief-text strong { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.brief-text .g-up { color: var(--up); } .brief-text .g-dn { color: var(--dn); } .brief-text .g-warn { color: var(--warn); }
.brief-text .g-A, .brief-text .g-B { color: var(--up); } .brief-text .g-C, .brief-text .g-D { color: var(--warn); } .brief-text .g-F { color: var(--dn); }
.brief-left { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.spotlight { border: 1px solid var(--line); border-top: 3px solid var(--acc); border-radius: var(--rs); padding: 16px 20px 15px; background: #F5F9FE; }
.spotlight .sp-k { font-family: var(--fb); font-size: 10px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--acc); margin-bottom: 7px; }
.spotlight .sp-name { font-family: var(--fd); font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: 6px; letter-spacing: -0.02em; }
.spotlight .sp-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.spotlight .sp-val { font-family: var(--fm); font-size: 2.05rem; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.02; }
.spotlight .sp-spark { height: 46px; margin: 10px 0 8px; }
.spotlight .sp-spark svg { width: 100%; height: 100%; display: block; overflow: visible; }
.spotlight .sp-sub { font-family: var(--fm); font-size: 10.5px; color: var(--ink-3); letter-spacing: 0.01em; line-height: 1.55; }
.spotlight .sp-sub strong { color: var(--ink-2); font-weight: 600; }
.brief-method { margin-top: auto; border-top: 1px solid var(--line); padding-top: 13px; }
.brief-method .bm { font-family: var(--fm); font-size: 10px; color: var(--ink-3); line-height: 1.7; letter-spacing: 0.01em; }
.brief-method .bm strong { color: var(--ink-2); font-weight: 600; letter-spacing: 0.08em; }
.findings { display: flex; flex-direction: column; gap: 10px; }
.findings-h { font-family: var(--fb); font-size: 10px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 3px; }
.finding { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--rs); transition: border-color 0.18s, box-shadow 0.18s; padding: 12px 16px; }
.finding:hover { border-color: var(--acc-line); box-shadow: var(--sh1); }
.finding .fl { font-family: var(--fb); font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.09em; padding-bottom: 4px; }
.finding.t-good .fl { color: var(--up); } .finding.t-warn .fl { color: var(--warn); }
.finding.t-bad .fl { color: var(--dn); } .finding.t-acc .fl { color: var(--acc); }
.finding .fv { font-family: var(--fd); font-size: 15px; font-weight: 700; color: var(--ink); line-height: 1.35; letter-spacing: -0.01em; }
.finding .fl, .finding .fv, .finding .fd { display: block; }
.finding .fd { font-size: 12.5px; color: var(--ink-2); line-height: 1.55; }

/* ── Signal board ── */
.dash-tb { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.dash-tb-l { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search-wrap { position: relative; display: inline-flex; }
.search-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--ink-3); pointer-events: none; }
.search-wrap input { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--rs); padding: 9px 14px 9px 35px; font-size: 13px; color: var(--ink); width: 240px; outline: none; transition: border-color 0.18s, box-shadow 0.18s; }
.search-wrap input:focus { border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft); }
.search-wrap input::placeholder { color: var(--ink-3); }
.sort-select { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--rs); color: var(--ink-2); font-size: 12.5px; padding: 9px 12px; outline: none; cursor: pointer; transition: border-color 0.18s; }
.sort-select:focus { border-color: var(--acc); }
.sort-select:hover { border-color: var(--acc-line); }
.dash-tb-r { display: flex; gap: 6px; flex-wrap: wrap; }
.sig-rail { margin-bottom: 22px; }
.sig-rail:last-child { margin-bottom: 0; }
.sig-rail-h { font-family: var(--fb); font-size: 10px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 11px; display: flex; align-items: center; gap: 12px; }
.sig-rail-h::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.sig-rail-h .rc { color: var(--acc); }
.sig-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 14px; }
.sig-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px 14px; cursor: pointer; transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s; position: relative; box-shadow: var(--sh1); }
.sig-card:hover { border-color: var(--acc-line); transform: translateY(-3px); box-shadow: var(--sh2); }
.sig-card:focus-visible { border-color: var(--acc); outline: 2px solid var(--acc); outline-offset: 1px; }
.sig-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 11px; }
.sig-file { font-family: var(--fm); font-size: 9px; color: var(--ink-3); letter-spacing: 0.03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 120px; }
.sig-flag { font-family: var(--fm); font-size: 9px; font-weight: 600; letter-spacing: 0.03em; color: var(--warn); border: 1px solid rgba(154,107,22,0.28); border-radius: 4px; padding: 2px 7px; white-space: nowrap; background: var(--warn-soft); }
.sig-name { font-size: 13.5px; color: var(--ink-2); font-weight: 600; margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sig-val { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.sig-val .sv { font-family: var(--fm); font-size: 1.5rem; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; word-break: break-all; line-height: 1.12; }
.sig-val .su { font-size: 11px; color: var(--ink-3); }
.sig-delta { font-family: var(--fm); font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 5px; white-space: nowrap; }
.sig-delta.up { color: var(--up); background: var(--up-soft); }
.sig-delta.dn { color: var(--dn); background: var(--dn-soft); }
.sig-delta.flat { color: var(--ink-3); background: var(--surface-3); }
.sig-sub { font-family: var(--fm); font-size: 10px; color: var(--ink-3); margin-top: 6px; letter-spacing: 0.01em; line-height: 1.5; }
.sig-spark { margin-top: 11px; height: 36px; }
.sig-spark svg { width: 100%; height: 100%; display: block; overflow: visible; }
.sig-spark .sp-line { fill: none; stroke: var(--acc); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; opacity: 0.85; }
.sig-card:hover .sp-line { opacity: 1; stroke: var(--acc-h); }
.sig-spark .sp-dot { fill: var(--acc-h); }
.sig-bars { margin-top: 11px; display: flex; flex-direction: column; gap: 6px; }
.sig-bar-row { display: grid; grid-template-columns: minmax(0,1fr) 38px; align-items: center; gap: 8px; }
.sig-bar-row .bl { font-size: 10.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sig-bar-row .bc { font-family: var(--fm); font-size: 10px; color: var(--ink-2); text-align: right; }
.sig-bar { grid-column: 1 / -1; height: 4px; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.sig-bar i { display: block; height: 100%; background: var(--acc); border-radius: 2px; transition: width 0.4s ease; }

/* sparkline draw-in + fills (shared by ex / sig / spotlight) */
.sp-line { fill: none; stroke: var(--acc); stroke-linecap: round; stroke-linejoin: round; }
.sp-area { fill: rgba(11,87,208,0.08); stroke: none; }
.sp-dot { fill: var(--acc-h); }
.sp-draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: km-draw 1s cubic-bezier(0.33,1,0.68,1) forwards; }
@keyframes km-draw { to { stroke-dashoffset: 0; } }

/* ── Chart explorer ── */
.chart-config { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 18px; margin-bottom: 20px; padding: 18px 20px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--rs); }
.cfg-group { display: flex; flex-direction: column; gap: 7px; }
.cfg-label { font-family: var(--fb); font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.11em; color: var(--ink-3); }
.insp-label { margin-bottom: 4px; }
.cfg-select { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--rs); color: var(--ink); font-size: 12.5px; padding: 8px 12px; outline: none; cursor: pointer; max-width: 240px; transition: border-color 0.15s; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235D6E88' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }
.cfg-select:focus { border-color: var(--acc); }
.cfg-select:hover { border-color: var(--acc-line); }
.cfg-metrics { display: flex; flex-wrap: wrap; gap: 7px; max-width: 500px; }
.mx-chip { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--ink-3); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--rs); padding: 6px 11px; cursor: pointer; transition: color 0.15s, border-color 0.15s, background 0.15s; }
.mx-chip:hover { border-color: var(--acc-line); }
.mx-chip input { accent-color: var(--acc); width: 13px; height: 13px; margin: 0; cursor: pointer; }
.mx-chip.sel { color: var(--ink); border-color: var(--acc); background: var(--acc-soft); }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--rs); overflow: hidden; }
.seg button { background: var(--surface); border: none; color: var(--ink-3); font-size: 12px; font-weight: 600; padding: 8px 15px; cursor: pointer; transition: background 0.15s, color 0.15s; border-right: 1px solid var(--line-2); }
.seg button:last-child { border-right: none; }
.seg button:hover { background: var(--surface-2); }
.seg button.on { background: var(--acc-soft); color: var(--acc); }
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.sw-track { width: 34px; height: 19px; border-radius: 10px; background: var(--surface-3); border: 1px solid var(--line-2); position: relative; transition: background 0.2s, border-color 0.2s; flex-shrink: 0; }
.sw-track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: var(--ink-3); transition: transform 0.2s, background 0.2s; }
.switch input:checked + .sw-track { background: var(--acc); border-color: var(--acc); }
.switch input:checked + .sw-track::after { transform: translateX(15px); background: #FFFFFF; }
.switch input:focus-visible + .sw-track { outline: 2px solid var(--acc); outline-offset: 2px; }
.sw-label { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.charts-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 18px; }
.ctile { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; transition: box-shadow 0.25s; }
.ctile:hover { box-shadow: var(--sh1); }
.ctile-full { grid-column: 1 / -1; }
.ctile .ct { font-family: var(--fd); font-size: 15px; font-weight: 700; color: var(--ink); margin-bottom: 4px; letter-spacing: -0.02em; }
.ctile .cs { font-family: var(--fm); font-size: 10.5px; color: var(--ink-3); margin-bottom: 15px; letter-spacing: 0.01em; }
.ctile .cw { position: relative; width: 100%; height: 280px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--surface); }
.ctile .cw canvas { width: 100% !important; height: 100% !important; }
/* composition bars (pure DOM — prints perfectly) */
.comp-list { display: flex; flex-direction: column; gap: 11px; }
.comp-row { display: grid; grid-template-columns: minmax(0, 170px) minmax(0, 1fr) 110px; align-items: center; gap: 14px; }
.comp-row .cl { font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comp-track { height: 16px; background: var(--surface-3); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.comp-track i { display: block; height: 100%; background: var(--acc); opacity: 0.78; transition: width 0.5s cubic-bezier(0.22,1,0.36,1), opacity 0.2s; }
.comp-row:hover .comp-track i { opacity: 1; }
.comp-row.hot .comp-track i { background: var(--warn); }
.comp-row .cv { font-family: var(--fm); font-size: 10.5px; color: var(--ink-3); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.comp-row .cv strong { color: var(--ink); font-weight: 700; }

/* ── Correlation heatmap ── */
.corr-scroll { overflow-x: auto; }
.corr-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.corr-table th { padding: 9px 14px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); font-weight: 700; white-space: nowrap; text-align: left; font-size: 11px; }
.corr-table td { padding: 8px 12px; text-align: center; border: 1px solid var(--line); white-space: nowrap; font-family: var(--fm); font-size: 11px; color: var(--ink); font-variant-numeric: tabular-nums; transition: outline 0.12s; cursor: default; }
.corr-table td:hover { outline: 2px solid var(--acc-line); outline-offset: -2px; }
.corr-table .cn { text-align: left; font-weight: 700; color: var(--ink); background: var(--surface); }
.corr-legend { display: flex; align-items: center; gap: 12px; margin-top: 15px; font-family: var(--fm); font-size: 10px; color: var(--ink-3); }
.corr-legend .lg-bar { width: 150px; height: 9px; border-radius: 4px; background: linear-gradient(90deg, rgba(178,58,72,0.55), var(--surface) 48%, var(--surface) 52%, rgba(11,87,208,0.55)); border: 1px solid var(--line); }
.corr-legend .lg-note { margin-left: 8px; }
.corr-legend span:first-child, .corr-legend span:nth-child(2) { font-weight: 600; }

/* ── Column inspector ── */
.insp-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.insp-box { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; }
.insp-box h4 { font-family: var(--fd); font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; letter-spacing: -0.02em; }
.stat-rows { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 22px; }
.stat-row { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.stat-row:last-child { border-bottom: none; }
.stat-row .sl2 { color: var(--ink-3); }
.stat-row .sv2 { font-family: var(--fm); color: var(--ink); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.insp-note { font-size: 12.5px; color: var(--ink-3); padding: 6px 0; line-height: 1.6; }
.insp-full { grid-column: 1 / -1; }
.insp-hist { position: relative; }
.insp-hist svg rect { fill: var(--acc); opacity: 0.5; transition: opacity 0.15s; }
.insp-hist svg rect:hover { opacity: 0.85; }
.insp-hist .hmark { position: absolute; top: 0; bottom: 14px; width: 0; border-left: 2px dashed var(--steel); z-index: 2; }
.insp-hist .hmark.med { border-left-color: var(--acc); }
.insp-hist .hmark span { position: absolute; top: -19px; left: 6px; font-family: var(--fm); font-size: 9px; font-weight: 600; color: var(--steel); white-space: nowrap; letter-spacing: 0.03em; background: var(--surface-2); padding: 1px 5px; border-radius: 3px; }
.insp-hist .hmark.med span { color: var(--acc); }
.out-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.out-table th { text-align: left; padding: 8px 12px; color: var(--ink-3); font-weight: 700; border-bottom: 1px solid var(--line-2); font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; }
.out-table td { padding: 8px 12px; border-bottom: 1px solid var(--line); color: var(--ink-2); font-family: var(--fm); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.out-table tbody tr:hover td { background: var(--acc-soft); }
.cat-row { display: grid; grid-template-columns: minmax(0,1fr) 58px 100px; align-items: center; gap: 12px; font-size: 12px; padding: 6px 0; }
.cat-row .cnm { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-row .cct { font-family: var(--fm); color: var(--ink); text-align: right; font-size: 11px; }
.cat-bar { height: 5px; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.cat-bar i { display: block; height: 100%; background: var(--acc); border-radius: 2px; transition: width 0.4s ease; }

/* ── Data preview (collapsed by default) ── */
.prev-details summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 11px; }
.prev-details summary::-webkit-details-marker { display: none; }
.prev-details summary .tw { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; color: var(--acc); transition: transform 0.2s; flex-shrink: 0; }
.prev-details summary .tw::after { content: ''; display: block; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg) translate(-2px, 1px); }
.prev-details[open] summary .tw { transform: rotate(90deg); }
.prev-details summary h3 { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.02em; }
.prev-scroll { overflow: auto; border: 1px solid var(--line); border-radius: var(--r); max-height: 360px; margin-top: 16px; }
.prev-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.prev-table th { position: sticky; top: 0; background: var(--surface-2); padding: 10px 15px; text-align: left; font-weight: 700; color: var(--ink); border-bottom: 1px solid var(--line-2); white-space: nowrap; z-index: 1; font-size: 11px; }
.prev-table td { padding: 8px 15px; border-bottom: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; max-width: 230px; overflow: hidden; text-overflow: ellipsis; font-family: var(--fm); font-size: 11px; transition: background 0.15s; }
.prev-table tbody tr:hover td { background: var(--acc-soft); }
.prev-table .rix { color: var(--ink-3); }

/* ── Footer ── */
.km-foot { border-top: 1px solid var(--line); margin-top: 56px; padding-top: 26px; display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.km-foot p { font-family: var(--fm); font-size: 10px; color: var(--ink-3); letter-spacing: 0.04em; }
.km-foot a { color: var(--ink-2); text-decoration: none; transition: color 0.15s; }
.km-foot a:hover { color: var(--acc); }

/* ── Toast ── */
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--navy); border: 1px solid var(--navy); border-radius: var(--rs); padding: 12px 18px; font-size: 13px; font-weight: 600; color: #E8EEF6; z-index: 300; opacity: 0; transform: translateY(10px); transition: opacity 0.22s, transform 0.22s; pointer-events: none; max-width: min(360px, calc(100vw - 48px)); box-shadow: var(--sh2); }
.toast.show { opacity: 1; transform: translateY(0); }

/* ── Reveal-on-render + inspector flash ── */
.reveal { opacity: 0; transform: translateY(10px); animation: km-reveal 0.55s cubic-bezier(0.22,1,0.36,1) forwards; }
@keyframes km-reveal { to { opacity: 1; transform: translateY(0); } }
.flash { animation: km-flash 1.2s ease-out; }
@keyframes km-flash { 0% { border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft); } 100% { border-color: var(--line); box-shadow: var(--sh1); } }

/* ── Print / PDF — crisp light report, charts included ── */
.print-head { display: none; }
/* ── Offline edition strip (download affordance) ── */
.offline {
    display: flex; gap: 36px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
    padding: 26px 28px; margin: 4px 0 40px; box-shadow: var(--sh1);
}
.offline-copy { max-width: 430px; min-width: 0; }
.offline-kicker {
    font-family: var(--fb); font-size: 11px; font-weight: 800; letter-spacing: 0.14em;
    text-transform: uppercase; color: var(--acc); margin-bottom: 10px;
}
.offline-copy h2 { font-size: 1.5rem; letter-spacing: -0.025em; margin-bottom: 8px; line-height: 1.15; }
.offline-copy p { font-size: 14px; line-height: 1.6; color: var(--ink-2); margin: 0; }
.offline-actions { flex: 1 1 320px; min-width: 0; }
.offline-cmd-wrap {
    display: flex; align-items: stretch; background: var(--navy); border-radius: var(--rs); overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
    min-width: 0; /* the command line must wrap inside, not blow out the layout */
}
.offline-cmd {
    flex: 1; min-width: 0; padding: 12px 15px;
    /* Wrap instead of horizontal-scroll: the install command must be fully
       readable and selectable at every width (it is ~1.8k chars of nowrap
       text otherwise, and only a fragment fits on mobile). Visual wrapping
       never inserts newlines, so the Copy button still gets the exact
       single-line command from textContent. */
    white-space: normal; overflow-wrap: anywhere; word-break: break-word;
    font-family: var(--fm); font-size: 11.5px; line-height: 1.6; color: var(--navy-strong);
}
/* Copy button — distinct class from the text block (.offline-copy) so the
   button surface styles can never leak onto the copy column. */
.offline-copy-btn {
    flex-shrink: 0; border: none; background: var(--ink-btn); color: #FFFFFF;
    font-family: var(--fb); font-size: 12px; font-weight: 700; padding: 0 18px; cursor: pointer;
    transition: background 0.15s, transform 0.12s;
    min-height: 44px;
}
.offline-copy-btn:hover { background: var(--ink-btn-h); }
.offline-copy-btn:active { transform: scale(0.98); }
.offline-copy-btn:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.offline-hint { font-size: 12px; color: var(--ink-3); margin: 10px 2px 0; }
.offline-hint a { color: var(--acc); font-weight: 600; }
@media (max-width: 700px) {
    .offline { flex-direction: column; align-items: stretch; padding: 20px; }
    .offline-copy, .offline-actions { max-width: 100%; }
    .offline-cmd { font-size: 10.5px; padding: 11px 12px; }
}

@media print {
    body { background: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    @page { margin: 14mm 12mm; }
    .bar, .opening, .msgs, .load, .readout .ro-r, .dash-tb, .chart-config,
    .toast, .km-foot, .btn, .colpop, .ws-rail, .ws-nav { display: none !important; }
    #workspace { display: block !important; }
    #workspace > .panel { grid-column: auto; }
    .print-head { display: block; border: 1px solid var(--line); border-top: 3px solid var(--acc); border-radius: 10px; padding: 22px 26px; margin-bottom: 18px; background: var(--surface-2); }
    .print-head .ph-k { font-family: var(--fb); font-size: 10px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--acc); margin-bottom: 8px; }
    .print-head h1 { font-size: 1.6rem; font-weight: 700; margin-bottom: 6px; }
    .print-head .ph-m { font-family: var(--fm); font-size: 10px; color: var(--ink-3); }
    .main { max-width: 100%; padding: 0; }
    .panel { display: block !important; break-inside: avoid-page; border: 1px solid var(--line); background: #fff; box-shadow: none; }
    .sig-card, .finding, .ctile, .insp-box { break-inside: avoid; background: #fff; box-shadow: none; }
    .panel-h h2 { break-after: avoid; }
    .sig-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .charts-grid { grid-template-columns: 1fr; }
    .ctile .cw { height: 240px; }
    .sig-card:hover, .ex-card:hover { transform: none; box-shadow: var(--sh1); }
    .sp-draw { animation: none; stroke-dashoffset: 0; }
    .reveal { animation: none; opacity: 1; transform: none; }
    .opening h1::after { animation: none; transform: scaleX(1); }
    .prev-details { display: block; }
    .prev-details .prev-scroll { display: block; }
    .prev-details summary .tw { display: none; }
}

/* ── Responsive ── */
@media (max-width: 980px) {
    #workspace { grid-template-columns: minmax(0, 1fr); }
    .ws-rail { grid-column: 1; grid-row: auto; position: static; max-height: none; overflow: visible; flex-direction: column; }
    #workspace > .panel { grid-column: 1; }
    .readout.on { flex-direction: column; }
    .ro-vitals { grid-template-columns: repeat(3, 1fr); }
    .ro-r { flex-direction: row; flex-wrap: wrap; }
    .ro-r > .btn { width: auto; flex: 1 1 auto; }
    .ws-nav { flex-direction: row; flex-wrap: wrap; gap: 6px; }
    .ws-nav a { border-left: none; border: 1px solid var(--line); background: var(--surface); padding: 6px 12px; }
    .ws-nav a.active { border-color: var(--acc-line); color: var(--acc); background: var(--acc-soft); }
    .colpop { left: 0; right: 0; width: auto; }
}
@media (max-width: 900px) {
    .bar-status .st-full { display: none; }
    .bar-status .st-mini { display: inline; }
    .bar-status.live .st-mini { color: #8AB6F2; font-weight: 700; }
    .brief-grid { grid-template-columns: 1fr; }
    .charts-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .main { padding: 32px 18px 64px; }
    .tray { flex-direction: column; align-items: stretch; gap: 16px; text-align: center; }
    .tray-glyph { align-self: center; }
    .tray-fmts { padding-left: 0; border-left: none; padding-top: 14px; border-top: 1px solid var(--line); justify-content: center; }
    .sig-grid { grid-template-columns: 1fr 1fr; }
    .insp-grid { grid-template-columns: 1fr; }
    .dash-tb { flex-direction: column; align-items: flex-start; }
    .bar-r .btn span { display: none; }
    .bar-r .btn { padding: 8px 10px; }
    .colpop { position: fixed; left: 12px; right: 12px; top: auto; bottom: 12px; width: auto; }
    .comp-row { grid-template-columns: minmax(0,110px) 1fr 92px; }
    .spec-row { flex-wrap: wrap; }
    .spec-row li { flex: 1 1 33%; border-bottom: 1px solid var(--line); }
}
@media (max-width: 480px) {
    .sig-grid { grid-template-columns: 1fr; }
    .ex-grid { grid-template-columns: 1fr; }
    .bar { padding: 0 16px; }
    .brand-name { font-size: 13px; }
    .bar-parent { display: none; }
    .ctile .cw { height: 220px; }
    .search-wrap input { width: 100%; }
    .search-wrap { width: 100%; }
    .opening h1 { font-size: 2.5rem; }
    .ro-vitals { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
    html { scroll-behavior: auto; }
    .sp-draw { stroke-dashoffset: 0; }
    .reveal { opacity: 1; transform: none; }
    .opening h1::after { animation: none; transform: scaleX(1); }
    .tray:hover .tray-sweep { animation: none; }
}
