/* xellstorm prototype. Tokens follow the approved design (A · green). */
/* Fonts are bundled (fonts/, SIL OFL 1.1): the app loads nothing from other servers.
   Latin, Latin Extended, Cyrillic and Greek (Sans) subsets; the browser fetches a subset only when a page uses its characters. */
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-sans-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-sans-latin-ext-500-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/ibm-plex-sans-latin-ext-600-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/ibm-plex-sans-latin-ext-700-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-mono-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-mono-latin-ext-500-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-sans-cyrillic-400-normal.woff2") format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-sans-greek-400-normal.woff2") format("woff2"); unicode-range: U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-sans-cyrillic-500-normal.woff2") format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-sans-greek-500-normal.woff2") format("woff2"); unicode-range: U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/ibm-plex-sans-cyrillic-600-normal.woff2") format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/ibm-plex-sans-greek-600-normal.woff2") format("woff2"); unicode-range: U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/ibm-plex-sans-cyrillic-700-normal.woff2") format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/ibm-plex-sans-greek-700-normal.woff2") format("woff2"); unicode-range: U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-mono-cyrillic-400-normal.woff2") format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-mono-cyrillic-500-normal.woff2") format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
:root {
  --bg: #FFFFFF; --surface: #F7F9F8; --line: #E3E8E5; --grid: #EEF2EF;
  --ink: #17201B; --ink-2: #56635C; --ink-3: #626D67;
  --accent: #1F7A4D; --accent-ink: #FFFFFF; --accent-soft: #E7F2EC; --accent-line: #9FCDB3;
  --d1: #3F72AF; --d1-soft: #A9C3E2; --d2: #C4577A; --d3: #D4892B; --d4: #8A63C4;
  --fan-outer: #D9E3EF; --fan-inner: #AEC4DD; --fan-edge: #5C87BB;
  --risk: #C23B2E; --risk-soft: #FBE9E6; --warn: #875800; --warn-soft: #FBF1DC; --good: #277A4C;
  --toast-err-ink: #FFFFFF; --dot-op: .45;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111613; --surface: #171D19; --line: #26302A; --grid: #1E2621;
    --ink: #E4EAE6; --ink-2: #9FABA4; --ink-3: #8A958E;
    --accent: #3DAA72; --accent-ink: #0B1A12; --accent-soft: #17291F; --accent-line: #2F6B4B;
    --d1: #5A8AC6; --d1-soft: #2C4563; --d2: #C9678A; --d3: #B8842F; --d4: #8E74C8;
    --fan-outer: #2B3F52; --fan-inner: #3D5C7E; --fan-edge: #4F79AB;
    --risk: #E0685A; --risk-soft: #3A1E1B; --warn: #D9A441; --warn-soft: #33290F; --good: #4CB982;
    --toast-err-ink: #1A0B09; --dot-op: .62;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111613; --surface: #171D19; --line: #26302A; --grid: #1E2621;
  --ink: #E4EAE6; --ink-2: #9FABA4; --ink-3: #8A958E;
  --accent: #3DAA72; --accent-ink: #0B1A12; --accent-soft: #17291F; --accent-line: #2F6B4B;
  --d1: #5A8AC6; --d1-soft: #2C4563; --d2: #C9678A; --d3: #B8842F; --d4: #8E74C8;
  --fan-outer: #2B3F52; --fan-inner: #3D5C7E; --fan-edge: #4F79AB;
  --risk: #E0685A; --risk-soft: #3A1E1B; --warn: #D9A441; --warn-soft: #33290F; --good: #4CB982;
  --toast-err-ink: #1A0B09; --dot-op: .62;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 13px; line-height: 1.5; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* Top bar */
.top { display: flex; align-items: center; gap: 14px; padding: 10px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; position: sticky; top: 0; background: var(--bg); z-index: 5; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: -.01em; font-size: 15px; }
.mark { width: 22px; height: 22px; border-radius: 5px; background: var(--accent); display: grid; place-items: center; }
.file { display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 12.5px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); min-width: 0; }
.steps { display: flex; gap: 2px; margin-left: auto; flex-wrap: wrap; }
.step { font-size: 12.5px; color: var(--ink-3); padding: 5px 10px; border-radius: 6px; display: flex; align-items: center; gap: 6px; border: 0; background: transparent; cursor: pointer; }
.step:disabled { cursor: default; opacity: .6; }
.step b { font-weight: 600; font-size: 11px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); color: var(--ink-3); }
.step.done b { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.step.now { color: var(--ink); background: var(--surface); font-weight: 600; }
.step.now b { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.theme { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 6px; padding: 4px 8px; font-size: 12px; cursor: pointer; }
/* Account: plan and sign-in (account.js) */
.account { position: relative; }
.acct { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 6px; padding: 4px 8px; font-size: 12px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; max-width: 260px; }
.acct-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
/* Six steps leave no room for the address on laptop screens: the badge stays, the popover shows the address. */
@media (max-width: 1480px) { .acct-email { display: none; } }
.acct-pop { position: absolute; right: 0; top: calc(100% + 8px); width: 300px; max-width: calc(100vw - 24px); z-index: 40; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 20px rgb(0 0 0 / .14); padding: 14px; display: grid; gap: 10px; }
.acct-pop h3 { font-size: 14px; font-weight: 600; }
.acct-pop > .link { justify-self: start; }
.acct-who { color: var(--ink-2); overflow-wrap: anywhere; }
.acct-link { color: var(--accent); font-size: inherit; text-decoration: underline; }
.acct-link:hover { color: var(--accent); }
.warn-t { color: var(--warn); }

/* Buttons and fields */
.btn { white-space: nowrap; font-size: 12.5px; font-weight: 600; background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); border-radius: 6px; padding: 7px 12px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.small { padding: 4px 8px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn:focus-visible, .step:focus-visible, .theme:focus-visible, .acct:focus-visible, .link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.link { border: 0; background: none; padding: 0; color: var(--ink-3); cursor: pointer; font-size: 12px; }
/* Icon buttons (✕): at least 24 × 24 px, 32 on touch screens. */
.link.x { min-width: 24px; min-height: 24px; display: inline-grid; place-items: center; border-radius: 4px; font-size: 13px; }
.link.x:hover { background: var(--risk-soft); }
@media (pointer: coarse) { .link.x { min-width: 32px; min-height: 32px; } }
.link:hover { color: var(--risk); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.field { display: grid; gap: 4px; min-width: 0; }
.field > span { font-size: 11.5px; color: var(--ink-3); }
.in { border: 1px solid var(--line); background: var(--bg); border-radius: 6px; padding: 5px 8px; font-variant-numeric: tabular-nums; font-size: 12.5px; width: 100%; min-width: 0; }
.in:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.in.bad { border-color: var(--risk); }
.in.narrow { width: 84px; }
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }

/* Layout */
.body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; min-height: calc(100% - 49px); }
.main { padding: 16px; display: grid; gap: 14px; align-content: start; min-width: 0; }
.side { border-left: 1px solid var(--line); background: var(--surface); padding: 16px; display: grid; gap: 16px; align-content: start; min-width: 0; }
.h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.h h2 { font-size: 15px; font-weight: 600; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.sub { color: var(--ink-3); font-size: 12px; }
.ref { font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; white-space: nowrap; }
.side .ref { background: var(--bg); }
.sec { display: grid; gap: 8px; }
.sec-t { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sec-t .ref { text-transform: none; letter-spacing: 0; font-weight: 400; }
.nowrap { white-space: nowrap; }
.panel { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; display: grid; gap: 8px; min-width: 0; align-content: start; }
.panel-t { font-size: 12.5px; font-weight: 600; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.panel-t span { font-weight: 400; color: var(--ink-3); }
.charts { display: grid; grid-template-columns: 1.25fr 1fr; gap: 14px; }
.scroll { overflow-x: auto; position: relative; }

/* KPI strip */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.kpis.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { padding: 12px 14px; display: grid; gap: 4px; border-right: 1px solid var(--line); min-width: 0; align-content: start; }
.kpi:last-child { border-right: 0; }
.kpi-l { font-size: 11.5px; color: var(--ink-3); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.kpi-v { font-size: 22px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpi-v small { font-size: 12px; font-weight: 500; color: var(--ink-3); margin-left: 3px; }
.chip { font-size: 11px; font-weight: 600; border-radius: 999px; padding: 1px 7px; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.chip.risk { background: var(--risk-soft); color: var(--risk); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.acc { background: var(--accent-soft); color: var(--accent); }
.chip.neutral { background: var(--surface); color: var(--ink-2); border: 1px solid var(--line); }

/* Tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.tbl th { text-align: left; font-weight: 500; color: var(--ink-3); font-size: 11px; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 6px 8px; border-bottom: 1px solid var(--grid); vertical-align: middle; }
.tbl .r { text-align: right; }
.tbl tr.sel td { background: var(--accent-soft); }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover td { background: var(--surface); }
.tbl tr.sel.clickable:hover td { background: var(--accent-soft); }
.params { display: flex; gap: 6px; justify-content: flex-end; }
.params label { display: inline-flex; gap: 4px; align-items: center; font-size: 11px; color: var(--ink-3); font-family: var(--mono); }
.params .in { width: 64px; padding: 3px 6px; text-align: right; }
.tbl select.in { width: auto; padding: 3px 6px; }
.bar-inline { height: 6px; border-radius: 3px; background: var(--d1); display: block; min-width: 1px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 12px; margin: 0; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }
.kv a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

/* Notes */
.note { border-radius: 8px; padding: 10px 12px; font-size: 12px; display: grid; gap: 4px; background: var(--surface); border: 1px solid var(--line); }
.note.warn { background: var(--warn-soft); border-color: transparent; }
.note.warn b { color: var(--warn); }
.note.risk { background: var(--risk-soft); border-color: transparent; }
.note.risk b { color: var(--risk); }
.check-list { display: grid; gap: 6px; font-size: 12.5px; }
.check-list > div { display: flex; gap: 8px; align-items: flex-start; }
.ok { color: var(--good); font-weight: 700; }
.bad-mark { color: var(--warn); font-weight: 700; }

/* Upload */
.drop { border: 1.5px dashed var(--accent-line); background: var(--accent-soft); border-radius: 10px; padding: 28px 20px; display: grid; justify-items: center; gap: 8px; text-align: center; }
.drop.over { border-color: var(--accent); border-style: solid; }
.drop b { font-size: 15px; }
.drop p { color: var(--ink-2); font-size: 12.5px; max-width: 52ch; }
.lock { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; color: var(--ink-2); }
.file-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.file-ico { width: 30px; height: 36px; border-radius: 4px; border: 1px solid var(--accent-line); display: grid; place-items: center; font-size: 9px; font-weight: 700; color: var(--accent); font-family: var(--mono); }
.ex-list { display: grid; gap: 2px; }
.ex-list button { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 7px 8px; border-radius: 6px; font-size: 12.5px; border: 0; background: transparent; text-align: left; cursor: pointer; color: var(--ink); }
.ex-list button:hover { background: var(--bg); }
.ex-list button span { color: var(--ink-3); font-size: 11.5px; }

/* Charts */
svg.chart { width: 100%; height: auto; display: block; overflow: visible; }
.ax { fill: var(--ink-3); font-size: 10.5px; font-family: var(--sans); font-variant-numeric: tabular-nums; }
.ax-strong { fill: var(--ink-2); font-size: 10.5px; font-weight: 600; font-family: var(--sans); }
.ax-name { fill: var(--ink-2); font-size: 11.5px; font-family: var(--sans); }
.grid-l { stroke: var(--grid); stroke-width: 1; }
.base-l { stroke: var(--line); stroke-width: 1; }
.bar { fill: var(--d1); }
.bar.over { fill: var(--risk); }
.tgt { stroke: var(--risk); stroke-width: 1.5; stroke-dasharray: 4 3; }
.curve { fill: none; stroke: var(--d1); stroke-width: 2; }
.curve.s2 { stroke: var(--d2); } .curve.s3 { stroke: var(--d3); } .curve.s4 { stroke: var(--d4); }
.sw { width: 10px; height: 10px; border-radius: 2px; display: inline-block; flex: none; }
.sw.s1 { background: var(--d1); } .sw.s2 { background: var(--d2); } .sw.s3 { background: var(--d3); } .sw.s4 { background: var(--d4); }
.pt { fill: var(--d1); stroke: var(--bg); stroke-width: 2; }
/* Low bars keep the soft fill; the outline gives them 3:1 against the page. */
.lowbar { fill: var(--d1-soft); stroke: var(--d1); stroke-width: 1; }
.highbar { fill: var(--d1); }
.axis0 { stroke: var(--ink-3); stroke-width: 1; }
/* Fan bands are solid tokens per theme; the outer band has an outline (>= 3:1 on the panel in both themes). */
.fan-outer { fill: var(--fan-outer); stroke: var(--fan-edge); stroke-width: 1; }
.fan-inner { fill: var(--fan-inner); }
.fan-med { fill: none; stroke: var(--d1); stroke-width: 2.25; }
.fan-mean { fill: none; stroke: var(--ink-2); stroke-width: 1.25; stroke-dasharray: 5 3; }
.fan-guide { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 2 3; }
.legend i.lg-fan-outer { height: 10px; background: var(--fan-outer); box-shadow: inset 0 0 0 1px var(--fan-edge); }
.legend i.lg-fan-inner { height: 10px; background: var(--fan-inner); }
.legend i.lg-fan-med { background: var(--d1); }
.legend i.lg-fan-mean { height: 0; border-top: 2px dashed var(--ink-2); border-radius: 0; }
.path-s { fill: none; stroke: var(--ink-3); stroke-width: 1; opacity: .8; }
.legend i.lg-path { height: 1px; background: var(--ink-3); }
svg.chart:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pdf { fill: var(--accent); opacity: .12; }
.pdf-l { fill: none; stroke: var(--accent); stroke-width: 2; }
.pdf-m { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 2 3; }
.pmf { fill: var(--accent); }
/* Fit to data: data bars stay neutral, fitted curves use the palette. */
.bar.data { fill: var(--ink-3); opacity: .3; }
.curve.thin { stroke-width: 1.2; }
.dot { fill: var(--d1); } .dot.s2 { fill: var(--d2); } .dot.s3 { fill: var(--d3); }
/* Scatter: translucent dots so dense areas read darker; trials meeting the condition in the risk color. */
.sc-pts { fill: none; stroke: var(--d1); stroke-width: 4.5; stroke-linecap: round; opacity: var(--dot-op); }
.sc-pts.hit { stroke: var(--risk); opacity: .7; }
.sc-trend { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.sc-trend-bg { fill: none; stroke: var(--bg); stroke-width: 5; stroke-linejoin: round; opacity: .85; }
.sc-diag { stroke: var(--ink-2); stroke-width: 1.2; stroke-dasharray: 5 3; }
.halo { paint-order: stroke; stroke: var(--bg); stroke-width: 3px; stroke-linejoin: round; }
.sc-ring { fill: none; stroke: var(--ink); stroke-width: 1.5; pointer-events: none; }
.legend i.lg-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--d1); opacity: .6; }
.legend i.lg-dot.hit { background: var(--risk); opacity: .85; }
.legend i.lg-trend { height: 2px; background: var(--ink); }
.legend i.lg-tgt { height: 0; border-top: 2px dashed var(--risk); border-radius: 0; }
.legend i.lg-diag { height: 0; border-top: 2px dashed var(--ink-2); border-radius: 0; }
.quad td, .quad th { text-align: right; }
.quad th:first-child, .quad td:first-child { text-align: left; }
.quad td.both { color: var(--risk); font-weight: 600; }
.fit-rank td:first-child { width: 28px; }
.fit-rank label { display: flex; gap: 6px; align-items: center; cursor: pointer; min-width: 0; }
.fit-rank input[type="radio"] { accent-color: var(--accent); margin: 0; }
.fit-charts { display: grid; gap: 8px; }
.fit-charts #fit-pp { max-width: 240px; justify-self: center; }
.fit-opts summary { cursor: pointer; }
.fit-opts-row { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; margin-top: 6px; }
.fit-opts-row .field { flex: 1 1 90px; }
.fit-opts-row .in { width: 100%; }
textarea.in { resize: vertical; font-family: var(--mono); font-size: 12px; line-height: 1.4; }
.spark { width: 72px; height: 20px; display: block; }
.spark .a { fill: var(--accent); opacity: .15; }
.spark .l { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.spark rect { fill: var(--accent); }
.hover-hit { fill: transparent; }
.tip { position: fixed; pointer-events: none; background: var(--ink); color: var(--bg); font-size: 11.5px; padding: 4px 8px; border-radius: 5px; font-variant-numeric: tabular-nums; z-index: 20; white-space: nowrap; }

/* Model map */
.map-wrap { border: 1px solid var(--line); border-radius: 8px; overflow: auto; max-height: 70vh; background:
  linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 24px 24px,
  linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 24px 24px, var(--bg); }
.map-wrap svg { display: block; }
.node { cursor: pointer; }
.node rect.box { fill: var(--bg); stroke: var(--line); stroke-width: 1; }
.node:hover rect.box { stroke: var(--ink-3); }
.node.input rect.box { stroke: var(--accent-line); }
.node.output rect.box { stroke: var(--d1); }
/* Selection is not a role color (green = input). */
.node.sel rect.box { stroke: var(--ink); stroke-width: 2.5; }
.node .nt { fill: var(--ink); font-size: 12px; font-weight: 600; font-family: var(--sans); }
.node .nr { fill: var(--ink-3); font-size: 10.5px; font-family: var(--mono); }
.node .tag-bg { fill: var(--surface); }
.node.input .tag-bg { fill: var(--accent-soft); }
.node.output .tag-bg { fill: var(--d1); opacity: .14; }
.node .tag { font-size: 9.5px; font-weight: 600; font-family: var(--sans); fill: var(--ink-3); letter-spacing: .04em; }
.node.input .tag { fill: var(--accent); }
.node.output .tag { fill: var(--d1); }
.node.dim { opacity: .28; }
.node.ghost rect.box { stroke-dasharray: 4 3; fill: var(--surface); }
.node.ghost .nt { fill: var(--ink-2); font-weight: 500; }
.node.compact .nt { font-size: 11.5px; }
.node .role-bar { fill: var(--line); }
.node.input .role-bar { fill: var(--accent); }
.node.output .role-bar { fill: var(--d1); }
.edge { fill: none; stroke: var(--ink-3); stroke-width: 1.2; opacity: .45; }
.edge.hot { stroke: var(--accent); opacity: 1; stroke-width: 1.6; }
.layer-l { fill: var(--ink-3); font-size: 10.5px; font-family: var(--sans); letter-spacing: .06em; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11.5px; color: var(--ink-2); }
.legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; vertical-align: middle; margin-right: 6px; }
.formula { font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); overflow-wrap: anywhere; }

/* Run */
.progress { height: 8px; background: var(--grid); border-radius: 4px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 4px; transition: width .2s; }
.progress i.full { background: var(--good); }
.hw { position: relative; height: 8px; background: var(--grid); border-radius: 4px; min-width: 120px; }
.hw i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--good); }
.hw i.no { background: var(--warn); }
.hw b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink-2); border-radius: 1px; }
.tab-n { font-size: 10.5px; color: var(--ink-3); border: 1px solid var(--line); border-radius: 8px; padding: 0 5px; margin-left: 2px; font-variant-numeric: tabular-nums; }
.period-bar { justify-content: space-between; margin-bottom: 8px; }
.period-link { color: var(--ink); font-size: 12.5px; font-weight: 600; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.period-link:hover { text-decoration-color: var(--ink-3); }
.name-link { color: var(--ink); font-size: inherit; text-align: left; text-decoration: underline dotted; text-decoration-color: var(--ink-3); text-underline-offset: 3px; }
.name-link:hover { color: var(--accent); }
.tabs { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tab { border: 0; background: transparent; padding: 6px 10px; font-size: 12.5px; color: var(--ink-3); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.empty { color: var(--ink-3); font-size: 12.5px; padding: 18px; border: 1px dashed var(--line); border-radius: 8px; text-align: center; }
.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; font-size: 12.5px; z-index: 30; max-width: calc(100% - 32px); }
.toast.err { background: var(--risk); color: var(--toast-err-ink); display: flex; gap: 10px; align-items: center; }
.toast-x { border: 0; background: none; color: inherit; cursor: pointer; font-size: 13px; min-width: 24px; min-height: 24px; padding: 0; }
.toast-x:focus-visible { outline: 2px solid currentColor; outline-offset: 1px; }

@media (max-width: 960px) {
  .body { grid-template-columns: minmax(0, 1fr); }
  .side { border-left: 0; border-top: 1px solid var(--line); }
  .charts { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 620px) {
  .kpis, .kpis.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { border-bottom: 1px solid var(--line); }
  .steps { margin-left: 0; width: 100%; }
  /* Names stay for screen readers; the numbers show. */
  .step .step-l { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .step { padding: 4px 8px; }
  .wide-only { display: none; }
  /* The header scrolls away on phones instead of taking a fifth of the screen. */
  .top { position: static; gap: 8px; padding: 8px 12px; }
  .file { order: 3; width: 100%; }
  .file .file-meta { display: none; }
  .theme { margin-left: auto; }
  .account:not([hidden]) { margin-left: auto; }
  .account:not([hidden]) + .theme { margin-left: 0; }
  .steps { order: 4; }
  .main, .side { padding: 12px; }
  .h .row .in { width: 100% !important; }
  .h .row { width: 100%; flex-wrap: nowrap; }
  .threshold .row { gap: 6px; }
}
/* Inputs and outputs as one card per row on tablets and phones: the columns do not fit. */
@media (max-width: 900px) {
  /* Outputs as one card per row. */
  #outputs thead { display: none; }
  #outputs, #outputs tbody { display: block; }
  #outputs tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "cell rm" "name name" "target target" "dir dir";
    gap: 4px 8px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
  #outputs td { border: 0; padding: 0; min-width: 0; }
  #outputs .c-cell { grid-area: cell; } #outputs .c-rm { grid-area: rm; } #outputs .c-name { grid-area: name; }
  #outputs .c-target { grid-area: target; } #outputs .c-dir { grid-area: dir; }
  #outputs .c-dir select { width: 100%; }
  #outputs .name-in { min-width: 0; width: 100%; }

  .tbl.cards thead { display: none; }
  .tbl.cards, .tbl.cards tbody { display: block; }
  .tbl.cards tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas:
    "cell cell rm" "name name name" "dist dist dist" "params params params" "shape mean range" "err err err";
    gap: 4px 8px; padding: 10px 2px; border-bottom: 1px solid var(--line); align-items: center; }
  .tbl.cards td { border: 0; padding: 0; min-width: 0; }
  .tbl.cards tr.sel, .tbl.cards tr.sel.clickable:hover { background: var(--accent-soft); border-radius: 6px; }
  .tbl.cards tr td, .tbl.cards tr.clickable:hover td, .tbl.cards tr.sel td { background: transparent; }
  .tbl.cards tr { padding: 10px 8px; }
  .tbl.cards .c-cell { grid-area: cell; } .tbl.cards .c-rm { grid-area: rm; justify-self: end; }
  .tbl.cards .c-name { grid-area: name; } .tbl.cards .c-dist { grid-area: dist; }
  .tbl.cards .c-params { grid-area: params; text-align: left; } .tbl.cards .c-shape { grid-area: shape; }
  .tbl.cards .c-mean { grid-area: mean; text-align: left; } .tbl.cards .c-range { grid-area: range; }
  .tbl.cards .c-err { grid-area: err; }
  .tbl.cards .c-dist select.in { width: 100%; }
  .tbl.cards .params { justify-content: flex-start; flex-wrap: wrap; }
  .tbl.cards .params .in { width: 76px; }
  .tbl.cards .card-l { display: inline; color: var(--ink-3); font-size: 11px; }
  .tbl.cards .name-in { min-width: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .progress i { transition: none; } }

/* Map toolbar */
.tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.btn-group { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.btn-group button { border: 0; background: var(--bg); padding: 4px 10px; font-size: 12.5px; cursor: pointer; color: var(--ink-2); }
.btn-group button + button { border-left: 1px solid var(--line); }
.btn-group button:hover { background: var(--surface); }
.btn-group button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Scenarios and correlations */
.scn { border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 8px; }
.scn:first-of-type { border-top: 0; padding-top: 0; }
.scn-h { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.scn-h .in { width: 220px; font-weight: 600; }
.scn-list { display: grid; gap: 6px; font-size: 12.5px; }
.scn-list > div { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.recent-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.recent-row .link { padding: 4px 6px; }
.chip.muted { color: var(--ink-3); }

/* Editable names */
.name-in { border-color: transparent; background: transparent; padding: 3px 6px; min-width: 140px; }
.name-in:hover { border-color: var(--line); background: var(--bg); }
.name-in.edited { font-weight: 600; }

/* Accessibility helpers */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
h2:focus { outline: none; }
h2:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
.tab:focus-visible, .ex-list button:focus-visible, .node:focus-visible, .help:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card-l { display: none; }

/* "?" help and its popover */
.help { width: 16px; height: 16px; min-width: 16px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); color: var(--ink-2);
  font-size: 10.5px; font-weight: 700; line-height: 1; padding: 0; cursor: pointer; display: inline-grid; place-items: center; vertical-align: middle;
  text-transform: none; letter-spacing: 0; position: relative; }
.help::after { content: ""; position: absolute; inset: -5px; } /* 26px touch area */
.help[aria-expanded="true"] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.help-pop { position: absolute; z-index: 40; background: var(--ink); color: var(--bg); font-size: 12px; line-height: 1.45; padding: 8px 10px; border-radius: 6px; box-shadow: 0 4px 14px rgb(0 0 0 / .18); }
.panel-t .t { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; color: var(--ink); }

/* Saved-in-this-browser indicator */
.saved { font-size: 11px; color: var(--good); border-left: 1px solid var(--line); padding-left: 6px; white-space: nowrap; }
.saved.no { color: var(--warn); }

/* Validation */
.issues { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; margin-top: 4px; }
.field-err { font-size: 11.5px; color: var(--risk); }
ul.plain { margin: 0; padding-left: 16px; display: grid; gap: 2px; }
.nowrap-row { flex-wrap: nowrap; }

/* Results */
.ref-l { stroke: var(--ink-2); stroke-width: 1.2; stroke-dasharray: 1 3; stroke-linecap: round; }
.legend i.lg-low { background: var(--d1-soft); outline: 1px solid var(--d1); height: 8px; }
.legend i.lg-high { background: var(--d1); height: 8px; }
.legend i.lg-base { background: var(--ink-3); width: 2px; height: 12px; }
.threshold { gap: 6px; }
.th-p { font-size: 18px; font-weight: 600; min-width: 60px; }
.dir-pick select { padding: 3px 6px; }
.res-opts { gap: 8px 20px; }
.sc-axes { gap: 6px 8px; }
.sc-axes select.sc-axis { width: auto; max-width: min(100%, 300px); }
.sc-presets { gap: 6px; }
/* Ready-made axis pairs: controls, so accent when chosen. */
.chip-btn { border: 1px solid var(--line); background: var(--bg); color: var(--ink-2); border-radius: 999px; padding: 2px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.chip-btn:hover { border-color: var(--accent-line); color: var(--ink); }
.chip-btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.sc-report { gap: 10px; margin-top: 6px; }
.sc-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 2px; }
.sc-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; border-bottom: 1px solid var(--grid); padding: 2px 0; }
.res-panel { display: grid; gap: 14px; min-width: 0; }

/* Unmanaged random sources (RAND cells that are not inputs) on the map: a status color, always with its tag. */
.node.random rect.box { stroke: var(--warn); stroke-dasharray: 5 3; }
.node.random .role-bar { fill: var(--warn); }
.node.random .tag-bg { fill: var(--warn-soft); }
.node.random .tag { fill: var(--warn); }
/* Parameters read from workbook cells. */
.params label.linked-l { display: inline-grid; grid-template-columns: auto auto; row-gap: 1px; }
.params .in.linked { width: 84px; text-align: left; font-family: var(--mono); font-size: 11px; }
.link-v { grid-column: 2; font-size: 10.5px; color: var(--ink-2); text-align: left; white-space: nowrap; }
#import-panel .formula { max-width: 260px; }
/* "=" toggle: phones' number keypads have no "=", so it switches a row's fields to the text keyboard. */
.link-toggle { display: none; font-family: var(--mono); min-width: 28px; min-height: 28px; }
@media (pointer: coarse) { .link-toggle { display: inline-flex; align-items: center; justify-content: center; } }

/* Per-period targets and directions of a range output (under its row). */
.period-row > td { padding-top: 0; border-top: 0; }
.periods > summary { cursor: pointer; color: var(--ink-2); font-size: 12px; padding: 2px 0; }
.periods > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.periods .tbl { margin: 6px 0 4px; }

/* Workbook loading: progress while a worker reads the file, bad-file errors. */
.load-error details { color: var(--ink-2); }
.load-error summary { cursor: pointer; width: max-content; }
.load-error details .formula { display: block; margin-top: 4px; }

/* Truncate / shift fields under an input's parameters, and table editors. */
.mods { margin-top: 3px; text-align: right; }
.mods > summary { cursor: pointer; color: var(--ink-2); font-size: 11px; font-family: var(--mono); list-style-position: inside; }
.mods > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.mods[open] > summary { margin-bottom: 3px; }
.mods .params { flex-wrap: wrap; }
.tbl.cards .mods { text-align: left; }
.dtable { width: 100%; }
.dtable td { padding: 3px 4px; }
.dtable .in { width: 100%; min-width: 64px; text-align: right; }
.dtable td.num { width: 1.5em; text-align: right; white-space: nowrap; }
#table-panel .chart { margin-top: 8px; }
/* Many fields (trigen, metalog) wrap instead of pushing the shape and statistics out of
   view, and an engine message wraps in full inside its cell. */
.c-params .params.many { flex-wrap: wrap; }
.params label { white-space: nowrap; }
.c-err { min-width: 200px; }
.c-err .sub { overflow-wrap: anywhere; }
.issues.hint { margin-top: 4px; text-align: left; }

/* Correlation matrix, correlation from data, sensitivity views */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg-b { border: 0; background: transparent; padding: 4px 10px; font-size: 12px; cursor: pointer; color: var(--ink-2); }
.seg-b[aria-checked="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.seg-b + .seg-b { border-left: 1px solid var(--line); }
.seg-b:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.corr-tools { justify-content: space-between; }
.corr-grid { width: auto; }
.corr-grid th[scope="row"], .corr-grid thead th { max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
.corr-grid td { padding: 3px 4px; text-align: center; vertical-align: top; }
.corr-grid td.diag { color: var(--ink-3); background: var(--surface); padding-top: 7px; }
.corr-in { width: 62px; text-align: right; padding: 3px 6px; }
.corr-grid .applied { display: block; font-size: 10.5px; color: var(--warn); font-weight: 600; margin-top: 2px; white-space: nowrap; }
.corr-paste summary, .spider-values summary { cursor: pointer; }
.corr-paste textarea { margin-top: 6px; }
.corr-data { background: var(--surface); }
.corr-data .tbl select.in { max-width: 180px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.curve.other { stroke: var(--ink-3); opacity: .55; }
.dot.s4 { fill: var(--d4); }
.dot.s1, .dot.s2, .dot.s3, .dot.s4 { stroke: var(--bg); stroke-width: 1; }
.dot.other { fill: var(--ink-3); opacity: .55; }
.legend i.lg-other { background: var(--ink-3); opacity: .55; }
.in.inline { width: auto; display: inline-block; padding: 1px 4px; font-weight: 600; }
#tail-table tr.weak td { color: var(--ink-3); }
.bar-inline.muted { background: var(--ink-3); opacity: .5; }

/* Optimize step: decision cells, statistic rows, sweep chart points. */
.opt-setup { display: grid; gap: 14px; }
.opt-setup .panel { display: grid; gap: 10px; }
.opt-stat { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: end; }
.opt-stat .field { width: auto; }
.narrow-only { display: none; }
@media (max-width: 620px) { .narrow-only { display: block; } }
.btn-group button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.btn-group button:disabled { cursor: default; opacity: .6; }
.dot { fill: var(--d1); stroke: var(--bg); stroke-width: 1; }
.dot.s2 { fill: var(--d2); } .dot.s3 { fill: var(--d3); } .dot.s4 { fill: var(--d4); }
