/* Chart tooltips and row selection, shared by the current figures. */
.td-tip.td-touch-tip{position:fixed;z-index:90;inset:auto 12px max(12px,env(safe-area-inset-bottom));display:flex;flex-direction:column;max-width:560px;min-width:0;max-height:min(52dvh,calc(100dvh - var(--td-head) - 24px),480px);margin:0 auto;padding:12px 16px;transform:none;pointer-events:auto;background:var(--bg);box-shadow:0 12px 40px var(--bg);backdrop-filter:none}
.td-touch-tip:not(.is-on){display:none}
.td-tip-head{display:flex;align-items:center;justify-content:space-between;flex:none;gap:12px;padding-bottom:8px;border-bottom:1px solid var(--edge)}
.td-tip-head .td-tip-title{min-width:0;margin:0}
.td-tip-body{min-height:0;overflow-y:auto;overscroll-behavior:contain;padding-top:8px}
.td-touch-tip .td-tip-title{font-size:13px;letter-spacing:.02em;line-height:1.5}
.td-tip.td-touch-tip .td-tip-row{grid-template-columns:12px minmax(0,1fr);gap:4px 8px;font-size:14px;line-height:1.5;padding:6px 0}
.td-tip.td-touch-tip.td-tip-plain .td-tip-row{grid-template-columns:minmax(0,1fr)}
.td-tip.td-touch-tip .td-tip-row b{grid-column:2;max-width:none;white-space:normal;text-align:left}
.td-tip.td-touch-tip.td-tip-plain .td-tip-row b{grid-column:1}
.td-touch-tip .td-tip-note{font-size:13px;line-height:1.55}
.td-touch-tip-close{display:block;flex:none;min-width:44px;min-height:44px;margin:0;padding:8px 14px;border:1px solid var(--edge2);border-radius:999px;background:var(--panel);color:var(--ink);font:600 14px var(--font);cursor:pointer}
.td-touch-tip-close:focus-visible{outline:2px solid var(--accent);outline-offset:3px}

.td-en-grambox{fill:var(--panel);stroke:var(--edge2);stroke-width:1}
.td-en-kind{font:600 11px var(--mono);letter-spacing:.04em;text-transform:uppercase;fill:var(--muted)}
.td-en-table-caption{font:500 12px var(--font);fill:var(--muted)}
.td-en-output{font:700 13px var(--font);fill:var(--ink)}

/* Benchmark figures on phones: the tapped row keeps a soft band and the other rows step back */
.td-hit-row{transition:opacity .2s}
.td-hit-row.is-dim{opacity:.4}
/* One band per row: a chart with a hit area for every cell marks those as .ta-cell-hit. */
.td-hit-row.is-on .td-hit:not(.ta-cell-hit){fill:color-mix(in srgb,var(--accent) 8%,transparent);rx:12px;x:-10px;width:calc(100% + 20px)}
@media(prefers-reduced-motion:reduce){.td-hit-row{transition:none}}

[data-td-chart="engram"] .td-en-line{stroke-dasharray:var(--td-path-length,420);stroke-dashoffset:var(--td-path-length,420)}
/* Fig. 07 reads in order: the lookup wires draw, the 16 rows light as they
   arrive, and only then do the wires from the rows to layer 2 draw. */
[data-td-chart="engram"] .td-en-line.is-out.is-on{animation-delay:.6s}
[data-td-chart="engram"] .td-en-cell.is-hit{transition-delay:.3s}
@media(prefers-reduced-motion:reduce){[data-td-chart="engram"] .td-en-line{animation:none!important;stroke-dashoffset:0!important}[data-td-chart="engram"] .td-en-cell{transition:none}}
