/* TAA Stress-Test Explorer — "stress lab report" identity (D-107, 2026-11-23).
   Layout: an engineering load-test report. White sheets on a cool desk, ruled sections,
   cobalt = everything simulated, ochre (--real) = what actually happened, used nowhere else.
   Variable names kept from the earlier palette: charts.js reads them. */
:root {
  --page: #e9edf1; --surface-1: #ffffff;
  --ink-1: #16202a; --ink-2: #435060; --ink-3: #66727f;
  --grid: #e2e7ec; --axis: #c9d1d9; --rule: #c9d1d9; --heavy: #16202a;
  --ring: rgba(22,32,42,0.07);
  --s1: #1f4fb8; --s3: #0e8a84; --s6: #c0392f; --s5: #6a4fc1;
  --s4: #2f7d32; --s7: #c2477f; --s8: #d1612a; --s2: #5f7d95;
  --real: #a2600a; --real-soft: rgba(162,96,10,0.10);
  --good: #1d7f3a; --warn: #b89400; --serious: #d1612a; --crit: #c0392f;
  --band-strong: rgba(31,79,184,0.30); --band-weak: rgba(31,79,184,0.12);
  --tip-bg: #16202a; --tip-ink: #eef2f6;
  --f-head: "IBM Plex Sans Condensed", "Arial Narrow", system-ui, sans-serif;
  --f-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
:root[data-theme="dark"] {
  --page: #0e141a; --surface-1: #151d25;
  --ink-1: #e6ebf0; --ink-2: #aab6c2; --ink-3: #7d8995;
  --grid: #212b35; --axis: #2b3642; --rule: #2b3642; --heavy: #e6ebf0;
  --ring: rgba(230,235,240,0.08);
  --s1: #78a2ff; --s3: #3cc4bd; --s6: #ef6b60; --s5: #a693f0;
  --s4: #5fbf62; --s7: #e07aa8; --s8: #ee8a52; --s2: #8fa9be;
  --real: #e3a548; --real-soft: rgba(227,165,72,0.13);
  --good: #4cc070; --warn: #e2c040; --serious: #ee8a52; --crit: #ef6b60;
  --band-strong: rgba(120,162,255,0.32); --band-weak: rgba(120,162,255,0.14);
  --tip-bg: #e6ebf0; --tip-ink: #10171e;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--page); color: var(--ink-1);
  font: 15px/1.55 var(--f-body);
}
h1, h2, h3 { font-family: var(--f-head); text-wrap: balance; }
a { color: var(--s1); }
:focus-visible { outline: 2px solid var(--s1); outline-offset: 2px; }

/* ---------- header: brand + tabs, then the context bar ---------- */
header {
  background: var(--surface-1); border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 10;
}
.topbar, .ctxbar {
  display: flex; align-items: center; gap: 10px 20px; flex-wrap: wrap;
  max-width: 1440px; margin: 0 auto;
  padding-left: max(22px, env(safe-area-inset-left, 0px)); padding-right: max(22px, env(safe-area-inset-right, 0px));
}
.topbar { padding-block: 6px; }
.ctxbar { padding-block: 8px 10px; align-items: flex-end; border-top: 1px solid var(--grid); }
header h1 { font: 700 15px/1 var(--f-head); letter-spacing: .08em; text-transform: uppercase; margin: 0;
  display: flex; align-items: center; gap: 10px; white-space: nowrap; }
header h1 .mark { width: 18px; height: 18px; border: 2px solid var(--heavy); display: inline-block; position: relative; flex: none; }
header h1 .mark::after { content: ""; position: absolute; left: 2px; right: 2px; bottom: 2px; height: 5px; background: var(--real); }
header .sub { color: var(--ink-3); font-size: 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.spacer { flex: 1; }
.ctl { display: flex; flex-direction: column; gap: 3px; min-width: 0; margin: 0; }
.ctl > .lbl { font: 600 11px var(--f-head); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.ctl.strategy { flex: 1 1 340px; }
.ctl.strategy select { width: 100%; }
.ctl.find { flex: 0 1 230px; }
.ctl.find input, .pick-search { font: inherit; font-size: 14px; color: var(--ink-1); background: var(--surface-1);
  border: 1px solid var(--axis); border-radius: 2px; padding: 6px 10px; width: 100%; }
.pick-search { max-width: 420px; margin: 0 0 10px; }
.ctl .lbl .count { text-transform: none; letter-spacing: 0; font-weight: 400; }
.sheet-link { font-size: 13px; align-self: flex-end; padding-bottom: 8px; white-space: nowrap; }
a.sheet-mini { font-size: 12px; margin-left: 8px; white-space: nowrap; }
select, button, input[type="text"], input[type="number"], textarea {
  font: inherit; font-size: 14px; color: var(--ink-1); background: var(--surface-1);
  border: 1px solid var(--axis); border-radius: 2px; padding: 6px 10px;
}
select { max-width: 100%; }
button { cursor: pointer; }
button.primary { background: var(--heavy); color: var(--surface-1); border-color: var(--heavy);
  font: 600 13px var(--f-head); letter-spacing: .06em; text-transform: uppercase; padding: 8px 14px; }
button.ghost { font-family: var(--f-body); }
button.ghost:hover { background: var(--ring); }
#theme-toggle { font: 500 12px var(--f-mono); color: var(--ink-2); padding: 5px 9px; }
nav.tabs { display: flex; gap: 2px; flex-wrap: wrap; }
nav.tabs button {
  border: none; background: none; padding: 9px 12px 8px; color: var(--ink-3);
  border-bottom: 3px solid transparent; border-radius: 0;
  font: 600 14px var(--f-head); letter-spacing: .05em; text-transform: uppercase;
}
nav.tabs button.active { color: var(--ink-1); border-bottom-color: var(--s1); }
nav.tabs button:hover { color: var(--ink-1); }
nav.subtabs {
  display: flex; gap: 2px; background: var(--page); border-bottom: 1px solid var(--rule); flex-wrap: wrap;
  padding-left: max(22px, env(safe-area-inset-left, 0px)); padding-right: max(22px, env(safe-area-inset-right, 0px));
}
nav.subtabs:empty { display: none; }
nav.subtabs button { border: none; background: none; padding: 8px 12px; color: var(--ink-2); border-radius: 0;
  font-size: 14px; border-bottom: 2px solid transparent; }
nav.subtabs button.active { color: var(--ink-1); border-bottom-color: var(--s1); font-weight: 600; }
body.on-start .ctxbar { display: none; }

main { padding: 26px max(22px, env(safe-area-inset-right, 0px)) 72px max(22px, env(safe-area-inset-left, 0px)); max-width: 1440px; margin: 0 auto; }
.site-foot { max-width: 1440px; margin: 0 auto; padding: 0 22px 40px; font-size: 12.5px; color: var(--ink-3, #777); }
.site-foot p { margin: 0 0 6px; }

/* ---------- sheets (cards) ---------- */
.grid { display: grid; gap: 18px; }
.tiles { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 980px) { .two { grid-template-columns: 1fr; } }
.card {
  background: var(--surface-1); border: 1px solid var(--rule); border-radius: 2px;
  padding: 14px 16px 16px; margin-bottom: 18px; min-width: 0;
}
.grid > .card { margin-bottom: 0; }
.grid { margin-bottom: 18px; }
.card h3 {
  margin: -14px -16px 12px; padding: 11px 16px; border-bottom: 1px solid var(--rule);
  font: 600 14px/1.3 var(--f-head); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-1);
}
.card h3:not(:first-child) { margin: 18px 0 8px; padding: 0 0 6px; }
.card .note { color: var(--ink-2); font-size: 13.5px; margin-top: 10px; max-width: 92ch; }
.card p { max-width: 80ch; }
.tile h3 { margin: 0 0 6px; padding: 0; border: 0; font-size: 12px; color: var(--ink-2); letter-spacing: .1em; }
.tile { border-top: 3px solid var(--heavy); }
.tile .value { font: 600 30px/1.1 var(--f-head); margin-top: 2px; font-variant-numeric: tabular-nums; }
.tile .qual { font-size: 13px; color: var(--ink-2); margin-top: 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot.good { background: var(--good); } .dot.warn { background: var(--warn); }
.dot.serious { background: var(--serious); } .dot.crit { background: var(--crit); }
.chart { width: 100%; min-height: 320px; }
.chart.tall { min-height: 420px; }

/* ---------- tables ---------- */
table.data { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; display: block; overflow-x: auto; max-width: 100%; }
table.data th, table.data td { text-align: right; padding: 8px 12px; border-bottom: 1px solid var(--grid); }
table.data td { font-family: var(--f-mono); font-size: 13.5px; }
table.data td:first-child { font-family: var(--f-body); font-size: 14px; }
table.data th {
  color: var(--ink-3); font: 600 11.5px var(--f-head); letter-spacing: .08em; text-transform: uppercase;
  border-bottom: 1px solid var(--heavy); cursor: pointer; user-select: none; white-space: nowrap; padding-right: 16px;
}
table.data th:first-child, table.data td:first-child { text-align: left; padding-left: 0; }
table.data tbody tr:hover { background: var(--ring); cursor: pointer; }
table.data tr.sel { outline: 2px solid var(--s1); outline-offset: -2px; }
table.data td.real, table.data th.real { color: var(--real); }
table.data td.real.out { font-weight: 600; }
.dot + * , td > .dot { margin-right: 6px; }
table.mono td { font-size: 11px; }
.ledger-wrap { max-height: 380px; overflow: auto; margin-top: 12px; border: 1px solid var(--grid); }
.ledger-wrap table.data th { position: sticky; top: 0; background: var(--surface-1); cursor: default; }
.ledger-wrap table.data tbody tr:hover { cursor: default; }
.ledger-wrap td.holdings { text-align: left; font-size: 12px; }
.ledger-wrap tr.killrow td { color: var(--crit); font-weight: 600; }
.ledger-wrap tr.offrow { opacity: 0.75; }
.ledger-wrap.tall { max-height: 640px; }
.ledger-wrap td.why { text-align: left; font-size: 12px; line-height: 1.4; min-width: 280px; max-width: 560px; white-space: normal; overflow-wrap: anywhere; }
.ledger-wrap td.why > div + div { margin-top: 2px; }
.ledger-wrap td { vertical-align: top; }
.ledger-wrap tr.chg td.holdings { font-weight: 600; }
.rule-summary { white-space: pre-wrap; }
table.data.wrap th { white-space: normal; cursor: default; }
table.data.wrap tbody tr:hover { cursor: default; }
table.data.wrap tbody tr[data-sid]:hover { cursor: pointer; }
table.drops th, table.drops td { padding: 9px 0 9px 16px; }

/* ---------- chips, notes, misc ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 7px; max-width: 100%;
  border-radius: 2px; border: 1px solid var(--rule); font: 500 12px/1.3 var(--f-mono); color: var(--ink-2);
  white-space: normal; text-align: left; background: none;
}
button.badge { cursor: help; }
.badge.real { color: var(--real); background: var(--real-soft); border-color: transparent; }
.chips.vs-bench { margin: 4px 0 18px; }
.badge.vs b { color: var(--ink-1); font-weight: 600; }
.real-num { font-family: var(--f-mono); font-size: 0.92em; color: var(--real); background: var(--real-soft); padding: 1px 5px; border-radius: 2px; white-space: nowrap; }
.muted { color: var(--ink-3); }
.mono { font-family: var(--f-mono); font-size: 12px; }
textarea.spec { width: 100%; min-height: 300px; resize: vertical; font-family: var(--f-mono); font-size: 12.5px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.banner {
  padding: 10px 14px; border-radius: 2px; font-size: 14px;
  background: var(--band-weak); border-left: 3px solid var(--s1); margin-bottom: 18px;
}
.err { color: var(--crit); white-space: pre-wrap; }
.card.low-sample { border-left: 4px solid var(--warn); }
fieldset { border: 1px solid var(--grid); border-radius: 2px; margin: 0 0 10px; }
legend { font-size: 12px; color: var(--ink-2); padding: 0 6px; }
label.inline { display: inline-flex; gap: 6px; align-items: center; margin-right: 12px; font-size: 13px; }
.loading { padding: 60px; text-align: center; color: var(--ink-3); }
details.explain { margin: 18px 0; }
details.explain > summary, details.tech > summary {
  cursor: pointer; color: var(--ink-2); padding: 8px 0; font: 600 13px var(--f-head); letter-spacing: .08em; text-transform: uppercase;
}
details.explain > .card { margin-top: 10px; }
details.tech { margin: 4px 0 18px; border-top: 1px solid var(--rule); }
details.tech .note, details.tech p { font-family: var(--f-mono); font-size: 12.5px; color: var(--ink-2); max-width: 100ch; }
.lead { font-size: 16px; color: var(--ink-2); max-width: 72ch; margin: 0 0 18px; }

/* ---------- terms and popovers (tips.js) ---------- */
.term { border-bottom: 1px dotted currentColor; cursor: help; }
.term:hover, .term:focus-visible { color: var(--s1); }
button.info {
  border: 1px solid var(--rule); background: var(--surface-1); border-radius: 2px;
  font: 600 11px var(--f-mono); color: var(--ink-3); padding: 1px 6px; margin-left: 6px; vertical-align: 1px; cursor: help;
}
button.info:hover { color: var(--ink-1); border-color: var(--ink-3); }
#tip {
  position: fixed; z-index: 50; max-width: min(360px, calc(100vw - 32px));
  background: var(--tip-bg); color: var(--tip-ink); border-radius: 2px; padding: 10px 12px;
  font: 13.5px/1.45 var(--f-body); box-shadow: 0 6px 24px rgba(0,0,0,.2); text-transform: none; letter-spacing: 0;
}
#tip b { font: 600 12px var(--f-head); letter-spacing: .08em; text-transform: uppercase; display: block; margin-bottom: 3px; }
#tip .tech { display: block; margin-top: 7px; padding-top: 7px; border-top: 1px solid color-mix(in srgb, var(--tip-ink) 25%, transparent);
  font: 12px/1.45 var(--f-mono); opacity: .88; }
@media (prefers-reduced-motion: no-preference) { #tip { transition: opacity .12s; } }

/* ---------- Results summary ---------- */
.kicker { font: 600 12px var(--f-head); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 4px; }
.question { font: 700 clamp(26px, 3.6vw, 38px)/1.1 var(--f-head); margin: 0 0 10px; }
.intro { color: var(--ink-2); max-width: 70ch; margin: 0 0 22px; font-size: 16px; }
.answers { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 28px; margin-bottom: 26px; }
@media (max-width: 860px) { .answers { grid-template-columns: 1fr; gap: 22px; } }
.card.answer { background: none; border: 0; border-top: 3px solid var(--heavy); border-radius: 0; padding: 10px 0 0; }
.answer .label { font: 600 12.5px var(--f-head); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.answer .figure { font: 600 clamp(44px, 5.4vw, 62px)/1 var(--f-head); margin: 10px 0 8px; font-variant-numeric: tabular-nums; }
.answer .sub { font-size: 14px; color: var(--ink-2); }
.split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.split > .card, .answers > .card { min-width: 0; overflow-x: auto; }
.rank-line { font-size: 15.5px; color: var(--ink-1); margin: 4px 0 0; }
.meter { position: relative; height: 26px; margin: 18px 0 6px; border-left: 1px solid var(--ink-3); border-right: 1px solid var(--ink-3); }
.meter::before { content: ""; position: absolute; left: 0; right: 0; top: 12px; height: 2px; background: var(--rule); }
.meter .m { position: absolute; top: 3px; width: 3px; height: 20px; background: var(--real); transform: translateX(-1px); }
.meter .mid { position: absolute; top: 7px; width: 1px; height: 12px; background: var(--ink-3); left: 50%; }
.mscale { display: flex; justify-content: space-between; font: 12px var(--f-mono); color: var(--ink-3); }
.method-card { padding: 16px 18px; }
.method-card h3 { margin: 0 0 6px; padding: 0; border: 0; font-size: 16px; letter-spacing: .02em; text-transform: none; }
.method-card p { margin: 0; color: var(--ink-2); }
.method-cards { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 860px) { .method-cards { grid-template-columns: 1fr; } }
.phone-safe { max-width: 100%; overflow-x: auto; }
.plain p { font-size: 15px; line-height: 1.55; margin: 0 0 6px; max-width: 76ch; }
.plain p.muted { font-size: 13px; }

/* ---------- Start here ---------- */
.start-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 36px; align-items: end;
  padding-bottom: 26px; border-bottom: 3px solid var(--heavy); }
.start-hero h2 { font: 700 clamp(32px, 4.8vw, 50px)/1.04 var(--f-head); letter-spacing: -0.01em; margin: 0; }
.start-hero .answerline { margin: 0; font-size: 15.5px; color: var(--ink-2); border-left: 3px solid var(--real); padding-left: 14px; }
@media (max-width: 820px) { .start-hero { grid-template-columns: 1fr; gap: 16px; } }
.step { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 28px; padding-block: 30px; border-bottom: 1px solid var(--rule); max-width: 1180px; }
.step .num { font: 700 13px var(--f-head); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); padding-top: 6px; }
.step .num span { display: block; font: 700 44px/1 var(--f-head); color: var(--ink-1); letter-spacing: 0; margin-bottom: 4px; }
.step h3 { font: 600 26px/1.15 var(--f-head); margin: 0; }
.step p { max-width: 68ch; margin: 10px 0 0; }
@media (max-width: 700px) { .step { grid-template-columns: 1fr; gap: 6px; } .step .num span { font-size: 34px; } }
.rulebox { margin-top: 16px; border: 1px solid var(--rule); background: var(--surface-1); padding: 14px 16px; max-width: 72ch; }
.rulebox ol { margin: 6px 0 0; padding-left: 20px; } .rulebox li { margin: 4px 0; }
.tkr { font: 500 13px var(--f-mono); background: var(--page); padding: 0 4px; border-radius: 2px; }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; max-width: 780px; }
.pair > div { border-top: 3px solid var(--heavy); padding-top: 10px; }
.pair h4 { font: 600 17px var(--f-head); margin: 0; }
.pair p { margin: 6px 0 0; font-size: 14px; color: var(--ink-2); }
@media (max-width: 600px) { .pair { grid-template-columns: 1fr; } }
.step figure { margin: 18px 0 0; }
.step figcaption { font-size: 13.5px; color: var(--ink-3); margin-top: 8px; max-width: 72ch; }
.diagram { width: 100%; max-width: 860px; height: auto; display: block; }
.diagram text { font-family: var(--f-body); fill: var(--ink-1); }
.diagram .sm { font-size: 12px; fill: var(--ink-3); }
.diagram .hd { font: 600 13px var(--f-head); letter-spacing: .08em; text-transform: uppercase; fill: var(--ink-2); }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.cta button { border: 2px solid var(--heavy); background: var(--heavy); color: var(--surface-1);
  padding: 10px 16px; font: 600 14px var(--f-head); letter-spacing: .06em; text-transform: uppercase; }
.cta button.alt { background: none; color: var(--ink-1); }
.c-sim { color: var(--s1); font-weight: 600; } .c-real { color: var(--real); font-weight: 600; }

/* ---------- Try your own: the strategy form (D-100) ---------- */
.lab .card { margin-bottom: 18px; }
.lab .card > h3 { font-size: 14px; }
.lab .intro { max-width: 760px; }
.kinds { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 14px; }
@media (max-width: 860px) { .kinds { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .kinds { grid-template-columns: 1fr; } }
button.kind { text-align: left; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; border-radius: 2px; }
button.kind b { font: 600 15px var(--f-head); }
button.kind span { font-size: 13px; color: var(--ink-2); line-height: 1.35; }
button.kind:hover { border-color: var(--s1); }
button.kind[aria-pressed="true"] { border-color: var(--s1); box-shadow: inset 0 0 0 1px var(--s1); background: var(--band-weak); }
.field { display: block; margin: 0 0 16px; }
.field > .lbl { display: block; font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.field .hint, .lab .hint { color: var(--ink-3); font-size: 13px; margin: 0 0 6px; max-width: 720px; }
.field .err { font-size: 12px; margin-top: 4px; }
.field select { max-width: 100%; }
.lab input[type="text"] { width: 100%; max-width: 420px; }
.lab input.num { width: 84px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border: 1px solid var(--axis); border-radius: 2px; font-size: 13px; max-width: 100%; }
.chip small { color: var(--ink-3); font-size: 12px; }
.chip button { border: none; background: none; padding: 0 6px; font-size: 16px; line-height: 1.2; color: var(--ink-2); }
.chip button:hover { background: var(--ring); color: var(--ink-1); }
.mixrow { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.mixrow select { flex: 1 1 220px; min-width: 0; max-width: 460px; }
.total { font-size: 13px; color: var(--ink-2); }
.total.bad { color: var(--crit); font-weight: 600; }
.sentence { line-height: 2.3; }
.months { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 4px 10px; max-width: 720px; }
label.tick { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; margin: 2px 0; cursor: pointer; }
details.more { margin: 0 0 10px; }
details.more > summary { cursor: pointer; color: var(--ink-2); font-size: 13px; font-weight: 600; margin-bottom: 8px; }

/* ---------- phone ---------- */
@media (max-width: 600px) {
  .topbar, .ctxbar, nav.subtabs { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  main { padding: 18px max(16px, env(safe-area-inset-right, 0px)) 60px max(16px, env(safe-area-inset-left, 0px)); }
  header { position: static; }
  .ctl { width: 100%; }
  .mixrow select { flex-basis: 100%; }
  .field select { width: 100%; }
  nav.tabs button { padding: 8px 9px 7px; font-size: 13px; }
}
#cmp-table td:first-child { min-width: 220px; }
table.data.kv td { text-align: left; }
table.data.kv td:first-child { white-space: nowrap; padding-right: 24px; color: var(--ink-2); }

/* Stress tests (D-137) */
.st-cards { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.st-card { cursor: pointer; border-top: 3px solid var(--grid); }
.st-card:hover { background: var(--ring); }
.st-card.active { border-top-color: var(--s1); outline: 2px solid var(--s1); outline-offset: -2px; }
.st-card p { margin: 0 0 10px; }
.st-check { font-size: 13.5px; margin-top: 8px; }
.st-check-text { display: block; color: var(--ink-2); }
.st-check-vals { display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.st-limit { font-size: 13px; color: var(--ink-2); margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--grid); }
table.data th.st-group { text-align: center; border-left: 1px solid var(--grid); }
table.data td.st-up { color: var(--good, #2e7d32); }
table.data td.st-down { color: var(--crit, #c62828); }
table.data tr.st-bench td { font-weight: 600; border-bottom: 2px solid var(--heavy); }
table.data tr.st-yours td { font-style: italic; background: var(--tint, rgba(0,0,0,0.03)); }
table.data.wrap tbody tr.st-row:hover { cursor: pointer; }

/* ---- the account panel (D-153) ---- */
dialog.acct { border: 1px solid var(--rule, #c9ccd1); background: var(--surface-1); color: var(--ink-1);
  padding: 20px 22px; width: min(460px, calc(100vw - 32px)); border-radius: 2px; }
dialog.acct::backdrop { background: rgba(20, 24, 31, 0.45); }
dialog.acct .acct-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
dialog.acct h2 { margin: 0; font-size: 19px; }
dialog.acct p { margin: 8px 0; }
dialog.acct .acct-form label { display: block; margin: 10px 0; }
dialog.acct .acct-form .lbl { display: block; font-size: 13px; margin-bottom: 3px; }
dialog.acct .acct-form input { width: 100%; box-sizing: border-box; font: inherit; font-size: 15px; padding: 8px 10px;
  color: var(--ink-1); background: var(--surface-1); border: 1px solid var(--ink-3, #9aa0a8); border-radius: 2px; }
dialog.acct .row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
dialog.acct .acct-offer { margin: 4px 0 10px; padding: 8px 10px; border-left: 3px solid var(--heavy); background: var(--ring); }
dialog.acct .acct-msg { margin: 10px 0; padding: 8px 10px; border-left: 3px solid var(--heavy); background: var(--ring); }
dialog.acct .acct-privacy { margin-top: 16px; font-size: 13px; }
dialog.acct .acct-privacy ul { margin: 8px 0 0; padding-left: 18px; }
dialog.acct .acct-privacy li { margin: 4px 0; }
#account-btn.warn { border-color: #b3541e; }
/* a button that reads as a link inside a sentence (Try your own: "sign in to see them") */
button.linkish { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }

/* D-160: the sign-in screen in front of the whole app */
body.gated nav.tabs, body.gated .ctxbar, body.gated #subtabs, body.gated #account-btn { display: none; }
.gate { max-width: 460px; margin: 40px auto; }
.gate h2 { margin: 0 0 6px; font-size: 21px; }
.gate .acct-form label { display: block; margin: 10px 0; }
.gate .acct-form .lbl { display: block; font-size: 13px; margin-bottom: 3px; }
.gate .acct-form input { width: 100%; box-sizing: border-box; font: inherit; font-size: 15px; padding: 8px 10px;
  color: var(--ink-1); background: var(--surface-1); border: 1px solid var(--ink-3, #9aa0a8); border-radius: 2px; }
.gate .row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.gate .acct-msg { margin: 10px 0; padding: 8px 10px; border-left: 3px solid var(--heavy); background: var(--ring); }
dialog.acct .acct-form label.check, .gate .acct-form label.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--ink-2); }
dialog.acct .acct-form label.check input, .gate .acct-form label.check input { width: auto; margin: 2px 0 0; padding: 0; }
.gate .gate-back { margin: 14px 0 0; font-size: 14px; }
.gate .acct-privacy { margin-top: 12px; font-size: 13px; }
.gate .acct-privacy ul { margin: 8px 0 0; padding-left: 18px; }
@media (max-width: 520px) { .gate { margin: 16px auto; } }
header .home-link { font-size: 13px; color: var(--ink-2, inherit); margin-right: 10px; white-space: nowrap; }
@media (max-width: 700px) { header .home-link { display: none; } }

/* D-160: a shared link to one result, seen without an account */
body.shared nav.tabs, body.shared #subtabs, body.shared .ctxbar .find, body.shared #run-label { display: none; }
.shared-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  margin: 0 0 14px; padding: 10px 14px; border-left: 3px solid var(--heavy); background: var(--ring); }
.shared-bar .row { display: flex; flex-wrap: wrap; gap: 8px; }
/* Under the sign-up button: creating an account accepts the terms and the privacy policy. */
.acct-agree { font-size: 13px; color: var(--ink-3); margin: 10px 0 0; }
.acct-privacy .acct-policy { margin: 8px 0 0; }
