:root {
  --paper: #f5f5f1;
  --surface: #ffffff;
  --ink: #18221f;
  --muted: #68736e;
  --line: #dce2dd;
  --lime: #dafa55;
  --blue: #5878f4;
  --coral: #f06957;
  --shadow: 0 18px 50px rgba(24, 34, 31, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
/* .button and friends set display, which would otherwise beat the [hidden] default. */
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; background: var(--paper); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
.topbar { align-items: center; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; padding: 22px clamp(20px, 4vw, 64px); }
.brand { align-items: center; color: var(--ink); display: inline-flex; font-size: 15px; font-weight: 750; gap: 10px; letter-spacing: .01em; text-decoration: none; }
.brand-mark { align-items: center; background: var(--ink); color: var(--lime); display: inline-flex; font-size: 11px; font-weight: 800; height: 29px; justify-content: center; letter-spacing: -.02em; width: 29px; }
.shell { margin: 0 auto; max-width: 1320px; padding: clamp(56px, 8vw, 104px) clamp(20px, 4vw, 64px) 30px; }
.intro { max-width: 750px; }
.eyebrow, .section-kicker { color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .14em; margin: 0 0 13px; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(48px, 7vw, 92px); letter-spacing: -.075em; line-height: .92; margin-bottom: 26px; }
h1 em { color: var(--blue); font-style: normal; }
.lede { color: var(--muted); font-size: 17px; line-height: 1.55; max-width: 510px; }
.workspace { background: var(--surface); box-shadow: var(--shadow); margin-top: clamp(48px, 8vw, 90px); padding: clamp(24px, 4vw, 52px); }
.workspace-head, .job-summary, .review-toolbar, .transcript-panel-head, .processing-copy { align-items: center; display: flex; justify-content: space-between; gap: 20px; }
h2 { font-size: clamp(24px, 3vw, 34px); letter-spacing: -.05em; line-height: 1; margin-bottom: 0; }
.limit-note, .segment-count, .save-state { color: var(--muted); font-size: 12px; }
.upload-form { margin-top: 36px; }
.drop-zone { align-items: center; border: 1px dashed #aab8b0; color: var(--ink); display: flex; flex-direction: column; min-height: 252px; justify-content: center; outline: none; padding: 30px; transition: border-color .18s, background .18s; }
.drop-zone:hover, .drop-zone:focus-visible, .drop-zone.dragover { background: #fbfceb; border-color: var(--blue); }
.drop-zone input { height: 1px; opacity: 0; position: absolute; width: 1px; }
.upload-icon { align-items: center; border: 1px solid var(--ink); display: flex; font-size: 24px; height: 52px; justify-content: center; margin-bottom: 18px; width: 52px; }
.drop-title { font-size: 17px; font-weight: 750; }
.drop-subtitle { color: var(--muted); font-size: 13px; margin-top: 7px; }
.file-meta { color: var(--blue); font-size: 13px; font-weight: 700; margin-top: 14px; }
.upload-options { align-items: end; display: grid; gap: 16px; grid-template-columns: 1fr 1.4fr auto; margin-top: 20px; }
.field-label { color: var(--muted); display: block; font-size: 12px; grid-column: 1; grid-row: 1; margin-bottom: 38px; position: absolute; }
select { appearance: none; background: var(--paper); border: 1px solid var(--line); border-radius: 0; color: var(--ink); min-height: 48px; padding: 0 14px; width: 100%; }
.permission { align-items: center; color: var(--muted); display: flex; font-size: 12px; gap: 8px; line-height: 1.4; min-height: 48px; }
.permission input { accent-color: var(--blue); height: 16px; width: 16px; }
.button { align-items: center; border: 1px solid transparent; display: inline-flex; font-size: 12px; font-weight: 800; gap: 14px; justify-content: center; letter-spacing: .02em; min-height: 46px; padding: 0 17px; transition: transform .15s, background .15s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .42; }
.button-primary { background: var(--ink); color: white; }
.button-primary:hover:not(:disabled) { background: var(--blue); }
.button-secondary { background: var(--lime); color: var(--ink); }
.button-quiet { background: transparent; border-color: var(--line); color: var(--ink); }
.button-danger { background: var(--coral); color: #fff; width: 100%; }
.button-danger:hover:not(:disabled) { background: #d8503e; }
#delete-button { margin-top: 12px; }
.deleted-note { color: var(--muted); font-size: 13px; line-height: 1.5; margin-top: 16px; }
.error-panel.deleted-panel { background: #f1f6f2; border-left-color: #56b889; }
.message { font-size: 13px; line-height: 1.45; margin: 16px 0 0; }
.error { color: var(--coral); }
.job-summary { border-top: 1px solid var(--line); margin-top: 40px; padding-top: 30px; }
.processing-view { margin-top: 34px; max-width: 700px; }
.processing-copy { font-size: 13px; margin-bottom: 12px; }
.processing-pulse { background: var(--lime); border-radius: 50%; display: inline-block; height: 9px; margin-right: 9px; width: 9px; }
.progress-track { background: var(--paper); height: 9px; overflow: hidden; }
.progress-bar { background: var(--blue); height: 100%; transition: width .35s ease; width: 0; }
.progress-bar.failed { background: var(--coral); }
.muted { color: var(--muted); font-size: 13px; line-height: 1.5; margin-top: 15px; }
.file-estimate { color: var(--muted); font-size: 12px; margin-top: 6px; text-align: center; }
.processing-headline { align-items: center; display: inline-flex; }
.processing-pulse.stalled { background: var(--coral); }
.timing-row { color: var(--muted); display: flex; font-size: 12px; gap: 16px; justify-content: space-between; margin-top: 10px; }
.timing-row span:last-child { font-weight: 700; }
.stage-list { display: flex; flex-wrap: wrap; gap: 8px 22px; list-style: none; margin: 22px 0 0; padding: 0; }
.stage-list li { align-items: center; color: var(--muted); display: flex; font-size: 12px; gap: 8px; }
.stage-mark { border: 1px solid var(--line); border-radius: 50%; height: 9px; width: 9px; }
.stage-list li.done { color: var(--ink); }
.stage-list li.done .stage-mark { background: var(--ink); border-color: var(--ink); }
.stage-list li.active { color: var(--blue); font-weight: 800; }
.stage-list li.active .stage-mark { background: var(--blue); border-color: var(--blue); box-shadow: 0 0 0 3px rgba(88, 120, 244, .18); }
.stage-list li.failed { color: var(--coral); font-weight: 800; }
.stage-list li.failed .stage-mark { background: var(--coral); border-color: var(--coral); }
.processing-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.stage-list li.skipped { opacity: .38; }
.stage-list li.skipped .stage-mark { border-style: dashed; }
.part-track { border: 1px solid var(--line); margin-top: 20px; padding: 13px 15px; }
.part-track-head { color: var(--muted); display: flex; font-size: 12px; justify-content: space-between; }
.part-track-head span:first-child { color: var(--ink); font-weight: 800; }
.part-pips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.part-pips span { background: var(--line); flex: 1 1 14px; height: 6px; min-width: 14px; }
.part-pips span.done { background: var(--ink); }
.part-pips span.active { background: var(--blue); }
.processing-reassurance { color: var(--muted); font-size: 12px; margin: 8px 0 0; }
.error-panel { background: #fdf1ef; border-left: 3px solid var(--coral); margin-top: 20px; padding: 16px 18px; }
.error-head { align-items: center; display: flex; flex-wrap: wrap; gap: 10px; }
.error-head strong { font-size: 15px; letter-spacing: -.01em; }
.error-code { background: var(--coral); color: #fff; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; font-weight: 700; letter-spacing: .04em; padding: 3px 7px; }
.error-message { color: var(--ink); font-size: 13px; line-height: 1.5; margin: 10px 0 0; }
.error-hint { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 8px 0 0; }
.error-hint span { color: var(--ink); font-weight: 800; letter-spacing: .1em; margin-right: 8px; text-transform: uppercase; }
.review-toolbar { border-bottom: 1px solid var(--line); margin-top: 34px; padding-bottom: 21px; }
.audio-wrap { flex: 1; }
audio { height: 38px; max-width: 100%; width: 100%; }
.review-actions { align-items: center; display: flex; gap: 17px; }
.review-grid { display: grid; gap: clamp(26px, 5vw, 70px); grid-template-columns: minmax(150px, .3fr) 1fr; padding-top: 33px; }
.review-aside { border-right: 1px solid var(--line); padding-right: 25px; }
.aside-block { border-top: 2px solid var(--ink); margin-bottom: 30px; padding-top: 12px; }
.aside-copy { color: var(--muted); font-size: 12px; line-height: 1.55; }
.legend-item { align-items: center; color: var(--muted); display: flex; font-size: 12px; gap: 9px; margin-top: 10px; }
.legend-dot { display: inline-block; height: 8px; width: 8px; }
.legend-dot.machine { background: var(--blue); }
.legend-dot.edited { background: var(--coral); }
.export-links { display: grid; gap: 8px; margin-top: 14px; }
.export-links a { color: var(--blue); font-size: 12px; font-weight: 750; }
.segments { margin-top: 28px; }
.segment { border-top: 1px solid var(--line); display: grid; gap: 17px; grid-template-columns: 105px 130px 1fr; padding: 19px 0; }
.segment-time { color: var(--blue); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; padding-top: 7px; }
.speaker-input, .text-input { background: transparent; border: 0; border-bottom: 1px solid transparent; color: var(--ink); outline: none; padding: 6px 0; width: 100%; }
.speaker-input { font-size: 12px; font-weight: 800; }
.text-input { font-size: 14px; line-height: 1.55; resize: vertical; }
.speaker-input:focus, .text-input:focus { border-bottom-color: var(--blue); }
.accepted .speaker-input, .accepted .text-input { cursor: default; }
.segment-warning { background: #fbfceb; border-left: 2px solid var(--lime); color: var(--muted); font-size: 12px; grid-column: 1 / -1; line-height: 1.5; margin: 4px 0 0; padding: 8px 11px; }
.segment.has-warning { border-top-color: var(--lime); }
.empty-review { color: var(--muted); padding: 40px 0; }
.footer { border-top: 1px solid var(--line); color: var(--muted); display: flex; font-size: 11px; justify-content: space-between; margin-top: 100px; padding: 18px 0 0; }
.accept-dialog { border: 0; box-shadow: 0 25px 80px rgba(24,34,31,.22); max-width: 480px; padding: 0; width: calc(100% - 40px); }
.accept-dialog::backdrop { background: rgba(24,34,31,.38); }
.accept-dialog form { padding: 31px; position: relative; }
.accept-dialog h2 { margin: 10px 0 14px; }
.accept-dialog p:not(.section-kicker) { color: var(--muted); font-size: 14px; line-height: 1.55; }
.dialog-close { background: transparent; border: 0; color: var(--muted); font-size: 24px; position: absolute; right: 17px; top: 10px; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: end; margin-top: 25px; }

@media (max-width: 760px) {
  .topbar { padding: 17px 20px; }
  .shell { padding-top: 58px; }
  h1 { font-size: clamp(50px, 16vw, 72px); }
  .upload-options { align-items: stretch; grid-template-columns: 1fr; }
  .field-label { margin-bottom: 0; position: static; }
  select { margin-top: -8px; }
  .workspace-head, .job-summary, .review-toolbar, .footer { align-items: flex-start; flex-direction: column; }
  .review-toolbar { gap: 17px; }
  .stage-list { gap: 8px 14px; }
  .timing-row { flex-direction: column; gap: 4px; }
  .review-actions { justify-content: space-between; width: 100%; }
  .review-grid { grid-template-columns: 1fr; }
  .review-aside { border-bottom: 1px solid var(--line); border-right: 0; display: grid; gap: 20px; grid-template-columns: repeat(3, 1fr); padding: 0 0 20px; }
  .aside-block { margin: 0; }
  .segment { gap: 6px 13px; grid-template-columns: 96px 1fr; }
  .text-input { grid-column: 1 / -1; }
  .footer { gap: 8px; margin-top: 60px; }
}

@media (max-width: 500px) {
  .review-aside { display: block; }
  .aside-block { margin-bottom: 22px; }
  .limit-note { display: none; }
}
