/* valuation.digital — static, no web fonts, light/dark via prefers-color-scheme */
:root {
  color-scheme: light;
  --bg: #f6f6f3;
  --surface: #ffffff;
  --surface-2: #f0efeb;
  --ink: #121211;
  --ink-2: #4c4b47;
  --ink-3: #6b6a64;
  --line: #e2e1dc;
  --grid: #ebeae6;
  --link: #1c5cab;
  --accent: #2a78d6;
  --s1: #2a78d6;
  --s1-strong: #184f95;
  --s2: #eb6834;
  --neg: #8d8c85;
  --tag-fact: #e7e6e1;
  --tag-assume: #fde8dd;
  --tag-assume-ink: #8a3312;
  --tag-output: #dbe8fa;
  --tag-output-ink: #184f95;
  --tag-market: #ece9f8;
  --tag-market-ink: #4a3aa7;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 2px 10px rgba(0, 0, 0, .04);
  --radius: 12px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #111110;
    --surface: #1a1a19;
    --surface-2: #232321;
    --ink: #f3f2ee;
    --ink-2: #c3c2b7;
    --ink-3: #9d9c92;
    --line: #34332f;
    --grid: #2b2a27;
    --link: #86b6ef;
    --accent: #3987e5;
    --s1: #3987e5;
    --s1-strong: #86b6ef;
    --s2: #d95926;
    --neg: #77766e;
    --tag-fact: #2c2c29;
    --tag-assume: #3d2519;
    --tag-assume-ink: #f2a57f;
    --tag-output: #1b2f4b;
    --tag-output-ink: #9ec5f4;
    --tag-market: #29243f;
    --tag-market-ink: #b5acf2;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-feature-settings: "tnum" 1;
}
a { color: var(--link); text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); letter-spacing: -0.02em; }
h2 { font-size: 1.45rem; margin-top: 0; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
small, .muted { color: var(--ink-3); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 960px; }

/* header */
.top { border-bottom: 1px solid var(--line); background: var(--surface); }
.top .wrap { display: flex; align-items: center; gap: 20px; min-height: 60px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 1.1rem; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; }
.brand svg { flex: none; }
.brand .dom { color: var(--accent); }
.nav { display: flex; gap: 18px; flex-wrap: wrap; margin-left: auto; font-size: .95rem; }
.nav a { color: var(--ink-2); text-decoration: none; }
.nav a:hover, .nav a[aria-current] { color: var(--ink); text-decoration: underline; }
.langsw { font-size: .9rem; border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; text-decoration: none; color: var(--ink-2); }

/* notice strip */
.notice { background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: .85rem; color: var(--ink-2); }
.notice .wrap { padding-top: 8px; padding-bottom: 8px; }

main { padding: 28px 0 48px; }
.crumbs { font-size: .85rem; color: var(--ink-3); margin-bottom: 10px; }
.crumbs a { color: var(--ink-3); }
.sub { color: var(--ink-2); margin-top: -4px; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); margin: 0 0 18px; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 20px 0; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi .k { font-size: .8rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.kpi .v { font-size: 1.55rem; font-weight: 650; margin: 2px 0; letter-spacing: -0.01em; }
.kpi .n { font-size: .8rem; color: var(--ink-2); }
.kpi.hl { border-color: var(--accent); }
.summary { font-size: 1.05rem; }

.toc { display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 6px 0 22px; padding: 0; list-style: none; font-size: .88rem; }
.toc a { display: inline-block; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink-2); background: var(--surface); }
.toc a:hover { color: var(--ink); border-color: var(--ink-3); }

section.block { margin: 34px 0 0; scroll-margin-top: 16px; }
.step { position: relative; padding-left: 0; }
.step h3 { display: flex; align-items: center; gap: 10px; }
.num { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-size: .85rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.tags { display: inline-flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.tag { font-size: .72rem; font-weight: 600; letter-spacing: .02em; padding: 2px 8px; border-radius: 999px; background: var(--tag-fact); color: var(--ink-2); white-space: nowrap; }
.tag.assume { background: var(--tag-assume); color: var(--tag-assume-ink); }
.tag.output { background: var(--tag-output); color: var(--tag-output-ink); }
.tag.market { background: var(--tag-market); color: var(--tag-market-ink); }

.formula { font-family: var(--mono); font-size: .88rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; overflow-x: auto; white-space: normal; overflow-wrap: anywhere; line-height: 1.6; margin: 10px 0 14px; }
.formula b { color: var(--ink); }
.explain { color: var(--ink-2); font-size: .95rem; }
.src { font-size: .8rem; color: var(--ink-3); }
.src a { color: var(--ink-3); }

/* tables */
.tw { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 10px 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .88rem; }
th, td { padding: 7px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
th { font-weight: 600; color: var(--ink-2); background: var(--surface-2); vertical-align: bottom; }
th.l, td.l { text-align: left; }
tbody tr:last-child td { border-bottom: 0; }
td.l, th.l { position: sticky; left: 0; background: var(--surface); z-index: 1; }
th.l { background: var(--surface-2); }
tr.self td { background: var(--tag-output); font-weight: 600; }
tr.med td { background: var(--surface-2); font-style: italic; }
tr.total td { font-weight: 700; border-top: 2px solid var(--line); }
.th2 { display: block; font-weight: 400; color: var(--ink-3); font-size: .78rem; }
.num-neg { color: var(--ink); }
table.sens td { text-align: center; font-weight: 600; }
table.sens td.base { outline: 2px solid var(--ink); outline-offset: -2px; }
table.sens th { text-align: center; }

.home-table td, .home-table th, table.compact td, table.compact th { padding: 7px 7px; }
table.compact { font-size: .84rem; }
.home-table td.range-cell { color: var(--ink-2); font-size: .82rem; }
.home-table td.sector { white-space: normal; min-width: 150px; font-size: .82rem; color: var(--ink-2); }
.home-table td.l a { font-weight: 600; text-decoration: none; }
.home-table td.l a:hover { text-decoration: underline; }
.tick-sm { font-size: .78rem; color: var(--ink-3); display: block; font-weight: 400; }

/* charts */
figure { margin: 12px 0 18px; }
figcaption { font-size: .85rem; color: var(--ink-2); margin-bottom: 6px; font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .8rem; color: var(--ink-2); margin: 0 0 6px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend i.l { height: 3px; border-radius: 2px; vertical-align: 3px; width: 16px; }
.sw-s1 { background: var(--s1); } .sw-s2 { background: var(--s2); } .sw-h { background: var(--ink-3); border-radius: 50% !important; }
svg.chart { width: 100%; height: auto; display: block; max-width: 640px; }
svg.chart text { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .axis { stroke: var(--ink-3); stroke-width: 1; }
.chart .dash { stroke-dasharray: 3 4; }
.chart .tick { fill: var(--ink-3); font-size: 12px; }
.chart .lbl { fill: var(--ink-2); font-size: 12.5px; }
.chart .val { fill: var(--ink); font-size: 12.5px; font-weight: 600; }
.chart .s1 { fill: var(--s1); } .chart .s2 { fill: var(--s2); } .chart .s1-strong { fill: var(--s1-strong); } .chart .neg { fill: var(--neg); }
.chart .line-s1 { stroke: var(--s1); stroke-width: 2.5; fill: none; stroke-linejoin: round; }
.chart .line-s2 { stroke: var(--s2); stroke-width: 2.5; fill: none; stroke-dasharray: 6 4; }
.chart .dot { fill: var(--s1); stroke: var(--surface); stroke-width: 2; }
.chart .dot-hist { fill: var(--ink-3); stroke: var(--surface); stroke-width: 2; }
.chart .hit { fill: transparent; }
.chart path:hover, .chart circle.dot:hover { opacity: .8; }

/* gap note, range chart, driver table */
.gapnote { background: var(--tag-assume); color: var(--ink); border: 1px solid var(--line); border-left: 4px solid var(--s2); border-radius: 10px; padding: 12px 16px; margin: -4px 0 18px; font-size: .95rem; }
.gapnote .src { display: block; margin-top: 6px; }
.rangefig { margin: 14px 0 6px; }
.chart .range { fill: color-mix(in srgb, var(--s1) 22%, var(--surface)); stroke: var(--s1); stroke-width: 1; }
.chart .price-line { stroke: var(--s2); stroke-width: 2; }
.chart .price-label { fill: var(--s2); }
td.wrap-cell { white-space: normal; min-width: 260px; text-align: left; font-size: .85rem; color: var(--ink-2); }
table.drivers td:nth-child(2) { font-weight: 650; }

/* quotes, events */
blockquote { margin: 12px 0; padding: 12px 16px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 8px 8px 0; }
blockquote p { margin: 0 0 6px; }
blockquote footer { font-size: .85rem; color: var(--ink-2); }
ul.events { list-style: none; padding: 0; margin: 10px 0; }
ul.events li { padding: 10px 0; border-bottom: 1px solid var(--line); }
ul.events .when { font-size: .8rem; color: var(--ink-3); }
ul.events .what { font-size: .8rem; color: var(--ink-2); }
.pill { display: inline-block; font-size: .72rem; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); margin-right: 4px; }

/* disclosure */
.disclosure { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 18px 20px; font-size: .88rem; }
.disclosure dl { display: grid; grid-template-columns: 220px 1fr; gap: 8px 16px; margin: 0; }
.disclosure dt { color: var(--ink-3); }
.disclosure dd { margin: 0; }

.prose { max-width: 760px; }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.3em; }
.prose li { margin-bottom: .35em; }
.prose table { font-size: .85rem; }

footer.site { border-top: 1px solid var(--line); background: var(--surface); padding: 26px 0 40px; font-size: .85rem; color: var(--ink-2); }
footer.site .cols { display: flex; flex-wrap: wrap; gap: 12px 28px; margin-bottom: 12px; }
footer.site a { color: var(--ink-2); }
.cite { font-size: .78rem; color: var(--ink-3); }

@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .v { font-size: 1.3rem; }
  .card { padding: 16px; }
  .nav { gap: 12px; font-size: .9rem; margin-left: 0; width: 100%; padding-bottom: 8px; }
  .top .wrap { gap: 6px 16px; padding-top: 8px; }
  .langsw { margin-left: auto; }
  .disclosure dl { grid-template-columns: 1fr; gap: 2px; }
  .disclosure dd { margin-bottom: 8px; }
  .step h3 { flex-wrap: wrap; }
  .tags { margin-left: 0; width: 100%; }
  th, td { padding: 6px 8px; }
  .formula { white-space: normal; overflow-wrap: anywhere; }
  table.drivers thead { display: none; }
  table.drivers, table.drivers tbody, table.drivers tr, table.drivers td { display: block; width: 100%; }
  table.drivers tr { border-bottom: 1px solid var(--line); padding: 8px 10px; }
  table.drivers td { border: 0; padding: 0; text-align: left; white-space: normal; position: static; }
  table.drivers td.l { font-weight: 600; background: transparent; }
  table.drivers td:nth-child(2) { font-size: 1.05rem; margin: 2px 0 4px; }
  td.wrap-cell { min-width: 0; }
  .chart .tick { font-size: 15px; }
  .chart .lbl { font-size: 14px; }
  .chart .val { font-size: 15px; }
}
@media print {
  .top, .notice, footer.site, .toc { display: none; }
  body { background: #fff; }
}
