:root {
  --ink: #101820;
  --paper: #f4f0e8;
  --card: #fffdf8;
  --muted: #667078;
  --line: #d8d3c9;
  --accent: #f2a53b;
  --accent-dark: #c66b16;
  --teal: #1d6f6a;
  --danger: #a23e36;
  --shadow: 0 20px 60px rgba(16, 24, 32, .11);
}
* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 80% 8%, rgba(242,165,59,.15), transparent 27rem), var(--paper); }
button, input, select, textarea { font: inherit; }
button, select, label { -webkit-tap-highlight-color: transparent; }
.topbar { height: 72px; padding: 0 max(20px, calc((100vw - 1040px)/2)); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(16,24,32,.12); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; letter-spacing: -.02em; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; color: var(--paper); background: var(--ink); border-radius: 10px 10px 10px 2px; }
.status-pill { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #c5a235; box-shadow: 0 0 0 4px rgba(197,162,53,.12); }
.status-pill.ok .status-dot { background: #3c9b70; box-shadow: 0 0 0 4px rgba(60,155,112,.12); }
.status-pill.bad .status-dot { background: #c2534b; box-shadow: 0 0 0 4px rgba(194,83,75,.12); }
main { width: min(1040px, calc(100% - 32px)); margin: 0 auto; }
.hero { max-width: 760px; padding: 74px 0 38px; }
.eyebrow, .kicker { color: var(--teal); text-transform: uppercase; letter-spacing: .13em; font-weight: 800; font-size: 12px; }
.hero h1 { margin: 10px 0 18px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(42px, 7vw, 76px); line-height: .98; letter-spacing: -.045em; font-weight: 700; }
.hero > p:last-child { max-width: 670px; color: #4c575f; font-size: 18px; line-height: 1.65; }
.workspace { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 28px; align-items: start; padding-bottom: 70px; }
.steps { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 28px; padding-top: 28px; }
.step { display: grid; grid-template-columns: 34px 1fr; gap: 9px; align-items: center; color: #9a9f9f; }
.step span { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--paper); font-weight: 800; font-size: 13px; }
.step small { font-weight: 700; }
.step.active { color: var(--ink); }
.step.active span { color: var(--paper); background: var(--ink); border-color: var(--ink); }
.step.done span { background: var(--teal); border-color: var(--teal); color: white; }
.panel { background: var(--card); border: 1px solid rgba(16,24,32,.1); border-radius: 24px; box-shadow: var(--shadow); padding: clamp(22px, 5vw, 44px); }
.panel-heading { display: flex; justify-content: space-between; align-items: start; gap: 20px; margin-bottom: 28px; }
.panel h2 { margin: 4px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(28px, 4vw, 40px); letter-spacing: -.025em; }
.panel p { margin: 0; }
.privacy-note { padding: 8px 11px; color: var(--teal); background: rgba(29,111,106,.09); border-radius: 99px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.dropzone { min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; border: 1.5px dashed #a6aaa6; border-radius: 18px; background: #faf8f2; cursor: pointer; transition: .2s ease; padding: 28px; }
.dropzone:hover, .dropzone.dragover { border-color: var(--accent-dark); background: #fff7e8; transform: translateY(-1px); }
.dropzone input { position: absolute; opacity: 0; pointer-events: none; }
.upload-icon { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 13px; color: var(--ink); background: var(--accent); border-radius: 15px; font-weight: 900; font-size: 25px; }
.dropzone strong { font-size: 18px; }
.dropzone > span:not(.upload-icon) { color: var(--muted); margin-top: 4px; }
.dropzone small { color: #81888b; margin-top: 16px; }
.file-list { display: grid; gap: 10px; margin-top: 16px; }
.file-row { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 13px 14px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.file-number { width: 30px; height: 30px; display: grid; place-items: center; color: white; background: var(--teal); border-radius: 9px; font-size: 12px; font-weight: 800; }
.file-copy { min-width: 0; }
.file-copy strong, .file-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-copy small { color: var(--muted); margin-top: 2px; }
.icon-button, .text-button, .round-button { border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.icon-button { width: 36px; height: 36px; border-radius: 10px; font-size: 20px; }
.icon-button:hover { background: #f3eee5; color: var(--danger); }
.options-grid, .voice-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; margin-top: 26px; }
.field { display: grid; gap: 9px; color: #39444a; font-size: 13px; font-weight: 750; }
select, textarea { width: 100%; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 12px; outline: none; }
select { height: 48px; padding: 0 38px 0 13px; }
select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(29,111,106,.11); }
.check-row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 12px; background: white; cursor: pointer; }
.check-row input { accent-color: var(--teal); width: 18px; height: 18px; }
.check-row strong, .check-row small { display: block; font-size: 12px; }
.check-row small { color: var(--muted); margin-top: 2px; }
.primary { width: 100%; min-height: 54px; margin-top: 26px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border: 0; border-radius: 13px; color: white; background: var(--ink); font-weight: 800; cursor: pointer; box-shadow: 0 10px 24px rgba(16,24,32,.16); }
.primary:hover:not(:disabled) { background: #23303a; transform: translateY(-1px); }
.primary:disabled { opacity: .42; cursor: not-allowed; }
.progress-wrap { margin-top: 20px; }
.progress-track, .queue-progress { height: 6px; background: #e7e2d8; border-radius: 99px; overflow: hidden; }
.progress-track span, .queue-progress span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width .25s ease; }
.progress-wrap p { margin-top: 8px; color: var(--muted); font-size: 12px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.stat { padding: 14px; background: #f6f2e9; border-radius: 12px; }
.stat strong { display: block; font-size: 19px; }
.stat small { color: var(--muted); }
.chapter-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: thin; }
.chapter-tab { flex: 0 0 auto; max-width: 210px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.chapter-tab.active { border-color: var(--ink); background: var(--ink); color: white; }
.narration-field { margin-top: 8px; }
textarea { min-height: 360px; resize: vertical; padding: 16px; line-height: 1.65; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; }
.helper { margin-top: 8px !important; color: var(--muted); font-size: 12px; }
.voice-grid { margin-top: 24px; }
input[type="range"] { width: 100%; accent-color: var(--teal); }
.error { margin-top: 12px !important; color: var(--danger); font-size: 13px; }
.text-button { padding: 6px; font-weight: 750; text-decoration: underline; text-underline-offset: 3px; }
.player-panel { text-align: center; }
.player-art { width: 180px; height: 180px; margin: 0 auto 28px; display: flex; align-items: end; justify-content: center; gap: 7px; padding: 38px; position: relative; background: var(--ink); border-radius: 28px; box-shadow: 0 22px 42px rgba(16,24,32,.26); overflow: hidden; }
.player-art::before { content: ""; position: absolute; width: 130px; height: 130px; top: -55px; right: -40px; border: 25px solid var(--accent); border-radius: 50%; opacity: .9; }
.player-art span { position: absolute; top: 18px; left: 21px; color: white; font: 700 26px Georgia, serif; }
.player-art i { width: 8px; height: 35%; background: var(--accent); border-radius: 8px; animation: wave .9s ease-in-out infinite alternate; }
.player-art i:nth-of-type(2) { height: 55%; animation-delay: -.5s; }.player-art i:nth-of-type(3) { height: 80%; animation-delay: -.25s; }.player-art i:nth-of-type(4) { height: 45%; animation-delay: -.7s; }
@keyframes wave { to { height: 22%; } }
.player-panel h2 { margin-bottom: 7px; }
#playbackMeta { color: var(--muted); margin-bottom: 22px; }
audio { width: 100%; margin: 4px 0 18px; }
.player-actions { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 22px 0 30px; }
.round-button { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: white; color: var(--ink); font-size: 20px; }
.secondary { min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: white; font-weight: 750; cursor: pointer; }
.queue-head { display: flex; justify-content: space-between; align-items: center; text-align: left; border-top: 1px solid var(--line); padding-top: 24px; }
.queue-head h3 { margin: 0; }
.audio-queue { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; text-align: left; }
.queue-item { display: grid; grid-template-columns: 28px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 12px; border-radius: 11px; color: var(--muted); background: #f7f3eb; cursor: pointer; }
.queue-item.active { color: var(--ink); background: #fff2d9; box-shadow: inset 3px 0 var(--accent); }
.queue-item.failed { color: var(--danger); }
.queue-item small { white-space: nowrap; }
footer { width: min(860px, calc(100% - 40px)); margin: 0 auto; padding: 0 0 34px; color: var(--muted); font-size: 12px; text-align: center; }
.toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 10; transform: translate(-50%, 20px); padding: 11px 16px; color: white; background: var(--ink); border-radius: 10px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .2s ease; font-size: 13px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.hidden { display: none !important; }
@media (max-width: 720px) {
  .topbar { height: 62px; padding: 0 16px; }
  .status-pill { font-size: 0; }
  .hero { padding: 48px 2px 28px; }
  .hero h1 { font-size: clamp(42px, 13vw, 62px); }
  .hero > p:last-child { font-size: 16px; }
  .workspace { grid-template-columns: 1fr; gap: 14px; }
  .steps { position: static; flex-direction: row; justify-content: center; gap: 15px; padding: 0; }
  .step { grid-template-columns: 30px 1fr; gap: 6px; }
  .step span { width: 30px; height: 30px; }
  .step small { font-size: 11px; }
  .panel { border-radius: 18px; }
  .panel-heading { flex-direction: column; margin-bottom: 20px; }
  .privacy-note { order: -1; }
  .dropzone { min-height: 190px; }
  .options-grid, .voice-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .stat { padding: 10px; }
  .stat strong { font-size: 16px; }
  .stat small { font-size: 10px; }
  textarea { min-height: 300px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; scroll-behavior: auto !important; transition: none !important; } }
