/* ============================================================
   tgwatson.com/dashboard - "Housing desk"
   Option 5, "Land and topo": a survey sheet for someone who
   develops dirt. Limestone paper, forest-and-soil ink, a single
   forest "today" band with index contours behind the headline,
   map-legend keys and chips. Water blue is up, survey brick is
   down, heather plum is reserved for anything you can grab.
   ============================================================ */

:root {
  /* limestone day */
  --sheet:   #f4f0e6;   /* limestone */
  --sheet-2: #e8e1d0;   /* sand: hover / inset */
  --panel:   #fbf9f3;   /* the board's plate */
  --ink:     #1c2118;   /* forest-black        14.4:1 on sheet */
  --ink-2:   #3f4136;   /* secondary text       9.1:1 */
  --ink-3:   #595749;   /* muted text           6.4:1 (5.6 on sand) */
  --rule:    rgba(28, 33, 24, 0.16);
  --rule-2:  rgba(28, 33, 24, 0.45);
  --grid:    rgba(28, 33, 24, 0.06);
  --up:      #1b5ea8;   /* water blue           5.7:1 */
  --down:    #b0360f;   /* survey brick         5.5:1 */
  --mid:     #e3ded2;   /* diverging neutral: dry sand */
  /* board ramp: OKLCH lightness per step away from --mid (1..5), chroma boost, chroma easing */
  --ramp-l:  0.83 0.745 0.66 0.535 0.455;
  --ramp-c:  1.1;
  --ramp-e:  0.75;
  --ramp-h:  28;
  --flag:    #8a2a72;   /* heather plum: controls, focus, what-if  7.0:1 */
  --flag-bg: rgba(138, 42, 114, 0.10);
  --ochre:   #7a5912;   /* contour brown: comparison series + annotations  5.8:1 */
  --forest:  #1d3327;   /* the today band */
  --band-2:  #274232;   /* band hover */
  --band-edge: transparent;
  --contour: rgba(245, 240, 227, 0.22);
  --contour-ink: rgba(28, 33, 24, 0.22);
  --shadow:  0 1px 2px rgba(28, 33, 24, .12), 0 20px 50px rgba(28, 33, 24, .20);

  --sans:  "Archivo", "Helvetica Neue", Arial, sans-serif;
  --semi:  "Archivo", "Helvetica Neue", Arial, sans-serif;
  --cond:  "Archivo Narrow", "Archivo", "Arial Narrow", sans-serif;
  --serif: "Archivo", "Helvetica Neue", Arial, sans-serif;

  /* type scale: 12 / 14 / 16 / 20 / 28 / 44 / hero */
  --t-xs: .75rem; --t-s: .875rem; --t-m: 1rem; --t-l: 1.25rem; --t-xl: 1.75rem; --t-2xl: 2.75rem;

  --pad: clamp(1rem, 3vw, 2.25rem);
  color-scheme: light;
}

[data-theme="study"] {
  /* forest night */
  --sheet:   #0d110e;   /* darker soil so the band lifts off it */
  --sheet-2: #182019;
  --panel:   #111612;
  --ink:     #efeadb;   /* 15.8:1 */
  --ink-2:   #cbc6b4;   /* 11.1:1 */
  --ink-3:   #a8a391;   /*  7.5:1 (6.6 on hover) */
  --rule:    rgba(239, 234, 219, 0.15);
  --rule-2:  rgba(239, 234, 219, 0.42);
  --grid:    rgba(239, 234, 219, 0.05);
  --up:      #4894df;   /* 6.0:1 (5.2 on hover) */
  --down:    #df6c3b;   /* 5.8:1 (5.0 on hover) */
  --mid:     #30332d;
  --ramp-l:  0.40 0.46 0.515 0.63 0.71;
  --ramp-c:  1.3;
  --ramp-e:  0.6;
  --ramp-h:  12;
  --flag:    #e695d3;   /* 8.1:1 */
  --flag-bg: rgba(230, 149, 211, 0.14);
  --ochre:   #d2a44c;
  --forest:  #21402f;
  --band-2:  #2b4a39;
  --band-edge: rgba(245, 240, 227, 0.28);
  --contour: rgba(245, 240, 227, 0.2);
  --contour-ink: rgba(239, 234, 219, 0.18);
  --shadow:  0 1px 2px rgba(0, 0, 0, .5), 0 20px 50px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

/* the forest band keeps its own inks in both themes (all >= 5.4:1 on #1d3327 / #274232) */
.tband, .dr-bar, .tip {
  --sheet:   var(--forest);
  --sheet-2: var(--band-2);
  --ochre:   #e2b65e;   /*  7.1:1 light band, 6.0 dark band */
  --ink:     #f5f0e3;   /* 11.9:1 */
  --ink-2:   #d3d4c2;   /*  9.0:1 */
  --ink-3:   #b3b8a3;   /*  6.6:1 (dark band 5.6, 4.8 on hover) */
  --rule:    rgba(245, 240, 227, 0.16);
  --rule-2:  rgba(245, 240, 227, 0.42);
  --up:      #8cc0f5;   /*  7.1:1 */
  --down:    #ffa27a;   /*  6.9:1 */
  --flag:    #f0a6dc;   /*  7.2:1 */
  --flag-bg: rgba(240, 166, 220, 0.14);
  color: var(--ink);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--sheet);
  font-variant-numeric: tabular-nums lining-nums;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  padding: 0 var(--pad) var(--pad);
  max-width: 1480px;
  margin: 0 auto;
  overflow-x: hidden;
}

::selection { background: var(--flag-bg); }

a { color: inherit; text-decoration-color: var(--rule-2); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--flag); }

:focus-visible { outline: 2.5px solid var(--flag); outline-offset: 2px; border-radius: 2px; }

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

kbd {
  font-family: var(--cond);
  font-size: .75em;
  padding: 0 .35em;
  border: 1px solid var(--rule-2);
  border-radius: 2px;
  color: var(--ink-2);
}

.sr-only, .skip:not(:focus) {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip:focus { position: fixed; top: 1rem; left: 1rem; z-index: 99; background: var(--sheet); padding: .5rem 1rem; }

/* ---------------- header: name + map cartouche ---------------- */

.head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem 2rem;
  align-items: center;
  padding: .9rem 0 .8rem;
}

.head h1 {
  font-family: var(--sans);
  font-weight: 800;
  font-stretch: 112%;
  font-size: var(--t-xl);
  line-height: 1;
  letter-spacing: -0.015em;
  display: flex; align-items: center; gap: .55rem;
}
/* benchmark glyph: a survey triangle */
.head h1::before {
  content: ""; width: .8em; height: .7em; background: var(--ink);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.head-sub { color: var(--ink-2); margin-top: .3rem; font-size: var(--t-s); }

.titleblock {
  display: grid;
  grid-template-columns: repeat(3, minmax(7.5rem, auto)) auto;
  border: 1.5px solid var(--ink);
  font-family: var(--semi);
  background: var(--panel);
}
.tb-cell {
  padding: .3rem .75rem .4rem;
  border-left: 1px solid var(--rule-2);
  min-width: 0;
}
.tb-cell:first-child { border-left: 0; }
.tb-cell dt { font-size: .68rem; font-weight: 700; color: var(--ink-3); letter-spacing: .09em; text-transform: uppercase; }
.tb-cell dd { font-size: var(--t-s); font-weight: 600; white-space: nowrap; }
.tb-market dd::before {
  content: ""; display: inline-block; width: .55rem; height: .55rem; margin-right: .4rem;
  background: var(--ink-3); vertical-align: .02em;
}
.tb-market.is-open dd::before { background: var(--up); box-shadow: 0 0 0 3px color-mix(in srgb, var(--up) 22%, transparent); }
.tb-actions { display: flex; align-items: center; gap: .15rem; padding: .25rem .4rem; }
.tb-btn {
  font-family: var(--semi); font-size: var(--t-s); font-weight: 600;
  padding: .3rem .55rem; border-radius: 2px; color: var(--ink-2);
}
.tb-btn:hover { background: var(--sheet-2); color: var(--flag); }

/* ---------------- section nav ---------------- */

.jump {
  position: sticky; top: 0; z-index: 30;
  display: flex; gap: .1rem; overflow-x: auto; scrollbar-width: none;
  margin: 0 calc(var(--pad) * -1); padding: .35rem var(--pad);
  background: color-mix(in srgb, var(--sheet) 94%, transparent);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border-top: 1.5px solid var(--ink);
  border-bottom: 1px solid var(--rule-2);
  font-family: var(--semi); font-size: var(--t-s); font-weight: 600;
}
.jump::-webkit-scrollbar { display: none; }
.jump a { text-decoration: none; color: var(--ink-2); padding: .3rem .65rem; white-space: nowrap; }
.jump a:hover { background: var(--sheet-2); color: var(--ink); }
.jump a.is-here { color: var(--ink); box-shadow: inset 0 -3px 0 var(--flag); }
section.sheet { scroll-margin-top: 3rem; }

/* ---------------- sheets: open sections, heavy rule, indexed like plan sheets ---------------- */

main { display: grid; gap: 3.25rem; counter-reset: sheet; }

.sheet { min-width: 0; position: relative; counter-increment: sheet; }

.sheet-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: .5rem 1.5rem; margin-bottom: .5rem;
  border-top: 3px solid var(--ink); padding-top: .65rem;
}
.sheet h2 {
  font-family: var(--sans); font-weight: 800; font-stretch: 108%;
  font-size: var(--t-xl); line-height: 1.1; letter-spacing: -0.01em;
}
.sheet-head h2::before {
  content: counter(sheet, decimal-leading-zero);
  display: inline-block; font-family: var(--cond); font-weight: 700; font-size: var(--t-xs); font-stretch: normal;
  letter-spacing: .04em; line-height: 1.3; padding: 0 .3rem; margin-right: .6rem; vertical-align: .5em;
  border: 1.5px solid var(--ink);
}
.sheet h3 {
  font-family: var(--semi); font-weight: 700; font-size: var(--t-m); margin: 0 0 .35rem;
}
.sheet-note { color: var(--ink-2); font-size: var(--t-s); max-width: 72ch; margin-bottom: .9rem; }
.sheet-head .sheet-note { margin-bottom: 0; flex: 1 1 24rem; }

figure { margin: 0; }
figcaption { font-size: var(--t-s); color: var(--ink-2); margin: .2rem 0 .35rem; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 3rem; }
.grid-2--wide { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }

/* segmented control, drawn like a legend key strip */
.seg { display: inline-flex; flex-wrap: wrap; border: 1.5px solid var(--ink); background: var(--panel); }
.seg button {
  font-family: var(--semi); font-size: var(--t-s); font-weight: 600; padding: .26rem .7rem;
  color: var(--ink-2); border-left: 1px solid var(--rule-2);
}
.seg button:first-child { border-left: 0; }
.seg button:hover { background: var(--sheet-2); color: var(--flag); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--sheet); }
.tband .seg { background: transparent; }

/* ---------------- today: the forest band ---------------- */

.today { counter-increment: none; }

.tband {
  position: relative; isolation: isolate;
  background: var(--forest);
  margin: 0 calc(var(--pad) * -1);
  padding: 1.1rem var(--pad) 2.4rem;
  /* full-bleed on screens wider than the page */
  box-shadow: 0 0 0 100vmax var(--forest);
  clip-path: inset(0 -100vmax);
  border-top: 1px solid var(--band-edge); border-bottom: 1px solid var(--band-edge);
}
/* index contours: a strip along the band's lower edge, below the tiles, never behind data */
.tband::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  left: 0; right: 0; bottom: .5rem; height: 28px;
  background: var(--contour);
  -webkit-mask: url(topo-strip.svg) left center / 1600px 28px repeat-x;
  mask: url(topo-strip.svg) left center / 1600px 28px repeat-x;
}
.band-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1rem; }
.band-top h2 {
  font-family: var(--sans); font-weight: 800; font-size: var(--t-xs); letter-spacing: .14em; text-transform: uppercase;
  color: var(--forest); background: var(--ink); padding: .12rem .45rem;
}
.band-top .sheet-note { color: var(--ink-2); font-size: var(--t-s); font-weight: 600; margin: 0; }

.band-main {
  display: grid; grid-template-columns: minmax(19rem, .78fr) minmax(0, 1.6fr); gap: 1rem 3rem; align-items: start;
  margin: .9rem 0 1.2rem;
}
.band-head { display: flex; flex-direction: column; gap: 1.25rem; }
.bh { display: grid; justify-items: start; text-align: left; gap: .1rem; border-radius: 2px; padding: .15rem .2rem; margin: -.15rem -.2rem; }
.bh:hover .bh-k { color: var(--flag); }
.bh-k { font-size: var(--t-xs); font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-2); }
.bh-v {
  font-family: var(--sans); font-weight: 800; font-stretch: 105%;
  font-size: clamp(3rem, 5.6vw, 5.25rem); line-height: .95; letter-spacing: -0.03em;
  display: inline-flex; align-items: center; gap: .12em; white-space: nowrap;
}
.bh:not(.bh--main) .bh-v { font-size: clamp(2.2rem, 3.6vw, 3.4rem); }
.bh-g { font-size: .38em; letter-spacing: 0; }
.bh-s { font-size: var(--t-s); font-weight: 600; color: var(--ink-2); display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .45rem; margin-top: .3rem; }
.bh-s i { width: 1px; height: .9em; background: var(--rule-2); align-self: center; }
.bh-s .dir { font-size: .8em; }
/* builders vs S&P, as a map scale bar: alternating half-point segments */
.bh-gap { display: flex; align-items: center; gap: .6rem; margin-top: .45rem; font-size: var(--t-xs); font-weight: 600; color: var(--ink-2); }
.bh-gap b { color: var(--ink); font-weight: 700; }
.gap-bar {
  height: 7px; flex: none; border: 1.5px solid var(--ink); box-sizing: content-box;
  background: repeating-linear-gradient(90deg, var(--ink) 0 20px, transparent 20px 40px);
}
.gap-bar.is-capped { border-right-style: dashed; }

.lede {
  font-family: var(--sans);
  font-size: var(--t-m);
  line-height: 1.6;
  max-width: 60ch;
  color: var(--ink-2);
  min-height: 3em;
  border-left: 3px solid var(--ink); padding-left: 1rem;
}
.read h3 { font-family: var(--sans); font-weight: 800; font-size: var(--t-xs); letter-spacing: .12em; text-transform: uppercase; margin: 0 0 .6rem; }
.lede b { font-weight: 700; color: var(--ink); }

.tiles { display: grid; gap: .75rem; }
.tile-group { display: grid; grid-template-columns: 7.4rem minmax(0, 1fr); align-items: stretch; gap: .8rem; }
/* group labels read like legend headings, with a key box */
.tile-gh {
  font-family: var(--sans); font-size: var(--t-xs); font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink); padding-top: .55rem; margin: 0; border-top: 2px solid var(--ink);
  display: flex; align-items: baseline; gap: .45rem;
}
.tile-gh::before { content: ""; width: .6rem; height: .6rem; border: 1.5px solid var(--ink); flex: none; }
.tile-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.4rem, 1fr)); border-top: 2px solid var(--ink); }
.tile {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "k k" "v d" "s s";
  align-items: baseline; gap: 0 .5rem; text-align: left;
  padding: .5rem .7rem .4rem; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  transition: background .15s;
}
.tile:hover { background: var(--sheet-2); }
.tile:hover .tile-k { color: var(--flag); }
.tile-k { grid-area: k; font-family: var(--semi); font-size: var(--t-xs); font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-v { grid-area: v; font-family: var(--cond); font-weight: 700; font-size: 1.6rem; line-height: 1.1; white-space: nowrap; }
.tile-d { grid-area: d; font-family: var(--cond); font-weight: 600; font-size: var(--t-s); white-space: nowrap; justify-self: end; }
.tile-spark { grid-area: s; width: 100%; height: 30px; display: block; margin-top: .2rem; }
.flash { animation: flash 1.1s ease-out; }
@keyframes flash { 0% { background: var(--flag-bg); } 100% { background: transparent; } }

.today-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 1.4rem 4rem; margin-top: 1.8rem; align-items: start; }
.session { min-width: 0; }
.session figcaption { font-weight: 600; color: var(--ink-2); font-size: var(--t-s); margin: 0 0 .2rem; }
.chart.chart--session { height: 196px; }
.chart.chart--session10 { height: 80px; margin-top: .2rem; }
.tband .axis text { fill: var(--ink-3); }
.tband .s-ink { stroke: var(--ink); stroke-width: 2.5; }
.tband .s-ink2 { stroke: var(--ink-2); stroke-width: 1.75; }
.tband .s-ink3 { stroke: var(--ink-3); stroke-width: 1.75; }
.s-flag { stroke: var(--ochre); }
.sub-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .4rem 1rem; margin-bottom: .5rem; }
.sub-head h3 { font-family: var(--semi); font-weight: 700; font-size: var(--t-m); margin: 0; }
.seg--sm button { font-size: var(--t-xs); padding: .18rem .55rem; }

.movers { position: relative; padding-top: 1.35rem; }
.mv-refs { position: absolute; top: 0; left: 3.4rem; right: 3.9rem; height: 1.2rem; pointer-events: none; }
.mv-refs span { position: absolute; transform: translateX(-50%); font-family: var(--cond); font-weight: 600; font-size: var(--t-xs); color: var(--ink-2); white-space: nowrap; }
.mv {
  display: grid; grid-template-columns: 3.4rem minmax(0, 1fr) 3.9rem; align-items: center; width: 100%;
  height: 19px; font-family: var(--cond); font-size: var(--t-s); text-align: left;
}
.mv:hover { background: var(--sheet-2); }
.mv:hover .mv-sym { color: var(--flag); }
.mv-sym { font-weight: 700; padding-left: .2rem; }
.mv-track { position: relative; height: 100%; }
.mv-track::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--ink); }
.mv-bar { position: absolute; top: 3px; bottom: 3px; border-radius: 1px; }
.mv-ref { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px dashed var(--ink-3); }
.mv-v { text-align: right; padding-right: .2rem; font-weight: 600; }
.up-bg { background: var(--up); }
.down-bg { background: var(--down); }

.up { color: var(--up); }
.down { color: var(--down); }
.dir { font-weight: 700; }

/* ---------------- board (plat): the one boxed plate ---------------- */

.board {
  background: var(--panel);
  border: 1.5px solid var(--ink);
  padding: 1rem 1.25rem 1.25rem;
}
.board .sheet-head { border-top: 0; padding-top: 0; }
.head-ctrls { display: flex; flex-wrap: wrap; gap: .5rem; }
.head-ctrls .seg[hidden] { display: none; }
.plat { position: relative; height: clamp(380px, 40vw, 560px); }
.plat[hidden], .legend[hidden], .table-wrap[hidden] { display: none; }
.plat svg { display: block; width: 100%; height: 100%; overflow: visible; }
.lot rect { stroke: var(--panel); stroke-width: 2; }
.lot { cursor: pointer; outline: none; }
.lot:hover rect.lot-edge, .lot:focus-visible rect.lot-edge { stroke: var(--flag); stroke-width: 3; }
.lot text { pointer-events: none; }
.lot-sym { font-family: var(--sans); font-weight: 800; }
.lot-val { font-family: var(--cond); font-weight: 600; }
.lot-name { font-family: var(--sans); }
.block-edge { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.block-label { font-family: var(--sans); font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; fill: var(--ink); }
.block-sub { font-family: var(--sans); font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; fill: var(--ink-2); }
.street { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 10 6; }

/* map legend box */
.legend {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.4rem; margin-top: .8rem;
  padding: .45rem .8rem; border: 1.5px solid var(--ink); background: var(--sheet);
  font-family: var(--semi); font-size: var(--t-xs); font-weight: 600; color: var(--ink-2);
}
.legend::before {
  content: "Legend"; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ink);
  padding-right: 1rem; border-right: 1px solid var(--rule-2);
}
.ramp { display: inline-flex; align-items: center; gap: .45rem; font-family: var(--cond); font-size: var(--t-s); color: var(--ink); }
.ramp-bar { display: inline-grid; grid-auto-flow: column; gap: 0; border: 1px solid var(--ink); }
.ramp-bar i { display: block; width: 18px; height: 12px; }

/* ---------------- rates ---------------- */

.rates-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(15rem, .8fr); gap: 1.2rem 2.5rem; align-items: start; }
.rates-grid .facts { margin-top: .2rem; }
.openable { cursor: pointer; border-radius: 2px; }
.openable figcaption { font-weight: 600; color: var(--ink); }
.open-cue { font-family: var(--semi); font-size: var(--t-xs); font-weight: 700; color: var(--flag); margin-left: .4rem; opacity: 0; transition: opacity .15s; }
.openable:hover .open-cue, .mini:hover .open-cue, .openable:focus-visible .open-cue, .mini:focus-visible .open-cue { opacity: 1; }
[data-open] { cursor: pointer; }
.facts--open div[data-open]:hover dt, .facts div[data-open]:hover dt { color: var(--flag); }
.facts div[data-open] dt::after { content: " \203A"; color: var(--ink-3); }

/* ---------------- rates to dirt ---------------- */

.hero { padding-bottom: .2rem; }
.expander {
  font-family: var(--semi); font-size: var(--t-s); font-weight: 700; padding: .3rem .8rem;
  border: 1.5px solid var(--flag); color: var(--flag); border-radius: 2px;
}
.expander::after { content: " \25BE"; }
.expander[aria-expanded="true"]::after { content: " \25B4"; }
.expander:hover { background: var(--flag-bg); }
.hero-body[hidden] { display: none; }
.link.is-open { cursor: pointer; }
.link.is-open:hover .link-k { color: var(--flag); }

.chain {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: .6rem 0 1.4rem;
  border-top: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
}
.link {
  position: relative;
  padding: .8rem 1.4rem .9rem 1rem;
  border-left: 1px solid var(--rule);
  min-width: 0;
}
.link:first-child { border-left: 0; padding-left: 0; }
.link:not(:last-child)::after {
  content: "";
  position: absolute; right: -7px; top: 50%;
  width: 12px; height: 12px;
  border-top: 2px solid var(--ink); border-right: 2px solid var(--ink);
  background: var(--sheet);
  transform: translateY(-50%) rotate(45deg);
  z-index: 1;
}
.link-k { font-family: var(--semi); font-size: var(--t-xs); font-weight: 600; color: var(--ink-2); line-height: 1.3; min-height: 2.1em; }
.link-v {
  font-family: var(--cond); font-weight: 700;
  font-size: clamp(1.7rem, 2.6vw, 2.4rem); line-height: 1.05; margin: .15rem 0 .2rem;
  white-space: nowrap;
}
.link-d { font-family: var(--semi); font-size: var(--t-xs); color: var(--ink-2); line-height: 1.35; }
.link.is-whatif .link-v { color: var(--flag); }
.link.is-range .link-v { font-size: clamp(1.35rem, 1.9vw, 1.85rem); padding-top: .2em; }
.link.is-pulse { animation: pulse 900ms ease-out both; }
@keyframes pulse {
  0%   { background: transparent; }
  30%  { background: var(--flag-bg); }
  100% { background: transparent; }
}

.hero-body { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(16rem, 1fr); gap: 1.5rem 2.25rem; }

.compare { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; margin-bottom: .5rem; }
.compare-label { font-family: var(--semi); font-size: var(--t-s); color: var(--ink-2); }

.curve-wrap { position: relative; height: 290px; touch-action: none; }

.rate-control {
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: .9rem;
  margin-top: .4rem; font-family: var(--semi); font-size: var(--t-s); font-weight: 600;
}
.rate-control output { font-family: var(--cond); font-weight: 700; font-size: var(--t-l); min-width: 4.2ch; color: var(--flag); }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 26px; background: transparent; }
input[type="range"]::-webkit-slider-runnable-track { height: 2px; background: var(--ink); }
input[type="range"]::-moz-range-track { height: 2px; background: var(--ink); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; margin-top: -8px; border-radius: 50%;
  background: var(--flag); border: 3px solid var(--sheet); box-shadow: 0 0 0 1px var(--flag);
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%; background: var(--flag);
  border: 3px solid var(--sheet); box-shadow: 0 0 0 1px var(--flag);
}
.linkish { font-family: var(--semi); font-size: var(--t-s); color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 3px; }
.linkish:hover { color: var(--flag); text-decoration-color: var(--flag); }
.linkish[hidden] { display: none; }

.terms { border-left: 1px solid var(--rule-2); padding-left: 1.6rem; }
.terms h3 + .blanks { margin-top: 0; }
.terms h3:not(:first-child) { margin-top: 1.3rem; }
.blanks { font-size: var(--t-m); line-height: 2.1; }
.blank { white-space: nowrap; font-family: var(--semi); font-weight: 700; }
.blank input {
  font: inherit; color: var(--flag); background: transparent;
  border: 0; border-bottom: 1.5px solid var(--ink);
  padding: 0 .15rem; text-align: center; width: auto;
}
.blank input:focus { outline: none; background: var(--flag-bg); border-bottom-color: var(--flag); }
.terms-note { font-size: var(--t-xs); color: var(--ink-3); line-height: 1.45; margin-top: .35rem; }
.buydown { font-family: var(--cond); font-weight: 700; font-size: var(--t-xl); line-height: 1.1; }
.buydown small { display: block; font-family: var(--semi); font-weight: 500; font-size: var(--t-s); color: var(--ink-2); margin-top: .2rem; }

/* ---------------- charts ---------------- */

.chart { position: relative; height: 200px; }
.chart svg, .curve-wrap svg, .mini svg { display: block; width: 100%; height: 100%; overflow: visible; }
.axis text { font-family: var(--cond); font-size: 11.5px; font-weight: 500; fill: var(--ink-3); }
.axis line, .gridline { stroke: var(--rule); stroke-width: 1; }
.baseline { stroke: var(--ink-3); }
.series { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.s-ink { stroke: var(--ink); stroke-width: 2.25; }
.s-ink2 { stroke: var(--ink-3); }
.s-ink3 { stroke: var(--ink-3); stroke-dasharray: 4 4; }
svg .band { fill: var(--ink); opacity: .08; }
.dlabel { font-family: var(--cond); font-size: 12.5px; font-weight: 700; fill: var(--ink); }
.dlabel.soft { fill: var(--ink-2); font-weight: 600; }
.xhair { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 2 3; }
.dot { stroke: var(--sheet); stroke-width: 2; }
.area { fill: var(--ink); opacity: .06; }
.hline { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; }
.hline.zero { stroke: var(--ink-3); stroke-dasharray: none; }
.hline.ref { stroke: var(--flag); opacity: .8; }
.hline-label { font-family: var(--cond); font-size: 11px; fill: var(--ink-3); }
.hit { fill: transparent; cursor: crosshair; }

.curve-afford { fill: none; stroke: var(--ink); stroke-width: 2.25; }
.curve-gap { fill: var(--down); opacity: .12; }
.curve-gain { fill: var(--up); opacity: .12; }
.pin-line { stroke: var(--ink-3); stroke-dasharray: 2 3; }
.pin-label { font-family: var(--cond); font-size: 11.5px; fill: var(--ink-2); }
.handle { fill: var(--flag); stroke: var(--sheet); stroke-width: 3; cursor: grab; }
.handle-ring { fill: none; stroke: var(--flag); stroke-width: 1; }
.handle-label { font-family: var(--cond); font-weight: 700; font-size: 12.5px; fill: var(--flag); }

.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .1rem 1.25rem; margin-top: .8rem; }
.facts div { border-top: 1px solid var(--rule-2); padding: .45rem 0 .35rem; }
.facts dt { font-family: var(--semi); font-size: var(--t-xs); font-weight: 600; color: var(--ink-2); }
.facts dd { font-family: var(--cond); font-weight: 700; font-size: var(--t-l); }
.facts dd small { font-family: var(--semi); font-weight: 500; font-size: var(--t-xs); color: var(--ink-2); margin-left: .25rem; }

/* ---------------- small multiples ---------------- */

.multiples { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.6rem 1.8rem; }
.mini { min-width: 0; padding: .45rem .5rem .25rem; margin: -.45rem -.5rem -.25rem; border-radius: 2px; transition: background .15s; border-top: 1px solid transparent; }
.mini[data-open]:hover { background: var(--sheet-2); }
.mini-d small { color: var(--ink-3); margin-left: .35rem; }
.mini-k { font-family: var(--semi); font-size: var(--t-s); font-weight: 600; color: var(--ink-2); }
.mini-v { font-family: var(--cond); font-weight: 700; font-size: var(--t-xl); line-height: 1.1; }
.mini-d { font-family: var(--semi); font-size: var(--t-xs); color: var(--ink-2); }
.mini-chart { position: relative; height: 92px; margin-top: .3rem; }
/* build costs: 13 multiples; the first three (traded, live) span two columns so rows fill in 4-up and 2-up */
#cost-multiples .mini:nth-child(-n+3) { grid-column: span 2; }
.mini-flag { font-family: var(--semi); font-size: var(--t-xs); color: var(--ochre); font-weight: 700; margin-left: .35rem; }

/* ---------------- tables ---------------- */

.table-wrap { overflow-x: auto; margin: 0 -.25rem; }
.mkt { width: 100%; border-collapse: collapse; font-family: var(--semi); font-size: var(--t-s); }
.mkt th {
  font-weight: 700; font-size: .7rem; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); text-align: right;
  padding: .4rem .5rem; border-bottom: 2px solid var(--ink); white-space: nowrap;
  cursor: pointer; user-select: none;
}
.mkt th:hover { color: var(--flag); }
.mkt th.nosort { cursor: default; }
.mkt th.nosort:hover { color: var(--ink-2); }
.mkt th[aria-sort="ascending"]::after { content: " \25B2"; font-size: .8em; }
.mkt th[aria-sort="descending"]::after { content: " \25BC"; font-size: .8em; }
.mkt td { text-align: right; padding: .4rem .5rem; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.mkt .l { text-align: left; }
.mkt td.name { font-weight: 700; }
.mkt td.name small { font-weight: 500; color: var(--ink-3); margin-left: .3rem; }
.mkt td.yoy { color: var(--ink-2); }
.mkt td.yoy i {
  display: inline-block; height: 8px; vertical-align: .05em; margin-right: .4rem; border-radius: 1px;
}
.mkt tr:hover td { background: var(--sheet-2); }
.mkt .spark { width: 140px; height: 26px; display: block; }
.mkt tr[data-open] { cursor: pointer; }
.mkt tr[data-open]:hover td.name { color: var(--flag); }
.mkt td.up { color: var(--up); } .mkt td.down { color: var(--down); }
.lb td.name small { display: block; margin-left: 0; font-size: var(--t-xs); }
.lb .spark { width: 110px; height: 24px; }
.permits-h { margin-top: 1.6rem; }
.permits-h small { font-weight: 500; color: var(--ink-3); font-size: var(--t-xs); margin-left: .3rem; }
.permits { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .1rem 1rem; }
.permit { display: grid; text-align: left; padding: .45rem .3rem; border-top: 1.5px solid var(--ink); font-family: var(--semi); }
.permit:hover { background: var(--sheet-2); }
.permit:hover .permit-k { color: var(--flag); }
.permit-k { font-size: var(--t-xs); font-weight: 600; color: var(--ink-2); }
.permit-v { font-family: var(--cond); font-weight: 700; font-size: var(--t-l); }
.permit-v small { font-family: var(--semi); font-weight: 500; font-size: .7rem; color: var(--ink-3); margin-left: .25rem; }
.permit-d { font-size: var(--t-xs); }
.permit-spark { width: 100%; height: 30px; margin-top: .2rem; }
.mkt tr.flagged td.name::before { content: "\25C6"; color: var(--ochre); font-size: .7em; margin-right: .35rem; vertical-align: .1em; }

/* ---------------- calendar ---------------- */

#timeline { position: relative; height: 150px; margin: .3rem 0 .8rem; }
.tl-axis { stroke: var(--ink); stroke-width: 2; }
.tl-week { stroke: var(--rule-2); }
.tl-today { stroke: var(--ochre); stroke-width: 2; }
.tl-mark { fill: var(--ink); }
.tl-fomc { fill: var(--sheet); stroke: var(--ink); stroke-width: 1.75; }
.tl-label { font-family: var(--cond); font-size: 11.5px; fill: var(--ink); font-weight: 700; paint-order: stroke; stroke: var(--sheet); stroke-width: 4px; stroke-linejoin: round; }
.tl-sub { font-family: var(--cond); font-size: 11px; fill: var(--ink-3); }

.cal-list { list-style: none; display: grid; gap: 0; }
.cal-list li {
  display: grid; grid-template-columns: 5.2rem 1fr auto; gap: .8rem; align-items: baseline;
  padding: .4rem 0; border-top: 1px solid var(--rule); font-family: var(--semi); font-size: var(--t-s);
}
.cal-date { color: var(--ink-2); font-weight: 600; }
.cal-list li.cal-more { display: block; }
.cal-date small { display: block; font-size: var(--t-xs); font-weight: 500; color: var(--ink-3); }
.cal-sub { color: var(--ink-3); font-size: var(--t-xs); }
.cal-list li.is-rel .cal-what b::before { content: "\25CF"; color: var(--ochre); font-size: .6em; margin-right: .35rem; vertical-align: .2em; }
.cal-list li.is-fed .cal-what b::before { content: "\25C6"; font-size: .7em; margin-right: .35rem; vertical-align: .1em; }
.tl-rel { fill: var(--sheet); stroke: var(--ochre); stroke-width: 2; }
.cal-what b { font-weight: 700; }
.cal-when { color: var(--ink-3); font-size: var(--t-xs); }
.cal-list button { text-align: left; text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 3px; }
.cal-list button:hover { color: var(--flag); text-decoration-color: var(--flag); }

/* ---------------- wire ---------------- */

.wire { list-style: none; columns: 2 26rem; column-gap: 3rem; }
.wire li { break-inside: avoid; padding: .6rem 0 .7rem; border-top: 1px solid var(--rule); }
.wire a { text-decoration: none; font-size: var(--t-m); line-height: 1.35; font-weight: 600; }
.wire a:hover { text-decoration: underline; text-decoration-color: var(--flag); color: var(--flag); }
.wire-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .7rem; margin-top: .25rem; font-family: var(--semi); font-size: var(--t-xs); color: var(--ink-3); }
/* chips: legend entries, key box + label */
.chip {
  display: inline-flex; align-items: center; gap: .35rem;
  font-family: var(--semi); font-size: var(--t-xs); font-weight: 700; padding: .05rem .45rem .05rem .35rem;
  border: 1px solid var(--rule-2); color: var(--ink-2); line-height: 1.5; background: var(--panel);
}
.chip::before { content: ""; width: .5rem; height: .5rem; border: 1.5px solid currentColor; flex: none; }
.chip:hover { border-color: var(--flag); color: var(--flag); }
.wire-empty { color: var(--ink-2); padding: 1rem 0; }

/* ---------------- footer: a contour strip, then provenance ---------------- */

.foot {
  position: relative; margin-top: 3.5rem; padding-top: 3.2rem; border-top: 3px solid var(--ink);
  color: var(--ink-3); font-size: var(--t-xs); display: flex; justify-content: space-between; gap: 2rem;
}
.foot::before {
  content: ""; position: absolute; top: .6rem; left: 0; right: 0; height: 28px; pointer-events: none;
  background: var(--contour-ink);
  -webkit-mask: url(topo-strip.svg) left center / 1600px 28px repeat-x;
  mask: url(topo-strip.svg) left center / 1600px 28px repeat-x;
}
.foot p:first-child { max-width: 90ch; }

/* ---------------- drawer ---------------- */

body.drawer-open { overflow: hidden; }
.drawer:focus { outline: none; }
.scrim { position: fixed; inset: 0; background: rgba(12, 18, 14, .45); z-index: 40; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(780px, 100vw);
  background: var(--sheet); border-left: 3px solid var(--forest); box-shadow: var(--shadow);
  z-index: 41; overflow-y: auto; padding: 0 1.8rem 2.5rem; overscroll-behavior: contain;
  animation: slide .28s cubic-bezier(.2, .8, .2, 1);
}
@keyframes slide { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.dr-bar {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: .6rem;
  margin: 0 -1.8rem 1.2rem; padding: .65rem 1.8rem; background: var(--forest);
}
.dr-btn { font-family: var(--semi); font-size: var(--t-s); font-weight: 600; color: var(--ink-2); padding: .25rem .5rem; border-radius: 2px; white-space: nowrap; }
.dr-btn:hover { background: var(--sheet-2); color: var(--ink); }
.dr-btn[hidden] { display: none; }
#dr-close { margin-left: auto; }
.dr-trail { list-style: none; display: flex; flex-wrap: nowrap; overflow: hidden; gap: .3rem; font-family: var(--semi); font-size: var(--t-s); color: var(--ink-3); min-width: 0; }
.dr-trail li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; min-width: 2.5rem; }
.dr-trail li + li::before { content: "/"; margin-right: .3rem; color: var(--ink-3); }
.dr-trail button { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 3px; }
.dr-trail button:hover { color: var(--flag); }
.dr-trail [aria-current] { color: var(--ink); font-weight: 700; }
.dr-kind { font-family: var(--sans); font-weight: 800; font-size: var(--t-xs); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.dr-name { font-family: var(--sans); font-weight: 800; font-stretch: 105%; font-size: 2.1rem; line-height: 1.05; letter-spacing: -0.015em; margin: .15rem 0 .35rem; }
.dr-px { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1rem; }
.dr-px .v { font-family: var(--sans); font-weight: 800; font-size: var(--t-2xl); line-height: 1.05; letter-spacing: -0.02em; }
.dr-px .d { font-family: var(--cond); font-weight: 600; font-size: var(--t-l); }
.dr-sub { font-family: var(--semi); font-size: var(--t-s); color: var(--ink-2); margin-top: .35rem; max-width: 62ch; }
.dr-read { font-family: var(--sans); font-size: var(--t-m); line-height: 1.55; margin: 1rem 0 .2rem; max-width: 62ch; color: var(--ink-2); border-left: 3px solid var(--ink); padding-left: .9rem; }
.dr-read b { font-weight: 700; color: var(--ink); }
.dr-ctrl { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; margin: 1.2rem 0 .4rem; }
.dr-rchg { font-family: var(--semi); font-size: var(--t-s); font-weight: 600; color: var(--ink-2); min-height: 1.3em; margin-bottom: .2rem; }
.dr-chart { position: relative; height: 280px; }
.dr-chart svg, .chart--short svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart.chart--short, .chart--short { position: relative; height: 130px; }
.dr-h {
  font-family: var(--sans); font-weight: 800; font-size: var(--t-xs); letter-spacing: .12em; text-transform: uppercase;
  margin: 1.7rem 0 .5rem; padding-top: .55rem; border-top: 3px solid var(--ink);
}
.dr-notes { margin-top: 1.3rem; display: grid; gap: .55rem; font-size: var(--t-m); line-height: 1.55; max-width: 66ch; color: var(--ink-2); }
.dr-notes b { font-weight: 700; color: var(--ink); }
.dr-src { font-family: var(--semi); font-size: var(--t-s); margin-top: .8rem; }
.perf { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin-top: 1rem; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule-2); }
.perf-c { padding: .4rem .5rem .45rem; border-left: 1px solid var(--rule); font-family: var(--cond); }
.perf-c:first-child { border-left: 0; }
.perf-c span { display: block; font-family: var(--semi); font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.perf-c b { font-weight: 700; font-size: var(--t-m); }
.range52 { margin: .2rem 0 .2rem; }
.range52-bar { position: relative; height: 3px; background: var(--ink-3); margin: .9rem 0 .3rem; }
.range52-bar i { position: absolute; top: -6px; width: 3px; height: 15px; background: var(--ink); }
.range52-ends { display: flex; justify-content: space-between; gap: .8rem; font-family: var(--semi); font-size: var(--t-xs); font-weight: 600; color: var(--ink-2); }
.range52-ends small { color: var(--ink-3); font-weight: 500; }
.street-bar { position: relative; height: 16px; margin: .8rem 0 .3rem; border-bottom: 1px solid var(--rule-2); }
.sb-range { position: absolute; top: 5px; height: 6px; background: var(--ink); opacity: .18; border-radius: 1px; }
.sb-tgt, .sb-px { position: absolute; top: 0; width: 2px; height: 16px; transform: translateX(-1px); }
.sb-tgt { background: var(--ink); }
.sb-px { background: var(--ochre); }
.surp { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; font-family: var(--semi); font-size: var(--t-xs); }
.surp-c { display: grid; justify-items: start; gap: .05rem; }
.surp-bar-wrap { position: relative; width: 100%; height: 72px; border-bottom: 0; }
.surp-bar-wrap::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--ink-3); }
.surp-bar-wrap i { position: absolute; left: 0; width: 60%; border-radius: 1px; }
.surp-c b { font-family: var(--cond); font-weight: 700; font-size: var(--t-m); }
.surp-c span { color: var(--ink-2); }
.surp-c small { color: var(--ink-3); }
.calc .blanks { font-size: var(--t-m); line-height: 2; }
/* connected: legend entries */
.dr-rel { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .45rem; }
.rel {
  display: grid; grid-template-columns: auto 1fr; column-gap: .5rem; text-align: left;
  padding: .45rem .6rem; border: 1px solid var(--rule-2); background: var(--panel); font-family: var(--semi);
}
.rel::before { content: ""; grid-row: 1 / span 2; width: .55rem; height: .55rem; margin-top: .3rem; border: 1.5px solid var(--ink); }
.rel:hover { border-color: var(--flag); }
.rel:hover::before { border-color: var(--flag); background: var(--flag-bg); }
.rel:hover .rel-k { color: var(--flag); }
.rel-k { font-size: var(--t-xs); font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rel-v { font-family: var(--cond); font-weight: 700; font-size: var(--t-m); }
.rel-v .up, .rel-v .down { font-weight: 600; font-size: var(--t-xs); margin-left: .2rem; }
.peers { margin-top: .2rem; }
.peers tr.is-self td { background: var(--sheet-2); font-weight: 700; }
.peers td.name small { margin-left: .3rem; }
.multiples--dr { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 1.1rem; }
.dr-news { list-style: none; margin-top: .2rem; }
.dr-news li { border-top: 1px solid var(--rule); padding: .5rem 0; }
.dr-news a { text-decoration: none; font-weight: 600; }
.dr-news a:hover { color: var(--flag); }
.dr-news small { display: block; color: var(--ink-3); font-family: var(--semi); font-size: var(--t-xs); }
.tip-cue { margin-top: .3rem; font-size: var(--t-xs); color: var(--ink-3); }

/* ---------------- palette ---------------- */

.palette {
  position: fixed; top: 12vh; left: 50%; transform: translateX(-50%);
  width: min(620px, calc(100vw - 2rem)); z-index: 50;
  background: var(--sheet); border: 2px solid var(--ink); box-shadow: 0 0 0 100vmax rgba(12, 18, 14, .35), var(--shadow);
}
.palette input {
  width: 100%; font-family: var(--semi); font-size: var(--t-l); font-weight: 600; padding: .9rem 1.1rem;
  background: transparent; color: var(--ink); border: 0; border-bottom: 1px solid var(--rule-2);
}
.palette input::placeholder { color: var(--ink-3); font-weight: 500; }
.palette input:focus { outline: none; }
#pal-list { list-style: none; max-height: 52vh; overflow-y: auto; }
#pal-list li {
  display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 1.1rem;
  font-family: var(--semi); font-weight: 600; cursor: pointer;
}
#pal-list li small { color: var(--ink-3); font-weight: 500; }
#pal-list li[aria-selected="true"] { background: var(--ink); color: var(--sheet); }
#pal-list li[aria-selected="true"] small { color: var(--sheet); opacity: .8; }
.keys { padding: 1.2rem 1.4rem 1.4rem; }
.keys h2 { font-family: var(--sans); font-weight: 800; font-size: var(--t-xl); margin-bottom: .6rem; }
.keys dl { display: grid; grid-template-columns: auto 1fr; gap: .5rem 1.2rem; font-family: var(--semi); font-size: var(--t-s); }
.keys dd { color: var(--ink-2); }

/* ---------------- tooltip (forest, same inks as the band) ---------------- */

.tip {
  position: fixed; z-index: 60; pointer-events: none;
  background: var(--forest); color: var(--ink);
  font-family: var(--semi); font-size: var(--t-s); line-height: 1.4;
  padding: .5rem .7rem; border-radius: 2px; max-width: 290px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
}
.tip b { font-weight: 700; }
.tip .row { display: flex; justify-content: space-between; gap: 1.2rem; }
.tip .row span:first-child { color: var(--ink-2); }
.tip-sw { display: inline-block; width: 8px; height: 8px; margin-right: .35rem; vertical-align: .05em; }

/* ---------------- responsive ---------------- */

@media (max-width: 1180px) {
  .today-body { grid-template-columns: minmax(0, 1fr); }
  .band-main { grid-template-columns: minmax(0, 1fr); }
  .band-head { flex-direction: row; flex-wrap: wrap; gap: 1rem 3rem; }
  .rates-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .rates-grid .facts { grid-column: 1 / -1; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .chain { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .link:nth-child(4) { border-left: 0; padding-left: 0; }
  .link:nth-child(n+4) { border-top: 1px solid var(--rule); }
  .link:nth-child(3)::after { display: none; }
  .grid-2, .grid-2--wide { grid-template-columns: minmax(0, 1fr); }
  .multiples { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .head { grid-template-columns: 1fr; }
  .titleblock { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tb-actions { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--rule-2); justify-content: flex-end; }
  .hero-body { grid-template-columns: minmax(0, 1fr); }
  .terms { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule-2); padding-top: 1rem; }
  .curve-wrap { height: 240px; }
  .rate-control { grid-template-columns: auto 1fr auto; }
  .rate-control .linkish { grid-column: 1 / -1; justify-self: start; }
  .foot { flex-direction: column; }
  .tile-group { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .tile-gh { border-top: 0; padding-top: 0; margin-bottom: .35rem; }
  .rates-grid { grid-template-columns: minmax(0, 1fr); }
  .rates-grid .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .perf { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .perf-c:nth-child(5) { border-left: 0; }
  .drawer { padding: 0 1rem 2rem; }
  .dr-bar { margin: 0 -1rem 1rem; padding: .6rem 1rem; }
}
@media (max-width: 560px) {
  body { padding: 0 .9rem .9rem; }
  .head { padding: .7rem 0 .6rem; gap: .6rem; }
  .head h1 { font-size: 1.45rem; }
  .head-sub { display: none; }
  .tb-cell { padding: .25rem .5rem .3rem; }
  .tb-actions { padding: .1rem .3rem; justify-content: space-between; }
  .tb-btn { padding: .2rem .45rem; }
  .drawer { border-left: 0; }
  .jump { margin: 0 -.9rem; padding: .3rem .9rem; }
  .tband { margin: 0 -.9rem; padding: .9rem .9rem 2.1rem; }
  /* phones: the move, the session, then compact tiles */
  .band-main { margin: .8rem 0 1rem; gap: 1rem; }
  .band-head { gap: .9rem 1.4rem; }
  .bh-v { font-size: 3rem; }
  .bh:not(.bh--main) .bh-v { font-size: 2.2rem; }
  .bh-s { font-size: var(--t-xs); }
  .chart.chart--session { height: 170px; }
  .chart.chart--session10 { height: 70px; }
  .tiles { gap: .5rem; }
  .tile-gh { font-size: .68rem; margin-bottom: .2rem; }
  .tile { padding: .3rem .45rem .25rem; grid-template-areas: "k k" "v d" "s s"; }
  .tile-k { font-size: .7rem; }
  .tile-v { font-size: 1.05rem; }
  .tile-d { font-size: .75rem; }
  .tile-spark { height: 14px; margin-top: .1rem; }
  .read .lede { font-size: var(--t-s); }
  .session figcaption { font-size: var(--t-xs); }
  .tile-row .tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .chain { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .link:nth-child(n) { border-left: 1px solid var(--rule); padding-left: .8rem; border-top: 1px solid var(--rule); }
  .link:nth-child(odd) { border-left: 0; padding-left: 0; }
  .link:nth-child(-n+2) { border-top: 0; }
  .link::after { display: none; }
  .multiples { grid-template-columns: minmax(0, 1fr); }
  .board { padding: .85rem .8rem 1rem; margin: 0 -.3rem; }
  .plat { height: 540px; }
  .legend { display: flex; }
  .legend::before { flex-basis: 100%; border-right: 0; padding: 0; }
  .tb-cell dd { font-size: var(--t-xs); white-space: normal; }
  .tile-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .head-ctrls .seg button { font-size: var(--t-xs); padding: .26rem .5rem; }
  .multiples--dr { grid-template-columns: minmax(0, 1fr); }
  .surp { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dr-name { font-size: 1.7rem; }
  .dr-px .v { font-size: 2.2rem; }
  main { gap: 2.6rem; }
}

@media (max-width: 759px), (pointer: coarse) {
  #btn-help { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
