@font-face { font-family: 'Golos Text'; src: url('/fonts/golos-text.ttf') format('truetype'); font-weight: 400 900; font-display: swap; }
@property --light-energy { syntax: '<number>'; inherits: true; initial-value: .62; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
:root { font-family: 'Golos Text', system-ui, sans-serif; font-synthesis: none; }
body {
  --page: #e9edf1; --ink: #1d2833; --muted: #526170; --line: #cbd4dc;
  --canvas: #f1f4f7; --node: #fbfcfe; --field: #fbfcfe; --paper: #fff;
  --accent: #305d9b; --accent-wash: #e0e9f4; --button: #293b4b; --button-top: #435969; --button-text: #fff;
  --rim: rgb(255 255 255 / .92); --low-rim: rgb(63 89 110 / .18); --shadow: 31 48 65;
  --coat: rgb(248 252 255 / .38); --blur: 10px; --saturation: 140%; --bevel: 1px;
  --reflection: rgb(255 255 255 / .28); --duration: 190ms; --travel: 12px;
  margin: 0; color: var(--ink); background: var(--page); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; color-scheme: light;
}
body[data-theme='dark'] {
  --page: #151e27; --ink: #ecf2f8; --muted: #b1bfcd; --line: #3f5263;
  --canvas: #1c2935; --node: #283947; --field: #253543; --paper: #23313d;
  --accent: #b0d1ff; --accent-wash: #334c66; --button: #cbdae7; --button-top: #e5eff7; --button-text: #1d2c3a;
  --rim: rgb(223 242 255 / .42); --low-rim: rgb(6 16 24 / .65); --shadow: 0 7 13;
  --coat: rgb(30 47 63 / .42); --reflection: rgb(191 224 255 / .12);
  color-scheme: dark;
}
body[data-material='matte'] { --coat: rgb(248 251 254 / .78); --blur: 24px; --saturation: 125%; --bevel: 0px; --reflection: transparent; --rim: rgb(255 255 255 / .94); --low-rim: transparent; }
body[data-material='edge'] { --coat: rgb(246 251 255 / .68); --blur: 22px; --saturation: 145%; --bevel: 2px; --reflection: rgb(255 255 255 / .45); }
body[data-theme='dark'][data-material='matte'] { --coat: rgb(32 45 58 / .83); --rim: rgb(214 233 250 / .10); }
body[data-theme='dark'][data-material='edge'] { --coat: rgb(31 48 64 / .76); --reflection: rgb(207 234 255 / .20); --rim: rgb(218 240 255 / .60); }
body[data-motion='smooth'] { --duration: 300ms; --travel: 20px; }
body[data-motion='none'] { --duration: 0ms; --travel: 0px; }
button, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; color: inherit; }
button:disabled { cursor: wait; opacity: .7; }
button:focus-visible, a:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
button { touch-action: manipulation; }
button .icon { flex: 0 0 auto; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
code { font: 12px ui-monospace, 'SFMono-Regular', Consolas, monospace; }
main { max-width: 1344px; padding: 32px 36px 20px; margin: auto; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 22px; font-weight: 550; letter-spacing: -.035em; }
h2 { font-size: 17px; font-weight: 550; letter-spacing: -.02em; }
.lab-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.lab-title { display: flex; gap: 12px; align-items: center; }
.lab-title > .icon { width: 23px; height: 23px; }
.lab-title > span { color: var(--muted); margin-left: 6px; font-size: 12px; }
.intro { color: var(--muted); margin: 12px 0 24px; max-width: 75ch; }
.segmented { display: inline-flex; gap: 3px; padding: 3px; background: rgb(var(--shadow) / .045); border: 1px solid var(--line); border-radius: 9px; }
.segmented button { min-height: 36px; padding: 7px 12px; border-radius: 6px; border: 0; background: transparent; color: var(--muted); font-size: 13px; }
.segmented button[aria-pressed='true'] { background: var(--field); color: var(--ink); box-shadow: 0 1px 3px rgb(var(--shadow) / .12); }
.comparison-controls { position: sticky; top: 8px; z-index: 10; background: var(--page); }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; background: var(--page); border-radius: 10px; }
.choices button { position: relative; display: flex; align-items: center; text-align: left; gap: 14px; padding: 13px 40px 13px 16px; border: 1px solid var(--line); border-radius: 10px; background: transparent; min-height: 72px; }
.choices button[aria-pressed='true'] { background: color-mix(in srgb, var(--accent) 9%, var(--field)); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); box-shadow: inset 0 1px 0 var(--reflection), 0 3px 8px -5px rgb(var(--shadow) / .15); }
.selection-mark { visibility: hidden; width: 16px; height: 16px; color: var(--accent); }
[aria-pressed='true'] > .selection-mark { visibility: visible; }
.choices .selection-mark { position: absolute; right: 14px; top: 14px; }
.choices strong { display: block; font-weight: 550; }
.choices small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.choice-letter { font-size: 13px; color: var(--muted); }
.choices button[aria-pressed='true'] .choice-letter { color: var(--accent); }
.scene { position: relative; }
#status-choice, .mobile-copy, .mobile-settings { display: none; }

/* One optical layer. No opacity/filter on its ancestors: the backdrop is real
   graph content, not a duplicated or prerendered texture. */
.optical {
  position: relative; background: var(--coat); border: 1px solid var(--rim);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(var(--saturation));
  backdrop-filter: blur(var(--blur)) saturate(var(--saturation));
  box-shadow: inset 0 1px 0 var(--rim), inset 0 -1px 0 var(--low-rim), 0 12px 30px -12px rgb(var(--shadow) / .27), 0 2px 5px rgb(var(--shadow) / .06);
}
.optical::before { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(123deg, var(--reflection), transparent 32%, transparent 72%, rgb(var(--shadow) / .035)); }
.optical::after { content: ''; position: absolute; inset: var(--bevel); border: 1px solid var(--reflection); border-radius: inherit; pointer-events: none; }
.optical > * { position: relative; }
body[data-material='matte'] .optical { border-color: rgb(255 255 255 / .86); box-shadow: 0 4px 14px rgb(var(--shadow) / .06), inset 0 1px 0 var(--rim); }
body[data-theme='dark'][data-material='matte'] .optical { border-color: rgb(190 212 235 / .13); }

.stage { height: 620px; position: relative; overflow: hidden; border-radius: 18px; border: 1px solid var(--line); background: var(--canvas); }
.stage-head { position: absolute; z-index: 4; inset: 12px 12px auto; padding: 14px 18px; border-radius: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.workflow-name { display: flex; align-items: center; gap: 12px; font-size: 16px; letter-spacing: -.02em; }
.workflow-name strong { font-weight: 550; }
.stage-actions { display: flex; gap: 8px; }
.stage-actions button, .graph-tools button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; border: 1px solid var(--line); padding: 6px 10px; border-radius: 7px; background: transparent; font-size: 12px; }
.stage-actions button[aria-expanded='true'] { background: var(--field); }
.viewport { position: absolute; inset: 0; overflow: hidden; touch-action: pan-y; cursor: grab; }
.viewport.dragging { cursor: grabbing; }
.canvas { position: absolute; width: 800px; height: 620px; transform-origin: 0 0; }
.connectors { position: absolute; inset: 0; width: 800px; height: 620px; fill: none; stroke: var(--line); stroke-width: 1.5; }
.node { position: absolute; width: 196px; height: 110px; border: 1px solid var(--line); border-radius: 10px; background: var(--node); padding: 15px 16px; text-align: left; box-shadow: 0 2px 3px rgb(var(--shadow) / .04); display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.node:nth-of-type(1) { left: 42px; top: 88px; }
.node:nth-of-type(2) { left: 302px; top: 88px; }
.node:nth-of-type(3) { left: 562px; top: 88px; }
.node:nth-of-type(4) { left: 42px; top: 254px; }
.node:nth-of-type(5) { left: 302px; top: 254px; }
.node:nth-of-type(6) { left: 562px; top: 254px; }
.node:nth-of-type(7) { left: 42px; top: 420px; }
.node:nth-of-type(8) { left: 302px; top: 420px; }
.node:nth-of-type(9) { left: 562px; top: 420px; }
.node.selected { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); background: color-mix(in srgb, var(--accent) 14%, var(--node)); box-shadow: inset 0 1px 0 var(--reflection), 0 4px 8px -5px rgb(var(--shadow) / .2); }
.node strong { font-weight: 550; font-size: 13px; }
.node-kind { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 12px; }
.node-kind .icon { width: 16px; height: 16px; }
.node .state { margin-top: auto; font-size: 11px; }
.graph-tools { position: relative; z-index: 2; display: flex; gap: 6px; padding: 4px; margin-top: 10px; width: fit-content; max-width: 100%; border-radius: 9px; }
#step-choice { display: block; min-width: 0; max-width: 340px; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; font: inherit; color: var(--ink); background: var(--field); }
.graph-tools button { border: 0; }
.graph-tools button:hover { background: var(--field); }

.inspector { position: absolute; z-index: 3; width: 348px; right: 18px; top: 108px; bottom: 18px; border-radius: 16px; display: flex; flex-direction: column; }
.inspector-head { display: flex; align-items: center; gap: 10px; padding: 19px 18px 14px 22px; }
.inspector-head > div { display: flex; gap: 10px; align-items: center; }
.inspector-head h2 { font-size: 15px; }
.icon-button { display: inline-grid; place-items: center; flex: 0 0 auto; border: 0; width: 36px; height: 36px; border-radius: 7px; background: transparent; color: var(--muted); }
.icon-button:hover { background: var(--field); color: var(--ink); }
.inspector-head > button { margin-left: auto; }
.inspector-scroll { padding: 8px 22px 22px; overflow: auto; flex: 1; }
.inspector dl { margin: 26px 0; }
.inspector dl > div { margin-top: 18px; }
.inspector dt { color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.inspector dd { margin: 0; font-size: 14px; font-weight: 450; }
.read-button { display: flex; align-items: center; gap: 9px; min-height: 44px; width: 100%; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--field); font-size: 13px; padding: 10px 12px; text-align: left; }
.read-button > .icon:last-child { margin-left: auto; }
.inspector-footer { border-top: 1px solid var(--line); padding: 16px 22px; display: flex; flex-direction: column; gap: 8px; }
.primary { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 42px; border: 1px solid var(--low-rim); border-radius: 8px; background: var(--button) linear-gradient(var(--button-top), var(--button)); box-shadow: inset 0 1px 0 rgb(255 255 255 / .22), 0 1px 3px rgb(var(--shadow) / .08); color: var(--button-text); padding: 10px 15px; font-size: 13px; font-weight: 500; }
.inspector-footer .primary { width: 100%; }

.history { position: absolute; top: 88px; right: 18px; width: 348px; border-radius: 14px; z-index: 5; padding: 18px; }
.popover-head { display: flex; align-items: center; justify-content: space-between; padding: 0 0 10px; }
.popover-head h2 { font-size: 14px; }
.history ol { list-style: none; padding: 0; margin: 0; }
.history li { padding: 13px 3px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 7px 10px; font-size: 12px; }
.history li > span:last-child { grid-column: 1 / -1; color: var(--muted); }
.history time { color: var(--muted); font-size: 11px; align-self: center; }

/* A single inherited energy value drives each source and its reflection.
   The source never goes out; text, geometry and backdrop filters stay fixed. */
[data-state] { --light-output: .62; --light-gain: 1; --light-x: 20px; --light-y: 50%; }
body[data-light-motion='supported'][data-glow='shimmer']:not([data-light='none']) [data-state] { --light-output: var(--light-energy); }
[data-state='done'] { --signal: #21734f; --signal-core: #6cebb0; --signal-rgb: 55 191 127; }
[data-state='running'], [data-state='cancelling'] { --signal: #2f65af; --signal-core: #83baff; --signal-rgb: 60 133 244; --light-gain: 1.25; }
[data-state='review'] { --signal: #805718; --signal-core: #ffd08b; --signal-rgb: 234 163 55; --light-gain: 1.25; }
[data-state='error'], [data-state='timed_out'] { --signal: #b3423a; --signal-core: #ffaaa0; --signal-rgb: 231 94 82; --light-gain: 1.6; }
[data-state='pending'], [data-state='skipped'], [data-state='cancelled'] { --signal: #5c6e80; --signal-core: #b5c2cd; --signal-rgb: 126 148 165; }
body[data-theme='dark'] [data-state='done'] { --signal: #93e5bd; }
body[data-theme='dark'] :is([data-state='running'], [data-state='cancelling']) { --signal: #a6caff; }
body[data-theme='dark'] [data-state='review'] { --signal: #f3ca8f; }
body[data-theme='dark'] :is([data-state='error'], [data-state='timed_out']) { --signal: #ffb3a9; }
body[data-theme='dark'] :is([data-state='pending'], [data-state='skipped'], [data-state='cancelled']) { --signal: #b0bfce; }
.state { display: inline-flex; align-items: center; gap: 9px; color: var(--signal); font-size: 12px; font-weight: 500; }
.lamp { position: relative; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--signal); flex: 0 0 auto; }
body:not([data-light='none']) .lamp { background: radial-gradient(circle at 35% 25%, var(--signal-core), var(--signal) 80%); box-shadow: 0 0 0 2px rgb(var(--signal-rgb) / .07); }
body:not([data-light='none']) .lamp::before { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(circle at 35% 25%, #fff, var(--signal-core) 65%, transparent); opacity: calc((.1 + var(--light-output) * .7) * var(--light-gain)); }
body:not([data-light='none']) .lamp::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: var(--light-output); box-shadow: 0 0 7px 1px rgb(var(--signal-rgb) / calc(.64 * var(--light-gain))), 0 0 3px 1px rgb(var(--signal-rgb) / calc((var(--light-gain) - 1) * .6)); }
body[data-theme='dark']:not([data-light='none']) .lamp::after { box-shadow: 0 0 7px 1px rgb(var(--signal-rgb) / calc(.78 * var(--light-gain))), 0 0 3px 1px rgb(var(--signal-rgb) / calc((var(--light-gain) - 1) * .6)); }
.status-plate { padding: 8px 11px; border: 1px solid rgb(var(--signal-rgb) / .25); background: rgb(var(--signal-rgb) / .065); border-radius: 7px; }
.edge-light, .optical > .edge-light { display: none; position: absolute; inset: 0; z-index: 1; border-radius: inherit; pointer-events: none; opacity: calc(var(--light-output) * var(--reflection-visible, 1)); }
body[data-light='edge'] [data-state]:not([data-state='pending'], [data-state='skipped'], [data-state='cancelled']) > .edge-light { display: block; }
/* A tapered reflection follows the existing rounded edge, with no separate
   rectangular strip or second outline. Mask only this light, never the glass. */
.edge-light::before { content: ''; position: absolute; inset: -1px; padding: 1px; border-radius: inherit; background: radial-gradient(ellipse 64px 72px at var(--light-x) var(--light-y), rgb(var(--signal-rgb) / calc(.95 * var(--light-gain))), rgb(var(--signal-rgb) / calc(.48 * var(--light-gain))) 42%, transparent 90%); -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); mask-composite: exclude; }
.edge-light::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(ellipse 24px 58px at 0 var(--light-y), rgb(var(--signal-rgb) / calc(.19 * var(--light-gain))), transparent 95%); }
body :is([data-state='pending'], [data-state='skipped'], [data-state='cancelled']) .lamp { box-shadow: none !important; background: var(--signal); }
body :is([data-state='pending'], [data-state='skipped'], [data-state='cancelled']) .lamp::before,
body :is([data-state='pending'], [data-state='skipped'], [data-state='cancelled']) .lamp::after { display: none; }
@supports not ((mask-composite: exclude) or (-webkit-mask-composite: xor)) { .edge-light::before { display: none; } }

.tuning { margin-top: 26px; }
.tuning-heading { display: flex; align-items: baseline; gap: 18px; margin-bottom: 12px; }
.tuning-heading p, .muted { font-size: 12px; color: var(--muted); }
.status-samples { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.status-sample { min-height: 58px; border-radius: 10px; text-align: left; padding: 14px 18px; display: flex; align-items: center; gap: 8px; }
.status-sample .state { min-width: 0; flex: 1; }
.status-sample > .selection-mark { flex: 0 0 16px; color: var(--signal); }
.status-sample[aria-pressed='true'] { background: color-mix(in srgb, var(--signal) 9%, var(--coat)); border-color: color-mix(in srgb, var(--signal) 35%, var(--rim)); }
.tuning-controls { display: flex; gap: 40px; flex-wrap: wrap; margin-top: 24px; }
.tuning-controls label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 7px; }
.muted { margin-top: 12px; }
.feedback { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); }
.feedback > div:first-child { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; }
.feedback p { color: var(--muted); font-size: 12px; }
.feedback > label { display: block; color: var(--muted); font-size: 13px; margin: 18px 0 8px; }
.feedback textarea { width: 100%; max-width: 850px; padding: 12px 14px; background: var(--field); color: var(--ink); border: 1px solid var(--line); border-radius: 9px; resize: vertical; font-size: 14px; line-height: 1.6; display: block; }
.feedback textarea::placeholder { color: var(--muted); opacity: .85; }
.feedback-actions { display: flex; align-items: center; gap: 16px; margin-top: 14px; }
.feedback-actions > span { max-width: 48ch; font-size: 12px; color: var(--muted); }
#copy-fallback { margin-top: 14px; }
.lab-footer { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; font-size: 12px; color: var(--muted); }
.lab-footer a { color: var(--muted); text-decoration: none; min-height: 36px; display: flex; align-items: center; gap: 6px; }
.lab-footer .icon { width: 14px; height: 14px; }

.reader { position: fixed; inset: 0; margin: auto; height: fit-content; padding: 8px; width: min(760px, calc(100vw - 32px)); max-height: min(90dvh, 880px); border-radius: 18px; color: var(--ink); }
.reader[open] { display: flex; flex-direction: column; overflow: hidden; }
.reader::backdrop { background: rgb(15 28 41 / .22); }
.reader header { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; padding: 8px 14px 12px; font-size: 13px; }
.reader article { min-height: 0; overflow: auto; overscroll-behavior: contain; background: var(--paper); padding: 32px 40px; border-radius: 11px; color: var(--ink); }
.reader article h2 { font-size: 28px; line-height: 1.25; letter-spacing: -.035em; margin-bottom: 24px; }
.reader article h3 { font-size: 18px; font-weight: 550; margin: 24px 0 10px; }
.reader article p { font-size: 16px; line-height: 1.75; margin-top: 14px; }
.reader article .article-kicker { margin: 0 0 16px; font-size: 12px; color: var(--muted); }

.entering { animation: enter var(--duration) cubic-bezier(.2,.8,.25,1) both; }
.leaving { animation: enter calc(var(--duration) * .7) ease-in reverse both; }
.history.entering { animation-name: drop; }
.history.leaving { animation-name: drop; }
.reader.entering { animation-name: rise; }
.reader.leaving { animation-name: rise; }
@keyframes enter { from { transform: translateX(var(--travel)); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes drop { from { transform: translateY(calc(var(--travel) * -.5)); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes rise { from { transform: translateY(var(--travel)) scale(.992); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
.canvas.moving { transition: transform 420ms cubic-bezier(.2,.8,.25,1); }
@media (max-width: 760px), (max-width: 1024px) and (max-height: 540px) {
  main { padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
  h1 { font-size: 18px; }
  .lab-header { gap: 10px; }
  .lab-title { gap: 8px; min-width: 0; }
  .lab-title > .icon { width: 20px; height: 20px; }
  .lab-title > span { display: none; }
  .theme-switch { margin-left: auto; }
  .theme-switch button { padding: 6px 9px; font-size: 12px; min-height: 44px; }
  .intro { margin: 10px 0 12px; font-size: 13px; }
  .comparison-controls { top: env(safe-area-inset-top, 0px); padding: 6px 0 10px; }
  .choices { gap: 8px; margin-bottom: 10px; border-radius: 0; }
  .choices button { min-width: 0; padding: 8px; flex-direction: column; align-items: flex-start; gap: 3px; min-height: 56px; }
  .choices .selection-mark { top: 8px; right: 8px; }
  .choices strong { font-size: 12px; }
  .choices small { display: none; }
  .choice-letter { font-size: 12px; }
  .mobile-settings { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 64px; gap: 8px; }
  .mobile-settings label, .glow-control { min-width: 0; color: var(--muted); font-size: 12px; }
  .mobile-settings select { display: block; width: 100%; height: 44px; margin-top: 4px; padding: 0 4px; font: inherit; font-size: 16px; color: var(--ink); border: 1px solid var(--line); border-radius: 7px; background: var(--field); }
  #glow-toggle { display: block; width: 100%; min-height: 44px; margin-top: 4px; border: 1px solid var(--line); border-radius: 7px; background: var(--field); color: var(--muted); font-size: 14px; }
  #glow-toggle[aria-pressed='true'] { color: var(--accent); border-color: var(--accent); }
  /* Only the compact controls stay pinned; the specimen never covers inputs. */
  .scene { padding-bottom: 8px; }
  .stage { height: clamp(320px, calc(100svh - 340px), 440px); border-radius: 14px; }
  .stage-head { inset: 8px 8px auto; gap: 8px; padding: 6px 8px; border-radius: 10px; }
  .workflow-name { min-width: 0; gap: 8px; font-size: 13px; line-height: 1.3; }
  .workflow-name .icon { display: none; }
  .stage-actions { gap: 4px; }
  .stage-actions button { width: 44px; min-width: 44px; height: 44px; padding: 0; }
  .stage-actions button span { display: none; }
  .inspector { inset: auto 8px 8px; width: auto; height: auto; max-height: calc(100% - 82px); border-radius: 12px; }
  .inspector-head { padding: 4px 8px 2px 14px; }
  .inspector-head h2 { font-size: 14px; }
  .inspector-head > div { min-width: 0; }
  .icon-button { width: 44px; height: 44px; }
  .inspector-scroll { padding: 2px 14px 10px; min-height: 0; }
  .status-plate { padding: 4px 8px; font-size: 13px; }
  .status-plate .state-label { display: none; }
  .status-plate { padding: 0 8px; }
  #status-choice { display: block; max-width: 100%; height: 44px; font: inherit; font-size: 16px; color: var(--signal); background: transparent; border: 0; }
  .inspector dl { margin: 10px 0; }
  .inspector dl > div { margin: 0; }
  .inspector dl > div:last-child { display: none; }
  .inspector dt { margin-bottom: 2px; }
  .inspector dd { font-size: 14px; overflow-wrap: anywhere; }
  .inspector-footer { padding: 8px 14px; flex-direction: row; }
  .inspector-footer .read-button { flex: 1; width: auto; min-width: 0; }
  .inspector-footer .read-button > .icon:last-child { display: none; }
  .inspector-footer #animate { width: 44px; flex: 0 0 44px; padding: 0; }
  #animate span { display: none; }
  .read-button, .primary { min-height: 44px; font-size: 14px; }
  .scene > .graph-tools.optical { position: relative; inset: auto; width: 100%; margin-top: 8px; padding: 0; gap: 6px; border: 0; border-radius: 0; background: var(--page); box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .graph-tools::before, .graph-tools::after { display: none; }
  .graph-tools button { min-height: 44px; border: 1px solid var(--line); background: var(--field); font-size: 14px; }
  #reset-graph { width: 44px; flex: 0 0 44px; padding: 0; }
  #step-choice { display: block; flex: 1; width: 0; min-width: 0; height: 44px; font: inherit; font-size: 16px; color: var(--ink); background: var(--field); border: 1px solid var(--line); border-radius: 7px; padding: 0 8px; }
  .desktop-copy { display: none; }
  .mobile-copy { display: inline; }
  .history { top: 76px; right: 8px; left: 8px; width: auto; max-height: calc(100% - 84px); padding: 10px 14px; overflow: auto; }
  .history li { padding: 10px 0; }
  .tuning { margin-top: 20px; }
  .status-samples { grid-template-columns: 1fr 1fr; gap: 12px; }
  .status-sample { min-height: 48px; padding: 10px 14px; }
  .status-sample .state { font-size: 14px; }
  .tuning-heading { display: block; }
  .tuning-heading p { margin-top: 6px; }
  .tuning-controls { display: none; }
  .feedback > div:first-child { display: block; }
  .feedback p { margin-top: 6px; }
  .feedback textarea { font-size: 16px; }
  .feedback-actions { align-items: stretch; flex-direction: column; gap: 10px; }
  .feedback-actions .primary { align-self: flex-start; }
  .lab-footer { align-items: flex-start; gap: 12px; flex-direction: column; }
  .lab-footer a { min-height: 44px; }
  .reader { width: calc(100vw - 16px); max-width: calc(100vw - 16px); max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); padding: 6px; }
  .reader header { padding: 4px 6px; margin-bottom: 6px; }
  .reader article { padding: 20px 16px; }
  .reader article h2 { font-size: 24px; }
  .inspector.entering, .inspector.leaving { animation-name: rise; }
}
@media (max-width: 360px) { .lab-title > .icon { display: none; } }
/* Leave the view usable when the browser or keyboard makes it very short. */
@media (max-width: 1024px) and (max-height: 540px) { .comparison-controls { position: relative; top: auto; } }
body:has(.reader[open]) { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { body[data-light-motion] [data-state] { --light-output: .62 !important; } .entering, .leaving { animation: none; } .canvas.moving { transition: none; } }
body[data-motion='none'] .canvas.moving { transition: none; }
@media (prefers-reduced-transparency: reduce) { .optical { background: var(--field); -webkit-backdrop-filter: none; backdrop-filter: none; } }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .optical { background: var(--field); } }
