.player { min-width: 0; margin: 15px 0 0; background: #141c29; border: 1px solid var(--line); border-radius: 4px; }
.drawing { display: block; position: relative; aspect-ratio: 900/320; cursor: zoom-in; }
.drawing:focus-visible { outline-offset: -3px; }
.drawing img, .drawing canvas, .large-drawing img, .large-drawing canvas { display: block; width: 100%; height: 100%; object-fit: contain; }
.animated, #large-animation { position: absolute; inset: 0; }
.player-bar { display: none; align-items: center; gap: 9px; padding: 2px 6px; border-top: 1px solid var(--line); background: #1d232c; }
.reader-ready .player-bar { display: flex; }
.ctrl { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: .84rem; padding: 5px 8px; min-height: 33px; border: 0; border-radius: 3px; background: transparent; }
.ctrl:enabled:hover,.close-button:hover { background: #2b3542; }
.ctrl:disabled { color: #919cad; }
.controls-right, .dialog-controls > div { display: inline-flex; align-items: center; }
.controls-right { margin-left: auto; }
.play { color: var(--accent); }
.play-icon { width: 11px; height: 13px; background: currentColor; clip-path: polygon(5% 0,100% 50%,5% 100%); }
.play[aria-pressed=true] .play-icon { clip-path: polygon(0 0,32% 0,32% 100%,0 100%,0 0,67% 0,100% 0,100% 100%,67% 100%,67% 0); }
.step-count { font-size: .79rem; color: var(--quiet); font-variant-numeric: tabular-nums; }
.chevron { width: 6px; height: 6px; border: solid currentColor; border-width: 1.3px 1.3px 0 0; }
.chevron.prev { transform: rotate(-135deg); } .chevron.next { transform: rotate(45deg); }
.zoom { margin-left: 3px; }
.expand-icon { position: relative; width: 13px; height: 13px; }
.expand-icon:before,.expand-icon:after { content: ""; position: absolute; width: 6px; height: 6px; }
.expand-icon:before { top: 0; right: 0; border-top: 1.5px solid; border-right: 1.5px solid; }
.expand-icon:after { bottom: 0; left: 0; border-bottom: 1.5px solid; border-left: 1.5px solid; }
.step-rail ol { display: flex; gap: 2px 12px; list-style: none; flex-wrap: wrap; padding: 0; margin: 8px 0 14px; }
.step-link { display: inline-block; text-decoration: none; padding: 3px 0; font-size: .82rem; color: var(--muted); }
.step-link:hover, .step-link[aria-current] { color: var(--accent); text-decoration: underline; }
.step-number { font-variant-numeric: tabular-nums; font-weight: 620; }
.stage h2, .reading h2 { margin-bottom: 5px; } .stage { scroll-margin: 14px; }
.stage + .stage { margin-top: 16px; } .reader-ready .stage + .stage { margin-top: 0; }
.parameters dl > div { display: grid; grid-template-columns: minmax(115px,30%) minmax(0,1fr); gap: 12px; align-items: baseline; border-top: 1px solid var(--line); padding: 5px 0; font-size: .88rem; overflow-wrap: anywhere; }
.parameters dt { color: var(--muted); } .reading-note.parameters { margin-top: 14px; }
.takeaway { border-left: 2px solid #81a2cd; padding: 3px 0 3px 12px; margin-top: 19px; }
.takeaway h2, .analogy .analogy-label { font: 600 .81rem/1.4 Inter, sans-serif; color: var(--accent); margin-bottom: 3px; }
.analogy,.comparison,.details-block,.connected,.references,.chapter-words { margin-top: 22px; }
.table-scroll { overflow-x: auto; margin: 9px 0 5px; }
.table-scroll table { border-collapse: collapse; width: 100%; font-size: .89rem; line-height: 1.45; text-align: left; }
.table-scroll :is(th,td) { border-bottom: 1px solid var(--line); padding: 7px 9px 7px 0; vertical-align: top; }
.table-scroll thead th { color: var(--muted); font-size: .81rem; }
.comparison > p { font-size: .87rem; color: var(--muted); }
.reading-note { border-bottom: 1px solid var(--line); }
.reading-note summary { display: list-item; list-style-type: disclosure-closed; font-size: .94rem; padding: 8px 0; color: #d2dce9; }
.reading-note[open] > summary { list-style-type: disclosure-open; }
.reading-note summary::marker { font-size: .8em; color: var(--quiet); }
.reading-note p,.reading-note dl,.reading-note ul { margin: 0 0 10px; }
.explanation { border-bottom: 1px solid var(--line); }
.note-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 0; }
.note-heading h3 { font: 500 .94rem/1.45 Inter, sans-serif; padding: 4px 0; }
.book-ready .note-heading { cursor: pointer; }
.note-toggle { flex: none; display: grid; place-items: center; width: 32px; height: 31px; background: transparent; border: 0; color: var(--quiet); }
.note-toggle:after { content: ""; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1px 1px 0; transform: rotate(45deg); }
.note-toggle[aria-expanded=true]:after { transform: rotate(225deg); }
.explanation > p { padding-bottom: 10px; }
.connected ul,.references ul { padding-left: 21px; font-size: .9rem; }
.chapter-words ul { list-style: none; padding: 0; columns: 2; font-size: .84rem; }
.chapter-words li { break-inside: avoid; padding: 3px 0; }
.lesson-neighbours { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.lesson-neighbours > a { text-decoration: none; font-size: .9rem; }
.lesson-neighbours > a:hover { text-decoration: underline; }
.dialog-open { overflow: hidden; }
#diagram-dialog { width: min(1050px,calc(100% - 20px)); max-height: calc(100dvh - 20px); padding: 15px; border: 1px solid #556476; border-radius: 5px; background: #1c2129; color: var(--fg); }
#diagram-dialog::backdrop { background: #090d14bf; }
.dialog-head,.dialog-controls { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.close-button { width: 34px; height: 34px; flex: none; font-size: 1.4rem; line-height: 1; border: 1px solid var(--line); border-radius: 3px; background: transparent; }
.dialog-canvas { overflow-x: auto; margin: 10px 0; background: #141c29; }
.large-drawing { position: relative; min-width: 850px; aspect-ratio: 900/320; }
.pan-hint { display: none; font-size: .82rem; color: var(--muted); }
.gif-link { font-size: .83rem; }
#zoom-summary { margin-top: 8px; color: var(--muted); font-size: .92rem; line-height: 1.5; }
@media(max-width:920px) { .pan-hint { display: block; } }
@media(max-width:690px) { .ctrl { min-height: 40px; }.step-rail ol { gap: 2px 9px; }.dialog-controls { flex-wrap: wrap; }.parameters dl > div { gap: 6px; } }
@media(max-width:440px) { .player-bar .ctrl-word { display: none; }.controls-right .ctrl { min-width: 33px; }.zoom-word { font-size: .78rem; }.chapter-words ul { columns: 1; } }
@media(max-width:380px) {
  .player-bar { gap: 4px; padding-inline: 3px; }
  .player-bar .zoom-word { display: none; }
  .controls-right .ctrl { min-width: 37px; }
  .player-bar .play { padding-inline: 5px; }
}
