/* Evaluation studio · the multi-OD page as one instrument room.
   Loaded last on the evaluation page only. It re-tones the shared tokens, turns the authoring workbench into a
   viewport-tall split studio (map | divider | settings rail) and stages save → compute → report with motion that
   follows real state. Science never lives here: colours of the noise scale, route meanings and every value come
   from the views. All motion stops under reduced-motion preferences. */

/* ---------- 1 · tokens ------------------------------------------------------------------------------------- */
:root {
  --es-bg: #eef0ec; --es-bg-2: #e3e7e1; --es-glass: rgb(255 255 255 / .72); --es-glass-2: rgb(255 255 255 / .9);
  --es-line: rgb(16 24 20 / .09); --es-line-2: rgb(16 24 20 / .18); --es-ink: #111613; --es-ink-2: #3b443e; --es-ink-3: #66706a;
  --es-signal: #b7e019; --es-signal-ink: #10140f; --es-cyan: #0f8fa6; --es-glow: rgb(183 224 25 / .35);
  --es-shadow: 0 1px 0 rgb(255 255 255 / .6) inset, 0 1.25rem 3rem -1.5rem rgb(20 30 25 / .35), 0 .25rem .75rem -.375rem rgb(20 30 25 / .18);
  --es-radius: 1rem; --es-radius-s: .625rem; --es-blur: saturate(1.4) blur(18px);
  --es-ease: cubic-bezier(.22, 1, .36, 1); --es-ease-io: cubic-bezier(.65, 0, .35, 1); --es-spring: cubic-bezier(.34, 1.56, .64, 1);
  --es-c-distance: #8a949c; --es-c-continuous: #4aa3ff; --es-c-threshold: #b47cff; --es-c-exposure: #9ccc00;
  --paper: var(--es-bg); --plate: rgb(255 255 255 / .62); --plate-2: rgb(16 24 20 / .06);
}
:root[data-theme="dark"] {
  --es-bg: #06090b; --es-bg-2: #0b1013; --es-glass: rgb(16 21 24 / .66); --es-glass-2: rgb(20 26 30 / .9);
  --es-line: rgb(214 236 226 / .08); --es-line-2: rgb(214 236 226 / .16); --es-ink: #e9efe9; --es-ink-2: #b9c4bd; --es-ink-3: #82908a;
  --es-signal: #d4f347; --es-signal-ink: #0b0f08; --es-cyan: #5ad1e6; --es-glow: rgb(212 243 71 / .28);
  --es-shadow: 0 1px 0 rgb(255 255 255 / .04) inset, 0 1.5rem 3.5rem -1.5rem rgb(0 0 0 / .75), 0 0 0 1px rgb(214 236 226 / .05);
  --es-c-distance: #9aa3ad; --es-c-continuous: #6fb6ff; --es-c-threshold: #c79bff; --es-c-exposure: #d4f347;
  --paper: var(--es-bg); --plate: rgb(20 26 30 / .62); --plate-2: rgb(214 236 226 / .06);
}
html:has(> body > .ev), html:has(.ev) { background: var(--es-bg); scroll-padding-top: 5rem; }
body:has(> .ev) { background: transparent; }

/* ---------- 2 · ambient field: a slow sound-field painted behind the room (canvas from the studio host) -------- */
.ev-ambient { position: fixed; inset: 0; z-index: -1; inline-size: 100vw; block-size: 100dvh; pointer-events: none; display: block; }
.ev-ambient-veil {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60rem 40rem at 12% -10%, color-mix(in oklab, var(--es-signal) 13%, transparent), transparent 70%),
    radial-gradient(50rem 36rem at 105% 15%, color-mix(in oklab, var(--es-cyan) 12%, transparent), transparent 70%),
    radial-gradient(70rem 50rem at 50% 120%, color-mix(in oklab, var(--es-cyan) 7%, transparent), transparent 70%);
}

/* ---------- 3 · page chrome ---------------------------------------------------------------------------------- */
.bx.ev { background: transparent; color: var(--es-ink); }
.bx.ev .bx-header { background: color-mix(in oklab, var(--es-bg) 72%, transparent); -webkit-backdrop-filter: var(--es-blur); backdrop-filter: var(--es-blur); z-index: 30; }
.bx.ev .bx-heading { padding-block: .875rem .5rem; gap: .5rem .625rem; }
.bx.ev .bx-heading h1 { font: 650 1.375rem/1.15 var(--f-display); letter-spacing: -.005em; margin-inline-end: auto; }
.bx.ev .bx-button {
  border-radius: 999px; border: 1px solid var(--es-line-2); background: var(--es-glass); color: var(--es-ink);
  -webkit-backdrop-filter: var(--es-blur); backdrop-filter: var(--es-blur);
  transition: transform .18s var(--es-ease), background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
@media (hover: hover) and (pointer: fine) { .bx.ev .bx-button:not(:disabled):hover { border-color: color-mix(in oklab, var(--es-signal) 60%, var(--es-line-2)); box-shadow: 0 0 0 4px color-mix(in oklab, var(--es-signal) 14%, transparent); } }
.bx.ev .bx-button:not(:disabled):active { transform: scale(.97); }
.bx.ev .bx-source { color: var(--es-ink-3); font-size: .8125rem; }
.bx.ev.ev-workbench-active .bx-history { border-bottom: 0; padding-block-end: .375rem; }
.bx.ev.ev-workbench-active .bx-history > h2 { font: 600 .75rem/1 var(--f-num); letter-spacing: .06em; text-transform: uppercase; color: var(--es-ink-3); }
.bx.ev .bx-history-item {
  border: 1px solid var(--es-line); border-radius: .875rem; background: var(--es-glass);
  -webkit-backdrop-filter: var(--es-blur); backdrop-filter: var(--es-blur);
  transition: transform .2s var(--es-ease), border-color .2s ease, box-shadow .2s ease;
}
@media (hover: hover) and (pointer: fine) { .bx.ev .bx-history-item:hover { transform: translateY(-2px); border-color: var(--es-line-2); box-shadow: var(--es-shadow); } }
.bx.ev .bx-history-item[aria-current="true"] { border-color: color-mix(in oklab, var(--es-signal) 70%, transparent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--es-signal) 18%, transparent); }

/* the stage bar and saved studies share one row above the studio */
.bx.ev.ev-workbench-active .bx-history { flex-wrap: wrap; row-gap: .5rem; }
.bx.ev .bx-history > .ev-stages { margin: 0 1rem 0 0; }
.bx.ev .bx-heading { flex-wrap: wrap; }
.bx.ev .bx-heading + .bx-source { margin-block: -.375rem .5rem; }
/* stage bar: design → compute → report as one readable journey (rendered by the host from real state) */
.ev-stages {
  position: relative; display: flex; align-items: stretch; gap: .25rem; margin-block: .25rem .75rem; padding: .3125rem;
  border: 1px solid var(--es-line); border-radius: 999px; background: var(--es-glass); inline-size: max-content; max-inline-size: 100%;
  -webkit-backdrop-filter: var(--es-blur); backdrop-filter: var(--es-blur); box-shadow: var(--es-shadow); overflow-x: auto; scrollbar-width: none;
}
.ev-stage {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: .5rem; padding: .4375rem 1rem .4375rem .5rem; border: 0;
  border-radius: 999px; background: transparent; color: var(--es-ink-3); font: 600 .875rem/1.2 var(--f-ui); white-space: nowrap; cursor: pointer;
  transition: color .25s ease;
}
.ev-stage:disabled { cursor: default; opacity: .5; }
.ev-stage-no {
  display: inline-grid; place-items: center; inline-size: 1.625rem; block-size: 1.625rem; border-radius: 50%;
  border: 1.5px solid currentColor; font: 700 .75rem/1 var(--f-num); transition: background-color .3s ease, color .3s ease, border-color .3s ease;
}
.ev-stage[data-state="done"] .ev-stage-no { background: color-mix(in oklab, var(--es-signal) 85%, transparent); border-color: transparent; color: var(--es-signal-ink); }
.ev-stage[data-state="active"] { color: var(--es-ink); }
.ev-stage[data-state="active"] .ev-stage-no { border-color: var(--es-signal); color: var(--es-ink); box-shadow: 0 0 0 4px var(--es-glow); }
.ev-stage[data-state="working"] .ev-stage-no { border-color: var(--es-signal); border-inline-end-color: transparent; animation: es-spin 1.1s linear infinite; }
.ev-stage-sub { font: 500 .75rem/1 var(--f-num); color: var(--es-ink-3); font-variant-numeric: tabular-nums; }
.ev-stages-ink {
  position: absolute; z-index: 0; inset-block: .3125rem; border-radius: 999px; background: color-mix(in oklab, var(--es-ink) 8%, transparent);
  box-shadow: inset 0 0 0 1px var(--es-line-2); transition: inset-inline-start .45s var(--es-ease), inline-size .45s var(--es-ease);
}
.ev-stage-sep { align-self: center; inline-size: 1.25rem; block-size: 1px; background: linear-gradient(90deg, var(--es-line-2), transparent); }

/* ---------- 4 · workbench re-tone ---------------------------------------------------------------------------- */
:is(.wb, .wb-run-console) {
  --wb-paper: transparent; --wb-plate: var(--es-glass); --wb-plate-2: color-mix(in oklab, var(--es-ink) 6%, transparent); --wb-field: var(--es-glass-2);
  --wb-ink: var(--es-ink); --wb-ink-2: var(--es-ink-2); --wb-ink-3: var(--es-ink-3); --wb-rule: var(--es-line); --wb-rule-2: var(--es-line-2);
  --wb-r: .625rem; --wb-lift: var(--es-shadow); --wb-ease: var(--es-ease);
  --wb-scope: #070b0d; --wb-scope-2: #0d1316; --wb-scope-3: #172025; --wb-on-scope: #e8f0ea; --wb-on-scope-2: #a7b5ad; --wb-scope-rule: rgb(220 240 230 / .12);
  --wb-scope-signal: #d4f347;
  --wb-c-distance: var(--es-c-distance); --wb-c-continuous: var(--es-c-continuous); --wb-c-threshold: var(--es-c-threshold); --wb-c-exposure: var(--es-c-exposure);
}
.wb { background: transparent; }
.wb .wb-input, .wb select.wb-input {
  border-radius: .625rem; border-color: var(--es-line-2); background-color: var(--es-glass-2);
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.wb .wb-input:focus-visible { outline: none; border-color: color-mix(in oklab, var(--es-signal) 80%, var(--es-ink)); box-shadow: 0 0 0 4px var(--es-glow); }
.wb .wb-button { border-radius: 999px; transition: transform .16s var(--es-ease), background-color .2s ease, box-shadow .2s ease, border-color .2s ease; }
.wb .wb-button:not(:disabled):active, .wb-run-console .wb-button:not(:disabled):active { transform: scale(.97); }
.wb .wb-button.wb-primary, .wb-run-console .wb-button.wb-primary {
  background: linear-gradient(180deg, color-mix(in oklab, var(--es-signal) 92%, #fff), var(--es-signal)) var(--es-signal); color: var(--es-signal-ink); border-color: transparent;
  box-shadow: 0 .5rem 1.25rem -.5rem color-mix(in oklab, var(--es-signal) 70%, transparent), inset 0 1px 0 rgb(255 255 255 / .45);
}

/* the hero folds into one quiet line above the studio: the page heading already names the mode */
.wb .wb-hero-text { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wb .wb-hero { justify-content: flex-end; padding-block: 0 .5rem; }
@container wb (max-width: 48rem) { .wb .wb-hero { justify-content: flex-start; } }
.wb .wb-hero { padding-block: .25rem .75rem; border-block-end: 0; align-items: center; }
.wb .wb-eyebrow { color: var(--es-ink-3); letter-spacing: .08em; text-transform: uppercase; font-size: .6875rem; }
.wb .wb-title { font: 650 1.375rem/1.15 var(--f-display, var(--wb-f-display)); }
.wb .wb-subtitle { color: var(--es-ink-3); font-size: .875rem; }
.wb .wb-modes { border-color: var(--es-line-2); background: var(--es-glass); -webkit-backdrop-filter: var(--es-blur); backdrop-filter: var(--es-blur); }
.wb .wb-mode[aria-pressed="true"] { background: var(--es-ink); color: var(--es-bg); box-shadow: 0 .375rem 1rem -.5rem rgb(0 0 0 / .45); }

/* ---------- 5 · the studio: map | divider | rail, one viewport tall -------------------------------------------- */
.wb {
  --wb-rail: clamp(22rem, 31vw, 34rem);
  --es-studio-h: clamp(34rem, calc(100dvh - 5.75rem), 72rem);
}
.wb .wb-body {
  display: grid; grid-template-columns: minmax(0, 1fr) .875rem minmax(20rem, var(--wb-rail)); gap: 0; align-items: stretch;
  block-size: var(--es-studio-h); padding-block-start: .25rem; scroll-margin-top: 5rem;
}
.wb[data-mode="csv"] .wb-body { block-size: auto; min-block-size: var(--es-studio-h); }
.wb .wb-stage { position: static; max-block-size: none; overflow: visible; min-block-size: 0; display: flex; flex-direction: column; gap: .75rem; }
.wb[data-mode="graph"] .wb-stage { position: static; max-block-size: none; overflow: visible; }
.wb .wb-map-panel {
  position: relative; flex: 1 1 auto; min-block-size: 0; display: flex; flex-direction: column;
  border-radius: var(--es-radius); overflow: hidden; background: var(--wb-scope); color: var(--wb-on-scope);
  box-shadow: 0 2rem 4rem -2rem rgb(0 0 0 / .65), 0 0 0 1px rgb(220 240 230 / .08);
  animation: es-rise .7s var(--es-ease) both;
}
.wb .wb-scope-bar { border-radius: 0; background: linear-gradient(180deg, rgb(255 255 255 / .035), transparent); padding: .5rem .5rem .375rem .75rem; }
.wb .wb-current { align-items: center; gap: .625rem; }
.wb .wb-current-no {
  display: inline-grid; place-items: center; min-inline-size: 1.875rem; block-size: 1.875rem; padding-inline: .375rem; border-radius: .5rem;
  background: var(--wb-group-color, var(--wb-scope-signal)); color: #0b0f0c; font: 700 .8125rem/1 var(--wb-f-num);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--wb-group-color, var(--wb-scope-signal)) 22%, transparent);
  transition: background-color .3s ease, box-shadow .3s ease;
}
.wb .wb-ends { background: rgb(255 255 255 / .06); border-radius: .75rem; }
.wb .wb-end { border-radius: .5625rem; transition: background-color .22s var(--es-ease), color .22s ease, transform .16s var(--es-ease); }
.wb .wb-end[aria-pressed="true"] { background: var(--wb-scope-signal); box-shadow: 0 .375rem 1rem -.375rem rgb(212 243 71 / .6); }
.wb .wb-end:not(:disabled):active { transform: scale(.97); }
/* bars above the plot keep one line so the plot never rescales while their text changes; they scroll sideways */
.wb .wb-source-bar { border-block-start: 1px solid var(--wb-scope-rule); background: transparent; padding-block: .375rem .5rem; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.wb .wb-source-bar > * { flex-shrink: 0; }
.wb .wb-source-field { flex: 1 0 17rem; }
.wb .wb-scope-bar { flex-wrap: nowrap; }
.wb .wb-scope-bar .wb-current { flex: 1 1 6rem; min-width: 0; }
.wb .wb-scope-bar .wb-end { max-inline-size: 13rem; }
.wb .wb-source-bar .wb-source-pick { border-radius: .625rem; background-color: rgb(255 255 255 / .06); }

.wb .wb-map-frame {
  flex: 1 1 auto; aspect-ratio: auto; min-block-size: 14rem; max-block-size: none; block-size: auto; border-radius: 0;
  background: radial-gradient(120% 90% at 50% 40%, #0f171b 0%, #070b0d 70%);
}
.wb .wb-map-frame:has(> .wb-map[hidden]) { block-size: auto; }
.wb .wb-map-fx { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; display: block; pointer-events: none; z-index: 1; }
.wb .wb-map { z-index: 0; }
.wb .wb-guide, .wb .wb-readout, .wb .wb-zoom, .wb .wb-veil, .wb .wb-map-empty { z-index: 3; }
.wb .wb-guide {
  inset-inline-start: 50%; inset-block-start: .75rem; transform: translateX(-50%); max-inline-size: calc(100% - 7rem);
  padding: .4375rem .875rem; border-radius: 999px; background: rgb(8 12 14 / .72); border: 1px solid rgb(220 240 230 / .12);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); font-size: .8125rem; font-weight: 600;
  animation: es-drop .5s var(--es-ease) both;
}
.wb .wb-guide::before { box-shadow: 0 0 0 0 rgb(212 243 71 / .6); animation: es-beacon 2.2s ease-out infinite; }
.wb .wb-zoom { inset-block-start: 50%; transform: translateY(-50%); border-radius: .875rem; background: rgb(8 12 14 / .72); border-color: rgb(220 240 230 / .12); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.wb .wb-zoom > [data-wb-zoom="focus"] { margin-block-start: .1875rem; }
.wb .wb-zoom > [data-wb-zoom="focus"]::before { content: ""; position: absolute; inset-inline: .5rem; inset-block-start: -.15625rem; block-size: 1px; background: var(--wb-scope-rule); }
.wb .wb-zoom > [data-wb-zoom="focus"][aria-pressed="true"] { color: var(--wb-scope-signal); }
@media (hover: hover) and (pointer: fine) { .wb .wb-icon-button:not(:disabled):hover { background: rgb(255 255 255 / .09); } }
.wb .wb-readout { inset-block-end: .75rem; inset-inline-end: 4.25rem; padding: .3125rem .625rem; border-radius: 999px; background: rgb(8 12 14 / .7); border: 1px solid rgb(220 240 230 / .1); }

/* floating dock: layers and legend over the map; folds to a single button */
.wb .wb-map-frame > .wb-dock {
  position: absolute; z-index: 3; inset-inline-start: .75rem; inset-block-end: 3.25rem; max-inline-size: min(26rem, calc(100% - 6rem));
  display: grid; gap: .625rem; padding: .625rem .75rem .75rem; border: 1px solid rgb(220 240 230 / .12); border-radius: .875rem;
  background: rgb(8 12 14 / .74); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 1rem 2rem -1rem rgb(0 0 0 / .8); transform-origin: 0 100%;
  transition: opacity .25s ease, transform .3s var(--es-ease), padding .3s var(--es-ease);
}
.wb .wb-dock-toggle {
  position: absolute; inset-inline-end: .375rem; inset-block-start: .375rem; display: inline-grid; place-items: center; inline-size: 1.875rem; block-size: 1.875rem;
  border: 0; border-radius: .5rem; background: transparent; color: var(--wb-on-scope-2); cursor: pointer;
}
/* folded, the three layer switches stay on the map; only the legend and noise opacity fold behind the scale pill */
.wb .wb-map-frame > .wb-dock[data-open="false"] { display: flex; flex-wrap: nowrap; align-items: center; gap: .25rem; padding: .25rem; inline-size: auto; max-inline-size: calc(100% - 6rem); border-radius: 999px; }
.wb .wb-map-frame > .wb-dock[data-open="false"] > .wb-legend,
.wb .wb-map-frame > .wb-dock[data-open="false"] .wb-layers > :is(.wb-dock-title, .wb-opacity) { display: none; }
.wb .wb-map-frame > .wb-dock[data-open="false"] .wb-layers { flex-wrap: nowrap; gap: .25rem; padding-inline-end: 0; }
.wb .wb-map-frame > .wb-dock[data-open="false"] > .wb-dock-toggle { position: static; order: 2; display: inline-flex; gap: .5rem; inline-size: auto; block-size: 2rem; padding: 0 .75rem 0 .625rem; color: var(--wb-scope-signal); border-radius: 999px; }
.wb .wb-dock-toggle > svg.wb-dock-ico-narrow, .wb .wb-dock-toggle > .wb-dock-narrow-text { display: none; }
.wb .wb-dock-mini { display: none; align-items: center; gap: .375rem; font: 600 .6875rem/1 var(--wb-f-num); color: var(--wb-on-scope-2); }
.wb .wb-map-frame > .wb-dock[data-open="false"] .wb-dock-mini { display: inline-flex; }
.wb .wb-dock-mini-ramp { inline-size: 4.5rem; block-size: .375rem; border-radius: 999px; background: linear-gradient(90deg, rgb(45 33 96), rgb(40 92 146), rgb(29 152 140), rgb(110 194 92), rgb(228 208 62), rgb(238 104 58)); }
.wb .wb-map-frame > .wb-dock .wb-layers { padding-inline-end: 2rem; }
.wb .wb-layer { border-radius: 999px; transition: background-color .2s ease, color .2s ease, transform .16s var(--es-ease); }
.wb .wb-layer:not(:disabled):active { transform: scale(.96); }

/* point card: the decision floats where the eye already is */
.wb .wb-map-frame > .wb-point {
  pointer-events: none; position: absolute; z-index: 4; inset-inline: 50% auto; inset-block-end: .875rem; transform: translateX(-50%);
  inline-size: min(34rem, calc(100% - 1.5rem)); margin: 0; min-block-size: 0;
  border: 1px solid rgb(220 240 230 / .14); border-inline-start: 3px solid rgb(220 240 230 / .3); border-radius: .875rem;
  background: rgb(10 15 17 / .82); color: var(--wb-on-scope); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: 0 1.25rem 2.5rem -1rem rgb(0 0 0 / .85);
  transition: border-color .25s ease, transform .35s var(--es-ease), opacity .25s ease;
}
.wb .wb-map-frame > .wb-point[data-state="idle"] { inline-size: auto; max-inline-size: calc(100% - 10rem); inset-inline: auto .75rem; transform: none; inset-block-end: .75rem; padding: .375rem .75rem; opacity: .9; }
.wb .wb-map-frame > .wb-point[data-state="idle"] .wb-point-state { display: none; }
.wb .wb-map-frame > .wb-point:is([data-state="valid"], [data-state="invalid"], [data-state="busy"]) { animation: es-card .42s var(--es-spring) both; }
.wb .wb-map-frame > .wb-point[data-state="valid"] { border-inline-start-color: var(--wb-scope-signal); }
.wb .wb-map-frame > .wb-point[data-state="invalid"] { border-inline-start-color: var(--wb-scope-alert); }
.wb .wb-map-frame > .wb-point .wb-point-facts { color: var(--wb-on-scope-2); }
.wb .wb-map-frame > .wb-point .wb-point-facts > dd { color: var(--wb-on-scope); }
.wb .wb-map-frame > .wb-point[data-state="valid"] .wb-point-state { color: var(--wb-scope-signal); }
.wb .wb-map-frame > .wb-point[data-state="invalid"] .wb-point-state { color: var(--wb-scope-alert); }
/* the card reads over the map but only its action takes the pointer; the rest of the map stays pickable */
.wb .wb-map-frame > .wb-point .wb-apply { pointer-events: auto; animation: es-pulse 2.4s ease-in-out 1s infinite; }
.wb .wb-map-frame > .wb-point[data-state="idle"] .wb-point-facts { font-size: .75rem; }
.wb .wb-map-meta { flex: none; display: flex; flex-wrap: nowrap; align-items: center; gap: 1rem; block-size: 2.25rem; padding: 0 .875rem; overflow: hidden; border-block-start: 1px solid var(--wb-scope-rule); color: var(--wb-on-scope-2); font-size: .75rem; white-space: nowrap; }
.wb .wb-map-meta > * { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.wb .wb-map-meta .wb-map-keys { flex: 1 1 auto; opacity: .7; }
.wb .wb-map-meta .wb-source-note { flex: 0 1 auto; }
.wb .wb-map-meta .wb-source-note { color: var(--wb-scope-warn); }
.wb .wb-manual { padding: 0 .875rem .5rem; color: var(--wb-on-scope-2); }
.wb .wb-manual .wb-input { background-color: rgb(255 255 255 / .06); color: var(--wb-on-scope); border-color: var(--wb-scope-rule); }
.wb .wb-map-empty { background: transparent; }

/* divider */
.wb .wb-resizer { position: relative; display: grid; place-items: center; cursor: col-resize; touch-action: none; outline: none; }
.wb .wb-resizer-grip { inline-size: 4px; block-size: 3.5rem; border-radius: 4px; background: var(--es-line-2); transition: background-color .2s ease, block-size .3s var(--es-ease), box-shadow .2s ease; }
.wb .wb-resizer:is(:hover, :focus-visible) .wb-resizer-grip, .wb[data-resizing="true"] .wb-resizer-grip { background: var(--es-signal); block-size: 6rem; box-shadow: 0 0 0 4px var(--es-glow); }
.wb[data-resizing="true"] { cursor: col-resize; user-select: none; }

/* focus: the map takes the room; the same button brings the rail back (Esc as well) */
.wb[data-focus="true"] .wb-body { grid-template-columns: minmax(0, 1fr) 0 0; }
.wb[data-focus="true"] :is(.wb-resizer, .wb-rail) { display: none; }

/* ---------- 6 · rail ----------------------------------------------------------------------------------------- */
.wb .wb-rail {
  display: flex; flex-direction: column; min-block-size: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  border: 1px solid var(--es-line); border-radius: var(--es-radius); background: var(--es-glass); box-shadow: var(--es-shadow);
  -webkit-backdrop-filter: var(--es-blur); backdrop-filter: var(--es-blur); padding: 0 1rem; scroll-padding-top: 3.75rem;
  animation: es-rise .7s .08s var(--es-ease) both;
}
.wb .wb-nav { position: sticky; top: 0; z-index: 3; margin: 0 -1rem; padding: .625rem .75rem .5rem; background: linear-gradient(180deg, var(--es-glass-2) 70%, transparent); box-shadow: none; }
.wb .wb-nav::before { display: none; }
.wb .wb-nav-item { position: relative; border-radius: 999px; transition: background-color .2s ease, color .2s ease; }
.wb .wb-nav-item[data-current="true"] { background: color-mix(in oklab, var(--es-ink) 9%, transparent); color: var(--es-ink); }
.wb .wb-nav-item[data-current="true"] .wb-nav-no { color: var(--es-ink); }
.wb .wb-nav-item[data-done="true"] .wb-nav-dot { border-color: var(--es-signal); background: var(--es-signal); box-shadow: 0 0 0 3px var(--es-glow); animation: es-pop .4s var(--es-spring); }
.wb .wb-step, .wb .wb-advanced { border-block-start: 1px solid var(--es-line); scroll-margin-top: 3.5rem; }
.wb .wb-step-title { font-size: 1.0625rem; }
.wb .wb-step-no {
  display: inline-grid; place-items: center; min-inline-size: 1.625rem; block-size: 1.625rem; border-radius: .4375rem;
  background: color-mix(in oklab, var(--es-ink) 8%, transparent); color: var(--es-ink-2); font-size: .75rem;
}
.wb .wb-rail > :is(.wb-step, .wb-advanced) { animation: es-rise .6s var(--es-ease) both; }
.wb .wb-rail > :nth-child(3) { animation-delay: .05s; } .wb .wb-rail > :nth-child(4) { animation-delay: .1s; }
.wb .wb-rail > :nth-child(5) { animation-delay: .15s; } .wb .wb-rail > :nth-child(6) { animation-delay: .2s; } .wb .wb-rail > :nth-child(7) { animation-delay: .25s; }

/* group cards wear their map hue */
.wb .wb-group {
  position: relative; border: 1px solid var(--es-line); border-radius: .875rem; background: color-mix(in oklab, var(--es-glass-2) 70%, transparent);
  overflow: hidden; transition: border-color .25s ease, box-shadow .3s var(--es-ease), transform .25s var(--es-ease);
  animation: es-slide .45s var(--es-ease) both;
}
.wb .wb-group::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; inline-size: 4px; background: var(--wb-group-color, var(--es-line-2)); opacity: .9; }
.wb .wb-group[data-selected="true"] { border-color: color-mix(in oklab, var(--wb-group-color, var(--es-signal)) 55%, transparent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--wb-group-color, var(--es-signal)) 16%, transparent), var(--es-shadow); }
.wb .wb-group-no {
  display: inline-grid; place-items: center; min-inline-size: 1.75rem; block-size: 1.75rem; border-radius: .5rem;
  background: var(--wb-group-color, var(--es-line-2)); color: #0b0f0c; font-weight: 700;
}
@media (hover: hover) and (pointer: fine) { .wb .wb-group[data-selected="false"]:hover { transform: translateY(-1px); border-color: var(--es-line-2); } }
.wb .wb-dot[data-on="true"] { background: var(--wb-group-color, var(--es-signal)); border-color: transparent; }
.wb .wb-check { border-radius: 999px; transition: background-color .2s ease, border-color .2s ease, transform .16s var(--es-ease); }
.wb .wb-check:has(input:checked) { border-color: color-mix(in oklab, var(--es-signal) 60%, transparent); background: color-mix(in oklab, var(--es-signal) 13%, transparent); }
.wb .wb-check:active { transform: scale(.97); }

/* the pinned action */
.wb .wb-cta {
  position: sticky; bottom: 0; z-index: 3; display: flex; align-items: center; gap: .75rem; margin: auto -1rem 0; padding: .875rem 1rem 1rem;
  border-block-start: 1px solid var(--es-line); background: linear-gradient(0deg, var(--es-glass-2) 65%, color-mix(in oklab, var(--es-glass-2) 70%, transparent));
  -webkit-backdrop-filter: var(--es-blur); backdrop-filter: var(--es-blur);
}
.wb .wb-cta-text { flex: 1 1 auto; min-width: 0; display: grid; gap: .125rem; }
.wb .wb-cta .wb-tally { display: flex; align-items: baseline; gap: .375rem; }
.wb .wb-cta .wb-cases-no { font: 700 1.5rem/1 var(--wb-f-display); font-variant-numeric: tabular-nums; }
.wb .wb-cta .wb-cases-label { font-size: .75rem; color: var(--es-ink-3); }
.wb .wb-cta .wb-readiness { font-size: .75rem; margin: 0; }
.wb .wb-cta .wb-freeze { flex: 0 1 auto; inline-size: auto; max-inline-size: 62%; min-block-size: 3rem; padding: .3125rem .3125rem .3125rem 1.125rem; border-radius: 999px; font-size: .9375rem; font-weight: 700; gap: .625rem; }
.wb .wb-cta .wb-freeze-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb .wb-cta-text { min-inline-size: 6.5rem; }
.wb .wb-cta .wb-readiness { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb .wb-cta .wb-freeze[data-state="ready"] { animation: es-ready 2.8s ease-in-out infinite; }
.wb .wb-cta .wb-freeze[data-state="blocked"] { background: color-mix(in oklab, var(--es-ink) 8%, transparent); color: var(--es-ink-3); box-shadow: none; }
.wb .wb-cta .wb-freeze-icon { display: inline-grid; place-items: center; inline-size: 1.75rem; block-size: 1.75rem; border-radius: 50%; background: rgb(0 0 0 / .12); transition: transform .3s var(--es-ease); }
@media (hover: hover) and (pointer: fine) { .wb .wb-cta .wb-freeze:not(:disabled):hover .wb-freeze-icon { transform: translateX(3px); } }

/* ---------- 7 · run console: the computation theatre --------------------------------------------------------- */
[data-slot="studio-report"], [data-slot="run-console"] { scroll-margin-top: 5.25rem; }
.wb-run-console {
  scroll-margin-top: 5.25rem; position: relative; overflow: hidden; display: grid; gap: 1.25rem; padding: 1.5rem; margin-block: .5rem 1.25rem;
  border: 1px solid var(--es-line); border-radius: 1.25rem; background: var(--es-glass); box-shadow: var(--es-shadow);
  -webkit-backdrop-filter: var(--es-blur); backdrop-filter: var(--es-blur); animation: es-rise .6s var(--es-ease) both;
}
.wb-run-console::before {
  content: ""; position: absolute; inset: -40% -10% auto auto; inline-size: 34rem; block-size: 34rem; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, color-mix(in oklab, var(--es-signal) 18%, transparent), transparent 65%); opacity: .55; transition: opacity .6s ease;
}
.wb-run-console[data-status="working"]::before { opacity: 1; animation: es-breathe 3.2s ease-in-out infinite; }
.wb-run-console .wb-run-head { position: relative; display: flex; flex-wrap: wrap; align-items: baseline; gap: .375rem .875rem; }
.wb-run-console .wb-run-title { font: 650 1.625rem/1.15 var(--wb-f-display); }
.wb-run-console .wb-run-chip { border-radius: 999px; }
.wb-run-body { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.5rem 2rem; align-items: center; }
.wb-ring { position: relative; inline-size: 11rem; block-size: 11rem; }
.wb-ring svg { inline-size: 100%; block-size: 100%; transform: rotate(-90deg); overflow: visible; }
.wb-ring-track { fill: none; stroke: color-mix(in oklab, var(--es-ink) 9%, transparent); stroke-width: 9; }
.wb-ring-fill { fill: none; stroke: url(#wb-ring-grad); stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset .8s var(--es-ease); filter: drop-shadow(0 0 6px color-mix(in oklab, var(--es-signal) 55%, transparent)); }
.wb-ring-wave { fill: none; stroke: color-mix(in oklab, var(--es-signal) 55%, transparent); stroke-width: 1.5; opacity: 0; transform-origin: 50% 50%; }
.wb-run-console[data-status="working"] .wb-ring-wave { animation: es-ripple 2.4s ease-out infinite; }
.wb-run-console[data-status="working"] .wb-ring-wave:nth-of-type(2) { animation-delay: 1.2s; }
.wb-ring-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: .125rem; }
.wb-ring-pct { font: 700 2.375rem/1 var(--wb-f-display); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.wb-ring-pct small { font-size: 1rem; font-weight: 600; opacity: .6; }
.wb-ring-count { font: 500 .8125rem/1.2 var(--wb-f-num); color: var(--es-ink-3); font-variant-numeric: tabular-nums; }
.wb-run-side { min-width: 0; display: grid; gap: 1rem; }
.wb-run-eta { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; font: 500 .8125rem/1.3 var(--wb-f-num); color: var(--es-ink-3); font-variant-numeric: tabular-nums; }
.wb-run-eta b { color: var(--es-ink); font-weight: 650; }
.wb-run-console .wb-gauge { display: none; }
.wb-matrix { display: grid; grid-template-columns: minmax(6rem, 12rem) repeat(5, minmax(2rem, 1fr)); gap: .3125rem; align-items: center; min-width: 0; font-size: .75rem; }
.wb-matrix-head { color: var(--es-ink-3); font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-matrix-head i { display: inline-block; inline-size: .5rem; block-size: .5rem; border-radius: 50%; margin-inline-end: .3125rem; vertical-align: .05em; }
.wb-matrix-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--es-ink-2); font-weight: 600; }
.wb-matrix-label b { display: inline-grid; place-items: center; min-inline-size: 1.25rem; block-size: 1.25rem; margin-inline-end: .375rem; border-radius: .3125rem; background: var(--wb-group-color, var(--es-line-2)); color: #0b0f0c; font: 700 .6875rem/1 var(--wb-f-num); }
.wb-cell {
  position: relative; block-size: 1.625rem; border-radius: .4375rem; background: color-mix(in oklab, var(--es-ink) 6%, transparent);
  overflow: hidden; transition: background-color .45s ease, box-shadow .45s ease;
}
.wb-cell::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.wb-cell[data-state="running"]::after { background: linear-gradient(90deg, transparent, color-mix(in oklab, var(--es-signal) 45%, transparent), transparent); animation: es-scan 1.1s linear infinite; }
.wb-cell[data-state="done"] { background: color-mix(in oklab, var(--wb-cell, var(--es-signal)) 78%, transparent); box-shadow: 0 0 .75rem -.125rem color-mix(in oklab, var(--wb-cell, var(--es-signal)) 60%, transparent); animation: es-pop .5s var(--es-spring); }
.wb-cell[data-state="failed"] { background: color-mix(in oklab, var(--wb-scope-alert) 55%, transparent); }
.wb-cell[data-state="unreachable"] { background: repeating-linear-gradient(135deg, color-mix(in oklab, var(--wb-scope-warn) 45%, transparent) 0 4px, transparent 4px 8px); }
.wb-run-console .wb-run-actions { position: relative; display: flex; flex-wrap: wrap; gap: .5rem; }
.wb-run-console .wb-run-primary { min-block-size: 3rem; padding-inline: 1.25rem; font-weight: 700; }
.wb-run-console[data-stage="done"] .wb-run-primary { animation: es-ready 2.4s ease-in-out infinite; }
@container (max-width: 40rem) { .wb-run-body { grid-template-columns: minmax(0, 1fr); justify-items: center; } }
@media (max-width: 40rem) { .wb-run-body { grid-template-columns: minmax(0, 1fr); justify-items: center; } .wb-matrix { justify-self: stretch; } }

/* ---------- 8 · legacy analysis tools follow the room (the report module replaces them as the main view) ------ */
.ev .bx-advanced { border-radius: .875rem; }
.ev :is(.ea, .ev-analysis) :is(figure, .ea-figure, .ea-chart) { background: var(--es-glass) !important; border-radius: .875rem; }

/* ---------- 9 · narrow studios: map above, rail as normal flow, action pinned to the viewport ------------------ */
@container wb (max-width: 60rem) {
  .wb .wb-body { grid-template-columns: minmax(0, 1fr); block-size: auto; gap: .875rem; }
  .wb .wb-resizer { display: none; }
  .wb .wb-map-panel { min-block-size: 0; }
  .wb .wb-map-frame { flex: none; block-size: auto; aspect-ratio: var(--wb-aspect, 1.6); min-block-size: 17rem; max-block-size: 70dvh; }
  .wb .wb-map-frame > .wb-dock { max-inline-size: calc(100% - 4.5rem); }
  .wb .wb-rail { overflow: visible; max-block-size: none; }
  .wb .wb-nav { top: 0; }
  .wb .wb-cta { bottom: env(safe-area-inset-bottom, 0); margin-block-start: .5rem; border-radius: var(--es-radius) var(--es-radius) 0 0; }
  .wb[data-focus="true"] .wb-rail { display: flex; }
  .wb .wb-map-frame > .wb-dock { inset-block-end: 3rem; }
  /* a narrow map folds the switches into one labelled pill; opened, the dock shows switches, opacity and legend */
  .wb .wb-map-frame > .wb-dock[data-open="false"] { padding: 0; }
  .wb .wb-map-frame > .wb-dock[data-open="false"] .wb-layers { display: none; }
  .wb .wb-map-frame > .wb-dock[data-open="false"] > .wb-dock-toggle { block-size: 2.5rem; padding: 0 .875rem 0 .75rem; font: 600 .75rem/1 var(--wb-f-ui); }
  .wb .wb-map-frame > .wb-dock[data-open="false"] :is(.wb-dock-ico-narrow, .wb-dock-narrow-text) { display: inline-block; }
  .wb .wb-map-frame > .wb-dock[data-open="false"] .wb-dock-ico-wide { display: none; }
  .wb .wb-map-frame > .wb-point:not([data-state="idle"]) { inline-size: calc(100% - 1rem); }
  .wb .wb-map-frame > .wb-point[data-state="idle"] { display: none; }
}
/* phone-width studios: the group name takes its own row so start/end and "load map" keep readable labels */
@container wb (max-width: 34rem) {
  .wb .wb-scope-bar { flex-wrap: wrap; row-gap: .5rem; }
  .wb .wb-scope-bar .wb-current { flex: 1 1 100%; }
  .wb .wb-scope-bar .wb-ends { flex: 1 1 0; min-width: 0; }
  .wb .wb-scope-bar .wb-end { max-inline-size: none; }
  .wb .wb-end-label { white-space: nowrap; }
  .wb .wb-zoom { inset-block-start: .5rem; transform: none; }
  .wb .wb-map-meta .wb-map-keys { display: none; }
}

/* ---------- 10 · motion vocabulary -------------------------------------------------------------------------- */
@keyframes es-rise { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes es-slide { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
@keyframes es-drop { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes es-card { from { opacity: 0; transform: translate(-50%, 12px) scale(.96); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@keyframes es-pop { 0% { transform: scale(.6); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes es-spin { to { transform: rotate(360deg); } }
@keyframes es-beacon { 0% { box-shadow: 0 0 0 0 rgb(212 243 71 / .55); } 70%, 100% { box-shadow: 0 0 0 9px rgb(212 243 71 / 0); } }
@keyframes es-pulse { 0%, 100% { box-shadow: 0 .5rem 1.25rem -.5rem rgb(212 243 71 / .7), 0 0 0 0 rgb(212 243 71 / .45); } 50% { box-shadow: 0 .5rem 1.25rem -.5rem rgb(212 243 71 / .7), 0 0 0 7px rgb(212 243 71 / 0); } }
@keyframes es-ready { 0%, 100% { box-shadow: 0 .5rem 1.25rem -.5rem color-mix(in oklab, var(--es-signal) 70%, transparent), 0 0 0 0 var(--es-glow); } 50% { box-shadow: 0 .75rem 1.75rem -.5rem color-mix(in oklab, var(--es-signal) 80%, transparent), 0 0 0 8px transparent; } }
@keyframes es-breathe { 0%, 100% { transform: scale(1); opacity: .75; } 50% { transform: scale(1.08); opacity: 1; } }
@keyframes es-ripple { from { opacity: .8; transform: scale(.82); } to { opacity: 0; transform: scale(1.22); } }
@keyframes es-scan { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) {
  .ev *, .ev *::before, .ev *::after { animation: none !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
:root:is([data-motion="reduced"], [data-motion="static"], [data-noise-motion="reduced"], [data-noise-motion="static"]) .ev :is(*, *::before, *::after) { animation: none !important; transition-duration: .01ms !important; }

/* ---------- light theme: the map scope is a light sheet like the rest of the page -------------------------------
   (the user asked that no light page keep a dark block). The plan, the noise raster and the route colours inside the map
   are unchanged; the scope's own ink, rules and floating cards take light values, and signal-coloured words and icons
   take a readable green (the lime stays a fill) */
:root:not([data-theme="dark"]) :is(.wb, .wb-run-console):not([data-theme="dark"]) {
  --wb-scope: #f3f2ed; --wb-scope-2: #e9e8e2; --wb-scope-3: #dcdbd4; --wb-on-scope: #121412; --wb-on-scope-2: #4e524b;
  --wb-scope-rule: rgb(18 20 18 / .12); --wb-scope-signal: #4d7300; --wb-scope-alert: #b33a0c; --wb-scope-warn: #845200;
}
:root:not([data-theme="dark"]) .wb:not([data-theme="dark"]) .wb-map-panel { box-shadow: 0 1.5rem 3rem -2rem rgb(18 20 18 / .3), 0 0 0 1px rgb(18 20 18 / .1); }
:root:not([data-theme="dark"]) .wb:not([data-theme="dark"]) .wb-scope-bar { background: linear-gradient(180deg, rgb(18 20 18 / .03), transparent); }
:root:not([data-theme="dark"]) .wb:not([data-theme="dark"]) :is(.wb-ends, .wb-source-bar .wb-source-pick, .wb-manual .wb-input) { background-color: rgb(18 20 18 / .05); }
:root:not([data-theme="dark"]) .wb:not([data-theme="dark"]) .wb-end[aria-pressed="true"] { background: #c4ee2c; color: #121412; box-shadow: 0 .375rem 1rem -.375rem rgb(110 140 10 / .45); }
:root:not([data-theme="dark"]) .wb:not([data-theme="dark"]) .wb-current-no { background: var(--wb-group-color, #c4ee2c); }
:root:not([data-theme="dark"]) .wb:not([data-theme="dark"]) .wb-map-frame { background: radial-gradient(120% 90% at 50% 40%, #fbfaf6 0%, #e9e8e2 70%); }
:root:not([data-theme="dark"]) .wb:not([data-theme="dark"]) :is(.wb-guide, .wb-zoom, .wb-readout, .wb-map-frame > .wb-dock) { background: rgb(251 250 246 / .86); border-color: rgb(18 20 18 / .12); box-shadow: 0 .75rem 1.5rem -1rem rgb(18 20 18 / .3); }
:root:not([data-theme="dark"]) .wb:not([data-theme="dark"]) .wb-icon-button:not(:disabled):hover { background: rgb(18 20 18 / .06); }
:root:not([data-theme="dark"]) .wb:not([data-theme="dark"]) .wb-map-frame > .wb-point { border-color: rgb(18 20 18 / .14); border-inline-start-color: rgb(18 20 18 / .3); background: rgb(251 250 246 / .9); box-shadow: 0 1.25rem 2.5rem -1rem rgb(18 20 18 / .3); }
:root:not([data-theme="dark"]) .wb:not([data-theme="dark"]) .wb-map-frame > .wb-point[data-state="valid"] { border-inline-start-color: #8db31a; }
