/* ============================================================
   Line Coach — design system
   Dark, quiet chrome; one warm accent (marquee gold); cues and
   lines set in Courier Prime on a cream "script page".
   ============================================================ */
:root {
  --bg: #0d0e12;
  --surface: #15161c;
  --surface-2: #1c1e26;
  --surface-3: #262935;
  --hair: rgba(255, 255, 255, .07);
  --hair-2: rgba(255, 255, 255, .12);
  --ink: #f2f3f5;
  --ink-2: #a3a7b4;
  --ink-3: #6d7180;
  --accent: #f5b841;
  --accent-2: #ffcd63;
  --accent-ink: #1b1405;
  --accent-soft: rgba(245, 184, 65, .13);
  --good: #46d39a;
  --good-soft: rgba(70, 211, 154, .14);
  --bad: #ff6b6b;
  --bad-soft: rgba(255, 107, 107, .14);
  --paper: #f4eee2;
  --paper-ink: #1d1b16;
  --paper-muted: #7a7162;
  --highlighter: rgba(255, 205, 64, .75);
  --script: "Courier Prime", "Courier New", Courier, monospace;
  --ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* hidden must win over the display values below */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: var(--ui); font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
#app { max-width: 680px; margin: 0 auto; padding: max(14px, env(safe-area-inset-top)) 16px calc(32px + env(safe-area-inset-bottom)); }

.screen { display: none; }
.screen.active { display: block; animation: fade .22s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- icons ---------- */
.ic { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.ic.sm { width: 16px; height: 16px; }
.ic.lg { width: 26px; height: 26px; }
.ic.xl { width: 34px; height: 34px; }
.ic.fill { fill: currentColor; stroke: none; }

/* ---------- type helpers ---------- */
.eyebrow { display: block; margin: 0 0 8px; font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.count { color: var(--ink-2); letter-spacing: 0; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 0; background: none; border: none; color: var(--accent); font-size: 14px; font-weight: 600; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 18px; border: 1px solid transparent; border-radius: 14px;
  background: var(--surface-3); color: var(--ink); font-size: 16px; font-weight: 650; letter-spacing: -.01em;
  transition: transform .08s ease, background .15s ease, border-color .15s ease, opacity .15s ease;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:active { background: var(--accent-2); }
.btn.ghost { background: transparent; border-color: var(--hair-2); }
.btn.small { min-height: 36px; padding: 7px 12px; border-radius: 11px; font-size: 14px; }
.btn.block { display: flex; width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }
.pill-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px 0 11px;
  border: 1px solid var(--hair-2); border-radius: 999px; background: var(--surface); color: var(--ink);
  font-size: 14px; font-weight: 650;
}
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 40px; height: 40px; border: 1px solid var(--hair); border-radius: 12px; background: var(--surface); color: var(--ink);
}
.icon-btn.quiet { width: 34px; height: 34px; border-color: transparent; background: transparent; color: var(--ink-2); }
.icon-btn:disabled { opacity: .28; cursor: default; }
.icon-btn-spacer { width: 40px; }

/* ---------- home: app bar + panels ---------- */
.appbar { display: flex; align-items: center; justify-content: space-between; margin: 6px 2px 18px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; box-shadow: 0 0 0 1px var(--hair-2); }
.brand-name { font-size: 20px; font-weight: 750; letter-spacing: -.02em; }
.panel { margin-bottom: 14px; padding: 16px; background: var(--surface); border: 1px solid var(--hair); border-radius: 20px; }

/* project */
.project-current { display: flex; align-items: center; gap: 10px; width: 100%; padding: 0; background: none; border: none; color: var(--ink); text-align: left; }
.project-title { flex: 1; min-width: 0; font-size: 24px; font-weight: 750; letter-spacing: -.02em; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-current .chev { color: var(--ink-3); transition: transform .2s; }
.project-current[aria-expanded="true"] .chev { transform: rotate(180deg); }
.project-list { display: flex; flex-direction: column; gap: 6px; margin: 12px 0 2px; }
.proj-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 14px; background: var(--surface-2); border: 1px solid var(--hair); border-radius: 14px; color: var(--ink); text-align: left; }
.proj-row.on { border-color: rgba(245, 184, 65, .55); }
.proj-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.proj-title { font-size: 15px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj-meta { font-size: 12.5px; color: var(--ink-2); }
.proj-check { display: inline-flex; color: var(--accent); }

.empty { padding: 18px 6px 8px; text-align: center; }
.empty-icon { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; margin-bottom: 10px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); }
.empty h3 { margin: 4px 0 6px; font-size: 18px; letter-spacing: -.01em; }
.empty p { margin: 0 0 16px; color: var(--ink-2); font-size: 14px; }

/* files: script / schedule / call sheets */
.files { display: flex; flex-direction: column; margin-top: 14px; border-top: 1px solid var(--hair); }
.files > * + * { border-top: 1px solid var(--hair); }
.file-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; background: var(--surface); }
.file-ico { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 36px; height: 36px; border-radius: 10px; background: var(--surface-3); color: var(--ink-2); }
.file-ico.script { background: var(--accent-soft); color: var(--accent); }
.file-ico.sched { background: rgba(143, 200, 255, .12); color: #8fc8ff; }
.file-ico.calls { background: rgba(196, 168, 255, .12); color: #c4a8ff; }
.file-info { flex: 1; min-width: 0; }
.file-kind { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.file-name { font-size: 15px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-act { flex: 0 0 auto; padding: 8px 2px 8px 10px; background: none; border: none; color: var(--accent); font-size: 14px; font-weight: 650; }
.cs-row { padding: 10px 0 10px 48px; background: var(--surface); font-size: 14px; color: var(--ink-2); }

/* import results */
.notice { display: flex; flex-direction: column; gap: 9px; margin-bottom: 14px; padding: 13px 15px; background: var(--surface); border: 1px solid var(--hair-2); border-radius: 16px; font-size: 14px; color: var(--ink); cursor: pointer; }
.notice-item { display: flex; align-items: flex-start; gap: 10px; }
.notice-item .ic { margin-top: 2px; color: var(--good); }
.notice-item.warn .ic { color: var(--accent); }

/* character */
.me-field { margin-bottom: 18px; }
.me-field.inline { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.me-field.inline .eyebrow { margin: 0; white-space: nowrap; }
.me-field.inline .select-wrap { flex: 1; min-width: 0; }
.select-wrap { position: relative; }
.select {
  width: 100%; padding: 12px 40px 12px 14px; -webkit-appearance: none; appearance: none;
  background: var(--surface-2); border: 1px solid var(--hair-2); border-radius: 12px;
  color: var(--ink); font-size: 16px; font-weight: 600;
}
.select-wrap .chev { position: absolute; top: 50%; right: 12px; width: 16px; height: 16px; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }

/* scene list */
.section-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.section-head .eyebrow { margin: 0; }
.deleted-toggle { margin-left: 8px; padding: 0; font-size: 12px; letter-spacing: 0; text-transform: none; }
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-2); border: 1px solid var(--hair); border-radius: 11px; }
.seg button { padding: 6px 11px; background: none; border: none; border-radius: 8px; color: var(--ink-2); font-size: 13px; font-weight: 600; }
.seg button.on { background: var(--surface-3); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.scene-list { position: relative; display: flex; flex-direction: column; gap: 8px; max-height: 56vh; margin: 0 -4px; padding: 0 4px 2px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.empty-note { margin: 6px 2px; color: var(--ink-2); font-size: 14px; }
.day-head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 2px 6px; background: var(--surface);
  font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2);
}
.day-head.past { color: var(--ink-3); }
.day-tag { padding: 3px 8px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); font-size: 10.5px; font-weight: 800; letter-spacing: .06em; }
.day-head.next .day-tag { background: var(--accent); color: var(--accent-ink); }
.day-tag.today { background: var(--good) !important; color: #062417 !important; }
.scene-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; background: var(--surface-2); border: 1px solid var(--hair); border-radius: 14px; color: var(--ink); text-align: left; }
.scene-row.on { border-color: rgba(245, 184, 65, .6); }
.sc-num {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; min-width: 46px; height: 46px; padding: 0 6px;
  background: var(--bg); border: 1px solid var(--hair); border-radius: 11px;
  font-family: var(--script); font-size: 16px; font-weight: 700; color: var(--accent);
}
.sc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sc-head { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-family: var(--script); font-size: 13px; font-weight: 700; line-height: 1.3; letter-spacing: .01em; text-transform: uppercase; }
.sc-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13.5px; line-height: 1.35; color: var(--ink-2); }
.sc-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin-top: 1px; font-size: 12px; color: var(--ink-3); }
.badge { padding: 2px 7px; border-radius: 6px; background: var(--surface-3); color: var(--ink-2); font-size: 10.5px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.badge.rev { background: var(--accent-soft); color: var(--accent); }
.badge.done { background: var(--good-soft); color: var(--good); }
.sc-bar { display: inline-block; width: 56px; height: 4px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.sc-bar i { display: block; height: 100%; border-radius: inherit; background: var(--good); }
.sc-go { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.sc-go .ic { width: 15px; height: 15px; margin-left: 2px; }
.scene-row.deleted { cursor: default; opacity: .7; }
.edit-scene { margin-top: 10px; }

/* grouped rows (settings) */
.rows { overflow: hidden; background: var(--surface-2); border: 1px solid var(--hair); border-radius: 14px; }
.row { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 50px; padding: 10px 14px; background: none; border: none; color: var(--ink); text-align: left; }
.rows > * + *, .settings-body > * + * { border-top: 1px solid var(--hair); }
.row-label { flex: 1; min-width: 0; font-size: 15px; font-weight: 550; }
.row-label small { display: block; font-size: 12px; font-weight: 400; color: var(--ink-3); }
.row-value { font-size: 15px; color: var(--ink-2); text-align: right; }
.row .chev { width: 16px; height: 16px; color: var(--ink-3); }
.row.pick { cursor: pointer; }
.row.pick select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; -webkit-appearance: none; appearance: none; font-size: 16px; }
.row-toggle .chev { transition: transform .2s; }
.row-toggle.open .chev { transform: rotate(180deg); }
.row input[type=range] { flex: 0 0 46%; accent-color: var(--accent); }
.fine-print { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 0; background: none; border: none; font-size: 12.5px; color: var(--ink-3); text-align: left; }
.fine-print .dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); }
.fine-print.link { color: var(--ink-2); cursor: pointer; }

/* switch */
.switch { position: relative; display: inline-block; flex: 0 0 auto; width: 51px; height: 31px; }
.switch input { display: none; }
.switch .track { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-3); transition: background .2s; }
.switch .track::before { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .3); transition: transform .2s; }
.switch input:checked + .track { background: var(--good); }
.switch input:checked + .track::before { transform: translateX(20px); }

/* voices (built by app.js) */
.voices-by-char { padding: 4px 14px 14px; }
.voices-by-char .field { margin-top: 12px; }
.voices-by-char .label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.voices-by-char .hint { color: var(--ink-3); font-size: 13px; }
.engine-toggle { display: flex; gap: 2px; padding: 3px; background: var(--surface); border: 1px solid var(--hair); border-radius: 11px; }
.engine-toggle .eng { flex: 1; padding: 8px; background: none; border: none; border-radius: 8px; color: var(--ink-2); font-size: 13.5px; font-weight: 600; }
.engine-toggle .eng.on { background: var(--surface-3); color: var(--ink); }
.voice-row-controls { display: flex; align-items: center; gap: 8px; }
.voices-by-char .select {
  flex: 1; min-width: 0; padding: 9px 34px 9px 12px; font-size: 14px; font-weight: 500; background-color: var(--surface);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236d7180' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='m7 15 5 5 5-5'/><path d='m7 9 5-5 5 5'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center;
}
.voice-preview { min-width: 40px; padding: 0 !important; }
.text-input { flex: 1; min-width: 0; padding: 10px 12px; background: var(--surface); border: 1px solid var(--hair-2); border-radius: 10px; color: var(--ink); font-size: 16px; }
.key-hint { margin: 6px 0 0; font-size: 12px; }

/* start, warnings, tips */
#btn-start { margin-top: 2px; }
.callout { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; padding: 12px 14px; background: var(--bad-soft); border: 1px solid rgba(255, 107, 107, .35); border-radius: 14px; color: #ffdada; font-size: 14px; }
.callout .ic { margin-top: 1px; color: var(--bad); }
.help { margin-top: 16px; padding: 2px 16px; background: var(--surface); border: 1px solid var(--hair); border-radius: 16px; color: var(--ink-2); font-size: 14px; }
.help summary { display: flex; align-items: center; gap: 8px; padding: 13px 0; color: var(--ink); font-weight: 650; list-style: none; cursor: pointer; }
.help summary::-webkit-details-marker { display: none; }
.help summary .ic { color: var(--ink-3); }
.help ul { margin: 0 0 14px; padding-left: 18px; }
.help li { margin: 8px 0; }
.help b { color: var(--ink); font-weight: 650; }

/* ---------- top bars (check lines, rehearse) ---------- */
.navbar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; margin: 4px 0 12px; }
.navbar-title { min-width: 0; text-align: center; }
.navbar-title .t { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.navbar-title .s { font-family: var(--script); font-size: 12px; color: var(--ink-3); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.navbar-title .s:empty { display: none; }
.scene-nav { display: flex; align-items: center; gap: 2px; min-width: 0; }
.scene-nav .navbar-title { flex: 1; }
.counter { min-width: 40px; color: var(--ink-2); font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; }
.run-progress { height: 3px; margin: 0 0 16px; overflow: hidden; border-radius: 999px; background: var(--surface-2); }
.run-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width .3s ease; }

/* ---------- check the lines ---------- */
.review-intro { margin: 0 2px 14px; color: var(--ink-2); font-size: 14px; }
.review-list { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 16px; }
.review-row { padding: 12px 14px; background: var(--surface); border: 1px solid var(--hair); border-left: 3px solid transparent; border-radius: 12px; cursor: pointer; }
.review-row.mine { background: #1f1b12; border-left-color: var(--accent); }
.rr-who { font-family: var(--script); font-size: 12.5px; font-weight: 700; letter-spacing: .03em; color: var(--ink-2); }
.review-row.mine .rr-who { color: var(--accent); }
.rr-text { margin-top: 3px; font-family: var(--script); font-size: 15px; line-height: 1.45; }
.review-row textarea, .review-row select { width: 100%; margin-top: 8px; padding: 9px; background: var(--bg); border: 1px solid var(--hair-2); border-radius: 10px; color: var(--ink); font-size: 15px; }
.review-row textarea { font-family: var(--script); }
.rr-edit { display: none; }
.review-row.editing .rr-edit { display: block; }
.review-row.editing .rr-text { display: none; }
.rr-edit-actions { display: flex; gap: 8px; margin-top: 10px; }
.review-actions { position: sticky; bottom: calc(10px + env(safe-area-inset-bottom)); display: flex; gap: 10px; }
.review-actions .btn { flex: 1; box-shadow: 0 10px 24px rgba(0, 0, 0, .4); }
.review-actions .btn.ghost { background: var(--surface); }

/* ---------- rehearse: the script page ---------- */
.stage-note { display: flex; align-items: flex-start; gap: 8px; margin: 0 4px 12px; font-family: var(--script); font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.stage-note .ic { margin-top: 2px; color: var(--ink-3); }
/* long action lines show four lines; tap to read the rest */
.stage-note span { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.stage-note.open span { display: block; }
.page {
  position: relative; min-height: 280px; margin-bottom: 20px; padding: 26px 22px 24px;
  background: var(--paper); color: var(--paper-ink); border-radius: 18px; font-family: var(--script);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
}
#cue-card, #mine-card { touch-action: pan-y; -webkit-user-select: none; user-select: none; }
#mine-card { cursor: pointer; }
.page .who { font-size: 16px; font-weight: 700; letter-spacing: .06em; text-align: center; text-transform: uppercase; }
.page .paren { margin-top: 2px; color: var(--paper-muted); font-size: 15px; font-style: italic; text-align: center; }
.cue-text, .mine-line { margin-top: 16px; font-size: 22px; line-height: 1.5; }
.speaking-dots { display: flex; justify-content: center; gap: 6px; margin-top: 20px; opacity: 0; transition: opacity .2s; }
.page.speaking .speaking-dots { opacity: 1; }
.speaking-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--paper-muted); animation: pulse 1s infinite; }
.speaking-dots span:nth-child(2) { animation-delay: .2s; }
.speaking-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes pulse { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

/* your line: a gold edge, like a highlighted page */
.page.mine { padding-top: 40px; box-shadow: 0 0 0 3px rgba(245, 184, 65, .6), 0 18px 40px rgba(0, 0, 0, .45); }
.page.mine.good { box-shadow: 0 0 0 3px var(--good), 0 18px 40px rgba(0, 0, 0, .45); }
.page.mine.bad { box-shadow: 0 0 0 3px var(--bad), 0 18px 40px rgba(0, 0, 0, .45); }
.mine-tag { position: absolute; top: 12px; left: 16px; right: 12px; display: flex; align-items: center; justify-content: space-between; font-family: var(--ui); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #a8761a; }
.mic-live { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; color: #c2410c; opacity: 0; transition: opacity .2s; }
.page.mine.listening .mic-live { opacity: 1; animation: micpulse 1.4s ease-in-out infinite; }
@keyframes micpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(194, 65, 12, .35); } 50% { box-shadow: 0 0 0 7px rgba(194, 65, 12, 0); } }
.mine-line .hl { padding: 1px 3px; border-radius: 3px; background: var(--highlighter); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.mine-line .hit { color: #0d6b35; }
.mine-line .miss { color: #b4232a; text-decoration: underline wavy; text-underline-offset: 4px; }
.mine-line.hidden-line { -webkit-user-select: none; user-select: none; }
.peek-hint { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 110px; border: 1.5px dashed rgba(29, 27, 22, .2); border-radius: 12px; color: var(--paper-muted); font-family: var(--ui); font-size: 15px; }
.page .status { margin-top: 16px; color: var(--paper-muted); font-family: var(--ui); font-size: 14px; font-weight: 600; text-align: center; }
.page .status.good { color: #0d6b35; }
.page .status.bad { color: #b4232a; }
.live-transcript { min-height: 20px; margin-top: 6px; color: var(--paper-muted); font-family: var(--ui); font-size: 15px; font-style: italic; text-align: center; }
.offer-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.page-btn { padding: 10px 16px; border: 1.5px solid rgba(29, 27, 22, .25); border-radius: 999px; background: transparent; color: var(--paper-ink); font-family: var(--ui); font-size: 14px; font-weight: 650; }
.page-btn.primary { background: var(--paper-ink); border-color: var(--paper-ink); color: var(--paper); }
@keyframes cardInNext { from { transform: translateX(56px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes cardInPrev { from { transform: translateX(-56px); opacity: 0; } to { transform: none; opacity: 1; } }
.page.in-next { animation: cardInNext .22s ease-out; }
.page.in-prev { animation: cardInPrev .22s ease-out; }

/* ---------- rehearse: controls ---------- */
.transport { display: flex; align-items: flex-start; justify-content: space-between; gap: 4px; margin: 4px 0 16px; }
.tbtn { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 0; background: none; border: none; color: var(--ink); }
.tbtn .ic { box-sizing: content-box; width: 22px; height: 22px; padding: 12px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--hair); transition: transform .08s ease; }
.tbtn:active .ic { transform: scale(.94); }
.tbtn small { font-size: 11px; font-weight: 600; color: var(--ink-2); }
.tbtn.main .ic { width: 28px; height: 28px; padding: 16px; background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 16px; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border: 1px solid var(--hair-2); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 600; }
.chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.btn.talk { min-height: 54px; background: transparent; border: 1.5px solid var(--accent); color: var(--accent); }
.btn.talk.holding { background: var(--accent); color: var(--accent-ink); }

/* ---------- rehearse: end of scene ---------- */
/* the playback controls step aside while the end card shows */
#screen-rehearse:has(#done-card:not([hidden])) .transport,
#screen-rehearse:has(#done-card:not([hidden])) .tools { display: none; }
.done { margin-top: 6px; padding: 26px 18px 18px; background: var(--surface); border: 1px solid var(--hair); border-radius: 22px; text-align: center; }
.done-badge { display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%; background: var(--good-soft); color: var(--good); }
.done-badge .ic { width: 30px; height: 30px; }
.done-badge.stopped { background: var(--surface-3); color: var(--ink-2); }
.done-badge.stopped .ic { width: 22px; height: 22px; }
.done-title { font-size: 22px; font-weight: 750; letter-spacing: -.02em; }
.done-sub { margin: 8px 0 18px; color: var(--ink-2); font-size: 14px; }
.stat-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 10px; }
.stat-tiles div { padding: 12px 6px; background: var(--surface-2); border: 1px solid var(--hair); border-radius: 14px; }
.stat-tiles b { display: block; color: var(--ink); font-size: 24px; font-weight: 750; font-variant-numeric: tabular-nums; }
.stat-tiles span { color: var(--ink-3); font-size: 12px; }
.done-prog { padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--hair); border-radius: 14px; text-align: left; }
.done-prog-top { display: flex; justify-content: space-between; gap: 10px; color: var(--ink); font-size: 14px; font-weight: 650; }
.done-prog .bar { height: 6px; margin: 10px 0 8px; overflow: hidden; border-radius: 999px; background: var(--surface-3); }
.done-prog .bar i { display: block; height: 100%; border-radius: inherit; background: var(--good); }
.done-prog-sub { color: var(--ink-3); font-size: 12px; }
.done-actions { display: flex; gap: 10px; }
.done-actions .btn { flex: 1; }
.done-next { margin-top: 10px; }
.done-lines { margin-top: 12px; }

/* ---------- swipe left to delete ---------- */
.swipe { position: relative; flex: 0 0 auto; overflow: hidden; border-radius: 14px; }
.files .swipe { border-radius: 0; }
.swipe-under { position: absolute; inset: 0; display: none; justify-content: flex-end; background: var(--bad); border-radius: inherit; }
.swipe.active .swipe-under { display: flex; }
.swipe-del { width: 92px; background: none; border: none; color: #fff; font-size: 15px; font-weight: 750; }
.swipe-main { position: relative; touch-action: pan-y; -webkit-user-select: none; user-select: none; }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(4, 5, 8, .66); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sheet { width: 100%; max-width: 420px; padding: 22px; background: var(--surface); border: 1px solid var(--hair-2); border-radius: 22px; box-shadow: 0 24px 60px rgba(0, 0, 0, .5); }
.busy-card { display: flex; align-items: center; gap: 14px; font-weight: 600; }
.spinner { flex: 0 0 auto; width: 24px; height: 24px; border: 3px solid var(--surface-3); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.modal-title { margin-bottom: 6px; font-size: 18px; font-weight: 750; letter-spacing: -.01em; }
.modal-body { margin-bottom: 18px; color: var(--ink-2); font-size: 15px; overflow-wrap: anywhere; }
.modal-actions { display: flex; flex-direction: column; gap: 8px; }
.modal-actions .btn { width: 100%; }
.overlay.drop { pointer-events: none; }
.drop-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px 36px; background: var(--surface); border: 2px dashed var(--accent); border-radius: 24px; color: var(--ink); font-size: 20px; font-weight: 750; }
.drop-card .ic { color: var(--accent); }
.drop-card small { color: var(--ink-2); font-size: 13px; font-weight: 500; }

/* ---------- toast + undo ---------- */
.toast, .undo-bar {
  position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  max-width: calc(100% - 32px); background: rgba(28, 30, 38, .96); border: 1px solid var(--hair-2); border-radius: 14px;
  color: var(--ink); font-size: 14px; font-weight: 600; box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.toast { z-index: 50; padding: 11px 16px; text-align: center; }
.undo-bar { z-index: 55; display: flex; align-items: center; gap: 14px; padding: 8px 8px 8px 16px; }
.undo-bar span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.undo-bar button { flex: 0 0 auto; padding: 8px 14px; background: var(--accent); border: none; border-radius: 10px; color: var(--accent-ink); font-size: 14px; font-weight: 750; }
.undo-bar:not([hidden]) + .toast { bottom: calc(80px + env(safe-area-inset-bottom)); }

@media (min-width: 600px) {
  .cue-text, .mine-line { font-size: 25px; }
  .page { padding: 32px 34px 30px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
