.viewer-width { width: min(1540px, calc(100% - clamp(24px, 6vw, 100px))); }
.site-header.viewer-width { padding-top: 25px; padding-bottom: 24px; }
.viewer-width h1, .viewer-width h2 { color: var(--ink); }
.viewer-width h1 { font-size: clamp(2rem, 3.8vw, 3rem); }
.intro { margin: 8px 0 25px; max-width: 82ch; font-size: 1rem; }
.section-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 16px; margin-bottom: 12px; }
.section-heading h2 { margin: 0; font: 600 1.55rem/1.3 var(--serif); }
#run-info, #frame-summary { font-variant-numeric: tabular-nums; color: var(--muted); }
.workspace { border: 1px solid #cbd4ce; border-radius: 6px; background: white; overflow: hidden; }
.map-toolbar, .timeline { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 9px 12px; background: #f7faf8; }
.map-toolbar { justify-content: space-between; border-bottom: 1px solid var(--line); }
.timeline { border-top: 1px solid var(--line); }
.map-area { height: clamp(640px, 76vh, 1050px); position: relative; }
#scene { width: 100%; height: 100%; display: block; touch-action: none; }
.load-state { position: absolute; inset: 34% 12px auto; text-align: center; }
.workspace button, .workspace select, .workspace input { font: inherit; }
.workspace button, .workspace select, .frame-number input { color: var(--ink); min-height: 36px; border: 1px solid #c3cdc6; background: #fff; border-radius: 4px; padding: 4px 10px; }
.workspace button { cursor: pointer; }
.workspace button:enabled:hover, .workspace select:hover { background: #eaf1ed; }
.workspace button:disabled { opacity: .48; cursor: default; }
.workspace :focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#methods { display: inline-flex; margin: 0; padding: 0; min-width: 0; border: 1px solid #bac8c0; border-radius: 4px; background: white; }
#methods label { position: relative; cursor: pointer; }
#methods input, .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; white-space: nowrap; overflow: hidden; clip-path: inset(50%); }
#methods span { display: block; padding: 6px 12px; color: var(--body); border-radius: 3px; }
#methods input:checked + span, #play { color: white; background: #245c43; }
#methods input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }
.view-controls { display: flex; align-items: center; gap: 5px; }
.tag-toggle { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; margin-right: 6px; cursor: pointer; }
.tag-toggle input { margin: 0; width: 1.05rem; height: 1.05rem; accent-color: var(--accent); }
#zoom-in, #zoom-out, #previous, #next { min-width: 36px; padding: 2px 6px; font-size: 20px; line-height: 1; }
#play { min-width: 64px; border-color: #245c43; }
#play:enabled:hover { background: #18472f; }
.frame-number, .speed-label { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.frame-number input { width: 4.1em; font-variant-numeric: tabular-nums; }
#scrub { min-width: 90px; flex: 1; accent-color: var(--accent); cursor: pointer; }
#frame-summary { margin: 12px 0; font-size: .94rem; }
.map-legend { margin: 0; border-block: 1px solid var(--line); padding: 12px 0; display: flex; flex-wrap: wrap; gap: 8px 22px; list-style: none; }
.map-legend li { display: inline-flex; align-items: center; gap: 7px; }
.key { position: relative; display: inline-block; flex: none; color: #435d83; }
.key.track, .key.return { background: currentColor; width: 7px; height: 7px; }
.key.return { border-radius: 50%; width: 5px; height: 5px; }
.key.truth { width: 9px; height: 9px; transform: rotate(45deg); border: 1.5px solid currentColor; }
.key.extent, .key.localization { width: 20px; height: 10px; border: 1.6px solid currentColor; border-radius: 50%; }
.key.localization { border: 2px dotted currentColor; }
.key.clutter { font-style: normal; font-size: 1.15rem; color: #67737a; line-height: .8; }
.key.station { width: 12px; height: 12px; background: #286547; clip-path: polygon(50% 0,100% 38%,81% 100%,19% 100%,0 38%); }
#map-guide { max-width: 95ch; color: var(--body); }
.compact-key { display: none; }
#track-values { border-block: 1px solid var(--line); }
#track-values summary { cursor: pointer; padding: 12px 0; font-weight: 600; }
.table-scroll { overflow: auto; max-height: 33rem; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: .45rem .7rem; border-top: 1px solid var(--line); text-align: right; white-space: nowrap; }
th { position: sticky; top: 0; background: #f7faf8; }
th:first-child, th:nth-child(2), td:first-child, td:nth-child(2) { text-align: left; }
.workspace:fullscreen, .workspace.expanded { display: flex; flex-direction: column; width: 100%; height: 100%; border: 0; border-radius: 0; }
.workspace.expanded { position: fixed; inset: 0; z-index: 20; height: 100dvh; }
.workspace:fullscreen .map-area, .workspace.expanded .map-area { min-height: 0; flex: 1; }
body.map-expanded { overflow: hidden; }
@media (max-width: 640px) {
  .compact-key { display: inline; }
  .site-header.viewer-width { padding-top: 16px; padding-bottom: 14px; }
  .intro { margin-bottom: 18px; }
  .map-area { height: max(540px, 72svh); }
  .map-toolbar, .timeline { gap: 6px; padding: 7px; }
  #methods span { padding-inline: 8px; }
  .speed-label { margin-left: auto; }
  #scrub { flex-basis: 100%; order: 1; }
}
