:root {
  color-scheme: light;
  --background: #f5f7fa;
  --surface: #fff;
  --soft: #edf2f9;
  --text: #293447;
  --muted: #5e6c82;
  --accent: #4c69a7;
  --accent-hover: #3d5890;
  --accent-soft: #e8eefb;
  --line: #dce4ef;
  --line-strong: #c6d2e3;
  --radius: 15px;
  --shadow: 0 12px 36px rgb(39 62 100 / 4%);
  font-family: Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--background); scroll-behavior: smooth; }
body { margin: 0; color: var(--text); font-size: 14px; line-height: 1.65; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, select { cursor: pointer; }
button:disabled, select:disabled { cursor: not-allowed; }
a { color: var(--accent); text-underline-offset: 3px; }
button, input, select, textarea, a { outline-offset: 4px; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #92afe8; }
input[type="checkbox"], input[type="radio"], input[type="range"] { accent-color: var(--accent); }
input[type="checkbox"], input[type="radio"] { width: 17px; height: 17px; flex: 0 0 auto; margin: 1px 0 0; }
input[type="range"] { max-width: 100%; }
p, h1, h2, h3, h4 { margin: 0; }
h2 { font-size: 19px; line-height: 1.45; font-weight: 600; letter-spacing: -.45px; }
h3 { font-size: 15px; line-height: 1.5; font-weight: 600; }
small { font-size: 12px; }
svg { display: block; flex-shrink: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.app-shell { min-height: 100dvh; display: flex; flex-direction: column; }
.app-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner, .workspace, .footer-inner { width: min(1160px, calc(100% - 80px)); margin-inline: auto; }
.header-inner { display: flex; justify-content: space-between; align-items: center; gap: 24px; min-height: 88px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 22px; font-weight: 600; letter-spacing: -.9px; }
.brand-symbol { display: grid; place-items: center; width: 32px; height: 36px; padding-bottom: 2px; color: white; background: var(--accent); border-radius: 10px 10px 10px 3px; font: 400 29px/1 "PT Serif", Georgia, serif; letter-spacing: -1px; }
.header-meta { display: flex; align-items: center; gap: 25px; font-size: 12px; color: var(--muted); }
.version-badge { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 7px; padding: 6px 10px; font-size: 11px; white-space: nowrap; }
.version-badge > span { width: 5px; height: 5px; background: #7a91b5; border-radius: 50%; }
.workspace { padding-block: 40px 65px; flex: 1; }
.workflow-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-bottom: 29px; border-bottom: 1px solid var(--line); }
.eyebrow { color: var(--muted); font-size: 11px; line-height: 1.5; letter-spacing: 1.65px; text-transform: uppercase; }
.steps { display: flex; align-items: center; gap: 28px; }
.step { display: flex; align-items: center; gap: 10px; padding: 0; background: transparent; border: 0; color: var(--muted); text-align: left; font-size: 12px; line-height: 1.4; }
.step-number, .step-index, .step > span:first-child:not(.step-copy) { display: grid; place-items: center; width: 30px; height: 30px; flex-shrink: 0; border: 1px solid var(--line-strong); border-radius: 50%; background: #f0f3f8; color: var(--muted); font-size: 12px; font-weight: 500; }
.step-copy { display: grid; gap: 2px; }
.step-title { font-weight: 500; }
.step-caption { font-size: 11px; color: var(--muted); }
.step.active, .step[aria-current="step"] { color: var(--accent); }
.step.active .step-number, .step.active .step-index, .step.active > span:first-child:not(.step-copy), .step[aria-current="step"] .step-number, .step[aria-current="step"] > span:first-child:not(.step-copy) { color: white; background: var(--accent); border-color: var(--accent); }
.step.done .step-number, .step.done .step-index, .step.done > span:first-child:not(.step-copy) { color: var(--accent); border-color: #aebfdb; background: var(--accent-soft); }
.step:disabled { opacity: 1; color: var(--muted); cursor: default; }
.step svg { width: 14px; height: 14px; }
.page-intro { padding-block: 35px 27px; }
.page-title { font-size: clamp(28px, 2.8vw, 37px); font-weight: 500; line-height: 1.25; letter-spacing: -1.25px; }
.page-subtitle { margin-top: 11px; max-width: 650px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1fr) 286px; align-items: start; gap: 27px; }
.view { display: grid; gap: 20px; min-width: 0; scroll-margin-top: 20px; }
.view:focus { outline: none; }
.summary { min-width: 0; display: grid; gap: 18px; }
.card { min-width: 0; padding: 29px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card > h2 + p, .card > h3 + p { margin-top: 9px; }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 23px; }
.card-heading { display: grid; gap: 6px; }
.card-header .muted { font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.micro { font-size: 11px; }
.stack { display: grid; gap: 18px; }
.inline { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; max-width: 100%; padding: 11px 20px; border: 1px solid var(--accent); border-radius: 10px; background: var(--accent); color: white; text-decoration: none; text-align: center; font-size: 13px; font-weight: 600; line-height: 1.5; transition: background-color .15s, border-color .15s; }
.button:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.button.secondary { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.button.secondary:hover:not(:disabled) { background: #f7f9fd; border-color: #abbcd6; }
.button.link { min-height: 30px; padding: 3px 0; border: 0; border-radius: 3px; background: transparent; color: var(--accent); text-align: left; font-size: 12px; font-weight: 500; }
.button.link:hover:not(:disabled) { background: transparent; color: var(--accent-hover); text-decoration: underline; text-underline-offset: 4px; }
.button.danger { background: #963e3e; border-color: #963e3e; }
.button:disabled { opacity: .46; }
.button svg { width: 17px; height: 17px; }
.button.full { width: 100%; }
.actions { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 13px; padding-top: 24px; margin-top: 25px; border-top: 1px solid var(--line); }
.actions.end { justify-content: flex-end; }
.actions .button.link { margin-right: auto; }
.field { display: grid; gap: 8px; min-width: 0; font-size: 12px; color: var(--muted); }
.field + .field { margin-top: 18px; }
.field label, .field-label { color: var(--text); font-size: 12px; font-weight: 500; }
.field input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]), .field select, .field textarea, input.text-input, select.select-input { width: 100%; min-height: 45px; padding: 11px 13px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 9px; color: var(--text); font-size: 14px; line-height: 1.5; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.field-hint { font-size: 11px; line-height: 1.7; }
.check-label { display: flex; align-items: flex-start; gap: 9px; font-size: 12px; line-height: 1.8; color: var(--muted); }
.check-label input { margin-top: 3px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field-grid .field + .field { margin-top: 0; }
.file-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: 258px; padding: 35px 25px; border: 1.5px dashed #bdcce2; border-radius: 12px; background: #f9fbfe; text-align: center; transition: border-color .15s, background-color .15s; }
.file-drop:hover, .file-drop.dragover, .file-drop.drag-over, .file-drop.dragging, .file-drop.is-dragover { border-color: var(--accent); background: #f0f5fd; }
.file-drop strong, .drop-title { color: var(--text); font-size: 17px; font-weight: 500; letter-spacing: -.35px; }
.file-drop p, .file-drop .muted { max-width: 360px; font-size: 12px; line-height: 1.75; }
.file-drop > svg { width: 31px; height: 35px; color: var(--accent); stroke-width: 1.4; }
.upload-icon { display: grid; place-items: center; width: 58px; height: 62px; margin-bottom: 2px; background: white; border: 1px solid var(--line); border-radius: 18px 18px 18px 5px; color: var(--accent); box-shadow: 0 4px 10px rgb(53 78 117 / 3%); }
.upload-icon svg { width: 27px; height: 30px; }
.file-info { display: flex; align-items: center; gap: 15px; min-width: 0; padding: 17px; border: 1px solid #d9e3f0; border-radius: 11px; background: #f1f5fb; }
.file-info > svg { width: 27px; height: 32px; flex-shrink: 0; color: var(--accent); stroke-width: 1.5; }
.file-info strong, .file-title { display: block; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.file-meta { color: var(--muted); font-size: 11px; margin-top: 4px; overflow-wrap: anywhere; }
.file-info .button { flex-shrink: 0; }
.formats { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 18px; }
.format-chip { display: inline-flex; align-items: center; justify-content: center; min-height: 25px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--muted); font-size: 11px; line-height: 1.4; font-weight: 500; letter-spacing: .25px; }
.chapter-list { display: grid; margin-top: 22px; border-top: 1px solid var(--line); }
.chapter-row { display: flex; align-items: center; gap: 11px; min-width: 0; min-height: 52px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px; line-height: 1.6; }
.chapter-row > span, .chapter-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.chapter-row small, .chapter-meta { flex-shrink: 0; color: var(--muted); font-size: 11px; }
.chapter-row .button { flex-shrink: 0; font-size: 11px; }
.chapter-row:has(input:disabled) { opacity: .55; }
.chapter-tools { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 17px; }
.voice-tariffs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.voice-tariff { min-height: 42px; padding: 7px 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--muted); font-size: 13px; }
.voice-tariff[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-hover); }
.voice-list { max-height: clamp(15rem, 47vh, 26rem); margin-top: 12px; padding: 3px; overflow-y: auto; scrollbar-gutter: stable; }
.voice-family { display: grid; gap: 8px; }
.voice-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 15px; padding: 17px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); transition: background-color .15s, border-color .15s; }
.voice-card.selected, .voice-card[aria-selected="true"] { border-color: var(--accent); background: #f4f7fd; }
.voice-pick, .voice-select { display: flex; align-items: center; gap: 14px; min-width: 0; width: 100%; min-height: 44px; padding: 0; border: 0; background: transparent; text-align: left; color: var(--text); }
.voice-avatar { display: grid; place-items: center; width: 42px; height: 46px; flex: 0 0 auto; border-radius: 16px 16px 16px 4px; background: var(--soft); color: var(--accent); font-size: 23px; font-weight: 400; }
.voice-name { display: block; font-size: 14px; font-weight: 600; }
.voice-description, .voice-caption { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.voice-card .radio-mark { width: 15px; height: 15px; flex-shrink: 0; border: 1px solid var(--line-strong); border-radius: 50%; margin-left: auto; }
.voice-card.selected .radio-mark { border: 5px solid var(--accent); }
.voice-play { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; padding: 0; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface); color: var(--accent); font-size: 15px; }
.voice-play:hover:not(:disabled) { background: var(--accent-soft); border-color: #afc0df; }
.voice-play:disabled { opacity: .45; }
.voice-play svg { width: 16px; height: 16px; }
.voice-card audio { grid-column: 1 / -1; width: 100%; max-width: 100%; height: 34px; }
.voice-selection-note { margin-top: 17px; font-size: 12px; color: var(--accent); }
.summary > .card, .summary.card { background: var(--soft); border-color: transparent; box-shadow: none; padding: 24px 22px; }
.summary h2, .summary h3 { margin-bottom: 20px; font-size: 16px; font-weight: 600; }
.summary-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 17px; padding-block: 6px; font-size: 12px; line-height: 1.7; }
.summary-row > :first-child { color: var(--muted); }
.summary-row > :last-child { max-width: 62%; margin: 0; text-align: right; overflow-wrap: anywhere; }
.summary-row .button.link { min-height: 0; font-size: 11px; }
.summary-divider { border-top: 1px solid #d4deed; margin-block: 19px; }
.summary-note { color: var(--muted); font-size: 11px; line-height: 1.8; margin-top: 12px; }
.summary .button:not(.link) { width: 100%; margin-top: 16px; }
.summary-empty { padding: 25px 23px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--muted); font-size: 12px; line-height: 1.8; background: #f1f4f9; }
.summary-empty strong { display: block; color: var(--text); font-size: 14px; font-weight: 500; margin-bottom: 9px; }
.price { display: block; font-size: 34px; font-weight: 600; line-height: 1.25; letter-spacing: -1.3px; color: var(--text); font-variant-numeric: tabular-nums; }
.price.pending { font-size: 15px; line-height: 1.7; letter-spacing: 0; font-weight: 400; color: var(--muted); }
.order-total { display: grid; gap: 7px; padding-top: 22px; margin-top: 23px; border-top: 1px solid var(--line); }
.book-cover { display: flex; flex-direction: column; justify-content: space-between; gap: 13px; width: 104px; min-height: 139px; padding: 17px 13px; background: var(--accent); border-left: 4px solid #3d568b; border-radius: 2px 8px 8px 2px; color: white; font: 400 18px/1.3 "PT Serif", Georgia, serif; box-shadow: 4px 6px 13px rgb(49 70 109 / 8%); }
.book-cover small { color: #e6ecf8; font: 400 11px/1.5 Manrope, sans-serif; letter-spacing: 1px; text-transform: uppercase; }
.book-overview { display: flex; align-items: center; gap: 21px; margin-bottom: 25px; }
.book-overview h2 { font-size: 23px; margin-bottom: 7px; }
.notice { display: flex; align-items: flex-start; gap: 10px; padding: 13px 15px; border: 1px solid #dce6f5; border-radius: 9px; background: #f0f5fc; color: #4c6284; font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.notice > svg { width: 17px; height: 17px; margin-top: 2px; }
.notice.error { background: #fff1ee; border-color: #f1d8d3; color: #8f4038; }
.notice.warning { background: #fff8e9; border-color: #efdfbc; color: #79602c; }
.notice.success { background: #eff7f1; border-color: #d5e8da; color: #47634d; }
.notice + .notice { margin-top: 10px; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 13px; padding: 28px 20px; text-align: center; }
.empty-state h2 { font-size: 22px; font-weight: 500; }
.empty-state p { max-width: 450px; color: var(--muted); font-size: 13px; line-height: 1.85; }
.empty-state > svg { width: 40px; height: 44px; color: var(--accent); stroke-width: 1.3; margin-bottom: 6px; }
.spinner { display: inline-block; width: 20px; height: 20px; flex-shrink: 0; border: 2px solid #d6e1f1; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.spinner.large { width: 33px; height: 33px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress-track { height: 6px; background: var(--soft); border-radius: 8px; overflow: hidden; }
.progress-fill { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .2s; }
.processing-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 15px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.processing-row.active { color: var(--accent); }
dialog.editor, dialog.modal { width: min(850px, calc(100% - 32px)); max-height: min(90dvh, 900px); padding: 28px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); color: var(--text); box-shadow: 0 25px 100px rgb(24 42 72 / 18%); }
dialog.editor::backdrop, dialog.modal::backdrop { background: rgb(25 39 61 / 32%); }
.editor-header, .modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.editor-header h2, .modal-header h2 { font-size: 23px; font-weight: 500; }
.close-button { display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--muted); font-size: 21px; line-height: 1; }
.editor-toolbar { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 16px; margin-bottom: 17px; }
.editor-toolbar .field { flex: 1; min-width: min(200px, 100%); }
.editor textarea { display: block; width: 100%; min-height: 320px; padding: 19px; border: 1px solid var(--line-strong); border-radius: 10px; resize: vertical; color: var(--text); background: #fbfcfe; font-size: 15px; line-height: 1.9; }
.editor .chapter-list { max-height: 220px; overflow-y: auto; }
.editor .actions { margin-top: 22px; }
.toast { position: fixed; z-index: 100; right: 24px; bottom: 24px; width: max-content; max-width: min(430px, calc(100% - 48px)); padding: 15px 19px; border: 1px solid var(--line-strong); border-radius: 11px; color: var(--text); background: var(--surface); box-shadow: 0 12px 40px rgb(26 49 85 / 13%); font-size: 12px; line-height: 1.75; overflow-wrap: anywhere; }
.toast.error { border-color: #ecc5bf; background: #fff6f3; color: #8f4038; }
.toast.success { border-color: #c7dfcf; color: #47634d; }
.legal-workspace { max-width: 760px; }
.legal-back { display: inline-block; font-size: 13px; }
.legal-heading { margin: 26px 0 22px; overflow-wrap: anywhere; }
.legal-article { font-size: 15px; line-height: 1.75; overflow-wrap: anywhere; }
.legal-article h2:not(:first-child), .legal-article section + section { margin-top: 28px; }
.legal-article p + p, .legal-article h2 + p { margin-top: 9px; }
.legal-article ul, .legal-article ol { padding-inline-start: 1.4em; }
.contact-details { display: grid; grid-template-columns: auto 1fr; gap: 8px 20px; margin: 18px 0 0; }
.contact-details dt { color: var(--muted); }
.contact-details dd { margin: 0; }
.footer-owner { display: grid; align-content: start; gap: 2px; }
.footer-nav { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 4px 18px; }
.footer-nav a, .footer-owner a { font-size: 12px; }
@media (max-width: 480px) {
  .contact-details { grid-template-columns: 1fr; gap: 0; }
  .contact-details dd + dt { margin-top: 10px; }
}
.app-footer { margin-top: auto; border-top: 1px solid var(--line); }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; padding-block: 24px; color: var(--muted); font-size: 11px; }
.skip-link { position: fixed; top: 10px; left: 10px; transform: translateY(-150%); z-index: 1000; padding: 10px 15px; border-radius: 7px; background: var(--accent); color: white; text-decoration: none; }
.skip-link:focus { transform: none; }
.noscript-message { padding: 20px; text-align: center; background: #fff4dd; color: #765a29; }
@media (min-width: 1280px) {
  .workspace-grid { grid-template-columns: minmax(0, 1fr) 300px; gap: 30px; }
  .workspace { padding-top: 46px; }
  .card { padding: 32px; }
  .file-drop { min-height: 290px; }
}
@media (max-width: 1000px) {
  .header-inner, .workspace, .footer-inner { width: calc(100% - 56px); }
  .header-caption { display: none; }
  .workspace-grid { grid-template-columns: minmax(0, 1fr) 246px; gap: 21px; }
  .card { padding: 24px; }
  .summary > .card, .summary.card { padding: 23px 19px; }
  .steps { gap: 23px; }
  .step-caption { display: none; }
}
@media (max-width: 820px) {
  .workspace-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .summary { grid-template-columns: minmax(0, 1fr); }
  .summary > .card { padding: 24px; }
  .workflow-heading { align-items: flex-start; flex-direction: column; gap: 20px; padding-bottom: 25px; }
  .steps { width: min(100%, 540px); justify-content: space-between; gap: 18px; }
  .page-intro { padding-block: 29px 24px; }
  .workspace { padding-block: 31px 44px; }
  .summary-empty { padding: 21px 24px; }
  .summary .book-cover { display: none; }
}
@media (max-width: 540px) {
  .header-inner, .workspace, .footer-inner { width: calc(100% - 36px); }
  .header-inner { min-height: 77px; gap: 13px; }
  .brand { gap: 8px; font-size: 19px; letter-spacing: -.85px; }
  .brand-symbol { width: 28px; height: 32px; border-radius: 9px 9px 9px 3px; font-size: 26px; }
  .header-meta { gap: 0; }
  .version-badge { padding: 5px 7px; gap: 5px; font-size: 11px; }
  .workspace { padding-top: 26px; }
  .workflow-heading { gap: 17px; padding-bottom: 21px; }
  .eyebrow { font-size: 11px; letter-spacing: 1.35px; }
  .steps { gap: 10px; }
  .step { gap: 7px; font-size: 11px; }
  .step-number, .step-index, .step > span:first-child:not(.step-copy) { width: 27px; height: 27px; font-size: 11px; }
  .page-intro { padding-block: 26px 21px; }
  .page-title { font-size: 28px; line-height: 1.3; letter-spacing: -.95px; }
  .page-subtitle { font-size: 12px; line-height: 1.85; margin-top: 10px; }
  .card { padding: 22px 18px; border-radius: 13px; }
  .card-header { gap: 12px; margin-bottom: 20px; }
  h2 { font-size: 18px; }
  .file-drop { min-height: 255px; padding: 29px 16px; gap: 13px; }
  .file-drop strong, .drop-title { font-size: 16px; }
  .file-drop .button { min-width: 165px; }
  .file-info { padding: 14px; gap: 11px; flex-wrap: wrap; }
  .file-info > svg { width: 22px; height: 27px; }
  .file-info .grow { flex-basis: 170px; }
  .file-info .button.link { margin-left: 33px; }
  .field-grid { grid-template-columns: 1fr; gap: 18px; }
  .field input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]), .field select, .field textarea, input.text-input, select.select-input { font-size: 16px; }
  .chapter-row { align-items: flex-start; gap: 9px; padding-block: 13px; font-size: 12px; }
  .chapter-row input { margin-top: 3px; }
  .chapter-row small, .chapter-meta { font-size: 11px; padding-top: 2px; }
  .chapter-row .button { font-size: 11px; }
  .voice-card { gap: 10px; padding: 13px 11px; }
  .voice-pick, .voice-select { gap: 10px; }
  .voice-avatar { width: 35px; height: 41px; border-radius: 14px 14px 14px 4px; font-size: 21px; }
  .voice-name { font-size: 13px; }
  .voice-description, .voice-caption { font-size: 11px; }
  .voice-play { width: 44px; height: 44px; }
  .voice-card .radio-mark { width: 13px; height: 13px; }
  .voice-card.selected .radio-mark { border-width: 4px; }
  .actions { gap: 14px; margin-top: 23px; padding-top: 21px; }
  .actions > .button:not(.link) { flex: 1 1 100%; }
  .actions > .button.link { order: 1; }
  .summary > .card, .summary.card { padding: 23px 20px; }
  .price { font-size: 31px; }
  .book-cover { width: 81px; min-height: 112px; padding: 13px 10px; font-size: 16px; }
  .book-overview { gap: 15px; }
  .book-overview h2 { font-size: 20px; }
  .notice { padding: 12px 13px; font-size: 11px; }
  .empty-state { padding: 20px 6px; }
  .empty-state h2 { font-size: 20px; }
  dialog.editor, dialog.modal { width: calc(100% - 24px); max-height: 92dvh; padding: 22px 17px; border-radius: 13px; }
  .editor-header, .modal-header { gap: 12px; margin-bottom: 20px; }
  .editor-header h2, .modal-header h2 { font-size: 21px; }
  .editor textarea { min-height: 280px; padding: 15px; font-size: 16px; line-height: 1.85; }
  .editor .actions .button { width: 100%; }
  .toast { right: 16px; bottom: 16px; max-width: calc(100% - 32px); padding: 14px 16px; }
  .footer-inner { padding-block: 21px; gap: 8px; flex-direction: column; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
  .spinner { animation: none; }
}

/* Live application components: import, editing, voice choice and quote. */
.step.active:disabled, .step[aria-current="step"]:disabled { color: var(--accent); }
.step:disabled .step-caption { color: var(--muted); }
.step:disabled .step-number { opacity: 1; }
.upload-symbol { display: grid; place-items: center; width: 56px; height: 60px; margin-bottom: 2px; border: 1px solid var(--line); border-radius: 18px 18px 18px 5px; color: var(--accent); background: var(--surface); font-size: 30px; font-weight: 400; line-height: 1; box-shadow: 0 4px 12px rgb(53 78 117 / 3%); }
.file-drop { gap: 12px; }
.file-drop > h2 { font-size: 21px; font-weight: 500; letter-spacing: -.55px; }
.file-drop > .button.link { margin-top: 0; }
.format-chips { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.format-chip.warning { color: #79602c; background: #fff7e6; border-color: #ead7ae; letter-spacing: 0; }
.file-format { display: grid; place-items: center; flex-shrink: 0; min-width: 47px; max-width: 74px; min-height: 49px; padding: 7px; border: 1px solid #d1deef; border-left: 3px solid var(--accent); border-radius: 4px 9px 9px 4px; color: var(--accent); background: var(--surface); font-size: 11px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.metadata-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin-top: 23px; }
.metadata-grid > .field + .field { margin-top: 0; }
.card > .notice { margin-top: 20px; }
.notice:has(> ul) { display: block; }
.notice > strong { font-weight: 600; }
.notice > ul { margin: 7px 0 0; padding-left: 19px; }
.notice li + li { margin-top: 5px; }
.chapter-list { max-height: 340px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #c4d0e3 transparent; }
.chapter-row { transition: background-color .15s; }
.chapter-open { flex: 1; min-width: 0; min-height: 34px; padding: 5px 0; border: 0; border-radius: 4px; background: transparent; color: var(--text); font-size: 13px; line-height: 1.65; text-align: left; overflow-wrap: anywhere; }
.chapter-open:hover { color: var(--accent-hover); }
.chapter-row.current { background: #f0f5fd; }
.chapter-row.current .chapter-open { color: var(--accent); font-weight: 600; }
.chapter-row.current input { margin-left: 9px; }
.chapter-row.current .chapter-meta { padding-right: 9px; }
.editor { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--line); }
.editor-toolbar h3 { font-size: 15px; }
.editor-toolbar > .small { max-width: 260px; text-align: right; font-size: 11px; line-height: 1.7; }
.editor .field input { font-weight: 500; }
.editor .field textarea { min-height: 340px; padding: 18px; background: #fbfcfe; font-size: 14px; line-height: 1.95; font-weight: 400; }
.editor .summary-note { margin-top: 12px; }
.editor-dialog { width: min(760px, calc(100% - 40px)); max-height: 88dvh; overflow-y: auto; padding: 29px; border: 1px solid var(--line); border-radius: 17px; color: var(--text); background: var(--surface); box-shadow: 0 25px 100px rgb(24 42 72 / 18%); }
.editor-dialog:has(.profile-account) { max-width: 460px; }
.editor-dialog::backdrop { background: rgb(25 39 61 / 32%); }
.editor-dialog .editor-header { align-items: center; margin-bottom: 9px; }
.editor-dialog .close-button { width: 40px; height: 40px; }
.format-list { display: grid; gap: 0; }
.format-detail { min-width: 0; padding: 18px 0; border-bottom: 1px solid var(--line); }
.format-detail > .inline { gap: 9px; }
.format-detail strong { font-size: 14px; font-weight: 600; }
.format-detail > p { margin-top: 7px; line-height: 1.8; overflow-wrap: anywhere; }
.format-detail .format-chip { font-size: 11px; }
.format-list > .notice { margin-top: 22px; }
.voice-copy { flex: 1; min-width: 0; }
.voice-name, .voice-description { overflow-wrap: anywhere; }
.voice-intro { max-width: 570px; font-size: 12px; line-height: 1.85; }
.voice-card .sample-note { grid-column: 1 / -1; margin-left: 56px; margin-top: -8px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.voice-play:disabled { opacity: 1; color: var(--muted); border-color: var(--line); background: #f5f7fb; }
.sample-progress { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 15px; margin-top: 20px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 9px; background: #f7f9fd; }
.sample-progress input { width: 100%; min-width: 0; height: 23px; margin: 0; }
.sample-time { white-space: nowrap; font-size: 11px; font-variant-numeric: tabular-nums; }
.chosen-voice { margin-top: 20px; color: var(--accent); font-size: 12px; font-weight: 500; }
.summary-card > .book-cover { margin: 0 auto 25px; }
.summary-card h3 { margin-bottom: 7px; overflow-wrap: anywhere; }
.summary-card .source-name { margin-bottom: 18px; color: var(--muted); font-size: 11px; line-height: 1.85; overflow-wrap: anywhere; }
.book-cover > span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font: 500 11px/1.5 Manrope, sans-serif; letter-spacing: .15px; }
.book-cover > strong { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; font-weight: 400; white-space: pre-line; overflow-wrap: anywhere; }
.summary-card .summary-note { margin-top: 16px; }
.summary-price { display: grid; gap: 8px; margin-top: 20px; padding-top: 19px; border-top: 1px solid #d1dced; }
.summary-price .price { font-size: 28px; }
.order-details { display: grid; gap: 0; margin: 25px 0 0; }
.order-details > .summary-row { padding-block: 13px; border-bottom: 1px solid var(--line); font-size: 13px; }
.order-details > .summary-row:last-child { border-bottom: 0; }
.order-details .summary-row > :last-child { max-width: 64%; }
.order-total .button { margin-top: 11px; }
.recent-book.button.link { display: flex; justify-content: space-between; width: 100%; min-height: 45px; padding: 12px 0; border-bottom: 1px solid var(--line); border-radius: 0; font-size: 12px; line-height: 1.75; text-align: left; overflow-wrap: anywhere; }
.recent-book.button.link::after { content: "↗"; margin-left: 12px; color: var(--muted); flex-shrink: 0; }
.recent-book.button.link:last-child { border-bottom: 0; }
.card > h3:has(+ .recent-book) { margin-bottom: 8px; }
.card.small > .button.link { margin-top: 10px; }
.save-error { color: #8f4038; }
.actions > #save-state { max-width: 330px; line-height: 1.8; }
.empty-state { min-height: 230px; }
.empty-state .spinner { width: 29px; height: 29px; margin-block: 3px 5px; border-width: 3px; }

@media (max-width: 820px) {
  .summary-card > .book-cover { display: none; }
  .summary-card .source-name { margin-bottom: 14px; }
  .summary-price { grid-template-columns: 1fr auto; align-items: center; gap: 15px; }
}
@media (max-width: 540px) {
  .metadata-grid { grid-template-columns: minmax(0, 1fr); gap: 17px; margin-top: 20px; }
  .file-info .button.link { margin-left: 0; }
  .file-info .grow { flex-basis: 170px; }
  .file-format { min-width: 43px; min-height: 46px; max-width: 63px; padding: 6px; }
  .file-drop { padding-inline: 14px; }
  .file-drop > h2 { font-size: 20px; }
  .format-chips { gap: 5px; }
  .chapter-list { max-height: 315px; }
  .chapter-row { align-items: center; gap: 9px; }
  .chapter-row input { margin-top: 0; }
  .chapter-open { min-height: 40px; font-size: 12px; }
  .chapter-row.current input { margin-left: 6px; }
  .chapter-row.current .chapter-meta { padding-right: 6px; }
  .chapter-meta { max-width: 65px; font-size: 11px; line-height: 1.6; text-align: right; }
  .editor { margin-top: 23px; padding-top: 22px; }
  .editor-toolbar { align-items: flex-start; flex-direction: column; gap: 5px; }
  .editor-toolbar > .small { max-width: none; text-align: left; }
  .editor .field textarea { min-height: 300px; padding: 14px; font-size: 16px; line-height: 1.8; }
  .editor-dialog { width: calc(100% - 24px); max-height: 92dvh; padding: 22px 18px; border-radius: 13px; }
  .editor-dialog .editor-header h2 { font-size: 20px; }
  .editor-dialog .close-button { width: 44px; height: 44px; }
  .format-detail { padding-block: 16px; }
  .format-detail > .inline { align-items: flex-start; flex-direction: column; gap: 7px; }
  .voice-card .sample-note { margin-left: 45px; font-size: 11px; }
  .sample-progress { gap: 11px; padding: 11px 12px; }
  .order-details > .summary-row { gap: 15px; font-size: 12px; }
  .order-details .summary-row > :last-child { max-width: 60%; }
  .order-total .price { font-size: 32px; }
  .actions > #save-state { max-width: none; }
  .summary-price .price { font-size: 27px; }
  .recent-book.button.link { min-height: 48px; }
}
.mode-card { padding-block: 20px; }
.mode-options { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; border: 0; }
.mode-options legend { margin-bottom: 12px; padding: 0; font-weight: 600; }
.mode-options label { display: inline-flex; gap: 8px; align-items: center; min-height: 44px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; font-size: 13px; }
.mode-options label:has(:checked) { background: #f4f7fd; border-color: var(--accent); }
.mode-options input { margin: 0; accent-color: var(--accent); }
.cast-list { margin-top: 16px; }
.cast-row { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(132px, 1fr) auto; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.cast-name { overflow-wrap: anywhere; font-size: 14px; font-weight: 500; }
.voice-description, .cast-profile { display: block; margin: 5px 0 0; color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.6; }
.cast-profile { grid-column: 2 / -1; margin-top: -7px; }
@media (max-width: 540px) { .cast-profile { grid-column: 1 / -1; } }
.cast-review { display: grid; justify-items: start; gap: 12px; margin-top: 18px; }
.cast-lines { max-height: min(56dvh, 580px); margin: 16px 0; overflow: auto; }
.cast-line { display: grid; grid-template-columns: minmax(0, 1fr) minmax(125px, 30%); gap: 15px; align-items: start; border-top: 1px solid var(--line); padding: 12px 2px; }
.cast-line p { align-self: center; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
.cast-pagination { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
@media (max-width: 540px) {
  .cast-row { grid-template-columns: minmax(0, 1fr) auto; }
  .cast-name { grid-column: 1 / -1; }
  .cast-line { grid-template-columns: 1fr; gap: 7px; padding-block: 14px; }
  .cast-pagination .button { padding-inline: 10px; }
}

.profile-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 27px; }
.profile-link { min-height: 38px; padding: 7px 14px; }
.profile-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; grid-template-areas: "shelf account"; gap: 27px; align-items: start; }
.profile-shelf { grid-area: shelf; min-width: 0; display: grid; gap: 18px; }
.profile-account { grid-area: account; }
.profile-account h2 { overflow-wrap: anywhere; }
.profile-account .field { margin-top: 15px; }
.profile-account .field input { min-width: 0; }
.profile-account .button.full { margin-top: 20px; }
.profile-account .button.link { margin-top: 10px; }
.profile-feedback-text { margin-bottom: 12px; }
.profile-form-error:not(:empty) { margin-top: 12px; color: var(--danger, #953d42); }
.profile-empty { padding-top: 14px; color: var(--muted); }
.profile-book, .profile-job { padding: 20px 0; }
.profile-book + .profile-book, .profile-job + .profile-job { border-top: 1px solid var(--line); }
.profile-book:last-child, .profile-job:last-child { padding-bottom: 0; }
.profile-book-header { display: flex; gap: 12px; align-items: start; }
.profile-book h3, .profile-book p, .profile-job p, .profile-audio li { overflow-wrap: anywhere; }
.profile-book-title { color: var(--text); text-decoration: none; }
.profile-book-title:hover { color: var(--accent); text-decoration: underline; }
.profile-book-actions { margin-top: 10px; gap: 18px; }
.profile-audio { margin: 15px 0 0; padding: 0; list-style: none; }
.profile-audio li { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 18px; padding: 5px 0; }
.profile-audio a { flex: none; }
.profile-job progress { display: block; width: 100%; height: 7px; margin-top: 7px; accent-color: var(--accent); }
#profile-feedback:empty { display: none; }
@media (max-width: 820px) {
  .profile-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "account" "shelf"; gap: 18px; }
  .profile-link { min-height: 36px; }
}
@media (max-width: 540px) {
  .profile-heading { flex-wrap: wrap; }
  .profile-audio li { align-items: start; flex-wrap: wrap; }
}
