/* The Proving Ground — Direction D: navy and signal orange */
:root {
  --navy: #142847;
  --paper: #F3F4F7;
  --white: #FFFFFF;
  --body: #2A3550;
  --muted: #56617A;
  --link: #2C4F8C;
  --link-hover: #0E1C36;
  --orange: #FF7A1A;
  --orange-ink: #B8470B;
  --orange-mark: #F06A10;
  --rule: #D8DCE5;
  --rule-dash: #C5CAD6;
  --pill: #E8EBF2;
  --d-text: #E6E8EB;
  --d-body: #CED7E6;
  --d-muted: #A9B6CC;
  --d-rule: #2E4369;
  --d-kicker: #A9C0EA;
  --d-foot: #93A0B8;
  --gain: #0F6D4A;
  --loss: #A1311B;
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans: 'IBM Plex Sans', -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
  --pad: clamp(20px, 8.33vw, 120px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--paper); color: var(--navy); font-family: var(--sans); font-size: 17px; line-height: 1.6; }
img, svg { max-width: 100%; }
a { color: var(--link); }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; top: 0; padding: 12px 16px; background: var(--navy); color: var(--white); z-index: 100; }
.skip:focus { left: 12px; top: 12px; }
.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; }
.wrap { max-width: 1440px; margin: 0 auto; padding-inline: var(--pad); }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.02em; margin: 0; color: inherit; }
p { margin: 0; }

/* ---------- shared bits ---------- */
.kicker { font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--link); margin: 0; }
.dark .kicker { color: var(--d-kicker); }
.lede { font-size: clamp(17px, 1.4vw, 19px); line-height: 1.6; color: var(--body); }
.small { font-size: 13px; line-height: 1.5; color: var(--muted); }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 54px; padding: 0 26px; font-family: var(--sans); font-size: 17px; font-weight: 600; text-decoration: none; cursor: pointer; border: 2px solid var(--navy); }
.btn-primary { color: var(--navy); background: var(--orange); }
.btn-primary:hover { color: var(--navy); background: #FF8F3D; }
.btn-outline { color: var(--navy); background: transparent; min-height: 44px; padding: 0 18px; font-size: 15px; }
.btn-outline:hover { color: var(--white); background: var(--navy); }
.stamp { display: inline-block; padding: 4px 10px; border: 2px solid var(--orange-ink); color: var(--orange-ink); font-family: var(--mono); font-size: 11.5px; font-weight: 600; letter-spacing: 0.16em; line-height: 1.4; transform: rotate(-4deg); white-space: nowrap; }
.stamp-lg { padding: 6px 14px; font-size: 14px; letter-spacing: 0.18em; }
.dark .stamp { border-color: var(--orange); color: var(--orange); }
.dark .stamp.benched { border-color: var(--d-text); color: var(--d-text); transform: rotate(2deg); }
.dark .stamp.scrapped { border: 2px dashed var(--d-muted); color: var(--d-muted); text-decoration: line-through; transform: rotate(-2deg); }
.pill { display: inline-block; padding: 5px 10px; font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--navy); background: var(--pill); }
.gain { color: var(--gain); font-weight: 600; }
.loss { color: var(--loss); font-weight: 600; }
.blur { display: inline-block; font-family: var(--mono); font-size: 15px; font-weight: 600; letter-spacing: 0.04em; color: var(--navy); filter: blur(5px); user-select: none; }

/* ---------- logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 22px; color: var(--navy); text-decoration: none; }
.logo:hover { color: var(--navy); }
.logo-stamp { display: inline-block; padding: 9px 14px; border: 2px solid currentColor; outline: 1px solid var(--orange); outline-offset: 3px; font-family: var(--mono); font-size: 15px; font-weight: 600; letter-spacing: 0.2em; line-height: 1; white-space: nowrap; }
.logo-slogan { font-family: var(--serif); font-size: 17px; font-style: italic; color: var(--muted); }

/* ---------- header ---------- */
.site-header { background: var(--paper); border-bottom: 2px solid var(--navy); position: relative; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 84px; }
.nav { display: flex; align-items: center; gap: 30px; }
.nav a { font-size: 15px; font-weight: 500; color: var(--navy); text-decoration: none; }
.nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.nav a.btn-outline:hover { text-decoration: none; color: var(--white); }
.menu-btn { display: none; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; font: 600 15px var(--sans); color: var(--navy); background: transparent; border: 2px solid var(--navy); cursor: pointer; }
@media (max-width: 1060px) {
  .logo-slogan { display: none; }
}
@media (max-width: 900px) {
  .menu-btn { display: inline-flex; }
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; padding: 8px var(--pad) 20px; background: var(--paper); border-bottom: 2px solid var(--navy); }
  .nav.open { display: flex; }
  .nav a { display: flex; align-items: center; min-height: 48px; border-bottom: 1px solid var(--rule); }
  .nav a.btn-outline { justify-content: center; margin-top: 14px; border: 2px solid var(--navy); }
  .logo-stamp { font-size: 13px; padding: 8px 11px; letter-spacing: 0.16em; }
}

/* ---------- logged-in members: the header offers the Vault instead of a login ---------- */
.nav .nav-vault, .nav .nav-member, .foot-nav .nav-vault { display: none; }
.pg-member .nav .nav-login, .pg-member .foot-nav .nav-login { display: none; }
.pg-member .nav .nav-vault { display: inline-flex; }
.pg-member .nav .nav-member { display: inline; }
.pg-member .foot-nav .nav-vault { display: flex; }
@media (max-width: 900px) { .pg-member .nav .nav-vault { display: flex; } .pg-member .nav .nav-member { display: flex; } }

/* ---------- footer ---------- */
.site-footer { background: var(--navy); color: var(--d-body); padding: 64px 0 48px; }
.site-footer .logo { color: var(--white); }
.site-footer .logo-slogan { display: inline; color: var(--d-muted); }
.foot-top { display: flex; justify-content: space-between; gap: 48px; flex-wrap: wrap; }
.foot-nav { display: flex; gap: 64px; flex-wrap: wrap; }
.foot-nav p { margin: 0 0 8px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--d-muted); }
.foot-nav a { display: flex; align-items: center; min-height: 36px; font-size: 15px; color: var(--d-text); text-decoration: none; }
.foot-nav a:hover { text-decoration: underline; color: var(--white); }
.foot-legal { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--d-rule); }
.foot-legal p { max-width: 1000px; font-size: 13px; line-height: 1.6; color: var(--d-muted); }
.foot-legal p + p { margin-top: 12px; font-size: 12px; color: var(--d-foot); }
@media (max-width: 700px) { .site-footer .logo-slogan { display: none; } .foot-nav { gap: 36px; } }

/* The Proving Ground: the members' Vault, brand Direction D.
   build.py writes dist/assets/vault.css = the site's tokens, header and footer (from site.css) + this file.
   The Vault page loads only vault.css, so the app's class names never meet the public pages' rules. */

#vault {
  --ink: var(--navy);
  --ink-2: var(--body);
  --ink-3: var(--muted);
  --rule-soft: #E6E9EF;
  --surface: #FFFFFF;
  --surface-2: #EEF0F5;
  --s1: var(--navy);
  --s2: #8C98AE;
  --s1-fill: rgba(20, 40, 71, 0.08);
  --ok: var(--gain);
  --tap: 48px;
  padding-top: clamp(28px, 4vw, 48px);
  padding-bottom: 88px;
}
#vault [hidden] { display: none !important; }

/* ---------- the shell's screens: checking, log in, refused, error ---------- */
.v-screen { max-width: 680px; padding: clamp(24px, 4vw, 40px); background: var(--white); border: 2px solid var(--navy); box-shadow: 8px 8px 0 var(--navy); }
.v-screen h1 { margin-top: 12px; font-size: clamp(32px, 3.6vw, 44px); line-height: 1.1; }
.v-screen p { margin-top: 14px; font-size: 17px; line-height: 1.6; color: var(--body); }
.v-screen .small { font-size: 14px; color: var(--muted); }
.v-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 24px; }
.v-actions a:not(.btn) { font-size: 15px; font-weight: 600; }
.v-checking { display: flex; align-items: center; gap: 14px; padding: 28px 0; font-family: var(--mono); font-size: 14px; color: var(--muted); }
.v-checking i { display: block; width: 14px; height: 14px; border: 2px solid var(--navy); border-top-color: var(--orange); border-radius: 50%; animation: vspin .9s linear infinite; }
@keyframes vspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .v-checking i { animation: none; } }
.v-foot { margin-top: 56px; padding: 20px 24px; background: var(--pill); font-size: 14px; line-height: 1.6; color: var(--body); }
.v-foot p + p { margin-top: 8px; }
#vault:not([data-state="app"]) .v-foot { display: none; }
@media (max-width: 480px) { .v-screen { box-shadow: 5px 5px 0 var(--navy); } }

/* ---------- the app: shared ---------- */
#app { color: var(--navy); font-size: 17px; line-height: 1.6; }
#app svg { display: block; width: 100%; height: auto; overflow: visible; }
#app h3 { margin: 44px 0 16px; padding-bottom: 8px; border-bottom: 2px solid var(--navy); font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--navy); }
#app h3:first-child { margin-top: 0; }
#app .pos { color: var(--gain); }
#app .neg { color: var(--loss); }
#app .sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
#app .prose { max-width: 66ch; }
#app .prose p { margin: 0 0 14px; color: var(--body); }
#app .caption { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--rule-soft); font-size: 14px; line-height: 1.6; color: var(--muted); }

/* landing: heading and alert settings */
.v-head h1 { margin-top: 12px; font-size: clamp(36px, 4.4vw, 56px); line-height: 1.05; letter-spacing: -0.025em; }
.v-lede { margin-top: 14px; max-width: 720px; font-size: clamp(17px, 1.4vw, 19px); color: var(--body); }
.v-lede b { color: var(--navy); }
.v-alerts { margin-top: 32px; padding: clamp(20px, 3vw, 28px); background: var(--white); border: 2px solid var(--navy); box-shadow: 8px 8px 0 var(--navy); }
.v-alerts-hd { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px; margin-bottom: 18px; }
.v-alerts-hd h2 { font-size: 28px; line-height: 1.2; }
.v-alerts-hd p { font-size: 15px; color: var(--body); }
#app .v-alerts .prefs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: none; }
.alerts-err { margin-top: 12px; font-size: 14px; font-weight: 600; color: var(--loss); }
@media (max-width: 860px) { #app .v-alerts .prefs { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 480px) { .v-alerts { box-shadow: 5px 5px 0 var(--navy); } }

/* alert toggles */
#app .prefs { display: grid; gap: 12px; max-width: 46em; }
#app .pref { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; background: var(--white); border: 1px solid var(--rule); }
#app .pref p { margin: 0; font-size: 16px; font-weight: 600; color: var(--navy); }
#app .pref small { display: block; margin-top: 4px; font-size: 14px; line-height: 1.5; color: var(--muted); }
#app .tog { flex: none; min-width: 78px; min-height: var(--tap); padding: 0 16px; font: 600 15px var(--sans); color: var(--navy); background: var(--white); border: 2px solid var(--navy); cursor: pointer; }
#app .tog[aria-pressed="true"] { color: var(--white); background: var(--navy); }
#app .tog[aria-pressed="true"]::before { content: "\2713\00a0"; }
#app .tog:disabled, #app .btn:disabled { opacity: 0.55; cursor: default; }
#app .alert-now { font-size: 15px; color: var(--muted); }
#app .alert-now b { color: var(--body); }
#app .alert-now b.is-on { color: var(--gain); }

/* groups and cards */
#app .group { margin-top: 48px; }
#app .group-hd { display: flex; align-items: baseline; gap: 12px; padding-bottom: 8px; border-bottom: 2px solid var(--navy); }
#app .group-hd h3 { margin: 0; padding: 0; border: 0; font-size: 13px; }
#app .group-hd span { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
#app .group-note { margin: 12px 0 0; max-width: 70ch; font-size: 15px; color: var(--body); }
#app .cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 24px; margin-top: 20px; }
#app .card { display: flex; flex-direction: column; width: 100%; padding: 24px; text-align: left; font: inherit; color: inherit; background: var(--white); border: 2px solid var(--navy); cursor: pointer; transition: box-shadow 0.12s, transform 0.12s; }
#app .card:hover { box-shadow: 6px 6px 0 var(--navy); transform: translate(-2px, -2px); }
#app .card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
#app .card h4 { margin: 0; font-family: var(--serif); font-size: 27px; font-weight: 500; line-height: 1.15; letter-spacing: -0.015em; }
#app .card-sub { margin: 6px 0 0; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
#app .card-desc { margin: 10px 0 0; font-size: 15px; line-height: 1.55; color: var(--body); }
#app .card-spark { margin-top: 14px; }
#app .card-vs { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 9px; font-size: 12.5px; }
#app .card-vs-keys { display: flex; gap: 14px; color: var(--muted); }
#app .card-vs-keys span { display: inline-flex; align-items: center; gap: 6px; }
#app .card-vs-line { margin: 9px 0 0; padding: 9px 12px; font-size: 13.5px; line-height: 1.45; font-variant-numeric: tabular-nums; }
#app .card-vs-line b { font-weight: 600; }
#app .card-vs-line.up { color: var(--navy); background: var(--surface-2); }
#app .card-vs-line.down { color: var(--body); background: var(--paper); }
#app .card-growth-sub { margin: 7px 0 0; font-family: var(--mono); font-size: 11.5px; line-height: 1.45; color: var(--muted); }
#app .card-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 10px; margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--navy); align-items: start; }
#app .card-facts.two { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; }
#app .card-fact { min-width: 0; }
#app .card-fact dt { min-height: 2.7em; margin: 0 0 5px; font-family: var(--mono); font-size: 11px; line-height: 1.35; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
#app .card-fact dt small { display: block; margin-top: 1px; font-size: 10px; letter-spacing: 0; text-transform: none; }
#app .card-fact dd { margin: 0; font-family: var(--mono); font-size: 17px; font-weight: 600; line-height: 1.25; font-variant-numeric: tabular-nums; }
#app .card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--rule); font-size: 15px; font-weight: 600; color: var(--link); }
#app .card-facts { margin-bottom: 18px; }
#app .chip { padding: 5px 9px; font-family: var(--mono); font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; color: var(--muted); background: var(--pill); border: 1px solid var(--rule); }
#app .chip.on { color: var(--white); background: var(--navy); border-color: var(--navy); }
@media (max-width: 430px) { #app .card-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } #app .card { padding: 20px 16px; } #app .card h4 { font-size: 24px; } }
/* wide screens: the three groups side by side, their notes and cards lined up */
@media (min-width: 1100px) {
  #app .groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, auto); column-gap: 28px; margin-top: 52px; }
  #app .groups .group { display: grid; grid-row: span 3; grid-template-rows: subgrid; margin-top: 0; }
  #app .groups .cards { grid-template-columns: minmax(0, 1fr); height: 100%; }
  #app .groups .card { height: 100%; }
  #app .groups .card-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; }
}

/* strategy page */
#app .back { display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); margin: 0 0 6px; padding: 0; font: 600 15px var(--sans); color: var(--link); background: none; border: 0; cursor: pointer; }
#app .back:hover { color: var(--link-hover); text-decoration: underline; text-underline-offset: 4px; }
#app .eyebrow { margin: 0 0 8px; font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--link); }
#app h2.det { margin: 0 0 8px; font-size: clamp(32px, 4vw, 48px); line-height: 1.08; letter-spacing: -0.025em; }
#app .det-kick { margin: 0 0 6px; font-family: var(--mono); font-size: 13px; color: var(--muted); }
#app .det-sub { max-width: 70ch; font-size: 17px; color: var(--body); }
#app .flagline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 14px 0 0; font-size: 15px; line-height: 1.5; color: var(--body); }
#app .flag-pill, #app .empty .pill { display: inline-block; padding: 4px 10px; font-family: var(--mono); font-size: 11.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; white-space: nowrap; color: var(--orange-ink); background: transparent; border: 2px solid var(--orange-ink); }
#app .status { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 28px; margin-top: 24px; padding: 18px 22px; background: var(--white); border: 2px solid var(--navy); }
#app .status-item { flex: 1 1 200px; min-width: 170px; }
#app .status-l { margin: 0 0 5px; font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
#app .status-v { margin: 0; font-family: var(--mono); font-size: 18px; font-weight: 600; line-height: 1.3; font-variant-numeric: tabular-nums; }
#app .status-v small { display: block; margin-top: 4px; font-family: var(--sans); font-size: 13.5px; font-weight: 400; color: var(--muted); }
#app .btn-wrap { flex: 0 0 auto; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
#app .btn { min-height: 50px; padding: 0 20px; font-size: 16px; white-space: nowrap; }
#app .btn-on { color: var(--navy); background: var(--white); }
#app .btn-on:hover { color: var(--white); background: var(--navy); }
#app .btn-note { max-width: 32ch; margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
#app .tabs { display: flex; margin-top: 28px; }
#app .tab { flex: 1 1 0; min-height: 52px; padding: 12px 14px; font: 600 16px var(--sans); line-height: 1.3; color: var(--navy); background: var(--white); border: 2px solid var(--navy); cursor: pointer; }
#app .tab + .tab { margin-left: -2px; }
#app .tab:hover { background: var(--surface-2); }
#app .tab[aria-selected="true"] { color: var(--white); background: var(--navy); }
#app .pane { padding: 34px 0 24px; }
@media (max-width: 620px) {
  #app .status { flex-direction: column; align-items: stretch; }
  #app .status-item { flex: 0 0 auto; }
  #app .btn-wrap, #app .btn { width: 100%; }
  #app .btn { white-space: normal; }
  #app .btn-note { max-width: none; }
  #app .tab { font-size: 15px; padding: 10px; }
}

/* How it works */
#app .oneline { max-width: 34em; margin: 0 0 6px; padding: 16px 20px; font-family: var(--serif); font-size: 23px; line-height: 1.4; color: var(--navy); background: var(--surface-2); border-left: 4px solid var(--navy); }
#app .steps { max-width: 42em; margin: 0; padding: 0; list-style: none; counter-reset: s; }
#app .steps li { position: relative; margin-bottom: 18px; padding-left: 46px; font-size: 17px; line-height: 1.6; color: var(--body); }
#app .steps li::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: 1px; display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; font: 600 14px var(--mono); color: var(--navy); background: var(--white); border: 2px solid var(--navy); }
#app .steps b, #app .bul b, #app .what b { font-weight: 600; color: var(--navy); }
#app .bul { max-width: 42em; margin: 0; padding-left: 22px; font-size: 17px; line-height: 1.6; color: var(--body); }
#app .bul li { margin-bottom: 10px; }
#app .bul li:last-child { margin-bottom: 0; }
#app .who-lead { max-width: 34em; margin: 0 0 16px; font-family: var(--serif); font-size: 22px; line-height: 1.45; color: var(--navy); }
#app .who-lead b { font-weight: 600; }
#app .what { max-width: 42em; }
#app .what p { margin: 0 0 12px; font-size: 17px; line-height: 1.6; color: var(--body); }
#app .joinbox { margin: 16px 0 0; padding: 18px 22px; font-size: 16px; line-height: 1.55; color: var(--navy); background: var(--surface-2); border-left: 4px solid var(--navy); }
#app .joinbox p { margin: 0; }
#app .joinbox p + p { margin-top: 10px; }
#app .rulebox { margin-top: 4px; padding: 18px 22px; background: var(--surface-2); border-left: 4px solid var(--navy); }
#app .rulebox dl { display: grid; grid-template-columns: auto 1fr; gap: 9px 18px; margin: 0; font-size: 15px; }
#app .rulebox dt { font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); white-space: nowrap; padding-top: 2px; }
#app .rulebox dd { margin: 0; font-weight: 500; color: var(--navy); }
@media (max-width: 560px) { #app .rulebox dl { grid-template-columns: minmax(0, 1fr); gap: 2px; } #app .rulebox dd { margin-bottom: 10px; } }
#app .fit { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); gap: 16px; }
#app .fit > div { padding: 20px; background: var(--white); border: 1px solid var(--rule); }
#app .fit h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 15px; font-weight: 600; }
#app .fit ul { margin: 0; padding-left: 20px; font-size: 16px; line-height: 1.6; color: var(--body); }
#app .mark { font-weight: 700; }
#app .mark.y { color: var(--gain); }
#app .mark.n { color: var(--loss); }

/* figures */
#app .figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 1px; background: var(--rule); border: 2px solid var(--navy); }
#app .fig { padding: 18px 18px 16px; background: var(--white); }
#app .fig-l { margin: 0 0 8px; font-family: var(--mono); font-size: 11.5px; line-height: 1.4; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
#app .fig-v { margin: 0; font-family: var(--mono); font-size: 26px; font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
#app .fig-n { margin: 7px 0 0; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 520px) { #app .figs { grid-template-columns: repeat(2, minmax(0, 1fr)); } #app .figs > .fig:last-child:nth-child(odd) { grid-column: 1 / -1; } #app .fig-v { font-size: 22px; } }

/* charts */
#app .chart { position: relative; padding: 18px 16px 12px; background: var(--white); border: 2px solid var(--navy); }
#app .chart-hd { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 10px; padding: 0 4px 14px; }
#app .chart-t { margin: 0; font-size: 15px; font-weight: 600; color: var(--navy); }
#app .legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13.5px; color: var(--body); }
#app .legend span { display: inline-flex; align-items: center; gap: 7px; }
#app .swatch { display: inline-block; flex: none; width: 14px; height: 3px; }
#app .chart .caption { margin: 12px 4px 0; }
#app .gridline { stroke: #E3E6EC; stroke-width: 1; }
#app .axis-t { font-family: var(--sans); font-size: 11.5px; fill: var(--muted); }
#app .scroller { overflow-x: auto; -webkit-overflow-scrolling: touch; }
#app .scroller > svg { min-width: 600px; }
#app .chart svg[tabindex]:focus:not(:focus-visible) { outline: none; }
#app .tip { position: absolute; z-index: 5; padding: 9px 12px; font-size: 13px; white-space: nowrap; color: var(--navy); background: var(--white); border: 1px solid var(--navy); box-shadow: 0 6px 18px rgba(20, 40, 71, 0.14); pointer-events: none; opacity: 0; transition: opacity 0.1s; font-variant-numeric: tabular-nums; }
#app .tip b { display: block; margin-bottom: 5px; font-size: 12px; font-weight: 600; color: var(--muted); }
#app .tip i { display: inline-block; width: 12px; height: 3px; margin-right: 8px; vertical-align: 4px; font-style: normal; }
#app .tip div + div { margin-top: 2px; }
#app .tip strong { font-weight: 600; color: var(--navy); }
#app .tip .lab { margin-left: 7px; color: var(--muted); }
#app .tip .diff { margin-top: 7px; padding-top: 6px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--rule-soft); }
#app .tip .diff + .diff { margin-top: 2px; padding-top: 0; border-top: 0; }

/* tables */
#app .tbl-wrap { overflow-x: auto; background: var(--white); border: 2px solid var(--navy); -webkit-overflow-scrolling: touch; }
#app .tbl-wrap.rel { position: relative; }
#app .tbl-wrap.scrolly { max-height: min(460px, 65vh); overflow-y: auto; }
#app .tbl-wrap.scrolly thead th { position: sticky; top: 0; z-index: 1; background: var(--white); box-shadow: inset 0 -1px 0 var(--navy); }
#app table { width: 100%; min-width: 480px; border-collapse: collapse; font-size: 14.5px; font-variant-numeric: tabular-nums; }
#app th, #app td { padding: 11px 14px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--rule-soft); }
#app th { font-size: 13px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--navy); }
#app td { color: var(--body); }
#app td b { color: var(--navy); font-family: var(--mono); font-weight: 600; }
#app th:first-child, #app td:first-child { text-align: left; }
#app tbody tr:last-child td { border-bottom: 0; }
#app tfoot td { font-weight: 600; color: var(--navy); border-top: 2px solid var(--rule); border-bottom: 0; }
#app tr.hl td { font-weight: 600; background: var(--surface-2); }
#app th.why, #app td.why { text-align: left; }
#app td.why { color: var(--body); }
#app table.checks { min-width: 0; }
#app table.checks td:first-child { white-space: normal; }
#app table.checks td small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
#app .gone { margin-left: 2px; font-weight: 400; color: var(--muted); }
@media (max-width: 640px) { #app table { font-size: 14px; } #app th, #app td { padding: 10px 10px; } }

/* empty states, limits */
#app .empty { padding: 36px 24px; text-align: center; background: var(--white); border: 2px dashed var(--rule-dash); }
#app .empty .pill { margin-bottom: 16px; }
#app .empty h4 { margin: 0 0 8px; font-size: 16px; font-weight: 600; color: var(--body); }
#app .empty .big { margin: 0 0 10px; font-family: var(--serif); font-size: 30px; font-weight: 500; color: var(--navy); }
#app .empty p { max-width: 50ch; margin: 0 auto; font-size: 15px; line-height: 1.6; color: var(--muted); }
#app .limits { margin-top: 40px; padding: 22px 24px; background: var(--pill); }
#app .limits h3 { margin-top: 0; }
#app .limits ul { margin: 0; padding-left: 20px; font-size: 15px; line-height: 1.6; color: var(--body); }
#app .limits li { margin-bottom: 9px; }
#app .ident { margin-top: 18px; font-family: var(--mono); font-size: 11.5px; line-height: 1.7; color: var(--muted); word-break: break-all; }
@media (prefers-reduced-motion: reduce) { #app * { transition: none !important; } }
