/* Robot Atlas. Same system as Fiscal Atlas, AI Atlas and Longevity Atlas. */
: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; }
.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; } }


/* shared small parts (from Fiscal Atlas) */
input[type="search"] { 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; width: 260px; 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); }
.scroll-x { overflow-x: auto; }
table.score { width: 100%; border-collapse: collapse; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
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:first-child, table.score td:first-child { text-align: left; }
table.score td { text-align: right; padding: 10px 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; }
.chart-head h3 { margin-right: auto; }
.mini { margin: 0 0 6px; font-size: 0.82rem; color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(4, 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; }
.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; text-align: right; font-variant-numeric: tabular-nums; }
.ticker dd { font-family: var(--body); font-weight: 700; letter-spacing: -0.02em; }
.ticker dd small { display: block; font: 400 0.78rem/1.4 var(--body); color: var(--faint); letter-spacing: 0; margin-top: 4px; }

/* shared with AI Atlas */
.chapters a.out-link { color: var(--cyan); border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 12px; }
.chapters a.out-link:hover { border-color: var(--cyan); }
.ladder { margin: 0; }
.ladder figcaption { font-size: 0.9rem; color: var(--muted); margin: 0 0 6px; }
.ladder .plot { height: 190px; }
.ladder .rung { stroke: rgba(130, 190, 255, 0.16); }
.ladder .rung-l { fill: var(--muted); font: 500 11.5px var(--body); }
.ladder .yr { fill: var(--faint); font: 500 11px var(--mono); }
.ladder circle { cursor: pointer; }
.proj-band { fill: rgba(0, 224, 255, 0.05); }
.proj-line { stroke-dasharray: 5 5; }
.caution { fill: rgba(255, 179, 0, 0.07); }
.caution-l { fill: var(--amber); font: 500 11px var(--body); opacity: 0.85; }
.modelled { display: inline-block; font: 600 0.68rem/1 var(--mono); letter-spacing: 0.03em; padding: 4px 8px; border-radius: 999px; border: 1px solid var(--amber); color: var(--amber); margin-left: 10px; vertical-align: 2px; white-space: nowrap; }
.slider { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 18px; align-items: center; margin: 0 0 14px; font-size: 0.9rem; color: var(--muted); }
.slider input[type="range"] { width: 100%; accent-color: var(--cyan); height: 22px; grid-column: 1 / -1; }
.slider output { color: var(--cyan); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 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); }
.presets button[aria-pressed="true"] { color: var(--text); border-color: var(--cyan); }
.bgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 0 0 28px; }
.bcard { all: unset; box-sizing: border-box; cursor: pointer; display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 14px 10px; min-width: 0; }
.bcard:hover, .bcard:focus-visible { border-color: var(--line-strong); }
.bcard[aria-pressed="true"] { border-color: var(--cyan); }
.bcard h4 { margin: 0; font: 600 0.9rem/1.3 var(--body); color: var(--text); }
.bcard .big { font: 700 1.6rem/1.1 var(--body); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin: 6px 0 0; color: var(--text); }
.bcard .who { font-size: 0.76rem; color: var(--faint); margin: 2px 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bcard svg { display: block; width: 100%; height: 56px; overflow: visible; }
.bcard .tag { font: 500 0.68rem var(--mono); color: var(--green); }
.bcard .tag.open { color: var(--faint); }
.jobs-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
#job-find { font-size: 0.88rem; color: var(--muted); }
#job-find ol { list-style: none; margin: 12px 0 0; padding: 0; }
#job-find li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
#job-find li span:last-child { color: var(--text); font-variant-numeric: tabular-nums; }
.status { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-right: 8px; }
.status.bad { background: var(--red); }
@media (max-width: 980px) { .bgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .jobs-grid { grid-template-columns: 1fr; } .tiles { grid-template-columns: 1fr 1fr; } .hood { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .ladder .plot { height: 170px; } }

/* Longevity Atlas */
.ladder .plot { height: 200px; }
.ladder .ring { fill: none; stroke: var(--amber); stroke-width: 2; }
.plot.map svg { overflow: visible; }
.pill { display: inline-block; font: 600 0.7rem/1 var(--mono); letter-spacing: 0.02em; padding: 4px 8px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; }
.pill.p3 { border-color: var(--green); color: var(--green); }
.pill.p2 { border-color: var(--cyan); color: var(--cyan); }
.pill.p1 { border-color: var(--amber); color: var(--amber); }
table.score td.wrap-cell { white-space: normal; text-align: left; color: var(--muted); font-size: 0.86rem; min-width: 280px; max-width: 520px; }
table.score td.wrap-cell a { color: var(--muted); }
table.score th.l, table.score td.l { text-align: left; }
.rungs { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.rungs > li { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 8px 28px; padding: 18px 0; border-top: 1px solid var(--line); }
.rungs > li:first-child { border-top: 1px solid var(--line-strong); }
.rungs .rung-h { font: 600 0.92rem/1.35 var(--body); color: var(--text); }
.rungs .rung-h span { display: block; font: 500 0.72rem var(--mono); color: var(--cyan); margin-bottom: 6px; }
.rungs .steps { display: flex; gap: 3px; margin-top: 10px; }
.rungs .steps i { width: 22px; height: 5px; border-radius: 2px; background: var(--line-strong); }
.rungs .steps i.on { background: var(--cyan); }
.rungs dl { margin: 0; }
.rungs dt { font-weight: 600; color: var(--text); font-size: 0.95rem; }
.rungs dd { margin: 2px 0 12px; color: var(--muted); font-size: 0.9rem; }
.rungs dd:last-child { margin-bottom: 0; }
.rungs dd a { color: var(--muted); }
.rungs dd small { color: var(--faint); }
.callout { border-left: 3px solid var(--amber); padding: 4px 0 4px 16px; margin: 0 0 24px; color: var(--muted); font-size: 0.95rem; max-width: 72ch; }
.callout b { color: var(--text); font-weight: 600; }
.callout a { color: var(--muted); }
.tl-row { fill: var(--muted); font: 500 12px var(--body); }
@media (max-width: 700px) { .rungs > li { grid-template-columns: 1fr; } }
#map-side li button { all: unset; cursor: pointer; color: var(--muted); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
#map-side li button:hover, #map-side li button:focus-visible { color: var(--text); }
.plot.map path.area { stroke: rgba(7, 11, 20, 0.7); }

/* v0.2 opening chart: survival curve with a year scrubber */
.surv { margin: 0; }
.surv-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin: 0 0 10px; }
.surv figcaption { font-size: 0.9rem; color: var(--muted); max-width: 60ch; }
.surv .plot { height: 380px; }
.surv-year { fill: var(--text); fill-opacity: 0.16; font: 800 clamp(3rem, 9vw, 6rem)/1 var(--display); font-variant-numeric: tabular-nums; pointer-events: none; }
.surv-bar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; margin: 10px 0 0; }
.surv-bar button { all: unset; cursor: pointer; box-sizing: border-box; min-width: 72px; text-align: center; font: 600 0.86rem/1 var(--body); color: var(--bg); background: var(--cyan); border-radius: 999px; padding: 9px 16px; }
.surv-bar button:hover { background: #7fefff; }
.surv-bar button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.surv-bar input[type="range"] { width: 100%; accent-color: var(--cyan); height: 22px; }
.surv-bar output { color: var(--cyan); font: 600 1rem var(--mono); font-variant-numeric: tabular-nums; min-width: 4ch; text-align: right; }
.surv-you { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.surv-you .tiles { grid-template-columns: repeat(3, 1fr); margin-bottom: 8px; }
@media (max-width: 560px) { .surv .plot { height: 300px; } .surv-you .tiles { grid-template-columns: 1fr; } }

/* v0.3 scenario builder */
.un-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 32px; align-items: start; }
.un-levers .slider { margin: 0 0 10px; font-size: 0.86rem; }
.un-levers .slider small { display: block; grid-column: 1 / -1; color: var(--faint); font-size: 0.76rem; margin-top: -4px; }
.un-levers .slider.age { border-top: 1px solid var(--line-strong); padding-top: 14px; margin-top: 16px; }
.un-levers .slider.age input[type="range"] { accent-color: var(--amber); }
.un-levers .slider.age output { color: var(--amber); }
.un-tiles { grid-template-columns: repeat(4, 1fr); margin-bottom: 14px; }
.un-tiles dd.hot { color: var(--amber); }
#c-un { height: 360px; }
@media (max-width: 980px) { .un-grid { grid-template-columns: 1fr; } .un-tiles { grid-template-columns: 1fr 1fr; } }

/* v0.4 opening picture: 100 people, then and now */
.ppl { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; max-width: 820px; margin: 6px 0 4px; }
.ppl-h { margin: 0; font-size: 0.86rem; color: var(--muted); }
.ppl-n { margin: 2px 0 12px; font: 700 clamp(2rem, 5vw, 3rem)/1.1 var(--body); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--text); }
.ppl-n span { font: 500 1rem var(--body); color: var(--muted); letter-spacing: 0; }
.ppl-col.now .ppl-n { color: var(--cyan); }
.ppl-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; max-width: 360px; }
.ppl-grid i { display: block; aspect-ratio: 1; border-radius: 50%; background: #162033; box-shadow: inset 0 0 0 1px rgba(130, 190, 255, 0.14); transition: background 0.25s; }
.ppl-col.then .ppl-grid i.on { background: #a3b3ca; box-shadow: none; }
.ppl-col.now .ppl-grid i.on { background: var(--cyan); box-shadow: none; }
.surv-bar output { min-width: 6ch; }
@media (max-width: 560px) { .ppl { gap: 18px; } .ppl-grid { gap: 4px; } }

/* 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; } }

/* Robot Atlas: map of driverless services */
.rmap-wrap { position: relative; min-width: 0; }
.plot.rmap { height: auto; aspect-ratio: 975 / 610; background: #080d19; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; touch-action: none; cursor: grab; }
.plot.rmap:active { cursor: grabbing; }
.plot.rmap svg { overflow: hidden; }
.plot.rmap .land { fill: #131d30; stroke: rgba(130, 190, 255, 0.22); stroke-linejoin: round; vector-effect: non-scaling-stroke; stroke-width: 0.7; }
.plot.rmap .dome { fill-opacity: 0.5; stroke-opacity: 0.95; vector-effect: non-scaling-stroke; stroke-width: 1.3; cursor: pointer; }
.plot.rmap .dome.soft { fill-opacity: 0.1; stroke-dasharray: 4 3; }
.plot.rmap .dome.sel { stroke: #fff; stroke-width: 2.2; }
.plot.rmap .dome.off { display: none; }
.hero .map-grid { margin-top: 6px; }
.hero #map-side { padding-top: 4px; }
#map-side .mode { color: var(--amber); }
@media (max-width: 900px) { .plot.rmap { aspect-ratio: 4 / 3.2; } }

/* Visual first: headline, one sentence, then the graphic */
.hero { padding-top: 34px; }
.hero h1 { font-size: clamp(1.5rem, 3.6vw, 2.7rem); margin-bottom: 10px; max-width: 30ch; }
.hero .kicker { margin-bottom: 10px; }
.hero-q { font-size: 1.05rem; color: var(--muted); max-width: 62ch; margin: 0 0 16px; }
.hero .surv figcaption { margin-top: 10px; font-size: 0.82rem; color: var(--faint); max-width: 90ch; }
.hero .readout { min-height: 4.2em; }
.plot.rmap.hero-map { aspect-ratio: 975 / 400; cursor: default; touch-action: auto; }
.plot.rmap .fac { fill: var(--s1); fill-opacity: 0.32; stroke: var(--s1); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.plot.rmap .fac.held { stroke-dasharray: 4 3; fill-opacity: 0.14; }
.plot.rmap .fac-l { fill: var(--text); font: 600 12px var(--body); text-anchor: middle; pointer-events: none; }
.plot.rmap .taxi { fill: var(--s8); stroke: var(--s8); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.plot.rmap .taxi.soft { fill-opacity: 0.08; stroke-dasharray: 3 2; }
.plot.rmap .taxi.off { display: none; }
.plot.rmap .yr { fill: var(--text); fill-opacity: 0.2; font: 800 64px var(--display); font-variant-numeric: tabular-nums; pointer-events: none; }
.stale { color: var(--amber); }
.chart-head .pill { margin-left: 10px; vertical-align: middle; }
@media (max-width: 640px) { .hero { padding-top: 18px; } .hero-q { font-size: 0.95rem; margin-bottom: 10px; } .plot.rmap.hero-map { aspect-ratio: 975 / 520; } .plot.rmap .yr { font-size: 90px; } .plot.rmap .fac-l { font-size: 22px; } }

/* 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); }
.tiles.sync { grid-template-columns: repeat(5, 1fr); margin: 14px 0 0; }
.tiles.sync dd { font-size: clamp(1.1rem, 2.4vw, 1.6rem); font-variant-numeric: tabular-nums; }
.tiles.sync dt { font-size: 0.74rem; }
@media (max-width: 640px) { .tiles.sync { grid-template-columns: repeat(3, 1fr); gap: 8px 10px; } }
.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; }
.sec-intro { color: var(--muted); font-size: 0.95rem; max-width: 80ch; margin: 0 0 14px; }
table.score td.wrap-cell { white-space: normal; min-width: 180px; }
table.score th.l, table.score td.l { text-align: left; }
#map-cover { white-space: normal; line-height: 1.3; }

/* 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); }

/* Energy Atlas: plant map and country map */
.plot.rmap.us-hero { aspect-ratio: 975 / 580; cursor: default; touch-action: auto; }
.plot.rmap .pp { fill-opacity: 0.62; stroke: rgba(7, 11, 20, 0.55); stroke-width: 0.4; }
.plot.rmap .pp.plan { fill: none; stroke-width: 1.3; stroke-dasharray: 3 2; stroke-opacity: 0.95; }
.plot.rmap .pp.off { display: none; }
.plot.rmap .land.choro { stroke: rgba(7, 11, 20, 0.7); stroke-width: 0.5; transition: fill 0.25s; }
.tiles.sync dt i, .tiles dt i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; background: var(--c); margin-right: 6px; }
@media (max-width: 640px) { .plot.rmap.us-hero { aspect-ratio: 975 / 640; } }

/* Energy Atlas: temperature globe */
.globe-wrap { background: radial-gradient(ellipse at 50% 45%, #0a1326 0%, #05080f 75%); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
#c-clim { display: block; width: 100%; cursor: grab; touch-action: pan-y; }
#c-clim:active { cursor: grabbing; }
.clim-scale { margin: 10px 0 0; }
.clim-scale .bar { height: 10px; border-radius: 5px; }
.clim-scale .ticks { position: relative; height: 1.3em; margin-top: 4px; font: 500 0.72rem/1 var(--mono); color: var(--muted); }
.clim-scale .ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.clim-scale .ticks span:first-child { transform: none; }
.clim-scale .ticks span:last-child { transform: translateX(-100%); }
.plot.auto { height: auto; }
#clim-tiles { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 640px) { #clim-tiles { grid-template-columns: repeat(3, 1fr); } }
#clim-mark[hidden] { display: none; }
