:root {
  color-scheme: light;
  --paper: #f7f4ee;
  --card: #fffcf7;
  --ink: #29312c;
  --muted: #737a72;
  --line: #deded4;
  --soft-line: #ecebe4;
  --accent: #a4543d;
  --accent-dark: #87402e;
  --accent-pale: #f2e6df;
  --sage: #667762;
  --danger: #a13e35;
  --shadow: 0 16px 50px rgba(63, 54, 38, .045);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}
.file-import { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.file-import input { max-width: 100%; font-size: 12px; }
.fallback-actions { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 12px; }
.import-fallback { border-left: 3px solid var(--accent); padding-left: 14px; margin-top: 16px; }
#cancel-load-button, #clear-downloads-button { margin-top: 15px; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); min-width: 320px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: inherit; }
:focus-visible { outline: 3px solid #bd765d; outline-offset: 3px; }
[hidden] { display: none !important; }

.site-shell { max-width: 1320px; padding: 0 42px; margin: 0 auto; }
.site-header { height: 90px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.brand { font-family: Georgia, "Times New Roman", serif; font-size: 42px; letter-spacing: -.085em; line-height: 1; text-decoration: none; font-weight: 700; padding-bottom: 7px; }
.brand span, .footer-period { color: var(--accent); }
.header-right { display: flex; align-items: center; gap: 26px; }
.header-note { color: var(--muted); font-family: Georgia, "Times New Roman", serif; font-style: italic; font-size: 15px; }
.local-badge { display: inline-flex; align-items: center; gap: 9px; color: var(--sage); border: 1px solid #d6ded0; border-radius: 100px; padding: 9px 14px; font-size: 11px; letter-spacing: .11em; text-transform: uppercase; font-weight: 700; white-space: nowrap; }
.badge-dot { width: 7px; height: 7px; border-radius: 50%; background: #829a77; box-shadow: 0 0 0 3px #e2eadb; }

.intro { min-height: 290px; display: flex; align-items: center; justify-content: space-between; position: relative; padding: 39px 8px 38px; }
.eyebrow, .section-number, .mini-label { font-size: 11px; font-weight: 750; letter-spacing: .19em; color: var(--accent); margin: 0; }
.eyebrow { display: flex; align-items: center; gap: 13px; margin-bottom: 22px; }
.eyebrow-rule { height: 1px; width: 25px; background: var(--accent); }
h1, h2, p { margin-top: 0; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
h1 { font-size: clamp(44px, 5.3vw, 71px); line-height: 1.04; letter-spacing: -.055em; margin: 0 0 20px; }
h1 em { color: var(--accent); font-weight: 400; }
.intro-description { color: #666c65; font-size: 15px; line-height: 1.7; max-width: 450px; margin: 0; }
.intro-mark { width: 202px; height: 202px; border: 1px solid #e6dacd; border-radius: 50%; display: grid; place-items: center; margin-right: 30px; color: #dbbca9; transform: rotate(-13deg); }
.intro-mark span { font-family: Georgia, "Times New Roman", serif; font-size: 194px; line-height: 1; margin: 41px 13px 0 0; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(360px, .88fr); gap: 20px; align-items: start; }
.right-column { display: grid; gap: 20px; min-width: 0; }
.card { background: var(--card); border: 1px solid #e7e4da; border-radius: 10px; box-shadow: var(--shadow); }
.source-card, .voice-card { padding: 33px 34px 32px; }
.card-heading, .listen-header { display: flex; justify-content: space-between; align-items: start; }
.section-number { margin-bottom: 12px; }
h2 { font-size: 31px; letter-spacing: -.04em; line-height: 1.17; margin-bottom: 0; }
.section-symbol { color: #d2ad98; font-size: 28px; line-height: 1; margin-top: 5px; }
.sound-symbol { font-family: Georgia, serif; font-size: 27px; transform: rotate(-10deg); letter-spacing: -.18em; padding-right: 6px; }

.source-tabs { display: flex; border-bottom: 1px solid var(--line); gap: 30px; margin-top: 38px; margin-bottom: 26px; }
.source-tab { border: 0; border-bottom: 2px solid transparent; padding: 0 0 14px; background: transparent; color: #7c8079; font-size: 13px; font-weight: 650; }
.source-tab:hover { color: var(--accent); }
.source-tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.field-label { display: block; font-size: 12px; color: var(--ink); font-weight: 750; margin-bottom: 12px; }
textarea, input[type="url"], input[type="text"], select { color: var(--ink); border: 1px solid #deddd2; border-radius: 5px; background: #fffefa; transition: border-color .15s, box-shadow .15s; }
textarea:hover, input[type="url"]:hover, input[type="text"]:hover, select:hover { border-color: #bcbfb1; }
textarea:focus, input[type="url"]:focus, input[type="text"]:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px #ead7cb; }
textarea { display: block; width: 100%; min-height: 400px; resize: vertical; padding: 18px 19px; line-height: 1.75; font-size: 15px; }
textarea::placeholder, input::placeholder { color: #a4a69e; }
.editor-footer { min-height: 37px; display: flex; align-items: end; justify-content: space-between; gap: 12px; color: #92968d; font-size: 12px; }
.text-action { padding: 0; color: var(--accent); font-size: 12px; font-weight: 700; border: 0; background: transparent; text-align: left; }
.text-action:hover, .download-link:hover { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 3px; }
.text-action span { font-size: 16px; margin-left: 3px; }
.url-row { display: flex; gap: 9px; }
input[type="url"], input[type="text"] { min-width: 0; width: 100%; height: 47px; padding: 0 13px; font-size: 14px; }
.secondary-button, .outline-button { flex: none; height: 47px; border: 1px solid var(--accent); border-radius: 5px; background: var(--accent-pale); color: var(--accent-dark); font-size: 12px; font-weight: 750; padding: 0 17px; transition: background .15s, transform .15s; }
.secondary-button:hover, .outline-button:hover { background: #ebd8cd; transform: translateY(-1px); }
.secondary-button:disabled, .outline-button:disabled { opacity: .6; transform: none; }
.secondary-button span { margin-left: 8px; font-size: 16px; }
.field-hint { font-size: 12px; line-height: 1.5; margin: 11px 0 0; color: var(--muted); }
.extracted-content { margin-top: 27px; padding-top: 25px; border-top: 1px solid var(--soft-line); }
.extracted-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; margin-bottom: 21px; }
.extracted-heading strong { font-family: Georgia, serif; font-weight: 400; font-size: 18px; }
.mini-label { font-size: 9px; }
.extracted-content textarea { min-height: 310px; }
.inline-message { border-radius: 4px; background: #f9eee7; color: var(--accent-dark); padding: 11px 13px; margin: 15px 0 0; font-size: 12px; line-height: 1.5; }
.inline-message.is-error { background: #f9e9e7; color: var(--danger); }

.voice-card { padding-bottom: 24px; }
.voice-card .card-heading { margin-bottom: 31px; }
.field-group { margin-bottom: 24px; }
.label-note { float: right; font-size: 11px; font-weight: 500; color: #92968e; }
.select-wrap { position: relative; }
.select-wrap:after { content: "⌄"; pointer-events: none; position: absolute; right: 16px; top: 7px; color: var(--accent); font-size: 24px; }
select { appearance: none; width: 100%; height: 47px; padding: 0 40px 0 14px; font-size: 14px; }
.range-label, .model-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.range-label .field-label, .model-heading .field-label { margin-bottom: 0; }
#speed-output { color: var(--accent); font-size: 13px; font-weight: 750; }
input[type="range"] { width: 100%; margin: 17px 0 7px; height: 5px; cursor: pointer; accent-color: var(--accent); }
.range-ends { display: flex; justify-content: space-between; font-size: 11px; color: #969990; }
.speed-group input:disabled { opacity: .48; cursor: not-allowed; }
.speed-group .field-hint { margin-bottom: 0; }
.model-block { padding: 0 0 24px; margin-bottom: 24px; border-bottom: 1px solid var(--soft-line); }
.model-state { color: var(--sage); font-size: 11px; font-weight: 700; }
.model-state.is-error { color: var(--danger); }
.model-block > .select-wrap { margin-top: 14px; }
.model-description { color: var(--muted); font-size: 11px; line-height: 1.5; margin: 11px 0 0; }
.model-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.model-meta span { display: inline-flex; align-items: center; padding: 4px 7px; border-radius: 3px; background: #f2efe8; color: #6f756b; font-size: 10px; line-height: 1.2; }
.model-repo-link { display: inline-block; margin-top: 10px; color: var(--accent); font-size: 11px; font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
.model-repo-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.model-setup { margin-top: 15px; border: 1px solid #eee8df; border-radius: 5px; background: #f9f6f0; padding: 12px; }
.setup-topline { display: flex; justify-content: space-between; gap: 8px; color: #777c72; font-size: 11px; line-height: 1.4; }
#model-percent { color: var(--accent); font-weight: 750; white-space: nowrap; }
.progress-track { height: 5px; border-radius: 10px; background: #e8e6dc; overflow: hidden; margin-top: 10px; }
.progress-track > span { display: block; width: 0; height: 100%; background: var(--accent); border-radius: inherit; transition: width .25s ease; }
.outline-button { width: 100%; margin-top: 12px; height: 36px; font-size: 11px; }
.outline-button span { margin-left: 5px; font-size: 15px; }
.custom-model { margin-top: 18px; border-top: 1px solid var(--soft-line); padding-top: 14px; }
.custom-model summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--accent); font-size: 12px; font-weight: 750; cursor: pointer; list-style: none; }
.custom-model summary::-webkit-details-marker { display: none; }
.custom-model summary::before { content: "+"; font-size: 17px; font-weight: 400; line-height: .7; }
.custom-model[open] summary::before { content: "−"; }
.custom-model summary span { margin-left: auto; color: #969990; font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: .1em; }
.custom-model form { padding-top: 21px; }
.custom-model input[type="text"] { font-size: 12px; height: 42px; }
.custom-model .field-label { margin-bottom: 8px; }
.custom-model-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 15px; }
.custom-model-row > div { min-width: 0; }
.custom-model-row select { height: 42px; padding-left: 11px; font-size: 12px; }
.custom-model .field-hint { margin-top: 12px; }
.custom-model .outline-button { margin-top: 15px; }
.custom-model .inline-message { margin-top: 11px; }
.select-wrap select:disabled { opacity: .62; }
.primary-button { width: 100%; border: 0; border-radius: 5px; background: var(--accent); color: #fffdf9; height: 51px; display: flex; align-items: center; gap: 13px; padding: 0 18px; text-align: left; font-weight: 750; font-size: 13px; transition: background .15s, transform .15s; }
.primary-button:not(:disabled):hover { background: var(--accent-dark); transform: translateY(-1px); }
.primary-button:disabled { opacity: .57; }
.button-icon { font-size: 13px; }
.button-arrow { font-size: 21px; margin-left: auto; font-weight: 400; }
.privacy-note { text-align: center; font-size: 11px; color: #92958c; margin: 14px 0 0; }
.privacy-note span { color: var(--sage); margin-right: 3px; }

.listen-card { padding: 28px 32px 25px; }
.listen-header h2 { font-size: 27px; }
.listen-decoration { font-family: Georgia, serif; font-size: 23px; color: #cfad96; }
.empty-player { min-height: 117px; display: flex; flex-direction: column; justify-content: center; align-items: center; margin-top: 11px; color: #93968f; font-family: Georgia, serif; font-style: italic; font-size: 14px; }
.empty-player p { margin: 12px 0 0; }
.empty-wave { height: 29px; display: flex; align-items: center; gap: 3px; }
.empty-wave i { display: block; width: 3px; height: 8px; background: #d6c7ba; border-radius: 3px; }
.empty-wave i:nth-child(3n) { height: 20px; }.empty-wave i:nth-child(4n) { height: 14px; }.empty-wave i:nth-child(7n) { height: 26px; }
.active-player { margin-top: 28px; }
.job-line { display: flex; justify-content: space-between; font-size: 12px; color: var(--sage); font-weight: 700; }
.job-progress { margin-top: 10px; }
.current-passage { font-family: Georgia, serif; font-size: 17px; line-height: 1.4; margin: 19px 0 5px; min-height: 24px; overflow-wrap: anywhere; }
.chunk-count { color: var(--muted); font-size: 11px; margin: 0 0 20px; }
.player-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.play-button { width: 41px; height: 41px; border: 0; border-radius: 50%; background: var(--accent); color: white; font-size: 16px; display: grid; place-items: center; }
.play-button:hover:not(:disabled) { background: var(--accent-dark); }
.play-button:disabled, .icon-button:disabled { opacity: .45; }
.icon-button { width: 34px; height: 34px; background: transparent; border: 1px solid #ddd9cf; border-radius: 50%; color: var(--ink); font-size: 11px; }
.icon-button:hover:not(:disabled) { background: #f3eee7; }
.playback-status { color: var(--muted); font-size: 12px; margin: 12px 0 18px; }
.playback-timeline { margin: 18px 0 22px; }
.playback-timeline .field-label { margin-bottom: 0; }
#seek-range { height: 28px; margin: 4px 0 0; }
.playback-times { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.player-controls button { min-width: 44px; min-height: 44px; }
.player-controls .skip-button { font-size: 12px; font-weight: 700; }
.playback-speed { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.playback-speed .field-label { margin: 0; }
.playback-speed select { width: 100px; min-height: 44px; padding: 8px; }
.player-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 20px; margin-top: 20px; border-top: 1px solid var(--soft-line); }
.download-link { color: var(--accent); font-size: 12px; font-weight: 750; text-decoration: none; }
.download-link span { margin-left: 4px; font-size: 15px; }
.cancel-button { margin-left: auto; color: var(--muted); }

.site-footer { display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); color: #8d9189; margin-top: 70px; padding: 24px 4px 34px; font-size: 11px; }
.site-footer span:first-child { font-family: Georgia, serif; font-size: 13px; }

@media (max-width: 960px) {
  .site-shell { padding: 0 28px; }
  .workspace { grid-template-columns: 1fr; }
  .right-column { grid-template-columns: 1fr 1fr; align-items: start; }
  .intro-mark { width: 150px; height: 150px; margin: 0 15px 0 30px; }
  .intro-mark span { font-size: 145px; margin-top: 30px; }
}
@media (max-width: 720px) {
  .site-shell { padding: 0 18px; }
  .site-header { height: 70px; }.brand { font-size: 36px; }.header-note { display: none; }
  .intro { min-height: unset; padding: 48px 3px 43px; }.intro-mark { display: none; }
  h1 { font-size: clamp(40px, 10vw, 62px); }
  .right-column { grid-template-columns: 1fr; }
  .source-card, .voice-card { padding: 27px 23px; }.listen-card { padding: 27px 23px 22px; }
  textarea { min-height: 300px; }.source-tabs { margin-top: 30px; }
  .site-footer { margin-top: 45px; }
}
@media (max-width: 470px) {
  .url-row { flex-direction: column; }.secondary-button { width: 100%; }
  .custom-model-row { grid-template-columns: 1fr; gap: 13px; }
  .editor-footer { align-items: start; flex-direction: column; padding-top: 10px; }
  .site-footer { flex-direction: column; gap: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

.info-page { max-width: 800px; padding: 40px 24px 64px; margin: auto; line-height: 1.75; }
.info-page h1 { font-size: clamp(2.2rem, 7vw, 3.7rem); line-height: 1.15; margin: 40px 0 24px; }
.info-page h2 { font-size: 1.5rem; margin: 32px 0 12px; }
.info-page p, .info-page li { margin-bottom: 16px; }
.info-page nav { margin-top: 40px; }
.site-footer nav { line-height: 1.8; }

/* Paper, halftone colour, and a familiar listening surface. */
.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; }
.audio-background { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; image-rendering: pixelated; opacity: .42; z-index: -1; }
body { isolation: isolate; }
.site-shell { position: relative; }
.ambience-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 1px solid #d9cbbb; border-radius: 30px; background: #fffcf7b3; color: var(--accent-dark); font-size: 11px; }
.ambience-toggle span { font-size: 22px; }
.ambience-toggle[aria-pressed="false"] { color: var(--muted); background: var(--paper); }
.listen-card { background: #fffcf7f5; }
.empty-player { min-height: 64px; margin-bottom: 5px; }
.empty-wave { display: none; }
.active-player { margin-top: 20px; }
.current-passage { text-align: center; font-size: 19px; line-height: 1.5; max-height: 5.9em; overflow-y: auto; padding: 0 4px; }
.chunk-count { text-align: center; margin-bottom: 14px; }
.playback-timeline { margin: 12px 0 6px; }
#seek-range { --progress: 0%; appearance: none; display: block; background: transparent; height: 26px; margin: 0; }
#seek-range::-webkit-slider-runnable-track { height: 4px; border-radius: 8px; background: linear-gradient(to right, var(--accent) var(--progress), #e3ddd1 var(--progress)); }
#seek-range::-moz-range-track { height: 4px; border-radius: 8px; background: #e3ddd1; }
#seek-range::-moz-range-progress { height: 4px; border-radius: 8px; background: var(--accent); }
#seek-range::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; border-radius: 50%; margin-top: -4px; background: var(--accent); box-shadow: 0 0 0 4px #a4543d10; }
#seek-range::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--accent); }
#seek-range:disabled { opacity: .45; }
.playback-times { font-size: 11px; }
#seek-note { font-size: 10px; line-height: 1.4; text-align: center; margin-top: 10px; }
.player-controls { justify-content: center; flex-wrap: nowrap; gap: 29px; margin-top: 20px; }
.play-button { width: 68px; height: 68px; background: var(--ink); box-shadow: 0 6px 14px #29312c19; transition: transform .18s, background .18s; }
.play-button:hover:not(:disabled) { background: var(--accent); transform: scale(1.04); }
.play-button svg { width: 29px; height: 29px; fill: currentColor; }
.play-button .pause-glyph, .play-button.is-playing .play-glyph { display: none; }
.play-button.is-playing .pause-glyph { display: block; }
.icon-button { width: 44px; height: 44px; flex: none; border: 0; display: grid; place-items: center; }
.icon-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.skip-button svg { width: 30px; height: 30px; }
.skip-button text { fill: currentColor; stroke: none; text-anchor: middle; font-size: 11px; font-family: inherit; font-weight: 700; }
.playback-status { text-align: center; font-size: 11px; margin: 13px 0 20px; }
.player-utility { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--soft-line); padding-top: 12px; }
.playback-speed select { appearance: auto; width: 73px; padding: 0 8px; height: 44px; border-radius: 22px; background: transparent; border: 1px solid var(--line); font-size: 12px; font-weight: 700; color: var(--ink); }
.volume-control { display: flex; align-items: center; gap: 3px; min-width: 0; max-width: 150px; }
#volume-range { margin: 0; min-width: 35px; height: 26px; }
.volume-cross, #mute-button[aria-pressed="true"] .volume-waves { display: none; }
#mute-button[aria-pressed="true"] .volume-cross { display: block; }
.player-tip { text-align: center; color: var(--muted); font-size: 10px; line-height: 1.5; margin: 14px 0 0; }
.player-actions { margin-top: 18px; padding-top: 16px; }
@media (max-width: 470px) {
  .header-right { gap: 7px; }
  .ambience-toggle { padding: 0 8px; font-size: 10px; }
  .local-badge { font-size: 8px; padding: 9px; letter-spacing: .05em; gap: 6px; }
  .player-controls { gap: 24px; }
  .player-utility { gap: 5px; }
}
