:root {
  color-scheme: dark;
  --bg: #10121b;
  --shell: #151824;
  --panel: #191d2b;
  --surface: #131724;
  --line: #2d3346;
  --text: #f0f1f8;
  --muted: #a3aec7;
  --quiet: #7e8ba8;
  --accent: #c1b2ff;
  --accent-button: #b8a7ff;
  --read: #bfaeff;
  --write: #ffc777;
  --error: #ffa1af;
  --success: #95e3bb;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: "Inter", "Segoe UI", system-ui, sans-serif;
  font: 100%/1.5 var(--sans);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: radial-gradient(ellipse 75% 25rem at 65% 0%, #1c1d35, transparent 75%), var(--bg);
}
button, select, textarea, input { font: inherit; }
button, select, a.button, summary { cursor: pointer; }
button:disabled, select:disabled, input:disabled { cursor: default; opacity: .48; }
button:focus-visible, select:focus-visible, textarea:focus-visible, input:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, p, pre, dl { margin: 0; }
a { color: var(--accent); }
.shell { width: min(100% - 3.5rem, 89rem); margin-inline: auto; }
.topbar { border-bottom: 1px solid #282d40; background: #11131cef; }
.topbar-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .55rem 1.25rem; align-items: center; min-height: 4.25rem; padding-block: .55rem; }
.brand { display: inline-flex; gap: .7rem; align-items: center; flex: 1; font-size: 1.1rem; font-weight: 720; white-space: nowrap; }
.brand-secondary { color: var(--muted); font-weight: 500; }
.brand-icon { display: grid; place-items: center; width: 2.15rem; aspect-ratio: 1; color: #171225; background: var(--accent-button); border-radius: .56rem; font: 700 .98rem var(--mono); letter-spacing: -.09em; }
main.shell { padding: 2rem 0 2.5rem; }
.site-footer { text-align: center; padding: .85rem 0 1.15rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; }
.file-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.code-context { display: flex; flex-wrap: wrap; gap: .25rem .55rem; padding: .4rem .9rem; font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; }
.code-context:not(:has(:not(:empty))) { display: none; }
.code-context :empty { display: none; }
.file-status.error { color: var(--error); }
#file-name { font-family: var(--mono); }
.form-field { display: grid; gap: .4rem; align-content: start; }
.form-field > span, .form-field > label { color: var(--muted); font-size: .875rem; font-weight: 580; }
select { appearance: none; background: #202535 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23b5bfd6' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right .58rem center / .9rem no-repeat; border: 1px solid var(--line); border-radius: .47rem; min-height: 2.35rem; color: var(--text); padding: .35rem 1.95rem .35rem .65rem; font-size: .88rem; }
.button { min-height: 2.35rem; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .34rem .76rem; border: 1px solid var(--line); border-radius: .47rem; background: #222739; color: var(--text); font-size: .86rem; font-weight: 660; line-height: 1.15; white-space: nowrap; text-decoration: none; }
.button:hover:not(:disabled) { background: #2b334a; border-color: #4b5574; }
.button-primary { background: var(--accent-button); color: #171329; border-color: var(--accent-button); }
.button-primary:hover:not(:disabled) { background: #d1c5ff; border-color: #d1c5ff; }
.button-quiet { background: transparent; color: var(--muted); }
.play-icon { width: 0; height: 0; display: inline-block; border-block: .31rem solid transparent; border-inline-start: .49rem solid currentColor; }
.is-playing .play-icon { width: .49rem; height: .65rem; border: 0; border-inline: .15rem solid currentColor; }

.workspace { display: grid; grid-template-columns: minmax(0, .99fr) minmax(0, 1.01fr); gap: 1rem; }
.card { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: .85rem; overflow: hidden; }
.card-heading { min-height: 3.55rem; padding: .55rem .9rem; display: flex; justify-content: space-between; gap: .55rem; align-items: center; border-bottom: 1px solid var(--line); }
h2 { display: flex; align-items: center; gap: .52rem; font-size: 1rem; font-weight: 690; letter-spacing: -.015em; }
.section-symbol { font: 700 .875rem var(--mono); color: var(--accent); }
.grid-icon { font-size: 1.15rem; }
.editor-card { display: flex; flex-direction: column; }
.editor-heading { flex-wrap: wrap; justify-content: space-between; }
.editor-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; }
.editor {
  --gutter: 3rem;
  --editor-top: .85rem;
  --row: 1.5rem;
  position: relative;
  flex: 1;
  min-height: 19rem;
  background: #111521;
  font: .86rem/var(--row) var(--mono);
}
.editor:focus-within { outline: 1px solid #8d7ded; outline-offset: -1px; }
.code-mirror { position: absolute; inset: 0; overflow: hidden; padding-top: var(--editor-top); padding-bottom: var(--editor-top); pointer-events: none; }
.code-row { position: relative; display: grid; grid-template-columns: var(--gutter) auto; width: max-content; min-width: 100%; min-height: var(--row); white-space: pre; }
.code-number { position: sticky; left: 0; text-align: right; padding-right: .85rem; color: var(--quiet); background: #111521; z-index: 1; user-select: none; }
.code-line { display: block; color: #dbe3fa; padding-right: .9rem; tab-size: 4; }
.code-row.active, .code-row.active .code-number { background: #252540; }
.code-row.active .code-number { color: var(--accent); box-shadow: inset 2px 0 0 var(--accent); }
.code-row.fault, .code-row.fault .code-number { background: #402432; }
.code-row.fault .code-number { color: var(--error); box-shadow: inset 2px 0 0 var(--error); }
.code-span { text-decoration: underline 2px var(--error); text-underline-offset: .22rem; }
.token-keyword { color: #c5afff; }
.token-number { color: #ffcb8b; }
.token-string { color: #9de1c4; }
.token-comment { color: #8b9abc; }
.editor textarea { position: absolute; inset: 0; width: 100%; height: 100%; padding: var(--editor-top) .9rem var(--editor-top) var(--gutter); margin: 0; border: 0; outline: 0; background: transparent; color: transparent; caret-color: var(--text); font: inherit; tab-size: 4; resize: none; overflow: auto; scrollbar-color: #565c78 #121622; }
.editor textarea::selection { color: transparent; background: #a08fff55; }
.io-panel { border-top: 1px solid var(--line); background: var(--panel); }
.io-panel summary { padding: .67rem .9rem; color: var(--muted); font-size: .88rem; font-weight: 650; }
.io-panel summary:hover { color: var(--text); }
.io-fields { display: grid; gap: .65rem; padding: 0 .9rem .85rem; }
.io-fields textarea { width: 100%; min-width: 0; resize: vertical; padding: .55rem .65rem; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: .48rem; }
.io-fields textarea { font: .86rem/1.55 var(--mono); }
.check-label { display: inline-flex; align-items: center; gap: .35rem; }
input[type=checkbox], input[type=range] { accent-color: var(--accent-button); }
.viewport-card { display: flex; flex-direction: column; }
.matrix-viewport { flex: 1; overflow: auto; max-height: 30rem; display: grid; align-content: safe center; justify-items: start; padding: .65rem 1rem .85rem; background: radial-gradient(ellipse at 50% 25%, #1d2237, var(--surface) 78%); }
.matrix-viewport > .empty { align-self: center; justify-self: center; max-width: 23rem; text-align: center; }
#matrix-wrap { width: 100%; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; }
#matrix { position: relative; max-width: 100%; overflow: auto; }
.matrix-caption { color: var(--muted); font: .81rem var(--mono); margin-bottom: .25rem; }
.matrix { border-spacing: .3rem; font: .79rem var(--mono); text-align: center; }
.matrix th { min-width: 1.4rem; min-height: 1.4rem; color: var(--quiet); font-weight: 550; }
.matrix td { min-width: clamp(2.05rem, 5.3vw, 3.65rem); height: 2.25rem; padding: .15rem .45rem; border-radius: .39rem; border: 1px solid #30394e; background: #222a40; color: #e6eafa; font-size: clamp(.82rem, 1.55vw, 1.08rem); font-weight: 650; }
.matrix td.axis-row, .matrix td.axis-column { background: #2b334e; border-color: #424d71; }
.matrix td.axis-row:where(.axis-column) { background: #383761; }
.matrix th.axis-active { color: #e1d8ff; background: #342c54; border-radius: .32rem; }
.matrix td.is-read { border-color: var(--read); color: #e8e0ff; background: #473777; box-shadow: 0 0 .9rem #b39dff2b; }
.matrix td.is-write { border-color: var(--write); color: #ffe0ad; background: #564023; }
.matrix td.is-error { border-color: var(--error); color: var(--error); background: #522a3d; }
.matrix td[data-window] { outline: 1px solid #9e8bea; outline-offset: -1px; background-color: #343052; }
.matrix td[data-window="invalid"] { outline-color: #dc879b; background-color: #3d293e; }
.matrix td[data-window="valid"], .matrix td[data-window="best"] { outline-color: #78d7ad; background-color: #23453f; }
.matrix td[data-window].is-read { border: 2px solid #e9d9ff; background-color: #563e7b; }
.matrix td[data-window="invalid"].is-read { border-color: #ffd0d7; background-color: #7a354c; }
.matrix-region { margin-top: .3rem; font: .82rem/1.4 var(--mono); color: #d5c7ff; text-align: center; }
.matrix-region[data-status="invalid"] { color: var(--error); }
.matrix-region[data-status="valid"], .matrix-region[data-status="best"] { color: var(--success); }
.matrix td.matrix-corner { min-width: 1.4rem; border-color: transparent; background: transparent; }
.matrix th.header-error { color: var(--error); }
.matrix td.undefined { color: var(--quiet); }
.matrix-note::before { content: "×"; display: inline-grid; place-items: center; width: 1.2rem; height: 1.2rem; margin-right: .35rem; border: 1px dashed currentColor; border-radius: .3rem; }
.matrix-note { max-width: 100%; margin-top: .35rem; color: var(--error); font-size: .85rem; }
.legend { min-height: 2.15rem; display: flex; justify-content: center; flex-wrap: wrap; align-items: center; gap: .95rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }
.legend span { display: inline-flex; align-items: center; gap: .38rem; }
.swatch { width: .52rem; height: .52rem; border-radius: .12rem; background: var(--read); }
.swatch-write { background: var(--write); }
.swatch-error { background: var(--error); }
.variables { display: flex; flex-wrap: wrap; gap: .4rem; padding: .6rem .8rem; }
.variables:empty { display: none; }
.variable { display: flex; align-items: baseline; gap: .38rem; border: 1px solid #323a51; border-radius: .35rem; background: #202639; padding: .12rem .4rem; font: .81rem/1.45 var(--mono); }
.variable dt { color: var(--accent); }
.variable dd { margin: 0; color: var(--text); }
.empty { color: var(--muted); font-size: .86rem; }
.output { font: .84rem/1.45 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; color: #e2e8fc; }
.comparison { padding: 0 .8rem .45rem; font-size: .81rem; color: var(--success); }
.comparison.mismatch { color: var(--error); }

.timeline { margin-top: 1rem; padding: .72rem .9rem .8rem; display: grid; gap: .58rem; }
.timeline-head, .timeline-status, .timeline-controls { display: flex; align-items: center; gap: .65rem; }
.timeline-head { justify-content: space-between; }
.timeline-status .status { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .82rem; font-weight: 640; }
.status::before { content: ""; background: currentColor; width: .37rem; height: .37rem; border-radius: 50%; }
.status[data-tone=success] { color: var(--success); }
.status[data-tone=error] { color: var(--error); }
.status[data-tone=running] { color: var(--accent); }
.error-button { color: var(--error); min-height: 1.9rem; padding: .2rem .55rem; }
.transport { display: flex; gap: .3rem; }
.button-icon { min-width: 2.15rem; font-size: 1.35rem; padding: .1rem .3rem; }
.playback { min-width: 7.35rem; }
#timeline-range { min-width: 2rem; width: 100%; }
.step-count { color: var(--muted); font: .8rem var(--mono); white-space: nowrap; }
.event-detail { min-height: 2.18rem; display: flex; align-items: center; gap: .55rem; border-top: 1px solid var(--line); padding-top: .52rem; color: var(--muted); font-size: .86rem; }
.event-kind { color: var(--accent); font: 650 .79rem var(--mono); min-width: max-content; }
.event-detail.fault .event-kind { color: var(--error); }
.event-detail p { overflow-wrap: anywhere; }
.step-details { color: var(--muted); font-size: .82rem; padding: 0 0 .2rem; }
.step-details summary { width: fit-content; font-weight: 620; }
.step-details ul { display: grid; gap: .2rem; margin: .45rem 0 0; padding-left: 1.3rem; }

dialog { max-width: min(35rem, 95vw); padding: 0; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: .85rem; box-shadow: 0 1.5rem 4rem #0008; }
dialog::backdrop { background: #070a13c9; }
.guide-body { display: grid; gap: .72rem; padding: 1rem; color: var(--muted); }
.guide-body h3 { color: var(--text); font-size: 1rem; }
.guide-body code, kbd { color: var(--accent); font-family: var(--mono); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

@media (max-width: 820px) {
  .shell { width: calc(100% - 1.5rem); }
  .topbar-inner { gap: .55rem; }
  .workspace { grid-template-columns: 1fr; }
  .editor { min-height: 19rem; }
}
@media (max-width: 510px) {
  main.shell { padding-top: 1.25rem; }
  .topbar-inner { min-height: 3.65rem; gap: .2rem; flex-wrap: wrap; }
  .brand { gap: .35rem; }
  .brand-icon { width: 1.65rem; }
  .coverage-button { font-size: .76rem; padding-inline: .45rem; }
  .timeline-controls { flex-wrap: wrap; }
  #timeline-range { order: 3; flex: 1 0 100%; }
  .step-count { margin-left: auto; }
  .editor-heading { padding-inline: .65rem; }
  .editor-actions { gap: .25rem; }
  #cancel { padding-inline: .35rem; }
}

#restore-input { justify-self: start; }
@media (max-width: 480px) {
  .topbar-inner { gap: .45rem; }
}

.book-dialog { width: min(70rem, calc(100% - 1rem)); max-width: none; max-height: min(91dvh, 53rem); }
.book-dialog > header { position: sticky; top: 0; z-index: 1; background: var(--surface); }
.book-catalog { display: grid; grid-template-columns: minmax(13rem, 23rem) minmax(0, 1fr); min-height: 24rem; }
.book-sidebar, .book-example { padding: 1rem; min-width: 0; }
.book-sidebar { border-right: 1px solid var(--line); }
.book-sidebar label + label, #book-count { margin-top: .65rem; }
.book-sidebar input { color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: .4rem; padding: .48rem; }
:is(#book-list, #study-list) { max-height: 54dvh; overflow: auto; margin: .55rem 0 0; padding: 0; list-style: none; display: grid; gap: .25rem; }
:is(#book-list, #study-list) button { text-align: left; display: grid; gap: .15rem; width: 100%; padding: .58rem .65rem; border-radius: .4rem; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
:is(#book-list, #study-list) button[aria-pressed="true"] { border-color: var(--accent); background: #292544; }
.book-example h3 { margin: .2rem 0 .4rem; }
#book-example-status, #book-actions, #book-example-credit, .book-example details, .book-source-links { margin: .65rem 0; }
.book-code { font: .86rem/1.46 var(--mono); padding: .7rem .8rem; margin: .45rem 0; border: 1px solid var(--line); border-radius: .4rem; background: var(--surface); max-height: 40dvh; overflow: auto; }
.book-source-links { font-size: .85rem; }
@media (max-width: 650px) {
  .book-catalog { grid-template-columns: minmax(0, 1fr); }
  .book-sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  :is(#book-list, #study-list) { max-height: 26dvh; }
}

/* One card per call, with the current call at the top. */
.stack-panel { grid-column: 1 / -1; display: flex; flex-direction: column; }
.stack-empty { padding: .75rem .9rem; }
.stack-frames { margin: 0; padding: .55rem .8rem; list-style: none; display: grid; gap: .45rem; max-height: 23rem; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.stack-frames:empty { display: none; }
.stack-card { min-width: 0; border: 1px solid var(--line); border-radius: .48rem; background: var(--surface); }
.stack-card[data-state="active"] { border-color: var(--accent); background: #232039; }
.stack-card[data-state="stacked"] { border-color: #676181; }
.stack-card[data-state="returned"] { background: #1a1c22; border-color: #3b3e47; color: #bcc0ca; }
.stack-frame { padding: .42rem .65rem; overflow-wrap: anywhere; font-weight: 650; }
.stack-meta { margin-left: .65rem; color: var(--muted); font-size: .78rem; font-weight: 500; }
.stack-card[data-state="active"] .stack-meta { color: var(--accent); }
.stack-card[data-state="returned"] .stack-meta { color: #a9abb4; }
.stack-values { padding: .1rem .65rem .5rem; display: grid; min-width: 0; gap: .25rem; }
.stack-values .variables { padding: 0; }
.stack-values .variable :is(dt, dd) { min-width: 0; }
.frame-array pre { max-width: 100%; max-height: 7rem; overflow: auto; padding: .3rem 0; }
.stack-card[data-state="returned"] .variable { background: #24262e; border-color: #444751; }
.stack-card[data-state="returned"] :is(dt, dd) { color: #c9cbd3; }
.stack-result, .stack-output-label { font-size: .82rem; }
.stack-frame-output, .stack-transcript .output { max-height: 7.5rem; overflow: auto; padding: .3rem .55rem; background: #111521; border-radius: .35rem; }
.stack-transcript { margin: .35rem .8rem .6rem; }
#step-list { max-height: 24rem; overflow: auto; padding-left: 2.2rem; }
.step-link { width: 100%; padding: .38rem .55rem; border: 0; border-radius: .3rem; background: transparent; color: var(--text); text-align: left; }
.step-link:hover, .step-link[aria-current="step"] { background: #302854; }
#legacy-list { display: grid; justify-items: start; gap: .35rem; }
@media (max-width: 820px) {
  .viewport-card { min-height: 17.5rem; }
}

.matrix td.record-cell { max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; }
.terminal-color { color: #fff; }
.terminal-color-light { color: #10121b; }
.variable { min-width: 0; max-width: 100%; flex-wrap: wrap; overflow-wrap: anywhere; }
#structure { min-width: 0; max-width: 60%; }

.menu-toggle { display: none; }
.matrix-actions { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .35rem; }
.matrix-actions #structure { max-width: min(11.5rem, 42vw); }
.fullscreen { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; border: 0; border-radius: 0; background: var(--bg); }
.fullscreen[open] { display: flex; flex-direction: column; }
html:has(.fullscreen[open]) { overflow: hidden; }
.fullscreen > header { flex: none; padding-inline: max(.7rem, env(safe-area-inset-left)); }
.all-structures { overflow: auto; overscroll-behavior: contain; flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr)); align-content: start; gap: .55rem; padding: .55rem; }
.structure-card { min-width: 0; padding: .45rem; border: 1px solid var(--line); border-radius: .45rem; background: var(--surface); }
.structure-grid { position: relative; overflow: auto; max-height: 24rem; }
.structure-grid .matrix td { min-width: 1.8rem; height: 1.75rem; }
@media (max-width: 1050px) {
  .menu-toggle { display: inline-flex; }
  .main-menu { display: none; width: 100%; }
  .menu-toggle[aria-expanded="true"] + .main-menu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .main-menu .button { white-space: normal; text-align: center; }
}
@media (max-width: 700px) {
}

/* Execution controls and panels keep their geometry as the cursor advances. */
.timeline { margin: 0 0 .85rem; }
.timeline-status { flex-wrap: wrap; justify-content: flex-end; }
.step-headline { min-width: 0; min-height: 1.4rem; max-height: 1.4rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; color: var(--muted); }
.current-step { margin-top: .85rem; padding: .7rem .9rem; height: 9rem; overflow: auto; }
.current-step .event-detail { align-items: flex-start; margin-top: .35rem; line-height: 1.45; }
#step-operations { margin: .35rem 0; padding-left: 1.25rem; color: var(--muted); font-size: .82rem; }
#all-steps { margin-top: .65rem; padding: .7rem .9rem; }
.view-column { min-width: 0; display: grid; gap: .65rem; grid-template-rows: minmax(15rem, 1fr) 8.2rem; }
.output-panel { display: flex; flex-direction: column; }
.output-panel .card-heading { min-height: 2.6rem; padding-block: .3rem; }
.output-panel .output { min-height: 0; flex: 1; overflow: auto; }
.output-panel .empty { padding: .45rem .9rem; }
.io-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.io-fields:not(:has(#expected-panel:not([hidden]))) { grid-template-columns: 1fr; }
.io-fields #restore-input { grid-column: 1 / -1; }
#expected { color: var(--muted); }
#structure-label { color: var(--muted); font-size: .78rem; }
.zoom-tools { display: inline-flex; align-items: center; gap: .16rem; }
.zoom-tools .button { min-height: 2rem; padding-inline: .4rem; }
.matrix { zoom: var(--matrix-zoom, 1); }
.matrix td.record-cell { min-width: 5rem; max-width: 13rem; padding: .3rem .35rem; white-space: normal; vertical-align: top; }
.record-diagram { text-align: left; font: .78rem/1.4 var(--mono); }
.record-field { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: .3rem; padding: .12rem 0; border-bottom: 1px solid #a3aec733; overflow-wrap: anywhere; }
.record-field:last-child { border-bottom: 0; }
.record-field dt { color: var(--muted); }
.record-field dt::after { content: ":"; }
.record-field dd { margin: 0; }
.variable-record { display: grid; gap: .2rem; }
.variable-record > dt { border-bottom: 1px solid var(--line); }
.stack-panel { height: 25rem; }
.stack-frames { flex: 1; min-height: 0; max-height: none; align-content: start; padding: .55rem .8rem; gap: .65rem; }
.stack-values .variables { align-items: flex-start; }
.stack-card .stack-frame { min-height: 2rem; }
.stack-frame-output { height: 3.6rem; }
.call-number:not(:empty) { margin-left: .55rem; color: var(--muted); font: .73rem var(--mono); }
@media (max-width: 700px) {
  .matrix-actions { justify-content: flex-end; }
  .viewport-card > .card-heading { flex-wrap: wrap; }
  .timeline-status .status { font-size: .75rem; }
}
.book-sample { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; }
.book-sample > * { min-width: 0; }
#guide { max-height: 90dvh; overflow: auto; }
@media (max-width: 480px) {
  .timeline-head { flex-wrap: wrap; }
  .timeline-status { justify-content: flex-start; }
}
.output-panel .output { padding: .45rem .85rem; }
.timeline-head { min-height: 2.3rem; }
@media (max-width: 700px) {
}
.fullscreen-header {
  flex: none;
  padding: .35rem .65rem;
  border-bottom: 1px solid var(--line);
}
#fullscreen-transport { width: min(100%, 42rem); margin-inline: auto; }
#fullscreen-transport .timeline-controls { gap: .35rem; }
#fullscreen-transport :is(.button, select) { min-height: 1.85rem; }
#fullscreen-transport .playback { min-width: auto; }
#fullscreen-transport .button-icon { min-width: 1.6rem; }
.fullscreen-body { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: .45rem; flex: 1; min-height: 0; padding: .45rem; }
.fullscreen-body .viewport-card { min-height: 0; }
.fullscreen-body .output-panel { max-height: min(30dvh, 12rem); }
.fullscreen-body .output-panel .output { margin: 0; }
.fullscreen-body .viewport-card > .card-heading { min-height: 2.25rem; padding: .2rem .5rem; justify-content: space-between; flex-wrap: nowrap; }
.fullscreen-body .step-headline { flex: 1; font-size: .8rem; }
.fullscreen-body .matrix-actions { flex: none; flex-wrap: nowrap; }
.fullscreen-body #fullscreen-close { min-height: 2rem; }
.fullscreen-body :is(#view-title, #fullscreen-open, #structure, #structure-label) { display: none; }
.fullscreen-body .all-structures { grid-template-columns: repeat(auto-fit, minmax(min(12rem, 100%), 1fr)); }
#study-statement { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 53dvh; }
.study-actions { margin-block: .65rem; align-items: center; }
#study-status:empty, #study-solution-status:empty { display: none; }
@media (max-width: 700px) {
  #fullscreen-transport #timeline-range { order: 0; flex: 1 1 2rem; min-width: 2rem; }
  #fullscreen-transport .step-count { margin-left: 0; }
  #fullscreen-transport .timeline-controls { flex-wrap: nowrap; }
  #fullscreen-transport #speed { padding: .2rem 1.2rem .2rem .35rem; background-position: right .2rem center; }
  .fullscreen-body .all-structures { grid-template-columns: repeat(auto-fit, minmax(min(7rem, 100%), 1fr)); }
}
