/* The "try a test" page (docs/TRY-PAGE.md). Colours follow sample-flight.css. The carousel follows the theme, as
   the app's does; the video and the flight path stay dark in both themes because they are drawn for a dark ground. */
:root {
  color-scheme: light dark;
  --bg: light-dark(#f1f2f3, #151719);
  --surface: light-dark(#fcfbf9, #22262a);
  --sunken: light-dark(#e9ecee, #1a1d20);
  --ink: light-dark(#1b1e21, #f2efeb);
  --muted: light-dark(#4d555c, #aeb7be);
  --line: light-dark(#cdd2d7, #424a50);
  --action: light-dark(#364c5a, #ccdbe4);
  --on-action: light-dark(#fff, #18232b);
  --pass: light-dark(#27624a, #8fd3b4);
  --fail: light-dark(#b3261e, #ff8a75);
  --fail-surface: light-dark(#fbeae8, #3a2421);
  --on-mark: light-dark(#fff, #151719);
  --now: light-dark(#a86200, #f2c14e);
  --stage-glow: light-dark(#ffffff, #23282d);
  --stage: light-dark(#e4e8eb, #111416);
  --stage-ink: var(--ink);
  --stage-muted: var(--muted);
  --ardupilot: light-dark(#8a5a00, #f2c14e);
  --px4: light-dark(#0b5cab, #7cc4ff);
  --band: color-mix(in srgb, var(--pass) 13%, transparent);
  --band-used: color-mix(in srgb, var(--pass) 34%, transparent);
  --band-edge: color-mix(in srgb, var(--pass) 60%, transparent);
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; overflow-x: hidden; }
:lang(zh-TW) body { font-family: system-ui, -apple-system, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif; line-height: 1.65; }
:lang(ja) body { font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif; line-height: 1.65; }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; padding: 0; }
ol, ul { list-style: none; }
a { color: inherit; text-underline-offset: .23em; }
button, select { font: inherit; color: var(--ink); }
button:enabled, select, summary { cursor: pointer; }
:focus-visible { outline: 2px solid var(--action); outline-offset: 3px; }
.shell { width: min(calc(100% - 64px), 1240px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; }

/* header and step bar. The logo takes the text colour of the theme, the way the app's does (an SVG filter turns
   the picture's brightness into opacity and floods it with one colour). */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top .yuzora-wordmark img { filter: url(#wordmark-tone); mask-image: none; }
.brand-tone { position: absolute; }
.brand-tone feFlood { flood-color: var(--ink); }
.page-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; min-height: 60px; padding-block: 6px; }
.page-header .back { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); }
.yuzora-wordmark { min-height: 44px; }
.steps ol { display: flex; align-items: center; gap: 6px; }
.steps button { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px 0 10px; border: 1px solid transparent; border-radius: 22px; background: transparent; color: var(--muted); font-size: 14px; }
.steps button:disabled { cursor: default; }
.steps button[aria-current="step"] { border-color: var(--action); background: var(--surface); color: var(--ink); font-weight: 650; }
.steps button.done { color: var(--ink); }
.step-n { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border: 1px solid var(--line); border-radius: 50%; font-size: 12px; font-weight: 700; }
.steps button[aria-current="step"] .step-n, .steps button.done .step-n { border-color: var(--action); background: var(--action); color: var(--on-action); }

main { padding: 18px 0 48px; }
.loading, .error { color: var(--muted); padding-block: 24px; }
.error { color: var(--fail); }
.eyebrow { color: var(--muted); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
:lang(zh-TW) .eyebrow, :lang(ja) .eyebrow { letter-spacing: .06em; }
h1 { font-size: clamp(26px, 3.4vw, 34px); line-height: 1.15; font-weight: 560; letter-spacing: -.03em; }
h1:focus { outline: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; min-width: 44px; padding: 0 18px; border: 1px solid var(--line); border-radius: 5px; background: transparent; color: var(--ink); font-weight: 600; text-decoration: none; }
.btn.primary { border-color: var(--action); background: var(--action); color: var(--on-action); font-weight: 700; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

/* steps 1 and 2: the carousel */
.choose { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.carousel { width: 100%; margin-top: 10px; }
.stage { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: start; gap: 0 12px; padding: 28px 0 18px; border-radius: 14px; background: radial-gradient(ellipse 60% 70% at 50% 40%, var(--stage-glow) 0%, var(--stage) 78%); color: var(--stage-ink); overflow: hidden; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.stage .side { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; min-height: 44px; padding: 8px; border: 0; background: transparent; color: var(--stage-muted); opacity: .45; }
.stage .side:focus-visible { opacity: 1; outline-offset: -3px; }
.stage .side { margin-top: 26px; padding-inline: 4px; }
.stage .side.left { justify-self: end; }
.stage .side.right { justify-self: start; }
.stage .side span { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.stage .center { position: relative; display: flex; flex-direction: column; align-items: center; }
.chosen.trial { position: absolute; left: 0; top: 0; visibility: hidden; pointer-events: none; }
.chosen { gap: 4px; width: min(584px, 58vw); padding: 14px 18px 8px; border: 2px solid var(--action); border-radius: 16px; background: color-mix(in srgb, var(--surface) 60%, transparent); cursor: pointer; }
.chosen:hover { background: color-mix(in srgb, var(--surface) 90%, transparent); }
.choose-it { display: flex; flex-direction: column; align-items: center; width: 100%; min-width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: inherit; }
/* Extend the card border to show keyboard focus on its main action. */
.chosen:has(> .choose-it:focus-visible) { outline: 2px solid var(--action); }
.chosen:has(> .choose-it:focus-visible) > .choose-it { outline: none; }
.tap-label { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); padding: 2px 13px; border-radius: 999px; background: var(--action); color: var(--on-action); font-size: 12.5px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; pointer-events: none; }
.name-row { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 14px; margin-top: 2px; }
.drone-picture { display: block; object-fit: contain; pointer-events: none; }
.drone-picture.mirror { transform: scaleX(-1); }
.drones .center .drone-picture { width: min(440px, 52vw, 44vh); height: min(300px, 36vw, 30vh); filter: drop-shadow(0 22px 24px light-dark(rgba(40, 50, 60, .28), rgba(0, 0, 0, .55))); }
.drones .side .drone-picture { width: min(200px, 17vw); height: min(138px, 12vw); }
.floor { display: block; width: min(420px, 50vw, 42vh); height: 36px; margin-top: -20px; border: 1px solid light-dark(#aab3ba, #5a636b); border-radius: 50%; background: radial-gradient(ellipse at center, light-dark(rgba(60, 76, 90, .10), rgba(173, 187, 199, .14)), transparent 70%); }
.scenarios .center img { display: block; width: min(530px, 100%, 54vh); height: auto; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--line); border-radius: 10px; background: #0d0f11; pointer-events: none; }
.scenarios .side img { display: block; width: min(260px, 17vw); height: auto; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--line); border-radius: 8px; background: #0d0f11; pointer-events: none; }
.stage.moved .center { animation: arrive .22s ease-out; }
@keyframes arrive { from { opacity: .3; transform: scale(.96); } to { opacity: 1; transform: none; } }
.carousel-nav { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 12px; }
.round { width: 48px; height: 48px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); font-size: 20px; line-height: 1; }
.count { min-width: 5em; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.choose h2 { font-size: clamp(26px, 3.6vw, 38px); line-height: 1.1; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
:lang(zh-TW) .choose h2, :lang(ja) .choose h2 { letter-spacing: 0; line-height: 1.3; }
.choose .sub { max-width: 680px; color: var(--stage-ink); font-size: 16px; }
.platform { display: inline-block; padding: 3px 11px; border: 1px solid currentColor; border-radius: 5px; font-size: 15px; font-weight: 700; letter-spacing: .03em; white-space: nowrap; }
.platform[data-platform="ardupilot"] { color: var(--ardupilot); background: color-mix(in srgb, var(--ardupilot) 12%, transparent); }
.platform[data-platform="px4"] { color: var(--px4); background: color-mix(in srgb, var(--px4) 12%, transparent); }
.choose .source { color: var(--stage-muted); font-size: 13px; }
.sensor-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 10px; margin-top: 4px; }
.row-label { color: var(--stage-muted); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.facts li { display: inline-flex; align-items: baseline; gap: 6px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 12.5px; text-align: start; }
.facts li span { color: var(--stage-muted); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.facts li strong { font-weight: 600; }
.facts li.none { border-style: dashed; }
.facts li.none strong { color: var(--stage-muted); font-weight: 400; }
.quiet { min-height: 44px; min-width: 44px; padding: 0 6px; border: 0; background: transparent; color: var(--action); font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: .23em; }


/* step 3: the replay */
.run { display: flex; flex-direction: column; gap: 14px; }
.run-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.run-head .titles { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; }
.meta { color: var(--muted); font-size: 13px; }
.verdict { padding: 2px 10px; border: 1px solid var(--pass); border-radius: 4px; color: var(--pass); font-weight: 650; }
.verdict.failed { border-color: var(--fail); background: var(--fail); color: var(--on-mark); font-weight: 700; }
.run-head .actions { justify-content: flex-start; gap: 10px; }
.player { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 8px 12px; padding: 14px 12px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.player .play { min-width: 96px; }
.player select { height: 44px; min-height: 44px; min-width: 60px; padding: 0 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); }
.clock { align-self: flex-start; min-height: 44px; display: inline-flex; align-items: center; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* the timeline (docs/TRY-PAGE.md §10.3): numbered ticks on the rail, a time scale, and the list of moments under it */
.timeline { position: relative; flex: 1 1 360px; min-width: 200px; height: 70px; margin-inline: 22px; margin-top: 4px; }
.timeline .rail, .timeline .fill { position: absolute; left: 0; top: 24px; height: 4px; border-radius: 2px; }
.timeline .rail { right: 0; background: var(--line); }
.timeline .fill { width: 0; background: var(--action); }
.timeline:has(.seek:focus-visible) .rail { outline: 2px solid var(--action); outline-offset: 5px; }
.timeline .seek { position: absolute; left: 0; right: 0; top: 4px; width: 100%; height: 44px; margin: 0; opacity: 0; cursor: pointer; }
.timeline .tick { position: absolute; top: 16px; width: 0; height: 20px; margin-left: -1px; border-left: 2px solid var(--muted); pointer-events: none; }
.timeline .tick.passed { border-color: var(--pass); }
.timeline .tick.failed { border-color: var(--fail); border-left-width: 3px; }
.timeline .tick[aria-current="true"] { top: 12px; height: 28px; border-color: var(--now); border-left-width: 3px; }
.timeline .window { position: absolute; top: 16px; height: 20px; border: 1px solid var(--now); border-radius: 4px; background: color-mix(in srgb, var(--now) 16%, transparent); pointer-events: none; }
.timeline .scale { position: absolute; left: 0; right: 0; top: 54px; height: 16px; pointer-events: none; }
.timeline .scale span { position: absolute; transform: translateX(-50%); color: var(--muted); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.timeline .scale span::before { content: ""; position: absolute; left: 50%; top: -5px; height: 4px; border-left: 1px solid var(--line); }
.tick-labels { position: absolute; inset: 0; pointer-events: none; }
.tick-labels span { position: absolute; display: inline-flex; gap: 4px; transform: translateX(-50%); font: 700 11px/12px system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.tick-labels span.top { top: 0; }
.tick-labels span.bottom { top: 38px; }
.tick-labels b { color: var(--muted); }
.tick-labels b.passed { color: var(--pass); }
.tick-labels b.failed { color: var(--fail); }
.tick-labels b[aria-current="true"] { color: var(--now); text-decoration: underline; text-underline-offset: 2px; }
.moments { position: relative; flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 6px; padding-top: 2px; }
.chip { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; max-width: 100%; padding: 0 12px 0 8px; border: 1px solid var(--line); border-radius: 22px; background: var(--sunken); font-size: 13px; text-align: start; }
.chip time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.chip .chip-text { overflow: hidden; max-width: 230px; white-space: nowrap; text-overflow: ellipsis; }
.chip.failed { border-color: var(--fail); }
.chip[aria-current="true"] { border-color: var(--now); box-shadow: 0 0 0 1px var(--now); background: var(--surface); }
.chip[aria-current="true"] > .badge { box-shadow: none; }
.badge { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border: 2px solid var(--muted); border-radius: 50%; background: var(--surface); color: var(--ink); font: 700 12px/1 system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.badge.passed { border-color: var(--pass); background: var(--pass); color: var(--on-mark); }
.badge.failed { border-color: var(--fail); border-radius: 3px; background: var(--fail); color: var(--on-mark); }
.badge.other { border-radius: 3px; }
[aria-current="true"] > .badge, .caption .badge.now { box-shadow: 0 0 0 3px var(--now); }
.panes { display: grid; grid-template-columns: minmax(0, 1.24fr) minmax(0, 1fr); gap: 10px; }
.panel { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); overflow: hidden; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px; padding: 9px 12px; }
.panel-head h2, .panel-head .lbl { font-size: 14px; font-weight: 650; }
.panel-head span { color: var(--muted); font-size: 12px; }
.screen { position: relative; background: #0d0f11; }
.screen video { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #0d0f11; }
.caption { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; padding: 7px 10px; border: 1px solid rgba(255, 255, 255, .2); border-radius: 6px; background: rgba(13, 15, 17, .86); color: #f2efeb; font-size: 13px; color-scheme: dark; }
.caption.failed { border-color: #ff8a75; }
.caption time { color: #c8d4dc; font-variant-numeric: tabular-nums; }
.caption strong { font-weight: 600; }
.video-note { padding: 6px 12px 8px; color: var(--muted); font-size: 12px; }
.flight-path-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 6px 12px 8px; }
.flight-path-controls [role="group"] { display: flex; flex-wrap: wrap; gap: 4px; }
.flight-path-controls button { min-height: 44px; min-width: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); font-size: 12px; }
.flight-path-controls button:disabled { opacity: .5; }
.flight-path-controls button[aria-pressed="true"] { border-color: var(--action); color: var(--action); }
.flight-path-hint { flex-basis: 100%; min-height: 1.5em; color: var(--muted); font-size: 11px; }
#map { display: block; flex: 1; width: 100%; min-height: 220px; background: #192128; }
#map.flight-path-3d { cursor: grab; }
#map.flight-path-3d:active { cursor: grabbing; }
#map.touch-rotating { touch-action: none; }
#map.flight-path-3d > text:last-of-type { display: none; }
#map .path-mark { cursor: pointer; }
.path-legend { display: flex; flex-wrap: wrap; gap: 3px 14px; padding: 5px 12px 8px; background: #192128; color: #c8d4dc; font-size: 11px; }
.path-legend span { display: inline-flex; align-items: center; gap: 5px; }
.path-legend .key::before { content: ""; width: 14px; border-top: 2px solid #eef2f5; }
.path-legend .estimate-key::before { border-top: 2px dashed #7c9fff; }
.path-legend .planned-key::before { border-top: 2px dashed #86caba; }
.path-legend i { display: inline-block; width: 11px; height: 11px; border: 2px solid #c8d4dc; border-radius: 50%; }
.path-legend i.passed { border-color: #8fd3b4; background: #8fd3b4; }
.path-legend i.failed { border-color: #ff8a75; border-radius: 2px; background: #ff8a75; }
.checks { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.checks-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
.checks-head h2 { font-size: 16px; font-weight: 650; }
.checks-head p, .recorded-note { color: var(--muted); font-size: 12px; }
.replay-guide-overlay { --replay-dim: #101923a6; position: fixed; inset: 0; z-index: 15; pointer-events: none; }
.replay-shade { position: absolute; inset: 0; background: var(--replay-dim); }
.replay-spotlight { position: absolute; border-radius: 8px; border: 2px solid #eef6fb; box-shadow: 0 0 0 200vmax var(--replay-dim); }
.replay-guide-launchers { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.replay-guide-launchers.guiding { visibility: hidden; }
.replay-guide-launchers .btn { padding-inline: 12px; }
.replay-guide-open { border-radius: 5px; }
.replay-guide-open:focus-visible { outline-offset: -2px; }
.replay-guide { position: absolute; width: min(340px, calc(100% - 24px)); max-height: calc(100% - 24px); overflow: auto; padding: 14px; border-radius: 8px; background: var(--surface); box-shadow: 0 5px 22px #10192355; pointer-events: auto; }
.replay-guide h2 { margin: 0 0 4px; font-size: 16px; }
.replay-guide p { color: var(--muted); font-size: 14px; }
.replay-guide-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 12px; }
.replay-guide-actions .btn { padding-inline: 11px; }
.replay-guide-actions .btn:first-child { margin-inline-end: auto; }
.check-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 8px; }
.check { display: flex; align-items: flex-start; gap: 10px; width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--sunken); text-align: start; }
.check.failed { border-color: var(--fail); background: var(--fail-surface); }
.check[aria-current="true"] { box-shadow: 0 0 0 2px var(--now); }
.check .text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.check .sentence { font-weight: 600; }
.check .numbers { display: flex; flex-wrap: wrap; gap: 3px 16px; font-size: 13px; }
.check .numbers span > span:first-child { color: var(--muted); }
.check .value { font-family: ui-monospace, Menlo, monospace; font-weight: 650; }
.check.failed .value.measured { color: var(--fail); }
.check .when { color: var(--muted); font-variant-numeric: tabular-nums; }
.checks summary { display: flex; align-items: center; min-height: 44px; color: var(--action); font-weight: 600; }
.gherkin { display: flex; flex-direction: column; margin-top: 4px; padding: 10px 12px; border-radius: 6px; background: var(--sunken); font: 12.5px/1.7 ui-monospace, "SF Mono", Menlo, monospace; overflow-wrap: anywhere; }
.gherkin b { color: var(--action); }

/* the Event timing view (docs/TRY-PAGE.md §10.2) */
.choose .open-timing { align-self: center; min-height: 44px; margin-top: 8px; padding: 0 14px; border-color: var(--action); color: var(--action); font-size: 13.5px; }
.panel-head.views { align-items: center; padding: 0; border-bottom: 1px solid var(--line); }
.panel-head.views .mono { padding-inline: 12px; }
.view-tabs { display: flex; gap: 2px; }
.view-tabs button { position: relative; min-height: 44px; padding: 0 12px; border: 0; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600; }
.view-tabs button[aria-selected="true"] { color: var(--ink); font-weight: 700; }
.view-tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 3px; border-radius: 2px 2px 0 0; background: var(--action); }
.panes.timing-open { grid-template-areas: "video timing" "checks timing"; grid-template-rows: auto 1fr; align-items: start; }
.panes.timing-open > .camera { grid-area: video; }
.panes.timing-open > .route { grid-area: timing; align-self: stretch; }
.panes.timing-open > .checks { grid-area: checks; align-self: stretch; }
.panes.timing-open > .checks .check-list { grid-template-columns: minmax(0, 1fr); }
.timing { display: flex; flex: 1; flex-direction: column; }
.t-summary { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 20px; padding: 12px; }
.t-headline { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.t-headline strong { font-size: 26px; line-height: 1; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.t-headline span { font-size: 14px; }
.t-facts { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.t-facts div { display: flex; align-items: baseline; gap: 7px; }
.t-facts dt { color: var(--muted); font-size: 12px; }
.t-facts dd { font-size: 13.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.t-facts .passed dd { color: var(--pass); }
.t-facts .failed dd { color: var(--fail); }
.t-chart { display: flex; flex-direction: column; padding-top: 4px; border-top: 1px solid var(--line); background: var(--sunken); }
.t-row { display: flex; flex-direction: column; padding-top: 12px; }
.t-row + .t-row { border-top: 1px dashed var(--line); }
.t-row-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; padding-inline: 12px; }
.t-row-head h3 { font-size: 13px; font-weight: 700; }
.t-row-head span { color: var(--muted); font-size: 13px; }
.t-row-head .t-state { align-self: center; padding: 0 8px; border: 1px solid var(--pass); border-radius: 4px; color: var(--pass); font-size: 12px; font-weight: 650; }
.t-row-head .t-state.failed { border-color: var(--fail); color: var(--fail); }
.t-lane { display: block; width: 100%; overflow: visible; }
.t-lane text { paint-order: stroke; stroke: var(--sunken); stroke-width: 4px; stroke-linejoin: round; font: 11.5px/1 ui-monospace, "SF Mono", Menlo, monospace; fill: var(--muted); font-variant-numeric: tabular-nums; }
.t-lane .t-axis { font-size: 11px; }
.t-lane .t-words { font: 12px/1 system-ui, -apple-system, "Segoe UI", sans-serif; fill: var(--muted); }
.t-lane .t-time { font: 600 11.5px/1 ui-monospace, "SF Mono", Menlo, monospace; fill: var(--ink); }
.t-lane .t-n, .t-lane .t-mode-name, .t-lane .t-used-label { stroke: none; }
.t-lane .t-n { font: 700 11.5px/1 system-ui, sans-serif; fill: var(--ink); }
.t-lane .t-n.on { fill: var(--on-mark); }
.t-lane .t-num { fill: var(--ink); }
.t-lane .t-num.now { fill: var(--now); }
.t-lane .t-used-label { font: 700 14px/1 ui-monospace, "SF Mono", Menlo, monospace; fill: var(--pass); }
.t-lane .t-mode-name { font: 600 12px/1 system-ui, sans-serif; fill: var(--ink); }
.t-grid { stroke: var(--line); stroke-width: .7; }
.t-up { stroke: var(--muted); stroke-width: 2; }
.t-silent { stroke: var(--now); stroke-width: 2; stroke-dasharray: 6 4; }
.t-start { fill: var(--now); }
.t-tick { stroke: var(--now); stroke-width: 2.5; }
.t-event { fill: var(--surface); stroke: var(--muted); stroke-width: 2; }
.t-passed { fill: var(--pass); }
.t-failed { fill: var(--fail); }
.t-not-seen { fill: var(--surface); stroke: var(--fail); stroke-width: 2; stroke-dasharray: 3 2; }
.t-allowed { fill: var(--surface); stroke: var(--band-edge); stroke-dasharray: 4 3; }
.t-used { fill: var(--band-used); stroke: var(--band-edge); }
.t-used.late { fill: color-mix(in srgb, var(--fail) 30%, transparent); stroke: var(--fail); }
.t-mode { fill: var(--surface); stroke: var(--line); }
.t-mode.m1 { fill: color-mix(in srgb, var(--now) 16%, var(--surface)); }
.t-mode.m2 { fill: color-mix(in srgb, var(--action) 16%, var(--surface)); }
.t-hit { fill: transparent; pointer-events: all; }        /* WebKit does not hit-test a transparent fill otherwise */
.t-ring { fill: color-mix(in srgb, var(--now) 14%, transparent); stroke: var(--now); stroke-width: 3; }
.t-mark { cursor: pointer; outline: none; }
.t-mark:focus-visible .t-hit { stroke: var(--action); stroke-width: 2; }
.t-mark:hover .t-hit { fill: color-mix(in srgb, var(--action) 12%, transparent); }
.t-playhead { stroke: var(--now); stroke-width: 2; pointer-events: none; }
.t-lane .ahead { opacity: .28; }
.t-lane .t-mark, .t-lane .t-words, .t-lane .t-num, .t-lane .t-silent, .t-lane .t-mode, .t-lane .t-mode-name { transition: opacity .25s ease-out; }
.t-axis-note { padding: 0 12px 10px; color: var(--muted); font-size: 11.5px; text-align: end; }
.t-detail { display: flex; flex: 1; flex-direction: column; gap: 6px; min-height: 150px; padding: 10px 12px 16px; border-top: 1px solid var(--line); }
.t-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.t-count { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.t-nav { display: flex; gap: 8px; }
.round.small { width: 44px; height: 44px; font-size: 18px; }
.t-detail h3 { font-size: 18px; line-height: 1.3; font-weight: 650; text-wrap: balance; }
.t-text { max-width: 68ch; font-size: 14.5px; text-wrap: pretty; }
.t-link a { display: inline-flex; align-items: center; min-height: 44px; color: var(--action); font-size: 13.5px; font-weight: 650; }
.t-source { max-width: 72ch; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.t-source span { margin-inline-end: 6px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.t-replay { color: var(--now); font-size: 12.5px; font-weight: 600; }
.check-list li.timed { display: flex; flex-direction: column; }
.check-list li.timed .check { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.inspect { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; min-height: 44px; padding: 6px 12px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 6px 6px; background: var(--surface); font-size: 13px; text-align: start; font-variant-numeric: tabular-nums; }
.inspect:hover { background: color-mix(in srgb, var(--action) 8%, var(--surface)); }
.inspect strong { margin-inline-start: auto; color: var(--action); font-weight: 650; }
.meter { position: relative; flex: 0 1 140px; min-width: 80px; height: 8px; border: 1px solid var(--band-edge); border-radius: 4px; background: var(--band); }
.meter-fill { position: absolute; inset: 0 auto 0 0; width: var(--used, 0%); border-radius: 3px; background: var(--pass); }
.meter-tick { position: absolute; top: -4px; bottom: -4px; left: var(--setting, 0%); border-left: 2px solid var(--now); }
.meter-key { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
.glyph.tick { display: inline-block; width: 0; height: 14px; border-left: 2.5px solid var(--now); }

/* the sensor window */
dialog#sensors { width: min(1060px, calc(100vw - 32px)); max-width: none; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); box-shadow: 0 30px 70px rgba(0, 0, 0, .55); }
dialog#sensors[open] { display: flex; flex-direction: column; }
dialog#sensors::backdrop { background: rgba(8, 10, 12, .72); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { font-size: 24px; font-weight: 600; }
.dialog-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 18px; padding: 18px 20px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.dialog-foot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--line); }
.drawing { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px; border-radius: 10px; background: radial-gradient(ellipse 70% 60% at 50% 34%, var(--stage-glow) 0%, var(--stage) 76%); color: var(--stage-ink); align-self: start; }
.drawing .drone-picture { width: min(300px, 100%); height: auto; max-height: 210px; }
.places { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%; }
.place { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--action); border-radius: 6px; background: var(--surface); font-size: 12px; text-align: start; }
.place b { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--action); color: var(--on-action); font-size: 11px; }
.place.empty { border: 1px dashed var(--line); background: transparent; color: var(--muted); }
.place.empty b { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.sensor-cards { display: flex; flex-direction: column; gap: 12px; }
.sensor-note { color: var(--muted); font-size: 13px; }
.sensor { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--sunken); }
.sensor-top { display: flex; align-items: center; gap: 12px; }
.sensor-top > b { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--action); color: var(--on-action); font-size: 12px; }
.photo { flex: none; display: flex; align-items: center; justify-content: center; width: 84px; height: 64px; border: 1px solid var(--line); border-radius: 6px; background: #fff; overflow: hidden; }
.photo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.photo.none { background: var(--surface); color: var(--muted); font-size: 11px; }
.sensor-name { display: flex; flex-direction: column; min-width: 0; }
.sensor-name .role { color: var(--muted); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.sensor-name strong { font-size: 17px; font-weight: 650; }
.sensor-name a { display: inline-flex; align-items: center; min-height: 44px; color: var(--action); font-size: 13px; }
.sensor-name .no-link { color: var(--muted); font-size: 13px; }
.options { display: flex; flex-wrap: wrap; gap: 6px; }
.options-label { color: var(--muted); font-size: 12px; }
.option { min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 5px; background: transparent; font-size: 13px; }
.option[aria-pressed="true"] { border: 2px solid var(--action); background: var(--surface); font-weight: 650; }
.option small { margin-inline-start: 6px; color: var(--muted); font-weight: 400; }

/* layout by screen (docs/TRY-PAGE.md §6) */
@media (orientation: portrait), (max-width: 899px) {
  .panes { grid-template-columns: minmax(0, 1fr); }
  .panes.timing-open { grid-template-areas: none; grid-template-rows: auto; }
  .panes.timing-open > .camera, .panes.timing-open > .route { grid-area: auto; }
  .t-detail { min-height: 0; }
  .dialog-body { grid-template-columns: minmax(0, 1fr); }
  .drawing { align-self: stretch; }
  #map { min-height: 0; aspect-ratio: 880 / 420; flex: none; }
}
@media (max-width: 760px) {
  .shell { width: calc(100% - 24px); }
  .stage { gap: 4px; }
  .chosen { width: 68vw; padding-inline: 10px; }
  .stage .side { padding: 4px 0; }
  .scenarios .center img { width: 100%; }
  .stage .side.left { margin-left: -18vw; }
  .stage .side.right { margin-right: -18vw; }
  .scenarios .side img { width: 30vw; }
  .stage .side span { display: none; }
  .steps button { padding-inline: 8px 10px; }
  .timeline { flex-basis: 100%; order: 3; }
  .moments { order: 4; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
  .moments li { flex: none; scroll-snap-align: start; }
  .chip .chip-text { max-width: 200px; }
}
@media (max-width: 520px) {
  .page-header .back { order: 3; }
  .steps { order: 4; flex-basis: 100%; }
  .steps ol { justify-content: space-between; }
  .dialog-head, .dialog-body, .dialog-foot { padding-inline: 12px; }
}

/* The drone picker uses less of the screen on tablets and in smaller browser windows. */
@media (max-width: 1199px), (max-width: 1366px) and (pointer: coarse) {
  .drones .stage { padding-block: 20px 12px; }
  .drones .chosen { width: min(440px, 60vw); padding-block: 10px 6px; }
  .drones .center .drone-picture { width: min(288px, 100%); height: min(184px, 27vh); }
  .drones .floor { width: min(260px, 86%); height: 24px; margin-top: -8px; }
  .drones .name-row h2 { font-size: clamp(20px, 3vw, 25px); letter-spacing: .02em; }
  .drones :is(:lang(zh-TW), :lang(ja)) h2 { letter-spacing: 0; }
  .drones .platform { padding: 2px 8px; font-size: 13px; }
  .drones .sub { font-size: 15px; }
  .drones .sensor-row { margin-top: 2px; }
  .drones .stage .side { width: min(144px, 100%); margin-inline: 0; }
  .drones .side .drone-picture { width: 100%; height: min(92px, 12vw); }
  .drones .side span { display: block; }
}

@media (max-width: 600px) {
  .drones .stage { grid-template-columns: minmax(0, 1fr); justify-items: center; margin-top: 10px; }
  .drones .stage .side { display: none; }
  .drones .chosen { width: min(340px, calc(100% - 24px)); }
  .drones .center .drone-picture { width: min(220px, 100%); height: clamp(110px, 34vw, 144px); }
  .drones .floor { width: min(190px, 72%); height: 18px; }
  .drones .carousel-nav { margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .stage.moved .center { animation: none; }
  .t-lane * { transition: none !important; }
}

/* Replay media, player and timing inspection */
.run-body .panes {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.run-body .panel-head {
  min-height: 42px;
  align-items: center;
}
.run-body .screen video {
  max-height: clamp(210px, 29vw, 390px);
}
.run-body #map {
  min-height: 160px;
}
.path-toggle {
  display: none;
}
.recording-info summary,
.values summary {
  width: fit-content;
  cursor: pointer;
  font-size: 13px;
  color: var(--action);
  padding-block: 6px;
}
.player {
  scroll-margin-top: 8px;
}
.player .tick,
.player .tick-labels,
.player .window {
  display: none;
}
.player .timeline {
  height: 44px;
  min-width: 80px;
  flex: 1;
  margin: 0 12px;
}
.player .timeline .rail,
.player .timeline .fill {
  top: 20px;
}
.player .timeline .fill:after {
  content: '';
  position: absolute;
  right: -5px;
  top: -3px;
  width: 10px;
  height: 10px;
  background: var(--action);
  border-radius: 50%;
}
.player .timeline .seek {
  top: 0;
}
.player .scale {
  display: none;
}
.inspection .view-tabs {
  padding-inline: 6px;
  border-bottom: 1px solid var(--line);
}
.event-table {
  padding: 4px 18px 12px;
}
.event-table .moments {
  display: block;
  overflow: visible;
}
.table-head,
.event-table .chip {
  display: grid;
  grid-template-columns: 30px 54px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 0 6px;
  text-align: start;
}
.table-head {
  min-height: 32px;
  font-size: 12px;
  color: var(--muted);
}
.event-table .chip {
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  border-top: 1px solid var(--line);
}
.event-table .chip:hover,
.event-table .chip[aria-current='true'] {
  background: var(--sunken);
}
.event-table .chip .chip-text {
  max-width: none;
  white-space: normal;
}
.event-table .badge {
  height: 20px;
  width: 20px;
  font-size: 11px;
}
.t-summary {
  display: block;
  padding: 20px 18px 12px;
}
.t-summary h2 {
  font-size: clamp(21px, 2vw, 28px);
  line-height: 1.15;
  letter-spacing: -0.025em;
}
.result-line {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 14px;
  margin: 6px 0;
  color: var(--muted);
}
.result-line .passed {
  color: var(--pass);
}
.timing {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(230px, 1fr);
  align-items: start;
}
.t-summary {
  grid-column: 1/-1;
}
.t-detail {
  min-width: 0;
  padding: 16px 18px;
}
.t-chart {
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.t-lane .ahead {
  opacity: 0.65;
}
@media (max-width: 760px) {
  .run-body .panes {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }
  .path-toggle {
    display: block;
    margin-left: auto;
    border: 0;
    background: transparent;
    color: var(--action);
    min-height: 44px;
    padding: 0 10px;
  }
  .route .panel-head .mono {
    display: none;
  }
  .route:not(.expanded) > :not(.panel-head) {
    display: none !important;
  }
  .timing {
    display: flex;
  }
  .t-chart,
  .t-detail {
    width: 100%;
  }
  .t-chart {
    border-right: 0;
  }
  .player .timeline {
    order: 0;
    flex-basis: 50px;
    margin: 0;
  }
  .run-body .player {
    gap: 8px;
  }
  .event-table {
    padding-inline: 8px;
  }
}
.player .group-labels {
  position: absolute;
  inset: 0 0 auto;
  height: 24px;
  pointer-events: none;
}
.group-marker {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  padding: 0 4px;
  height: 23px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  pointer-events: auto;
  color: var(--muted);
  border: 0;
  border-radius: 3px;
  justify-content: center;
  background: transparent;
  font: 600 12px/1 system-ui;
  cursor: pointer;
}
.group-marker small {
  font: 500 10px/1 system-ui;
}
.group-marker:hover,
.group-marker:focus-visible {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.group-marker.current-group {
  color: var(--action);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.player .timeline .tick {
  display: block;
  top: 25px;
  height: 9px;
  z-index: 1;
  pointer-events: none;
}
.player .timeline .rail,
.player .timeline .fill {
  top: 28px;
}
.player .group-labels {
  z-index: 2;
}
.event-table .moments {
  max-height: 178px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  overflow-anchor: none;
  padding: 0;
}
.table-head {
  min-height: 26px;
}
.event-table .chip {
  min-height: 32px;
  padding-block: 3px;
  font-size: 13px;
}
.event-table .badge {
  width: 18px;
  height: 18px;
  font-size: 10px;
  border-width: 1px;
}
.event-table .chip[aria-current='true'] {
  color: var(--ink);
  background: color-mix(in srgb, var(--action) 10%, var(--surface));
  font-weight: 650;
}
@media (max-width: 760px) {
  .player .play {
    min-width: 55px;
    padding-inline: 7px;
  }
  .player .clock {
    font-size: 11px;
  }
  .player .timeline {
    margin: 0 2px;
  }
  .event-table .chip {
    min-height: 40px;
  }
  .event-table .moments {
    max-height: 204px;
  }
}
#magi-late-position {
  color-scheme: inherit;
  --surface: light-dark(#fcfbf9, #22262a);
  --ground: light-dark(#edf0f2, #171b1e);
  --ink: light-dark(#20272c, #f0efec);
  --muted: light-dark(#505c65, #b2bec7);
  --line: light-dark(#cbd2d7, #465159);
  --late: light-dark(#a82c24, #ff9e8e);
  --late-wash: light-dark(#fbe9e5, #412a2a);
  --perception: light-dark(#e0e9fa, #263954);
  --perception-ink: light-dark(#233e6d, #d6e6ff);
  --sender: light-dark(#d9eedf, #294238);
  --sender-ink: light-dark(#24513c, #c4f3d5);
  --busy: light-dark(#e8ecef, #333b42);
  --selected: light-dark(#344b62, #bdd5ed);
  --mono: ui-monospace, 'SF Mono', Menlo, monospace;
  padding: clamp(4px, 2vw, 16px);
  color: var(--ink);
  font:
    14px/1.45 system-ui,
    sans-serif;
}
#magi-late-position * {
  box-sizing: border-box;
}
#magi-late-position .report {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}
#magi-late-position .top {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}
#magi-late-position .brand {
  letter-spacing: 0.14em;
  font-weight: 700;
}
#magi-late-position .context {
  color: var(--muted);
}
#magi-late-position .trace-body {
  padding: clamp(11px, 3vw, 22px);
  display: grid;
  gap: 16px;
}
#magi-late-position h2,
#magi-late-position h3,
#magi-late-position p,
#magi-late-position dl,
#magi-late-position dd {
  margin: 0;
}
#magi-late-position h2 {
  font-size: clamp(20px, 4vw, 27px);
  line-height: 1.18;
  letter-spacing: -0.025em;
}
#magi-late-position h3 {
  font-size: 14px;
  margin-bottom: 4px;
}
#magi-late-position .mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
#magi-late-position .small {
  font-size: 12px;
  color: var(--muted);
}
#magi-late-position .header p {
  margin-top: 4px;
}
#magi-late-position .facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
  padding: 10px 12px;
  background: var(--ground);
}
#magi-late-position dt {
  font-size: 12px;
  color: var(--muted);
}
#magi-late-position dd {
  font: 600 16px/1.4 var(--mono);
}
#magi-late-position .late dd {
  color: var(--late);
}
#magi-late-position .chart {
  --label-width: clamp(53px, 12vw, 99px);
  --due: 43.5%;
  --sent: 92.278%;
}
#magi-late-position .chart-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 2px 12px;
}
#magi-late-position .assignment {
  margin: 4px 0 10px;
}
#magi-late-position .handoff {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 16px;
  margin-top: 4px;
  font-size: 12px;
}
#magi-late-position .handoff .scheduler {
  color: var(--sender-ink);
}
#magi-late-position .plot {
  position: relative;
  padding: 0 0 0 var(--label-width);
}
#magi-late-position .plot-grid {
  position: absolute;
  inset: 23px 0 24px var(--label-width);
  pointer-events: none;
  background: repeating-linear-gradient(to right, var(--line) 0 1px, transparent 1px calc(100% / 6));
}
#magi-late-position .late-window {
  position: absolute;
  inset: 0 auto 0 var(--due);
  width: calc(var(--sent) - var(--due));
  background: var(--late-wash);
}
#magi-late-position .lines {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  inset: 23px 0 24px var(--label-width);
}
#magi-late-position .lines span {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 2px solid var(--late);
}
#magi-late-position .lines .due {
  left: var(--due);
  border-left-style: dashed;
}
#magi-late-position .lines .sent {
  left: var(--sent);
  border-left-color: var(--sender-ink);
}
#magi-late-position .markers,
#magi-late-position .axis {
  position: relative;
  height: 24px;
  font-size: 11px;
}
#magi-late-position .markers span {
  position: absolute;
  transform: translateX(-50%);
  white-space: nowrap;
  font-weight: 650;
}
#magi-late-position .markers .due {
  left: var(--due);
  color: var(--late);
}
#magi-late-position .markers .sent {
  left: var(--sent);
  color: var(--sender-ink);
}
#magi-late-position .row {
  position: relative;
  height: 40px;
}
#magi-late-position .row-label {
  position: absolute;
  right: 100%;
  top: 12px;
  width: var(--label-width);
  font-size: 12px;
  color: var(--muted);
}
#magi-late-position .slice {
  position: absolute;
  z-index: 1;
  top: 6px;
  height: 28px;
  border: 0;
  border-radius: 3px;
  background: var(--busy);
  color: var(--ink);
  text-align: left;
  overflow: hidden;
  padding: 0 6px;
  white-space: nowrap;
  text-overflow: ellipsis;
  font:
    600 12px/1 system-ui,
    sans-serif;
}
#magi-late-position .slice[aria-pressed='true'] {
  box-shadow: inset 0 0 0 2px var(--selected);
}
#magi-late-position .slice:focus-visible {
  outline: 2px solid var(--selected);
  outline-offset: 2px;
  z-index: 3;
}
#magi-late-position .vision {
  background: var(--perception);
  color: var(--perception-ink);
}
#magi-late-position .write {
  background: var(--sender);
  color: var(--sender-ink);
  min-width: 10px;
  padding: 0;
  text-align: center;
}
#magi-late-position .runnable {
  background: var(--late-wash);
  color: var(--late);
  border-bottom: 2px solid var(--late);
}
#magi-late-position .ticks {
  color: var(--muted);
}
#magi-late-position .ticks span {
  position: absolute;
  top: 5px;
  left: var(--tick);
  transform: translateX(-50%);
}
#magi-late-position .ticks span:first-child {
  transform: none;
}
#magi-late-position .ticks span:last-child {
  transform: translateX(-100%);
  white-space: nowrap;
}
#magi-late-position .details {
  padding: 10px 12px;
  background: var(--ground);
  display: grid;
  gap: 3px;
}
#magi-late-position .details strong {
  font-size: 13px;
}
@media (max-width: 460px) {
  #magi-late-position .top {
    padding-inline: 10px;
  }
  #magi-late-position .facts {
    gap: 7px 13px;
  }
  #magi-late-position dd {
    font-size: 14px;
  }
  #magi-late-position .slice {
    padding-inline: 4px;
    font-size: 11px;
  }
  #magi-late-position .axis .minor {
    display: none;
  }
}

#magi-late-position {
  padding: 0;
}
#magi-late-position .report {
  border: 0;
}
#magi-late-position .markers .sent {
  transform: translateX(-80%);
}

.delivery-overview {
  padding: clamp(12px, 2.4vw, 28px);
}
.delivery-overview h2,
.delivery-detail h3 {
  margin: 0;
}
.delivery-overview p {
  margin: 0.5rem 0 1rem;
}
.delivery-overview svg {
  display: block;
  width: 100%;
  cursor: crosshair;
}
.delivery-overview svg text {
  font: 12px system-ui;
  fill: currentColor;
}
.delivery-overview input {
  display: block;
  width: 90%;
  margin: 0.3rem auto 1rem;
}
.delivery-detail {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  margin-top: 1rem;
}

.delivery-overview svg [role='button']:focus-visible {
  outline: 2px solid #345567;
}
.position-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.position-head button + button {
  margin-left: 0.3rem;
}
.measurement-picker {
  display: flex;
  align-items: center;
  gap: 6px 12px;
  flex-wrap: wrap;
  margin: 14px clamp(12px, 2.4vw, 28px) 0;
  color: var(--muted);
  font-size: .875rem;
}
.measurement-picker select {
  max-width: 100%;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background-color: var(--sunken);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.measurement-picker select:hover {
  border-color: var(--muted);
}
@supports (appearance: base-select) {
  .measurement-picker select,
  .measurement-picker select::picker(select) {
    appearance: base-select;
  }
  .measurement-picker select { align-items: center; gap: 12px; }
  .measurement-picker select::picker(select) {
    margin-top: 4px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    color: var(--ink);
  }
  .measurement-picker option { padding: 8px; border-radius: 3px; }
  .measurement-picker option:checked,
  .measurement-picker option:hover { background: var(--sunken); }
}

.trace-page {
  max-width: 1100px;
  margin: auto;
  padding: clamp(12px, 3vw, 36px);
}
.trace-page > a {
  display: inline-block;
  margin-bottom: 20px;
}
.trace-page .trace-body {
  padding: clamp(12px, 2vw, 28px);
}
.trace-page h1 {
  margin: 0.25em 0;
}
.trace-page .facts,
.trace-page .chart,
.trace-page .details {
  margin: 1rem 0;
}
.trace-page h2 {
  font-size: 1.15rem !important;
}
.trace-event {
  position: absolute;
  top: 4px;
  height: 30px;
  border-left: 2px solid #805c24;
}
.trace-event::after {
  content: attr(data-label);
  font-size: 11px;
  position: absolute;
  left: 3px;
  white-space: nowrap;
}
.trace-event:last-child::after {
  left: auto;
  right: 3px;
}
.trace-event:first-of-type::after {
  top: 14px;
}
.delivery-detail .btn.primary {
  display: inline-block;
  text-decoration: none;
}
.delivery-overview [role='button'] {
  cursor: pointer;
}
.delivery-detail .btn.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
}
.delivery-detail .position-head {
  justify-content: flex-start;
  column-gap: 14px;
}
.delivery-detail .position-head button {
  min-width: 36px;
  min-height: 36px;
  padding: 0 8px;
}
.delivery-detail p {
  margin: 0.5rem 0 0.8rem;
}
.trace-page {
  width: 100%;
  max-width: 960px;
  box-sizing: border-box;
}
.trace-page #magi-late-position {
  padding: 0;
}
.trace-page #content > h2 {
  margin: 0.25rem 0;
  font-size: clamp(20px, 3vw, 28px) !important;
}
.trace-page #content > p:not(.details) {
  max-width: 65ch;
  margin: 0.4rem 0 1.4rem;
}
.trace-page #content > .position-head {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.trace-page .position-head button {
  min-height: 36px;
  padding: 0 10px;
}
.trace-page .position-head button:disabled {
  opacity: 0.4;
}
.trace-page #magi-late-position .chart {
  --label-width: 58px;
}
.trace-page #magi-late-position .row-label {
  text-transform: none;
  letter-spacing: normal;
  font-weight: 600;
}
.trace-page .plot {
  isolation: isolate;
}
.trace-page .wait-band {
  position: absolute;
  z-index: -1;
  pointer-events: none;
  inset: 0 0 24px var(--label-width);
}
.trace-page .wait-bounds {
  position: absolute;
  top: 0;
  bottom: 0;
  border-inline: 1px dashed #a35e42;
  background: #c9814e18;
}
.trace-page #magi-late-position .slice {
  padding: 0;
  text-align: center;
  min-width: 0;
  text-overflow: clip;
}
.trace-page #magi-late-position .ticks span {
  transform: translateX(-50%);
  white-space: nowrap;
}
.trace-page .trace-event:first-of-type:after {
  top: 0;
}
.trace-page #magi-late-position .facts {
  justify-content: flex-start;
}
.trace-toggle {
  background: none;
  color: inherit;
  border: 0;
  text-decoration: underline;
  padding: 8px 0;
  cursor: pointer;
}
.trace-page #content > details {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.trace-page #content > details summary {
  cursor: pointer;
}
.trace-page #content > details p {
  margin-top: 0.65rem;
}
@media (max-width: 520px) {
  .delivery-overview svg text {
    font-size: 20px;
  }
  .delivery-overview svg > text[text-anchor='end'] {
    font-size: 16px;
    transform: translateX(4px);
  }
  .delivery-overview svg > text[text-anchor='end']:first-of-type {
    font-size: 16px;
  }
}
.delivery-detail .position-head {
  justify-content: flex-start;
  gap: 0.4rem 1rem;
}
.position-actions {
  margin-inline-start: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.delivery-detail .position-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  min-height: 36px;
  margin: 0;
  line-height: 1;
}
.delivery-detail .position-actions .primary {
  margin-left: 4px;
  padding: 0 12px;
}
.delivery-detail p {
  margin-bottom: 0;
}
.cpu-dialog.trace-page {
  width: min(890px, calc(100% - 24px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  overflow: auto;
  overscroll-behavior: contain;
}
.cpu-dialog::backdrop {
  background: rgb(17 25 30 / 55%);
}
.trace-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 0.875rem;
}
.trace-tools span {
  margin-right: auto;
}
.trace-tools .btn {
  min-height: 36px;
}
.cpu-dialog #magi-late-position .trace-body {
  padding: clamp(16px, 3vw, 28px);
}
.cpu-dialog #trace-dialog-title {
  font-size: 1.5rem !important;
}
.cpu-dialog .trace-tools a {
  white-space: nowrap;
  color: inherit;
}
body:has(.cpu-dialog[open]) {
  overflow: hidden;
}

.solo-timeline {
  font-size: 1rem;
  padding: 12px 18px;
}
.timing[hidden] {
  display: none;
}
.inspection .t-facts {
  display: flex;
  flex-wrap: wrap;
}
.inspection .t-detail {
  align-self: start;
}
.delivery-overview svg {
  touch-action: manipulation;
}
/* Keep controls large enough to operate while their labels stay compact. */
.group-marker {
  min-width: 44px;
  height: 44px;
  align-items: flex-start;
  padding-top: 3px;
}
.event-table .chip,
.delivery-detail .position-actions .btn,
.cpu-dialog .trace-tools .btn,
.trace-page .position-head button,
.measurement-picker select,
.recording-info summary,
.values summary {
  min-height: 44px;
}
.delivery-detail .position-actions .btn {
  min-width: 44px;
}
.t-chart,
.t-detail,
.t-summary {
  padding-inline: 12px;
}

/* Copter scene, accepted in the local trial; boats keep the video rules above. */
.real-canvas { height: clamp(350px, 29vw, 390px); position: relative; overflow: hidden; background: #cfe3f2; }
.real-canvas canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.real-place select { height: 44px; min-height: 44px; max-width: 42%; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 5px; padding: 0 8px; }
.real-place .panel-head { flex-wrap: wrap; }
.place-status { padding: 8px 12px; font-size: 13px; color: var(--muted); }
.place-status:empty { display: none; }
/* Google asks for clear space round its logo: 10 px left, right and top, 5 px below. */
.attribution { position: absolute; left: 8px; top: 8px; z-index: 3; max-width: calc(100% - 130px); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 10px 10px 5px; border-radius: 4px; background: #ffffffd9; color: #1b1e21; font-size: 10px; line-height: 1.2; pointer-events: none; }
.attribution .data-sources { display: none; pointer-events: auto; padding: 2px 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }
@media (max-width: 600px) {
  .attribution .data-sources { display: inline; }
  .attribution #tile-credits { display: none; flex-basis: 100%; }
  .attribution.open #tile-credits { display: block; }
}
.attribution img { display: block; }
.real-canvas .caption { z-index: 2; pointer-events: none; }
.imagery-loading { position: absolute; right: 12px; top: 12px; z-index: 3; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 9px; border-radius: 999px; background: #10161bcc; backdrop-filter: blur(6px); color: #fff; font-size: 12px; pointer-events: none; }
.spinner, .imagery-loading::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #ffffff40; border-top-color: #fff; animation: imagery-spin .8s linear infinite; }
/* The cover: a soft, out-of-focus sky and ground with a light sweep across it, a spinner and a label. */
.imagery-cover { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #fff; font-size: 13px; letter-spacing: .02em; text-shadow: 0 1px 2px #0006; overflow: hidden; pointer-events: none; opacity: 1; transition: opacity .5s ease;
  background: radial-gradient(120% 60% at 30% 78%, #5f7f5c 0, transparent 60%), radial-gradient(90% 50% at 78% 70%, #6f8a79 0, transparent 60%), linear-gradient(#6fa5d6 0, #cfe0ec 46%, #8a9a8c 54%, #566b58 100%); }
.imagery-cover::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, #ffffff38 50%, transparent 70%); transform: translateX(-100%); animation: imagery-sweep 1.6s ease-in-out infinite; }
.imagery-cover .spinner { width: 30px; height: 30px; border-width: 3px; }
.imagery-cover.lifted { opacity: 0; }
.imagery-cover.lifted::before, .imagery-cover.lifted .spinner { animation: none; }
@keyframes imagery-spin { to { transform: rotate(360deg); } }
@keyframes imagery-sweep { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .spinner, .imagery-loading::before, .imagery-cover::before { animation: none; } .imagery-cover { transition: none; } }
.imagery-loading[hidden] { display: none; }
html[data-playing="true"] .imagery-loading { display: none; }

/* On phones the loading pill sits below the credits, so both remain readable. */
@media (max-width: 600px) {
  .attribution { max-width: calc(100% - 16px); }
  .attribution .data-sources { min-height: 44px; padding: 0 4px; font-size: 12px; }
  .imagery-loading { top: auto; bottom: 12px; }
  .real-canvas .caption { bottom: 52px; }
}
.play:disabled { opacity: .65; cursor: wait; }


.attribution[hidden] { display: none; }
.real-canvas .imagery-cover { z-index: 4; }
.real-canvas .imagery-cover.lifted { visibility: hidden; }
.real-canvas .caption { bottom: 10px; }

/* ---- Fixes after the first publication with the real-place picture (Beck, 2026-11-20) ---- */
/* The Play button is a round icon button; its word is in a hidden span for screen readers. */
.player .play { width: 52px; min-width: 52px; height: 52px; padding: 0; border-radius: 50%; display: grid; place-items: center; flex: none; }
.player .play .play-icon { display: grid; place-items: center; }
.player .play svg { width: 26px; height: 26px; fill: currentColor; }
@media (max-width: 760px) {
  .player .play { width: 44px; min-width: 44px; height: 44px; padding: 0; }
  .player .play svg { width: 22px; height: 22px; }
}
/* The picture's heading and the flight path's heading are the same height on a pointer device, so the two
   panels start level. Touch screens keep the 44 px control; the panels are stacked there. */
@media (hover: hover) and (pointer: fine) {
  .real-place select { height: 28px; min-height: 28px; }
  .real-place .panel-head { padding-block: 6px; }
}
/* A check with a timing strip under it is highlighted as one box, not only its upper half. */
.check-list li.timed:has(.check[aria-current="true"]) { border-radius: 6px; box-shadow: 0 0 0 2px var(--now); }
.check-list li.timed .check[aria-current="true"] { box-shadow: none; }
/* Scenario cards: a smaller name and description, so the card stays short, above all on a phone. */
.scenarios .choose h2, .scenarios h2 { font-size: clamp(20px, 2.4vw, 28px); letter-spacing: .03em; }
.scenarios .sub { max-width: 60ch; font-size: 14.5px; line-height: 1.5; }
@media (max-width: 600px) {
  .scenarios .choose h2, .scenarios h2 { font-size: 19px; }
  .scenarios .sub { font-size: 14px; }
}

.wp-timing { padding: 16px; }
.wp-timing h3 { font-size: 1rem; }
.wp-timing p { margin: 6px 0; }
.wp-reading { display: grid; width: 100%; min-height: 44px; align-items: center; grid-template-columns: minmax(8em, 1fr) minmax(16px, 1fr) auto; gap: 12px; padding: 4px 0; background: transparent; color: inherit; border: 0; text-align: start; }
.wp-reading strong, .wp-delay strong { font-variant-numeric: tabular-nums; }
.wp-scale { position: relative; height: 1px; background: var(--line); }
.wp-scale i { position: absolute; top: -4px; width: 2px; height: 9px; background: currentColor; }
.wp-delay { border-top: 1px solid var(--line); padding-top: 10px; }

/* Local beta navigation: keep both picker exits readable at narrow widths. */
.header-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 16px; }
.header-links .back { display: inline-flex; align-items: center; min-height: 44px; }
@media (max-width: 700px) { .header-links { width: 100%; justify-content: space-between; } }
@media (min-width: 701px) and (max-width: 900px) { .header-links { flex-direction: column; gap: 0; align-items: flex-end; } }
