:root {
  color-scheme: dark;
  --bg: #12121b;
  --panel: #1a1a26;
  --inset: #15151f;
  --line: #353347;
  --subtle: #2b2a3b;
  --ink: #f4f1fa;
  --muted: #b9b3c9;
  --quiet: #a39ab6;
  --accent: #c1a9fb;
  --accent-hot: #cfbdff;
  --good: #9ce6bf;
  --warn: #f3cc87;
  --rose: #ffadbf;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: radial-gradient(ellipse at 86% 12%, #1d192d 0%, var(--bg) 47%); color: var(--ink); min-height: 100vh; }
a { color: inherit; }
button, textarea, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
button:focus-visible, a:focus-visible, textarea:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent-hot); outline-offset: 4px; }
.shell { width: min(1192px, calc(100% - 96px)); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--subtle); }
.header-inner { display: flex; justify-content: space-between; align-items: center; min-height: 76px; gap: 14px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); font-size: 1.18rem; text-decoration: none; font-weight: 700; letter-spacing: -.025em; }
.brand-icon { background: var(--accent); width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: #21163c; font: 700 1.55rem/1 Georgia, serif; padding-top: 6px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 10px; min-height: 42px; border-radius: 8px; border: 1px solid transparent; font-size: .9rem; font-weight: 650; padding: 9px 14px; transition: background-color .18s, border-color .18s, color .18s; }
.secondary { color: var(--ink); background: #242334; border-color: #3d3954; }
.secondary:hover:not(:disabled) { background: #312b47; border-color: #635584; }
.triangle { width: 0; height: 0; border-block: 5px solid transparent; border-left: 8px solid currentColor; margin-left: 2px; }
.demo-button .triangle { color: var(--accent); }
.intro { position: relative; min-height: 274px; display: grid; grid-template-columns: minmax(0, 1fr) 36%; align-items: center; padding: 37px 0 42px; }
.intro-copy { z-index: 1; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2.55rem, 4.8vw, 4.5rem); line-height: 1.04; font-weight: 630; letter-spacing: -.07em; }
h1 em { font-family: Georgia, 'Times New Roman', serif; font-style: italic; font-weight: 400; color: var(--accent); letter-spacing: -.08em; }
.intro p { color: var(--muted); margin-top: 18px; max-width: 565px; line-height: 1.55; font-size: 1.04rem; }
.hero-wave { position: absolute; right: 0; top: 13px; width: 38%; height: calc(100% - 26px); pointer-events: none; }
.hero-wave canvas { width: 100%; height: 100%; display: block; }
.workspace { display: grid; grid-template-columns: minmax(340px, .79fr) minmax(0, 1.21fr); gap: 20px; align-items: start; padding-bottom: 54px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 13px 42px #09081130; min-width: 0; }
.inputs { padding: 24px; }
.output { min-height: 510px; padding: 24px; display: flex; flex-direction: column; }
.panel-heading h2 { font-size: 1.27rem; font-weight: 680; letter-spacing: -.035em; }
.panel-heading p { color: var(--muted); font-size: .925rem; line-height: 1.5; margin-top: 5px; }
fieldset { margin: 0; padding: 0; border: 0; min-inline-size: 0; }
.field-label { display: flex; justify-content: space-between; align-items: baseline; margin: 24px 0 8px; font-size: .94rem; font-weight: 650; }
.quote-label { margin-top: 19px; }
.optional { font-size: .875rem; font-weight: 500; color: var(--quiet); }
.counter { font-size: .875rem; color: var(--quiet); font-weight: 550; font-variant-numeric: tabular-nums; }
.counter.over { color: var(--rose); }
.upload { background: #1e1b30; border: 1px dashed #625583; border-radius: 9px; transition: border-color .18s, background-color .18s; }
.upload:hover, .upload.dragging { border-color: var(--accent); background: #29213d; }
.upload:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.drop-label { min-height: 82px; padding: 13px; display: flex; align-items: center; gap: 12px; cursor: pointer; }
.upload-icon, .file-icon { background: #32294a; color: var(--accent-hot); width: 39px; height: 39px; flex: 0 0 39px; display: grid; place-items: center; border-radius: 8px; font-size: 1.35rem; }
.upload-copy { color: var(--muted); font-size: .9rem; line-height: 1.4; }
.upload-copy strong { color: var(--accent-hot); font-weight: 650; }
.upload-copy small, .file-copy span { display: block; margin-top: 4px; color: var(--quiet); font-size: .82rem; }
.selected-file { display: flex; align-items: center; gap: 12px; min-height: 84px; padding: 12px; border: 1px solid #55466d; border-radius: 9px; background: #201c32; }
.file-copy { flex: 1; min-width: 0; }
.file-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .95rem; }
.icon-button { width: 35px; height: 35px; flex: 0 0 auto; display: grid; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted); font-size: 1.45rem; }
.icon-button:hover { border-color: var(--line); color: var(--ink); background: var(--panel); }
textarea { display: block; width: 100%; min-height: 126px; padding: 12px; resize: vertical; color: var(--ink); background: var(--inset); border: 1px solid var(--line); border-radius: 8px; line-height: 1.5; font-size: .96rem; }
textarea::placeholder { color: #a29bb2; }
.field-help { color: var(--quiet); font-size: .86rem; margin-top: 7px; line-height: 1.4; }
.notice { border: 1px solid #754755; border-radius: 8px; color: #ffccd7; background: #35202d; font-size: .91rem; line-height: 1.45; margin-top: 13px; padding: 10px 12px; }
.actions { display: flex; gap: 8px; margin-top: 16px; }
.primary { flex: 1; width: 100%; min-height: 47px; color: #1e142e; background: var(--accent); }
.primary:hover:not(:disabled) { background: #d6c5ff; }
.verify-icon { font-size: 1.2rem; line-height: 1; font-weight: 800; transform: rotate(90deg); }
.privacy { display: flex; gap: 9px; align-items: flex-start; line-height: 1.4; margin-top: 13px; color: var(--quiet); font-size: .82rem; }
.lock { display: inline-block; position: relative; width: 11px; height: 9px; flex: 0 0 11px; margin-top: 6px; border: 1px solid currentColor; border-radius: 2px; }
.lock::before { content: ''; position: absolute; top: -6px; left: 1px; width: 5px; height: 5px; border: 1px solid currentColor; border-bottom: none; border-radius: 5px 5px 0 0; }
.results-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.clear-button { min-height: 33px; padding: 5px 9px; white-space: nowrap; }
.empty, .working { display: flex; flex: 1; min-height: 365px; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px; }
.empty-mark { display: flex; align-items: center; justify-content: center; width: 73px; height: 73px; gap: 4px; border-radius: 19px; border: 1px solid #493c66; background: #28213d; color: var(--accent); margin-bottom: 17px; }
.empty-mark i { display: block; height: 11px; width: 3px; background: currentColor; border-radius: 3px; }
.empty-mark i:nth-child(2), .empty-mark i:nth-child(6) { height: 19px; }
.empty-mark i:nth-child(3), .empty-mark i:nth-child(5) { height: 28px; }
.empty-mark i:nth-child(4) { height: 36px; }
.empty h3, .working h3 { font-size: 1.07rem; letter-spacing: -.025em; }
.empty p, .working p { color: var(--muted); max-width: 300px; line-height: 1.5; margin-top: 8px; font-size: .95rem; }
.working-mark { display: block; width: 37px; height: 37px; border: 3px solid #493d65; border-top-color: var(--accent); border-radius: 50%; margin-bottom: 16px; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
progress { accent-color: var(--accent); margin-top: 15px; width: min(230px, 100%); }
.result-switcher { display: flex; gap: 5px; flex-wrap: wrap; padding: 4px; width: fit-content; margin-top: 17px; border-radius: 9px; border: 1px solid var(--line); background: var(--inset); }
.result-switch { min-height: 36px; padding: 5px 10px; background: transparent; color: var(--muted); }
.result-switch:hover { color: var(--ink); background: #252238; }
.result-switch[aria-pressed="true"] { color: var(--accent-hot); background: #33274a; border-color: #544270; }
#result-note { margin-top: 12px; }
.results { display: grid; gap: 12px; margin-top: 12px; }
.results-note { color: var(--quiet); font-size: .88rem; line-height: 1.5; }
.transcript-entry { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--inset); }
.transcript-entry .play-row { margin: 0 0 9px; border: 0; padding: 0; }
.transcript-entry p { font-size: .97rem; line-height: 1.58; overflow-wrap: anywhere; }
.result-card { border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: var(--inset); }
.result-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.result-head h3 { font-size: .94rem; font-weight: 680; }
.badge { font-size: .8rem; font-weight: 650; border-radius: 999px; padding: 4px 8px; }
.badge.exact { color: var(--good); background: #19362d; }
.badge.different { color: var(--accent-hot); background: #33274a; }
.badge.uncertain { color: var(--warn); background: #3b3121; }
.badge.unmatched { color: var(--muted); background: #2e2b3b; }
.quote-row { display: grid; grid-template-columns: 114px minmax(0, 1fr); gap: 9px; align-items: baseline; }
.quote-row + .quote-row { margin-top: 9px; }
.quote-key { color: var(--quiet); font-size: .85rem; }
.quote-text { overflow-wrap: anywhere; font-size: .97rem; line-height: 1.58; }
del, ins { border-radius: 3px; padding: 1px 2px; }
del { color: #ffd0d9; background: #452837; text-decoration-thickness: 1px; }
ins { color: #d9c8ff; background: #35294f; text-underline-offset: 3px; }
.result-note { color: var(--muted); font-size: .86rem; line-height: 1.5; margin-top: 10px; }
.play-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--subtle); padding-top: 10px; margin-top: 12px; }
.play-button { min-height: 35px; padding: 5px 9px; color: var(--accent-hot); font-size: .86rem; }
.pause-icon { display: block; width: 8px; height: 10px; border-inline: 2px solid currentColor; margin-inline: 1px; }
.timecode { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
details.alt { margin-top: 10px; color: var(--muted); font-size: .89rem; }
details.alt summary { cursor: pointer; }
details.alt .quote-text { margin-top: 9px; }
.visually-hidden { clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; white-space: nowrap; position: absolute; }

@media (max-width: 900px) {
  .shell { width: calc(100% - 44px); }
  .workspace { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 13px; }
  .inputs, .output { padding: 18px; }
  .quote-row { grid-template-columns: 1fr; gap: 1px; }
}
@media (max-width: 670px) {
  .shell { width: calc(100% - 32px); }
  .header-inner { min-height: 64px; }
  .brand { gap: 7px; }
  .brand-icon { width: 30px; height: 30px; }
  .demo-button { gap: 7px; padding-inline: 9px; font-size: .84rem; }
  .intro { display: block; min-height: 0; padding: 34px 0 26px; }
  .intro p { position: relative; }
  h1 { position: relative; z-index: 1; }
  .hero-wave { width: 63%; height: 72%; opacity: .34; right: -3px; }
  .workspace { grid-template-columns: 1fr; padding-bottom: 24px; }
  .output { min-height: 290px; }
  .empty, .working { min-height: 220px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition: none !important; }
}
