:root{
  --bg:#0B0D10; --surface:#14181Deb; --line:#232A32;
  --text:#C8D0D8; --dim:#7C8894; --accent:#5FE3C0;
  --R:#FF5A5F; --D:#3FA9FF; --I:#FFD34E; --cross:#A78BC4;
  --bar-h:60px;
}
*{box-sizing:border-box}
html,body{height:100%;margin:0;background:var(--bg);color:var(--text);
  font:13px/1.5 ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  font-variant-numeric:tabular-nums;overflow:hidden}
#topbar{position:fixed;top:0;left:0;right:0;height:var(--bar-h);z-index:30;
  display:flex;align-items:center;justify-content:space-between;gap:20px;
  padding:0 22px;background:#0F1319f2;backdrop-filter:blur(14px);
  border-bottom:1px solid var(--line)}
#topbar h1{font-size:16px;font-weight:650;letter-spacing:-.015em;white-space:nowrap}
#topbar .sub{margin:2px 0 0;color:var(--dim);font-size:11.5px;white-space:nowrap;
  overflow:hidden;text-overflow:ellipsis}
.tb-back{display:flex;align-items:center;gap:9px;text-decoration:none;color:var(--dim);
  padding:7px 13px 7px 11px;border:1px solid var(--line);border-radius:7px;flex:none;
  transition:color .14s,border-color .14s,background .14s}
.tb-back:hover{color:var(--text);border-color:#39434E;background:#1B2027}
.tb-back .arr{font-size:14px;line-height:1}
.tb-back .lbl{display:flex;flex-direction:column;line-height:1.25}
.tb-back b{font-size:11.5px;font-weight:600;color:inherit}
.tb-back i{font-style:normal;font-size:10px;text-transform:uppercase;letter-spacing:.07em;opacity:.75}

#gl{position:fixed;inset:0;width:100%;height:100%;display:block}
#vignette{position:fixed;inset:0;pointer-events:none;
  background:radial-gradient(ellipse at 58% 50%,transparent 42%,#000 128%);opacity:.75}

#panel{position:fixed;top:var(--bar-h);left:0;bottom:0;width:322px;padding:18px 18px 26px;
  background:var(--surface);backdrop-filter:blur(14px);border-right:1px solid var(--line);
  overflow-y:auto;overscroll-behavior:contain}
#panel::-webkit-scrollbar{width:8px}
#panel::-webkit-scrollbar-thumb{background:#232A32;border-radius:4px}
h1{margin:0;font-size:15px;font-weight:650;letter-spacing:-.01em}
.sub{margin:5px 0 0;color:var(--dim);font-size:11.5px;line-height:1.45}
section{margin-top:20px;padding-top:18px;border-top:1px solid var(--line)}
section.frame{border-top:none}
.row{display:flex;justify-content:space-between;align-items:baseline;font-size:12px;color:var(--dim)}
.row b{color:var(--text);font-size:15px;font-weight:650}
.meta{margin-top:6px;color:var(--dim);font-size:11px;min-height:15px}

.cong{font-size:23px;font-weight:650;letter-spacing:-.02em;line-height:1.1}
.years{color:var(--dim);font-size:12px;margin-bottom:10px}
#spark{width:100%;height:78px;display:block;cursor:ew-resize;touch-action:none}
.sparkkey{display:flex;gap:11px;flex-wrap:wrap;color:var(--dim);font-size:10.5px;margin:5px 0 9px}
.sparkkey i.sw{display:inline-block;width:9px;height:2px;vertical-align:middle;margin-right:4px}
.sw.within{background:#8A8F98}.sw.cross{background:var(--cross)}
.sparkkey .hint{margin-left:auto;opacity:.7}

input[type=range]{width:100%;-webkit-appearance:none;appearance:none;background:none;height:20px;cursor:pointer}
input[type=range]::-webkit-slider-runnable-track{height:3px;background:#293139;border-radius:2px}
input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:13px;height:13px;margin-top:-5px;
  border-radius:50%;background:var(--accent);border:none}
input[type=range]::-moz-range-track{height:3px;background:#293139;border-radius:2px}
input[type=range]::-moz-range-thumb{width:13px;height:13px;border-radius:50%;background:var(--accent);border:none}

.transport{display:flex;gap:6px;margin-top:6px}
button,select{font:inherit;color:var(--text);background:#1B2027;border:1px solid var(--line);
  border-radius:6px;padding:6px 9px;cursor:pointer;transition:background .14s,border-color .14s}
button:hover,select:hover{background:#232A32;border-color:#333C46}
button.primary{background:#1F2A2E;border-color:#2C4640;color:var(--accent);min-width:52px}
.transport select{margin-left:auto}
select{width:100%}
.controls{display:flex;gap:6px}
.controls button{flex:1}

.stat{text-align:left}
.statnum{font-size:40px;font-weight:650;letter-spacing:-.03em;line-height:1;color:#fff}
.statlab{color:var(--dim);font-size:11px;margin-top:5px;max-width:250px}
.statdelta{margin-top:7px;font-size:11px;color:var(--dim)}

.legend{display:flex;flex-direction:column;gap:5px}
.lg{display:flex;align-items:center;gap:8px;text-align:left;font-size:12px;padding:5px 8px}
.lg b{margin-left:auto;color:var(--dim);font-weight:400}
.lg[data-off="1"]{opacity:.38}
.dot{width:9px;height:9px;border-radius:50%;flex:none}
.dot.R{background:var(--R)}.dot.D{background:var(--D)}.dot.I{background:var(--I)}

#method{margin-top:20px;padding-top:16px;border-top:1px solid var(--line)}
#method summary{cursor:pointer;color:var(--dim);font-size:11.5px;list-style:none}
#method summary::-webkit-details-marker{display:none}
#method summary::before{content:"▸ ";}
#method[open] summary::before{content:"▾ ";}
#method div{color:var(--dim);font-size:11px;line-height:1.6;margin-top:9px}
#method p{margin:0 0 9px}
#method b{color:#A6B0BA;font-weight:600}

#tip{position:fixed;pointer-events:none;opacity:0;transition:opacity .12s;
  background:#0F1317f2;border:1px solid var(--line);border-radius:7px;padding:9px 11px;
  font-size:11.5px;line-height:1.55;max-width:250px;z-index:50}
#tip .nm{font-weight:650;font-size:12.5px;color:#fff}
#tip .pr{color:var(--dim);margin-bottom:6px}
#tip table{border-collapse:collapse;width:100%;font-size:11px}
#tip td{padding:1px 0}
#tip td:last-child{text-align:right;color:#fff}
#tip hr{border:none;border-top:1px solid var(--line);margin:5px 0}

#loading{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;
  color:var(--dim);background:var(--bg);z-index:20;transition:opacity .4s}
#loading.gone{opacity:0;pointer-events:none}
@media (max-width:820px){
  :root{--bar-h:56px}
  #topbar{padding:0 12px;gap:8px}
  .tb-title{min-width:0}
  #topbar h1{overflow:hidden;text-overflow:ellipsis}
  .tb-back{padding:7px 10px}
  .tb-back b{font-size:11px}
  #panel{width:100%;height:52%;top:auto;bottom:0;border-right:none;
    border-top:1px solid var(--line)}
  #topbar h1{font-size:14px}
  #topbar .sub{display:none}
  .tb-back i{display:none}
}

/* ---- senator card ---- */
#tip{max-width:none;width:282px;padding:0;overflow:hidden}
#tip .head{display:flex;gap:11px;padding:11px 12px 9px}
#tip .face{width:56px;height:68px;object-fit:cover;border-radius:5px;flex:none;
  background:#1B2027;border:1px solid var(--line);filter:saturate(.9)}
#tip .face.ph{display:flex;align-items:center;justify-content:center;
  font-size:17px;font-weight:650;color:#0B0D10;letter-spacing:-.02em}
#tip .face.ph.R{background:var(--R)}#tip .face.ph.D{background:var(--D)}#tip .face.ph.I{background:var(--I)}
#tip .who{min-width:0;padding-top:2px}
#tip .nm{font-weight:650;font-size:13px;color:#fff;line-height:1.25;margin-bottom:3px}
#tip .pr{color:var(--text);font-size:11px;display:flex;align-items:center;gap:5px;margin-bottom:2px}
#tip .sm{color:var(--dim);font-size:10.5px}
#tip .sm.brk{padding:0 12px 10px;line-height:1.45}
#tip .ten{padding:0 12px 10px;color:var(--text);font-size:11px}
#tip hr{border:none;border-top:1px solid var(--line);margin:0}
#tip .lab{padding:9px 12px 5px;color:var(--dim);font-size:10px;text-transform:uppercase;letter-spacing:.06em}
#tip table{width:auto;margin:0 12px 10px;border-collapse:collapse;font-size:11px}
#tip td{padding:1.5px 0}
#tip td:first-child{color:var(--dim);padding-right:9px;white-space:nowrap}
#tip td.bw{width:96px}
#tip td.bv{text-align:right;color:#fff;padding-left:8px;width:24px}
#tip .bar{display:block;height:5px;border-radius:3px}
#tip .bar.R{background:var(--R)}#tip .bar.D{background:var(--D)}#tip .bar.I{background:var(--I)}
#tip .nb{display:block;height:5px}
#tip .foot{display:flex;justify-content:space-between;gap:10px;
  padding:9px 12px 10px;color:var(--dim);font-size:10.5px}
#tip .foot b{color:#fff;font-weight:600}
.pct{font-size:.62em;font-weight:500;color:var(--dim);margin-left:1px;letter-spacing:0}
.statnum .pct{font-size:.32em;margin-left:5px}
#tip .bv{white-space:nowrap;width:34px}
.sparkkey i.sw{border-radius:1px}

/* ---- provenance ---- */
#prov h2{margin:0 0 10px;font-size:11px;font-weight:600;color:var(--dim);
  text-transform:uppercase;letter-spacing:.07em}
#prov dl{margin:0;font-size:11px;line-height:1.55}
#prov dt{color:#A6B0BA;font-weight:600;margin-top:9px}
#prov dt:first-child{margin-top:0}
#prov dd{margin:2px 0 0;color:var(--dim)}
#prov .u{color:var(--accent);font-size:10.5px}
#prov code{font-size:10.5px;color:#A6B0BA;background:#1B2027;padding:1px 4px;border-radius:3px}
#prov i{font-style:italic}

/* ---- floating view controls, over the visualization ---- */
/* align-items:stretch on a max-content column makes every button exactly as
   wide as the widest one, which is the colorblind toggle. */
#viewctl{position:fixed;right:20px;bottom:20px;z-index:25;
  display:flex;flex-direction:column;align-items:stretch;width:max-content;gap:7px}
#viewctl .vc-buttons{display:flex;flex-direction:column;align-items:stretch;gap:7px}
#viewctl .vc-dots{background:#14181Deb;backdrop-filter:blur(12px);
  border:1px solid var(--line);border-radius:8px;padding:7px 11px 3px}
#viewctl .vc-dots label + input + label{margin-top:5px}
#viewctl .vc-dots label{display:flex;justify-content:space-between;align-items:baseline;
  font-size:11px;color:var(--dim);cursor:pointer}
#viewctl .vc-dots label b{color:var(--text);font-weight:600;font-size:11.5px}
#viewctl .vc-dots input[type=range]{height:18px}
#viewctl .vc-dots input[type=range]::-webkit-slider-thumb{width:11px;height:11px;margin-top:-4px}
#viewctl .vc-dots input[type=range]::-moz-range-thumb{width:11px;height:11px}
#viewctl button{display:flex;align-items:center;gap:8px;padding:8px 12px;
  background:#14181Deb;backdrop-filter:blur(12px);border:1px solid var(--line);
  border-radius:8px;color:var(--dim);font-size:11.5px;text-align:left}
#viewctl button:hover{color:var(--text);border-color:#39434E;background:#1B2027f2}
#viewctl button svg{width:14px;height:14px;flex:none;opacity:.75}
#viewctl button.on{color:var(--accent);border-color:#2C4640;background:#16231Fee}
#viewctl button.on svg{opacity:1}
#viewctl .hint{margin:2px 4px 0;color:var(--dim);font-size:10px;opacity:.6}
#viewctl button .lbl-short{display:none}
/* Portrait phones: one row across the canvas, equal widths, shorter labels. */
@media (max-width:820px){
  #viewctl{bottom:calc(52% + 12px);right:12px;left:12px;width:auto;
    flex-direction:column;gap:8px}
  #viewctl .vc-buttons{flex-direction:row;gap:8px}
  #viewctl button{flex:1 1 0;min-width:0;justify-content:center;gap:6px;
    padding:9px 6px;font-size:11px;text-align:center}
  #viewctl .vc-dots{padding:6px 10px 2px}
  #viewctl button .lbl-full{display:none}
  #viewctl button .lbl-short{display:inline}
  #viewctl .hint{display:none}
}
#tip .ten .sub2{margin-top:3px;color:var(--dim);font-size:10.5px}

/* ---- colorblind-safe mode ---- */
/* inherits the #viewctl button styling; only the swatch needs rules */
#cvdToggle .sw{display:flex;gap:2px;align-items:center;flex:none}
#cvdToggle .sw i{width:6px;height:6px;display:block;background:var(--D)}
#cvdToggle .sw .s-r{background:var(--R)}
#cvdToggle .sw .s-i{background:var(--I)}
#cvdToggle .sw .s-d{border-radius:50%}


/* the toggle swatches and the legend both track the active palette */
body.cvd{--R:#FFB570; --D:#3F93E0; --I:#FFFFFF; --cross:#6E7480}
/* The vignette multiplies everything toward black toward the edges of the
   canvas, which is exactly the contrast a low-vision viewer cannot spare.
   Ease it off in this mode rather than changing the background. */
body.cvd #vignette{opacity:.42}
body.cvd .dot.R,body.cvd #cvdToggle .sw .s-r{border-radius:0}
body.cvd .dot.I{border-radius:0;background:transparent;width:0;height:0;
  border-left:5px solid transparent;border-right:5px solid transparent;
  border-bottom:9px solid var(--I)}
body.cvd #cvdToggle .sw .s-i{border-radius:0;background:transparent;width:0;height:0;
  border-left:4px solid transparent;border-right:4px solid transparent;
  border-bottom:7px solid var(--I)}
body.cvd #tip .face.ph.R{border-radius:2px}

/* ---- senator roster, top left of the visualization ---- */
/* Sits over the canvas, clear of the panel on wide layouts. */
#rosterctl{position:fixed;top:calc(var(--bar-h) + 18px);left:calc(322px + 20px);z-index:26}
#rosterBtn{display:flex;align-items:center;gap:8px;padding:8px 12px;
  background:#14181Deb;backdrop-filter:blur(12px);border:1px solid var(--line);
  border-radius:8px;color:var(--dim);font-size:11.5px}
#rosterBtn:hover{color:var(--text);border-color:#39434E;background:#1B2027f2}
#rosterBtn svg{width:14px;height:14px;flex:none;opacity:.75}
#rosterBtn.on{color:var(--accent);border-color:#2C4640;background:#16231Fee}
#rosterBtn.on svg{opacity:1}
#rosterBtn b{font-weight:650;font-size:10.5px;color:var(--bg);background:var(--accent);
  border-radius:9px;padding:1px 6px;line-height:1.5}
#rosterBtn b[hidden]{display:none}
#rosterctl.tour-spot{z-index:61}

#roster{position:absolute;top:calc(100% + 8px);left:0;width:288px;
  background:#14181Df5;backdrop-filter:blur(14px);border:1px solid var(--line);
  border-radius:10px;box-shadow:0 18px 44px #05070Aa8;overflow:hidden;
  animation:rosterIn .16s ease-out both}
#roster[hidden]{display:none}
@keyframes rosterIn{from{opacity:0;transform:translateY(-6px)}}
#roster .r-head{display:flex;align-items:center;gap:6px;padding:9px 9px 7px;
  border-bottom:1px solid var(--line)}
#roster input[type=search]{flex:1 1 auto;min-width:0;background:#0F1318;
  border:1px solid var(--line);border-radius:6px;color:var(--text);
  font:inherit;font-size:12px;padding:6px 9px;-webkit-appearance:none}
#roster input[type=search]:focus{outline:none;border-color:#2C4640}
#roster input[type=search]::placeholder{color:var(--dim)}
#roster .x{flex:none;background:transparent;border:none;color:var(--dim);
  font-size:17px;line-height:1;padding:3px 6px}
#roster .x:hover{color:var(--text)}
#roster .r-sub{display:flex;align-items:center;justify-content:space-between;gap:8px;
  padding:6px 12px;color:var(--dim);font-size:10.5px}
#roster .r-sub button{background:transparent;border:none;color:var(--accent);
  font-size:10.5px;padding:0}
#roster .r-sub button[hidden]{display:none}
#rosterList{max-height:min(46vh,340px);overflow:auto;padding:0 5px 5px}
#rosterList::-webkit-scrollbar{width:8px}
#rosterList::-webkit-scrollbar-thumb{background:#232A32;border-radius:4px}
#rosterList .r-row{display:flex;align-items:center;gap:8px;width:100%;
  background:transparent;border:none;border-radius:6px;padding:5px 7px;
  color:var(--text);font-size:12px;text-align:left}
#rosterList .r-row:hover{background:#1B2027}
#rosterList .r-row[aria-pressed=true]{background:#16231Fee;color:#fff}
#rosterList .r-row .nm{flex:1 1 auto;min-width:0;overflow:hidden;
  text-overflow:ellipsis;white-space:nowrap}
#rosterList .r-row .st{flex:none;color:var(--dim);font-size:10.5px}
#rosterList .r-row[aria-pressed=true] .st{color:var(--accent)}
#rosterList .r-group{padding:9px 8px 4px;color:var(--dim);font-size:9.5px;
  text-transform:uppercase;letter-spacing:.07em}
#rosterList .r-group:first-child{padding-top:6px}
#rosterList .none{padding:12px 9px;color:var(--dim);font-size:11.5px}
#roster .r-foot{margin:0;padding:8px 12px 10px;border-top:1px solid var(--line);
  color:var(--dim);font-size:10px;line-height:1.5}
@media (max-width:820px){
  #rosterctl{top:calc(var(--bar-h) + 10px);left:12px}
  #roster{width:min(288px,calc(100vw - 24px))}
  #rosterList{max-height:34vh}
}

/* ---- guided tour ---- */
#tourStart{display:flex;align-items:center;gap:8px;padding:7px 13px;border:1px solid var(--line);
  border-radius:7px;color:var(--dim);font-size:11.5px;background:transparent;margin-left:auto;margin-right:12px}
#tourStart:hover{color:var(--text);border-color:#39434E;background:#1B2027}
#tourStart svg{width:14px;height:14px;flex:none;opacity:.8}

#tour{position:fixed;inset:0;z-index:60;pointer-events:none}
/* The opening step dims the page so the card cannot be mistaken for chrome.
   From step 2 the scrim clears, because every later step asks you to look at
   something behind it. */
#tour .t-scrim{position:absolute;inset:0;background:#05070A9e;opacity:0;
  pointer-events:none;transition:opacity .4s ease}
#tour.intro .t-scrim{opacity:1;pointer-events:auto}
#tour .t-card{position:absolute;left:calc(322px + 34px);bottom:30px;width:392px;
  pointer-events:auto;background:#12161Bf7;backdrop-filter:blur(16px);
  border:1px solid #2B333D;border-radius:12px;padding:18px 19px 15px;
  box-shadow:0 18px 50px #000a;transition:border-color .4s ease,box-shadow .4s ease;
  animation:tourIn .42s cubic-bezier(.2,.9,.25,1.05) both}
/* the first card announces itself, later ones sit quietly beside the graph */
#tour.intro .t-card{left:50%;bottom:auto;top:50%;transform:translate(-50%,-50%);
  width:472px;border-color:#3C6D63;box-shadow:0 26px 70px #000c,0 0 0 1px #5FE3C022}
#tour.intro .t-card h2{font-size:20px}
@keyframes tourIn{from{opacity:0;transform:translateY(14px) scale(.985)}
  to{opacity:1;transform:translateY(0) scale(1)}}
#tour.intro .t-card{animation:tourInCentre .42s cubic-bezier(.2,.9,.25,1.05) both}
@keyframes tourInCentre{from{opacity:0;transform:translate(-50%,-46%) scale(.97)}
  to{opacity:1;transform:translate(-50%,-50%) scale(1)}}
#tour .t-step{font-size:10px;letter-spacing:.1em;text-transform:uppercase;color:var(--dim);
  font-variant-numeric:tabular-nums}
#tour h2{margin:7px 0 0;font-size:16.5px;font-weight:650;color:#fff;letter-spacing:-.015em;line-height:1.25}
#tour p{margin:8px 0 0;font-size:12.5px;line-height:1.6;color:var(--text)}
#tour .t-nav{display:flex;align-items:center;gap:8px;margin-top:15px}
#tour .t-right{margin-left:auto;display:flex;gap:8px}
#tour button{font-size:12px;padding:7px 14px}
#tour button.ghost{background:transparent;border-color:transparent;color:var(--dim)}
#tour button.ghost:hover{color:var(--text)}
#tour button.primary{background:#1F2A2E;border-color:#2C4640;color:var(--accent);font-weight:600}
#tour button[disabled]{opacity:.35;cursor:default}

/* the ring that points at whatever the current step is talking about */
.tour-spot{position:relative;z-index:61;
  outline:2px solid var(--accent);outline-offset:5px;border-radius:6px;
  animation:tourPulse 1.9s ease-in-out infinite}
@keyframes tourPulse{0%,100%{outline-color:#5FE3C0}50%{outline-color:#5FE3C055}}

@media (max-width:820px){
  #tourStart span{display:none}
  #tourStart{padding:7px 9px;margin-right:8px}
  /* Sit over the panel, not over the graph: the whole point of a step is to
     look at the thing it describes. */
  #tour .t-card{left:10px;right:10px;bottom:10px;top:auto;width:auto;padding:15px 15px 12px}
  #tour.intro .t-card{left:10px;right:10px;top:50%;bottom:auto;width:auto;
    transform:translateY(-50%);animation:tourInMobile .42s cubic-bezier(.2,.9,.25,1.05) both}
  #tour.intro .t-card h2{font-size:17px}
  @keyframes tourInMobile{from{opacity:0;transform:translateY(-46%) scale(.97)}
    to{opacity:1;transform:translateY(-50%) scale(1)}}
  #tour h2{font-size:15px}
  #tour p{font-size:12px}
}

/* ---- panel emphasis: the control outranks the reading ---- */
.stat .statrow{display:flex;align-items:center;gap:12px}
.stat .statnum{font-size:27px;line-height:1;flex:none}
.stat .statnum .pct{font-size:.42em;margin-left:3px}
.stat .statlab{margin-top:0;font-size:10.5px;line-height:1.35;max-width:none}
.stat .statdelta{margin-top:9px}

/* the slider is what people came to touch, so it carries the weight */
#threshSec .row.big{align-items:center}
#threshSec .row.big span{font-size:13px;color:var(--text)}
#threshSec .row.big b{font-size:30px;font-weight:650;letter-spacing:-.02em;line-height:1}
#threshSec .row.big b .pct{font-size:.45em}
#threshSec input[type=range]{height:26px}
#threshSec input[type=range]::-webkit-slider-runnable-track{height:4px}
#threshSec input[type=range]::-webkit-slider-thumb{width:17px;height:17px;margin-top:-6.5px}
#threshSec input[type=range]::-moz-range-track{height:4px}
#threshSec input[type=range]::-moz-range-thumb{width:17px;height:17px}

/* ---- year watermark, on the graph itself ---- */
/* Sits over the canvas so the year travels with the picture, including in a
   screenshot. Ticks continuously while playing rather than only at frames. */
#yearmark{position:fixed;top:calc(var(--bar-h) + 14px);right:26px;z-index:5;
  pointer-events:none;user-select:none;font-variant-numeric:tabular-nums;
  font-size:74px;font-weight:650;letter-spacing:-.03em;line-height:1;
  color:#fff;opacity:.085}
@media (max-width:820px){
  #yearmark{font-size:44px;top:calc(var(--bar-h) + 10px);right:14px;opacity:.11}
}

/* Portrait-phone advisory. The selector carries an element so it outranks
   "#tour p", which would otherwise reset the colour back to body text.
   Deliberately hue-free: this page already asks a lot of colour, so the
   callout earns attention through weight, border and a light ground rather
   than a hue that some readers cannot separate from the panel behind it. */
#tour p#tourRotate{display:flex;gap:9px;align-items:flex-start;
  margin-top:12px;padding:10px 12px;border-radius:8px;
  background:#ffffff14;border:1px solid #46505C;color:#E2E8EF;
  font-size:11.5px;line-height:1.5}
#tour p#tourRotate b{color:#fff;font-weight:650}
#tour p#tourRotate svg{width:16px;height:16px;flex:none;margin-top:1px;opacity:.85}
/* display:flex would otherwise beat the browser default for [hidden] */
#tour p#tourRotate[hidden]{display:none}

/* ======================================================================
   Mobile layout
   ----------------------------------------------------------------------
   Not the desktop layout made narrow. On a phone the graph is the page:
   it runs full bleed, a compact transport bar sits at the bottom because
   scrubbing is the one thing you do continuously, and everything else
   lives in a sheet that is closed until asked for. The desktop panel put
   several hundred words of provenance in front of someone holding a
   phone, which is what made it feel pages long.
   ====================================================================== */
body.mobile #vignette{opacity:.5}

/* --- bottom transport bar --- */
#mbar{display:none}
body.mobile #mbar{display:grid;position:fixed;left:0;right:0;bottom:0;z-index:28;
  grid-template-columns:1fr auto;grid-template-areas:"when controls" "slot slot";
  gap:6px 10px;padding:9px 12px calc(9px + env(safe-area-inset-bottom,0px));
  background:#0F1319f7;backdrop-filter:blur(14px);border-top:1px solid var(--line)}
body.mobile #mbar .mb-when{grid-area:when;display:flex;align-items:baseline;gap:8px;min-width:0}
body.mobile #mbar .mb-when b{font-size:15px;font-weight:650;letter-spacing:-.015em;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.mobile #mbar .mb-when i{font-style:normal;font-size:11.5px;color:var(--dim);flex:none}
body.mobile #mbar .mb-slot{grid-area:slot}
body.mobile #mbControls{grid-area:controls;padding:7px 13px;font-size:12px;
  background:#1B2027;border:1px solid var(--line);border-radius:7px;color:var(--text)}
body.mobile #mbControls.on{color:var(--accent);border-color:#2C4640;background:#16231F}

/* the frame section is relocated into the bar; it carries the scrubber */
body.mobile #mbar section.frame{margin:0;padding:0;border:none}
body.mobile #mbar .cong,body.mobile #mbar .years{display:none}
body.mobile #mbar #scrub{margin:0;height:30px}
body.mobile #mbar .transport{margin-top:4px;gap:8px}
body.mobile #mbar .transport button{flex:1;padding:9px 0;font-size:14px}
body.mobile #mbar .transport select{flex:1.2;margin-left:0;padding:9px 8px}

/* --- the sheet --- */
body.mobile #panel{position:fixed;left:0;right:0;bottom:0;top:auto;width:100%;height:auto;
  max-height:74vh;z-index:29;padding:0 16px 18px;border:none;border-top:1px solid var(--line);
  border-radius:14px 14px 0 0;box-shadow:0 -20px 50px #05070Ab0;
  opacity:0;visibility:hidden;pointer-events:none;
  transition:opacity .18s ease,visibility .18s;
  overscroll-behavior:contain}
body.mobile.sheet #panel{opacity:1;visibility:visible;pointer-events:auto}
body.mobile #sheetTabs{display:flex;gap:6px;position:sticky;top:0;z-index:2;
  padding:12px 0 10px;background:var(--surface)}
body.mobile #sheetTabs button{flex:1;padding:8px 4px;font-size:12px;background:#161B21;
  border:1px solid var(--line);border-radius:7px;color:var(--dim)}
body.mobile #sheetTabs button[aria-selected=true]{color:var(--accent);border-color:#2C4640;
  background:#16231F}
body.mobile #sheetTabs #sheetClose{flex:0 0 38px;font-size:17px;line-height:1}
#sheetTabs{display:none}

/* one tab visible at a time */
body.mobile #panel > section,body.mobile #panel > #method,body.mobile #panel > #viewctl{display:none}
body.mobile.tab-filter  #panel > #threshSec,
body.mobile.tab-filter  #panel > #topicSec,
body.mobile.tab-filter  #panel > #legendSec,
body.mobile.tab-view    #panel > #viewctl,
body.mobile.tab-about   #panel > #statSec,
body.mobile.tab-about   #panel > #prov,
body.mobile.tab-about   #panel > #method{display:block}
body.mobile #panel > section:first-of-type{border-top:none;margin-top:8px;padding-top:0}

/* the floating view controls become an ordinary block inside the sheet */
body.mobile #viewctl{position:static;flex-direction:column;width:auto;gap:10px;
  margin-top:8px;padding-top:0}
body.mobile #viewctl .vc-buttons{flex-direction:column;gap:8px}
body.mobile #viewctl button{flex:none;justify-content:flex-start;text-align:left;
  padding:11px 13px;font-size:12.5px}
body.mobile #viewctl button .lbl-short{display:none}
body.mobile #viewctl button .lbl-full{display:inline}
body.mobile #viewctl .hint{display:none}
body.mobile #viewctl .vc-dots{background:transparent;border:none;padding:0}

/* --- chrome trimmed to what a phone can hold --- */
body.mobile #yearmark{top:calc(var(--bar-h) + 6px);right:12px;font-size:40px;opacity:.12}
body.mobile #rosterctl{top:calc(var(--bar-h) + 8px);left:10px}
body.mobile #roster{width:min(300px,calc(100vw - 20px));max-height:none}
body.mobile #rosterList{max-height:40vh}
body.mobile #tip{width:min(282px,calc(100vw - 20px))}
/* Clear the transport bar. Scoped away from the intro step, which is centred
   with a translate: setting `top` as well put it half its own height off the
   top of the screen. */
body.mobile #tour:not(.intro) .t-card{top:auto;bottom:calc(var(--mbar-h,116px) + 10px)}
body.mobile #roster{max-height:calc(100vh - var(--mbar-h,116px) - var(--bar-h) - 40px)}
