/* Video review: an editor-style workspace (report, viewer, timeline) in a light clinical theme; theme.css restyles it. */
@font-face { font-family: "DM Sans"; src: url("fonts/dm-sans-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("fonts/dm-sans-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("fonts/dm-sans-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-400-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Source Serif"; src: url("fonts/source-serif-4-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif"; src: url("fonts/source-serif-4-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  /* Font stacks; a theme can swap them in one place. */
  --sans: "DM Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", monospace;
  --serif: "Source Serif", Georgia, serif;
  /* Cool clinical palette: slate surfaces tinted blue, never pure white. */
  color-scheme: light;
  --page: #d3dbe4;
  --panel: #e8edf2;
  --sheet: #f5f7fa;
  --bar: #dde4eb;
  --line: #c7d1dc;
  --line-soft: #d9e0e8;
  --text: #1f2a37;
  --muted: #536171;
  --faint: #8290a0;
  --accent: #4a66a0;
  --accent-soft: #d8e2f1;
  --hover: #e1e8f0;
  --playhead: #df4a50;
  --story-head: #d4dfec; --story-line: #b6c6da; --story-text: #233f69; --story-body: #c1cedd;
  --gap-fill: #e0e6ec;
  --h-ruler: 22px;
  --h-story: 58px;
  --object-row: 15px;
  --lane-gap: 5px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--page); color: var(--text); font: 13px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:is(p, dl, dd, ol, ul) { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
:is(button, a, [tabindex], input):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -48px; background: var(--text); color: #fff; padding: 8px 12px; border-radius: 4px; z-index: 20; }
.skip-link:focus { top: 8px; }

/* Workspace */
/* Side margins as on the website demo: the toolbar spans the window, the workspace sits between two gutters,
   and a narrower gap separates the report from the video. */
.app {
  --gutter: clamp(20px, 4.4vw, 80px);
  --split: clamp(12px, 1.6vw, 28px);
  display: grid; height: 100vh; min-height: 600px; gap: 1px; background: var(--page);
  grid-template-columns: var(--gutter) minmax(440px, 1fr) var(--split) minmax(0, 1.25fr) var(--gutter);
  grid-template-rows: 46px minmax(0, 1fr) auto;
  grid-template-areas: "toolbar toolbar toolbar toolbar toolbar" ". browser . viewer ." ". timeline timeline timeline .";
}
.toolbar { grid-area: toolbar; display: flex; align-items: center; gap: 14px; padding: 0 var(--gutter); background: var(--panel); min-width: 0; }
.toolbar-name { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; font-size: 14px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
.toolbar-name::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); }
.toolbar-title { flex: 1; min-width: 0; text-align: center; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toolbar-title span { color: var(--muted); font-weight: 400; }
a.toolbar-title { color: inherit; text-decoration: none; }
a.toolbar-title:hover { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; }
.toolbar-chip { font: 10px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); background: var(--sheet); border: 1px solid var(--line); border-radius: 4px; padding: 3px 7px; white-space: nowrap; }

.panel-bar { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 12px; background: var(--bar); border-bottom: 1px solid var(--line); }
.icon-button { display: inline-grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); }
.icon-button:hover { background: #d3dbe4; color: var(--text); }
.text-button { border: 1px solid var(--line); background: var(--sheet); border-radius: 5px; padding: 3px 9px; font-size: 12px; color: var(--muted); }
.text-button:hover { color: var(--text); border-color: #b3bfcc; }
.segmented { display: flex; gap: 2px; background: #d6dee7; border: 1px solid var(--line); border-radius: 6px; padding: 2px; }
.segmented button { border: 0; border-radius: 4px; padding: 3px 9px; background: transparent; color: var(--muted); font: 11px var(--mono); }
.segmented button[aria-pressed=true] { background: var(--sheet); color: var(--text); box-shadow: 0 1px 2px #1f2a3714; }

/* Browser */
/* The report side is neutral gray, set apart from the slate viewer and timeline. */
.browser {
  --panel: #e2e2e2; --bar: #d8d8d8; --sheet: #efefef; --line: #cbcbcb; --line-soft: #dcdcdc;
  --text: #232323; --muted: #5a5a5a; --faint: #8a8a8a; --hover: #e3e3e3;
}
.browser { grid-area: browser; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); background: var(--panel); min-width: 0; min-height: 0; }
.browser-tabs { display: flex; gap: 4px; min-width: 0; overflow-x: auto; scrollbar-width: none; align-self: stretch; }
.browser-tabs button { display: inline-flex; align-items: center; gap: 6px; border: 0; border-bottom: 2px solid transparent; padding: 0 8px; background: transparent; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.browser-tabs button:hover { color: var(--text); }
.browser-tabs button[aria-selected=true] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 500; }
.panel-tools { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.panel-tools[hidden] { display: none; }
.browser-body { overflow: auto; min-height: 0; overscroll-behavior: contain; }
.panel { padding: 12px 18px 14px; }
.panel[hidden] { display: none; }
.panel-caption { font-size: 11.5px; line-height: 1.5; color: var(--faint); }

/* Report: one compact paragraph per step, every sentence links to its interval. */
.panel-report { --report-size: 14px; margin: 10px; padding: 16px 22px 18px; background: var(--sheet); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 1px 3px #1f2a3714; }
/* Clinical prose in Source Serif, as on the website demo. */
.report-para { margin: 0 0 .75em; font: 400 var(--report-size)/1.55 var(--serif); color: #2b2b2b; text-wrap: pretty; }
.report-para:last-child { margin-bottom: 0; }
.sentence { border-radius: 3px; cursor: pointer; transition: background-color .12s, color .12s; box-decoration-break: clone; -webkit-box-decoration-break: clone; padding: 1px 1px; margin: -1px -1px; }
.sentence:hover, .sentence:focus-visible { background: var(--hover); color: var(--text); outline: none; box-shadow: inset 0 -1.5px 0 var(--accent); }
.sentence[data-active=true] { background: var(--accent-soft); color: #1b2b47; }

/* Steps and case */
.phase-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px 10px; }
.phase-card { display: block; width: 100%; padding: 0; border: 0; background: transparent; text-align: left; }
.phase-card img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; background: #000; outline: 2px solid transparent; outline-offset: 1px; }
.phase-card:hover img { outline-color: #b3bfcc; }
.phase-card[aria-current=true] img { outline-color: var(--accent); }
.phase-card span { display: flex; justify-content: space-between; gap: 6px; margin-top: 5px; font-size: 12px; }
.phase-card span b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phase-card time { font: 10px/1.6 var(--mono); color: var(--faint); }
.phase-card[aria-current=true] span b { color: var(--accent); }
.case-data { display: grid; grid-template-columns: minmax(120px, .75fr) minmax(0, 1.4fr); }
.case-data dt, .case-data dd { padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: 12.5px; line-height: 1.45; }
.case-data dt { color: var(--muted); padding-right: 10px; }
/* Coding: per country, each code with its system, title and the evidence it rests on. */
.coding-list { list-style: none; margin: 0; padding: 0; }
.coding-row { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 2px 12px; padding: 9px 0; border-top: 1px solid var(--line-soft); }
.coding-kind { grid-column: 1 / -1; font-size: 11px; color: var(--faint); }
.coding-code { font: 600 14px/1.3 var(--mono); color: var(--text); }
.coding-title { font-size: 13px; font-weight: 500; line-height: 1.35; }
.coding-basis { grid-column: 2; font-size: 12px; line-height: 1.45; color: var(--muted); }
.coding-time { padding: 0 2px; border: 0; border-radius: 3px; background: none; font: 11px var(--mono); color: var(--accent); white-space: nowrap; cursor: pointer; }
.coding-time:hover { text-decoration: underline; text-underline-offset: 2px; }
.panel-caption.credit { margin-top: 12px; }
/* Objects: the ledger, one row per physical object, above the detector's tracks grouped by object. */
.object-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin-bottom: 8px; font-size: 13px; line-height: 1.45; }
.object-summary strong { font-weight: 600; }
.object-summary span { font-size: 11.5px; color: var(--faint); }
.ledger { list-style: none; padding: 0; border-top: 1px solid var(--line-soft); }
.ledger-row { --chip: #8cb7ef; padding: 6px 8px 7px; border-bottom: 1px solid var(--line-soft); }
.ledger-row:has(.ledger-pick:hover) { background: var(--hover); }
.ledger-row[data-focus=true] { background: var(--sheet); box-shadow: inset 2px 0 0 var(--accent); }
.ledger-head { position: relative; display: grid; grid-template-columns: minmax(76px, max-content) max-content minmax(0, 1fr); align-items: baseline; gap: 2px 14px; }
.ledger-pick { display: inline-flex; align-items: center; gap: 7px; padding: 0; border: 0; background: none; font-size: 12.5px; text-align: left; white-space: nowrap; }
/* The whole first line selects; the times above it stay their own buttons. */
.ledger-pick::after { content: ""; position: absolute; inset: -6px -8px; }
.ledger-pick:focus-visible { outline: none; }
.ledger-head:has(.ledger-pick:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
.ledger-pick i { width: 10px; height: 10px; border-radius: 3px; background: var(--chip); box-shadow: inset 0 0 0 1px #0000001f; }
.ledger-head[data-on=true] .ledger-pick i { box-shadow: 0 0 0 2px var(--panel), 0 0 0 3.5px #2f8783; }
.ledger-row[data-focus=true] .ledger-head[data-on=true] .ledger-pick i { box-shadow: 0 0 0 2px var(--sheet), 0 0 0 3.5px #2f8783; }
.ledger-pick b { font-weight: 600; }
.ledger-row[data-focus=true] .ledger-pick b { color: var(--accent); }
.ledger-seen { position: relative; z-index: 1; font: 10.5px var(--mono); color: var(--faint); white-space: nowrap; }
.ledger-time { padding: 0 1px; border: 0; border-radius: 3px; background: none; font: 10.5px/1.5 var(--mono); color: var(--muted); }
.ledger-time:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.ledger-status { font-size: 12px; }
.ledger-note { margin: 1px 0 0 17px; font-size: 11.5px; line-height: 1.45; color: var(--muted); }
.ledger-events { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0 10px; margin: 5px 0 1px 17px; padding: 0; list-style: none; font-size: 11.5px; line-height: 1.5; color: var(--muted); }
.ledger-events li { display: contents; }
.ledger-events .ledger-time { justify-self: start; }
.track-groups-head { margin: 16px 0 2px; font-size: 11.5px; font-weight: 500; color: var(--faint); }
.track-group { --chip: #8cb7ef; border-bottom: 1px solid var(--line-soft); }
.track-group summary { display: flex; align-items: center; gap: 7px; padding: 5px 2px; font-size: 12px; cursor: pointer; list-style: none; }
.track-group summary::-webkit-details-marker { display: none; }
.track-group summary::before { content: ""; width: 5px; height: 5px; margin: 0 3px 2px 1px; border: solid var(--faint); border-width: 0 1.4px 1.4px 0; transform: rotate(-45deg); transition: transform .12s; }
.track-group[open] summary::before { transform: rotate(45deg); margin-bottom: 4px; }
.track-group summary i { width: 8px; height: 8px; border-radius: 2px; background: var(--chip); }
.track-group[data-false=true] summary i { background: transparent; border: 1px dashed #7d848d; }
.track-group summary b { font-weight: 500; }
.track-group summary span { font-size: 11px; color: var(--faint); }
.track-group[data-focus=true] summary b { color: var(--accent); }
.track-group .object-cards { padding: 4px 0 12px; }
.object-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.object-card { --chip: #8cb7ef; display: grid; gap: 5px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--sheet); text-align: left; }
.object-card:hover { border-color: #b0b0b0; }
.object-card[aria-pressed=true] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.object-card-head { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 12.5px; }
.object-card-head b { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 5px; background: var(--chip); color: #11161f; font: 600 10.5px/1 var(--mono); }
.object-card-head strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.object-card svg { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 4px; background: #1d2026; stroke: none; }
.object-card .object-grid { fill: none; stroke: #ffffff14; stroke-width: 1; }
.object-card .object-path { fill: none; stroke: var(--chip); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; opacity: .9; }
.object-card .object-dot { fill: #fff; stroke: var(--chip); stroke-width: 2.5; }
.object-card-state { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.object-card-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.object-card-state i[data-on=true] { background: #2f8783; }
.object-card-state time { margin-left: auto; font: 10px var(--mono); color: var(--faint); }
.object-card-meta { margin-top: -3px; font: 10px var(--mono); color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step-group { display: grid; grid-template-columns: 158px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.step-group:first-child { padding-top: 0; }
.step-head { display: grid; grid-template-columns: 20px minmax(0, 1fr); align-content: start; gap: 2px 8px; margin: 0; font-size: 12.5px; font-weight: 600; line-height: 1.35; }
.step-head b { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 5px; background: var(--accent); color: #fff; font: 600 11px/1 var(--mono); }
.step-head b.none { background: transparent; color: var(--faint); border: 1px dashed var(--line); }
.step-head span { padding-top: 1px; }
.step-head time { grid-column: 2; font: 400 10px/1.5 var(--mono); color: var(--faint); white-space: pre-line; }
.step-group .phase-grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px 8px; }

/* Viewer */
.viewer { grid-area: viewer; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: var(--panel); min-width: 0; min-height: 0; }
.viewer-bar { justify-content: space-between; font-size: 12px; }
.viewer-format { font: 10.5px var(--mono); color: var(--muted); }
.viewer-name { font-weight: 600; }
.viewer-stage { position: relative; background: #0b0c0e; min-height: 0; overflow: hidden; }
.viewer-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #0b0c0e; }
/* Tracked objects over the picture: box, five-second trail and the object's name, as in the website demo. */
.object-overlay { position: absolute; pointer-events: none; }
.object-overlay .object-layer { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; fill: none; stroke: none; }
.object-box { fill: none; stroke: currentColor; stroke-width: 2; vector-effect: non-scaling-stroke; }
.object-trail { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-opacity: .75; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.object-center { fill: currentColor; stroke: #0b0c0e; stroke-width: 1; vector-effect: non-scaling-stroke; }
.object-labels span { position: absolute; display: inline-flex; align-items: center; gap: 4px; padding: 1px 6px; border-radius: 4px; transform: translateY(-100%); margin-top: -3px; font: 600 11px/1.3 var(--sans); color: #11161f; white-space: nowrap; box-shadow: 0 1px 2px #0006; }
.object[data-dim=true] { opacity: .3; }
.object[data-focus=true] .object-box { stroke-width: 3; }
.object-labels span[data-dim=true] { opacity: .45; }
/* A false detection stays visible as the model's output, dashed so it never reads as a counted object. */
.object[data-false=true] .object-box { stroke-dasharray: 6 5; }
.viewer-bar .segmented button { font-size: 10.5px; }
.viewer-error { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: #ddd; line-height: 1.6; background: #0b0c0e; }
.viewer-error[hidden] { display: none; }
.viewer-error code { font: 11.5px var(--mono); background: #ffffff1a; padding: 1px 5px; border-radius: 3px; }
.transport { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; min-height: 46px; padding: 0 10px; background: var(--panel); border-top: 1px solid var(--line); }
.transport-side { display: flex; align-items: center; gap: 2px; }
.transport-end { justify-content: flex-end; }
.icon-button.play { width: 34px; height: 34px; color: var(--text); }
.icon-button.play svg { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.icon-button.play .icon-pause, .icon-button.play[data-playing=true] .icon-play { display: none; }
.icon-button.play[data-playing=true] .icon-pause { display: block; }
.timecode { font: 20px/1 var(--mono); letter-spacing: .02em; font-variant-numeric: tabular-nums; color: var(--text); }

/* Timeline */
.timeline { grid-area: timeline; background: var(--panel); min-width: 0; }
.zoom-tools { display: flex; align-items: center; justify-content: center; gap: 2px; border-bottom: 1px solid var(--line); }
.zoom-tools .icon-button { width: 24px; height: 20px; border-radius: 4px; }
.zoom-tools svg { width: 14px; height: 14px; }
.zoom-tools [aria-pressed=true] { color: var(--accent); }
.timeline-body { display: grid; grid-template-columns: 90px minmax(0, 1fr); }
.lane-names { display: grid; grid-template-rows: var(--h-ruler) var(--h-story) var(--h-objects); row-gap: var(--lane-gap); padding: 0 0 8px; background: var(--bar); border-right: 1px solid var(--line); }
.lane-name { display: flex; align-items: center; gap: 7px; padding-left: 12px; font-size: 11px; color: var(--muted); }
.lane-name::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--dot); border: 1px solid var(--dot-line); }
.lane-name-story { --dot: var(--story-head); --dot-line: var(--story-line); }
.lane-name-objects { --dot: #8cb7ef; --dot-line: #6f9bd6; line-height: 1.15; }
.timeline-scroll { overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-color: #b3bfcc transparent; }
.timeline-content { position: relative; display: grid; grid-template-rows: var(--h-ruler) var(--h-story) var(--h-objects); row-gap: var(--lane-gap); padding-bottom: 8px; min-width: 100%; }
.ruler { position: relative; border-bottom: 1px solid var(--line); cursor: ew-resize; touch-action: none; background: var(--bar); }
.tick { position: absolute; bottom: 0; width: 1px; height: 4px; background: #b5c0cc; }
.tick.major { height: 8px; background: #8393a5; }
.tick.major span { position: absolute; left: 4px; bottom: 5px; font: 9.5px var(--mono); color: var(--muted); white-space: nowrap; }
.lane { position: relative; }
.clip { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; min-width: 2px; padding: 0 7px; border: 1px solid var(--clip-line); border-radius: 4px; overflow: hidden; background: var(--clip-fill); color: var(--clip-text); font-size: 11px; white-space: nowrap; text-align: left; }
.clip > span { overflow: hidden; text-overflow: ellipsis; }
.clip:hover { filter: brightness(.97); }
.clip[data-active=true] { box-shadow: 0 0 0 2px var(--accent); z-index: 1; }
/* Foreign-object clips take their class colour; rows stack only where tracks overlap. */
.clip-object { --chip: #8cb7ef; --clip-fill: var(--chip); --clip-line: #0000002e; --clip-text: #11161f; bottom: auto; height: var(--object-row); gap: 5px; padding: 0 6px; font-size: 10.5px; }
.clip-object[data-false=true] { --clip-line: #6f7782; border-style: dashed; }
.clip-object[data-dim=true] { opacity: .35; }
.clip-story { --clip-fill: var(--story-body); --clip-line: var(--story-line); --clip-text: var(--story-text); flex-direction: column; align-items: stretch; padding: 0; }
.clip-story .clip-label { display: flex; gap: 6px; align-items: center; height: 17px; padding: 0 6px; background: var(--story-head); border-bottom: 1px solid var(--story-line); flex-shrink: 0; }
.clip-story .clip-label b { font: 9.5px var(--mono); color: #5b7097; font-weight: 400; }
.clip-story[data-gap=true] { --clip-fill: var(--gap-fill); --clip-line: var(--line); --clip-text: var(--faint); }
.clip-story[data-gap=true] .clip-label { background: var(--gap-fill); border-bottom-color: var(--line); }
.filmstrip { display: flex; flex: 1; overflow: hidden; }
.filmstrip i { flex: 0 0 auto; height: 100%; background-repeat: no-repeat; border-right: 1px solid #e8edf280; }
.clip-story[data-gap=true] .filmstrip { opacity: .35; }
.clip-cut { position: absolute; top: 17px; bottom: 0; width: 2px; margin-left: -1px; background: var(--story-line); pointer-events: none; }
.range-band { position: absolute; top: 0; bottom: 0; left: 0; background: #4a66a01a; border-inline: 1px solid var(--accent); pointer-events: none; z-index: 2; }
.range-band[hidden] { display: none; }
.playhead { position: absolute; top: 0; bottom: 0; left: 0; width: 1px; background: var(--playhead); pointer-events: none; z-index: 3; will-change: transform; }
.playhead span { position: absolute; top: 0; left: -5px; width: 11px; height: 13px; border-radius: 2px 2px 5px 5px; background: var(--playhead); }
.skimmer { position: absolute; top: 0; bottom: 0; left: 0; width: 1px; background: #4a66a073; pointer-events: none; z-index: 2; }
.skimmer[hidden] { display: none; }
.skimmer span { position: absolute; top: 2px; left: 5px; padding: 1px 4px; border-radius: 3px; background: var(--text); font: 9.5px var(--mono); color: #fff; white-space: nowrap; }

/* Tones step down gently: white toolbar and viewer, light gray report, then a mid steel timeline. */
.toolbar, .viewer { --panel: #ffffff; --bar: #ffffff; --sheet: #f4f6f8; --line: #e1e5ea; }

.timeline {
  --panel: #d3d9e1; --bar: #c7ced8; --line: #b4bdc9; --text: #1f2a37; --muted: #46525f; --faint: #5d6977;
  --story-head: #4f6ea3; --story-line: #405d8f; --story-text: #ffffff; --story-body: #a3b3ca;
  --gap-fill: #bec6d0;
  color: var(--text);
  box-shadow: inset 0 1px 0 #ffffff80;
}
.browser { color: var(--text); }
.timeline .icon-button:hover { background: #b9c2cd; color: var(--text); }
.timeline .timeline-scroll { scrollbar-color: #9aa5b2 transparent; }
.timeline .tick { background: #9ea9b6; }
.timeline .tick.major { background: #67737f; }
.timeline .clip { box-shadow: 0 1px 1px #1f2a371a; }
.timeline .clip:hover { filter: brightness(1.07); }
.timeline .clip[data-active=true] { box-shadow: 0 0 0 2px #f0b429; }
.timeline .clip-story .clip-label b { color: #dbe4f5; }
.timeline { --object-rows: 1; --h-objects: calc((var(--object-row) + 2px) * var(--object-rows) - 2px); }
.timeline .clip-story[data-gap=true] { --clip-text: var(--muted); }
.timeline .clip-story[data-gap=true] .clip-label { background: #b6bfca; border-bottom-color: #a7b1bd; }
.timeline .filmstrip i { border-right-color: #00000033; }
.timeline .range-band { background: #2f4f8a1f; border-inline-color: #2f4f8a; }
.timeline .skimmer { background: #2f4f8a8c; }
.timeline .skimmer span { background: var(--text); color: #fff; }

/* Shorter screens: give the report more width so it fits at a readable size. */
@media (max-height: 860px) and (min-width: 901px) {
  .app { grid-template-columns: var(--gutter) minmax(440px, 1.08fr) var(--split) minmax(0, 1fr) var(--gutter); }
}
@media (max-height: 800px) and (min-width: 901px) {
  :root { --h-ruler: 20px; --h-story: 46px; --lane-gap: 4px; --object-row: 12px; }
  .clip-object { font-size: 9.5px; }
  .app { grid-template-rows: 40px minmax(0, 1fr) auto; }
  .panel-bar { min-height: 34px; }
  .panel { padding: 8px 16px; }
  .panel-report { margin: 6px; padding: 10px 16px 12px; }
  .transport { min-height: 40px; }
}
@media (max-width: 1100px) {
  .toolbar-title .toolbar-license { display: none; }
  .app { grid-template-columns: var(--gutter) minmax(380px, 1.2fr) var(--split) minmax(0, 1fr) var(--gutter); }
}
@media (max-width: 900px) {
  .app { --gutter: 16px; height: auto; min-height: 100vh; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: "toolbar" "viewer" "timeline" "browser"; }
  .toolbar { min-height: 46px; }
  .toolbar-title { display: none; }
  .toolbar-chip { margin-left: auto; }
  .viewer-stage { aspect-ratio: 16 / 9; }
  .browser-body { overflow: visible; }
}
@media (max-width: 560px) {
  .viewer-format { display: none; }
  .timecode { font-size: 17px; }
  .timeline-body { grid-template-columns: 74px minmax(0, 1fr); }
  .zoom-tools { gap: 1px; }
  .zoom-tools .icon-button { width: 22px; }
  .lane-name { font-size: 10px; padding-left: 8px; }
  .lane-name::before { display: none; }
  .panel { padding: 12px 14px; }
  .step-group { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .case-data { grid-template-columns: minmax(0, 1fr); }
  .case-data dt { border-bottom: 0; padding-bottom: 0; }
  .case-data dd { padding-top: 1px; }
  .ledger-head { grid-template-columns: minmax(0, max-content) max-content; }
  .ledger-status { grid-column: 1 / -1; padding-left: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .sentence, .track-group summary::before { transition: none; }
}
