@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("./fonts/source-serif-4-latin-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("./fonts/source-serif-4-latin-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/inter-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("./fonts/inter-latin-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("./fonts/inter-latin-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("./fonts/inter-latin-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("./fonts/inter-latin-800.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("./fonts/jetbrains-mono-latin-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("./fonts/jetbrains-mono-latin-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #f7f9fb;
  --surface: #ffffff;
  --surface-muted: #eef1f4;
  --surface-deep: #e6ebf2;
  --primary: #003461;
  --primary-soft: #e6eef6;
  --primary-deep: #001f3d;
  --primary-ghost: rgba(0, 52, 97, 0.08);
  --text: #191c1e;
  --muted: #4a5660;
  --muted-soft: #7b8696;
  --line: #c2c6d1;
  --line-strong: #98a0b0;
  --line-soft: #e1e4ea;
  --record: #b4232f;
  --record-deep: #8f1b25;
  --record-soft: #fbe7e9;
  --good: #166534;
  --good-soft: #e1f1e7;
  --warn: #8a5a13;
  --warn-soft: #fbf2dc;
  --party-lab: #d8003a;
  --party-con: #0079c0;
  --party-lib: #faa61a;
  --party-snp: #ebc94e;
  --party-ref: #12b6cf;
  --party-grn: #5ea832;
  --party-pc: #005b54;
  --party-dup: #d46a4c;
  --party-sf: #326760;
  --party-spk: #4a5660;
  --shadow-1: 0 1px 2px rgba(15, 25, 40, 0.04), 0 1px 1px rgba(15, 25, 40, 0.06);
  --shadow-2: 0 8px 28px rgba(15, 25, 40, 0.08);
  --shadow-pop: 0 24px 60px rgba(15, 25, 40, 0.18);
  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 10px;
  --font-display: "Source Serif 4", Georgia, serif;
  --font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", Consolas, "SFMono-Regular", monospace;
  --accent: var(--primary);
  --accent-strong: var(--primary-deep);
  --accent-soft: var(--primary-soft);
  --danger: var(--record);
  --danger-strong: var(--record-deep);
  --amber: var(--warn);
  --surface-2: var(--surface-muted);
  --shadow: var(--shadow-2);
  --max-width: 1500px;
}

* {
  box-sizing: border-box;
}

*:focus-visible {
  outline: 3px solid var(--primary-ghost);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-body);
  letter-spacing: 0;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

button,
input,
select,
textarea,
a.btn {
  font: inherit;
}

button,
summary,
.file-picker-button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.app-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(140%) blur(6px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--primary);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: var(--radius);
  color: #ffffff;
  background: var(--primary);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
}

.brand-wordmark {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.app-bar-right {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.readiness-menu {
  position: relative;
}

.readiness-menu summary {
  list-style: none;
}

.readiness-menu summary::-webkit-details-marker {
  display: none;
}

.status-chip,
.rec-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0;
}

.status-chip {
  border: 1px solid var(--good);
  color: var(--good);
  background: var(--good-soft);
}

.status-chip::before,
.privacy::before,
.privacy-explainer::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.readiness-list {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 60;
  display: grid;
  gap: 8px;
  min-width: 220px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

.status-pill.good {
  border-color: rgba(22, 101, 52, 0.3);
  color: var(--good);
  background: var(--good-soft);
}

.status-pill.warn {
  border-color: rgba(138, 90, 19, 0.32);
  color: var(--warn);
  background: var(--warn-soft);
}

.rec-chip {
  display: none;
  border: 1px solid var(--record);
  color: var(--record);
  background: var(--record-soft);
}

.rec-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.82);
  }
}

@keyframes lockNoticePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(138, 90, 19, 0.28);
  }

  100% {
    box-shadow: 0 0 0 8px rgba(138, 90, 19, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .rec-dot {
    animation: none;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* Windows High Contrast / forced-colors hardening. Several controls are painted
   with custom background colours that the forced-colours palette flattens, so
   meaning carried by colour alone (the selected range, the record state, status
   pills) can vanish. Give interactive controls a visible boundary, and keep the
   genuinely colour-coded elements painted with system colours. Additive — only
   applies when forced-colors is active; normal rendering is untouched. Verify in
   real Windows High Contrast mode before relying on it. */
@media (forced-colors: active) {
  .btn,
  .btn-record,
  .btn-stop,
  .preset-button,
  .format-button,
  .metadata-row,
  .rail-step,
  .status-pill,
  .status-chip,
  .rec-chip,
  .record-preflight,
  .clip-plan-card,
  .compat-card,
  .cct-card {
    border: 1px solid;
  }

  /* The trim range + handles show the chosen clip by colour alone. */
  .trim-selection {
    forced-color-adjust: none;
    background: Highlight;
  }

  .trim-handle {
    border: 2px solid ButtonText;
  }

  /* Live-recording indicators are meaning-by-colour. */
  .rec-dot,
  .cct-dot {
    forced-color-adjust: none;
    background: Highlight;
  }
}

.workspace {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 360px;
  gap: 0;
  width: min(var(--max-width), calc(100% - 40px));
  height: calc(100vh - 112px);
  min-height: 560px;
  margin: 24px auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-2);
}

body[data-state="idle"] .workspace {
  grid-template-columns: minmax(0, 1fr) 360px;
}

body.player-large .workspace {
  width: min(1800px, calc(100% - 32px));
  grid-template-columns: 280px minmax(0, 1fr) 340px;
}

body[data-state="idle"] #metadata-panel {
  display: none;
}

.metadata-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.metadata-head {
  display: grid;
  gap: 12px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--line-soft);
}

.metadata-head strong,
.metadata-head span {
  display: block;
}

.metadata-head strong {
  color: var(--primary);
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
}

.metadata-head span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}

.metadata-head output {
  justify-self: start;
  padding: 5px 9px;
  border: 1px solid rgba(0, 52, 97, 0.18);
  border-radius: 999px;
  color: var(--primary);
  background: var(--primary-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

.metadata-tools {
  display: grid;
  gap: 12px;
  padding: 0 20px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.metadata-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.metadata-tab {
  min-height: 36px;
  border: 0;
  border-right: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.metadata-tab:last-child {
  border-right: 0;
}

.metadata-tab.active,
.metadata-tab[aria-selected="true"] {
  color: #ffffff;
  background: var(--primary);
}

.metadata-empty,
.metadata-no-results {
  margin: 12px 20px;
  padding: 11px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--surface-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.metadata-range-summary {
  margin: 12px 20px 6px;
  padding: 12px;
  border: 1px solid rgba(0, 86, 64, 0.18);
  border-radius: var(--radius);
  color: var(--primary);
  background: rgba(229, 244, 239, 0.72);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.metadata-range-summary strong {
  color: var(--good);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
}

.metadata-range-summary span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

.moment-lock-notice {
  margin: 12px 20px 0;
  padding: 10px 11px;
  border: 1px solid rgba(138, 90, 19, 0.28);
  border-radius: var(--radius);
  color: #6d4300;
  background: var(--warn-soft);
  font-size: 12px;
  font-weight: 700;
  line-height: 17px;
}

.moment-lock-notice.is-attention {
  animation: lockNoticePulse 520ms ease;
}

body[data-moment-locked="true"] .metadata-panel {
  background:
    linear-gradient(180deg, rgba(255, 247, 225, 0.42), rgba(255, 255, 255, 0) 170px),
    var(--surface);
}

body[data-moment-locked="true"] .metadata-row[aria-disabled="true"] {
  cursor: not-allowed;
}

body[data-moment-locked="true"] .metadata-row[aria-disabled="true"]:hover,
body[data-moment-locked="true"] .metadata-row[aria-disabled="true"]:focus-visible {
  background: transparent;
}

body[data-moment-locked="true"] .metadata-row.in-range[aria-disabled="true"],
body[data-moment-locked="true"] .metadata-row.in-range[aria-disabled="true"]:hover,
body[data-moment-locked="true"] .metadata-row.in-range[aria-disabled="true"]:focus-visible {
  background: rgba(229, 244, 239, 0.72);
}

body[data-moment-locked="true"] .metadata-row.range-partial[aria-disabled="true"],
body[data-moment-locked="true"] .metadata-row.range-partial[aria-disabled="true"]:hover,
body[data-moment-locked="true"] .metadata-row.range-partial[aria-disabled="true"]:focus-visible {
  background: rgba(255, 247, 225, 0.84);
}

.metadata-range-list {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.metadata-range-item {
  position: relative;
  padding-left: 12px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.metadata-range-item::before {
  content: "";
  position: absolute;
  top: 0.58em;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--good);
}

.metadata-range-item.is-partial::before {
  background: var(--warn);
}

.metadata-list {
  display: grid;
  align-content: start;
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 6px 0 24px;
  scroll-behavior: smooth;
}

.metadata-row {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  height: max-content;
  min-height: 62px;
  padding: 10px 20px 10px 18px;
  border: 0;
  color: var(--text);
  background: transparent;
  overflow: visible;
  text-align: left;
  transition: background 120ms ease;
}

.metadata-row::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 0;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--party, var(--line));
  opacity: 0.92;
}

.metadata-row.party-lab { --party: var(--party-lab); }
.metadata-row.party-con { --party: var(--party-con); }
.metadata-row.party-lib { --party: var(--party-lib); }
.metadata-row.party-snp { --party: var(--party-snp); }
.metadata-row.party-ref { --party: var(--party-ref); }
.metadata-row.party-grn { --party: var(--party-grn); }
.metadata-row.party-pc { --party: var(--party-pc); }
.metadata-row.party-dup { --party: var(--party-dup); }
.metadata-row.party-sf { --party: var(--party-sf); }
.metadata-row.party-spk { --party: var(--party-spk); }

.metadata-row.is-agenda {
  min-height: auto;
  padding: 16px 20px 8px;
  cursor: default;
}

.metadata-row.is-agenda::before {
  display: none;
}

.metadata-row:hover,
.metadata-row:focus-visible,
.metadata-row.selected {
  background: var(--primary-soft);
}

.metadata-row.in-range {
  background: rgba(229, 244, 239, 0.72);
}

.metadata-row.in-range:hover,
.metadata-row.in-range:focus-visible,
.metadata-row.in-range.selected {
  background: rgba(218, 238, 232, 0.95);
}

.metadata-row.range-partial {
  background: rgba(255, 247, 225, 0.84);
}

.metadata-row.range-partial:hover,
.metadata-row.range-partial:focus-visible,
.metadata-row.range-partial.selected {
  background: rgba(255, 241, 202, 0.96);
}

.metadata-row.in-range::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 12px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--good);
}

.metadata-row.range-partial::after {
  background: var(--warn);
}

.metadata-row.selected {
  box-shadow: inset 0 0 0 1px rgba(0, 52, 97, 0.18);
}

.metadata-row:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.metadata-row-time {
  flex: 0 0 62px;
  margin-top: 2px;
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 16px;
}

.metadata-row-copy {
  display: grid;
  flex: 1;
  gap: 2px;
  min-width: 0;
}

.metadata-row-label {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.28;
}

.metadata-row.is-agenda .metadata-row-label {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.metadata-row-hint {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 15px;
  overflow-wrap: anywhere;
}

.metadata-row.is-agenda .metadata-row-hint,
.metadata-row.is-agenda .metadata-row-time {
  display: none;
}

.stage-shell {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: var(--bg);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.label,
.field span,
.segmented legend,
.mode-switch legend,
.rail-eyebrow {
  margin: 0 0 7px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  line-height: 14px;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--primary);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.12;
}

h2 {
  font-size: 20px;
  line-height: 1.22;
}

h3 {
  font-size: 16px;
  line-height: 1.25;
}

.meter {
  min-width: 150px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: right;
}

.meter span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.meter strong {
  display: block;
  margin-top: 3px;
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
}

.stage {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: #050b10;
  box-shadow: var(--shadow-2);
}

body.player-large .stage {
  max-height: 76vh;
}

#record-canvas,
#capture-preview,
.embed-frame,
.local-video-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#record-canvas,
#capture-preview,
.local-trim-video {
  display: block;
  object-fit: contain;
}

#capture-preview {
  opacity: 0;
  pointer-events: none;
}

.embed-frame {
  z-index: 2;
  display: none;
  border: 0;
  background: #071416;
}

.stage.embed-loaded .embed-frame {
  display: block;
}

.stage.has-trim-overlay .embed-frame {
  pointer-events: none;
}

.stage.embed-loaded #record-canvas {
  opacity: 0;
}

.local-video-stage {
  z-index: 3;
  display: none;
  background: #071416;
}

body[data-workflow-step="review"] .local-video-stage {
  display: block;
}

body[data-clip-format="audio"][data-workflow-step="review"] .local-video-stage {
  display: grid;
  place-items: center;
}

body[data-workflow-step="review"] #record-canvas,
body[data-workflow-step="review"] #capture-preview,
body[data-workflow-step="review"] .embed-frame,
body[data-workflow-step="review"] #stage-overlay-layer,
body[data-workflow-step="review"] #stage-empty,
body[data-workflow-step="review"] #embed-status {
  display: none !important;
}

.local-trim-video {
  width: 100%;
  height: 100%;
  border: 0;
  background: #071416;
  cursor: pointer;
}

.local-trim-audio {
  display: none;
  width: min(680px, calc(100% - 32px));
  margin: auto;
  align-self: center;
  justify-self: center;
}

body[data-clip-format="audio"][data-workflow-step="review"] .local-trim-audio {
  display: block;
}

body[data-clip-format="audio"] .local-trim-video,
body[data-clip-format="audio"] #local-overlay-layer {
  display: none;
}

.stage-overlay-layer {
  position: absolute;
  inset: 0;
  z-index: 9;
  overflow: hidden;
  pointer-events: none;
}

body[data-workflow-step="review"] #stage-overlay-layer {
  display: none !important;
}

.local-overlay-layer {
  z-index: 9;
}

.stage-empty {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-content: center;
  gap: 10px;
  padding: 32px;
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
  background:
    radial-gradient(70% 60% at 50% 35%, #1e3a5f 0%, transparent 60%),
    linear-gradient(180deg, #0a1c30 0%, #050b10 80%);
}

.stage-empty .eyebrow {
  color: rgba(255, 255, 255, 0.5);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.stage-empty strong {
  color: rgba(255, 255, 255, 0.94);
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
}

.stage-empty span:last-child {
  max-width: 480px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 14px;
  line-height: 1.55;
}

/* The empty-state caveat ("Cite the Record never receives the video file") must
   never be clipped by the stage's overflow:hidden when the stage is short — at
   tablet/narrow-desktop widths (and under browser zoom) the default 30px
   heading + 32px padding can crowd it out. Trim the footprint so it fits. */
@media (max-width: 1024px) {
  .stage-empty {
    padding: 18px 20px;
    gap: 6px;
  }
  .stage-empty strong {
    font-size: 22px;
  }
  .stage-empty span:last-child {
    font-size: 12.5px;
  }
}

.stage.has-source .stage-empty,
.stage.embed-loaded .stage-empty {
  display: none;
}

.embed-status {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 6;
  max-width: min(360px, calc(100% - 32px));
  padding: 10px 12px;
  border: 1px solid rgba(0, 52, 97, 0.2);
  border-radius: var(--radius);
  color: var(--primary);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-2);
}

.embed-status strong,
.embed-status span {
  display: block;
}

.embed-status strong {
  font-size: 13px;
  line-height: 18px;
}

.embed-status span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

.stage-trim-overlay {
  position: absolute;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 11;
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(5, 11, 16, 0.38), rgba(5, 11, 16, 0.9));
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
  pointer-events: none;
}

.stage-trim-overlay > * {
  pointer-events: auto;
}

.stage-trim-meta {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  color: rgba(255, 255, 255, 0.82);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}

.stage-trim-meta output {
  min-width: 74px;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.stage-trim-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: rgba(255, 255, 255, 0.84);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  flex-wrap: wrap;
}

.stage-trim-controls span {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  min-height: 28px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}

.stage-trim-controls output {
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.stage-play-button {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 999px;
  color: var(--primary);
  background: #ffffff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.stage-play-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.stage-trim-lock-note {
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius);
  color: #ffffff;
  background: rgba(109, 67, 0, 0.82);
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
}

.trim-track {
  position: relative;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.22) 1px, transparent 1px) 0 0 / 8.333% 100%,
    rgba(255, 255, 255, 0.28);
}

.trim-selection {
  position: absolute;
  top: 7px;
  bottom: 7px;
  border-radius: 999px;
  background: rgba(0, 52, 97, 0.42);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.58);
}

.trim-track.is-empty {
  opacity: 0.62;
}

.trim-track.is-empty::after {
  content: "Set start and finish to unlock";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.72);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  pointer-events: none;
}

.local-trim-track.is-empty::after {
  content: "Load a recording or select a video";
}

.trim-track.is-tight-selection .trim-selection {
  min-width: 22px;
}

.trim-handle {
  position: absolute;
  top: 50%;
  width: 28px;
  height: 28px;
  padding: 0;
  transform: translate(-50%, -50%);
  border: 2px solid var(--primary);
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
  cursor: ew-resize;
}

.trim-handle::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 7px;
  right: 7px;
  height: 3px;
  border-radius: 999px;
  background: var(--primary);
  transform: translateY(-50%);
}

.trim-handle.end {
  border-color: var(--record);
}

.trim-handle.end::before {
  background: var(--record);
}

body[data-moment-locked="true"] #trim-track,
body[data-moment-locked="true"] #stage-trim-track {
  cursor: not-allowed;
  opacity: 0.76;
}

body[data-moment-locked="true"] #trim-track .trim-handle,
body[data-moment-locked="true"] #stage-trim-track .trim-handle {
  cursor: not-allowed;
  filter: saturate(0.55);
}

.trim-track.is-tight-selection .trim-handle.start {
  transform: translate(calc(-50% - 9px), -50%);
}

.trim-track.is-tight-selection .trim-handle.end {
  transform: translate(calc(-50% + 9px), -50%);
}

.source-trim-view,
.local-trim-view {
  display: grid;
}

.stage-trim-controls.source-trim-view,
.stage-trim-controls.local-trim-view {
  display: flex;
}

body[data-workflow-step="review"] .source-trim-view {
  display: none;
}

body:not([data-workflow-step="review"]) .local-trim-view {
  display: none;
}

.recording-badge {
  display: none;
}

.stage-reassurance {
  position: absolute;
  right: 14%;
  bottom: 12%;
  left: 14%;
  z-index: 12;
  display: none;
  width: auto;
  padding: 16px 20px 14px;
  border: 0;
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(247, 249, 251, 0.96);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.32),
    inset 0 0 0 1px rgba(0, 52, 97, 0.08);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.5;
  pointer-events: none;
  transform: none;
}

.stage-reassurance .lead {
  display: block;
  margin-bottom: 4px;
  color: var(--primary);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
}

.stage-reassurance .meta {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.stage-reassurance .meta strong {
  margin-right: 4px;
  color: var(--primary);
}

.stage-reassurance .meta .meta-dot {
  margin: 0 6px;
  color: var(--muted-soft);
}

.stage-reassurance strong {
  color: var(--primary);
}

.stage-stop-cluster {
  position: absolute;
  top: 18px;
  right: 18px;
  bottom: auto;
  z-index: 16;
  display: none;
  align-items: flex-start;
  gap: 10px;
}

.elapsed-big {
  padding: 8px 10px;
  border-radius: var(--radius);
  color: #ffffff;
  background: rgba(7, 14, 22, 0.78);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
}

.btn-stop {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--radius);
  color: #ffffff;
  background: var(--record);
  font-size: 14px;
  font-weight: 700;
  box-shadow: var(--shadow-2);
}

.btn-stop:hover {
  background: var(--record-deep);
}

.btn-stop .square {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: currentColor;
}

body[data-state="recording"] .readiness-menu {
  display: none;
}

body[data-state="recording"] .rec-chip {
  display: inline-flex;
}

body[data-state="recording"] .stage {
  box-shadow: inset 0 0 0 2px rgba(180, 35, 47, 0.62), var(--shadow-2);
}

body[data-state="recording"] .stage-reassurance {
  display: block;
}

body[data-state="recording"] .stage-stop-cluster {
  display: inline-flex;
}

body[data-state="recording"] .stage-stop-cluster .record-mark-panel {
  display: none;
}

body[data-capture-clean="true"] .stage,
body[data-capture-clean="true"] .stage * {
  cursor: none !important;
}

body[data-capture-clean="true"] .stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 20;
  background: transparent;
  cursor: none !important;
  pointer-events: auto;
}

body[data-capture-clean="true"] .stage-stop-cluster,
body[data-capture-clean="true"] .stage-stop-cluster * {
  cursor: auto !important;
}

body[data-capture-clean="true"] .stage-stop-cluster .btn-stop {
  cursor: pointer !important;
}

body[data-capture-clean="true"] #stage-overlay-layer,
body[data-capture-clean="true"] #embed-status,
body[data-capture-clean="true"] .stage-reassurance,
body[data-capture-clean="true"] .stage-trim-overlay,
body[data-capture-clean="true"] .recording-badge {
  display: none !important;
  pointer-events: none !important;
}

body[data-capture-clean="true"] .stage-stop-cluster {
  position: fixed;
  top: var(--clean-stop-top, 72px);
  right: auto;
  bottom: auto;
  left: var(--clean-stop-left, 16px);
  z-index: 120;
  filter: none;
}

body[data-capture-clean="true"][data-clean-stop="hidden"] .stage-stop-cluster {
  display: inline-flex !important;
}

body[data-state="recording"] .metadata-panel,
body[data-state="recording"] .rail-body,
body[data-state="recording"] .rail-step-bar,
body[data-state="recording"] .stage-quick,
body[data-state="recording"] .timeline {
  opacity: 0.32;
  pointer-events: none;
  filter: saturate(0.7);
}

body[data-state="recording"] .overlay-popover,
body[data-state="recording"] #stage-overlay-layer,
body[data-state="recording"] .stage-trim-overlay {
  display: none !important;
}

.timeline {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
}

.timeline-track {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-muted);
}

#progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width 160ms ease;
}

.timeline-meta,
.local-trim-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 14px;
  margin-top: 8px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
}

.trim-editor {
  display: none !important;
}

.stage-quick {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 14px;
  padding: 10px 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
}

body[data-workflow-step="review"] .stage-quick {
  display: none;
}

.stage-quick-left,
.stage-quick-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.stage-quick-left {
  display: inline-flex;
}

.rail {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--surface);
}

.rail-step-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-bottom: 1px solid var(--line);
}

body[data-clip-format="audio"] .rail-step-bar {
  grid-template-columns: repeat(4, 1fr);
}

body[data-clip-format="audio"] [data-step="caption"],
body[data-clip-format="audio"] .caption-panel {
  display: none;
}

body[data-clip-format="audio"] #quality-fieldset {
  display: none;
}

.rail-step {
  position: relative;
  padding: 14px 6px 16px;
  border-right: 1px solid var(--line-soft);
  border-top: 0;
  border-bottom: 0;
  border-left: 0;
  text-align: center;
  background: transparent;
  font: inherit;
  cursor: pointer;
  min-width: 0;
}

.rail-step:last-child {
  border-right: 0;
}

.rail-step:disabled {
  cursor: not-allowed;
  opacity: 0.54;
}

.rail-step .num,
.rail-step .name {
  display: block;
}

.rail-step .num {
  margin-bottom: 3px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.rail-step .name {
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.15;
}

body[data-workflow-step="load"] [data-step="load"],
body[data-workflow-step="moment"] [data-step="moment"],
body[data-workflow-step="caption"] [data-step="caption"],
body[data-workflow-step="record"] [data-step="record"],
body[data-workflow-step="review"] [data-step="review"] {
  background: var(--primary-soft);
}

body[data-workflow-step="load"] [data-step="load"] .num,
body[data-workflow-step="load"] [data-step="load"] .name,
body[data-workflow-step="moment"] [data-step="moment"] .num,
body[data-workflow-step="moment"] [data-step="moment"] .name,
body[data-workflow-step="caption"] [data-step="caption"] .num,
body[data-workflow-step="caption"] [data-step="caption"] .name,
body[data-workflow-step="record"] [data-step="record"] .num,
body[data-workflow-step="record"] [data-step="record"] .name,
body[data-workflow-step="review"] [data-step="review"] .num,
body[data-workflow-step="review"] [data-step="review"] .name {
  color: var(--primary);
}

body[data-workflow-step="load"] [data-step="load"]::after,
body[data-workflow-step="moment"] [data-step="moment"]::after,
body[data-workflow-step="caption"] [data-step="caption"]::after,
body[data-workflow-step="record"] [data-step="record"]::after,
body[data-workflow-step="review"] [data-step="review"]::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: -1px;
  height: 3px;
  border-radius: 2px;
  background: var(--primary);
}

body[data-workflow-step="moment"] [data-step="load"] .num::before,
body[data-workflow-step="caption"] [data-step="load"] .num::before,
body[data-workflow-step="caption"] [data-step="moment"] .num::before,
body[data-workflow-step="record"] [data-step="load"] .num::before,
body[data-workflow-step="record"] [data-step="moment"] .num::before,
body[data-workflow-step="record"] [data-step="caption"] .num::before,
body[data-workflow-step="review"] [data-step="load"] .num::before,
body[data-workflow-step="review"] [data-step="moment"] .num::before,
body[data-workflow-step="review"] [data-step="caption"] .num::before,
body[data-workflow-step="review"] [data-step="record"] .num::before {
  content: "\2713\00a0";
  color: var(--good);
}

.rail-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 22px;
}

.rail-panel {
  display: none;
  gap: 12px;
}

body[data-workflow-step="load"] .source-panel,
body[data-workflow-step="moment"] .trim-panel,
body[data-workflow-step="caption"] .caption-panel,
body[data-workflow-step="record"] .record-panel,
body[data-workflow-step="review"] .save-panel {
  display: grid;
}

.rail-title {
  font-size: 19px;
}

.rail-panel-nav {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
}

.rail-panel p,
.version-panel p,
.field-helper {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.field-helper {
  font-size: 12px;
}

.field {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.format-fieldset {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
}

.format-fieldset legend {
  margin: 0 0 6px;
  padding: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.format-option {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}

.format-option:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.format-option input[type="radio"] {
  margin: 4px 0 0;
}

.format-option .format-label {
  display: grid;
  gap: 2px;
}

.format-option strong {
  color: var(--primary);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
}

.format-option small {
  color: var(--text);
  font-size: 12px;
  line-height: 1.4;
}

input[type="url"],
input[type="text"],
input[type="number"],
input[type="search"],
select,
textarea {
  min-width: 0;
  width: 100%;
  min-height: 42px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--surface);
  font-size: 14px;
  line-height: 20px;
}

textarea {
  min-height: 78px;
  resize: vertical;
}

select {
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) calc(100% - 17px) 50% / 6px 6px no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) calc(100% - 12px) 50% / 6px 6px no-repeat,
    var(--surface);
}

input[type="color"] {
  width: 100%;
  min-height: 38px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}

.visually-hidden,
.visually-hidden-file {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
  white-space: nowrap;
}

.button-row,
.time-grid,
.local-trim-actions,
.local-nudge-actions,
.overlay-tool-grid,
.color-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.time-grid.compact {
  grid-template-columns: 1fr;
}

.local-trim-actions,
.local-nudge-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.btn,
.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  text-decoration: none;
}

.btn-primary,
.download-link {
  color: #ffffff;
  background: var(--primary);
  box-shadow: var(--shadow-1);
}

.btn-primary:hover,
.download-link:hover {
  background: var(--primary-deep);
}

.btn-record {
  color: #ffffff;
  background: var(--record);
  box-shadow: var(--shadow-1);
}

.btn-record:hover {
  background: var(--record-deep);
}

.btn-record::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: currentColor;
}

.btn-secondary {
  border-color: var(--line);
  color: var(--primary);
  background: var(--surface);
}

.btn-secondary:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 4px 0;
  border: 0;
  color: var(--primary);
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.btn-link:hover {
  text-decoration: underline;
}

.btn-tertiary {
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius);
  color: var(--muted);
  background: transparent;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.btn-tertiary:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.btn-full {
  width: 100%;
}

.caption-actions {
  display: grid;
  gap: 8px;
}

.mode-switch,
.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.segmented {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
}

.mode-switch legend,
.segmented legend {
  grid-column: 1 / -1;
}

.mode-switch label,
.segmented label {
  position: relative;
  min-width: 0;
}

.mode-switch input,
.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-switch span {
  display: grid;
  gap: 3px;
  min-height: 70px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--surface);
}

.mode-switch strong {
  color: var(--primary);
  font-size: 13px;
  line-height: 17px;
}

.mode-switch small {
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
}

.mode-switch input:checked + span {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px rgba(0, 52, 97, 0.16);
}

.segmented span {
  display: grid;
  min-height: 42px;
  place-items: center;
  padding: 8px 6px;
  border: 1px solid var(--line);
  border-right: 0;
  color: var(--muted);
  background: var(--surface);
  font-size: 12px;
  font-weight: 700;
  line-height: 15px;
  text-align: center;
}

.segmented label:first-of-type span {
  border-radius: var(--radius) 0 0 var(--radius);
}

.segmented label:last-of-type span {
  border-right: 1px solid var(--line);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.segmented input:checked + span {
  z-index: 1;
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.version-panel {
  display: grid;
  gap: 8px;
}

.clip-plan-card,
.trim-workflow-status,
.source-timing-status,
.mark-status,
.status-line {
  margin: 0;
  padding: 10px 11px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--surface-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 17px;
}

.clip-plan-card {
  display: grid;
  gap: 3px;
}

.clip-plan-card strong {
  color: var(--primary);
  font-size: 13px;
  line-height: 18px;
}

.clip-plan-card.good,
.trim-workflow-status.good,
.source-timing-status.good,
.mark-status.good,
.status-line.good {
  color: #124c31;
  border-color: rgba(22, 101, 52, 0.22);
  background: var(--good-soft);
}

.clip-plan-card.warn,
.trim-workflow-status.warn,
.source-timing-status.warn,
.mark-status.warn,
.status-line.warn {
  color: #6d4300;
  border-color: rgba(138, 90, 19, 0.25);
  background: var(--warn-soft);
}

.record-mark-panel,
.advanced-settings,
.rail-log-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
}

.advanced-settings {
  margin-top: 18px;
  background: var(--surface-muted);
}

.advanced-settings summary,
.log-details summary {
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  line-height: 18px;
}

.advanced-settings[open] summary {
  margin-bottom: 8px;
}

.step1-compat-body {
  display: grid;
  gap: 10px;
}

.step1-compat-body p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
}

.step1-compat-body strong {
  color: var(--primary);
}

.record-fallback-row {
  margin-top: 6px;
}

.info-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  color: var(--primary);
  background: transparent;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.info-icon-btn:hover {
  text-decoration: underline;
}

.info-icon-btn .info-label {
  font-weight: 500;
}

.manual-tab-info-panel {
  margin-top: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.manual-tab-info-panel h3 {
  margin: 0 0 8px;
  color: var(--primary);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
}

.manual-tab-info-panel p {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
}

.manual-tab-options {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.manual-tab-options li {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
}

.manual-tab-options strong {
  color: var(--primary);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
}

.manual-tab-options .desc {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.switch-row {
  display: grid;
  gap: 8px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.switch-row label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
}

.switch-row input {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
}

.result-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.result-panel strong {
  display: block;
  color: var(--primary);
  font-size: 14px;
  line-height: 20px;
  word-break: break-word;
}

.review-pre-save {
  display: grid;
  gap: 10px;
}

.summary-card {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--good);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--good-soft);
}

.summary-card .label {
  color: var(--good);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.summary-card .range {
  color: var(--primary-deep);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  word-break: break-word;
}

.summary-card .hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.share-guidance-card {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid rgba(138, 90, 19, 0.34);
  border-radius: var(--radius);
  background: var(--warn-soft);
  color: var(--text);
}

.share-guidance-card .label,
.attribution-copy-field span {
  color: var(--warn);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 14px;
  text-transform: uppercase;
}

.share-guidance-card p {
  margin: 0;
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.48;
}

.share-guidance-card a {
  color: var(--primary);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.4;
}

.attribution-copy-field {
  display: grid;
  gap: 6px;
  margin-top: 2px;
}

.attribution-copy-field textarea {
  min-height: 96px;
  width: 100%;
  resize: vertical;
  padding: 10px 11px;
  border: 1px solid rgba(138, 90, 19, 0.3);
  border-radius: var(--radius-sm);
  color: var(--primary-deep);
  background: rgba(255, 255, 255, 0.78);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.45;
}

.copy-status {
  min-height: 16px;
  color: var(--warn);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

.save-progress {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--primary-soft);
}

.save-progress .lbl {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.save-progress .lbl strong {
  font-variant-numeric: tabular-nums;
}

.save-progress .track {
  position: relative;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 52, 97, 0.12);
}

.save-progress .fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0%;
  border-radius: 999px;
  background: var(--primary);
  transition: width 200ms ease-out;
}

.save-progress .desc {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.save-confirmation {
  display: grid;
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid var(--good);
  border-radius: var(--radius-lg);
  background: var(--good-soft);
  box-shadow: var(--shadow-1);
}

.save-confirmation .save-head {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  align-items: center;
}

.save-confirmation .save-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: var(--good);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
}

.save-confirmation .lead {
  color: var(--primary-deep);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0;
}

.save-card,
.save-where,
.save-breadcrumb {
  display: grid;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
}

.save-card {
  gap: 6px;
  padding: 14px 16px;
}

.save-card .file-eyebrow,
.save-where .lbl,
.save-breadcrumb .lbl-row {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.save-card .filename {
  color: var(--primary-deep);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  word-break: break-word;
}

.save-card .file-meta {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.save-where {
  gap: 4px;
  padding: 12px 14px;
}

.save-where .val {
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}

.save-where .val.val-aside {
  color: var(--muted);
  font-size: 12px;
}

.save-where .val strong {
  color: var(--primary);
}

.save-breadcrumb {
  gap: 8px;
  padding: 14px 16px;
}

.save-breadcrumb .lbl-row {
  margin-bottom: 4px;
}

.save-breadcrumb .row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  font-size: 12.5px;
}

.save-breadcrumb .row .lbl {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.save-breadcrumb .row .val {
  color: var(--text);
}

.save-breadcrumb .row.emphasis .val {
  color: var(--good-deep, var(--good));
  font-weight: 700;
}

.save-verify summary {
  padding: 6px 0;
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  list-style: none;
  text-transform: uppercase;
  cursor: pointer;
}

.save-verify summary::-webkit-details-marker {
  display: none;
}

.save-verify summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 8px;
  color: var(--muted-soft);
}

.save-verify[open] summary::before {
  content: "▾";
}

.save-verify .verify-body {
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: var(--radius);
  color: var(--text);
  background: var(--surface-muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.save-verify .verify-body code {
  padding: 1px 6px;
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.save-verify .verify-body em {
  color: var(--primary);
  font-style: italic;
  font-weight: 600;
}

.save-confirmation .save-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}

.save-confirmation.is-acknowledged .save-verify,
.save-confirmation.is-acknowledged .save-breadcrumb,
.save-confirmation.is-acknowledged .save-where {
  opacity: 0.55;
  transition: opacity 240ms ease-out;
}

.save-closing {
  margin: 0;
  color: var(--good-deep, var(--good));
  font-size: 13px;
  line-height: 1.5;
}

body[data-review-state="saved"] .stage-trim-overlay,
body[data-review-state="saved"] .local-trim-meta {
  display: none;
}

.download-link {
  min-height: 38px;
  white-space: nowrap;
}

.rail-log-panel {
  margin-top: 18px;
}

.activity-log {
  display: grid;
  gap: 8px;
  max-height: 150px;
  margin: 8px 0 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.activity-log li {
  padding: 9px 10px;
  border-left: 3px solid var(--line-strong);
  color: var(--muted);
  background: var(--surface-muted);
  font-size: 12px;
  line-height: 17px;
}

.activity-log li.warn {
  border-left-color: var(--warn);
  color: #6d4300;
  background: var(--warn-soft);
}

.activity-log li.good {
  border-left-color: var(--good);
  color: #124c31;
  background: var(--good-soft);
}

.contract-hidden {
  display: none !important;
}

.stage-stop-cluster .record-mark-panel {
  width: auto;
  padding: 4px 0;
  border: 0;
  color: rgba(255, 255, 255, 0.84);
  background: transparent;
  box-shadow: none;
}

.stage-stop-cluster .record-mark-panel button {
  height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
}

.stage-stop-cluster .record-mark-panel button:hover {
  background: rgba(255, 255, 255, 0.18);
}

.stage-stop-cluster .record-mark-panel .mark-status,
.stage-stop-cluster .record-mark-panel .mark-status.good,
.stage-stop-cluster .record-mark-panel .mark-status.warn {
  margin: 0;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.94);
  background: rgba(15, 24, 32, 0.72);
  font-size: 11.5px;
  line-height: 1.45;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45);
}

.overlay-popover {
  position: fixed;
  z-index: 80;
  width: min(380px, calc(100vw - 20px));
  max-height: calc(100vh - 20px);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: var(--text);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-pop);
}

.overlay-popover[hidden] {
  display: none;
}

.composer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 8px;
}

.composer-head strong {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.overlay-popover-delete {
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid rgba(180, 35, 47, 0.3);
  border-radius: var(--radius);
  color: var(--record-deep);
  background: var(--record-soft);
  font-size: 12px;
  font-weight: 700;
}

.composer-body,
.composer-tab-body {
  display: grid;
  gap: 12px;
  padding: 10px 16px 14px;
}

.composer-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-muted);
}

.composer-tabs button {
  min-height: 38px;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  background: transparent;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.composer-tabs button[aria-selected="true"] {
  color: var(--primary);
  background: var(--surface);
  border-bottom-color: var(--primary);
}

.popover-field {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.popover-field.wide {
  grid-column: 1 / -1;
}

.popover-field span,
.range-field span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.range-field {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.range-field span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.range-field output {
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  text-transform: none;
}

.range-field.compact {
  gap: 6px;
  padding: 8px 9px;
}

.overlay-popover-grid,
.overlay-popover-sliders {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.preset-row,
.format-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.format-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.preset-button,
.format-button {
  min-height: 34px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--primary);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  line-height: 14px;
  text-transform: uppercase;
}

.preset-button:hover,
.format-button:hover,
.format-button[aria-pressed="true"] {
  border-color: var(--primary);
  color: #ffffff;
  background: var(--primary);
}

.video-overlay-item {
  position: absolute;
  display: block;
  box-sizing: border-box;
  min-width: 72px;
  min-height: 34px;
  padding: var(--overlay-pad, 10px);
  border: 1px solid transparent;
  border-radius: var(--overlay-radius, 8px);
  color: var(--overlay-color, #ffffff);
  background: var(--overlay-bg, rgba(5, 8, 9, 0.7));
  box-shadow: var(--overlay-shadow, 0 8px 24px rgba(0, 0, 0, 0.32));
  font-family: var(--overlay-font, "Inter", sans-serif);
  font-size: var(--overlay-size, 28px);
  font-style: var(--overlay-style, normal);
  font-weight: var(--overlay-weight, 800);
  line-height: var(--overlay-line, 1.14);
  overflow-wrap: anywhere;
  paint-order: stroke fill;
  text-align: var(--overlay-align, left);
  text-shadow: var(--overlay-text-shadow, 0 1px 2px rgba(0, 0, 0, 0.55));
  -webkit-text-stroke: var(--overlay-stroke-width, 0px) var(--overlay-stroke-color, transparent);
  white-space: pre-wrap;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  cursor: move;
}

.video-overlay-text,
.overlay-text-content {
  display: block;
  min-width: 0;
}

.video-overlay-text {
  pointer-events: none;
}

.video-overlay-item::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px dashed transparent;
  border-radius: var(--overlay-radius, 8px);
  pointer-events: none;
}

.video-overlay-item.is-selected::before {
  border-color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 2px rgba(0, 52, 97, 0.72);
}

.overlay-delete-button {
  position: absolute;
  top: 6px;
  left: 6px;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 50%;
  color: #ffffff;
  background: rgba(180, 35, 47, 0.94);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.26);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  pointer-events: auto;
}

.overlay-resize-handle {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 4px;
  background:
    linear-gradient(135deg, transparent 0 42%, rgba(255, 255, 255, 0.92) 42% 49%, transparent 49% 100%),
    rgba(0, 52, 97, 0.86);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.24);
  cursor: nwse-resize;
  pointer-events: auto;
}

.local-trim-placeholder {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: none;
  place-items: center;
  padding: 20px;
  color: #d8e8eb;
  background: rgba(7, 20, 22, 0.82);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  pointer-events: none;
}

.local-trimmer.is-locked .local-trim-placeholder {
  display: grid;
}

.local-trimmer.is-ready {
  border-color: rgba(0, 52, 97, 0.42);
  box-shadow: 0 0 0 3px rgba(0, 52, 97, 0.12);
}

.product-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 28px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
}

.privacy,
.privacy-explainer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.privacy::before {
  color: var(--good);
}

.privacy-explainer {
  padding: 5px 11px;
  border: 1px solid rgba(22, 101, 52, 0.28);
  border-radius: 999px;
  color: var(--good);
  background: var(--good-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.intro-modal-dialog {
  width: 100%;
  max-width: min(580px, 100vw);
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
}

.intro-modal-dialog::backdrop {
  background: rgba(15, 25, 40, 0.62);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.intro-modal-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
}

.intro-modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 28px 6px;
}

.intro-modal-head .brand-mark {
  width: 28px;
  height: 28px;
  font-size: 12px;
}

.intro-modal-eyebrow {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.intro-modal-body {
  padding: 4px 28px 0;
}

.intro-modal-body h2 {
  margin: 4px 0 12px;
  color: var(--primary);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0;
}

.intro-modal-lede {
  margin: 0 0 18px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
}

.intro-steps {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.intro-steps li {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 14px;
  align-items: start;
}

.intro-steps .step-num {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  color: var(--primary);
  background: var(--primary-soft);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
}

.intro-steps strong {
  display: block;
  margin-bottom: 2px;
  color: var(--primary);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}

.intro-steps .desc {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.intro-trust {
  margin: 18px 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--good);
  border-radius: var(--radius);
  color: var(--good-deep, var(--good));
  background: var(--good-soft);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.55;
}

.intro-verify {
  margin-top: 6px;
}

.intro-verify summary {
  padding: 6px 0;
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  list-style: none;
  text-transform: uppercase;
  cursor: pointer;
}

.intro-verify summary::-webkit-details-marker {
  display: none;
}

.intro-verify summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 8px;
  color: var(--muted-soft);
}

.intro-verify[open] summary::before {
  content: "▾";
}

.intro-verify-body {
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: var(--radius);
  color: var(--text);
  background: var(--surface-muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.intro-verify-body code {
  padding: 1px 6px;
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.intro-verify-body em {
  color: var(--primary);
  font-style: italic;
  font-weight: 600;
}

.intro-modal-foot {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 18px 28px 24px;
  border-top: 1px solid var(--line-soft);
}

.compat-banner {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px 24px;
  background: var(--bg);
}

.compat-banner-inner {
  display: grid;
  width: 100%;
  max-width: 720px;
  gap: 24px;
}

.compat-banner-head {
  display: flex;
  align-items: center;
}

.compat-banner h1 {
  margin: 0;
  color: var(--primary);
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0;
}

.compat-banner-lede {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
}

.compat-banner-subhead {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.compat-banner-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.compat-card {
  display: grid;
  gap: 12px;
  padding: 22px 22px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}

.compat-card-eyebrow {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.compat-card h2 {
  margin: 0;
  color: var(--primary);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}

.compat-card p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
}

.compat-verify summary {
  padding: 6px 0;
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  list-style: none;
  text-transform: uppercase;
  cursor: pointer;
}

.compat-verify summary::-webkit-details-marker {
  display: none;
}

.compat-verify summary::before {
  content: "▸";
  margin-right: 8px;
  color: var(--muted-soft);
}

.compat-verify[open] summary::before {
  content: "▾";
}

.compat-verify-body {
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: var(--radius);
  color: var(--text);
  background: var(--surface-muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.compat-verify-body ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
}

.compat-verify-body strong {
  color: var(--primary);
}

.compat-banner-foot {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.compat-banner-foot a {
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.privacy-dialog {
  width: min(520px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: transparent;
}

.privacy-dialog::backdrop {
  background: rgba(5, 11, 16, 0.42);
}

.privacy-dialog-card {
  display: grid;
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
}

.privacy-dialog-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 1120px) {
  .workspace,
  body.player-large .workspace {
    grid-template-columns: minmax(0, 1fr) 330px;
  }

  .metadata-panel {
    display: none;
  }
}

@media (max-width: 720px) {
  .compat-banner-cards {
    grid-template-columns: 1fr;
  }

  .app-bar {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 16px;
  }

  .workspace,
  body[data-state="idle"] .workspace,
  body.player-large .workspace {
    grid-template-columns: 1fr;
    width: calc(100% - 24px);
    height: auto;
    max-height: none;
    margin: 12px auto;
  }

  .stage-shell {
    order: 1;
    padding: 16px;
    border-right: 0;
  }

  .metadata-panel {
    order: 3;
    display: flex;
    max-height: 430px;
    border-top: 1px solid var(--line);
    border-right: 0;
  }

  body[data-state="idle"] #metadata-panel {
    display: none;
  }

  .section-head,
  .result-panel,
  .product-foot {
    align-items: stretch;
    flex-direction: column;
  }

  h1 {
    font-size: 22px;
  }

  .stage-empty {
    gap: 8px;
    padding: 18px;
  }

  .stage-empty strong {
    font-size: 24px;
    line-height: 1.05;
  }

  .stage-empty span:last-child {
    font-size: 12px;
    line-height: 1.35;
  }

  body[data-state="recording"] .stage {
    aspect-ratio: auto;
    min-height: 320px;
  }

  .stage-reassurance {
    right: 14px;
    bottom: 72px;
    left: 14px;
    width: calc(100% - 28px);
    max-height: calc(100% - 96px);
    padding: 13px 14px;
    overflow: auto;
    font-size: 13px;
    line-height: 1.38;
  }

  .stage-reassurance .lead {
    font-size: 20px;
  }

  .stage-reassurance .meta {
    font-size: 10.5px;
    line-height: 1.35;
  }

  .rail-step-bar .name {
    font-size: 11px;
  }

  .meter {
    text-align: left;
  }

  .rail {
    order: 2;
    border-top: 1px solid var(--line);
  }

  .rail-body {
    padding: 16px;
  }

  .button-row,
  .time-grid,
  .time-grid.compact,
  .mode-switch,
  .segmented,
  .local-trim-actions,
  .local-nudge-actions,
  .overlay-popover-grid,
  .overlay-popover-sliders,
  .preset-row {
    grid-template-columns: 1fr;
  }

  .stage-quick,
  .stage-quick-left,
  .stage-quick-right {
    align-items: stretch;
    flex-direction: column;
  }

  .stage-stop-cluster {
    top: 14px;
    left: 14px;
    right: 14px;
    bottom: auto;
    justify-content: space-between;
  }

  .stage-trim-overlay {
    right: 8px;
    bottom: 8px;
    left: 8px;
    gap: 6px;
    padding: 10px;
  }

  .stage-trim-meta {
    grid-template-columns: 1fr auto auto;
    gap: 6px;
    font-size: 10px;
  }

  .stage-trim-meta output {
    min-width: 56px;
  }

  .stage-trim-controls {
    gap: 5px;
    font-size: 10px;
    flex-wrap: wrap;
  }

  .stage-trim-controls span,
  .stage-play-button {
    min-height: 26px;
  }

  .stage-trim-controls span {
    padding: 5px 7px;
  }

  #embed-status {
    position: static;
    max-width: none;
    margin: 8px;
  }

  .trim-track {
    height: 34px;
  }

  .overlay-popover {
    left: 10px !important;
    right: 10px;
    width: auto;
    max-height: min(420px, calc(100vh - 20px));
  }

  .overlay-popover-grid,
  .overlay-popover-sliders,
  .format-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .rail-step-bar .name {
    display: none;
  }

  .save-confirmation .save-actions {
    grid-template-columns: 1fr;
  }
}

/* === Clean-capture bottom-toast reassurance ============================ */

.clean-capture-toast {
  display: none;
}

/* Show only when clean-capture is active AND we are recording. The toast
   lives OUTSIDE .stage so it does not enter the cropped recording. */
body[data-capture-clean="true"][data-state="recording"] .clean-capture-toast {
  display: block;
}

body[data-clip-format="audio"][data-state="recording"] .clean-capture-toast {
  display: block;
}

.clean-capture-toast {
  margin: 12px 0 0;
  pointer-events: none;
}

.cct-card {
  display: grid;
  gap: 10px;
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 16px 20px 14px;
  border: 1px solid rgba(0, 52, 97, 0.18);
  border-radius: var(--radius-lg);
  color: var(--text);
  background: rgba(247, 249, 251, 0.98);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.32),
              0 4px 14px rgba(0, 0, 0, 0.18);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.5;
}

.cct-head {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: start;
}

.cct-icon {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--record-soft);
}

.cct-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--record);
  animation: cct-pulse 1.2s ease-in-out infinite;
}

@keyframes cct-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(0.85); }
}

/* Mouse-pause explainer — the most load-bearing message during a clean
   one-page capture, where the pointer is locked and the cursor disappears.
   Shown ONLY for the locked video path (data-capture-clean); never for audio
   (which is not pointer-locked) — so it stays display:none in that case. */
.cct-mouse {
  display: none;
}

body[data-capture-clean="true"][data-state="recording"] .clean-capture-toast .cct-mouse {
  display: block;
  margin: 0;
  padding: 10px 13px;
  border-radius: var(--radius-md, 10px);
  background: var(--record-soft);
  border: 1px solid var(--record);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.5;
}

.cct-mouse strong {
  color: var(--record);
}

.cct-mouse kbd {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.92em;
  padding: 1px 6px;
  border: 1px solid rgba(0, 52, 97, 0.4);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: #fff;
  white-space: nowrap;
}

/* Just-in-time "what happens when you press Record" card (Step 4). Sets the
   real-time-wait expectation and pre-empts the browser's "Share this tab"
   dialog + the pointer-lock mouse pause, right at the moment of decision. */
.record-preflight {
  list-style: none;
  margin: 0 0 14px;
  padding: 12px 14px;
  display: grid;
  gap: 9px;
  border: 1px solid rgba(0, 52, 97, 0.16);
  border-radius: var(--radius-md, 10px);
  background: rgba(247, 249, 251, 0.9);
  font-size: 13px;
  line-height: 1.5;
}

.record-preflight li {
  position: relative;
  padding-left: 18px;
}

.record-preflight li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary, #003461);
}

.record-preflight strong {
  display: block;
}

/* The mouse pause only applies to the pointer-locked one-page VIDEO path.
   Audio capture is not pointer-locked, so hide that point for audio clips. */
body[data-clip-format="audio"] .record-preflight-mouse {
  display: none;
}

.cct-titles {
  display: grid;
  gap: 3px;
}

.cct-title {
  display: block;
  color: var(--primary);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
}

.cct-sub {
  display: block;
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.45;
}

.cct-meter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.cct-meter strong {
  color: var(--primary);
}

.cct-dot-sep {
  color: var(--muted-soft);
}

.cct-saved {
  color: var(--good);
}

.cct-progress-track {
  height: 6px;
  border-radius: 3px;
  background: rgba(0, 52, 97, 0.10);
  overflow: hidden;
}

.cct-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--record) 0%, var(--record-deep) 100%);
  transition: width 240ms linear;
}

.cct-keep {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

@media (max-width: 720px) {
  .cct-card {
    padding: 12px 14px;
  }
  .cct-title { font-size: 15px; }
}
