:root{color-scheme:dark;--bg:#160b1d;--card:#26152e;--paper:#f6f0e7;--muted:#cbbbd0;--gold:#e2bd62;--cyan:#76d9dc;--line:rgba(226,189,98,.28);font-family:system-ui,-apple-system,"Segoe UI",sans-serif}
*{box-sizing:border-box}
[hidden]{display:none!important}
html{min-width:320px;background:var(--bg)}
body{margin:0;min-height:100vh;color:var(--paper);background:radial-gradient(circle at 12% 0%,#4b235a 0,transparent 38rem),radial-gradient(circle at 95% 95%,#243b43 0,transparent 33rem),var(--bg)}
button,select,textarea,input{font:inherit}
button{cursor:pointer}
button:disabled{cursor:not-allowed;opacity:.5}
a{color:var(--cyan)}
:focus-visible{outline:3px solid var(--cyan);outline-offset:3px}
.shell{width:min(1120px,calc(100% - 2rem));margin:auto}
.topbar{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1.3rem 0;border-bottom:1px solid var(--line)}
.brand{text-decoration:none;text-transform:uppercase;letter-spacing:.1em;font-size:.9rem;font-weight:900;color:var(--gold)}
.brand span{color:var(--paper);opacity:.7}
.back{font-size:.88rem;text-decoration:none;color:var(--muted)}
.back:hover{text-decoration:underline}
.intro{padding:clamp(2.5rem,7vw,5rem) 0 2.3rem}
.eyebrow,.step{text-transform:uppercase;letter-spacing:.16em;font-size:.72rem;font-weight:800;color:var(--gold);margin:0 0 .7rem}
h1{font-family:Georgia,serif;font-size:clamp(2.8rem,7vw,5.4rem);letter-spacing:-.055em;line-height:1.02;margin:0 0 1.1rem}
h1 em{font-weight:400;color:var(--gold)}
.intro>p:last-child{max-width:57ch;line-height:1.6;color:var(--muted);margin:0}
.workspace{display:grid;grid-template-columns:minmax(0,1.18fr) minmax(300px,.82fr);gap:1rem;align-items:start}
.card{border:1px solid var(--line);background:rgba(38,21,46,.94);border-radius:20px;padding:clamp(1.15rem,3vw,2rem);box-shadow:0 20px 45px rgba(0,0,0,.18)}
.section-head{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;margin-bottom:1.4rem}
h2{font-family:Georgia,serif;font-size:1.7rem;line-height:1.1;margin:0}
.step{color:var(--cyan)}
.local-badge{border:1px solid rgba(118,217,220,.45);border-radius:99px;padding:.3rem .6rem;color:var(--cyan);font-size:.7rem;font-weight:700;white-space:nowrap}
.file-picker{min-height:90px;border:1px dashed var(--gold);border-radius:13px;background:rgba(226,189,98,.08);display:flex;align-items:center;gap:1rem;padding:1rem;cursor:pointer}
.file-picker:hover{background:rgba(226,189,98,.15)}
.file-picker:focus-within{outline:3px solid var(--cyan);outline-offset:3px}
.file-picker strong,.file-picker small{display:block}
.file-picker small{margin-top:.2rem;color:var(--muted);font-size:.78rem}
.file-icon{width:42px;height:42px;border-radius:10px;display:grid;place-items:center;background:var(--gold);color:#251525;font-size:1.5rem;font-weight:900}
#file-input{position:absolute;width:1px;height:1px;opacity:0;overflow:hidden}
.or{text-align:center;color:var(--muted);font-size:.8rem;margin:1.1rem 0}
textarea{display:block;width:100%;min-height:290px;resize:vertical;border:1px solid rgba(255,255,255,.2);border-radius:12px;background:#190f20;color:var(--paper);padding:1rem;line-height:1.55}
textarea::placeholder{color:#a992ad}
.text-meta{display:flex;justify-content:space-between;align-items:center;gap:1rem;color:var(--muted);font-size:.78rem;margin-top:.7rem}
.text-button{border:0;background:none;color:var(--cyan);padding:.3rem;white-space:nowrap}
.text-button:hover{text-decoration:underline}
.controls label{display:block;font-weight:700;font-size:.86rem;margin-bottom:.5rem}
.voice-field{margin-bottom:1rem}
select{width:100%;min-height:44px;border:1px solid rgba(255,255,255,.25);border-radius:9px;background:#190f20;color:var(--paper);padding:.55rem .7rem}
.voice-field select{border-color:rgba(118,217,220,.42)}
.hint{color:var(--muted);font-size:.76rem;line-height:1.45;margin:.55rem 0 1.5rem}
.rate-row{display:flex;justify-content:space-between;align-items:center}
.rate-row output{font-weight:800;color:var(--gold)}
input[type=range]{width:100%;accent-color:var(--gold);margin:.35rem 0 1.6rem}
.play-actions{display:flex;gap:.5rem}
.play-actions button{min-height:50px;border-radius:10px;font-weight:800;padding:.7rem 1rem}
.play-actions .icon-button{flex:0 0 50px;padding:0;font-size:1.05rem}
.play-actions svg{width:1.15em;height:1.15em;fill:currentColor;vertical-align:-.2em}
.primary .icon-pause,.primary.is-playing .icon-play{display:none}
.primary.is-playing .icon-pause{display:inline}
.primary{flex:1;border:1px solid var(--gold);background:var(--gold);color:#211323}
.primary:hover:not(:disabled){background:#f3d083}
.secondary{border:1px solid var(--line);background:transparent;color:var(--paper)}
.secondary:hover:not(:disabled){border-color:var(--gold)}
.progress-track{height:4px;margin-top:1rem;border-radius:99px;background:rgba(255,255,255,.1);overflow:hidden}
#progress-bar{display:block;height:100%;width:0;background:var(--cyan);transition:width .3s}
.progress{min-height:50px;display:flex;justify-content:space-between;gap:.6rem;align-items:center;color:var(--muted);font-size:.83rem;border-bottom:1px solid var(--line)}
#progress-count{white-space:nowrap}
.shortcuts{color:var(--muted);font-size:.72rem;line-height:1.45;margin:.8rem 0 0}
.lexicon{margin-top:1rem;border:1px solid var(--line);border-radius:10px;padding:.7rem .9rem}
.lexicon summary{cursor:pointer;font-weight:700;font-size:.86rem}
.lexicon p{color:var(--muted);font-size:.76rem;line-height:1.45;margin:.6rem 0}
.lexicon code{color:var(--gold)}
.lexicon textarea{min-height:110px;font-size:.85rem;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}
.text-actions{display:flex;gap:.4rem}
.reading-view{max-height:min(70vh,640px);overflow-y:auto;position:relative;border:1px solid rgba(255,255,255,.2);border-radius:12px;background:#190f20;padding:1rem 1.15rem;line-height:1.75;font-size:1.04rem;overscroll-behavior:contain}
.reading-view p{margin:0 0 1em}
.reading-view h3{font-family:Georgia,serif;font-size:1.25rem;margin:.4em 0 .6em;color:var(--gold)}
.reading-view .sentence{cursor:pointer;border-radius:4px;transition:background-color .2s,color .2s}
.reading-view .sentence:hover{background:rgba(118,217,220,.12)}
.reading-view .sentence.is-read{color:#a992ad}
.reading-view .sentence.is-current{background:rgba(226,189,98,.26);color:var(--paper);box-shadow:0 0 0 2px rgba(226,189,98,.26)}
.privacy{margin-top:1.3rem;padding:1rem;border-radius:10px;background:rgba(118,217,220,.09);font-size:.78rem;line-height:1.55;color:var(--muted)}
.privacy strong{color:var(--paper)}
.fine-print{color:var(--muted);font-size:.75rem;line-height:1.5;margin:1rem 0 0}
footer{padding:2.2rem 0 2.8rem;color:var(--muted);font-size:.75rem}
.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}
@media(min-width:781px){.player-card{position:sticky;top:1rem}}
@media(max-width:780px){.workspace{grid-template-columns:1fr}.reading-view{max-height:55vh}body.is-reading{padding-bottom:5.5rem}body.is-reading .play-actions{position:fixed;left:1rem;right:1rem;bottom:.75rem;z-index:5;padding:.5rem;border:1px solid var(--line);border-radius:14px;background:rgba(38,21,46,.97);box-shadow:0 10px 30px rgba(0,0,0,.45)}.intro{padding-top:2.8rem}.topbar{flex-wrap:wrap}.card{padding:1.25rem}}
@media(max-width:380px){.local-badge{display:none}.play-actions .icon-button{flex-basis:44px}}
