/* Isophone Lab entrance. The page is one instrument: a laser-cut contour model of a sound field fills the window, and
   the research pipeline reads down the left as a two-column station table. One type scale (12 / 14 / 20), two rule
   weights (structure hairline, control edge), and fills only for the primary task and the concept tab.
   Paper and ink tokens match the route bench exactly so the departure veil hands over without a flash. */
:root {
  color-scheme: light;
  --paper: #ecebe6; --paper-hi: #f7f6f2; --paper-lo: #d9d8d1;
  --ink: #121412; --ink-2: #3d403a; --ink-3: #5f625b;
  --rule: rgb(18 20 18 / .13); --rule-2: rgb(18 20 18 / .3); --wash: rgb(18 20 18 / .065);
  --slab: #121412; --on-slab: #f7f6f2; --signal: #c4ee2c; --signal-ink: #121412; --alert: #c2410c;
  --f-display: "Bahnschrift", "DIN Alternate", "Roboto Condensed", "Arial Narrow", sans-serif;
  --f-ui: "Segoe UI Variable Text", "Segoe UI", Roboto, "Noto Sans", "Hiragino Sans", "Yu Gothic UI", "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  --f-num: "Cascadia Mono", "JetBrains Mono", "Roboto Mono", ui-monospace, Consolas, monospace;
  --ease: cubic-bezier(.2, .9, .25, 1); --out: cubic-bezier(.16, 1, .3, 1);
  --dep-ms: 1100ms;
  --col: 140px; --gut: 16px; --row: 40px; /* station column, gutter, task row */
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0d0e0d; --paper-hi: #171917; --paper-lo: #060706;
  --ink: #edece5; --ink-2: #c3c5bc; --ink-3: #9a9d94;
  --rule: rgb(237 236 229 / .12); --rule-2: rgb(237 236 229 / .28); --wash: rgb(237 236 229 / .07);
  --slab: #edece5; --on-slab: #0d0e0d; --signal: #d4f347; --alert: #ff7a2e;
}
@media (pointer: coarse) { :root { --row: 44px; } }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--paper); color: var(--ink); font: 400 var(--t2)/1.4 var(--f-ui); letter-spacing: 0; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, select, input { font: inherit; color: inherit; letter-spacing: 0; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.lab { position: fixed; inset: 0; }

/* ---------- the field ---------- */
.lab-stage { position: absolute; inset: 0; overflow: hidden; background: radial-gradient(52% 70% at 66% 50%, var(--paper-hi), var(--paper) 62%, var(--paper-lo)); }
/* paper under the directory (its right edge is --ix): the model and its routes stay clear of the table, then fade in */
.lab-stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; --ix: calc(32px + min(488px, 44vw)); transition: opacity 420ms var(--ease);
  background: linear-gradient(90deg, var(--paper) 0, var(--paper) calc(var(--ix) - 16px), color-mix(in oklab, var(--paper) 70%, transparent) calc(var(--ix) + 40px), transparent calc(var(--ix) + 160px)); }
.lab-gl, .lab-fallback { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.lab-gl { cursor: grab; touch-action: none; }
.lab-gl:active { cursor: grabbing; }
.lab-leaders, .lab-callouts { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.lab-leaders path { fill: none; stroke: var(--ink-2); stroke-width: 1; }
.lab-leaders circle { fill: var(--paper-hi); stroke: var(--ink); stroke-width: 1.25; }
/* callouts use the directory's label type: 12 px name, 12 px mono station number */
.co { position: absolute; left: 0; top: 0; white-space: nowrap; opacity: 0; transition: opacity 260ms var(--ease); will-change: transform; }
.co.on { opacity: 1; }
.co span { display: inline-flex; align-items: baseline; gap: 8px; padding: 4px 8px; font: 600 12px/1.25 var(--f-ui); color: var(--ink); background: var(--paper-hi); border: 1px solid var(--rule-2); border-radius: 2px; }
.co small { font: 500 12px/1 var(--f-num); color: var(--ink-3); }
.co.is-live span { background: var(--slab); color: var(--on-slab); border-color: var(--slab); }
.co.is-live small { color: var(--signal); }
/* a callout arrives along its leader: the line draws out from the anchor, the dot settles, then the label opens from
   the leader's side. Once per appearance; under reduced motion it is simply there (the rule below). */
.lab-leaders path.on { stroke-dasharray: 1; animation: lead-draw 380ms var(--out) both; }
.lab-leaders circle.on { transform-box: fill-box; transform-origin: center; animation: dot-in 320ms var(--out) both; }
/* the side follows the label (a variable, so a label that changes side does not replay its entrance) */
.co span { --co-from: inset(0 100% 0 0); --co-dx: -6px; }
.co[data-side="l"] span { --co-from: inset(0 0 0 100%); --co-dx: 6px; }
.co.on span { animation: co-open 420ms var(--out) 200ms both; }
@keyframes lead-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes dot-in { from { transform: scale(.3); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes co-open { from { clip-path: var(--co-from); transform: translateX(var(--co-dx)); } to { clip-path: inset(0); transform: none; } }

/* ---------- top bar ---------- */
.lab-top { position: absolute; z-index: 6; top: 0; left: 0; right: 0; height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 20px 0 32px; pointer-events: none; }
.lab-top > * { pointer-events: auto; }
.lab-gap { flex: 1; pointer-events: none !important; }
.lab-mark { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; transform-origin: left center; transition: transform 520ms var(--out); }
.lab-mark b { padding: 6px 9px 5px; font: 700 22px/1 var(--f-display); background: var(--slab); color: var(--on-slab); border-radius: 2px; }
.lab-mark span { font: 600 14px/1.2 var(--f-ui); color: var(--ink-2); transition: opacity 240ms var(--ease); }
.lab-ib { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; color: var(--ink); background: transparent; border: 1px solid var(--rule-2); border-radius: 3px; transition: opacity 260ms var(--ease), background 160ms var(--ease); }
.lab-ib:hover { background: var(--wash); }
.lab-ib[aria-expanded="true"] { background: var(--slab); color: var(--on-slab); border-color: var(--slab); }
.lab-ib-s { width: 32px; height: 32px; }
.lab-ib-s .i { width: 16px; height: 16px; }
@media (pointer: coarse) { .lab-ib-s { width: 44px; height: 44px; } }
.lab-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 10px; font: 600 12px/1 var(--f-ui); white-space: nowrap; color: var(--ink); background: transparent; border: 1px solid var(--rule-2); border-radius: 3px; }
.lab-btn:hover { background: var(--wash); }
.lab-btn[hidden] { display: none; }
.lab-btn .i { width: 16px; height: 16px; }
.lab-btn kbd { font: 500 12px/1 var(--f-num); padding: 2px 5px; border: 1px solid currentColor; border-radius: 2px; opacity: .7; }
@media (pointer: coarse) { .lab-btn { min-height: 44px; } }

/* ---------- the directory: lead, project field, station table, one key line ---------- */
.lab-index { position: absolute; z-index: 4; left: 32px; top: 80px; bottom: 16px; width: min(488px, 44vw); overflow: auto; overscroll-behavior: contain; padding: 0 12px 12px 0; scrollbar-width: thin; }
.lab-lead { margin: 0 0 16px; max-width: 30ch; font: 650 20px/1.3 var(--f-ui); text-wrap: balance; }
.lab-project { display: grid; grid-template-columns: var(--col) minmax(0, 1fr); column-gap: var(--gut); align-items: center; padding: 8px 0; border-top: 1px solid var(--rule-2); transition: opacity 260ms var(--ease); }
.lab-label { font: 12px/1.3 var(--f-ui); color: var(--ink-3); }
.lab-project select {
  appearance: none; width: 100%; min-height: var(--row); padding: 0 30px 0 10px; font: 600 14px/1.2 var(--f-ui); color: var(--ink); text-overflow: ellipsis; cursor: pointer;
  background: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%) no-repeat calc(100% - 17px) 52% / 5px 5px,
    linear-gradient(135deg, var(--ink-2) 50%, transparent 50%) no-repeat calc(100% - 12px) 52% / 5px 5px, transparent;
  border: 1px solid var(--rule-2); border-radius: 3px;
}
.lab-project select:hover { background-color: var(--wash); }
.lab-project select:disabled { cursor: default; color: var(--ink-3); }
.lab-project select option { color: var(--ink); background: var(--paper-hi); }
.lab-proj-note { margin: 0 0 8px calc(var(--col) + var(--gut)); font: 600 12px/1.4 var(--f-ui); color: var(--alert); }
.lab-stations { list-style: none; margin: 0; padding: 0; }
.st { position: relative; display: grid; grid-template-columns: var(--col) minmax(0, 1fr); column-gap: var(--gut); padding: 4px 0; border-top: 1px solid var(--rule); transition: opacity 300ms var(--ease); animation: st-in 640ms var(--out) both; animation-delay: calc(var(--i, 0) * 60ms + 60ms); }
.st:nth-child(1) { --i: 0; } .st:nth-child(2) { --i: 1; } .st:nth-child(3) { --i: 2; } .st:nth-child(4) { --i: 3; } .st:nth-child(5) { --i: 4; }
.st::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 2px; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform 420ms var(--out); }
.st.is-active::before { transform: scaleX(1); }
.st-head { display: flex; align-items: baseline; gap: 10px; min-width: 0; padding-top: calc((var(--row) - 18px) / 2); }
.st-n { flex: none; padding: 3px 4px; font: 500 12px/1 var(--f-num); color: var(--ink-3); border-radius: 2px; transition: background 220ms var(--ease), color 220ms var(--ease); }
.st.is-active .st-n { background: var(--signal); color: var(--signal-ink); }
.st-name { margin: 0; min-width: 0; font: 650 14px/1.3 var(--f-ui); }
.lab:not([data-station="home"]) .st:not(.is-active) { opacity: .6; }
@media (hover: none) { .st-head { cursor: pointer; } }
.st-tasks { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; min-width: 0; }
.task { position: relative; display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; column-gap: 10px; min-height: var(--row); margin-left: -8px; padding: 4px 8px; border-radius: 3px; color: var(--ink); text-decoration: none; font: 500 14px/1.3 var(--f-ui); transition: background 160ms var(--ease); }
.task .i { grid-column: 1; grid-row: 1 / span 2; color: var(--ink-3); }
.task-name { grid-column: 2; grid-row: 1; min-width: 0; }
.task-meta { grid-column: 2; grid-row: 2; font: 12px/1.3 var(--f-ui); color: var(--ink-3); }
.task-meta:empty { display: none; }
.task-note { grid-column: 2 / 4; grid-row: 3; font: 12px/1.35 var(--f-ui); color: var(--ink-3); }
a.task:hover, a.task:focus-visible { background: var(--wash); }
a.task:hover .i, a.task:focus-visible .i { color: var(--ink); }
/* every row that opens a room ends in the primary row's chevron; a current (legacy) page adds a small ring after its
   name, like a footnote mark, explained once by the key line. No href (packaged preview, Android only): no chevron. */
a.task[href]:not(.task-primary)::after { content: ""; grid-column: 3; grid-row: 1 / span 2; width: 6px; height: 6px; margin: 0 6px 0 4px; border: solid var(--ink-3); border-width: 1.75px 1.75px 0 0; border-radius: 1px; transform: rotate(45deg); transition: transform 200ms var(--out), border-color 160ms var(--ease); }
a.task[href]:not(.task-primary):hover::after, a.task[href]:not(.task-primary):focus-visible::after { border-color: var(--ink); transform: translateX(3px) rotate(45deg); }
a.task[data-kind="legacy"] .task-name::after, .lab-key .mk, .room-legacy .mk { content: ""; display: inline-block; width: 6px; height: 6px; border: 1.25px solid var(--ink-3); border-radius: 50%; }
a.task[data-kind="legacy"] .task-name::after { margin-left: 6px; vertical-align: .45em; }
a.task[aria-disabled="true"] { color: var(--ink-3); cursor: default; }
.task-off { cursor: default; color: var(--ink-2); }
/* fieldwork relay entries (relay.js): a directory row and a header button that open it on Home */
button.task-relay { width: calc(100% + 8px); text-align: start; background: transparent; border: 0; cursor: pointer; }
button.task-relay:hover, button.task-relay:focus-visible { background: var(--wash); }
button.task-relay:hover .i, button.task-relay:focus-visible .i { color: var(--ink); }
button.task-relay::after { content: ""; grid-column: 3; grid-row: 1 / span 2; width: 6px; height: 6px; margin: 0 6px 0 4px; border: solid var(--ink-3); border-width: 1.75px 1.75px 0 0; border-radius: 1px; transform: rotate(45deg); transition: transform 200ms var(--out), border-color 160ms var(--ease); }
button.task-relay:hover::after, button.task-relay:focus-visible::after { border-color: var(--ink); transform: translateX(3px) rotate(45deg); }
button.task-relay[aria-expanded="true"] { box-shadow: inset 3px 0 0 var(--signal); }
.lab-relay-cta { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px 0 10px; font: 600 var(--t1)/1.2 var(--f-ui); color: var(--ink); background: transparent; border: 1px solid var(--rule-2); border-radius: 3px; cursor: pointer; transition: opacity 260ms var(--ease), background 160ms var(--ease); }
.lab-relay-cta:hover { background: var(--wash); }
.lab-relay-cta[aria-expanded="true"] { color: var(--on-slab); background: var(--slab); border-color: var(--slab); }
.lab-relay-cta .i { flex: none; width: var(--ic); height: var(--ic); }
.lab[data-state="departing"] .lab-relay-cta { opacity: 0; pointer-events: none; }
.task-primary { margin: 2px 0 4px -8px; padding: 6px 8px; min-height: calc(var(--row) + 8px); background: var(--slab); color: var(--on-slab); font-weight: 650; }
.task-primary .i { color: var(--on-slab); }
.task-primary .go { grid-column: 3; grid-row: 1 / span 2; width: 16px; height: 16px; transition: transform 200ms var(--out); }
.task-primary .task-meta { color: color-mix(in oklab, var(--on-slab) 66%, transparent); font-weight: 400; }
.task-primary:hover, .task-primary:focus-visible { background: var(--slab) !important; box-shadow: inset 3px 0 0 var(--signal); }
a.task-primary:hover .i, a.task-primary:focus-visible .i { color: var(--on-slab); }
.task-primary:hover .go, .task-primary:focus-visible .go { transform: translateX(3px); }
.task-primary:focus-visible { outline-color: var(--signal); }
/* route key: the bench's colour and dash per cost model, aligned under the task names */
.st-key { padding: 2px 0 6px 28px; }
.route-key { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, max-content)); gap: 2px 18px; }
.route-key li { display: flex; align-items: center; gap: 8px; min-height: 22px; font: 12px/1.25 var(--f-ui); color: var(--ink-2); transition: opacity 160ms var(--ease); }
.route-key svg { width: 28px; height: 6px; flex: none; overflow: visible; }
.route-key.has-solo li:not(.is-solo) { opacity: .35; }
.route-key li.is-solo { color: var(--ink); font-weight: 600; }
@media (pointer: coarse) { .route-key li { min-height: 32px; } }
.lab-key { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 0 0 calc(var(--col) + var(--gut)); border-top: 1px solid var(--rule); font: 12px/1.35 var(--f-ui); color: var(--ink-3); }
.lab-key .mk { flex: none; display: inline-block; }
@keyframes st-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- concept plate: a short honest label on the field, details on request ---------- */
.lab-plate { position: absolute; z-index: 4; right: 24px; bottom: 20px; max-width: min(420px, calc(100% - 48px)); display: grid; justify-items: end; gap: 8px; }
.lab-plate-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px 10px; }
.lab-concept-tab { margin: 0; padding: 5px 8px; font: 600 12px/1 var(--f-ui); color: var(--on-slab); background: var(--slab); border-radius: 2px; }
.lab-concept-short { font: 12px/1.3 var(--f-ui); color: var(--ink-2); }
.lab-concept-warn { order: -1; margin: 0; font: 600 12px/1.4 var(--f-ui); color: var(--alert); }
.lab-help { order: -2; margin: 0; max-width: 340px; padding: 10px 12px; font: 12px/1.5 var(--f-ui); color: var(--ink-2); background: var(--paper-hi); border: 1px solid var(--rule-2); border-radius: 3px; box-shadow: 0 12px 32px rgb(0 0 0 / .12); animation: pop 220ms var(--out); }
.lab-help[hidden], .lab-concept-warn[hidden] { display: none; }

/* ---------- display settings ---------- */
.lab-display { position: absolute; z-index: 8; top: 60px; right: 20px; width: 340px; max-height: calc(100% - 80px); overflow: auto; padding: 12px 16px 16px; background: var(--paper-hi); border: 1px solid var(--rule-2); border-radius: 4px; box-shadow: 0 18px 50px rgb(0 0 0 / .2); animation: pop 240ms var(--out); }
.lab-display[hidden] { display: none; }
.lab-display-head { display: flex; align-items: center; justify-content: space-between; }
.lab-display h2 { margin: 0; font: 650 14px var(--f-ui); }
.lab-seg { margin: 12px 0 0; padding: 0; border: 0; min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lab-seg legend { padding: 0; margin-bottom: 6px; font: 12px var(--f-ui); color: var(--ink-3); }
.lab-seg label { position: relative; min-width: 0; }
.lab-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.lab-seg span { display: grid; place-items: center; min-height: 40px; padding: 0 6px; font: 600 12px/1.1 var(--f-ui); white-space: nowrap; border: 1px solid var(--rule-2); cursor: pointer; }
.lab-seg label + label span { border-left: 0; }
.lab-seg label:first-of-type span { border-radius: 3px 0 0 3px; }
.lab-seg label:last-of-type span { border-radius: 0 3px 3px 0; }
.lab-seg input:checked + span { background: var(--slab); color: var(--on-slab); border-color: var(--slab); }
.lab-seg input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (pointer: coarse) { .lab-seg span { min-height: 44px; } }
@keyframes pop { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- departure: the field flattens into the plan, the directory steps aside, paper closes over ---------- */
.lab-depart { position: absolute; inset: 0; z-index: 20; pointer-events: none; }
.lab-depart[hidden] { display: none; }
.dep-veil { position: absolute; inset: 0; background: var(--paper); opacity: 0; transition: opacity 280ms var(--ease); }
.dep-pill { position: absolute; left: 50%; bottom: 36px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 16px; min-width: 320px; max-width: calc(100% - 32px); padding: 12px 12px 14px 16px; overflow: hidden; color: var(--on-slab); background: var(--slab); border-radius: 4px; box-shadow: 0 18px 44px rgb(0 0 0 / .26); pointer-events: auto; opacity: 0; transform: translate(-50%, 14px); transition: opacity 200ms var(--ease), transform 340ms var(--out); }
.dep-text { font: 650 14px/1.3 var(--f-ui); }
.dep-note { grid-column: 1; font: 12px/1.35 var(--f-ui); opacity: .72; }
.dep-note:empty { display: none; }
.dep-pill .lab-btn { grid-column: 2; grid-row: 1 / span 2; min-height: 40px; color: var(--on-slab); background: transparent; border-color: color-mix(in oklab, var(--on-slab) 40%, transparent); }
.dep-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--signal); transform: scaleX(0); transform-origin: left; transition: transform 200ms var(--ease); }
.lab[data-state="departing"] .dep-pill { opacity: 1; transform: translate(-50%, 0); }
.lab[data-state="departing"] .dep-bar { transform: scaleX(1); transition: transform var(--dep-ms) linear; }
.lab[data-state="departing"] .dep-veil { opacity: 1; transition: opacity 380ms var(--ease) calc(var(--dep-ms) - 440ms); }
.lab[data-state="departing"] .lab-index { opacity: 0; transform: translateX(-32px); pointer-events: none; }
.lab[data-state="departing"] .lab-plate, .lab[data-state="departing"] .lab-ib { opacity: 0; pointer-events: none; }
.lab[data-state="departing"] .lab-plate { transform: translateY(14px); }
.lab[data-state="departing"] .lab-mark { transform: translate(-18px, -10px) scale(.66); }
.lab[data-state="departing"] .lab-mark span { opacity: 0; }
.lab[data-state="departing"] :is(.co, .lab-tag) { opacity: 0; }

/* ---------- rooms: the hosted page fills a port that opens from the task's point on the model ----------
   travel: the directory, plate and top bar step aside, the camera dives toward the station, the rail drops in and the
   pill reports the load; the port then opens as a wavefront. room: the field rests behind the rail.
   return: the port closes back into its point while the directory comes home. */
.lab-top, .lab-plate, .lab-index { transition: opacity 380ms var(--ease), transform 520ms var(--out), visibility 0s; }
.lab[data-state="travel"] :is(.lab-top, .lab-plate, .lab-index), .lab[data-state="room"] :is(.lab-top, .lab-plate, .lab-index) {
  opacity: 0; pointer-events: none; visibility: hidden; transition: opacity 320ms var(--ease), transform 520ms var(--out), visibility 0s 520ms;
}
.lab[data-state="travel"] .lab-index, .lab[data-state="room"] .lab-index { transform: translateX(-32px); }
.lab[data-state="travel"] .lab-plate, .lab[data-state="room"] .lab-plate { transform: translateY(14px); }
.lab[data-state="travel"] .dep-pill { opacity: 1; transform: translate(-50%, 0); }
/* the load has no known length, so the bar sweeps instead of pretending to fill */
.lab[data-state="travel"] .dep-bar { transform: scaleX(.28); transition: none; animation: dep-sweep 1200ms var(--ease) infinite; }
@keyframes dep-sweep { from { translate: -30% 0; } to { translate: 100% 0; } }

.lab-room { position: absolute; inset: 0; z-index: 12; display: grid; grid-template-rows: auto minmax(0, 1fr); pointer-events: none; --rail: max(48px, calc(var(--row) + .5rem)); }
.lab-room[hidden] { display: none; }
.room-port { position: relative; grid-row: 2; min-width: 0; min-height: 0; background: var(--paper); clip-path: circle(0 at 50% 50%); pointer-events: auto; }
.lab[data-state="return"] .room-port { pointer-events: none; }
.room-frame { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border: 0; background: transparent; }
.room-frame[hidden] { display: none; }
.room-wait { position: absolute; left: 50%; top: 38%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; margin: 0; font: 12px/1.3 var(--f-ui); color: var(--ink-3); white-space: nowrap; }
.room-wait i { width: 10px; height: 10px; border: 1.25px solid var(--alert); border-radius: 50%; animation: room-ping 1400ms var(--ease) infinite; }
.room-port[data-loaded="true"] .room-wait { display: none; }
/* Once a page is in, the port is a tinted glass in the page's tone rather than paper: a hosted page whose ground is
   vellum (host.css) lets the model show through, dimmed enough that the page's own text keeps its contrast. */
.room-port[data-loaded="true"] { background: color-mix(in oklab, var(--paper) 30%, transparent); transition: background-color 240ms var(--ease); }
.lab-room[data-tone="light"] .room-port[data-loaded="true"] { background: rgb(236 235 230 / .3); }
.lab-room[data-tone="dark"] .room-port[data-loaded="true"] { background: rgb(13 14 13 / .3); }
/* the directory's paper scrim leaves with the directory, so the whole model is behind the room */
.lab:is([data-state="travel"], [data-state="room"]) .lab-stage::after { opacity: 0; }
@keyframes room-ping { 0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--alert) 40%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }
.room-blocked { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 24px; text-align: center; font: 14px/1.4 var(--f-ui); background: var(--paper); }
.room-blocked[hidden] { display: none; }
.room-blocked p { margin: 0; max-width: 36ch; }
/* the wavefront: the leading ring in the hot level colour, two hairline levels trailing it */
.room-wave { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.room-wave circle { fill: none; stroke: var(--ink-2); stroke-width: 1; opacity: 0; }
.room-wave circle:first-child { stroke: var(--alert); stroke-width: 1.5; }

/* the rail: a strip of paper over the field, edged with the plan's ruler ticks */
.room-rail { position: relative; grid-row: 1; min-height: var(--rail); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 6px 12px 6px 16px; pointer-events: auto; color: var(--ink);
  background-color: color-mix(in oklab, var(--paper) 84%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule-2); transform: translateY(-100%); transition: transform 420ms var(--out), background-color 240ms var(--ease), color 240ms var(--ease); }
.room-rail::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; pointer-events: none;
  background: repeating-linear-gradient(90deg, var(--rule-2) 0 1px, transparent 1px 40px) left bottom / 100% 6px no-repeat,
    repeating-linear-gradient(90deg, var(--rule) 0 1px, transparent 1px 8px) left bottom / 100% 3px no-repeat; }
.lab[data-state="travel"] .room-rail, .lab[data-state="room"] .room-rail { transform: none; }
/* Home: the one filled control on the rail, a signal pill with the house mark and its word, so it never reads as the
   outlined Classic switch beside it */
.room-back { flex: none; display: inline-flex; align-items: center; gap: .5rem; min-height: calc(var(--rail) - 12px); padding: 0 .875rem 0 .625rem; font: 650 var(--t2)/1 var(--f-ui); white-space: nowrap; color: var(--signal-ink); background: var(--signal); border: 0; border-radius: 999px; box-shadow: inset 0 0 0 1px rgb(18 20 18 / .14); transition: box-shadow 160ms var(--ease); }
.room-back:hover { box-shadow: inset 0 0 0 1px rgb(18 20 18 / .2), 0 0 0 3px color-mix(in oklab, var(--signal) 38%, transparent); }
.room-back:focus-visible { outline-color: var(--ink); }
.room-back .i { width: var(--ic); height: var(--ic); stroke-width: 2; }
.room-id { display: flex; flex: 1 1 14rem; align-items: center; gap: 10px; min-width: 0; }
/* the pipeline ruler: the directory's five station numbers, this room's lit in signal; it replaces the lone number */
.room-id > .st-n { display: none; }
.room-pipe { flex: none; display: flex; align-items: center; height: 20px; border: 1px solid var(--rule-2); border-radius: 2px; }
.room-pipe i { display: grid; place-items: center; min-width: 24px; height: 100%; padding: 0 3px; font: 600 12px/1 var(--f-num); font-style: normal; color: var(--ink-3); }
.room-pipe i + i { border-left: 1px solid var(--rule); }
.room-pipe i.is-on { background: var(--signal); color: var(--signal-ink); }
.room-name { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 650 14px/1.2 var(--f-ui); }
.room-name:focus { outline: none; } /* a programmatic landing point for the room, not a control */
.room-legacy { display: inline-flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; font: 12px/1.3 var(--f-ui); color: var(--ink-3); white-space: nowrap; }
.room-legacy[hidden] { display: none; }
.room-legacy > span { overflow: hidden; text-overflow: ellipsis; }
.room-legacy .mk { flex: none; }
.room-rail .lab-ib { flex: none; width: calc(var(--rail) - 12px); height: calc(var(--rail) - 12px); }
.room-rail .lab-ib .i { width: var(--ic); height: var(--ic); }
.room-rail .room-task-switch { flex: none; min-height: 44px; }
@media (pointer: coarse) { .room-rail .lab-ib { width: max(44px, calc(var(--rail) - 12px)); height: max(44px, calc(var(--rail) - 12px)); } .room-back { min-height: 44px; } }

/* the rail and its sheets meet the hosted page's own tone (read by host.js), whatever the lab's theme */
.lab-room[data-tone="light"] :is(.room-rail, .room-switch, .room-lang) { color-scheme: light; color: var(--ink);
  --paper: #ecebe6; --paper-hi: #f7f6f2; --ink: #121412; --ink-2: #3d403a; --ink-3: #5f625b;
  --rule: rgb(18 20 18 / .13); --rule-2: rgb(18 20 18 / .3); --wash: rgb(18 20 18 / .065); --slab: #121412; --on-slab: #f7f6f2; --signal: #c4ee2c; --alert: #c2410c; }
.lab-room[data-tone="dark"] :is(.room-rail, .room-switch, .room-lang) { color-scheme: dark; color: var(--ink);
  --paper: #0d0e0d; --paper-hi: #171917; --ink: #edece5; --ink-2: #c3c5bc; --ink-3: #9a9d94;
  --rule: rgb(237 236 229 / .12); --rule-2: rgb(237 236 229 / .28); --wash: rgb(237 236 229 / .07); --slab: #edece5; --on-slab: #0d0e0d; --signal: #d4f347; --alert: #ff7a2e; }

/* a current page in another language: one quiet offer per visit on the page's lower edge, never automatic */
.room-lang { position: absolute; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); translate: -50% 0; width: max-content; max-width: calc(100% - 24px); display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; pointer-events: auto;
  background: var(--paper-hi); border: 1px solid var(--rule-2); border-radius: 4px; box-shadow: 0 14px 40px rgb(0 0 0 / .2); font: 12px/1.35 var(--f-ui); animation: pop 220ms var(--out); }
.room-lang[hidden] { display: none; }
.room-lang p { margin: 0 6px 0 0; min-width: 0; }
.room-lang small { display: block; font-size: 12px; color: var(--ink-3); }
.room-lang button { flex: none; height: 32px; padding: 0 12px; border: 1px solid var(--rule-2); border-radius: 3px; background: transparent; font-weight: 600; transition: background 160ms var(--ease); }
.room-lang button:hover { background: var(--wash); }
.room-lang .room-lang-go, .room-lang .room-lang-go:hover { background: var(--slab); color: var(--on-slab); border-color: var(--slab); }
@media (pointer: coarse) { .room-lang button { height: 44px; } }
/* Wide desktop: the offer joins the rail, the room's own surface, instead of covering the page's lower edge. Its
   sentence already names the page as a current (legacy) page, so the rail's legacy label steps back meanwhile. */
@media (min-width: 1240px) {
  .lab:not(.lab-phone) .room-lang { top: calc((var(--rail) - 36px) / 2); right: 108px; bottom: auto; left: auto; translate: none; height: 36px; max-width: calc(100% - 600px); padding: 0 2px 0 12px; white-space: nowrap; background: transparent; border-color: var(--rule); box-shadow: none; }
  .lab:not(.lab-phone) .room-lang p { overflow: hidden; text-overflow: ellipsis; }
  .lab:not(.lab-phone) .room-lang small { display: inline; margin-left: 6px; }
  .lab:not(.lab-phone) .room-lang button { height: 30px; }
  .lab:not(.lab-phone) .lab-room:has(.room-lang:not([hidden])) .room-legacy > span { display: none; }
}

/* the switcher is the station table, compact: numbers in a narrow column, the current room marked */
.room-switch { position: absolute; grid-row: 2; top: 6px; right: 12px; width: min(380px, calc(100% - 24px)); max-height: calc(100% - 12px); overflow: auto; overscroll-behavior: contain; padding: 4px 12px 8px; pointer-events: auto; background: var(--paper-hi); border: 1px solid var(--rule-2); border-radius: 4px; box-shadow: 0 18px 50px rgb(0 0 0 / .2); animation: pop 220ms var(--out); }
.room-switch[hidden] { display: none; }
.room-switch .st { grid-template-columns: 28px minmax(0, 1fr); column-gap: 8px; opacity: 1 !important; animation: none; }
.room-switch .st::before { display: none; }
.room-switch .st-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.room-switch .st:first-child { border-top: 0; }
.room-switch a[aria-current] { background: var(--wash); box-shadow: inset 2px 0 0 var(--alert); }
.room-switch .task-primary[aria-current] { background: var(--slab); box-shadow: inset 3px 0 0 var(--signal); }

/* Let the room follow the actual wrapped header instead of a desktop-only height. */
@media (max-width: 52rem) {
  .room-rail { gap: 8px; padding: 8px 12px; }
  .room-back { min-height: 44px; }
  .room-id { flex: 1 1 11rem; min-width: min(100%, 11rem); }
  .room-name { white-space: normal; overflow-wrap: anywhere; }
  .room-pipe, .room-rail > .lab-gap { display: none; }
  .room-legacy { order: 1; flex-basis: 100%; white-space: normal; }
  .room-rail .room-mode { order: 1; flex: 1 1 9rem; max-width: 100%; min-width: 0; min-height: 44px; }
  .room-rail .lab-ib { order: 2; width: 44px; height: 44px; }
  .room-rail .lab-ib .i { width: min(var(--ic), 32px); height: min(var(--ic), 32px); }
  .room-rail .room-task-switch { order: 2; }
}

/* ---------- reduced motion: no choreography, state changes are immediate ---------- */
:root[data-motion="reduced"] *, :root[data-motion="reduced"] *::before, :root[data-motion="reduced"] *::after { animation: none !important; transition-duration: 0ms !important; transition-delay: 0ms !important; }
:root[data-motion="reduced"] .lab[data-state="travel"] .dep-bar { transform: scaleX(1); opacity: .5; }

/* ---------- narrow desktop windows: field on top, table below, concept label on the field's lower edge ---------- */
@media (max-width: 860px) {
  :root { --col: 132px; }
  .lab-stage { bottom: auto; height: 46vh; }
  .lab-stage::after { background: linear-gradient(0deg, var(--paper) 0, transparent 26%); }
  .lab-top { height: 56px; padding: 0 12px 0 20px; }
  .lab-mark b { font-size: 20px; }
  .lab-mark span { display: none; }
  .lab-index { left: 0; right: 0; top: 46vh; width: auto; padding: 8px 20px 24px; }
  .lab-lead { font-size: 18px; margin-bottom: 12px; }
  .lab-plate { left: 20px; right: auto; bottom: calc(54vh + 12px); justify-items: start; }
  .lab-plate-row { justify-content: flex-start; }
}

/* A phone-width window on the desktop page: the top bar keeps every control on screen (the fieldwork button keeps
   its icon, Display its 44 px, the interface picker gives way) and the stations read as on the phone page: slim
   headings over full-width task rows, so labels never stand one character to a line. */
@media (max-width: 560px) {
  .lab-top { gap: 8px; padding: 0 10px 0 16px; }
  .lab-top > .lab-ib { flex: 0 0 44px; }
  .lab-relay-cta { flex: 0 0 auto; }
  .lab-relay-cta > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .lab-top .lab-classic { flex: 0 1 auto; min-width: 0; max-width: 9.5rem; }
  .lab-index { padding: 8px 16px 24px; }
  .lab-project { grid-template-columns: max-content minmax(0, 1fr); column-gap: 12px; }
  .st { grid-template-columns: minmax(0, 1fr); padding: 0 0 4px; }
  .st-head { padding: 10px 0 4px; min-height: 36px; align-items: center; }
  .st-key { padding: 0 0 4px 28px; }
}

/* Reader-selected type sizes on one rem hierarchy (the browser's own text size is the base, so 1rem is the reader's,
   not ours). Layout responds to the viewport; text does not: a wide screen gets wider measure and roomier rows, and
   the Large preference is the way to bigger type. */
html { font-size: 100%; }
:root { --t1: .8125rem; --t2: .9375rem; --t3: 1.375rem; --t4: 1.5rem; --ic: 1.125rem; --dir-w: 31rem; }
:root[data-scale="1"] { --t1: .875rem; --t2: 1rem; --t3: 1.625rem; --t4: 1.625rem; --ic: 1.25rem; --col: 10rem; --row: 2.75rem; --dir-w: 36rem; }
:root[data-scale="2"] { --t1: .9375rem; --t2: 1.0625rem; --t3: 1.75rem; --t4: 1.75rem; --ic: 1.3125rem; --col: 11.25rem; --gut: 1.25rem; --row: 3.125rem; --dir-w: 41.25rem; }
:root[data-scale="3"] { --t1: 1.0625rem; --t2: 1.1875rem; --t3: 2rem; --t4: 2rem; --ic: 1.4375rem; --col: 12.75rem; --gut: 1.5rem; --row: 3.5rem; --dir-w: 47.5rem; }
:is(.co span, .co small, .lab-label, .lab-proj-note, .st-n, .task-meta, .task-note, .route-key li, .lab-key, .lab-concept-tab, .lab-concept-short, .lab-concept-warn, .lab-help, .lab-btn, .lab-btn kbd, .lab-seg legend, .lab-seg span, .dep-note,
  .room-wait, .room-legacy, .room-pipe i, .room-lang, .room-lang small) { font-size: var(--t1); }
:is(.lab-mark span, .lab-project select, .st-name, .task, .lab-display h2, .dep-text, .room-name, .room-blocked) { font-size: var(--t2); }
/* wide screens: the table keeps its measure but gains air, and the room's rail and switcher grow with the rows */
@media (min-width: 2200px) {
  .room-switch { width: min(30rem, calc(100% - 24px)); }
  .lab-help { max-width: 30rem; }
}
.lab-lead { font-size: var(--t3); }
.lab-mark b { font-size: var(--t4); }
.task .i { width: var(--ic); height: var(--ic); }
:is(.lab-btn, .lab-ib-s) .i { width: calc(var(--ic) - 2px); height: calc(var(--ic) - 2px); }
.task { grid-template-columns: var(--ic) minmax(0, 1fr) auto; }
.st-head { padding-top: calc((var(--row) - var(--t2) * 1.3) / 2); }
.st-key { padding-left: calc(var(--ic) + 10px); }
.lab-index { width: min(var(--dir-w), 44vw); }
.lab-stage::after { --ix: calc(32px + min(var(--dir-w), 44vw)); }
.lab-plate { max-width: min(calc(var(--dir-w) * .9), calc(100% - 48px)); }
.lab-display { width: max(340px, calc(var(--dir-w) * .66)); }
:root:not([data-scale="0"]) .lab:not(.lab-phone) .lab-top { height: calc(var(--row) + 24px); }
@media (min-width: 861px) {
  :root:not([data-scale="0"]) .lab:not(.lab-phone) .lab-index { top: calc(var(--row) + 40px); }
}
@media (max-width: 860px) { .lab-index { width: auto; } }

/* ---------- Classic UI: a plain way back to the current interface, marked with the legacy pages' ring ---------- */
.lab-top .lab-classic { min-height: 44px; padding: 0 10px 0 12px; gap: 8px; color: var(--ink-2); transition: opacity 260ms var(--ease), background 160ms var(--ease); }
.lab-top .lab-classic:hover { color: var(--ink); }
.lab-classic .mk { flex: none; width: 6px; height: 6px; border: 1.25px solid currentColor; border-radius: 50%; }
.lab[data-state="departing"] .lab-classic { opacity: 0; pointer-events: none; }
.room-rail .room-classic { flex: none; min-height: calc(var(--rail) - 12px); padding: 0 10px; color: var(--ink-2); }
.room-rail .room-classic:hover { color: var(--ink); }
@media (max-width: 1100px) { .room-rail .room-classic { width: calc(var(--rail) - 12px); padding: 0; justify-content: center; } .room-rail .room-classic span { display: none; } }
@media (pointer: coarse) { .room-rail .room-classic { min-height: 44px; } }

/* ---------- saved snapshot: a recorded field, labelled by its provenance and set apart from the concept slab ---------- */
.lab-concept-tab { display: inline-flex; align-items: center; gap: 6px; }
.lab-concept-tab .i { display: none; width: 14px; height: 14px; }
.lab-plate[data-mode="saved"] .lab-concept-tab { color: var(--ink); background: var(--paper-hi); box-shadow: inset 0 0 0 1.5px var(--ink); }
.lab-plate[data-mode="saved"] .lab-concept-tab .i { display: block; }
.lab-view { display: inline-flex; margin: 0; padding: 0; border: 0; min-width: 0; }
.lab-view[hidden] { display: none; }
.lab-view label { position: relative; }
.lab-view input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.lab-view span { display: grid; place-items: center; min-height: 28px; padding: 0 10px; font: 600 var(--t1)/1 var(--f-ui); color: var(--ink-2); border: 1px solid var(--rule-2); cursor: pointer; transition: background 160ms var(--ease); }
.lab-view label + label span { border-left: 0; }
.lab-view label:first-of-type span { border-radius: 3px 0 0 3px; }
.lab-view label:last-of-type span { border-radius: 0 3px 3px 0; }
.lab-view span:hover { background: var(--wash); }
.lab-view input:checked + span { color: var(--on-slab); background: var(--slab); border-color: var(--slab); }
.lab-view input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (pointer: coarse) { .lab-view span { min-height: 44px; } }
/* the provenance label: an instrument plate with a ruler-tick top edge */
.lab-prov { order: -1; margin: 0; display: grid; grid-template-columns: max-content minmax(0, max-content); gap: 3px 14px; max-width: 100%; padding: 10px 12px 9px;
  background: color-mix(in oklab, var(--paper-hi) 90%, transparent) repeating-linear-gradient(90deg, var(--rule-2) 0 1px, transparent 1px 8px) left top / 100% 4px no-repeat;
  border: 1px solid var(--rule-2); border-radius: 3px; font: var(--t1)/1.35 var(--f-ui); animation: pop 240ms var(--out); }
.lab-prov[hidden] { display: none; }
.lab-prov div { display: contents; }
.lab-prov dt { color: var(--ink-3); }
.lab-prov dd { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-weight: 600; }
.lab-prov dd.is-id { font: 500 var(--t1)/1.35 var(--f-num); }
/* the version line: which saved heatmap is shown and when it was saved, under the identity line and as compact */
.lab-ver { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; margin: 0; font: var(--t1)/1.25 var(--f-ui); }
.lab-ver[hidden], .lab-ver [hidden] { display: none; }
.lab-ver-k { flex: none; color: var(--ink-3); }
.lab-ver-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--ink); }
.lab-ver select { min-width: 0; max-width: min(24rem, 100%); min-height: 28px; padding: 0 28px 0 10px; appearance: none; font: 600 var(--t1)/1.2 var(--f-ui); color: var(--ink); text-overflow: ellipsis; cursor: pointer;
  background-color: var(--paper-hi); border: 1px solid var(--rule-2); border-radius: 3px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: right 15px top 50%, right 10px top 50%; background-size: 5px 5px; background-repeat: no-repeat; transition: border-color 160ms var(--ease); }
.lab-ver select:hover { border-color: var(--ink-2); }
.lab-ver select:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (pointer: coarse) { .lab-ver select { min-height: 44px; } }
/* a chosen version on its way in: the shown field and its line stay until it arrives */
.lab-plate[data-busy="yes"] :is(.lab-ver select, .lab-ver-name) { cursor: progress; animation: ver-wait 900ms var(--ease) infinite alternate; }
@keyframes ver-wait { to { opacity: .5; } }
/* campus orientation: each approximate building carries a quiet name on a dotted pin from its roof. Ink, not signal;
   a hairline rule, not a box, so the names read as annotation of the massing rather than as more controls. */
.lab-leaders path.pin { stroke: var(--ink-3); stroke-dasharray: 1.5 2.5; }
.lab-tag { position: absolute; left: 0; top: 0; white-space: nowrap; opacity: 0; transition: opacity 260ms var(--ease); will-change: transform; }
.lab-tag.on { opacity: 1; }
.lab-tag span { display: block; padding: 2px 6px 2px 5px; font: 500 var(--t1)/1.25 var(--f-ui); color: var(--ink-2); background: color-mix(in oklab, var(--paper-hi) 76%, transparent); border-left: 1.5px solid var(--ink-2); border-radius: 0 2px 2px 0; }
/* the probe: the saved value under the pointer */
.lab-probe { position: absolute; left: 0; top: 0; z-index: 3; display: flex; align-items: baseline; gap: 6px; padding: 5px 9px; pointer-events: none; white-space: nowrap; color: var(--on-slab); background: var(--slab); border-radius: 2px; font: 600 var(--t1)/1.2 var(--f-ui); box-shadow: 0 8px 22px rgb(0 0 0 / .18); }
.lab-probe[hidden] { display: none; }
.lab-probe b { font: 600 var(--t2)/1 var(--f-num); }
.lab-probe small { font-size: var(--t1); font-weight: 400; opacity: .72; }
.route-key li.is-absent { opacity: .38; }
.route-key li.is-absent svg line { stroke-dasharray: 1 4; }
@media (min-width: 1101px) {
  .lab:not(.lab-phone) .room-lang { right: 300px; max-width: max(220px, calc(100% - 900px)); }
}

/* ---------- task environments: each room has its own light behind the hosted page ----------
   Under the port (so above the model's task pose, below the page) a room lays one accent glow and one quiet mark in the
   hosted page's tone: survey dots for projects, a registration grid for alignment, hatching for access, stake ticks
   for measurement, rings from a corner for the heat map, lanes for the route bench, rings from the centre for the
   simulation. It shows through the page's vellum margins (host.css) and is never drawn over the page, its maps or
   their colours. The rail carries the same accent in its lit station number and a line along its lower edge, so the
   room reads at a glance after travel. The environment rises with the room and falls with Home; enter, task to task
   and return stay one continuous space. */
.lab-room { --env-a: var(--signal); --env-at: 50% 50%; --env-ink: var(--rule); --env-motif: none; --env-glow: 26%; }
.lab-room[data-tone="light"] { --env-ink: rgb(18 20 18 / .11); --env-glow: 30%; }
.lab-room[data-tone="dark"] { --env-ink: rgb(237 236 229 / .09); --env-glow: 24%; }
.lab-room[data-task="projects"] { --env-a: #a3e635; --env-at: 16% 18%; --env-motif: radial-gradient(circle, var(--env-ink) 1.25px, transparent 1.75px) 0 0 / 24px 24px; }
.lab-room[data-task="geo"] { --env-a: #2bd4f0; --env-at: 84% 20%; --env-motif: linear-gradient(var(--env-ink) 1px, transparent 1px) 0 0 / 64px 64px, linear-gradient(90deg, var(--env-ink) 1px, transparent 1px) 0 0 / 64px 64px; }
.lab-room[data-task="access"] { --env-a: #fbbf24; --env-at: 18% 82%; --env-motif: repeating-linear-gradient(45deg, var(--env-ink) 0 1px, transparent 1px 16px); }
.lab-room[data-task="measure"] { --env-a: #6ee7b7; --env-at: 50% 100%; --env-motif: conic-gradient(from 270deg at 1px 12px, var(--env-ink) 0 90deg, transparent 0) 0 0 / 40px 40px; }
.lab-room[data-task="heat"] { --env-a: #ff6a2b; --env-at: 92% 88%; --env-motif: repeating-radial-gradient(circle at 100% 100%, transparent 0 55px, var(--env-ink) 55px 56px); }
.lab-room[data-task="bench"] { --env-a: #38bdf8; --env-at: 50% 0%; --env-motif: repeating-linear-gradient(0deg, var(--env-ink) 0 1px, transparent 1px 48px); }
.lab-room[data-task="sim"] { --env-a: #d4f347; --env-at: 50% 50%; --env-motif: repeating-radial-gradient(circle at 50% 50%, transparent 0 71px, var(--env-ink) 71px 72px); }
.lab-room::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 640ms var(--ease);
  background: radial-gradient(64% 76% at var(--env-at), color-mix(in oklab, var(--env-a) var(--env-glow), transparent), transparent 72%), var(--env-motif); }
.lab[data-state="travel"] .lab-room::before { opacity: .55; }
.lab[data-state="room"] .lab-room::before { opacity: 1; }
.lab[data-state="return"] .lab-room::before { opacity: 0; transition-duration: 360ms; }
.room-pipe i.is-on { background: var(--env-a); color: #121412; }
.room-rail::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; pointer-events: none;
  background: linear-gradient(90deg, var(--env-a), color-mix(in oklab, var(--env-a) 40%, transparent) 46%, transparent 78%); }
.lab-display .lab-display-more { display: flex; align-items: center; justify-content: flex-start; gap: .625rem; width: 100%; min-height: 2.75rem; margin-top: .75rem; padding: .625rem .75rem; font: 600 .875rem/1.4 var(--f-ui); }
/* Station names keep their accessible full text without changing the room rail's
   geometry whenever the next workspace has a longer translated title. */
.room-rail .room-name { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }

/* Colour scale of the field shown (2026-11-14): the same ramp as the scene (quiet, signal, alert), with the saved
   field's own LAeq range or, on the illustrative field, quiet to loud. The scene reads its colours from setDark. */
:root { --ramp-0: #0e7490; --ramp-1: #1f8a63; --ramp-2: #b7791f; --ramp-3: #c2410c; }
:root[data-theme="dark"] { --ramp-0: #34c6f4; --ramp-1: #58e6b4; --ramp-2: #f5d76a; --ramp-3: #ff6a3d; }
.lab-scale { display: inline-flex; align-items: center; gap: 8px; font: 500 var(--t1)/1 var(--f-ui); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.lab-scale-k { color: var(--ink-3); }
.lab-scale-lo, .lab-scale-hi { font-family: var(--f-num); font-size: 12px; }
.lab-scale-bar { width: 128px; height: 6px; border-radius: 3px;
  background: linear-gradient(90deg in oklab, var(--ramp-0) 0%, var(--ramp-0) 8%, var(--ramp-1) 38%, var(--ramp-2) 68%, var(--ramp-3) 96%, var(--ramp-3) 100%); }
:root[data-theme="dark"] .lab-scale-bar { box-shadow: 0 0 14px color-mix(in oklab, var(--ramp-1) 28%, transparent); }
.lab-scale[data-mode="concept"] .lab-scale-bar { opacity: .75; }
/* the headline breaks between its phrases only */
.lab-lead .ph { display: inline-block; animation: ph-rise 560ms var(--out) both; }
/* each phrase of the headline rises out of its own baseline, a beat apart, before the stations come in */
.lab-lead .ph:nth-child(2) { animation-delay: 70ms; } .lab-lead .ph:nth-child(3) { animation-delay: 140ms; } .lab-lead .ph:nth-child(n+4) { animation-delay: 210ms; }
@keyframes ph-rise { from { clip-path: inset(100% 0 -.2em 0); transform: translateY(.45em); } to { clip-path: inset(0 0 -.2em 0); transform: none; } }
/* with the saved/concept switch shown, the boxed title only repeated it; it stays the plate's accessible name */
.lab-view:not([hidden]) ~ .lab-concept-tab { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
