/* AlgoIQT design system — one token set for public pages and the SPA (dark institutional). */
/* Inter 5.3.0 (fontsource, OFL-1.1) vendored under /static/fonts, latin subset */
@font-face { font-family: Inter; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/static/fonts/inter-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: Inter; font-style: normal; font-weight: 500; font-display: swap;
  src: url(/static/fonts/inter-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: Inter; font-style: normal; font-weight: 600; font-display: swap;
  src: url(/static/fonts/inter-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: Inter; font-style: normal; font-weight: 700; font-display: swap;
  src: url(/static/fonts/inter-latin-700-normal.woff2) format("woff2"); }
:root {
  --bg: #0b1220; --bg2: #101a2c; --panel: #131f34; --panel2: #1a2740; --line: #24344f; --line2: #2e4262;
  --text: #e6edf7; --muted: #8fa1bd; --dim: #8597b1; --blue: #3b8cff; --blue2: #2a6fd6;
  --green: #22c58b; --amber: #f2b33d; --red: #f25c6b; --violet: #9b7cff;
  --radius: 10px; --gap: 16px; --pad: 16px; --fs: 14px; --row: 9px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "DejaVu Sans Mono", "Liberation Mono", "Noto Sans Mono", monospace;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
body.density-compact { --gap: 10px; --pad: 10px; --fs: 13px; --row: 5px; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: var(--fs)/1.5 var(--sans); }
body { overflow-x: hidden; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; margin: 4px 0 12px; letter-spacing: -.01em; }
h2 { font-size: 18px; margin: 0 0 10px; }
h3 { font-size: 15px; margin: 0 0 8px; }
p { margin: 0 0 10px; }
code, .mono { font-family: var(--mono); font-size: .92em; overflow-wrap: anywhere; }
.muted { color: var(--muted); } .dim { color: var(--dim); } .hidden { display: none !important; }
.blue { color: var(--blue); } .pos { color: var(--green); } .neg { color: var(--red); }
.err { color: var(--red); min-height: 1.2em; }
.eyebrow { font-size: 12px; letter-spacing: .14em; color: var(--muted); text-transform: uppercase; }

/* controls */
button, .btn { font: inherit; cursor: pointer; border-radius: 8px; border: 1px solid var(--blue2); background: var(--blue2);
  color: #fff; padding: 7px 14px; display: inline-block; line-height: 1.3; }
button:hover, .btn:hover { background: var(--blue); text-decoration: none; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.outline, .btn.outline { background: transparent; color: var(--text); border-color: var(--line2); }
button.outline:hover, .btn.outline:hover { background: var(--panel2); }
button.danger { background: var(--red); border-color: var(--red); }
button.danger:hover { background: #ff6474; }
button.tiny, .tiny { padding: 4px 9px; font-size: 12px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--bg2); border: 1px solid var(--line2);
  border-radius: 7px; padding: 6px 9px; max-width: 100%; }
label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
label input, label select, label textarea { display: block; width: 100%; margin-top: 3px; color: var(--text); }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 12px; align-items: end; }

/* pills / badges */
.pill { white-space: nowrap; display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; border: 1px solid var(--line2);
  color: var(--muted); white-space: nowrap; }
.pill.green { color: var(--green); border-color: rgba(34,197,139,.45); background: rgba(34,197,139,.08); }
.pill.amber { color: var(--amber); border-color: rgba(242,179,61,.45); background: rgba(242,179,61,.08); }
.pill.red { color: var(--red); border-color: rgba(239,79,95,.5); background: rgba(239,79,95,.08); }
.pill.blue { color: var(--blue); border-color: rgba(59,140,255,.45); background: rgba(59,140,255,.08); }

/* layout: public */
.pubhead { display: flex; align-items: center; gap: 16px; padding: 14px 24px; border-bottom: 1px solid var(--line);
  background: var(--bg2); position: relative; flex-wrap: wrap; }
.pubnav { display: flex; gap: 18px; margin-left: auto; flex-wrap: wrap; }
.pubnav a { color: var(--muted); } .pubnav a.active, .pubnav a:hover { color: var(--text); text-decoration: none; }
.navtoggle, .burger { display: none; }
.pubmain { max-width: 1080px; margin: 0 auto; padding: 24px; }
.pubfoot { border-top: 1px solid var(--line); color: var(--dim); font-size: 12px; }
.pubfootin { max-width: 1080px; margin: 0 auto; padding: 18px 24px; display: flex; gap: 4px 16px; flex-wrap: wrap;
  align-items: baseline; color: var(--muted); }
body.public { min-height: 100vh; display: flex; flex-direction: column; }
body.public .pubmain { flex: 1 0 auto; width: 100%; }
.pubmain p, .pubmain ol, .pubmain ul { max-width: 72ch; }
.pubmain .grid3 > .card { margin: 0; height: 100%; } .pubmain .grid3 { align-items: stretch; }
.pubnav { align-items: center; } .pubnav .navcta { line-height: 1.4; }
.timeline { max-width: none !important; } .card.waiting { margin-top: 16px; }
.grid3.cols2 > .card:last-child:nth-child(odd) { grid-column: 1 / -1; }
.timeline p { max-width: none !important; } .note { color: #8b98ad; max-width: 70ch; }
.pubhead { padding-left: max(24px, calc((100% - 1080px) / 2 + 24px)); padding-right: max(24px, calc((100% - 1080px) / 2 + 24px)); }
.pubfootin a { padding: 0; line-height: 2.2; } .pubmain .ctas { margin-top: 28px; }
.pubmain td:first-child { font-variant-numeric: normal; } .vsrc { white-space: nowrap; } .vsrc .dim { color: var(--muted); }
.pubmain:has(> .login) { display: grid; align-content: start; justify-items: center; padding-top: 48px; }
.pubmain:has(> .login) > .notice { margin-bottom: 16px; }
.pubmain > .login { width: 100%; margin: 0; } .login .small { font-size: 13px; color: var(--muted); }
.pubmain .card p { max-width: none; }
.pubmain h1 { margin-bottom: 6px; } .pubmain h1 + .lead { margin-top: 0; margin-bottom: 20px; }
.pubmain .card h3 { margin: 0 0 6px; }
.grid3.cols3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid3.cols2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pubmain .chips { margin: 8px 0; } .pubmain .chips span { padding: 3px 10px; border: 1px solid var(--line2);
  border-radius: 999px; font-size: 12px; color: var(--muted); background: var(--panel2); white-space: nowrap; }
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.timeline li:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (max-width: 760px) { .timeline { grid-template-columns: 1fr; } }
.timeline li { display: grid; grid-template-columns: 34px 1fr; gap: 14px; padding: 14px 16px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); }
.timeline .num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 600;
  background: rgba(59,140,255,.14); color: var(--blue); border: 1px solid rgba(59,140,255,.45); }
.timeline h3 { margin: 3px 0 4px; font-size: 15px; } .timeline p { margin: 0; color: var(--muted); }
.card.sec { padding-left: 40px; position: relative; }
.card.sec h3::before { content: "✓"; color: var(--green); position: absolute; left: 16px; }
.plan { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(0, 2fr); column-gap: 40px; padding: 24px 28px; gap: 20px; align-items: center; }
.plan .price { font-size: 30px; font-weight: 700; margin-top: 4px; } .plan .price span { font-size: 14px;
  font-weight: 400; color: var(--muted); }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.checks li { display: flex; gap: 8px; } .checks li::before { content: "✓"; color: var(--green); flex: 0 0 auto; }
.note { font-size: 13px; color: var(--dim); margin-top: 18px; }
.h2s { font-size: 18px; margin: 28px 0 10px; }
.pubmain textarea { resize: vertical; }
.small { font-size: 12px; } .nowrap { white-space: nowrap; }
.login .btn { width: 100%; margin-top: 6px; } .login label { font-size: 13px; }
.login h1 { margin: 0 0 4px; } .login form { display: grid; gap: 10px; margin-top: 14px; }
.hero { padding: 28px 0 18px; }
.lead { font-size: 16px; color: var(--muted); max-width: 760px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--gap); margin: 16px 0; }
.steps li, .bullets li { margin-bottom: 8px; }
.notice.slim { padding: 6px 12px; font-size: 12px; display: inline-block; }
.hero h1 { max-width: none; font-size: 32px; }
.herofig a { display: block; } .herofig a:hover img { border-color: var(--blue); }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 28px; align-items: center; }
.hero h1 { font-size: 34px; line-height: 1.18; letter-spacing: -.02em; text-wrap: balance; hyphens: manual; }
.ctas { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.herofig { margin: 0; min-width: 0; } .herofig img { display: block; width: 100%; height: auto; border-radius: var(--radius);
  border: 1px solid var(--line2); box-shadow: 0 18px 50px rgba(0,0,0,.45); }
.herofig figcaption { font-size: 12px; color: var(--dim); margin-top: 6px; }
.hint-tap { display: none; } @media (pointer: coarse) { .hint-click { display: none; } .hint-tap { display: inline; } }
.herofig a { position: relative; } .herofig .expand { position: absolute; right: 10px; bottom: 10px; width: 32px; height: 32px;
  display: grid; place-items: center; border-radius: 8px; background: rgba(9,13,20,.82); color: #fff; font-size: 18px;
  border: 1px solid var(--line2); pointer-events: none; }
.access { max-width: none; margin: 36px 0 8px; } .access > p { margin-bottom: 18px; } .access .form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.access .wide, .access button { grid-column: 1 / -1; } .access label { font-size: 13px; } .access button { justify-self: start; }
.access textarea { width: 100%; resize: vertical; font: inherit; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.logo { display: block; flex: 0 0 auto; }
.pubnav .navcta { color: #fff; padding: 4px 12px; font-size: inherit; }
@media (max-width: 900px) { .grid3.cols3, .grid3.cols2, .plan { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; } .hero h1 { font-size: 27px; } .access .form { grid-template-columns: 1fr; } }
.login { max-width: 400px; margin: 40px auto; }

/* layout: app */
.brand, .brand:hover { text-decoration: none; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; color: var(--text); }
.brandicon { color: var(--blue); }
.layout { display: flex; min-height: 100vh; background: linear-gradient(to right, var(--bg2) 235px, var(--line) 235px, var(--line) 236px, transparent 236px); }
.layout > .sidebar { align-self: flex-start; }
.sidebar { width: 236px; flex: 0 0 236px; background: var(--bg2); border-right: 1px solid var(--line); padding: 18px 14px;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.tagline { color: var(--muted); font-size: 12px; margin: 6px 0 18px; line-height: 1.35; }
.caption { font-size: 12px; letter-spacing: .16em; color: var(--dim); margin-bottom: 6px; }
#nav a { display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; border-radius: 7px;
  color: var(--muted); margin-bottom: 1px; }
#nav a:hover { background: var(--panel); color: var(--text); text-decoration: none; }
#nav a.active { background: var(--panel2); color: var(--text); box-shadow: inset 2px 0 0 var(--blue); }
#nav a .off { font-size: 12px; color: var(--amber); }
.sidebottom { margin-top: auto; padding-top: 16px; display: grid; gap: 8px; }
.health { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.health small { color: var(--dim); width: 100%; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); display: inline-block; }
.dot.ok { background: var(--green); } .dot.warn { background: var(--amber); } .dot.bad { background: var(--red); }
main.app { flex: 1; min-width: 0; padding: 18px 24px 40px; }
header.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap;
  margin-bottom: 12px; }
.headright { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.menubtn { display: none; }
.notice { border: 1px solid rgba(242,179,61,.4); background: rgba(242,179,61,.07); color: var(--amber);
  padding: 9px 12px; border-radius: 8px; margin-bottom: 14px; font-size: 13px; }
.notice.red { border-color: rgba(239,79,95,.5); background: rgba(239,79,95,.08); color: var(--red); }
.notice.blue { border-color: rgba(59,140,255,.4); background: rgba(59,140,255,.07); color: #9cc3ff; }

/* panels */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--pad);
  min-width: 0; }
.grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); margin-bottom: var(--gap); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); align-items: start; }
.kpis { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: var(--gap); }
.kpi .label { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.kpi .value { font-size: 22px; font-weight: 650; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12px; color: var(--dim); }
.section { margin-bottom: var(--gap); }
.grid > .section, .kpis > .section { margin-bottom: 0; } /* grid gap owns the rhythm (no doubled spacing) */
.kpi { display: flex; flex-direction: column; } .kpi .sub { margin-top: auto; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: minmax(110px, max-content) 1fr; gap: 4px 12px; font-size: 13px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: break-word; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: var(--gap); }
.chip { display: inline-flex; gap: 6px; align-items: baseline; padding: 4px 10px; border: 1px solid var(--line2);
  border-radius: 999px; font-size: 12px; color: var(--muted); background: var(--panel); white-space: nowrap; }
.chip b { color: var(--text); font-weight: 600; } .chip.off b { color: var(--amber); } .chip.on b { color: var(--green); }
.pill.dim { color: var(--dim); border-style: dashed; background: transparent; }  /* muted without opacity (keeps AA contrast) */
.chips.tight { margin: 0; gap: 4px; }
.card h3 .cardmeta { display: block; font-size: 12px; font-weight: 400; margin-top: 2px; }
h4.sub { margin: 12px 0 4px; font-size: 12px; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.card > h4.sub:first-of-type { margin-top: 0; }
.levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 10px; margin: 10px 0 6px; }
details.lvl summary { cursor: pointer; font-size: 12px; color: var(--muted); margin-top: 6px; }
.proxybox { border: 1px dashed var(--line2); border-radius: 8px; padding: 6px 8px; margin-top: 8px; }
.proxybox .sub { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.levels span { color: var(--muted) !important; font-size: 12px !important; }
.levels div { min-width: 0; } .levels span { display: block; font-size: 12px; color: var(--dim); }
.levels b { font-weight: 600; font-variant-numeric: tabular-nums; font-size: 13px; }
.skel { display: block; height: 12px; border-radius: 6px; margin: 8px 0; max-width: 100%;
  background: linear-gradient(90deg, var(--panel2), var(--line), var(--panel2)); background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite; }
.skel.big { height: 26px; width: 55%; } .skel.w70 { width: 70%; } .skel.w40 { width: 40%; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (max-width: 420px) { .levels { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.empty { color: var(--muted); border: 1px dashed var(--line2); border-radius: 8px; padding: 14px; text-align: center; }
.loading { color: var(--muted); padding: 14px; }
.loading::before { content: ""; display: inline-block; width: 10px; height: 10px; border: 2px solid var(--line2);
  border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
.errorbox { color: var(--red); border: 1px solid rgba(239,79,95,.45); border-radius: 8px; padding: 12px; }
.notenabled { max-width: 640px; }
.bar { height: 8px; background: var(--bg2); border-radius: 4px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--blue); }
.bar > span.red { background: var(--red); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs button { background: transparent; border-color: var(--line2); color: var(--muted); }
.tabs button.on { background: var(--panel2); color: var(--text); border-color: var(--blue2); }
pre { background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 10px; overflow-x: auto;
  font: 12px/1.45 var(--mono); max-height: 360px; }
svg.chart { width: 100%; height: 180px; display: block; }

/* tables */
.tablewrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.fixed { table-layout: fixed; } table.fixed td, table.fixed th { overflow: hidden; text-overflow: ellipsis; }
table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: var(--row) 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
td.wrap { white-space: normal; min-width: 200px; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--panel2); }
body.mode-basic .adv { display: none !important; }
/* M14 V6: below 640 px every data table becomes a stack of cards (label: value rows), no hidden columns */
@media (max-width: 640px) {
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack thead { display: none; }
  table.stack tr { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; margin-bottom: 8px;
    background: var(--panel2); }
  table.stack td { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border: 0;
    padding: 4px 0; white-space: normal; min-width: 0; text-align: right; overflow-wrap: anywhere; }
  table.stack td::before { content: attr(data-label); flex: 0 0 auto; max-width: 45%; text-align: left;
    color: var(--dim); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
  table.stack td[data-label=""]::before { content: none; }
  table.stack td[data-label=""] { justify-content: flex-end; }
  table.stack td:first-child { font-weight: 600; }
  .kv dd { overflow-wrap: break-word; } td, .kv dd { hyphens: none; }
  table.stack td > .chips, table.stack td > span:only-child { justify-content: flex-end; max-width: 75%; }
  table.stack .pill { text-align: center; }
  /* compact: title cell on its own line, then label/value pairs in a fixed 2-column grid (aligned across rows) */
  table.stack.compact tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 14px; padding: 8px 10px; }
  table.stack.compact td { display: flex; justify-content: flex-start; gap: 6px; padding: 1px 0; text-align: left; min-width: 0; }
  table.stack.compact td::before { max-width: none; font-size: 12px; flex: 0 0 auto; }
  table.stack.compact td:first-child, table.stack.compact td.wrap, table.stack.compact td.full, table.stack.compact td[data-label="Action"] { grid-column: 1 / -1; }
  table.stack.compact td.nil { display: none; }
  .form { grid-template-columns: 1fr; }
  table.stack.compact td[data-label="Action"] { justify-content: flex-end; }
  table.stack.compact td[data-label="Action"]::before { content: none; }
  table.stack.compact td:first-child::before, table.stack.compact td[data-label=""]::before { content: none; }
  table.stack.compact.actfirst td:first-child { order: 9; justify-content: flex-end; font-weight: 400; }
  table.stack.compact.actfirst td:nth-child(2) { grid-column: 1 / -1; font-weight: 600; }
  table.stack.compact.actfirst td:nth-child(2)::before { content: none; }
}

/* modal */
.modal { position: fixed; inset: 0; background: rgba(3,7,15,.72); display: flex; align-items: center;
  justify-content: center; padding: 16px; z-index: 50; }
.dialog { background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; padding: 20px; width: 100%;
  max-width: 460px; }
.actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.scrim { display: none; }

@media (max-width: 900px) {
  .layout { background: none; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 40; transform: translateX(-100%); transition: transform .18s; }
  body.drawer .sidebar { transform: none; }
  body.drawer .scrim { display: block; position: fixed; inset: 0; background: rgba(3,7,15,.6); z-index: 30; }
  .menubtn { display: inline-block; }
  main.app { padding: 12px 14px 32px; }
  h1 { font-size: 20px; }
  .grid.two { grid-template-columns: 1fr; }
  .pubhead { padding: 12px 16px; }
  .burger { display: block; margin-left: auto; font-size: 22px; cursor: pointer; color: var(--text); }
  .pubnav { display: none; width: 100%; flex-direction: column; gap: 10px; margin: 0; }
  .navtoggle:checked ~ .pubnav { display: flex; }
  .pubmain { padding: 16px; } .hero h1 { font-size: 24px; } .pubfootin { padding: 14px 16px; }
  .pubhead { padding-left: 16px; padding-right: 16px; }
  .pubmain table.stack.cat td { justify-content: flex-start; text-align: left; padding: 2px 0; }
  .pubmain table.stack.cat td::before { content: none; }
  .pubmain table.stack.cat tr { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
  .pubmain table.stack.cat td { width: auto; display: inline; }
  .pubmain table.stack.cat td:first-child { font-size: 15px; width: 100%; }
  .pubmain table.stack.cat td:not(:first-child) { color: var(--muted); font-size: 12px; }
  .pubmain table.stack.cat td:last-child { width: 100%; }
  .herofig img { max-height: 360px; object-fit: cover; object-position: left top; }
  .pubmain:has(> .login) { padding-top: 20px; }
  .kv { grid-template-columns: minmax(96px, 40%) 1fr; gap: 6px 10px; }
}
@media (max-width: 640px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpis > .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; } }
@media (max-width: 640px) { .form > button[type=submit] { grid-column: 1 / -1; } }
@media (max-width: 640px) {
  .pubmain table.stack.cat td:first-child { font-size: 16px; }
  .pubmain table.stack.cat td:not(:first-child) { font-size: 13px; }
  .pubmain table.stack:not(.cat) td { justify-content: space-between; }
}
details.fold > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: "▾"; color: var(--muted); font-size: 14px; }
details.fold:not([open]) > summary::after { content: "▸"; }
details.fold > summary h3 { margin: 0; } details.fold[open] > summary { margin-bottom: 10px; }
@media (max-width: 640px) { svg.chart { height: 200px; } }
.pubmain tr.grp th { background: var(--panel2); color: var(--text); font-size: 12px; letter-spacing: .06em; padding-top: 10px; }
@media (max-width: 640px) {
  .pubmain table.stack.cat tr.grp { display: block; border: 0; background: none; padding: 14px 0 4px; margin: 0; }
  .pubmain table.stack.cat tr.grp th { display: block; background: none; padding: 0; font-size: 12px; color: var(--muted); }
  .pubmain table.stack.cat tr { padding: 8px 10px; margin-bottom: 6px; }
  .pubmain table.stack.cat td:first-child { font-size: 15px; }
}
.stale { opacity: .45; text-decoration: line-through; text-decoration-thickness: 1px; }
input[type=date], input[type=number], input, select { height: 34px; box-sizing: border-box; } textarea { height: auto; }
.form label { align-self: end; }
@media (max-width: 640px) {
  table.stack td.wrap { flex-direction: column; align-items: flex-start; text-align: left; gap: 4px; }
  table.stack td.wrap > .chips { justify-content: flex-start; max-width: 100%; }
  .levels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.shocks { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.shocks div { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: var(--panel2); }
.shocks span { display: block; font-size: 12px; color: var(--muted); } .shocks b { font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .shocks { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  table.stack.compact.actfirst tr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  table.stack.compact.actfirst td:first-child button { min-height: 34px; min-width: 64px; }
  table.stack.compact.actfirst td { font-size: 13px; }
}
@media (max-width: 640px) { table.stack.compact.caps tr { grid-template-columns: repeat(2, minmax(0, 1fr)); } table.stack.compact.caps td { flex-direction: column; gap: 0; } }
.xaxis { position: relative; display: flex; justify-content: space-between; font-size: 12px; height: 16px; }
.xmark { position: absolute; top: 0; transform: translateX(-50%); color: var(--amber); white-space: nowrap; }
@media (max-width: 640px) { table.stack.compact td { white-space: nowrap; } table.stack.compact td.wrap, table.stack.compact td.full { white-space: normal; } }
@media (max-width: 640px) {
  .herofig img { max-height: 200px; object-position: 0 18%; }
  .pubmain tr.grp th { font-size: 13px !important; color: var(--text) !important; letter-spacing: .04em; }
  .pubmain table.stack.cat td:not(:first-child) { font-size: 13px; color: var(--muted); }
  .pubmain table.stack.cat code { font-size: 12px; }
}
.pubmain:has(> .login) > .notice { max-width: 400px; box-sizing: border-box; text-align: left; }
@media (max-width: 640px) { .herofig img { max-height: none !important; object-fit: contain !important; } }
.levels.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 640px) { .levels.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
svg.chart + .spread, .xaxis { font-size: 12px !important; }
@media (max-width: 640px) {
  .pubfootin { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
  .pubfootin > span { grid-column: 1 / -1; margin-bottom: 6px; }
  .pubfootin a { line-height: 2.4; }
}
@media (max-width: 640px) { table.stack td.dsk { display: none; } }
/* M15 W1 scanner: summary + regime side by side on desktop, stacked on mobile */
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); align-items: stretch; }
.grid2 > .card { margin: 0; } .grid2 { margin-bottom: var(--gap); }
/* M18 E4: card-title controls sit on the title row, vertically centred (was float:right, drifted on wrap) */
.card h3:has(> .h3right) { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.card h3 > .h3right { margin-left: auto; } .card h3:has(> .h3right) > .cardmeta { order: 3; flex-basis: 100%; }
@media (max-width: 640px) { table.stack td[data-label="State"] { flex-wrap: wrap; justify-content: flex-end; text-align: right; } }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } }
.pill b { font-weight: 700; margin-left: 2px; }
/* M15 W3 command center: one CTA card spans the three ledger KPIs; blotter / greeks / alerts share one row */
.kpis.withcta { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpis .span3 { grid-column: span 3; } .kpis .span4 { grid-column: span 4; }
.grid.three { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 1100px) { .kpis.withcta { grid-template-columns: repeat(3, minmax(0, 1fr)); } .kpis .span4 { grid-column: 1 / -1; } .grid.three { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .kpis.withcta { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpis .span3, .kpis .span4 { grid-column: 1 / -1; }
  .kpis.withcta > .kpi:last-child { grid-column: 1 / -1; } .grid.three { grid-template-columns: 1fr; } }
/* M15 W4 public: smooth scroll to the access form, privacy note, legal prose, copyright line */
html { scroll-behavior: smooth; } #access { scroll-margin-top: 80px; }
.access .privacy { grid-column: 1 / -1; margin: 0; }
.prose h3 { margin: 18px 0 6px; } .prose h3:first-child { margin-top: 0; } .prose p { max-width: 72ch; }
.pubfootin .copy { flex-basis: 100%; color: var(--dim); font-size: 12px; margin-top: 4px; }
@media (max-width: 640px) { .pubfootin > .copy { grid-column: 1 / -1; margin: 6px 0 0; } }
/* M16 Y1: app toggle (replaces the native checkbox) + segmented scope control */
label.switch { display: inline-flex; align-items: center; gap: 8px; margin: 0; cursor: pointer; color: var(--muted);
  font-size: 12px; font-weight: 400; }
label.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
label.switch .knob { position: relative; width: 30px; height: 17px; border-radius: 999px; background: var(--panel2);
  border: 1px solid var(--line2); flex: none; transition: background .15s; }
label.switch .knob::after { content: ""; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px;
  border-radius: 50%; background: var(--muted); transition: transform .15s; }
label.switch input:checked + .knob { background: var(--blue2); border-color: var(--blue2); }
label.switch input:checked + .knob::after { transform: translateX(13px); background: #fff; }
label.switch input:focus-visible + .knob { outline: 2px solid var(--blue); outline-offset: 2px; }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 8px; overflow: hidden; font-weight: 400; }
.seg button { border: 0; border-radius: 0; background: transparent; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--panel2); color: var(--text); }
/* M16 Y2: Command Center rhythm */
.cardlink { float: right; font-size: 12px; font-weight: 400; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.grid.cc-top { grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); align-items: stretch; } /* M17 D2: equal heights */
.grid.three.eqh { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; }
.grid.three.eqh > .section, .grid.cc-top > .section { display: flex; flex-direction: column; }
.grid.three.eqh > .section > .empty { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 96px; }
@media (max-width: 1100px) { .grid.three.eqh { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .grid.three.eqh { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .grid.cc-top { grid-template-columns: 1fr; } }
/* M17 D1: failed-gate drill-down (symbol · strategy — reason) */
details.gatedrill { margin: 4px 0 0; } details.gatedrill summary { cursor: pointer; }
details.gatedrill ul { margin: 4px 0 0 18px; padding: 0; } details.gatedrill li { margin: 2px 0; overflow-wrap: anywhere; }
/* M17 D3: SPX without a level is one line (no big dash) */
.spxline { margin: 6px 0 4px; font-size: 13px; color: var(--muted); } .spxline b { color: var(--text); }
