:root{color-scheme:dark;--purple:#593196;--panel:#221331;--ink:#f4eafd;--muted:#c7b5da;--a:#65d1e6;--b:#9ebcff;--line:#755686}
.data-summary{padding:7px 10px;margin:4px 0 10px;border-left:3px solid #acdf84;border-radius:4px;background:#2d1a40;font-size:12px;color:#e4d4f3}.response-control label{display:flex;justify-content:space-between;gap:6px}.response-control strong{color:#acdf84;white-space:nowrap}
.sequence-shifts{display:grid;grid-template-columns:1fr 1fr;gap:6px 18px;padding:8px 12px;border-radius:7px;background:#221331}.sequence-shifts label{display:flex;justify-content:space-between;gap:6px;font-size:11px}.sequence-shifts strong{color:#acdf84}.sequence-shifts input[type=range]{margin:5px 0}.pair-settings{border-top:1px solid #6a4e7d;margin-top:10px;padding-top:8px;font-size:11px}.pair-settings .index-control{border:0;padding-top:0;margin-top:4px}@media(max-width:640px){.settings>.pair-settings{grid-column:1/-1}.sequence-shifts{gap:5px 12px}.sequence-shifts label{display:block}.sequence-shifts strong{display:block}}
*{box-sizing:border-box}body{margin:0;background:var(--purple);color:var(--ink);font:13px/1.45 system-ui,-apple-system,sans-serif}a{color:inherit}button,input,select{font:inherit}button,select,input:not([type=range]):not([type=checkbox]){border:1px solid #856a9a;border-radius:5px;background:#1d112b;color:var(--ink);min-height:28px;padding:3px 8px;font-size:12px}button{cursor:pointer;white-space:nowrap}button:hover{background:#49305d}button:disabled{opacity:.45;cursor:default}button.primary{background:#ead5fd;color:#21112f;border-color:#ead5fd;font-weight:650}button:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible,[tabindex]:focus-visible{outline:2px solid #ffcb64;outline-offset:3px}input[type=range]{width:100%;accent-color:#c9ef90;margin:8px 0}input[type=checkbox]{accent-color:#c9ef90}input{min-width:0}label{display:block;font-size:12px;font-weight:600;margin:6px 0 3px}small,.hint{font-size:11px;color:var(--muted);line-height:1.45}.hint{margin:7px 0}p{margin:6px 0 10px}h1,h2{line-height:1.2}h1{font-size:clamp(22px,2.4vw,30px);margin:5px 0 9px}h2{font-size:15px;margin:0 0 10px}.site-header{display:flex;justify-content:space-between;align-items:center;gap:15px;padding:10px 22px;background:#21112f;font-size:12px}.site-header>a{font-weight:700;text-decoration:none}.site-header nav{display:flex;gap:20px}.skip{position:absolute;left:15px;top:-60px;padding:8px;background:#21112f;z-index:10}.skip:focus{top:10px}main{max-width:1280px;margin:auto;padding:18px 22px}.intro{display:grid;grid-template-columns:1fr auto;align-items:center;gap:26px;margin-bottom:18px}.intro p{max-width:550px;margin-bottom:0}.eyebrow{font-size:10px;letter-spacing:.08em;font-weight:700}.eyebrow span{color:#d1b5e8;margin-left:12px}.identity{padding:13px 20px;border-radius:10px;background:var(--panel);font-size:16px}.identity small{display:block;margin-top:8px}.workspace{display:grid;grid-template-columns:205px minmax(0,1fr);gap:14px;align-items:start}.settings{background:var(--panel);border-radius:10px;padding:13px}.settings select,.settings input:not([type=range]):not([type=checkbox]){width:100%}.settings button.primary,.settings>button{width:100%;margin-top:5px}.settings fieldset{border:0;border-top:1px solid #6a4e7d;padding:6px 0 2px;margin:13px 0 0}.settings legend{font-size:12px;font-weight:700;padding:0 7px 0 0}.a{color:var(--a)}.b{color:var(--b)}.sample-range{display:grid;grid-template-columns:1fr 76px;gap:4px 8px;align-items:center;margin-top:7px}.sample-range label{margin:0;font-weight:500}.sample-range input{width:76px!important}.check{display:flex;align-items:center;gap:5px;font-weight:400}.index-control{border-top:1px solid #6a4e7d;margin-top:10px;padding-top:8px}.index-control label{display:flex;justify-content:space-between}.settings #k-input{width:100%}.settings #input-error{color:#ffd09c;margin:6px 0;font-size:11px}.settings #input-error:empty{display:none}#edit-status{font-size:10px;color:#baadcc;margin:5px 0}.lab{min-width:0}.mode-tabs{display:flex;gap:4px;margin-bottom:8px}.mode-tabs button{font-size:13px;flex:1;min-height:32px;border-radius:7px}.mode-tabs [aria-selected=true]{background:#eedcfa;color:#21112f;border-color:#eedcfa;font-weight:650}.playbar{display:flex;gap:6px;align-items:center;flex-wrap:wrap;margin-bottom:8px}.playbar label{display:flex;gap:5px;align-items:center;font-weight:400;margin:0;font-size:11px}.playbar select{min-height:26px}.playbar #progress{font-size:11px;color:#deceed;margin-left:auto}.stages{display:flex;gap:4px;flex-wrap:wrap}.stages button{flex:1;min-height:27px;font-size:11px;padding:3px 6px}.stages [aria-pressed=true]{background:#c6ed91;color:#213416;border-color:#c6ed91}.phase-explanation{min-height:63px;padding:8px 1px;font-size:12px}.phase-explanation p{margin:0 0 4px}.math-line{font-size:14px;overflow-x:auto;overflow-y:hidden;min-width:0;padding:2px 0}.math-line mjx-container{margin:0!important}.plot-board{border:1px solid #755686;background:#261833;border-radius:8px;overflow:hidden;color:#f4eafd}.plot-board svg[data-chart]{display:block;width:100%;height:auto;background:#261833;color:#f4eafd;font:11px system-ui,sans-serif;touch-action:pan-y}.plot-board .axis{stroke:#a794bb;stroke-width:1}.plot-board .grid{stroke:#51405f;stroke-dasharray:3 4}.plot-board .tick{fill:#c2b0cf;font-size:10px}.plot-board .row-title{font-weight:650;font-size:12px;fill:#f4eafd}.plot-board .row-subtitle{font-size:10px;fill:#baacc9}.plot-board .value{font-size:11px;fill:#f6eafa;font-weight:600}.plot-board .drag{cursor:ns-resize;touch-action:none}.plot-board .pick,.plot-board .pair{cursor:pointer}.plot-board .drag:focus,.plot-board .pick:focus,.plot-board .pair:focus{outline:none}.plot-board .drag:focus>circle:last-of-type,.plot-board .pick:focus>circle:last-of-type,.plot-board .pair:focus>circle:last-of-type{stroke:#cb8410;stroke-width:2}.inspector{padding:9px 11px;margin-top:8px;background:var(--panel);border-radius:7px;display:flex;align-items:center;flex-wrap:wrap;gap:8px 20px}.inspector label{display:flex;gap:6px;align-items:center;white-space:nowrap;margin:0}.inspector input{width:66px}.inspector p{margin:0}.inspector #sum-equation{flex-basis:100%}.board-hint{font-size:11px;color:var(--muted);margin:8px 0}.ledger{margin-top:8px;background:var(--panel);border-radius:7px;padding:7px 11px;font-size:12px}summary{cursor:pointer;font-weight:600}.table-wrap{overflow:auto;max-height:260px;margin-top:8px}table{border-collapse:collapse;width:100%;text-align:right;font-size:11px}th,td{padding:4px 8px;border-bottom:1px solid #4d365d}th{position:sticky;top:0;background:#2b193c}tr.selected{background:#694224}tr.zero{color:#9f8eaf}.copy-pager{display:flex;gap:6px;align-items:center;flex-wrap:wrap;font-size:11px;margin:0 0 7px}.copy-pager span{margin-right:auto}.copy-pager button{font-size:11px;min-height:25px}#copies-note{margin-top:8px}.understanding{display:grid;grid-template-columns:1fr 1fr;gap:22px;margin:23px 0;font-size:12px}.understanding h2{font-size:15px}.sources{font-size:11px;color:#dac8ea;padding:10px 13px;background:#3e2267;border-radius:7px}footer{display:flex;justify-content:space-between;gap:15px;padding:16px 0 5px;font-size:10px;color:#cab5dd}[hidden]{display:none!important}@media(max-width:850px){main{padding:14px}.workspace{grid-template-columns:190px minmax(0,1fr)}.intro{gap:12px}.identity{font-size:14px;padding:10px}.playbar #progress{width:100%;margin:0}.stages button{font-size:10px;padding:3px 4px}}@media(max-width:640px){.site-header{padding:9px 12px}.site-header nav{gap:10px;font-size:10px}main{padding:12px 9px}.intro{display:block;margin-bottom:13px}.intro p{font-size:12px}.identity{margin-top:10px;font-size:14px}.workspace{grid-template-columns:1fr;gap:12px}.settings{display:grid;grid-template-columns:1fr 1fr;gap:3px 10px;padding:11px}.settings h2,.settings>label[for=preset],.settings>select#preset,.settings form,.settings>.hint{grid-column:1/-1}.settings h2{margin-bottom:2px}.settings form{display:grid;grid-template-columns:1fr 1fr;gap:3px 12px}.settings fieldset{margin-top:7px;min-width:0}.settings form>p,.settings form>button{grid-column:1/-1}.sample-range{grid-template-columns:1fr 66px;gap:4px}.sample-range input{width:66px!important}.settings .index-control{grid-column:1/-1;margin-top:3px}.settings .index-control #k-input{width:85px}.settings #output-index{width:calc(100% - 95px);margin-left:8px;vertical-align:middle}.settings>label[for=view-range]{align-self:center}.settings>.check{grid-column:1/-1}.settings>button{grid-column:1/-1;width:auto;justify-self:start}.settings>.hint{margin:2px 0;font-size:10px}.mode-tabs button{font-size:12px}.understanding{grid-template-columns:1fr;gap:10px}.stages button{flex:auto}.inspector{gap:7px;font-size:11px}.math-line{font-size:12px}.board-hint{font-size:10px}footer span{display:none}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}

.math-window{position:fixed;right:16px;bottom:16px;width:min(450px,calc(100vw - 24px));max-height:45vh;z-index:30;border:1px solid #ac89ca;border-radius:9px;background:#221331;box-shadow:0 10px 35px #10051f88;overflow:hidden;color:#f4eafd}.math-window>header{display:flex;align-items:center;gap:6px;padding:8px 10px;background:#39204f;cursor:move;touch-action:none}.math-window h2{font-size:14px;flex:1;margin:0;white-space:nowrap}.math-window header button{font-size:11px;min-height:25px;padding:2px 7px}.math-window #math-close{font-size:19px;line-height:1;padding:0 8px}.math-window-body{padding:10px 13px;overflow:auto;max-height:calc(45vh - 45px);font-size:12px}.math-window h3{font-size:12px;margin:12px 0 5px;color:#c6ed91}.math-window .math-line{font-size:14px;padding:5px 0}.math-window #math-context{font-weight:650;color:#dbc5ed;font-size:11px}.math-window #math-window-status{margin:0 0 8px}.math-window [aria-pressed=true]{background:#c6ed91;color:#213416}.math-window:focus-within{border-color:#d9b7f5}@media(max-width:640px){.math-window{right:12px;bottom:12px;max-height:45vh}.math-window-body{max-height:calc(45vh - 45px)}.math-window h2{font-size:12px}.math-window header{gap:4px}.math-window #math-move{font-size:10px;padding:2px 5px}.math-window .math-line{font-size:12px}}
.inspector:has(p[hidden]+p[hidden]){display:none}.settings #pair-index{width:100%}@media(max-width:640px){.settings .index-control #pair-index{width:85px}.settings #input-index{width:calc(100% - 95px);margin-left:8px;vertical-align:middle}}

@media(max-width:640px){.mode-tabs button{font-size:11px;padding:3px 5px}}

/* One palette for values, formulas and plot rows. Labels and gold rings also
   identify the selection, so the correspondence does not rely on colour alone. */
:root{--a:#59cde6;--b:#98b4ff;--p:#acdf84;--c:#d7a6fb}
.example-math{background:#221331;border:1px solid #755686;border-radius:7px;padding:8px 11px;margin:7px 0 10px}.example-math summary{font-size:12px}.example-math .math-line{font-size:13px;margin:5px 0}.example-math .hint{margin:5px 0;font-size:10px}
.p{color:var(--p)}.c{color:var(--c)}.selected-key{color:#ffd06a}
.plot-key{display:flex;flex-wrap:wrap;gap:4px 13px;font-size:11px;margin:6px 0 8px;font-weight:600}
.plot-link{padding:8px 11px;border:1px solid #755686;background:#221331;border-radius:7px;margin-bottom:10px}
.link-label{display:block;color:#dbc5ed;font-size:10px;font-weight:600;margin-top:2px}
.plot-link .math-line{font-size:12px}.plot-link p{margin-bottom:0;font-size:10px}
.math-piece{display:inline-block;vertical-align:middle}.math-piece mjx-container{display:inline-block!important}
#math-grids .math-piece{display:block;margin:3px 0}
.copy-0{color:#98b4ff}.copy-1{color:#ffbb75}.copy-2{color:#90dbb4}.copy-3{color:#d7a6fb}.copy-4{color:#ff95b7}.copy-5{color:#59cde6}
.math-window .math-term{display:block;width:100%;text-align:left;white-space:normal;padding:5px 8px;margin:4px 0;background:#2a1939;border:1px solid #725184;border-left:3px solid transparent;color:#f4eafd}
.math-window .math-term[aria-pressed=true]{background:#392747;color:#f4eafd;border-color:#ffd06a;border-left-color:#ffd06a}
.math-term .term-position{display:block;color:#dbc5ed;font-size:10px;margin-bottom:1px}
.math-window .math-term .math-line{display:block;font-size:12px;padding:1px 0}
.math-window .copy-pager{margin-top:7px}.math-window #math-progress-note{border-left:2px solid var(--c);padding-left:7px}

/* Keep the four aligned stem rows readable as one teaching diagram. */
.phase-explanation{min-height:0;padding:6px 1px}
.phase-explanation .math-line{font-size:13px}
.plot-board .value{paint-order:stroke fill;stroke:#261833;stroke-width:3px;stroke-linejoin:round}
.plot-board .tick{font-variant-numeric:tabular-nums}
.plot-board .row-subtitle{fill:#d1bedf}
.plot-board .selection-ring{filter:drop-shadow(0 0 2px #ffd06a66)}
.plot-link .hint{max-width:85ch}
@media(max-width:640px){.plot-board .row-subtitle{font-size:9px}.plot-board .tick{font-size:9px}.plot-board .value{font-size:10px}.plot-board .row-title{font-size:11px}}

/* Coincident stems retain their exact coordinates: a wide cyan shaft and a
   narrow blue shaft with an open head reveal both amplitudes on one scale. */
#slide-board .overlay-input>g>line{stroke-width:5px;stroke-opacity:.55}
#slide-board .overlay-kernel>g>line{stroke-width:2px}
#slide-board .overlay-kernel>g>circle:first-of-type{fill:none;stroke-width:2px;r:5px}
#slide-board .overlay-kernel>g[data-selected]>circle:first-of-type{r:6px}
#slide-board .selected-sum{font-weight:650}
.overlay-control{display:flex;gap:6px;align-items:center;margin:6px 0;font-size:12px;font-weight:500}
#slide-board .overlay-kernel .value{transform:translateY(-12px)}

.slide-controls{background:#221331;border:1px solid #755686;border-radius:7px;padding:5px 10px;margin:6px 0 9px}.slide-controls label[for=slide-output-index]{display:flex;justify-content:space-between;gap:10px}.slide-controls strong{color:#c9ef90}.slide-controls input[type=range]{margin:4px 0}.limits{font-size:11px;margin:8px 0}@media(max-width:640px){.settings>.limits{grid-column:1/-1}.slide-controls label{font-size:11px}}

/* Math panels scale together; the floating window has independent dimensions. */
:root{--math-scale:1}
.math-line{font-size:calc(14px * var(--math-scale))}.example-math .math-line{font-size:calc(13px * var(--math-scale))}.plot-link .math-line{font-size:calc(12px * var(--math-scale))}
.math-window{display:flex;flex-direction:column;height:min(45vh,600px);min-width:min(300px,calc(100vw - 16px));min-height:min(200px,calc(100vh - 16px));max-width:calc(100vw - 16px);max-height:calc(100vh - 16px);font-size:calc(12px * var(--math-scale))}
.math-window>header{flex:none;flex-wrap:wrap}.math-window h2{font-size:1.17em;min-width:0}.math-window-body{flex:1;min-height:0;max-height:none;font-size:inherit;padding-bottom:26px}
.math-window .math-line{font-size:1.17em}.math-window h3{font-size:1em}.math-window .hint{font-size:.92em}.math-window #math-context,.math-window .plot-key{font-size:.92em}.math-window .math-term{font-size:inherit}.math-window .math-term .math-line{font-size:1em}.math-window .term-position{font-size:.83em}
.math-size-controls{display:flex;align-items:center;flex-wrap:wrap;gap:5px;padding:5px 9px;background:#2a1939;border-bottom:1px solid #725184;flex:none;font-size:11px}.math-size-controls label{margin:0;font-size:11px}.math-size-controls button{min-height:25px;font-size:11px;padding:2px 6px}.math-size-controls input[type=range]{flex:1;min-width:60px;width:80px;margin:0}.math-size-controls output{min-width:37px;font-variant-numeric:tabular-nums}
.window-resize{position:absolute;right:1px;bottom:1px;width:24px;height:24px;min-height:24px;padding:0;border:0;border-radius:5px 0 7px 0;background:#39204f;color:#e9d5fa;cursor:nwse-resize;touch-action:none;font-size:18px}
@media(max-width:640px){.math-window{max-height:calc(100vh - 16px)}.math-window-body{max-height:none}.math-window .math-line{font-size:1.05em}.math-window h2{flex-basis:100%}.math-size-controls{gap:4px}.math-size-controls label{width:100%}}
.phase-explanation .math-line{font-size:calc(13px * var(--math-scale))}

/* Window borders provide the familiar mouse resize targets. */
.math-window>header{user-select:none}
.math-window-body{margin:0 6px 6px;padding-left:7px;padding-right:7px}
.math-window[data-interacting]{user-select:none}
.window-edge{position:absolute;z-index:2;touch-action:none}
.window-edge-n,.window-edge-s{left:12px;right:12px;height:7px;cursor:ns-resize}.window-edge-n{top:0}.window-edge-s{bottom:0;right:25px}
.window-edge-w,.window-edge-e{top:12px;bottom:12px;width:7px;cursor:ew-resize}.window-edge-w{left:0}.window-edge-e{right:0;bottom:25px}
.window-edge-nw,.window-edge-ne,.window-edge-sw{width:13px;height:13px}.window-edge-nw{left:0;top:0;cursor:nwse-resize}.window-edge-ne{right:0;top:0;cursor:nesw-resize}.window-edge-sw{left:0;bottom:0;cursor:nesw-resize}
.window-resize{z-index:3}
