/* VSSGEO charts — SCALES lane (docs/design/charts/scales.css), 2026-09-27. Pairs with scales.js.
   The map legends (Vista Elements ladder, story heat legends) and the report bars (#panel .ibar, "× U.S.").
   Load AFTER door/r2/map.css, reports.css and lead-fixes.css: it builds on map.css's dock ("legends as quiet cards,
   mono ticks") and only takes over the legend blocks' own shape + arrival. Rules are prefixed ":root body.door" so they
   win on specificity, not only on load order. Colours: --vg-* tokens, Evan's data colours (inline --c), and the
   --vr2-bar-* bar tokens from reports.css (with fallbacks). 8-pt: 4 / 8 / 16 / 24 / 32. Small marks: radius 3px.
   Motion: ARRIVE = blocks build in left to right, once per layer / report (scales.js adds .vgs-in / .vgs-go);
   hover = focus (the rest dims to .22); REST = still; prefers-reduced-motion = final state, no motion. */

:root{
  --vgs-cell:3px;                                                    /* block radius */
  --vgs-gap:2px;                                                     /* gap between blocks */
  --vgs-track:color-mix(in srgb,var(--vg-ink) 8%,transparent);       /* empty block / track (brief) */
  --vgs-edge:transparent;                                            /* pale fills get an edge in light mode */
  --vgs-blue:var(--vr2-bar-blue,var(--vg-blue));
  --vgs-gold:var(--vr2-bar-gold,var(--vg-gold));
  --vgs-us:var(--vg-ink);                                            /* the U.S. = 1× tick */
  --vgs-dim:.22;
}
:root[data-theme="light"]{
  --vgs-edge:color-mix(in srgb,var(--vg-ink) 14%,transparent);
  --vgs-track:color-mix(in srgb,var(--vg-ink) 8%,transparent);
}

@keyframes vgs-block{from{opacity:0;transform:translateY(-6px) scale(.5)}to{opacity:1;transform:none}}
@keyframes vgs-cell{from{opacity:0;transform:scale(.4)}to{opacity:1;transform:none}}
@keyframes vgs-tip{from{opacity:0;translate:-50% 4px}to{opacity:1;translate:-50% 0}}


/* ══ 1. THE DOCK: legend + "For sale" side by side (fixes For sale sitting on top of the #1–#100 legend) ══════════
   Evan stacks #ladder under the layer row, inside a pill-shaped dock: For sale floated in the pill's curved top-left
   and the legend hung beneath it (Beth, d15-elements). With Vista Elements on, the dock is ONE row:
   [ #1 ▮▮▮▮▮▮▮▮▮▮ #100 ] [ For sale ]. Toolbox / listings / style boxes still take a full row of their own. */
:root body.door.lseg #dock{display:flex;flex-wrap:wrap;align-items:center;gap:4px}
:root body.door.lseg #dock>.drow{order:2;flex:0 0 auto}
:root body.door.lseg #dock>#ladder{order:1;flex:1 1 256px;margin:0}
:root body.door.lseg #dock>:is(#toolbox,#avbar,#stybox){order:0;flex:1 0 100%}
:root body.door.lseg #dock>:is(#avbar,#stybox){order:3}


/* ══ 2. THE VISTA ELEMENTS LADDER (#ladder / #lbar): ten tier blocks ══════════════════════════════════════════════ */
:root body.door #dock #ladder.vgs-ladder{position:relative;gap:8px;font:500 11px/1 var(--vg-font-mono);letter-spacing:.02em;
  color:var(--vg-muted);font-variant-numeric:tabular-nums}
:root body.door #dock #ladder.vgs-ladder>span{flex:0 0 auto}
:root body.door #dock #lbar{flex:1;min-width:160px;height:32px;display:flex;align-items:center;gap:var(--vgs-gap);background:none;
  box-shadow:none;border-radius:0;overflow:visible}   /* door-panels drew a pill track + clipped it: blocks need room to lift */
:root body.door #dock #lbar>i{position:relative;flex:1;height:12px;border-radius:var(--vgs-cell);
  box-shadow:inset 0 0 0 1px var(--vgs-edge);cursor:default;animation:none;   /* map.css's replaying stack-in -> ours below */
  transition:opacity .18s ease,transform .18s var(--vg-spring)}
:root body.door #dock #lbar>i::after{content:"";position:absolute;inset:-10px -1px}                  /* 32px tall hit area */
:root body.door #dock #ladder.vgs-in #lbar>i{animation:vgs-block .32s var(--vg-spring) backwards;animation-delay:calc(var(--i,0) * 36ms)}


/* ══ 3. THE HEAT LEGENDS: dock (.gheat) and story card (.legend2): six stop blocks ══════════════════════════════ */
:root body.door .gheat.vgs-heat>i,:root body.door .legend2.vgs-heat>.g{display:none!important}   /* [!] Evan's gradient: kept, hidden */
:root body.door .vgs-ramp{display:flex;align-items:center;gap:var(--vgs-gap);height:24px}
:root body.door .vgs-ramp>b{position:relative;flex:1;height:10px;border-radius:var(--vgs-cell);background:var(--c);
  box-shadow:inset 0 0 0 1px var(--vgs-edge);transition:opacity .18s ease,transform .18s var(--vg-spring)}
:root body.door .vgs-ramp>b::after{content:"";position:absolute;inset:-8px -1px}
:root body.door .vgs-in .vgs-ramp>b{animation:vgs-block .3s var(--vg-spring) backwards;animation-delay:calc(var(--i,0) * 48ms)}
/* dock: fewer ▮▮▮▮▮▮ more */
:root body.door #dock .gheat.vgs-heat{position:relative;font:500 11px/1 var(--vg-font-mono);letter-spacing:.02em;color:var(--vg-muted)}
:root body.door #dock .gheat .vgs-ramp{width:144px;height:32px}
/* story card: the ramp full width, Evan's labels under it in mono */
:root body.door .legend2.vgs-heat{position:relative;margin:8px 0}
:root body.door .legend2.vgs-heat .vgs-ramp{height:24px}
:root body.door .legend2.vgs-heat .vgs-ramp>b{height:12px}
:root body.door .legend2.vgs-heat .l{font:500 11px/1.3 var(--vg-font-mono);color:var(--vg-muted);margin-top:4px;gap:8px}
:root body.door .legend2.vgs-heat .l>span:nth-child(2){font-family:var(--vg-font-body);text-align:center}


/* ══ 4. LEGEND HOVER = FOCUS (both legends) ══════════════════════════════════════════════════════════════════════ */
:root body.door .vgs-focus :is(#lbar>i,.vgs-ramp>b):not(.vgs-on){opacity:var(--vgs-dim)}
:root body.door .vgs-focus :is(#lbar>i,.vgs-ramp>b).vgs-on{transform:scaleY(1.35)}
/* map -> legend: the band of the hexagon under the pointer gets a ring (no dimming: the map is the focus) */
:root body.door #dock #lbar>i.vgs-here,:root body.door #dock .vgs-ramp>b.vgs-here{box-shadow:0 0 0 2px var(--vg-panel),0 0 0 3px var(--vg-ink)}
/* the readout: a small glass tag above the band, mono */
:root body.door .vgs-read{position:absolute;bottom:calc(100% + 8px);left:50%;translate:-50% 0;z-index:3;pointer-events:none;
  padding:4px 8px;border-radius:var(--vg-r-sm);background:var(--vg-glass);border:1px solid var(--vg-rule);box-shadow:var(--vgmap-float,var(--vg-shadow));
  font:500 11px/16px var(--vg-font-mono);color:var(--vg-ink);white-space:nowrap;opacity:0;visibility:hidden;
  -webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}
:root body.door .vgs-read.vgs-show{opacity:1;visibility:visible;animation:vgs-tip .16s ease both}
:root body.door .legend2.vgs-heat .vgs-read{bottom:calc(100% + 4px)}


/* ══ 5. REPORT BARS (#panel .ibar): 20 blocks on Evan's scale + the U.S. = 1× tick ══════════════════════════════ */
:root body.door #panel .ibar.vgs-done>.t>i{display:none!important}        /* [!] Evan's bar: kept in the DOM, hidden */
:root body.door #panel .ibar.vgs-done>.t{background:none!important}      /* [!] round 1 / reports.css drew the track on .t */
:root body.door #panel .vgs-bar{position:relative;display:grid;grid-template-columns:repeat(20,minmax(0,1fr));gap:var(--vgs-gap);
  height:8px;margin-top:8px;--vgs-fill:var(--vgs-blue)}
:root body.door #panel .vgs-bar.vgs-gold{--vgs-fill:var(--vgs-gold)}
:root body.door #panel .ibar .t .vgs-bar>b{display:block;height:8px;margin:0;padding:0;border-radius:2px;background:var(--vgs-track)}   /* Evan's .t b rule was squashing them to 5px */
:root body.door #panel .ibar .t .vgs-bar>b.on{background:linear-gradient(90deg,var(--vgs-fill) var(--f,100%),var(--vgs-track) var(--f,100%));
  box-shadow:inset 0 0 0 1px var(--vgs-edge)}
/* the U.S. tick: a 2px ink line, taller than the bar, where the bar would end if this area matched the U.S. */
:root body.door #panel .vgs-us{position:absolute;top:-4px;bottom:-4px;width:2px;margin-left:-1px;border-radius:1px;
  background:var(--vgs-us);box-shadow:0 0 0 1px var(--vg-panel);text-decoration:none;pointer-events:none;transition:opacity .18s ease,background .15s ease}
:root body.door #panel .ibar.vgs-on .vgs-us{width:3px;margin-left:-1.5px;background:var(--vg-accent)}   /* the hovered row's U.S. tick steps forward */
/* one key per "× U.S." group */
:root body.door #panel .vgs-key{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;margin:16px 0 8px;
  font:500 11px/16px var(--vg-font-mono);color:var(--vg-muted)}
:root body.door #panel .vgs-key>i{display:inline-flex;gap:2px;align-items:center}
:root body.door #panel .vgs-key>i>b{width:8px;height:8px;border-radius:2px;background:var(--vgs-blue);box-shadow:inset 0 0 0 1px var(--vgs-edge)}
:root body.door #panel .vgs-key>i>b.g{background:var(--vgs-gold)}
:root body.door #panel .vgs-key>i.us{width:2px;height:16px;border-radius:1px;background:var(--vgs-us);margin-left:8px}
/* the "× U.S." number reads as a measure: mono (reports.css already makes the % mono) */
:root body.door #panel .ibar.vgs-done>span:last-child small{font-family:var(--vg-font-mono);font-variant-numeric:tabular-nums}
/* hover = focus: the row lights, the other rows' marks dim */
:root body.door #panel .vgs-focus>.ibar.vgs-done:not(.vgs-on) :is(.vgs-bar,.vgs-us){opacity:var(--vgs-dim)}
:root body.door #panel .vgs-focus>.ibar.vgs-done:not(.vgs-on){color:var(--vg-muted)}
:root body.door #panel .ibar.vgs-done{transition:color .15s ease}
/* ARRIVE: the lit blocks build in left to right, rows staggered (bars wait hidden until scrolled into view) */
:root body.door #panel .vgs-bar.vgs-wait>b.on,:root body.door #panel .vgs-bar.vgs-wait>.vgs-us{opacity:0}
:root body.door #panel .vgs-bar.vgs-go>b.on{animation:vgs-cell .22s var(--vg-spring) backwards;
  animation-delay:calc(var(--row,0) * 32ms + var(--k,0) * 14ms)}
:root body.door #panel .vgs-bar.vgs-go>.vgs-us{animation:vgs-cell .2s ease backwards;animation-delay:calc(var(--row,0) * 32ms + 300ms)}
/* reports.js's row entrance (vr2-in) grows Evan's <i>; ours replaces it */
:root body.door #panel.vr2 .ibar.vgs-done .t i{animation:none}


/* ══ 6. PHONES ══════════════════════════════════════════════════════════════════════════════════════════════════ */
/* Evan hides both legends whenever the visible map is under 620px wide (body.mtight, every phone): the colours then have
   no key. The one-row dock has room, so the legend comes back. [!] vs Evan's display:none!important. Lead: drop these two
   lines to keep Evan's behaviour. */
:root body.door.geo.mtight.lseg #dock #ladder{display:flex!important}
:root body.door.geo.mtight.heat #dock .gheat{display:flex!important}
@media (max-width:760px){
  :root body.door.lseg #dock>#ladder{flex-basis:200px}
  :root body.door #dock #lbar{min-width:120px}
  :root body.door #dock .gheat .vgs-ramp{width:96px}
}


/* ══ 7. REDUCED MOTION: final state, nothing moves ══════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion:reduce){
  :root body.door :is(#lbar>i,.vgs-ramp>b,.vgs-bar>b,.vgs-us,.vgs-read){animation:none!important;transition:none!important}
  :root body.door #panel .vgs-bar.vgs-wait>:is(b.on,.vgs-us){opacity:1}
}
