/* Fiscal Atlas. Shares Decisive Labs' navy, cyan and mono accents; the Clarendon
   display face and the "one dollar" bar are its own. */
:root {
  --bg: #070b14;
  --panel: #0d1422;
  --panel-2: #121b2d;
  --line: rgba(130, 190, 255, 0.14);
  --line-strong: rgba(130, 190, 255, 0.28);
  --text: #e8f0fb;
  --muted: #a3b3ca;
  --faint: #74869f;
  --cyan: #00e0ff;      /* money in, interactive */
  --amber: #ffb300;     /* money out */
  --red: #ff6b6b;       /* shortfall */
  --green: #00e676;
  --display: 'Besley', 'Rockwell', Georgia, serif;
  --body: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', 'Cascadia Code', ui-monospace, monospace;
  --wrap: 1120px;
  /* categorical slots, validated on --panel with the dataviz palette checker */
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
  --s5: #d55181; --s6: #0ca30c; --s7: #9085e9; --s8: #e66767; --s0: #7d8aa0;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 17px/1.6 var(--body); -webkit-font-smoothing: antialiased; }
a { color: var(--cyan); text-underline-offset: 3px; }
a:hover { color: #7fefff; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: var(--panel); padding: 8px 12px; z-index: 100; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

/* top bar */
.top { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 28px; padding: 12px 24px;
  background: rgba(7, 11, 20, 0.88); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.brand { font: 700 1.15rem/1 var(--display); color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.brand-mark { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--cyan); color: var(--cyan); font: 700 0.95rem/1 var(--display); }
.chapters { display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none; }
.chapters::-webkit-scrollbar { display: none; }
.chapters a { color: var(--muted); text-decoration: none; font-size: 0.9rem; font-weight: 500; white-space: nowrap; padding: 4px 0; border-bottom: 2px solid transparent; }
.chapters a:hover, .chapters a.on { color: var(--text); border-bottom-color: var(--cyan); }

/* hero */
.hero { padding: 72px 0 56px; border-bottom: 1px solid var(--line);
  background: radial-gradient(900px 380px at 12% -10%, rgba(0, 224, 255, 0.09), transparent 70%), var(--bg); }
.kicker { font: 500 0.82rem/1 var(--mono); color: var(--cyan); margin: 0 0 18px; letter-spacing: 0.02em; }
h1 { font: 800 clamp(2.3rem, 5.4vw, 4.2rem)/1.04 var(--display); letter-spacing: -0.015em; margin: 0 0 22px; max-width: 17ch; text-wrap: balance; }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 62ch; margin: 0 0 44px; }
.lede b { color: var(--text); font-weight: 600; }

.dollar { margin: 0; }
.dollar figcaption { font-size: 0.9rem; color: var(--muted); margin: 0 0 10px; }
.dollar figcaption.second { margin-top: 22px; }
.dollar-bar { display: flex; gap: 2px; height: 112px; border-radius: 10px; overflow: hidden; }
.dollar-bar.thin { height: 44px; }
.dollar-bar button { all: unset; box-sizing: border-box; cursor: pointer; height: 100%; min-width: 3px; display: flex; flex-direction: column; justify-content: flex-end; padding: 10px 12px; overflow: hidden;
  color: #fff; transition: filter 0.15s, opacity 0.15s; }
.dollar-bar.thin button { flex-direction: row; justify-content: flex-start; align-items: center; padding: 0 12px; }
.dollar-bar button:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }
.dollar-bar:hover button, .dollar-bar:focus-within button { opacity: 0.5; }
.dollar-bar button:hover, .dollar-bar button:focus-visible { opacity: 1; filter: brightness(1.12); }
.dollar-bar .c { font: 700 1.5rem/1 var(--display); white-space: nowrap; }
.dollar-bar.thin .c { font-size: 1.05rem; }
.dollar-bar .n { font-size: 0.8rem; font-weight: 500; line-height: 1.2; margin-top: 4px; white-space: nowrap; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.dollar-bar.thin .n { margin: 0 0 0 8px; }
.dollar-bar .hide { display: none; }
.dollar-bar .borrowed { background: repeating-linear-gradient(135deg, #a33 0 8px, #8a2a2a 8px 16px); }
.readout { min-height: 3.2em; margin: 14px 0 0; color: var(--muted); font-size: 0.95rem; max-width: 80ch; }
.readout b { color: var(--text); }

.ticker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 40px 0 0; border-top: 1px solid var(--line); }
.ticker div { padding: 18px 20px 0 0; }
.ticker dt { font-size: 0.85rem; color: var(--muted); }
.ticker dt span { color: var(--faint); }
.ticker dd { margin: 4px 0 0; font: 700 clamp(1.4rem, 2.6vw, 2rem)/1.1 var(--display); font-variant-numeric: tabular-nums; }

/* chapters */
.chapter { padding: 88px 0 24px; }
.prose { max-width: 68ch; margin-bottom: 28px; }
h2 { font: 800 clamp(1.7rem, 3.4vw, 2.5rem)/1.1 var(--display); letter-spacing: -0.01em; margin: 0 0 16px; text-wrap: balance; }
h3.sub { font: 700 1.4rem/1.2 var(--display); margin: 56px 0 10px; }
.prose p { color: var(--muted); margin: 0 0 12px; }
.prose p b, .cases p b { color: var(--text); font-weight: 600; }

/* chart frame */
.chart { margin: 0 0 28px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px 18px; min-width: 0; }
.chart-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-bottom: 14px; }
.chart-head h3 { font: 600 1.02rem/1.3 var(--body); margin: 0; }
.plot { position: relative; height: 400px; }
.plot.short { height: 250px; }
.plot.tall { height: 560px; }
.plot.auto { height: auto; }
.plot.map { height: auto; aspect-ratio: 975 / 610; }
.plot svg { display: block; width: 100%; height: 100%; overflow: visible; }
.src { font-size: 0.8rem; color: var(--faint); margin: 12px 0 0; }
.src a { color: var(--muted); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }

.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 3px; flex-wrap: wrap; }
.seg button { all: unset; cursor: pointer; font-size: 0.82rem; font-weight: 500; color: var(--muted); padding: 6px 12px; border-radius: 6px; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.seg button:focus-visible { outline: 2px solid var(--cyan); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.chips button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px 5px 10px; }
.chips button i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); opacity: 0.3; }
.chips button[aria-pressed="true"] { color: var(--text); border-color: var(--line-strong); background: var(--panel-2); }
.chips button[aria-pressed="true"] i { opacity: 1; }
.chips button:focus-visible { outline: 2px solid var(--cyan); }

/* svg marks */
.axis text { fill: var(--faint); font: 400 11.5px var(--body); font-variant-numeric: tabular-nums; }
.axis path, .axis line { stroke: none; }
.grid line { stroke: rgba(130, 190, 255, 0.09); }
.baseline { stroke: rgba(130, 190, 255, 0.3); }
.lbl { fill: var(--muted); font: 500 12px var(--body); }
.lbl.strong { fill: var(--text); }
.note { fill: var(--faint); font: 400 11px var(--body); }
.cross { stroke: rgba(232, 240, 251, 0.35); stroke-width: 1; pointer-events: none; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 10px; font-size: 0.82rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }

.tip { position: fixed; z-index: 80; pointer-events: none; background: #050810; border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; font-size: 0.82rem; line-height: 1.45; color: var(--muted); max-width: 320px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5); }
.tip h5 { margin: 0 0 6px; font: 600 0.86rem var(--body); color: var(--text); }
.tip table { border-collapse: collapse; width: 100%; }
.tip td { padding: 1px 0; }
.tip td:last-child { text-align: right; color: var(--text); font-variant-numeric: tabular-nums; padding-left: 16px; white-space: nowrap; }
.tip i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 7px; background: var(--c); }
.tip .sep td { border-top: 1px solid var(--line); padding-top: 4px; }

details.tbl { margin-top: 10px; font-size: 0.82rem; }
details.tbl summary { cursor: pointer; color: var(--muted); width: max-content; }
details.tbl > div { max-height: 320px; overflow: auto; margin-top: 10px; border: 1px solid var(--line); border-radius: 8px; }
details.tbl table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
details.tbl th, details.tbl td { padding: 5px 10px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
details.tbl th { position: sticky; top: 0; background: var(--panel-2); color: var(--text); font-weight: 600; }
details.tbl th:first-child, details.tbl td:first-child { text-align: left; }
details.tbl td { color: var(--muted); }

/* map */
.map-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 0.9rem; color: var(--muted); }
select { background: var(--bg); color: var(--text); border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 34px 8px 12px; font: 500 0.9rem var(--body); max-width: 100%;
  appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.map-grid { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 28px; align-items: start; }
.plot.map path.area { stroke: var(--panel); stroke-width: 0.5; cursor: pointer; }
.plot.map path.area.nodata { fill: #1a2233; }
.plot.map path.area:hover, .plot.map path.area.sel { stroke: #fff; stroke-width: 1.6; }
.plot.map path.mesh { fill: none; stroke: var(--panel); stroke-width: 0.9; pointer-events: none; }
.legend-scale { display: flex; align-items: flex-start; gap: 2px; margin-top: 12px; font-size: 0.74rem; color: var(--muted); }
.legend-scale div { flex: 1; text-align: center; min-width: 0; }
.legend-scale i { display: block; height: 10px; background: var(--c); margin-bottom: 5px; }
.legend-scale div:first-child i { border-radius: 4px 0 0 4px; }
.legend-scale div:last-child i { border-radius: 0 4px 4px 0; }
#map-side { font-size: 0.86rem; color: var(--muted); }
#map-side h4 { font: 700 1.2rem/1.2 var(--display); color: var(--text); margin: 0 0 4px; }
#map-side .pop { color: var(--faint); margin: 0 0 12px; }
#map-side table { width: 100%; border-collapse: collapse; }
#map-side td { padding: 5px 0; border-bottom: 1px solid var(--line); }
#map-side td:last-child { text-align: right; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
#map-side tr.cur td { color: var(--cyan); }
#map-side h5 { font: 600 0.82rem var(--body); color: var(--text); margin: 18px 0 6px; }
#map-side ol { margin: 0; padding: 0; list-style: none; }
#map-side li { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
#map-side li span:last-child { color: var(--text); font-variant-numeric: tabular-nums; }
#map-side button.link { all: unset; cursor: pointer; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
#map-side button.link:hover { color: var(--text); }

/* integrity */
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 0 0 36px; border-top: 1px solid var(--line-strong); }
.three article { padding: 22px 28px 8px 0; }
.three article + article { padding-left: 28px; border-left: 1px solid var(--line); }
.three h3 { font: 500 0.85rem var(--mono); color: var(--cyan); margin: 0 0 12px; }
.three .big { font: 700 1.5rem/1.2 var(--display); margin: 0 0 10px; color: var(--text); }
.three p { color: var(--muted); font-size: 0.93rem; margin: 0 0 10px; }
.cases { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.cases article { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px 22px 14px; min-width: 0; }
.cases h4 { font: 700 1.12rem/1.25 var(--display); margin: 0 0 10px; }
.cases p { font-size: 0.92rem; color: var(--muted); margin: 0 0 12px; }
.cases .both { font-size: 0.86rem; border-top: 1px solid var(--line); padding-top: 12px; }
.cases .both strong { color: var(--text); font-weight: 600; }
.cases .plot { margin: 4px 0 12px; height: 200px; }

.srclist { list-style: none; padding: 0; margin: 0 0 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; }
.srclist li { padding: 12px 0; border-top: 1px solid var(--line); font-size: 0.9rem; color: var(--muted); }
.srclist a { color: var(--text); font-weight: 500; }
.srclist small { display: block; color: var(--faint); font-size: 0.8rem; }
.fine { font-size: 0.82rem; color: var(--faint); }
.foot { margin-top: 72px; padding: 32px 0 48px; border-top: 1px solid var(--line); font-size: 0.86rem; color: var(--faint); }
.foot strong { color: var(--muted); }

@media (max-width: 900px) {
  .pair, .cases, .three, .srclist { grid-template-columns: 1fr; }
  .three article + article { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .map-grid { grid-template-columns: 1fr; }
  .ticker { grid-template-columns: 1fr 1fr; }
  .chapter { padding-top: 64px; }
  .plot { height: 340px; }
  .plot.tall { height: 640px; }
  .dollar-bar { height: 92px; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .top { gap: 16px; padding: 10px 16px; }
  .wrap { padding: 0 16px; }
  .chart { padding: 16px 14px 14px; border-radius: 12px; }
  .hero { padding-top: 44px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

/* v0.2 */
.map-controls .find-l { margin-left: 14px; }
input[type="search"], .money-input input { background: var(--bg); color: var(--text); border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 12px; font: 500 0.9rem var(--body); min-width: 0; }
input[type="search"] { width: 220px; max-width: 100%; }
details.tbl .csv { all: unset; cursor: pointer; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; margin: 8px 0 0; display: inline-block; }
details.tbl .csv:hover { color: var(--text); }
.receipt-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 40px; align-items: start; }
.receipt-form label { display: block; font-size: 0.9rem; color: var(--muted); margin-bottom: 8px; }
.money-input { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--line-strong); border-radius: 10px; padding: 4px 14px; }
.money-input span { font: 700 1.6rem var(--display); color: var(--faint); }
.money-input input { border: 0; background: transparent; padding: 8px 0; width: 100%; font: 700 1.9rem/1.1 var(--display); font-variant-numeric: tabular-nums; }
.money-input input:focus { outline: none; }
.money-input:focus-within { border-color: var(--cyan); }
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 16px; }
.presets button { all: unset; cursor: pointer; font-size: 0.82rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; }
.presets button:hover, .presets button:focus-visible { color: var(--text); border-color: var(--line-strong); }
.receipt { background: #f4f1e8; color: #1b1b1b; border-radius: 4px; padding: 26px 28px 22px; font: 400 0.92rem/1.5 var(--mono); max-width: 620px; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  -webkit-mask: linear-gradient(#000 0 0) top / 100% calc(100% - 8px) no-repeat, radial-gradient(circle at 6px 0, #000 5.5px, transparent 6px) bottom left / 12px 8px repeat-x;
  mask: linear-gradient(#000 0 0) top / 100% calc(100% - 8px) no-repeat, radial-gradient(circle at 6px 0, #000 5.5px, transparent 6px) bottom left / 12px 8px repeat-x; padding-bottom: 30px; }
.receipt h3 { font: 800 1.25rem/1.2 var(--display); margin: 0 0 2px; }
.receipt .sub { color: #5c5a53; font-size: 0.8rem; margin: 0 0 14px; }
.receipt .row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 5px 0; border-bottom: 1px dashed #c9c5b8; }
.receipt .row b { font-weight: 500; }
.receipt .row span:last-child { font-variant-numeric: tabular-nums; text-align: right; }
.receipt .row .bar { grid-column: 1 / -1; height: 4px; background: #ddd8c9; border-radius: 2px; overflow: hidden; }
.receipt .row .bar i { display: block; height: 100%; background: var(--c); }
.receipt .inside { font-size: 0.8rem; color: #5c5a53; margin: 14px 0 4px; }
.receipt .row.small { border-bottom: 0; padding: 2px 0; font-size: 0.84rem; color: #3a3933; }
.receipt .total { display: flex; justify-content: space-between; font-weight: 500; padding: 10px 0 2px; border-top: 2px solid #1b1b1b; margin-top: 10px; }
.receipt .total.red { color: #a3231f; border-top: 1px dashed #a3231f; }
.receipt .foot-note { font-size: 0.76rem; color: #5c5a53; margin: 14px 0 0; }
@media (max-width: 900px) { .receipt-grid { grid-template-columns: 1fr; gap: 24px; } .map-controls .find-l { margin-left: 0; } }

/* v0.3 */
.receipt-form .seg { margin-bottom: 18px; }
.receipt-form #rc-est label, .receipt-form #rc-amount-l { margin-top: 14px; }
.receipt-form select { width: 100%; }
.money-input.small input { font-size: 1.3rem; }
.money-input.small span { font-size: 1.2rem; }
.money-input.locked { opacity: 0.75; }
.scroll-x { overflow-x: auto; }
table.score { width: 100%; border-collapse: collapse; font-size: 0.9rem; font-variant-numeric: tabular-nums; min-width: 720px; }
table.score th { text-align: right; font-weight: 500; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; vertical-align: bottom; }
table.score th button { all: unset; cursor: pointer; }
table.score th button:hover, table.score th[aria-sort] button { color: var(--text); }
table.score th[aria-sort="descending"] button::after { content: " ↓"; color: var(--cyan); }
table.score th[aria-sort="ascending"] button::after { content: " ↑"; color: var(--cyan); }
table.score th:first-child, table.score td:first-child { text-align: left; }
table.score td { text-align: right; padding: 11px 12px; border-bottom: 1px solid var(--line); color: var(--text); white-space: nowrap; }
table.score td:first-child { white-space: normal; font-weight: 500; }
table.score td i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); margin-right: 9px; }
table.score td small { display: block; color: var(--faint); font-size: 0.76rem; font-weight: 400; margin-left: 19px; }
.chart-head .link { all: unset; cursor: pointer; font-size: 0.78rem; color: var(--faint); margin-left: auto; }
.chart-head .link:hover, .chart-head .link:focus-visible { color: var(--cyan); }
.chart-head h3 { margin-right: auto; }
.mini { margin: 0 0 6px; font-size: 0.82rem; color: var(--muted); }

/* v0.4 drill-down */
.readout button.jump, #map-side button.jump { all: unset; cursor: pointer; color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }
#map-side button.jump { display: inline-block; margin: 12px 0 0; font-weight: 500; }
.inside-row { display: grid; grid-template-columns: minmax(120px, 300px) minmax(0, 1fr) 240px; gap: 14px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 0.88rem; }
.inside-row .nm { color: var(--text); }
.inside-row .bar { height: 14px; position: relative; }
.inside-row .bar i { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 0 4px 4px 0; background: var(--c); }
.inside-row.neg .bar i { background: repeating-linear-gradient(135deg, #7a8597 0 5px, #5b6577 5px 10px); }
.inside-row .val { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }
.inside-row .val small { color: var(--faint); margin-left: 6px; }
.plot.map path.area.dim { opacity: 0.25; }
@media (max-width: 560px) { .inside-row { grid-template-columns: minmax(0, 1fr) 110px; } .inside-row .bar { grid-column: 1 / -1; order: 3; height: 8px; } .inside-row .val small { display: none; } }

/* v0.5 debt clock */
.clock { margin: 0 0 28px; padding: 30px 32px 26px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; border-top: 2px solid var(--red); }
.clock-label { margin: 0 0 8px; font-size: 0.9rem; color: var(--muted); }
.clock-num { margin: 0; font: 800 clamp(1.7rem, 6.2vw, 4.6rem)/1.05 var(--display); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; color: var(--text); white-space: nowrap; }
.clock-num .cents { color: var(--faint); }
.clock-basis { margin: 10px 0 0; font-size: 0.86rem; color: var(--faint); max-width: 78ch; }
.clock-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 24px 0 0; border-top: 1px solid var(--line); }
.clock-stats div { padding: 16px 18px 0 0; }
.clock-stats dt { font-size: 0.82rem; color: var(--muted); }
.clock-stats dd { margin: 4px 0 0; font: 700 clamp(1.15rem, 2.2vw, 1.6rem)/1.15 var(--display); font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .clock-stats { grid-template-columns: 1fr 1fr; } .clock { padding: 22px 18px 20px; } }
.clock-num, .clock-stats dd, #t-debt { font-family: var(--body); font-weight: 700; letter-spacing: -0.02em; }

/* v0.6 policy lab */
.chapters a.lab-link { color: var(--cyan); border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 12px; }
.chapters a.lab-link:hover { border-color: var(--cyan); }
.lab-hero { padding: 56px 0 28px; border-bottom: 1px solid var(--line); background: radial-gradient(900px 380px at 12% -10%, rgba(0, 224, 255, 0.09), transparent 70%), var(--bg); }
.lab-hero h1 { max-width: none; font-size: clamp(2.1rem, 4.6vw, 3.6rem); margin-bottom: 16px; }
.lab-hero .lede { margin-bottom: 24px; max-width: 70ch; font-size: 1.1rem; }
.presets-row { display: flex; flex-wrap: wrap; gap: 10px; }
.presets-row button { all: unset; cursor: pointer; padding: 10px 16px; border: 1px solid var(--line-strong); border-radius: 10px; font-weight: 600; font-size: 0.92rem; color: var(--text); background: var(--panel); }
.presets-row button:hover { border-color: var(--cyan); }
.presets-row button[aria-pressed="true"] { background: var(--cyan); color: #03161b; border-color: var(--cyan); }
.presets-row button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.preset-note { min-height: 1.5em; margin: 12px 0 0; color: var(--muted); font-size: 0.95rem; }
.lab-grid { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 32px; padding-top: 32px; align-items: start; }
.levers { position: sticky; top: 64px; max-height: calc(100vh - 80px); overflow-y: auto; padding-right: 6px; scrollbar-width: thin; }
.levers details { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); margin-bottom: 12px; }
.levers summary { cursor: pointer; padding: 14px 16px; font: 700 1.05rem var(--display); display: flex; justify-content: space-between; align-items: center; }
.levers summary small { font: 500 0.75rem var(--body); color: var(--cyan); }
.levers .body { padding: 2px 16px 12px; }
.lever { padding: 10px 0 12px; border-top: 1px solid var(--line); }
.lever-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; font-size: 0.9rem; }
.lever-head label, .lever-head span.l { color: var(--text); font-weight: 500; }
.lever-head output { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 0.86rem; }
.lever.changed .lever-head output { color: var(--cyan); font-weight: 600; }
.lever p { margin: 6px 0 0; font-size: 0.78rem; color: var(--faint); line-height: 1.45; }
.lever input[type="range"] { width: 100%; margin: 10px 0 0; accent-color: var(--cyan); height: 22px; }
.lever .seg { margin-top: 10px; }
.lever .switch { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 0.86rem; color: var(--muted); cursor: pointer; }
.lever .switch input { accent-color: var(--cyan); width: 18px; height: 18px; }
.verdict { font: 700 clamp(1.25rem, 2.4vw, 1.8rem)/1.25 var(--display); margin: 0 0 18px; text-wrap: balance; }
.verdict .good { color: var(--green); } .verdict .bad { color: var(--red); }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 0 0 24px; border-top: 1px solid var(--line-strong); }
.tiles div { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--line); }
.tiles dt { font-size: 0.82rem; color: var(--muted); }
.tiles dd { margin: 4px 0 0; font: 700 1.5rem/1.15 var(--body); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.tiles dd small { display: block; font: 400 0.78rem/1.4 var(--body); color: var(--faint); letter-spacing: 0; margin-top: 3px; }
.tiles dd small b { font-weight: 600; }
.tiles dd small b.good { color: var(--green); } .tiles dd small b.bad { color: var(--red); }
.lab-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 4px 0 0; }
.btn { all: unset; cursor: pointer; padding: 11px 18px; border-radius: 10px; font-weight: 600; font-size: 0.95rem; background: var(--cyan); color: #03161b; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line-strong); }
.btn:hover { filter: brightness(1.1); } .btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.hood { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; }
.hood div { padding: 12px 0; border-top: 1px solid var(--line); font-size: 0.9rem; color: var(--muted); display: flex; justify-content: space-between; gap: 18px; }
.hood div b { color: var(--text); font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mixrow { display: grid; grid-template-columns: 170px minmax(0, 1fr) 110px; gap: 12px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 0.86rem; }
.mixrow .bars { display: grid; gap: 3px; }
.mixrow .bars i { display: block; height: 9px; border-radius: 0 3px 3px 0; background: var(--c); }
.mixrow .bars i.base { background: #56627a; }
.mixrow .v { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }
.mixrow .v small { color: var(--faint); }
.mixrow.total { border-top: 1px solid var(--line-strong); font-weight: 600; }
@media (max-width: 980px) {
  .lab-grid { grid-template-columns: 1fr; }
  .levers { position: static; max-height: none; overflow: visible; padding: 0; }
  .tiles { grid-template-columns: 1fr 1fr; } .hood { grid-template-columns: 1fr; }
  .hood div b { white-space: normal; text-align: right; }
  .mixrow { grid-template-columns: 110px minmax(0, 1fr) 84px; }
}

/* v0.7 advocates and who feels it */
.party { display: inline-block; font: 600 0.68rem/1 var(--body); letter-spacing: 0.02em; padding: 3px 7px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); margin-right: 8px; white-space: nowrap; vertical-align: 1px; }
.lever .who { margin: 8px 0 0; padding: 0; list-style: none; font-size: 0.78rem; color: var(--muted); line-height: 1.45; }
.lever .who li { margin: 5px 0 0; }
.lever .who b { color: var(--text); font-weight: 600; }
.lever .who a, .wholist a { color: var(--muted); }
.lever details.backers { border: 0; background: none; margin: 8px 0 0; }
.lever details.backers summary { padding: 0; font: 500 0.78rem var(--body); color: var(--cyan); display: inline; cursor: pointer; }
.wholist { font-size: 0.9rem; color: var(--muted); }
.wholist .item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.wholist .item:first-child { padding-top: 2px; }
.wholist .item h4 { margin: 0 0 6px; font: 600 0.92rem var(--body); color: var(--text); }
.wholist .item h4 span { color: var(--cyan); font-weight: 500; margin-left: 6px; }
.wholist .item p { margin: 4px 0 0; line-height: 1.5; }
.wholist .item p b { color: var(--text); font-weight: 600; }
.wholist .empty { padding: 6px 0 2px; }

.month-stats { margin: 4px 0 18px; border-top: 0; }
.month-stats div { padding-top: 0; }
@media (max-width: 900px) { .month-stats div { padding-bottom: 12px; } }

/* methods page */
.methods .hood { grid-template-columns: 1fr; max-width: 78ch; }
.methods .hood div span { display: block; } .methods .hood .ul { display: block; color: var(--text); font-weight: 600; white-space: normal; margin-bottom: 2px; }
table.score.plain { min-width: 0; max-width: 560px; }
.log { color: var(--muted); padding-left: 20px; margin: 0 0 14px; } .log li { margin-bottom: 8px; }
.cmp { margin: 6px 0 14px; }
.cmp-row, .cmp-axis { display: grid; grid-template-columns: minmax(150px, 300px) minmax(0, 1fr) 52px; gap: 16px; align-items: center; }
.cmp-row { padding: 9px 0; border-top: 1px solid var(--line); }
.cmp-l { font-size: 0.9rem; color: var(--text); }
.cmp-v { text-align: right; font-variant-numeric: tabular-nums; font-size: 0.9rem; color: var(--muted); }
.cmp-track { position: relative; height: 18px; background: linear-gradient(var(--line), var(--line)) center / 100% 1px no-repeat; }
.cmp-track i { position: absolute; top: 50%; transform: translateY(-50%); }
.cmp-track .band { height: 18px; background: rgba(0, 224, 255, 0.10); border-radius: 4px; }
.cmp-track .cbo { height: 18px; min-width: 2px; background: var(--muted); border-radius: 1px; opacity: 0.85; }
.cmp-track .dot { width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 2px var(--panel); }
.cmp-track .dot.hollow { background: var(--panel); border: 2px solid var(--cyan); box-shadow: none; }
.cmp-track .dot.off { background: var(--amber); }
.cmp-axis { font-size: 0.72rem; color: var(--faint); padding-bottom: 4px; }
.cmp-axis div { position: relative; height: 14px; } .cmp-axis i { position: absolute; transform: translateX(-50%); font-style: normal; white-space: nowrap; }
.cmp-axis i:first-child { transform: none; } .cmp-axis i:last-child { transform: translateX(-100%); }
.cmp-legend i.k-cbo { width: 3px; height: 14px; border-radius: 1px; background: var(--muted); }
.cmp-legend i.k-band { width: 18px; background: rgba(0, 224, 255, 0.18); }
.cmp-legend i.k-dot { border-radius: 50%; background: var(--cyan); } .cmp-legend i.k-dot.hollow { background: transparent; border: 2px solid var(--cyan); box-sizing: border-box; }
details.tbl td.wrapcell { white-space: normal; min-width: 240px; text-align: left; } details.tbl td small { color: var(--faint); }
@media (max-width: 640px) { .cmp-row, .cmp-axis { grid-template-columns: minmax(0, 1fr) 44px; gap: 4px 10px; } .cmp-l { grid-column: 1 / -1; } .cmp-axis span:first-child { display: none; } }

/* program pages */
.tiles.five { grid-template-columns: repeat(5, 1fr); margin: 8px 0 22px; }
.tiles.five div { padding-right: 18px; }
.tiles.five dd { font-size: clamp(1.15rem, 2vw, 1.5rem); }
.others { display: flex; flex-wrap: wrap; gap: 8px; }
.others a, .prog-links a { font-size: 0.86rem; padding: 7px 13px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--muted); text-decoration: none; }
.others a:hover, .prog-links a:hover { color: var(--text); border-color: var(--cyan); }
.prog-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 26px; align-items: center; } .prog-links span { font-size: 0.86rem; color: var(--faint); margin-right: 4px; }
.cases.two { grid-template-columns: repeat(2, 1fr); margin-bottom: 14px; }
.rank-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 84px; gap: 12px; align-items: center; padding: 5px 0; font-size: 0.88rem; }
.rank-l { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-bar { height: 14px; display: block; } .rank-bar i { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.rank-v { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.rank-row:nth-child(11) { margin-top: 10px; padding-top: 12px; border-top: 1px dashed var(--line-strong); }
table.score.plain.wide { max-width: none; }
.who-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; margin-bottom: 22px; }
.who-grid .item { padding: 16px 0; border-top: 1px solid var(--line); } .who-grid h4 { margin: 0 0 6px; font: 600 1rem var(--body); }
.who-grid p { margin: 0 0 8px; font-size: 0.88rem; color: var(--muted); } .who-grid a { color: var(--text); }
.program a.btn { display: inline-block; text-decoration: none; }
@media (max-width: 980px) { .tiles.five { grid-template-columns: 1fr 1fr; } .cases.two, .who-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .rank-row { grid-template-columns: 104px minmax(0, 1fr) 70px; gap: 8px; } }

.chart h3.sub { font: 600 0.95rem var(--body); margin: 22px 0 8px; }

/* review fixes, v0.11 */
.verdict .plain, .tiles dd small b.plain { color: var(--text); }
.caution { border: 1px solid var(--amber); border-left-width: 4px; border-radius: 10px; padding: 12px 14px; margin: 0 0 14px; font-size: 0.92rem; color: var(--text); background: rgba(255, 179, 0, 0.07); }
.vintage { font-size: 0.8rem; color: var(--faint); margin: -6px 0 18px; }
.presets-row button.illus { border-style: dashed; } .presets-row button small { display: block; font: 500 0.7rem var(--body); color: var(--faint); margin-top: 2px; }
.presets-row button[aria-pressed="true"] small { color: #03161b; }
.results { min-width: 0; } .results .tiles { min-width: 0; } .results .tiles div { min-width: 0; overflow-wrap: anywhere; }
.mini { display: none; }
@media (max-width: 980px) {
  .mini { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; gap: 12px; align-items: center; padding: 10px 16px; background: #050810; border-top: 1px solid var(--line-strong); font-size: 0.86rem; color: var(--muted); }
  .mini b { color: var(--text); font-variant-numeric: tabular-nums; margin-right: auto; } .mini a { color: var(--cyan); text-decoration: none; padding: 8px 4px; }
  body.lab:not(.methods):not(.program) { padding-bottom: 56px; }
}
@media (max-width: 760px) {
  /* One row that scrolls sideways, with a fade on the right edge to show there is more. It was four wrapped rows, which pushed the first graphic off a phone's first screen. */
  .top { position: static; flex-wrap: wrap; gap: 6px 16px; }
  .chapters { flex-wrap: nowrap; overflow-x: auto; gap: 4px 18px; width: 100%; -webkit-mask-image: linear-gradient(90deg, #000 86%, transparent); mask-image: linear-gradient(90deg, #000 86%, transparent); padding-right: 28px; }
  .chapters a { padding: 8px 0; }
}

.cases.four { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .cases.four { grid-template-columns: 1fr; } }

/* v0.13: scroll hint on wide tables, small screens */
@media (max-width: 760px) { .scroll-x, details.tbl > div { background: linear-gradient(to left, rgba(0, 224, 255, 0.10), transparent 28px) right / 28px 100% no-repeat; } }

/* links between the Decisive Labs atlases, above the header on every page */
.atlases { display: flex; align-items: center; gap: 20px; padding: 7px 24px; background: #050810; border-bottom: 1px solid var(--line); font: 500 0.76rem/1.4 var(--mono); overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.atlases::-webkit-scrollbar { display: none; }
.atlases a { color: var(--muted); text-decoration: none; padding: 3px 0; }
.atlases a:hover { color: var(--text); }
.atlases a.here { color: var(--cyan); }
.atlases a:first-child { color: var(--text); padding-right: 20px; border-right: 1px solid var(--line); }
@media (max-width: 560px) { .atlases { padding: 7px 16px; gap: 16px; } }

/* Visual first: headline, then the graphic; the long paragraph sits below it */
.hero.vf { padding-top: 34px; }
.hero.vf h1 { font-size: clamp(1.5rem, 3.6vw, 2.7rem); margin-bottom: 14px; max-width: 30ch; }
.hero.vf .kicker { margin-bottom: 10px; }
.hero.vf .lede { margin: 30px 0 0; font-size: 1.05rem; }
.hero.vf .dollar figcaption { margin-bottom: 6px; }
.hero.vf .dollar figcaption.second { margin-top: 14px; }
.stale { color: var(--amber); }
.fresh { color: var(--faint); }
.receipt .part { font: 700 0.74rem/1.3 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: #5c5a53; margin: 14px 0 4px; }
.receipt .part.red { color: #a3231f; margin-top: 18px; }
@media (max-width: 640px) { .hero.vf { padding-top: 18px; } .hero.vf .dollar-bar { height: 96px; } }

/* Policy lab: hold debt steady (assets/js/stabilize.js) */
.sz-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.sz-slider { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; margin: 0 0 16px; font-size: 0.88rem; color: var(--muted); }
.sz-slider output { color: var(--cyan); font-weight: 600; font-variant-numeric: tabular-nums; }
.sz-slider input[type="range"] { grid-column: 1 / -1; width: 100%; accent-color: var(--cyan); height: 22px; }
.sz-h { font: 600 0.82rem var(--body); color: var(--muted); margin: 0 0 8px; }
.sz-mark { display: inline-block; font: 600 0.68rem/1 var(--mono); color: var(--amber); border: 1px solid var(--amber); border-radius: 999px; padding: 4px 8px; margin-left: 8px; vertical-align: middle; white-space: nowrap; }
#c-sz-map, #c-sz-path { height: auto; }
@media (max-width: 1100px) { .sz-grid { grid-template-columns: 1fr 1fr; } .sz-levers { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; } }
@media (max-width: 700px) { .sz-grid { grid-template-columns: 1fr; } .sz-levers { grid-template-columns: 1fr; } }

/* Share, save, reset, and the change log (assets/js/extras.js) */
.share-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 0; }
.share-row button { all: unset; box-sizing: border-box; cursor: pointer; font: 500 0.78rem/1 var(--body); color: var(--muted); border: 1px solid var(--line-strong); border-radius: 999px; padding: 7px 12px; }
.share-row button:hover, .share-row button:focus-visible { color: var(--text); border-color: var(--cyan); }
.share-row button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.share-say { font-size: 0.8rem; color: var(--cyan); }
.changes { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; max-width: 900px; }
.changes li { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 4px; color: var(--muted); font-size: 0.92rem; }
.changes li > b { color: var(--text); font-weight: 600; }
.changes li .chg b { color: var(--text); }
.changes li small { color: var(--faint); font-size: 0.8rem; }
.changes li.none { border-style: dashed; }
.changes .pill { justify-self: start; display: inline-block; font: 600 0.68rem/1 var(--mono); padding: 4px 8px; border-radius: 999px; border: 1px solid var(--line-strong); }
.changes .pill.p2 { border-color: var(--cyan); color: var(--cyan); }
.changes .pill.p1 { border-color: var(--amber); color: var(--amber); }
.fresh { color: var(--faint); }
.changes table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 0.86rem; }
.changes th { text-align: left; font-weight: 500; color: var(--faint); padding: 6px 10px 6px 0; border-bottom: 1px solid var(--line-strong); }
.changes td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--text); }
.changes td small { display: block; margin-top: 4px; }
.changes td .pill { margin-right: 4px; }

/* share dialog */
.share-dlg { width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow: auto; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--panel, #0d1424); color: var(--text); padding: 20px 22px; }
.share-dlg::backdrop { background: rgba(2, 5, 12, 0.72); }
.share-dlg h3 { font: 700 1.15rem var(--display, inherit); margin: 0 0 12px; }
.share-prev { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg); min-height: 120px; display: grid; place-items: center; color: var(--faint); font-size: 0.86rem; }
.share-prev canvas { display: block; width: 100%; height: auto; }
.share-dlg label { display: block; font-size: 0.82rem; color: var(--muted); margin: 14px 0 6px; }
.share-dlg textarea { width: 100%; box-sizing: border-box; background: var(--bg); color: var(--text); border: 1px solid var(--line-strong); border-radius: 8px; padding: 9px 11px; font: 400 0.95rem/1.45 var(--body); resize: vertical; }
.share-acts { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.share-acts button { all: unset; box-sizing: border-box; cursor: pointer; font: 600 0.84rem/1 var(--body); color: var(--bg); background: var(--cyan); border-radius: 999px; padding: 9px 14px; }
.share-acts button[data-do="copy"], .share-acts button[data-do="png"], .share-acts button[data-do="vid"], .share-acts button.ghost { background: none; color: var(--text); border: 1px solid var(--line-strong); }
.share-acts button[disabled] { opacity: 0.5; cursor: default; } .share-acts button[hidden] { display: none; }
.share-acts button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.share-note { min-height: 1.4em; margin: 10px 0 0; font-size: 0.84rem; color: var(--cyan); }
.share-fine { margin: 6px 0 0; font-size: 0.78rem; color: var(--faint); }
