.debug-page { background: radial-gradient(circle at 30% -10%, rgba(214,255,56,.08), transparent 32rem), #0b0c0b; }
.debug-main { max-width: 1480px; padding-top: 28px; }
.debug-nav { display: flex; gap: 18px; align-items: center; }
.debug-warning {
  display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: start;
  padding: 22px; border: 2px solid rgba(255,211,106,.58); border-radius: 20px;
  background: linear-gradient(135deg, rgba(255,211,106,.16), rgba(255,79,31,.08));
  box-shadow: var(--shadow);
}
.debug-warning-badge {
  padding: 9px 12px; border-radius: 10px; background: var(--yellow); color: #151615;
  font: 800 12px/1 Manrope, sans-serif; letter-spacing: .09em; white-space: nowrap;
}
.debug-warning h1 { margin: 0; font: 800 clamp(22px,3vw,34px)/1.12 Manrope,sans-serif; letter-spacing: -.035em; }
.debug-warning p { margin: 8px 0 0; max-width: 970px; color: #e7ddbd; font-size: 15px; line-height: 1.55; }
.debug-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, .82fr); gap: 20px; margin-top: 20px; align-items: start; }
.debug-stage, .debug-readout, .debug-timeline-card, .debug-boundary { padding: 24px; }
.debug-stage-head, .debug-timeline-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.debug-stage h2, .debug-readout h2, .debug-timeline-card h2, .debug-boundary h2 { margin: 0; font: 800 24px/1.2 Manrope,sans-serif; letter-spacing: -.035em; }
.debug-video-shell { position: relative; margin-top: 18px; width: 100%; aspect-ratio: 16/9; overflow: hidden; border-radius: 18px; background: #020302; box-shadow: inset 0 0 0 1px rgba(255,255,255,.09); }
#debugVideo, #overlayCanvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#debugVideo { object-fit: contain; background: #020302; }
#overlayCanvas { z-index: 2; pointer-events: none; }
.debug-canvas-status { position: absolute; z-index: 3; left: 14px; bottom: 52px; padding: 7px 10px; border-radius: 9px; background: rgba(4,9,8,.76); color: #d8ddd8; font-size: 11px; font-weight: 700; backdrop-filter: blur(8px); }
.debug-shortcuts { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; margin-top: 12px; }
.debug-shortcuts button { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.045); color: var(--ink); text-align: left; cursor: pointer; }
.debug-shortcuts button:hover, .debug-shortcuts button:focus-visible { border-color: var(--lime); background: rgba(214,255,56,.08); }
.debug-shortcuts small, .debug-shortcuts strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.debug-shortcuts small { color: var(--muted); font-size: 10px; }
.debug-shortcuts strong { margin-top: 4px; font: 700 13px/1.2 Manrope,sans-serif; }
.debug-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 14px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.025); }
.debug-controls button { border: 1px solid var(--line); border-radius: 10px; background: #181c19; color: var(--ink); padding: 8px 11px; font: inherit; font-weight: 800; cursor: pointer; }
.debug-controls button:hover { border-color: var(--mint); }
.scene-browser { display: grid; grid-template-columns: minmax(170px,.8fr) minmax(260px,1.5fr) auto; gap: 10px; margin-top: 16px; }
.scene-browser label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.scene-browser select { min-width: 0; width: 100%; border: 1px solid var(--line); border-radius: 10px; background: #181c19; color: var(--ink); padding: 10px 12px; font: 700 12px/1.2 Manrope,sans-serif; color-scheme: dark; }
.scene-stepper { display: flex; align-items: end; gap: 7px; }
.scene-stepper button { border: 1px solid var(--line); border-radius: 10px; background: #181c19; color: var(--ink); padding: 10px 12px; font: 800 12px/1 Manrope,sans-serif; cursor: pointer; }
.classification-badge { display: inline-flex; margin: 8px 7px 2px 0; padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); font-size: 11px; font-weight: 800; }
.coverage-legend { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.coverage-legend span { padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; font-size: 10px; font-weight: 800; }
.debug-controls label { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 12px; font-weight: 700; }
.debug-controls input[type=checkbox] { accent-color: var(--lime); width: 16px; height: 16px; }
.scale-control { margin-left: auto; }
.scale-control input { width: 110px; accent-color: var(--lime); }
.scale-control output { min-width: 28px; color: var(--ink); }
.debug-readout { position: sticky; top: 18px; }
.debug-description { color: var(--muted); line-height: 1.5; font-size: 13px; min-height: 3.9em; }
.debug-readout dl { display: grid; gap: 0; margin: 18px 0; border: 1px solid var(--line); border-radius: 15px; overflow: hidden; }
.debug-readout dl div { display: grid; grid-template-columns: 1fr 1.15fr; gap: 12px; padding: 11px 13px; border-bottom: 1px solid var(--line); }
.debug-readout dl div:last-child { border-bottom: 0; }
.debug-readout dt { color: var(--dim); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.debug-readout dd { margin: 0; text-align: right; font: 700 12px/1.3 Manrope,sans-serif; overflow-wrap: anywhere; }
.reference-readout { padding: 12px 13px; border-radius: 13px; border: 1px solid rgba(255,211,106,.25); background: rgba(255,211,106,.07); }
.reference-readout strong { font-size: 11px; color: var(--yellow); text-transform: uppercase; letter-spacing: .08em; }
.reference-readout p { margin: 6px 0 0; color: #e9e4d5; font-size: 12px; line-height: 1.45; }
.truth-stack { display: grid; gap: 9px; margin-top: 14px; }
.truth-stack div { padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.035); }
.truth-stack span { color: var(--lime); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.truth-stack div:last-child span { color: var(--yellow); }
.truth-stack p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.debug-timeline-card { margin-top: 20px; }
.debug-timeline-head > p { max-width: 520px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.debug-timeline { position: relative; height: 116px; margin-top: 22px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; cursor: crosshair; background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.015)); }
.timeline-windows { position: absolute; inset: 0; }
.timeline-window { position: absolute; bottom: 0; height: 100%; background: rgba(255,211,106,.09); border-left: 1px solid rgba(255,211,106,.5); border-right: 1px solid rgba(255,211,106,.5); }
.timeline-window span { position: absolute; left: 7px; bottom: 7px; color: var(--yellow); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.timeline-cursor { position: absolute; z-index: 4; top: 0; bottom: 0; width: 2px; background: var(--lime); box-shadow: 0 0 12px var(--lime); pointer-events: none; }
.timeline-cursor::before { content: ''; position: absolute; top: 0; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--lime); }
.marker-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin-top: 12px; }
.marker-button { padding: 10px 11px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.035); color: var(--ink); cursor: pointer; text-align: left; }
.marker-button:hover, .marker-button:focus-visible { border-color: var(--lime); }
.marker-button span, .marker-button strong { display: block; }
.marker-button span { color: var(--muted); font-size: 10px; line-height: 1.35; }
.marker-button strong { margin-top: 4px; font: 700 12px/1.2 Manrope,sans-serif; }
.marker-button.range { border-color: rgba(255,211,106,.25); }
.debug-boundary { margin-top: 20px; display: grid; grid-template-columns: .75fr 1.2fr 1.2fr; gap: 20px; align-items: start; }
.debug-boundary p { margin: 0; color: var(--muted); line-height: 1.55; font-size: 13px; }
.debug-boundary .section-kicker { grid-column: 1/-1; margin-bottom: -8px; }

@media (max-width: 1020px) {
  .debug-grid { grid-template-columns: 1fr; }
  .debug-readout { position: static; }
  .debug-shortcuts { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .debug-boundary { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .debug-main { padding-top: 14px; }
  .debug-nav { gap: 10px; }
  .debug-nav .source-link:last-child { display: none; }
  .debug-warning { grid-template-columns: 1fr; padding: 16px; gap: 12px; }
  .debug-warning-badge { width: fit-content; }
  .debug-warning h1 { font-size: 22px; }
  .debug-warning p { font-size: 13px; }
  .debug-stage, .debug-readout, .debug-timeline-card, .debug-boundary { padding: 16px; }
  .debug-stage-head, .debug-timeline-head { display: grid; }
  .debug-stage-head .timing-badge { width: fit-content; }
  .debug-shortcuts { grid-template-columns: 1fr; }
  .debug-controls { align-items: flex-start; flex-direction: column; }
  .scale-control { margin-left: 0; width: 100%; }
  .scale-control input { flex: 1; min-width: 0; }
  .marker-list { grid-template-columns: 1fr; }
  .debug-timeline { height: 96px; }
  .debug-canvas-status { display: none; }
  .timeline-window span { writing-mode: vertical-rl; bottom: 5px; }
}

.coverage-card {
  margin-bottom: 18px;
  border: 1px solid rgba(54,197,182,.36);
  background: linear-gradient(145deg,rgba(54,197,182,.10),rgba(255,255,255,.025));
}
.coverage-card h2 { margin: 0 0 8px; font-size: clamp(20px,2.4vw,30px); }
.coverage-summary { margin: 0; color: #f3f5ef; font-weight: 700; letter-spacing: .01em; }
.coverage-breakdown { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.coverage-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 999px;
  border: 1px solid color-mix(in srgb,var(--chip-color) 58%,transparent); background: color-mix(in srgb,var(--chip-color) 13%,transparent);
  color: #eef1ec; font-size: 12px; font-weight: 700;
}
.coverage-chip::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--chip-color); }
.scene-navigator {
  margin: 0 0 18px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(12,15,13,.82); box-shadow: var(--shadow);
}
.scene-navigator-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.scene-navigator h2 { margin: 0 0 4px; font-size: 20px; }
.scene-navigator p { margin: 0; color: var(--muted); font-size: 13px; }
.scene-navigator-controls { display: grid; grid-template-columns: minmax(170px,.8fr) minmax(280px,1.7fr) auto auto; gap: 9px; }
.scene-navigator select,.scene-navigator button {
  min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: #181c19; color: var(--ink);
  padding: 10px 12px; font: inherit; color-scheme: dark;
}
.scene-navigator button { cursor: pointer; font-weight: 800; }
.scene-navigator button:hover { border-color: var(--mint); }
.debug-timeline { position: relative; overflow: visible; }
#timelineCuts { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; }
.shot-segment {
  position: absolute; top: 0; bottom: 0; min-width: 1px; border: 0; border-right: 1px solid rgba(0,0,0,.24);
  opacity: .76; padding: 0; cursor: pointer;
}
.shot-segment:hover,.shot-segment:focus-visible { opacity: 1; outline: 2px solid #fff; outline-offset: -2px; z-index: 4; }
#timelineProgress { position: absolute; inset: 0 auto 0 0; width: 0; background: rgba(255,255,255,.09); border-right: 2px solid #fff; pointer-events: none; z-index: 5; }
#timelineRange { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; z-index: 6; }
.timeline-ticks { position: relative; height: 26px; margin-top: 8px; color: var(--muted); font-size: 11px; }
.timeline-ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.timeline-ticks span:first-child { transform: none; }
.timeline-ticks span:last-child { transform: translateX(-100%); }
body[data-coverage-complete='true'] .coverage-card { border-color: rgba(54,197,182,.7); }
body[data-coverage-complete='false'] .coverage-card { border-color: rgba(236,102,116,.8); }

@media (max-width: 800px) {
  .scene-navigator-controls { grid-template-columns: 1fr 1fr; }
  .scene-navigator-controls select:nth-of-type(2) { grid-column: 1 / -1; }
  .scene-browser { grid-template-columns: 1fr 1fr; }
  .scene-browser label:nth-child(2) { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .scene-navigator-head { display: block; }
  .scene-navigator-controls { grid-template-columns: 1fr; }
  .scene-navigator-controls select:nth-of-type(2) { grid-column: auto; }
  .scene-browser { grid-template-columns: 1fr; }
  .scene-browser label:nth-child(2) { grid-column: auto; }
  .scene-stepper button { flex: 1; }
  .coverage-chip { width: 100%; justify-content: flex-start; }
}
