:root {
  color-scheme: light;
  --bg: #f5efe5;
  --bg-soft: #ebe4d8;
  --surface: #fffdf8;
  --surface-2: #f8f3ea;
  --surface-3: #eee7dc;
  --ink: #17252a;
  --ink-2: #33464b;
  --muted: #69777a;
  --faint: #8b9697;
  --line: #d8d1c5;
  --line-strong: #bdb5a8;
  --accent: #e84f37;
  --accent-strong: #bd301f;
  --accent-soft: #ffe1d9;
  --secondary: #087f82;
  --secondary-strong: #055f62;
  --secondary-soft: #d6f1ed;
  --success: #1d7d58;
  --success-soft: #daf1e6;
  --warning: #a66309;
  --warning-soft: #fff0cf;
  --danger: #b82c37;
  --danger-soft: #ffe0e3;
  --shadow: 0 20px 50px rgba(47, 39, 29, 0.11);
  --shadow-small: 0 8px 22px rgba(47, 39, 29, 0.08);
  --radius-xl: 24px;
  --radius-lg: 17px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shell: min(1440px, calc(100vw - 40px));
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="blue"] {
  color-scheme: light;
  --bg: #e8f3ff;
  --bg-soft: #dcecff;
  --surface: #fafdff;
  --surface-2: #edf6ff;
  --surface-3: #dcecff;
  --ink: #08243c;
  --ink-2: #294a65;
  --muted: #57718a;
  --faint: #7790a6;
  --line: #bdd7ec;
  --line-strong: #91bad8;
  --accent: #086bd8;
  --accent-strong: #0451aa;
  --accent-soft: #d5e9ff;
  --secondary: #008d91;
  --secondary-strong: #006b6e;
  --secondary-soft: #d5f1f1;
  --success: #137652;
  --success-soft: #d7f0e4;
  --warning: #9a5b00;
  --warning-soft: #ffefcb;
  --danger: #b4263b;
  --danger-soft: #ffdee4;
  --shadow: 0 20px 52px rgba(22, 64, 103, 0.13);
  --shadow-small: 0 8px 22px rgba(22, 64, 103, 0.09);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a1117;
  --bg-soft: #0f1921;
  --surface: #121d25;
  --surface-2: #16232d;
  --surface-3: #1d2c37;
  --ink: #eef7f6;
  --ink-2: #c6d7d8;
  --muted: #91a6a9;
  --faint: #74898d;
  --line: #2b3c47;
  --line-strong: #425663;
  --accent: #ff7457;
  --accent-strong: #ff957e;
  --accent-soft: #49251f;
  --secondary: #43d4c7;
  --secondary-strong: #78e7dd;
  --secondary-soft: #173c3b;
  --success: #5bd6a4;
  --success-soft: #173a2e;
  --warning: #f2ba56;
  --warning-soft: #42341d;
  --danger: #ff7582;
  --danger-soft: #48242a;
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.34);
  --shadow-small: 0 9px 26px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
  scroll-padding-top: 82px;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 6% 2%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 26rem),
    radial-gradient(circle at 93% 11%, color-mix(in srgb, var(--secondary) 8%, transparent), transparent 31rem),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  transition: background-color 160ms ease, color 160ms ease;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

a {
  color: var(--secondary);
  text-underline-offset: 0.18em;
}

img,
svg {
  display: block;
}

code,
pre {
  font-family: var(--mono);
}

code {
  font-size: 0.9em;
}

.shell {
  width: var(--shell);
  margin-inline: auto;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--surface);
  font-weight: 750;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--secondary) 75%, white);
  outline-offset: 3px;
}

.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
}

.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  min-height: 70px;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 580;
  letter-spacing: -0.015em;
  text-decoration: none;
  white-space: nowrap;
}

.brand img {
  border-radius: 10px;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--ink) 13%, transparent);
}

.brand strong {
  font-weight: 850;
}

.primary-nav {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.primary-nav a {
  padding: 8px 11px;
  border-radius: 9px;
  color: var(--ink-2);
  font-size: 0.88rem;
  font-weight: 670;
  text-decoration: none;
}

.primary-nav a:hover {
  background: var(--surface-3);
  color: var(--ink);
}

.theme-switcher {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.theme-choice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.theme-choice[aria-pressed="true"] {
  background: var(--surface-3);
  color: var(--ink);
}

.theme-dot {
  width: 12px;
  height: 12px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 50%;
}

.theme-dot-warm {
  background: linear-gradient(135deg, #fff8eb 50%, #e84f37 50%);
}

.theme-dot-blue {
  background: linear-gradient(135deg, #e7f4ff 50%, #086bd8 50%);
}

.theme-dot-dark {
  background: linear-gradient(135deg, #0d1720 50%, #43d4c7 50%);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(420px, 0.98fr);
  align-items: center;
  gap: clamp(42px, 7vw, 96px);
  padding-block: clamp(64px, 8vw, 106px) clamp(48px, 7vw, 84px);
}

.eyebrow,
.panel-kicker {
  color: var(--secondary);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--secondary);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--secondary) 14%, transparent);
}

.hero h1 {
  max-width: 760px;
  margin: 18px 0 20px;
  font-size: clamp(2.9rem, 6.2vw, 5.8rem);
  line-height: 0.96;
  letter-spacing: -0.064em;
}

.hero-lead {
  max-width: 690px;
  margin: 0;
  color: var(--ink-2);
  font-size: clamp(1.08rem, 1.5vw, 1.32rem);
  line-height: 1.64;
}

.hero-lead code {
  padding: 0.12em 0.35em;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--accent-strong);
}

.hero-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 20px;
  margin-top: 27px;
}

.hero-proof span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-2);
  font-size: 0.86rem;
  font-weight: 700;
}

.hero-proof svg {
  width: 17px;
  height: 17px;
  padding: 3px;
  border-radius: 50%;
  background: var(--success-soft);
  stroke: var(--success);
  stroke-width: 2.2;
  fill: none;
}

.hero-visual {
  position: relative;
}

.hero-visual::before {
  position: absolute;
  z-index: -1;
  inset: -12%;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--secondary) 14%, transparent), transparent 65%);
  content: "";
}

.hero-player {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 25px;
  background: #101820;
  box-shadow: var(--shadow);
  transform: rotate(1.4deg);
}

.hero-player-top {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding-inline: 15px;
  border-bottom: 1px solid #2a3944;
  background: #17232c;
}

.hero-player-top span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #52636e;
}

.hero-player-top span:first-child {
  background: #ff735b;
}

.hero-player-top span:nth-child(2) {
  background: #f2bb56;
}

.hero-player-top span:nth-child(3) {
  background: #43d4c7;
}

.hero-player-top b {
  margin-left: auto;
  color: #8fa6b2;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.15em;
}

.hero-screen {
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(240px, 29vw, 385px);
  background:
    linear-gradient(150deg, rgba(23, 49, 60, 0.7), rgba(8, 16, 22, 0.95)),
    repeating-linear-gradient(90deg, transparent 0 63px, rgba(255, 255, 255, 0.025) 64px),
    #0d151b;
}

.hero-screen::before,
.hero-screen::after {
  position: absolute;
  width: 42%;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  content: "";
}

.hero-screen::before {
  top: 33%;
  left: 8%;
  transform: rotate(-12deg);
}

.hero-screen::after {
  top: 28%;
  right: 8%;
  transform: rotate(15deg);
}

.hero-play {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  padding-left: 5px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.25rem;
}

.hero-caption {
  position: absolute;
  right: 8%;
  bottom: 16%;
  left: 8%;
  max-width: 80%;
  margin-inline: auto;
  padding: 9px 15px;
  border-radius: 7px;
  background: rgba(3, 9, 12, 0.83);
  color: #fff;
  font-size: clamp(0.88rem, 1.3vw, 1.08rem);
  font-weight: 760;
  text-align: center;
  text-shadow: 0 1px 2px #000;
}

.hero-timeline {
  position: relative;
  height: 78px;
  border-top: 1px solid #2a3944;
  background:
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(255, 255, 255, 0.05) 40px),
    #121d24;
}

.hero-timeline i {
  position: absolute;
  top: 27px;
  left: var(--left);
  width: var(--width);
  height: 25px;
  border: 1px solid #6de3d8;
  border-radius: 5px;
  background: rgba(67, 212, 199, 0.2);
}

.hero-timeline em {
  position: absolute;
  top: 10px;
  bottom: 8px;
  left: 56%;
  width: 2px;
  background: #ff7457;
  box-shadow: 0 0 10px rgba(255, 116, 87, 0.7);
}

.editor-section {
  padding-bottom: clamp(72px, 9vw, 126px);
}

.editor-app {
  position: relative;
  overflow: visible;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.editor-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  background: var(--surface-2);
}

.file-actions,
.document-tools,
.export-actions,
.validation-counts,
.dialog-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 790;
  line-height: 1.1;
  text-decoration: none;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.button-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 5px 12px color-mix(in srgb, var(--accent) 22%, transparent);
}

.button-primary:hover:not(:disabled) {
  background: var(--accent-strong);
}

.button-secondary,
.button-media {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink-2);
}

.button-secondary:hover:not(:disabled),
.button-media:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: var(--surface-3);
  color: var(--ink);
}

.button-media {
  color: var(--secondary-strong);
}

.button-small {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 0.78rem;
}

.privacy-contract {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1px solid color-mix(in srgb, var(--success) 32%, var(--line));
  border-radius: 11px;
  background: var(--success-soft);
  color: var(--success);
}

.privacy-contract svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.privacy-contract span {
  display: grid;
  line-height: 1.18;
}

.privacy-contract strong {
  font-size: 0.76rem;
}

.privacy-contract small {
  color: color-mix(in srgb, var(--success) 78%, var(--ink));
  font-size: 0.66rem;
}

.document-bar {
  position: relative;
  z-index: 12;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.document-identity {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.document-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--secondary) 35%, var(--line));
  border-radius: 8px;
  background: var(--secondary-soft);
  color: var(--secondary-strong);
  font-family: var(--mono);
  font-size: 0.67rem;
  font-weight: 900;
}

.document-identity div {
  display: grid;
  min-width: 0;
  line-height: 1.28;
}

.document-identity strong,
.document-identity span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-identity strong {
  font-size: 0.86rem;
}

.document-identity span {
  color: var(--muted);
  font-size: 0.69rem;
}

.icon-button,
.text-tool,
.text-button,
.dialog-close,
.export-menu button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 720;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 7px;
  border-radius: 8px;
}

.icon-button:hover:not(:disabled),
.text-tool:hover,
.text-button:hover {
  background: var(--surface-3);
  color: var(--ink);
}

.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.icon-button svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.text-tool {
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 0.74rem;
}

.text-button {
  padding: 5px 7px;
  border-radius: 7px;
  color: var(--secondary);
  font-size: 0.78rem;
}

.tool-divider {
  width: 1px;
  height: 24px;
  margin-inline: 2px;
  background: var(--line);
}

.export-actions {
  position: relative;
}

.button-download {
  min-width: 126px;
}

.export-more {
  border: 1px solid var(--line);
}

.export-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 7px);
  right: 0;
  min-width: 180px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

.export-menu button {
  width: 100%;
  padding: 9px 10px;
  border-radius: 7px;
  color: var(--ink-2);
  font-size: 0.78rem;
  text-align: left;
}

.export-menu button:hover {
  background: var(--surface-3);
  color: var(--ink);
}

.draft-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 16px;
  border-bottom: 1px solid color-mix(in srgb, var(--secondary) 35%, var(--line));
  background: var(--secondary-soft);
}

.draft-banner > div:first-child {
  display: grid;
  line-height: 1.35;
}

.draft-banner strong {
  color: var(--secondary-strong);
  font-size: 0.82rem;
}

.draft-banner span {
  color: var(--ink-2);
  font-size: 0.72rem;
}

.draft-banner > div:last-child {
  display: flex;
  align-items: center;
  gap: 8px;
}

.editor-workspace {
  display: grid;
  grid-template-columns: minmax(420px, 0.92fr) minmax(510px, 1.08fr);
  min-height: 720px;
}

.preview-panel,
.cue-panel {
  min-width: 0;
  padding: 18px;
}

.preview-panel {
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-2) 56%, var(--surface));
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.panel-heading h3,
.validation-heading h3 {
  margin: 2px 0 0;
  font-size: 1.02rem;
  line-height: 1.25;
}

.media-status {
  max-width: 45%;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 275px;
  overflow: hidden;
  border: 1px solid #2b3b45;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at center, rgba(67, 212, 199, 0.08), transparent 55%),
    #0c151b;
  color: #d8e4e7;
}

.media-stage video {
  width: 100%;
  max-height: 460px;
  background: #05090c;
}

.media-stage audio {
  width: calc(100% - 34px);
}

.media-placeholder {
  display: grid;
  justify-items: center;
  max-width: 390px;
  padding: 30px;
  text-align: center;
}

.placeholder-frame {
  display: grid;
  place-items: center;
  width: 78px;
  height: 60px;
  margin-bottom: 15px;
  border: 1px solid #3b4e5a;
  border-radius: 13px;
  background: #15232c;
}

.placeholder-frame svg {
  width: 43px;
  fill: none;
  stroke: #7a919e;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.media-placeholder strong {
  margin-bottom: 5px;
  color: #f3f8f9;
  font-size: 0.9rem;
}

.media-placeholder > span {
  margin-bottom: 15px;
  color: #94a9b3;
  font-size: 0.74rem;
}

.subtitle-overlay {
  position: absolute;
  right: 6%;
  bottom: 64px;
  left: 6%;
  z-index: 4;
  width: fit-content;
  max-width: 82%;
  margin-inline: auto;
  padding: 7px 12px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: clamp(0.84rem, 1.5vw, 1.06rem);
  font-weight: 720;
  line-height: 1.35;
  text-align: center;
  text-shadow: 0 1px 2px #000;
  white-space: pre-line;
}

.timeline-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}

.timeline-toolbar > div,
.timeline-toolbar label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timeline-toolbar label {
  color: var(--muted);
  font-size: 0.69rem;
  font-weight: 740;
}

.timeline-toolbar input[type="range"] {
  width: clamp(80px, 9vw, 130px);
  accent-color: var(--secondary);
}

.timeline-toolbar select {
  min-height: 30px;
  padding: 3px 26px 3px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  font-size: 0.7rem;
}

.time-readout {
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
}

.timeline-scroll {
  position: relative;
  margin-top: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
}

.timeline-track {
  position: relative;
  min-width: 100%;
  height: 138px;
  overflow: hidden;
  background:
    linear-gradient(to bottom, transparent 0 23px, var(--line) 24px, transparent 25px),
    repeating-linear-gradient(90deg, transparent 0 39px, color-mix(in srgb, var(--line) 55%, transparent) 40px);
}

#waveform {
  position: absolute;
  top: 27px;
  left: 0;
  width: 100%;
  height: 66px;
  opacity: 0.47;
}

.time-ticks {
  position: absolute;
  inset: 0 0 auto;
  height: 24px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.59rem;
}

.time-ticks span {
  position: absolute;
  top: 4px;
  transform: translateX(3px);
}

.cue-bars {
  position: absolute;
  top: 94px;
  right: 0;
  bottom: 8px;
  left: 0;
}

.cue-bar {
  position: absolute;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 8px;
  height: 33px;
  padding-inline: 7px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--secondary) 72%, var(--line));
  border-radius: 5px;
  background: color-mix(in srgb, var(--secondary) 25%, var(--surface));
  color: var(--secondary-strong);
  cursor: grab;
  font-family: var(--mono);
  font-size: 0.61rem;
  font-weight: 850;
  touch-action: none;
  user-select: none;
}

.cue-bar:active {
  cursor: grabbing;
}

.cue-bar.is-selected,
.cue-bar.is-active {
  z-index: 3;
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 28%, var(--surface));
  color: var(--accent-strong);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent);
}

.cue-bar.has-error {
  border-color: var(--danger);
}

.cue-bar.has-warning:not(.is-selected) {
  border-color: var(--warning);
}

.cue-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 7px;
  background: color-mix(in srgb, currentColor 34%, transparent);
  cursor: ew-resize;
}

.cue-handle-start {
  left: 0;
}

.cue-handle-end {
  right: 0;
}

.playhead {
  position: absolute;
  z-index: 5;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  pointer-events: none;
  background: var(--accent);
  box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 60%, transparent);
}

.playhead span {
  position: absolute;
  top: 0;
  left: 50%;
  width: 9px;
  height: 9px;
  border-radius: 0 0 7px 7px;
  background: var(--accent);
  transform: translateX(-50%);
}

.timeline-help {
  margin: 7px 2px 0;
  color: var(--muted);
  font-size: 0.67rem;
}

.current-cue {
  margin-top: 13px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--secondary);
  border-radius: 10px;
  background: var(--surface);
}

.current-cue span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.65rem;
}

.current-cue p {
  margin: 5px 0 0;
  font-size: 0.86rem;
  font-weight: 640;
  white-space: pre-line;
}

.document-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin-top: 13px;
}

.document-stats div {
  display: grid;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}

.document-stats span {
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 720;
}

.document-stats strong {
  margin-top: 1px;
  font-size: 0.83rem;
}

.cue-panel {
  background: var(--surface);
}

.cue-list {
  display: grid;
  gap: 11px;
  max-height: 795px;
  padding: 2px 4px 12px 2px;
  overflow-y: auto;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
}

.cue-empty {
  display: grid;
  justify-items: center;
  padding: 56px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: var(--surface-2);
  text-align: center;
}

.cue-empty strong {
  margin-bottom: 4px;
}

.cue-empty p {
  max-width: 390px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.8rem;
}

.cue-card {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: 0 3px 10px color-mix(in srgb, var(--ink) 4%, transparent);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.cue-card:hover {
  border-color: var(--line-strong);
}

.cue-card.is-selected {
  border-color: color-mix(in srgb, var(--secondary) 76%, var(--line));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--secondary) 14%, transparent);
}

.cue-card.has-error {
  border-left: 3px solid var(--danger);
}

.cue-card.has-warning:not(.has-error) {
  border-left: 3px solid var(--warning);
}

.cue-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px 8px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 12px 12px 0 0;
}

.cue-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.cue-index {
  display: grid;
  place-items: center;
  width: 27px;
  height: 25px;
  flex: 0 0 auto;
  border-radius: 6px;
  background: var(--secondary-soft);
  color: var(--secondary-strong);
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 900;
}

.cue-label span:last-child {
  overflow: hidden;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cue-head-actions {
  display: flex;
  gap: 3px;
}

.cue-head-actions button {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  padding: 7px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
}

.cue-head-actions button:hover {
  background: var(--surface-3);
  color: var(--ink);
}

.cue-head-actions button[data-action="delete"]:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.cue-head-actions svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.cue-card-body {
  padding: 11px;
}

.cue-time-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 8px;
}

.cue-arrow {
  padding-bottom: 9px;
  color: var(--faint);
  font-size: 0.73rem;
}

.cue-field,
.form-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.cue-field > span,
.form-field > span {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 770;
}

.cue-field input,
.cue-field textarea,
.form-field input,
.form-field textarea,
.form-field select,
.quality-grid input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: var(--surface);
  color: var(--ink);
}

.cue-field input {
  min-height: 35px;
  padding: 6px 8px;
  font-family: var(--mono);
  font-size: 0.71rem;
}

.cue-field input:focus,
.cue-field textarea:focus,
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--secondary) 12%, transparent);
}

.cue-text-field {
  margin-top: 9px;
}

.cue-field textarea {
  min-height: 76px;
  resize: vertical;
  padding: 9px 10px;
  font-size: 0.81rem;
  line-height: 1.42;
}

.cue-advanced {
  display: grid;
  grid-template-columns: minmax(100px, 0.7fr) minmax(160px, 1.3fr);
  gap: 8px;
  margin-top: 8px;
}

.cue-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}

.metric-badge {
  padding: 3px 6px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 760;
}

.metric-badge.is-warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.metric-badge.is-error {
  background: var(--danger-soft);
  color: var(--danger);
}

.validation-panel {
  padding: 18px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  background: var(--surface-2);
}

.validation-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.validation-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.count-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 770;
}

.count-error {
  background: var(--danger-soft);
  color: var(--danger);
}

.count-warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.validation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.issue-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 12px;
}

.issue-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 8px;
  width: 100%;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 0.72rem;
  text-align: left;
}

.issue-item:hover {
  border-color: var(--line-strong);
}

.issue-icon {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  font-size: 0.66rem;
  font-weight: 900;
}

.issue-error .issue-icon {
  background: var(--danger-soft);
  color: var(--danger);
}

.issue-warning .issue-icon {
  background: var(--warning-soft);
  color: var(--warning);
}

.issue-code {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.57rem;
}

.issue-empty {
  grid-column: 1 / -1;
  padding: 13px;
  border: 1px solid color-mix(in srgb, var(--success) 28%, var(--line));
  border-radius: 10px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 0.76rem;
  font-weight: 750;
}

.preserved-note {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.preserved-note > svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: var(--secondary);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.preserved-note > div {
  display: grid;
  line-height: 1.35;
}

.preserved-note strong {
  font-size: 0.75rem;
}

.preserved-note span {
  color: var(--muted);
  font-size: 0.67rem;
}

.content-section {
  padding-block: clamp(76px, 9vw, 126px);
}

.content-band {
  padding-block: clamp(72px, 8vw, 112px);
  border-block: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-2) 72%, transparent);
}

.section-heading h2 {
  margin: 12px 0 15px;
  font-size: clamp(2rem, 4vw, 3.7rem);
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.section-heading p {
  max-width: 670px;
  margin: 0;
  color: var(--ink-2);
  font-size: 1rem;
  line-height: 1.72;
}

.centered-heading {
  max-width: 820px;
  margin: 0 auto clamp(34px, 5vw, 58px);
  text-align: center;
}

.centered-heading p {
  margin-inline: auto;
}

.split-heading {
  display: grid;
  grid-template-columns: 1fr minmax(340px, 0.72fr);
  align-items: end;
  gap: 50px;
  margin-bottom: 38px;
}

.step-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step-grid li {
  position: relative;
  padding: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

.step-grid li > span {
  display: grid;
  place-items: center;
  width: 40px;
  height: 34px;
  margin-bottom: 28px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 900;
}

.step-grid h3,
.job-grid h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.step-grid p,
.job-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.preservation-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(480px, 1.18fr);
  align-items: center;
  gap: clamp(46px, 7vw, 110px);
}

.inline-link {
  display: inline-block;
  margin-top: 22px;
  color: var(--secondary);
  font-size: 0.86rem;
  font-weight: 790;
  text-decoration: none;
}

.inline-link:hover {
  text-decoration: underline;
}

.preservation-table {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

.preservation-table > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

.preservation-table > div:last-child {
  border-bottom: 0;
}

.preservation-table span {
  color: var(--ink-2);
  font-size: 0.85rem;
}

.preservation-table strong {
  color: var(--success);
  font-size: 0.76rem;
  text-align: right;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.check-card {
  padding: clamp(24px, 3vw, 36px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.check-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check-card-title span {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 50%;
  font-weight: 900;
}

.error-card .check-card-title span {
  background: var(--danger-soft);
  color: var(--danger);
}

.warning-card .check-card-title span {
  background: var(--warning-soft);
  color: var(--warning);
}

.check-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.check-card ul {
  display: grid;
  gap: 9px;
  margin: 20px 0 0;
  padding-left: 20px;
  color: var(--ink-2);
  font-size: 0.85rem;
}

.content-caveat {
  max-width: 850px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.anatomy-grid {
  display: grid;
  grid-template-columns: minmax(460px, 1.05fr) minmax(320px, 0.95fr);
  align-items: center;
  gap: clamp(46px, 7vw, 100px);
}

.code-card {
  overflow: hidden;
  border: 1px solid #2b3c47;
  border-radius: 18px;
  background: #0e171d;
  box-shadow: var(--shadow);
}

.code-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 15px;
  border-bottom: 1px solid #2b3c47;
  color: #98adb6;
  font-family: var(--mono);
  font-size: 0.67rem;
}

.code-card-top b {
  color: #43d4c7;
  letter-spacing: 0.12em;
}

.code-card pre {
  margin: 0;
  padding: clamp(22px, 4vw, 38px);
  overflow-x: auto;
  color: #d8e5e8;
  font-size: clamp(0.7rem, 1.15vw, 0.86rem);
  line-height: 1.75;
}

.code-keyword {
  color: #ff937c;
}

.code-time {
  color: #65e3d7;
}

.code-setting {
  color: #f2c36d;
}

.job-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.job-grid article {
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.job-grid article > span {
  display: grid;
  place-items: center;
  width: 39px;
  height: 36px;
  margin-bottom: 24px;
  border-radius: 9px;
  background: var(--secondary-soft);
  color: var(--secondary-strong);
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 900;
}

.faq-section {
  padding-top: 10px;
}

.faq-list {
  max-width: 900px;
  margin-inline: auto;
  border-top: 1px solid var(--line);
}

.faq-list details {
  border-bottom: 1px solid var(--line);
}

.faq-list summary {
  position: relative;
  padding: 20px 46px 20px 0;
  cursor: pointer;
  font-weight: 780;
  list-style: none;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  position: absolute;
  top: 19px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--muted);
  content: "+";
}

.faq-list details[open] summary::after {
  content: "−";
}

.faq-list p {
  max-width: 780px;
  margin: -2px 0 22px;
  color: var(--ink-2);
}

.site-footer {
  margin-top: clamp(64px, 8vw, 110px);
  padding-block: 32px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-2) 72%, transparent);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 32px;
}

.footer-brand {
  font-size: 0.9rem;
}

.footer-grid > div:first-child p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px 16px;
}

.footer-links a {
  color: var(--ink-2);
  font-size: 0.76rem;
  font-weight: 680;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--secondary);
}

.footer-note {
  margin: 0;
  color: var(--faint);
  font-size: 0.72rem;
}

.app-dialog {
  width: min(720px, calc(100vw - 30px));
  max-height: min(880px, calc(100vh - 36px));
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 17px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.35);
}

.app-dialog::backdrop {
  background: rgba(4, 11, 15, 0.65);
  backdrop-filter: blur(4px);
}

.compact-dialog {
  width: min(530px, calc(100vw - 30px));
}

.raw-dialog {
  width: min(960px, calc(100vw - 30px));
}

.app-dialog form {
  padding: 22px;
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.dialog-heading h2 {
  margin: 2px 0 0;
  font-size: 1.35rem;
}

.dialog-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 1.3rem;
}

.dialog-close:hover {
  background: var(--surface-3);
  color: var(--ink);
}

.form-field {
  margin-bottom: 14px;
}

.form-field input,
.form-field select {
  min-height: 42px;
  padding: 8px 10px;
}

.form-field textarea {
  min-height: 230px;
  padding: 11px;
  resize: vertical;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.5;
}

.raw-dialog textarea {
  min-height: min(58vh, 570px);
}

.form-field small,
.dialog-intro {
  color: var(--muted);
  font-size: 0.72rem;
}

.dialog-intro {
  margin: -6px 0 15px;
  line-height: 1.55;
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-block: 13px;
  color: var(--ink-2);
  font-size: 0.78rem;
}

.checkbox-field input {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  margin-top: 2px;
  accent-color: var(--secondary);
}

.dialog-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

.dialog-actions .text-button:first-child {
  margin-right: auto;
}

.dialog-message {
  min-height: 1.2em;
  margin: 9px 0 0;
  color: var(--danger);
  font-size: 0.72rem;
}

.quality-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.quality-grid .form-field {
  margin: 0;
}

.toast-region {
  position: fixed;
  z-index: 200;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 40px));
  pointer-events: none;
}

.toast {
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-small);
  font-size: 0.78rem;
  font-weight: 680;
  animation: toast-in 180ms ease both;
}

.toast.is-error {
  border-color: color-mix(in srgb, var(--danger) 50%, var(--line));
}

.toast.is-success {
  border-color: color-mix(in srgb, var(--success) 50%, var(--line));
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* Supporting pages */
.legal-main,
.guide-main {
  padding-block: clamp(58px, 8vw, 100px);
}

.legal-hero,
.guide-hero {
  max-width: 850px;
  margin-bottom: 30px;
}

.legal-hero h1,
.guide-hero h1,
.error-copy h1 {
  margin: 13px 0 16px;
  font-size: clamp(2.5rem, 6vw, 5rem);
  line-height: 1;
  letter-spacing: -0.055em;
}

.legal-hero p,
.guide-hero p,
.error-copy p {
  margin: 0;
  color: var(--ink-2);
  font-size: 1.03rem;
}

.updated-note {
  display: inline-block;
  margin-top: 15px;
  color: var(--muted);
  font-size: 0.72rem;
}

.legal-card,
.guide-card {
  max-width: 930px;
  padding: clamp(26px, 5vw, 54px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

.legal-card h2,
.guide-card h2 {
  margin: 34px 0 10px;
  font-size: 1.32rem;
}

.legal-card h2:first-child,
.guide-card h2:first-child {
  margin-top: 0;
}

.legal-card h3,
.guide-card h3 {
  margin: 24px 0 7px;
  font-size: 1rem;
}

.legal-card p,
.legal-card li,
.guide-card p,
.guide-card li {
  color: var(--ink-2);
}

.legal-card pre,
.guide-card pre {
  overflow-x: auto;
  padding: 18px;
  border-radius: 12px;
  background: #0e171d;
  color: #d8e5e8;
  font-size: 0.76rem;
}

.feedback-form {
  margin-bottom: 38px;
  padding-bottom: 34px;
  border-bottom: 1px solid var(--line);
}

.form-note {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.73rem;
}

.error-layout {
  display: grid;
  grid-template-columns: 1fr minmax(380px, 0.8fr);
  align-items: center;
  gap: 70px;
  min-height: calc(100vh - 250px);
  padding-block: 72px;
}

.error-code {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.guide-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  align-items: start;
  gap: 42px;
}

.guide-toc {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 3px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.guide-toc strong {
  margin-bottom: 7px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.guide-toc a {
  padding: 6px 8px;
  border-radius: 7px;
  color: var(--ink-2);
  font-size: 0.75rem;
  text-decoration: none;
}

.guide-toc a:hover {
  background: var(--surface-3);
  color: var(--ink);
}

@media (max-width: 1180px) {
  :root {
    --shell: min(100% - 30px, 1120px);
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(380px, 0.85fr);
    gap: 45px;
  }

  .document-bar {
    grid-template-columns: minmax(190px, 1fr) auto;
  }

  .document-tools {
    grid-row: 2;
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding-top: 8px;
    border-top: 1px solid var(--line);
  }

  .export-actions {
    grid-column: 2;
  }

  .editor-workspace {
    grid-template-columns: minmax(380px, 0.9fr) minmax(460px, 1.1fr);
  }

  .job-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 940px) {
  .header-inner {
    gap: 14px;
  }

  .primary-nav {
    display: none;
  }

  .header-inner {
    grid-template-columns: 1fr auto;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 42px;
    padding-top: 58px;
  }

  .hero-copy {
    max-width: 780px;
  }

  .hero-visual {
    max-width: 720px;
    width: 100%;
    margin-inline: auto;
  }

  .editor-topbar {
    align-items: flex-start;
  }

  .file-actions {
    flex-wrap: wrap;
  }

  .editor-workspace {
    grid-template-columns: 1fr;
  }

  .preview-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .cue-list {
    max-height: 720px;
  }

  .preservation-grid,
  .anatomy-grid,
  .split-heading,
  .guide-layout {
    grid-template-columns: 1fr;
  }

  .preservation-grid,
  .anatomy-grid {
    gap: 38px;
  }

  .split-heading {
    gap: 10px;
  }

  .guide-toc {
    position: static;
    grid-row: 1;
  }

  .footer-grid {
    grid-template-columns: 1fr auto;
  }

  .footer-note {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  :root {
    --shell: calc(100% - 22px);
    --radius-xl: 18px;
  }

  .header-inner {
    min-height: 62px;
  }

  .brand {
    font-size: 0.87rem;
  }

  .brand img {
    width: 34px;
    height: 34px;
  }

  .theme-label {
    display: none;
  }

  .theme-choice {
    width: 28px;
    padding: 4px;
    justify-content: center;
  }

  .hero {
    padding-block: 46px 46px;
  }

  .hero h1 {
    font-size: clamp(2.55rem, 14vw, 4.3rem);
    letter-spacing: -0.058em;
  }

  .hero-lead {
    font-size: 1rem;
  }

  .hero-proof {
    gap: 9px 14px;
  }

  .hero-player {
    transform: none;
  }

  .hero-screen {
    min-height: 215px;
  }

  .editor-topbar {
    display: grid;
    grid-template-columns: 1fr;
    padding: 11px;
  }

  .file-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .file-actions .button {
    width: 100%;
  }

  .privacy-contract {
    justify-content: center;
  }

  .document-bar {
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 10px 11px;
  }

  .document-tools {
    grid-row: 2;
    grid-column: 1 / -1;
    max-width: 100%;
    padding-top: 8px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
  }

  .document-tools::-webkit-scrollbar {
    display: none;
  }

  .tool-divider {
    display: none;
  }

  .export-actions {
    grid-row: 1;
    grid-column: 2;
  }

  .button-download {
    min-width: auto;
    padding-inline: 10px;
    font-size: 0.74rem;
  }

  .draft-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .preview-panel,
  .cue-panel,
  .validation-panel {
    padding: 13px;
  }

  .media-stage {
    min-height: 220px;
  }

  .timeline-toolbar {
    flex-wrap: wrap;
  }

  .timeline-toolbar > div {
    width: 100%;
  }

  .document-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .cue-time-grid {
    grid-template-columns: 1fr 1fr;
  }

  .cue-arrow {
    display: none;
  }

  .cue-advanced {
    grid-template-columns: 1fr;
  }

  .validation-heading {
    flex-direction: column;
  }

  .issue-list {
    grid-template-columns: 1fr;
  }

  .preserved-note {
    grid-template-columns: auto 1fr;
  }

  .preserved-note .text-button {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .step-grid,
  .check-grid,
  .job-grid {
    grid-template-columns: 1fr;
  }

  .content-section,
  .content-band {
    padding-block: 68px;
  }

  .section-heading h2 {
    font-size: clamp(1.9rem, 10vw, 3rem);
  }

  .preservation-table > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .preservation-table strong {
    text-align: left;
  }

  .anatomy-grid {
    gap: 30px;
  }

  .code-card {
    min-width: 0;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-brand {
    justify-content: center;
  }

  .footer-links {
    justify-content: center;
  }

  .footer-note {
    grid-column: auto;
  }

  .quality-grid {
    grid-template-columns: 1fr;
  }

  .dialog-actions {
    flex-wrap: wrap;
  }

  .error-layout {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 42px;
  }
}

@media (max-width: 430px) {
  .document-identity span {
    max-width: 160px;
  }

  .export-more {
    width: 30px;
  }

  .panel-heading {
    align-items: flex-start;
  }

  .cue-panel-heading {
    align-items: center;
  }

  .media-placeholder {
    padding: 22px 16px;
  }

  .timeline-toolbar label {
    flex: 1 1 auto;
  }

  .current-cue {
    padding: 10px;
  }

  .cue-card-body {
    padding: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
