* { box-sizing: border-box; }
:root {
  color-scheme: light dark;
  --ink: #292524;
  --muted: #57534e;
  --sand: #e5dccd;
  --control: #f4efe6;
  --line: #c4b8a6;
  --rule: #ded6c9;
  --gold: #deaf4b;
  --rust: #935218;
  --truth: #286847;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f6f2eb;
    --muted: #bfb9ae;
    --sand: #434047;
    --control: #21222a;
    --line: #716c66;
    --rule: #38383d;
    --gold: #c69b48;
    --rust: #e9b071;
    --truth: #8ccbaa;
  }
}
body { margin:0; background:transparent; color:var(--ink); font:16px/1.45 system-ui,sans-serif; }
main { max-width:1080px; margin:auto; padding:1.6rem 3px; border-block:1px solid var(--rule); }
h1 { margin:0 0 1.25rem; font-size:clamp(1.3rem,2vw,1.65rem); letter-spacing:-.035em; }
h1 small { margin-left:.45em; color:var(--muted); font-size:.76em; letter-spacing:0; font-weight:500; }
#gallery { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:22px; }
button { font:inherit; cursor:pointer; }
.thumb { padding:0; border:2px solid var(--sand); background:var(--sand); border-radius:7px; overflow:hidden; width:clamp(68px,9vw,116px); aspect-ratio:16/9; opacity:.62; }
.thumb img { display:block; width:100%; height:100%; object-fit:cover; }
.thumb[aria-pressed=true], .thumb:hover { opacity:1; border-color:var(--rust); }
.thumb:focus-visible, .cell:focus-visible { outline:2px solid var(--ink); outline-offset:2px; }
.explorer { display:grid; grid-template-columns:minmax(160px,.8fr) repeat(2,minmax(0,1fr)); align-items:start; gap:clamp(12px,2vw,28px); }
.time,.view { text-transform:uppercase; font-size:.8rem; color:var(--muted); }
.time { margin-left:24px; }
#pad { display:grid; grid-template-columns:18px 1fr; gap:6px; padding:6px 0; }
.view { writing-mode:vertical-rl; }
.dataset-control {
  display:grid; grid-template-columns:9.25rem minmax(0, 1fr); align-items:center;
  gap:14px; max-width:42rem; margin-bottom:10px; color:var(--ink); font-size:.91rem; font-weight:600;
}
.dataset-control:has(#protocol) { margin-bottom:20px; }
.select-field { position:relative; display:block; min-width:0; }
.select-field:has(#dataset) { max-width:17rem; }
.select-field select {
  appearance:none; width:100%; min-height:44px; padding:10px 42px 10px 14px;
  border:1px solid var(--line); border-radius:7px; background:var(--control);
  color:var(--ink); font:500 .94rem/1.4 Inter,system-ui,sans-serif;
  cursor:pointer; text-overflow:ellipsis;
}
.select-field::after {
  content:""; position:absolute; pointer-events:none; right:17px; top:50%;
  width:7px; height:7px; border:solid var(--muted); border-width:0 1.6px 1.6px 0;
  transform:translateY(-70%) rotate(45deg);
}
.select-field select:hover { border-color:var(--rust); }
.select-field select:focus-visible { outline:2px solid var(--rust); outline-offset:2px; }
@media(max-width:580px) {
  .dataset-control { grid-template-columns:minmax(0,1fr); gap:5px; }
  .select-field:has(#dataset) { max-width:none; }
}
#pad.trajectory { display:block; }
.trajectory .view { display:none; }
.trajectory .cell { width:100%; min-width:0; min-height:32px; aspect-ratio:auto; }
#grid { display:grid; grid-template-columns:repeat(8,1fr); gap:4px; }
#pad.short-window { width:calc(50% + 10px); }
.cell { aspect-ratio:1; background:var(--sand); border:0; border-radius:4px; padding:0; }
.cell.context,.legend .context { background:var(--gold); }
.cell[aria-pressed=true],.legend .current { background:var(--rust); }
.cell[aria-pressed=true] { outline:2px solid var(--rust); outline-offset:1px; }
button:focus-visible { outline:3px solid var(--rust); outline-offset:2px; }
.legend { display:flex; flex-wrap:wrap; gap:6px 12px; margin-top:12px; font-size:.85rem; color:var(--muted); }
.legend i { display:inline-block; width:12px; height:12px; background:var(--sand); border-radius:3px; margin-right:5px; }
aside p,footer,output { font-size:.85rem; color:var(--muted); }
#play { border:1px solid var(--line); background:var(--control); color:var(--ink); border-radius:6px; padding:4px 9px; font-size:.8rem; }
figure { margin:0; }
figure img { display:block; width:100%; aspect-ratio:1; border-radius:10px; border:1px solid var(--rule); }
figcaption { font-weight:700; margin-top:5px; color:var(--ink); }
output:empty { display:none; }
output { display:block; margin-top:16px; font-variant-numeric:tabular-nums; }
footer { margin-top:14px; }
.explorer { grid-template-columns:minmax(155px,1fr) minmax(0,3fr); }
#panels { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
#panels img { border-color:var(--sand); }
#panels #prediction { border-color:var(--rust); }
#panels #truth { border-color:var(--truth); }
#panels figcaption { color:var(--ink); }
#panels figure:nth-child(2) figcaption { color:var(--truth); }
#inputs { display:grid; grid-template-columns:repeat(auto-fit,minmax(80px,1fr)); gap:8px; }
#inputs figcaption { font-size:.75rem; overflow-wrap:anywhere; }
details { margin-top:12px; }
.model-note { display:block; margin-top:10px; font-size:.8rem; color:var(--muted); }
summary { cursor:pointer; }
@media(max-width:700px) {
  .explorer { grid-template-columns:repeat(2,minmax(0,1fr)); }
  aside { grid-column:span 2; width:min(100%,290px); }
  #panels { grid-column:span 2; grid-template-columns:repeat(2,minmax(0,1fr)); }
  h1 small { display:block; margin:0; }
}
