/* Hand-built figures for lesson 18, Long context and efficient architectures. */

/* shared: controls, readouts, bars, tables, grids, charts */
.ea-top { margin: 0 0 16px; }
.ea-slider input { width: min(200px, 50vw); }
.ea-slider.off { opacity: 0.4; }
.ea-slider sub { font-size: 0.7em; }
.seg.ea-wrap { flex-wrap: wrap; border-radius: 18px; max-width: 100%; }
.seg.ea-wrap button { height: auto; min-height: 28px; padding: 4px 12px; white-space: normal; text-align: left; line-height: 1.3; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ea-two { display: grid; gap: 22px 28px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 860px) { .ea-two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.ea-two .kicker { margin-bottom: 8px; }
.ea-big { font: 400 1.7rem/1.2 var(--f-display); margin: 6px 0; overflow-wrap: anywhere; }
.ea-big b { font-weight: 400; color: var(--gold); }
.ea-big small { display: block; font: 0.8rem var(--f-mono); color: var(--ink-3); margin-top: 2px; }
.ea-work { font: 0.9rem/1.65 var(--f-mono); color: var(--ink-2); margin: 0 0 8px; overflow-wrap: anywhere; }
.ea-work b { color: var(--ink); }
.ea-read { font-size: 0.85rem; color: var(--ink-2); margin: 8px 0 0; line-height: 1.5; }
.ea-verdict { margin-top: 14px; }
.ea-mult { font-size: 0.85rem; color: var(--gold); min-height: 1.4em; margin: 6px 0 0; font-variant-numeric: tabular-nums; }
.ea-bar { position: relative; height: 18px; border-radius: 9px; background: var(--surface-2); overflow: visible; margin: 10px 0 4px; }
.ea-bar i { display: block; height: 100%; border-radius: 9px; background: var(--accent); transition: width 0.25s; min-width: 2px; }
.ea-bar i.over { background: var(--bad); }
.ea-bar.log i { background: var(--c3); }
.ea-gpu-line { position: absolute; top: -6px; bottom: -6px; border-left: 2px dashed var(--ink-3); }
.ea-gpu-line em { position: absolute; left: 6px; top: -4px; font: 0.7rem var(--f-mono); color: var(--ink-3); white-space: nowrap; }
.ea-bar.gpu { margin-bottom: 26px; }
.ea-table { border-collapse: collapse; width: 100%; font: 0.86rem var(--f-ui); }
.ea-table th { text-align: left; font: 500 0.66rem var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); padding: 6px 8px; border-bottom: 1px solid var(--line-2); }
.ea-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); color: var(--ink-2); vertical-align: middle; }
.ea-table td.num { font-family: var(--f-mono); color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ea-table td.lost { color: var(--bad); }
.ea-table tr.fix td { color: var(--gold); }
.ea-mask { width: 100%; max-width: 330px; height: auto; display: block; }
.ea-cell { fill: var(--surface-2); }
.ea-cell.future { fill: transparent; stroke: var(--line); stroke-width: 0.5; }
.ea-cell.on { fill: var(--accent); }
.ea-cell.on.reach { fill: var(--c3); }
.ea-cell.row { fill-opacity: 0.45; stroke: var(--gold); stroke-width: 1; }
.ea-cell.row.on { fill-opacity: 1; }
.ea-grid-lbl, .ea-grid-tick { font: 11px var(--f-mono); fill: var(--ink-3); }
.ea-chart { width: 100%; height: auto; display: block; }
.ea-grid { stroke: var(--line); }
.ea-axis { stroke: var(--ink-3); }
.ea-tick { font: 12px var(--f-mono); fill: var(--ink-3); }
.ea-tick.strong { fill: var(--ink-2); font-weight: 600; }
.ea-line { fill: none; stroke-width: 2.5; stroke-linejoin: round; }
.ea-line.sel { stroke: var(--accent); } .ea-line.fix { stroke: var(--gold); }
.ea-dot.sel { fill: var(--accent); } .ea-dot.fix { fill: var(--gold); }
.ea-inbar { fill: var(--ink-3); fill-opacity: 0.45; }
.ea-inbar.mark { fill: var(--bad); fill-opacity: 0.75; }
.ea-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font: 0.8rem var(--f-ui); color: var(--ink-3); margin: 6px 0 16px; }
.ea-legend .key, .ea-lines .key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 6px; }
.key.sel { background: var(--accent); } .key.fix { background: var(--gold); } .key.bar { background: var(--ink-3); opacity: 0.6; }
.ea-num input, .ea-inputs input { width: 3.6em; font: inherit; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 6px; padding: 3px 6px; }
.ea-inputs { display: inline-flex; gap: 6px; align-items: center; color: var(--ink-3); }

/* hero */
.eh { width: 100%; height: auto; display: block; max-width: 900px; margin: 0 auto; }
.eh-tok { fill: var(--ink-3); } .eh-tok.new { fill: var(--gold); }
.eh-tok-lbl { font: 13px var(--f-mono); fill: var(--ink-3); }
.eh-state { opacity: 0; transition: opacity 0.7s var(--ease); }
.eh-state.in { opacity: 1; }
.eh-arc { fill: none; stroke: var(--accent); stroke-opacity: 0.35; stroke-width: 1.2; }
.eh-arc.on { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-opacity: 1; }
.eh-band { fill: var(--accent); fill-opacity: 0.14; stroke: var(--accent); stroke-opacity: 0.5; }
.eh-pour { fill: none; stroke: var(--c3); stroke-opacity: 0.35; stroke-width: 1.2; }
.eh-pot { fill: var(--surface); stroke: var(--c3); stroke-width: 2; }
.eh-pot-lbl { font: 600 13px var(--f-ui); fill: var(--ink); }
.eh-lbl { font: 400 17px var(--f-display); fill: var(--ink); }
@media (max-width: 600px) { .eh-lbl { font-size: 23px; } .eh-tok-lbl { font-size: 17px; } }

/* 1: two bills */
.ea-bills { display: grid; gap: 22px 28px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .ea-bills { grid-template-columns: 1fr 1fr; } }
.ea-bill .kicker { margin-bottom: 4px; }

/* 2b: the rolling buffer */
.ea-slots { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.ea-slot { min-width: 96px; padding: 8px 10px; border-radius: var(--r-1); border: 1px solid var(--line-2); background: var(--surface-2); font-family: var(--f-ui); display: grid; gap: 2px; }
.ea-slot-n { font: 500 0.64rem var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.ea-slot b { font: 500 0.95rem var(--f-mono); color: var(--ink); }
.ea-slot small { font: 0.72rem var(--f-ui); color: var(--bad); min-height: 1.2em; }
.ea-slot.new { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); }
.ea-slot.empty b { color: var(--ink-3); }
.ea-cap { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.ea-cap .kicker { margin-bottom: 6px; }
.ea-cap .controls { margin-top: 0; }
.ea-cap-read { font-size: 0.9rem; color: var(--ink-2); margin: 12px 0 0; line-height: 1.5; }
.ea-cap-read b { color: var(--ink); }

/* 3: sparse */
.ea-sparse-side .ea-big { margin-top: 0; }
.ea-sparse-side .kicker { margin-top: 18px; }

/* 4: the pot */
.ea-pot-table tr.out td { opacity: 0.4; }
.ea-pot-table tr.now td { background: var(--accent-soft); }
.ea-pot-state { display: flex; gap: 28px; margin-top: 12px; }
.ea-pot-state b { display: block; font: 400 1.5rem var(--f-display); color: var(--gold); }
.ea-pot-side .ea-big { font-size: 1.4rem; }

/* 5a: two roads */
.ea-kernel { display: grid; gap: 6px; margin: 4px 0 12px; }
.ea-kbar { display: grid; grid-template-columns: 50px 1fr 64px; gap: 10px; align-items: center; font: 0.82rem var(--f-mono); color: var(--ink-3); }
.ea-kbar-track { height: 14px; border-radius: 7px; background: var(--surface-2); overflow: hidden; }
.ea-kbar-track i { display: block; height: 100%; background: var(--c3); transition: width 0.2s; }
.ea-kbar b { color: var(--ink); text-align: right; font-weight: 500; }

/* 5b: selective recall */
.ea-big .sel b { color: var(--accent-ink); } .ea-big .fix b { color: var(--gold); }
.ea-big .sel, .ea-big .fix { display: inline-block; margin-right: 18px; font-size: 1rem; font-family: var(--f-ui); color: var(--ink-3); }
.ea-big .sel b, .ea-big .fix b { font: 400 1.7rem var(--f-display); }

/* 5c: the scan */
.ea-scan { display: grid; gap: 10px; }
.ea-round { display: grid; gap: 4px; }
.ea-round:not(.in) .ea-chips { visibility: hidden; }
.ea-round:not(.in) .ea-round-lbl { opacity: 0.45; }
.ea-round-lbl { font: 500 0.66rem var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.ea-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ea-chip { padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface-2); font: 0.78rem var(--f-mono); color: var(--ink-2); white-space: nowrap; }
.ea-chip.merged { border-color: var(--gold); }
.ea-chip b { color: var(--ink); }

/* 5d: backpacks and suitcases */
.ea-stack { display: grid; grid-template-columns: repeat(16, 1fr); gap: 4px; max-width: 520px; margin: 4px 0 14px; }
.ea-stack i { aspect-ratio: 1; border-radius: 4px; background: var(--c3); opacity: 0.55; }
.ea-stack i.att { background: var(--accent); opacity: 1; border-radius: 2px; }

/* 6a: the bill per token */
.ea-heads { display: flex; flex-wrap: wrap; gap: 10px 14px; margin: 4px 0 12px; }
.ea-binder { display: inline-flex; align-items: center; gap: 3px; }
.ea-binder i { width: 14px; height: 20px; border-radius: 3px; background: var(--accent); }
.ea-binder em { width: 6px; height: 10px; border-radius: 2px; background: var(--ink-3); opacity: 0.6; }

/* 6b: the latent kitchen */
.ea-kitchen-in { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-bottom: 16px; font-size: 0.9rem; }
.ea-kitchen-in .kicker { display: inline; margin-right: 8px; }
.ea-num { display: inline-block; margin-right: 4px; }
.ea-two.kitchen .ea-big { font-size: 1.3rem; }

/* 6c: one ruler */
.ea-two.ruler .ea-slider { margin: 6px 0; font-size: 0.85rem; }
.ea-ruler { width: 100%; height: auto; display: block; margin-top: 8px; }
.ea-rtick { stroke: var(--ink-3); }
.ea-rdot { fill: var(--gold); }
.ea-rsnap { fill: var(--bad); }
.ea-rmove { stroke: var(--bad); stroke-width: 2; }

/* putting it together: memory lines */
.ea-chart.lines { max-width: 760px; }
.ea-gpu { stroke: var(--ink-3); stroke-dasharray: 5 4; }
.ea-line.design { stroke-width: 2.2; }
.ea-cursor { stroke: var(--gold); stroke-dasharray: 3 3; }
.ea-lines { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px 20px; grid-template-columns: 1fr; font-size: 0.85rem; }
@media (min-width: 760px) { .ea-lines { grid-template-columns: 1fr 1fr; } }
.ea-lines li { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 3px 0; border-bottom: 1px solid var(--line); }
.ea-lines label { display: flex; align-items: center; gap: 6px; color: var(--ink-2); cursor: pointer; }
.ea-lines .key { background: var(--c); }
.ea-lines b { font-family: var(--f-mono); font-weight: 500; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
