@font-face{font-family:Sarabun;font-weight:400;font-style:normal;font-display:swap;src:local("Sarabun"),local("Sarabun Regular"),url(fonts/Sarabun-Regular.ttf) format("truetype")}
@font-face{font-family:Sarabun;font-weight:500 800;font-style:normal;font-display:swap;src:local("Sarabun Bold"),url(fonts/Sarabun-Bold.ttf) format("truetype")}
:root{--canvas:#FBFAF7;--surface:#fff;--soft:#F2F5F0;--ink:#25302F;--muted:#58645F;--line2:#BCC9C2;--hl:#FFE2D6;--cov-sh:rgba(0,0,0,.42);--mint:#A8DCCB;--mintd:#286457;--on-mint:#173A31;--coral:#F4A18B;--coral-soft:#FFF0EB;--lav:#E8E1F4;--lav-ink:#59416F;--lav-bar:#8F72B5;--amber:#F2C979;--amber-soft:#FFF5DA;--amber-ink:#5E4A14;--danger:#C95B5B;--line:#DDE5DF;
 --sh:0 8px 24px rgba(37,48,47,.08);--sh-card:0 1px 0 rgba(37,48,47,.03),0 6px 18px rgba(37,48,47,.05);--scrim:rgba(37,48,47,.42);--glow1:rgba(168,220,203,.38);--glow2:rgba(232,225,244,.7);
 --font:Sarabun,'Noto Sans Thai','Leelawadee UI',Tahoma,system-ui,sans-serif;color-scheme:light}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]){--canvas:#14171A;--surface:#252B2F;--soft:#2F373B;--line2:#56626A;--hl:#4B3A38;--cov-sh:rgba(0,0,0,.22);--ink:#F7F5EF;--muted:#B4BFC2;--mint:#86C5B0;--mintd:#B7E9D8;--on-mint:#10302A;--coral:#F5A58F;--coral-soft:#392F30;--lav:#3A3445;--lav-ink:#D8C8EC;--lav-bar:#B79CDB;--amber:#E5B95F;--amber-soft:#2D2C27;--amber-ink:#F2D58E;--danger:#FF9A92;--line:#3B454A;--sh:0 0 0 1px #46525A,0 12px 32px rgba(0,0,0,.45);--sh-card:0 0 0 1px #333D43,0 10px 26px rgba(0,0,0,.35);--scrim:rgba(0,0,0,.6);--glow1:rgba(134,197,176,.06);--glow2:rgba(120,100,160,.07);color-scheme:dark}}
:root[data-theme=dark]{--canvas:#14171A;--surface:#252B2F;--soft:#2F373B;--line2:#56626A;--hl:#4B3A38;--cov-sh:rgba(0,0,0,.22);--ink:#F7F5EF;--muted:#B4BFC2;--mint:#86C5B0;--mintd:#B7E9D8;--on-mint:#10302A;--coral:#F5A58F;--coral-soft:#392F30;--lav:#3A3445;--lav-ink:#D8C8EC;--lav-bar:#B79CDB;--amber:#E5B95F;--amber-soft:#2D2C27;--amber-ink:#F2D58E;--danger:#FF9A92;--line:#3B454A;--sh:0 0 0 1px #46525A,0 12px 32px rgba(0,0,0,.45);--sh-card:0 0 0 1px #333D43,0 10px 26px rgba(0,0,0,.35);--scrim:rgba(0,0,0,.6);--glow1:rgba(134,197,176,.06);--glow2:rgba(120,100,160,.07);color-scheme:dark}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0}
body{background:radial-gradient(circle at 4% 0,var(--glow1),transparent 26rem),radial-gradient(circle at 96% 18%,var(--glow2),transparent 28rem),var(--canvas);background-attachment:fixed;color:var(--ink);font:400 16px/25px var(--font);-webkit-font-smoothing:antialiased;min-height:100dvh;overflow-wrap:break-word}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
h1,h2,h3,p{margin:0}
button{font:inherit;color:inherit;min-height:48px;min-width:48px;border:1px solid var(--line);background:var(--surface);border-radius:14px;padding:0 16px;cursor:pointer;font-weight:700;font-size:14px;line-height:20px;transition:background .15s,border-color .15s,transform .1s}
button:active{transform:scale(.97)}
button:focus-visible,input:focus-visible,[tabindex]:focus-visible{outline:3px solid var(--mintd);outline-offset:2px}
svg{width:22px;height:22px;flex:none}
.sub{color:var(--muted);font-size:14px;line-height:20px}
.lead{color:var(--muted);font-size:15px;line-height:22px;margin-top:4px}
.pill{display:inline-block;padding:0 12px;border-radius:99px;background:var(--soft);color:var(--mintd);font-size:15px;font-weight:700;line-height:28px;vertical-align:middle;margin-inline-start:6px}

/* shell */
.app{display:block;max-width:760px;margin:0 auto}
.side{display:none}
.main{min-width:0}
.screen{display:none;padding:calc(22px + env(safe-area-inset-top)) 20px calc(112px + env(safe-area-inset-bottom))}
.screen.on{display:block}
.head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:8px;min-height:56px}
h1{font-size:30px;line-height:38px;font-weight:700;letter-spacing:-.01em}
.circle-add{width:56px;height:56px;border-radius:50%;border:0;display:grid;place-items:center;padding:0;background:var(--mint);color:var(--on-mint);box-shadow:0 8px 16px rgba(40,100,87,.18)}
.circle-add svg{width:26px;height:26px}
.bottom-nav{position:fixed;z-index:4;left:0;right:0;bottom:0;display:flex;justify-content:center;gap:8px;padding:8px 24px calc(10px + env(safe-area-inset-bottom));background:color-mix(in srgb,var(--canvas) 94%,transparent);border-top:1px solid var(--line);backdrop-filter:blur(12px)}
.bottom-nav button{flex:1;max-width:200px;display:grid;justify-items:center;align-content:center;gap:2px;border:0;background:none;color:var(--muted);font-size:12px;line-height:16px;padding:6px 8px;border-radius:14px;min-height:54px}
.bottom-nav button.on{color:var(--mintd)}
.bottom-nav button.on svg{background:var(--mint);color:var(--on-mint);border-radius:99px;width:52px;height:30px;padding:4px 15px;margin-bottom:-1px}
.bottom-nav button svg{width:26px;height:26px}
body.in-player .bottom-nav{display:none}

/* covers */
.cover{position:relative;flex:0 0 72px;width:72px;height:104px;border-radius:14px;overflow:hidden;display:flex;flex-direction:column;justify-content:flex-end;padding:9px 8px 8px 12px;color:#fff;font-weight:700;box-shadow:0 8px 16px rgba(37,48,47,.18),inset 0 -40px 40px -20px rgba(0,0,0,.28);isolation:isolate}
.cover::before{content:"";position:absolute;z-index:-1;left:0;top:0;bottom:0;width:6px;background:rgba(0,0,0,.14);box-shadow:1px 0 0 rgba(255,255,255,.22)}
.cover::after{content:"";position:absolute;z-index:-1;right:-30%;top:-18%;width:90%;aspect-ratio:1;border-radius:50%;background:rgba(255,255,255,.14)}
.cover .ini{font-size:38px;line-height:1.6;height:62px;margin-top:-6px;opacity:.92;text-shadow:0 2px 10px rgba(0,0,0,.18);display:block;overflow:visible;white-space:nowrap;position:absolute;left:12px;top:0}
.cover .t{font-size:11px;line-height:14px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-shadow:0 1px 6px rgba(0,0,0,.25);position:relative}
.cover-lg{flex:none;width:168px;height:224px;border-radius:22px;padding:18px 16px 16px 22px;margin:8px auto 18px;box-shadow:0 18px 36px rgba(37,48,47,.22),inset 0 -80px 60px -40px rgba(0,0,0,.3)}
.cover-lg::before{width:9px}
.cover-lg .ini{font-size:84px;height:130px;left:22px;top:6px;line-height:1.7}
.cover-lg .t{font-size:20px;line-height:26px;-webkit-line-clamp:3}

/* shelf */
.sec-head{display:flex;align-items:baseline;justify-content:space-between;margin:26px 0 12px}
.sec-head h2{font-size:18px;line-height:26px}
.sec-head span{color:var(--muted);font-size:13px}
.grid{display:grid;gap:12px}
.book-card{position:relative;display:flex;gap:14px;padding:14px;border:1px solid var(--line);border-radius:22px;background:var(--surface);box-shadow:var(--sh-card);cursor:pointer;transition:transform .15s,box-shadow .15s}
.book-card:hover{transform:translateY(-2px);box-shadow:var(--sh)}
.book-card:focus-visible{outline:3px solid var(--mintd);outline-offset:3px}
.book-info{min-width:0;flex:1;display:flex;flex-direction:column;padding-inline-end:36px}
.book-info strong{display:block;font-size:17px;line-height:24px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.book-info small{display:block;color:var(--muted);font-size:13px;line-height:18px;margin-top:2px}
.prow{display:flex;justify-content:space-between;align-items:center;margin-top:auto;padding-top:10px;color:var(--muted);font-size:12px;line-height:18px;font-weight:600}
.prow b{color:var(--mintd)}
.progress{height:7px;overflow:hidden;border-radius:99px;background:var(--line)}
.progress i{display:block;height:100%;width:0;border-radius:inherit;background:var(--mintd);transition:width .4s}
.book-info .progress{margin-top:5px}
.book-actions{display:flex;gap:8px;margin-top:10px;align-items:center}
.primary{min-height:48px;border:0;border-radius:14px;padding:0 20px;color:var(--on-mint);background:var(--mint);font-size:16px;font-weight:700;display:inline-flex;align-items:center;justify-content:center;gap:8px}
.primary:hover{filter:brightness(.97)}
.primary svg{width:20px;height:20px}
.secondary{border-radius:14px;background:var(--surface)}
.wide{width:100%}
.more{position:absolute;top:6px;right:6px;border:0;background:none;color:var(--muted);padding:0;display:grid;place-items:center;border-radius:50%}
.more:hover{background:var(--soft)}
.book-card .primary{min-height:44px;font-size:15px;padding:0 18px}
.book-card .primary{min-height:48px}
.book-card.prep{background:color-mix(in srgb,var(--lav) 30%,var(--surface));border-color:color-mix(in srgb,var(--lav-bar) 35%,var(--line))}
.book-card.prep .progress i{background:var(--lav-bar)}
.book-card.prep .prow b{color:var(--lav-ink)}
.badge{display:inline-flex;align-items:center;gap:6px;margin-top:8px;padding:2px 10px;border-radius:99px;background:var(--lav);color:var(--lav-ink);font-size:12px;line-height:20px;font-weight:700;align-self:flex-start}
.badge.go{background:var(--soft);color:var(--mintd)}
.pulse{display:inline-block;width:8px;height:8px;border-radius:50%;background:currentColor;animation:pulse 1.4s ease-in-out infinite}
@keyframes pulse{0%,100%{opacity:.35;transform:scale(.8)}50%{opacity:1;transform:scale(1.15)}}
.progress.ind i{width:38%!important;animation:slide 1.6s ease-in-out infinite}
@keyframes slide{0%{margin-left:-38%}100%{margin-left:100%}}
.ring{position:relative;width:52px;height:52px;flex:none;display:grid;place-items:center}
.ring svg{width:52px;height:52px;transform:rotate(-90deg)}
.ring circle{fill:none;stroke-width:5}
.ring .bg{stroke:var(--line)}.ring .fg{stroke:var(--mintd);stroke-linecap:round}
.ring b{position:absolute;font-size:12px;line-height:1;color:var(--ink)}

.banner{display:none;gap:12px;align-items:center;margin:14px 0 4px;padding:14px;border-radius:16px;background:var(--amber-soft);border:1px solid color-mix(in srgb,var(--amber) 55%,transparent);color:var(--amber-ink);font-size:14px;line-height:21px}
.banner.on{display:flex}
.banner b{display:block;font-size:15px}
.banner span{display:block}
.banner svg{margin-top:1px;align-self:flex-start}
.banner.warn{margin-top:16px}
.banner.warn .secondary{margin-inline-start:auto;border-color:color-mix(in srgb,var(--amber) 60%,transparent);color:var(--amber-ink);background:transparent}

.empty{text-align:center;padding:36px 8px 0}
.empty-art{position:relative;width:176px;height:168px;margin:12px auto 22px}
.empty-art .sun{position:absolute;right:14px;top:2px;width:44px;height:44px;border-radius:50%;background:var(--amber);opacity:.8}
.empty-art .ba,.empty-art .bb{position:absolute;bottom:8px;width:92px;height:124px;border-radius:10px 10px 8px 8px;box-shadow:0 15px 20px rgba(37,48,47,.14)}
.empty-art .ba{left:18px;transform:rotate(-11deg);background:linear-gradient(150deg,#c2dfd2,#86bba5)}
.empty-art .bb{right:14px;transform:rotate(10deg);background:linear-gradient(150deg,#f1c4b4,#e19b86)}
.empty-art .ba::after,.empty-art .bb::after{content:"";position:absolute;left:14px;right:14px;top:22px;height:4px;border-radius:4px;background:rgba(255,255,255,.7);box-shadow:0 12px 0 rgba(255,255,255,.5)}
.empty-art::after{content:"";position:absolute;left:36px;bottom:0;width:108px;height:14px;border-radius:50%;background:rgba(37,48,47,.14);filter:blur(4px)}
.empty h2{font-size:24px;line-height:32px}
.empty p{color:var(--muted);max-width:290px;margin:8px auto 22px;font-size:15px;line-height:23px}
.empty .primary{width:100%;max-width:360px;min-height:56px;font-size:17px}

/* player */
.ptop{display:grid;grid-template-columns:48px 1fr 48px;align-items:center;gap:8px;margin-bottom:8px}
.ptitle-wrap{text-align:center;min-width:0}
.ptitle-wrap .sub{display:block;font-size:13px}
.ptitle-wrap b{display:block;font-size:17px;line-height:24px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.icon-btn{display:grid;place-items:center;padding:0;width:48px;height:48px;border:0;border-radius:16px;background:var(--soft);color:var(--ink)}
.screen#player{padding-bottom:0}
.pgrid{display:block}
.pinfo{text-align:center;padding-bottom:calc(260px + env(safe-area-inset-bottom))}
.player-title{font-size:24px;line-height:30px;letter-spacing:-.01em}
.player-meta{margin-top:4px;color:var(--muted);font-size:14px;line-height:20px}
.passage{margin-top:18px;padding:15px 18px;border-inline-start:4px solid var(--coral);border-radius:16px;background:var(--coral-soft);text-align:start}
.passage small{color:var(--muted);font-size:12px;line-height:18px;font-weight:600;display:flex;align-items:center;gap:6px}
.passage p{font-size:20px;line-height:33px;margin-top:2px;display:-webkit-box;-webkit-line-clamp:5;-webkit-box-orient:vertical;overflow:hidden}
.read-link{display:inline-flex;align-items:center;gap:6px;margin-top:6px;border:0;background:none;color:var(--mintd);font-size:15px}
.dock{position:fixed;z-index:3;left:0;right:0;bottom:0;padding:12px 20px calc(14px + env(safe-area-inset-bottom));background:color-mix(in srgb,var(--surface) 96%,transparent);border-top:1px solid var(--line);box-shadow:0 -10px 30px rgba(37,48,47,.08);backdrop-filter:blur(14px);border-radius:24px 24px 0 0}
.dock>*{max-width:560px;margin-inline:auto}
.time-row{display:flex;justify-content:space-between;margin-top:6px;color:var(--muted);font-size:12px;line-height:18px;font-weight:600}
.controls{display:flex;align-items:center;justify-content:center;gap:22px;margin-top:6px}
.control{display:grid;justify-items:center;gap:0;border:0;background:none;color:var(--muted);font-size:12px;line-height:16px;font-weight:600;padding:2px 6px;min-height:56px}
.control svg{width:28px;height:28px;color:var(--ink)}
.control:disabled,.tool:disabled,.play:disabled{opacity:.4;cursor:not-allowed}
.play{width:68px;height:68px;min-width:68px;padding:0;border:0;border-radius:50%;display:grid;place-items:center;background:var(--mint);color:var(--on-mint);box-shadow:0 10px 20px rgba(40,100,87,.22)}
.play svg{width:30px;height:30px}
.play.busy{animation:glow 1.4s ease-in-out infinite}
@keyframes glow{0%,100%{box-shadow:0 0 0 0 color-mix(in srgb,var(--mint) 60%,transparent)}50%{box-shadow:0 0 0 12px color-mix(in srgb,var(--mint) 0%,transparent)}}
.tools{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:8px}
.tool{display:grid;gap:2px;place-items:center;align-content:center;min-height:60px;padding:6px 4px;font-size:13px;line-height:18px;border-radius:16px;text-align:center}
.tool svg{color:var(--mintd)}
.tool.act{background:var(--amber-soft);border-color:color-mix(in srgb,var(--amber) 60%,transparent);color:var(--amber-ink)}
.tool.act svg{color:inherit}
.pright{display:none}
.v-read .pright{display:block}.v-read .pinfo{display:none}.v-read .time-row{display:none}
.v-read .dock .progress{margin-top:2px}
.pright{padding-bottom:calc(230px + env(safe-area-inset-bottom))}
.read-head{display:flex;align-items:center;gap:12px;margin:6px 0 10px}
.read-head h3{font-size:22px;line-height:30px}
.read-head .sub{font-size:13px}
.read-head>div{flex:1;min-width:0}
.only-m{display:grid}
#player.reading .ptop{display:none}
.chip-mood{display:inline-flex;align-items:center;gap:6px;padding:2px 12px;border-radius:99px;background:var(--coral-soft);color:var(--ink);font-size:13px;line-height:24px;font-weight:700;border:1px solid color-mix(in srgb,var(--coral) 50%,transparent);white-space:nowrap}
.chip-mood:empty{display:none}
.read-copy .para{font-size:20px;line-height:36px;margin:0 0 22px}
.s{padding:3px 6px;margin-inline:-2px;border-radius:9px;cursor:pointer;border-inline-start:3px solid transparent;-webkit-box-decoration-break:clone;box-decoration-break:clone;transition:background .2s}
.s:hover{background:var(--soft)}
.s.cur{background:var(--coral-soft);border-inline-start-color:var(--coral);box-shadow:0 0 0 1px color-mix(in srgb,var(--coral) 35%,transparent)}
.s.cur.pulse-edge{animation:edge 1.4s ease-in-out infinite}
@keyframes edge{0%,100%{border-inline-start-color:var(--coral)}50%{border-inline-start-color:transparent}}
.prep-state{margin-top:18px;padding:16px;border-radius:18px;background:var(--lav);color:var(--lav-ink);text-align:start}
.prep-state b{display:block;font-size:16px}
.prep-state .progress{margin-top:12px;background:color-mix(in srgb,var(--lav-bar) 25%,transparent)}
.prep-state .progress i{background:var(--lav-bar)}

/* sheets */
.sheet{position:fixed;inset:0;z-index:10;background:var(--scrim);display:flex;align-items:flex-end;justify-content:center;visibility:hidden;opacity:0;transition:opacity .2s,visibility 0s .2s}
.sheet.on{visibility:visible;opacity:1;transition:opacity .2s}
.sheet-card{width:100%;max-width:560px;max-height:88dvh;overflow:auto;background:var(--surface);border-radius:28px 28px 0 0;padding:10px 20px calc(24px + env(safe-area-inset-bottom));box-shadow:0 -12px 35px rgba(0,0,0,.18);transform:translateY(24px);transition:transform .25s;outline:0}
.sheet.on .sheet-card{transform:none}
.handle{width:40px;height:5px;border-radius:9px;background:var(--line);margin:0 auto 14px}
.sheet h2{font-size:24px;line-height:30px}
.sheet .primary{margin-top:16px}
.sheet .sub-btn{margin-top:8px}
.segmented{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;padding:4px;border-radius:15px;background:var(--soft);gap:4px;margin-top:14px}
.segmented button{border:0;background:none;color:var(--muted);border-radius:11px;min-height:44px;padding:0 8px}
.segmented button.sel{background:var(--surface);color:var(--ink);box-shadow:0 2px 6px rgba(37,48,47,.12),0 0 0 1px var(--line)}
.mood-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-top:14px}
.mood{display:grid;place-items:center;align-content:center;gap:0;min-height:60px;padding:6px 2px;border-radius:15px;font-size:14px;line-height:20px;position:relative}
.mood .em{font-size:20px;line-height:24px;color:var(--muted);font-weight:400}
.mood.sel{border:2px solid var(--ink);background:var(--coral-soft)}
.mood.sel::after{content:"";position:absolute;top:5px;right:6px;width:8px;height:8px;border-radius:50%;background:var(--ink)}
.range-label{display:flex;justify-content:space-between;align-items:center;margin-top:18px;color:var(--muted);font-size:13px}
.range-label b{color:var(--ink);font-size:15px}
input[type=range]{-webkit-appearance:none;appearance:none;width:100%;height:48px;background:none;margin:0;cursor:pointer;--v:50%}
input[type=range]::-webkit-slider-runnable-track{height:8px;border-radius:99px;background:linear-gradient(var(--mintd),var(--mintd)) 0/var(--v) 100% no-repeat,var(--line)}
input[type=range]::-moz-range-track{height:8px;border-radius:99px;background:var(--line)}
input[type=range]::-moz-range-progress{height:8px;border-radius:99px;background:var(--mintd)}
input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:28px;height:28px;margin-top:-10px;border-radius:50%;background:var(--surface);border:4px solid var(--mintd);box-shadow:0 3px 8px rgba(0,0,0,.25)}
input[type=range]::-moz-range-thumb{width:20px;height:20px;border-radius:50%;background:var(--surface);border:4px solid var(--mintd)}
.stops{display:flex;justify-content:space-between;color:var(--muted);font-size:12px;line-height:18px;margin-top:-6px}
.switch-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:14px;padding:10px 14px;border-radius:15px;background:var(--soft);min-height:56px}
.switch-row span small{display:block;color:var(--muted);font-weight:400;font-size:13px;line-height:18px}
.switch-row b{font-size:15px}
.switch{position:relative;flex:none;width:56px;min-width:56px;height:48px;border:0;background:none;padding:0}
.switch::before{content:"";position:absolute;left:0;top:10px;width:56px;height:28px;border-radius:99px;background:var(--line);transition:background .2s}
.switch::after{content:"";position:absolute;left:4px;top:14px;width:20px;height:20px;border-radius:50%;background:#fff;box-shadow:0 1px 4px rgba(0,0,0,.3);transition:transform .2s}
.switch[aria-checked=true]::before{background:var(--mintd)}
.switch[aria-checked=true]::after{transform:translateX(28px)}
.radio-list{display:grid;gap:8px;margin:14px 0 6px}
.radio{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:52px;padding:0 16px;border-radius:15px;font-size:16px;font-weight:400;text-align:start;width:100%}
.radio::after{content:"";width:22px;height:22px;flex:none;border-radius:50%;border:2px solid var(--line)}
.radio.sel{border:2px solid var(--mintd);background:var(--soft);font-weight:700}
.radio.sel::after{border:7px solid var(--mintd);background:var(--surface)}
.speed-row{display:flex;justify-content:space-between;align-items:center;margin:16px 0 0;color:var(--muted);font-size:14px}
.speed-row b{color:var(--mintd);font-size:16px;background:var(--soft);padding:0 14px;line-height:30px;border-radius:99px}
.timer-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:18px 0 10px}
.timer-grid button{min-height:58px;font-size:16px;border-radius:16px}
.timer-grid button.sel{border:2px solid var(--mintd);background:var(--mint);color:var(--on-mint)}
.timer-grid .full{grid-column:1/-1}
.danger{color:var(--danger);background:none;border-color:color-mix(in srgb,var(--danger) 45%,var(--line))}
.toast{position:fixed;z-index:20;left:50%;bottom:calc(120px + env(safe-area-inset-bottom));transform:translateX(-50%);padding:10px 18px;border-radius:99px;background:var(--ink);color:var(--canvas);font-size:14px;font-weight:700;box-shadow:var(--sh);max-width:90vw}

/* settings */
.set-grid{display:grid;gap:14px;margin-top:14px}
.card-block{padding:18px;border:1px solid var(--line);border-radius:22px;background:var(--surface);box-shadow:var(--sh-card)}
.card-block h2{font-size:20px;line-height:28px}
.card-block .radio-list{margin-bottom:0}
.card-block input[type=range]{margin-top:6px}
.field{width:100%;min-height:52px;margin-top:12px;padding:0 14px;border-radius:14px;border:1px solid var(--line);background:var(--canvas);color:var(--ink);font:inherit;font-size:16px}
.tip{display:flex;gap:14px;background:var(--lav);border-color:transparent;color:var(--lav-ink)}
.tip .lead{color:inherit;opacity:.92}
.tip-ico{width:44px;height:44px;border-radius:50%;background:color-mix(in srgb,#fff 55%,transparent);display:grid;place-items:center;flex:none}
[data-theme=dark] .tip-ico{background:rgba(255,255,255,.12)}

/* desktop: sidebar + two panes */
@media(min-width:900px){
 .app{display:grid;grid-template-columns:248px minmax(0,1fr);max-width:1320px;min-height:100dvh}
 .side{display:flex;flex-direction:column;gap:6px;position:sticky;top:0;height:100dvh;padding:32px 20px;border-inline-end:1px solid var(--line)}
 .brand{display:flex;align-items:center;gap:12px;padding:0 8px 22px;font-size:22px}
 .logo{width:44px;height:44px;border-radius:14px;background:var(--mint);color:var(--on-mint);display:grid;place-items:center;box-shadow:0 8px 16px rgba(40,100,87,.16)}
 .side button{display:flex;align-items:center;gap:12px;border:0;background:none;justify-content:flex-start;min-height:52px;font-size:16px;color:var(--muted);padding:0 16px;border-radius:16px}
 .side button:hover{background:var(--soft)}
 .side button.on{background:var(--mint);color:var(--on-mint)}
 .bottom-nav{display:none}
 .screen{padding:44px 48px 56px}
 #shelf,#settings{max-width:1000px}
 .head{margin-bottom:14px}
 h1{font-size:34px;line-height:44px}
 .grid{grid-template-columns:repeat(auto-fill,minmax(380px,1fr));gap:16px}
 .banner{max-width:720px}
 .set-grid{grid-template-columns:1fr 1fr;align-items:start}
 .set-grid .tip{grid-column:1/-1}
 .screen#player{padding:28px 40px 32px;max-width:none}
 .ptop{max-width:1100px;margin:0 auto 18px}
 .pgrid,.pgrid.v-read{display:grid;grid-template-columns:380px minmax(0,1fr);gap:28px;max-width:1100px;margin:0 auto;height:calc(100dvh - 130px);min-height:560px}
 .pleft{display:flex;flex-direction:column;gap:16px;min-height:0;overflow:auto}
 .v-read .pinfo,.pinfo{display:block;padding:24px 20px 4px;border:1px solid var(--line);border-radius:26px;background:var(--surface);box-shadow:var(--sh-card)}
 .cover-lg{margin-top:0}
 .pinfo{flex:1;display:flex!important;flex-direction:column;justify-content:center;padding-bottom:24px}
 #player.reading .ptop{display:grid}
 .passage,.read-link,#toPlay{display:none}
 .dock{position:static;padding:16px 20px 18px;border:1px solid var(--line);border-radius:26px;background:var(--surface);box-shadow:var(--sh-card);backdrop-filter:none}
 .v-read .time-row{display:flex}
 .pright,.v-read .pright{display:block;min-height:0;overflow:auto;padding:26px 36px 120px;border:1px solid var(--line);border-radius:26px;background:var(--surface);box-shadow:var(--sh-card);scroll-behavior:smooth}
 .read-head{position:sticky;top:-26px;z-index:2;margin:-26px -36px 12px;padding:22px 36px 12px;background:color-mix(in srgb,var(--surface) 94%,transparent);backdrop-filter:blur(8px);border-bottom:1px solid var(--line)}
 .only-m{display:none}
 .sheet{align-items:center}
 .sheet-card{border-radius:28px;max-width:500px;padding-top:24px;transform:translateY(12px) scale(.98)}
 .sheet .handle{display:none}
 .toast{bottom:40px}
}
@media(min-width:900px) and (max-height:760px){.cover-lg{width:132px;height:176px}.cover-lg .ini{font-size:62px;height:100px}.cover-lg .t{font-size:16px;line-height:22px}}
@media(max-width:380px){.mood-grid{grid-template-columns:repeat(3,1fr)}.controls{gap:12px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}.progress.ind i{margin-left:0;width:100%!important;opacity:.55}}

/* ---- polish v3 ---- */
.sub{font-size:14px;line-height:1.5}
.lead{line-height:1.55}
.prow{font-size:13px;line-height:1.5}
.badge{font-size:13px;line-height:1.55}
.bottom-nav button{font-size:13px;line-height:1.4;font-weight:600}
.bottom-nav button.on{color:var(--ink);font-weight:700}
.time-row,.passage small,.stops,.ring b{font-size:13px;line-height:1.5}
.control{font-size:14px;line-height:1.4;min-height:60px;min-width:56px}
.control svg{width:30px;height:30px}
.sec-head span{font-size:14px}
.book-info small{font-size:14px;line-height:1.5}
.screen{padding-bottom:calc(124px + env(safe-area-inset-bottom))}
.handle{background:var(--line2);width:44px}
.sheet-card{background:color-mix(in srgb,var(--surface) 100%,#fff 0%)}
:root[data-theme=dark] .sheet-card{background:#2B3236;box-shadow:0 -1px 0 #46525A,0 -16px 40px rgba(0,0,0,.5)}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]) .sheet-card{background:#2B3236;box-shadow:0 -1px 0 #46525A,0 -16px 40px rgba(0,0,0,.5)}}
:root[data-theme=dark] .dock{background:#252B2F}
button{border-color:var(--line2)}
.primary,.circle-add,.icon-btn,.more,.bottom-nav button,.side button,.segmented button,.read-link{border-color:transparent}
.book-card{border-color:var(--line)}

/* covers */
.cover{padding:12px 10px 11px 16px;box-shadow:0 8px 16px rgba(37,48,47,.2),inset 0 -70px 50px -30px var(--cov-sh)}
.cover .ini{display:none}
.cover .orn{position:absolute;left:16px;top:14px;width:22px;height:3px;border-radius:3px;background:rgba(255,255,255,.75);box-shadow:0 7px 0 rgba(255,255,255,.4)}
.cover .t{font-size:13px;line-height:1.5;padding-top:2px;-webkit-line-clamp:3;text-transform:capitalize;letter-spacing:.01em;text-shadow:0 1px 8px rgba(0,0,0,.35)}
.cover-lg{padding:20px 18px 18px 26px;box-shadow:0 18px 36px rgba(37,48,47,.22),inset 0 -110px 70px -50px var(--cov-sh)}
.cover-lg .orn{left:26px;top:24px;width:34px;height:4px;box-shadow:0 10px 0 rgba(255,255,255,.4)}
.cover-lg .t{font-size:24px;line-height:1.45;-webkit-line-clamp:4}
:root[data-theme=dark] .cover{filter:saturate(.88) brightness(.95)}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]) .cover{filter:saturate(.88) brightness(.95)}}

/* hero + add tile */
.hero-grid{grid-template-columns:1fr!important}
.book-card.hero{padding:18px;gap:18px;border-radius:28px;background:linear-gradient(135deg,color-mix(in srgb,var(--mint) 24%,var(--surface)),var(--surface) 72%)}
.hero .cover{flex:0 0 104px;width:104px;height:150px;border-radius:18px}
.hero .cover .t{font-size:16px}
.hero .book-info strong{font-size:22px;line-height:1.4}
.hero .book-actions .primary{min-height:52px;font-size:17px}
.hero .book-actions{margin-top:14px}
.add-tile{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:72px;margin-top:14px;border:2px dashed var(--line2);background:transparent;color:var(--mintd);border-radius:22px;font-size:16px}
.add-tile:hover{background:var(--soft)}
.add-tile svg{width:22px;height:22px}

/* empty */
.empty{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:calc(100dvh - 250px);padding:12px 8px 0}
.empty h2{font-size:26px;line-height:1.4;color:var(--ink)}
.empty p{color:var(--muted);font-size:16px;line-height:1.6;max-width:320px}
.banner{font-size:15px;line-height:1.55}
:root[data-theme=dark] .banner:not(.offline){background:var(--amber-soft);border-color:color-mix(in srgb,var(--amber) 40%,transparent)}

/* moods, timer */
.mood{min-height:56px;font-size:14px;line-height:1.4;border-color:var(--line2)}
.mood.sel{border:2px solid var(--mintd);background:var(--coral-soft);font-weight:700}
.mood.sel::after{display:none}
.mood i{margin-bottom:3px!important}
.cap-auto{display:flex;align-items:center;gap:8px;margin:14px 0 0;padding:8px 14px;border-radius:12px;background:var(--lav);color:var(--lav-ink);font-size:14px;line-height:1.5;font-weight:700}
.cap-auto svg{width:18px;height:18px}
.timer-grid button{min-height:52px;border:2px solid var(--line2);font-size:17px}
.timer-grid button.rec{border-color:var(--mintd)}
.timer-grid button small{display:block;font-size:13px;line-height:1.2;color:var(--mintd);font-weight:600}
.timer-grid button.sel small{color:var(--on-mint)}
.timer-grid button:not(.sel){background:var(--surface)}
:root[data-theme=dark] .timer-grid button:not(.sel){background:#323A3F}

/* reading highlight */
.s{padding:.1em .25em;margin-inline:-.1em;border-inline-start:0;border-radius:.4em;box-shadow:none;-webkit-box-decoration-break:clone;box-decoration-break:clone}
.s.cur{background:var(--hl);border-inline-start:0;box-shadow:none}
.s.cur.pulse-edge{animation:hlp 1.4s ease-in-out infinite}
@keyframes hlp{0%,100%{background:var(--hl)}50%{background:color-mix(in srgb,var(--hl) 55%,transparent)}}
.read-copy .para{line-height:2}
.passage{background:var(--hl);border-inline-start-color:var(--coral)}
.passage small{color:var(--muted)}

/* player layout */
.tool{min-height:64px;font-size:14px;line-height:1.35;gap:3px}
.dock{padding-top:14px}
.controls{gap:26px;margin-top:8px}
@media(max-width:899px){
 .pinfo{min-height:calc(100dvh - 76px - 300px - env(safe-area-inset-bottom));display:flex;flex-direction:column;justify-content:center;padding-bottom:calc(300px + env(safe-area-inset-bottom) - 100px)}
 .pinfo{padding-top:0}
 .read-link{min-height:48px;font-size:16px;margin-top:8px;align-self:center}
 .cover-lg{width:min(168px,34dvh*.75);height:min(224px,34dvh)}
}
.passage p{font-size:20px;line-height:1.65}
@media(min-width:900px){
 .app{max-width:1440px;margin-inline:auto}
 #shelf,#settings{max-width:1100px;margin-inline:auto;width:100%}
 .grid{grid-template-columns:repeat(auto-fill,minmax(300px,1fr))}
 .hero-grid{grid-template-columns:1fr!important}
 .hero .cover{flex-basis:150px;width:150px;height:216px;border-radius:22px}
 .hero .cover .t{font-size:20px}
 .book-card.hero{padding:26px 30px;gap:30px}
 .hero .book-info strong{font-size:28px}
 .hero .book-info{justify-content:center}
 .hero .book-actions{max-width:320px}
 .empty{min-height:calc(100dvh - 190px)}
 .add-tile{min-height:88px}
 .sheet .handle{display:none}
}

/* ---- polish v4 ---- */
:root{--muted:#5b6762}
:root[data-theme=dark]{--muted:#b4bdb9}
:root[data-theme=dark],:root[data-theme=dark] body{--canvas:#14171A;--surface:#1d2327;--soft:#262d32;--line:#323a40;--line2:#4a545b;--sh:0 0 0 1px #3a444b,0 12px 32px rgba(0,0,0,.45);--sh-card:0 0 0 1px #2b3338,0 8px 22px rgba(0,0,0,.3);--glow1:rgba(134,197,176,.03);--glow2:rgba(120,100,160,.03)}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]){--muted:#b4bdb9;--canvas:#14171A;--surface:#1d2327;--soft:#262d32;--line:#323a40;--line2:#4a545b;--sh:0 0 0 1px #3a444b,0 12px 32px rgba(0,0,0,.45);--sh-card:0 0 0 1px #2b3338,0 8px 22px rgba(0,0,0,.3);--glow1:rgba(134,197,176,.03);--glow2:rgba(120,100,160,.03)}
 :root:not([data-theme=light]) .sheet-card{background:#232a2f;box-shadow:0 -1px 0 #3a444b,0 -16px 40px rgba(0,0,0,.5)}
 :root:not([data-theme=light]) .dock{background:#1d2327}
 :root:not([data-theme=light]) .timer-grid button:not(.sel){background:#262d32}}
:root[data-theme=dark] .sheet-card{background:#232a2f;box-shadow:0 -1px 0 #3a444b,0 -16px 40px rgba(0,0,0,.5)}
:root[data-theme=dark] .dock{background:#1d2327}
:root[data-theme=dark] .timer-grid button:not(.sel){background:#262d32}
h1,h2,h3,.player-title{line-height:1.35}
.book-info strong{line-height:1.4}
button,.chip-mood,.badge,.pill,.mood,.tool,.control{line-height:1.5}
.bottom-nav button{font-size:13px;line-height:1.5}
.sub,.lead,.sec-head span{font-size:14px}
.read-copy{padding-top:14px}
.screen#settings{padding-bottom:calc(88px + env(safe-area-inset-bottom) + 24px)}
.shelf-tip{margin-top:16px}
.shelf-tip .lead{font-size:14px}
.shelf-tip h2{font-size:18px}
.mood-grid{display:flex;flex-wrap:wrap;justify-content:center;gap:8px}
.mood{flex:0 0 calc((100% - 24px)/4)}
@media(max-width:380px){.mood{flex-basis:calc((100% - 16px)/3)}}
.steps{list-style:none;margin:26px 0 0;padding:0;display:grid;grid-template-columns:repeat(3,1fr);gap:10px;width:100%;max-width:420px}
.steps li{display:grid;justify-items:center;gap:6px;padding:14px 8px;border:1px solid var(--line);border-radius:18px;background:var(--surface);font-size:14px;line-height:1.5}
.steps b{width:30px;height:30px;border-radius:50%;background:var(--mint);color:var(--on-mint);display:grid;place-items:center;font-size:15px}
.empty .primary{width:100%;max-width:360px}
@media(min-width:900px){
 #shelf,#settings{max-width:1060px}
 #books{display:grid;grid-template-columns:repeat(auto-fill,minmax(340px,1fr));gap:16px;align-items:stretch}
 #books>.sec-head,#books>.banner,#books>.empty,#books>.shelf-tip{grid-column:1/-1}
 #books>.sec-head{margin:14px 0 0}
 #books>.banner{margin:0;max-width:none}
 #books>.grid,#books>.grid.hero-grid{display:contents}
 .book-card.hero{grid-column:1/-1}
 #books>.add-tile{margin:0;min-height:100%;height:100%;min-height:150px;flex-direction:column;border-radius:22px}
 #books>.shelf-tip{margin-top:0;align-items:center}
 .book-info .progress{max-width:320px}
 .empty{min-height:calc(100dvh - 200px);padding-top:0}
 .steps{max-width:520px;margin-top:32px}
 .set-grid{grid-template-columns:1fr 1fr;align-items:stretch;gap:16px}
 .set-grid>.card-block:nth-child(1){grid-row:span 2}
 .set-grid .tip{grid-column:auto}
 .sheet-card{width:min(480px,92vw);padding:28px;font-size:14px}
 .sheet-card .lead,.sheet-card .sub{font-size:14px}
 .sheet h2{font-size:22px}
 .mood-grid{justify-content:center}
 .cover-lg{width:min(220px,60%);height:auto;aspect-ratio:2/3;margin:0 auto 18px}
 .cover-lg .t{font-size:22px}
 .tool{font-size:13px;min-height:64px}
 .control{font-size:13px;min-width:56px;min-height:60px}
 .read-copy{padding-top:20px}
}
@media(min-width:900px) and (max-height:760px){.cover-lg{width:min(160px,60%);height:auto}}
@media(min-width:900px){
 #books>.add-tile{grid-column:auto/-1}
 #books .grid>.book-card:only-child{grid-column:1/-1}
}
@media(min-width:900px){
 #books>.add-tile{grid-column:1/-1;height:auto;min-height:84px;flex-direction:row}
}

/* ---- polish v5 ---- */
:root{--pbg:#286457;--pfg:#fff;--scrim:rgba(20,28,26,.45)}
:root[data-theme=dark]{--pbg:#62BBA2;--pfg:#04201A;--scrim:rgba(0,0,0,.55)}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]){--pbg:#62BBA2;--pfg:#04201A;--scrim:rgba(0,0,0,.55)}}
.primary,.circle-add{background:var(--pbg);color:var(--pfg);box-shadow:0 6px 16px rgba(40,100,87,.28)}
.primary:hover{filter:brightness(1.1)}
.sheet{backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px)}
/* nothing under 13px */
.cover .t,.prow,.badge,.ring b,.passage small,.time-row,.stops,.control,.bottom-nav button,.timer-grid button small,.tool,.sec-head span,.range-label,.speed-row,.mood small,.pill{font-size:13px}
.stops{font-size:13px;color:var(--muted);font-weight:600}
.timer-grid button small{font-size:13px;font-weight:700;color:var(--mintd)}
.sub,.lead{color:color-mix(in srgb,var(--muted) 82%,var(--ink))}
.cover .t{word-break:break-word;overflow-wrap:anywhere;hyphens:auto;-webkit-line-clamp:3;font-size:13px;line-height:1.35}
.cover{padding:12px 8px 11px 14px}
.book-info .prow{gap:10px}
.prow span{min-width:0}
.prow b{flex:none;font-variant-numeric:tabular-nums;font-size:14px}
/* scroll clearance above fixed bottom nav */
@media(max-width:899px){
 .screen{padding-bottom:calc(150px + env(safe-area-inset-bottom))}
 .screen#settings{padding-bottom:calc(170px + env(safe-area-inset-bottom))}
 .screen#player{padding-bottom:calc(20px + env(safe-area-inset-bottom))}
}
@media(min-width:900px){
 .app{grid-template-columns:260px minmax(0,1fr)}
 .side{padding:36px 22px;gap:8px;background:linear-gradient(180deg,color-mix(in srgb,var(--mint) 16%,var(--surface)),var(--surface) 60%);border-inline-end:1px solid var(--line)}
 .brand{font-size:24px;padding:0 6px 28px;margin-bottom:6px;border-bottom:1px solid var(--line)}
 .logo{width:50px;height:50px;border-radius:16px;background:var(--pbg);color:var(--pfg)}
 .side button{font-size:17px;min-height:56px;font-weight:700;color:var(--ink)}
 .side button svg{width:26px;height:26px}
 .side button.on{background:var(--pbg);color:var(--pfg);box-shadow:0 6px 14px rgba(40,100,87,.22)}
 .side button:not(.on):hover{background:color-mix(in srgb,var(--mint) 30%,transparent)}
 .screen{padding:48px 56px 64px}
 #shelf,#settings{max-width:1000px;margin-inline:auto;width:100%}
 .screen#shelf.on,.screen#settings.on{min-height:100dvh}
 .head{min-height:72px;margin-bottom:22px}
 h1{font-size:38px;line-height:1.3}
 /* settings: two equal columns, equal-height rows */
 .set-grid{grid-template-columns:1fr 1fr;grid-auto-rows:1fr;align-items:stretch;gap:20px;margin-top:18px}
 .set-grid>.card-block:nth-child(1){grid-row:span 2}
 .set-grid>.card-block{padding:26px;border-radius:26px;display:flex;flex-direction:column}
 .set-grid>.card-block h2{font-size:22px}
 .set-grid>.card-block .radio-list{margin-top:14px}
 .set-grid .tip{grid-column:1/-1;grid-row:auto;flex-direction:row;align-items:center;gap:18px;background:linear-gradient(135deg,var(--lav),color-mix(in srgb,var(--mint) 40%,var(--surface)));color:var(--ink)}
 :root[data-theme=dark] .set-grid .tip{background:linear-gradient(135deg,#2e2a3a,#1f2f2c)}
 @media(prefers-color-scheme:dark){:root:not([data-theme=light]) .set-grid .tip{background:linear-gradient(135deg,#2e2a3a,#1f2f2c)}}
 .set-grid .field{margin-top:auto}
 /* shelf */
 #books{grid-template-columns:repeat(auto-fill,minmax(360px,420px));justify-content:start;gap:20px}
 .book-card.hero{grid-column:1/-1;max-width:none;padding:32px 40px;gap:40px;align-items:center}
 .hero .cover{flex-basis:190px;width:190px;height:274px}
 .hero .book-info{max-width:520px;padding-inline-end:0}
 .hero .book-info strong{font-size:32px}
 .hero .book-info .progress{max-width:none}
 .hero .book-actions{max-width:360px}
 .book-card .more{top:10px;right:10px}
 #books>.add-tile{max-width:none}
 /* player */
 .pgrid,.pgrid.v-read{grid-template-columns:440px minmax(0,1fr);gap:32px;max-width:1240px}
 .ptop{max-width:1240px}
 .cover-lg{width:min(260px,70%);aspect-ratio:2/3;height:auto}
 .controls{gap:22px;justify-content:center}
 .control{min-width:68px;min-height:68px}
 .tool{min-height:66px}
 .play{width:76px;height:76px;min-width:76px;background:var(--pbg);color:var(--pfg)}
 .pinfo{padding:28px 24px}
 .sheet-card{padding:30px}
}
.play{background:var(--pbg);color:var(--pfg)}
@media(min-width:900px){#books{grid-template-columns:repeat(auto-fill,minmax(360px,1fr))}.book-card:not(.hero){max-width:460px}.ptop,.pgrid{margin-inline:auto}}
#close,.sheet .sub-btn,.sheet .secondary{background:var(--surface);color:var(--ink);border:2px solid var(--line2);font-weight:700}
.control,.tool,.time-row,.passage small,.prow,.stops,.timer-grid button small,.bottom-nav button{font-size:14px}
:root[data-theme=dark]{--line2:#6a767e}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]){--line2:#6a767e}}
.book-card.prep .progress.ind i{width:45%;margin-left:0}
/* fixes r6 */
.bottom-nav{background:var(--canvas);backdrop-filter:none}
.screen{padding-bottom:calc(88px + env(safe-area-inset-bottom))}
@media(min-width:900px){
 .side{background:linear-gradient(180deg,color-mix(in srgb,var(--mint) 16%,var(--surface)),color-mix(in srgb,var(--mint) 6%,var(--surface)));min-height:100vh;height:100vh;align-self:start}
 .book-card.prep{grid-column:1/-1;max-width:none}
 .set-grid{grid-auto-flow:dense;grid-auto-rows:auto;align-items:start}
 .set-grid>.card-block:nth-child(1){grid-column:1;grid-row:1/span 3;align-self:stretch}
 .set-grid>.card-block:nth-child(2),.set-grid>.card-block:nth-child(3),.set-grid>.card-block:nth-child(4){grid-column:2}
 .set-grid>.tip{grid-column:1/-1}
 .screen#settings{padding-bottom:64px}
}
.icon-btn{background:var(--surface);border:1px solid var(--line2)}

/* ---- polish v7: desktop final layer ---- */
.side-foot{display:none}
:root{--tipbg:linear-gradient(135deg,#EFE7F8,#E3F1EB);--tipink:#3B2F55}
:root[data-theme=dark]{--tipbg:linear-gradient(135deg,#2B2838,#24312F);--tipink:#E6DDF3;--scrim:rgba(14,18,20,.5)}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]){--tipbg:linear-gradient(135deg,#2B2838,#24312F);--tipink:#E6DDF3;--scrim:rgba(14,18,20,.5)}}
.tip,.set-grid .tip,.shelf-tip{background:var(--tipbg)!important;color:var(--tipink);border:1px solid color-mix(in srgb,var(--tipink) 14%,transparent)}
.tip .lead,.tip h2{color:inherit}
@media(min-width:900px){
 .side{display:flex;flex-direction:column}
 .side-foot{display:block;margin-top:auto;padding:22px;border-radius:22px;background:color-mix(in srgb,var(--mint) 14%,var(--surface));border:1px solid var(--line)}
 .side-foot .side-ico{display:grid;place-items:center;width:44px;height:44px;border-radius:14px;background:var(--pbg);color:var(--pfg);margin-bottom:12px}
 .side-foot b{display:block;font-size:17px;line-height:1.5;color:var(--ink)}
 .side-foot p{margin:4px 0 0;font-size:14px;line-height:1.65;color:var(--muted)}
 .side{padding-bottom:32px}
 /* nothing under 13px on desktop */
 .sub,.lead,small,.stops,.badge,.pill,.cover .t,.sec-head span,.time-row,.prow,.range-label,.speed-row,.mood small,.timer-grid button small{font-size:14px}
 .sec-head,.sec-head b,.sec-head h2{font-size:20px}
 /* player: wider, text fills the pane */
 .pgrid,.pgrid.v-read,.ptop{max-width:1360px}
 .pgrid,.pgrid.v-read{grid-template-columns:480px minmax(0,1fr);gap:36px}
 .read-copy{max-width:720px;margin-inline:auto;padding-top:28px}
 .read-copy .para{font-size:23px;line-height:2.05;margin:0 0 30px}
 .read-head h3{font-size:26px}
 .read-head .sub{font-size:15px}
 .pright,.v-read .pright{padding:30px 56px 120px}
 .read-head{margin:-30px -56px 12px;padding:26px 56px 14px;top:-30px}
 .cover-lg{width:min(280px,66%)}
 .pinfo .player-title{font-size:28px}
 .player-meta{font-size:15px}
 .tool,.control{font-size:14px}
 /* settings: voice card fills its height */
 .set-grid>.card-block:nth-child(1) .radio-list{flex:1;grid-auto-rows:minmax(64px,1fr);gap:12px}
 .set-grid>.card-block:nth-child(1) .radio{font-size:18px;height:100%}
 .set-grid .lead{font-size:15px}
 .set-grid>.tip{padding:26px 30px}
 .set-grid>.tip h2{font-size:20px}
 .set-grid>.tip .lead{font-size:16px;max-width:760px}
 /* shelf */
 .shelf-tip{padding:24px 30px;border-radius:26px;gap:18px}
 .shelf-tip h2{font-size:20px}
 .shelf-tip .lead{font-size:16px;line-height:1.75}
 .tip-ico{width:52px;height:52px}
 .hero .book-info{max-width:640px}
 .hero .book-info small{font-size:16px}
 /* modals */
 .sheet-card{width:min(560px,92vw);padding:34px;font-size:16px}
 .sheet-card .lead,.sheet-card .sub{font-size:16px;line-height:1.65}
 .sheet h2{font-size:26px}
 .sheet-card .radio,.sheet-card .segmented button{font-size:17px}
 .sheet-card .stops,.sheet-card .range-label,.sheet-card .speed-row,.sheet-card small{font-size:14px}
 .sheet-card button{font-size:16px}
 .sheet{backdrop-filter:blur(6px)}
}
@media(min-width:900px){
 .cover-lg{width:min(210px,60%);margin-bottom:14px}
 .pinfo{padding:22px 24px}
 .pinfo .player-title{font-size:26px}
}
@media(min-width:900px) and (max-height:820px){.cover-lg{width:min(190px,56%)}}
.tip-ico{background:color-mix(in srgb,var(--mint) 38%,transparent);color:var(--tipink)}
[data-theme=dark] .tip-ico{background:color-mix(in srgb,var(--mint) 30%,transparent)}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]) .tip-ico{background:color-mix(in srgb,var(--mint) 30%,transparent)}}

/* ===== final polish layer (round 5) ===== */
:root{--r-card:24px;--r-in:16px;--bd:#B9C6BF;--track:#D3DDD7}
:root[data-theme=dark]{--bd:#5D6A72;--track:#4A565E}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]){--bd:#5D6A72;--track:#4A565E}}
.sub{font-size:14px}.stops,.time-row,.range-label{font-size:13px}
.radio::after{border-color:var(--bd)}
.radio,.card-block,.field,.segmented{border-color:var(--bd)}
.progress{background:var(--track)}
.progress i{background:var(--mintd)}
:root[data-theme=dark] .progress i{background:#7FD3BA}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]) .progress i{background:#7FD3BA}}
.play{background:var(--mintd)!important;color:#fff!important;opacity:1!important}
:root[data-theme=dark] .play{background:#7FD3BA!important;color:#04201A!important}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]) .play{background:#7FD3BA!important;color:#04201A!important}}
.tip{border-radius:var(--r-card);background:linear-gradient(135deg,var(--lav),color-mix(in srgb,var(--mint) 35%,var(--lav)));border:1px solid color-mix(in srgb,var(--lav-ink) 18%,transparent);padding:20px}
.tip-ico{width:48px;height:48px;color:var(--lav-ink);box-shadow:0 4px 12px rgba(89,65,111,.14)}
.tip h2{margin-bottom:4px}
.card-block,.book-card,.dock,.pinfo{border-radius:var(--r-card)}
.sheet-card{padding:28px 24px calc(28px + env(safe-area-inset-bottom))}
.sheet-card .mood{min-height:56px;font-size:15px}
.sheet-card button,.sheet-card .chip{font-size:15px}
.timer-grid button{min-height:52px;font-size:16px}
.sheet-card .sub,.sheet-card .lead,.sheet-card small,.cap-auto{font-size:13.5px;line-height:1.5}
.prep .progress.ind{width:100%;height:10px;background:var(--track)}
.prep .progress.ind i{background:var(--lav-bar)}
.book-info,.book-card .book-info{min-width:0}
.prep .prow{font-size:14px}

@media(max-width:899px){
 .screen{padding-bottom:132px}
 #settings{padding-bottom:140px}
 .set-grid{gap:16px}
 .card-block{padding:20px}
 .radio-list{gap:10px}
 .radio{min-height:56px}
 .bottom-nav button{font-size:13px}
 .stops,.time-row,.ring b{font-size:13px}
 .tool span,.control span{font-size:13px}
 .pgrid.v-play .dock{margin-top:0}
 .empty{padding-top:clamp(48px,11dvh,110px)}
 .empty-art{margin-bottom:28px}
}

@media(min-width:900px){
 html{font-size:17px}
 body{font-size:17px;line-height:1.6}
 .app{max-width:none;grid-template-columns:272px minmax(0,1fr)}
 .side{background:color-mix(in srgb,var(--surface) 70%,var(--canvas));border-inline-end:1px solid var(--line);padding:32px 20px;gap:8px}
 .side button{font-size:17px;min-height:56px}
 .side-foot{margin-top:auto}
 .side-foot b{font-size:16px}.side-foot p{font-size:14px;line-height:1.6}
 .screen{padding:48px 56px 64px}
 #shelf,#settings{max-width:1120px;margin-inline:auto;width:100%}
 h1{font-size:38px;line-height:1.3}
 .sub{font-size:15px}
 .stops,.time-row,.range-label,.prow,.badge,.chip-mood,.passage small,.read-head .sub,.ptitle-wrap .sub,.cap-auto{font-size:14px}
 .book-card strong{font-size:19px}
 .book-card small{font-size:14px}
 .prow{font-size:14px}
 .tool span,.control span{font-size:14px}
 .ptop,.pgrid{max-width:1240px}
 .pgrid,.pgrid.v-read{grid-template-columns:420px minmax(0,1fr)}
 .read-copy,#text{font-size:20px;line-height:2}
 .set-grid{grid-template-columns:1fr 1fr;align-items:stretch;gap:20px}
 .set-grid .card-block{padding:26px 28px}
 .set-grid .card-block h2{font-size:20px}
 .set-grid .lead{font-size:15px}
 .set-grid .radio{min-height:56px;font-size:17px}
 .set-grid .field{min-height:52px;font-size:16px}
 .set-grid .tip{padding:26px 28px}
 .set-grid .tip .lead{font-size:16px}
 .empty{padding-top:clamp(40px,8dvh,100px)}
 .empty-art{width:clamp(220px,18vw,280px);height:clamp(210px,17vw,268px);margin:8px auto 32px}
 .empty-art .ba,.empty-art .bb{width:52%;height:74%}
 .empty-art .sun{width:22%;height:22%}
 .empty h2{font-size:clamp(30px,2.4vw,36px);line-height:1.3}
 .empty p{max-width:600px;text-wrap:balance;font-size:18px;line-height:1.7}
 .empty .primary{max-width:420px;min-height:60px;font-size:18px}
 .steps{max-width:720px;margin-inline:auto;gap:16px}
 .steps li{padding:24px 16px;font-size:16px;min-height:128px;border-radius:var(--r-card);align-content:center;gap:10px}
 .steps b{width:36px;height:36px;font-size:17px}
 .sheet-card{width:min(560px,90vw);max-width:none;padding:28px}
 .sheet-card h2,.sheet-card h3{font-size:22px}
 .sheet-card .mood{min-height:48px;font-size:15px}
 .sheet-card .stops,.sheet-card .range-label,.sheet-card .mood small,.sheet-card .cap-auto{font-size:13px}
 .timer-grid button{min-height:52px;font-size:16px}
 .banner{max-width:none}
 .banner span,.banner b{font-size:15px}
}
.book-card .book-info{flex:1 1 auto;min-width:0;width:100%}
.book-card .book-info .progress,.book-card.prep .progress{width:100%;max-width:none}
.book-card.prep .progress.ind{height:10px}
.book-card.prep .progress.ind i{width:42%!important}
.sec-head a,.sec-head span,.sec-head button{font-size:14px}
@media(min-width:900px){.book-card.prep{padding:22px 24px}.book-card.prep .book-info{gap:2px}.book-card.prep .prow span{font-size:15px}}

/* ===== round 4 layer ===== */
/* shelf: prep card replaces banner */
#books:has(.book-card.prep)>.banner:not(.offline){display:none}
.book-card.prep .prow span{font-size:14px}
.book-card .prow,.book-card small{font-size:14px}
/* dark contrast */
@media(prefers-color-scheme:dark){
 :root:not([data-theme=light]){--line2:#6a767e;--hl:#3d3432;--muted:#C2CCCE}
 :root:not([data-theme=light]) .passage{background:#2f2b2c;border-inline-start-color:var(--coral)}
 :root:not([data-theme=light]) .passage p{color:#F7F5EF}
 :root:not([data-theme=light]) .mood:not(.sel){background:#2b3338;border-color:#6a767e;color:#EDEBE5}
 :root:not([data-theme=light]) .mood .em{color:#C9D3D5}
 :root:not([data-theme=light]) .add-tile{border-color:#7f8c94;color:#CDEFE2;background:rgba(134,197,176,.08)}
 :root:not([data-theme=light]) .sheet-card .stops,:root:not([data-theme=light]) .sheet-card .range-label,:root:not([data-theme=light]) .sheet-card .mood small{color:#C9D3D5}
}
:root[data-theme=dark] .passage{background:#2f2b2c}
:root[data-theme=dark] .mood:not(.sel){background:#2b3338;border-color:#6a767e;color:#EDEBE5}
:root[data-theme=dark] .add-tile{border-color:#7f8c94;color:#CDEFE2;background:rgba(134,197,176,.08)}
.mood-grid{grid-template-columns:repeat(auto-fit,minmax(78px,1fr))}
/* mobile */
@media(max-width:899px){
 .pinfo{padding-bottom:calc(232px + env(safe-area-inset-bottom));min-height:calc(100dvh - 76px - 232px - env(safe-area-inset-bottom))}
 .read-link{margin-top:2px}
 .screen{padding-bottom:calc(112px + env(safe-area-inset-bottom))}
 #settings .radio-list{gap:8px}
 #settings .radio{min-height:48px;padding-block:6px;font-size:16px}
 #settings .card-block{padding:18px}
 #books>.add-tile,#books .add-tile{min-height:64px}
 .shelf-tip{margin-bottom:8px}
 .mood-grid{grid-template-columns:repeat(4,1fr)}
}
@media(max-width:899px) and (max-width:359px){.mood-grid{grid-template-columns:repeat(3,1fr)}}
/* desktop */
@media(min-width:900px){
 .sheet-card{width:min(580px,92vw)!important;padding:32px!important}
 .sheet-card h2,.sheet-card h3{font-size:24px!important}
 .sheet-card .lead,.sheet-card p{font-size:16px!important}
 .sheet-card .radio,.sheet-card .mood,.sheet-card .segmented button{font-size:16px!important}
 .sheet-card .stops,.sheet-card .range-label,.sheet-card .mood small,.sheet-card .cap-auto,.sheet-card .stops span{font-size:14px!important}
 .sheet-card .timer-grid button{font-size:17px!important}
 .mood-grid{grid-template-columns:repeat(4,1fr)}
 /* shelf hero two-column */
 #books .book-card.hero{max-width:980px;margin-inline:auto;padding:32px 40px;gap:44px;justify-content:flex-start}
 #books .hero .cover{flex-basis:210px;width:210px;height:300px}
 #books .hero .book-info{max-width:560px;flex:1}
 #books .hero .book-info strong{font-size:28px;line-height:1.35}
 #books .hero .book-info small,#books .hero .prow{font-size:15px}
 #books .hero .book-actions{max-width:340px}
 #books .book-card.prep{max-width:980px;margin-inline:auto;padding:22px 28px}
 #books .book-card.prep .book-info{max-width:none}
 #books .book-card.prep .progress{max-width:420px}
 #books .book-card.prep strong{font-size:20px}
 #books .book-card.prep small,#books .book-card.prep .prow span{font-size:15px}
 #books .sec-head{max-width:980px;margin-inline:auto;width:100%}
 /* player */
 .pgrid,.pgrid.v-read{grid-template-columns:460px minmax(0,1fr)}
 .cover-lg{width:min(260px,32dvh*.75*1.5);height:min(348px,40dvh)}
 .player-title{font-size:26px}.player-meta{font-size:16px}
 .controls .control span,.tool span,.time-row,.time-row span{font-size:15px}
 .tool{min-height:52px}
 .tool span{font-size:15px}
 /* settings */
 .set-grid{align-items:stretch}
 .set-grid .tip{align-items:center;justify-content:center;text-align:center;flex-direction:column}
 .set-grid .tip>div{max-width:420px}
 .set-grid .tip .lead{font-size:16px;max-width:420px;margin-inline:auto}
 /* empty */
 .empty h2{font-size:clamp(34px,2.8vw,42px)}
 .empty p{font-size:20px;max-width:640px}
 .steps li{font-size:18px}
 .empty .primary{font-size:19px}
}
@media(min-width:900px) and (max-height:760px){.cover-lg{width:150px;height:200px}}
@media(min-width:900px){
 #books .book-card.hero,#books .book-card.prep,#books .sec-head{max-width:none;margin-inline:0;width:auto}
 #books .book-card.hero{padding:32px 44px;gap:48px}
 #books .hero .book-info{max-width:none}
 #books .hero .book-info .progress{max-width:520px}
 #books .book-card.prep .progress{max-width:420px}
 #player .player-title{font-size:28px;line-height:1.35}
 #player .player-meta{font-size:16px}
 #player .time-row,#player .time-row span{font-size:15px}
 #player .controls .control span,#player .tool span{font-size:15px}
 #player .control svg{width:28px;height:28px}
 #player .play{width:80px;height:80px}
 #player .tool{min-height:56px}
}
.mood-grid{display:grid!important;grid-template-columns:repeat(12,1fr)!important;gap:8px}
.mood-grid>.mood{grid-column:span 3;width:auto;min-width:0}
.mood-grid>.mood:nth-child(n+5){grid-column:span 4}
@media(min-width:900px){
 #books .hero .book-info .prow,#books .hero .book-info .progress{max-width:520px;width:100%}
 #books .book-card.prep{gap:24px;padding:26px 32px}
 #books .book-card.prep .cover{flex:0 0 112px;width:112px;height:160px}
 #books .book-card.prep .book-info{justify-content:center}
 #books .book-card.prep .progress,#books .book-card.prep .prow{max-width:420px;width:100%}
 .sheet-card .mood{font-size:16px!important}
}
@media(min-width:900px){
 #books .hero .book-info .prow,#books .hero .book-info .progress{max-width:640px}
 #books .hero .book-actions{max-width:420px}
 #books .book-card.prep .progress,#books .book-card.prep .prow{max-width:560px}
}

/* ===== final layer r7: desktop shelf/dialogs, dark surfaces, player contrast, 390 sheets ===== */
.book-card.prep .progress.ind i{background:var(--mintd)}
.book-card.prep .prow b{color:var(--mintd)}
.book-card.prep .badge{background:color-mix(in srgb,var(--mint) 38%,var(--surface));color:var(--mintd);border:1px solid color-mix(in srgb,var(--mint) 70%,transparent)}
.book-card.prep{background:color-mix(in srgb,var(--mint) 12%,var(--surface));border-color:color-mix(in srgb,var(--mint) 55%,var(--line))}
.sheet-card .radio::after,.radio::after{width:22px;height:22px;border-width:2px}
.radio.sel::after{border:7px solid var(--mintd);background:var(--surface)}
.timer-grid button.sel{box-shadow:0 0 0 3px color-mix(in srgb,var(--mintd) 28%,transparent);font-weight:700}
@media(max-width:899px){
 #books .shelf-tip{margin-top:20px}
 #books{padding-bottom:28px}
 .sheet-card .mood-grid{gap:10px!important}
 .sheet-card .mood{min-height:64px;padding:10px 6px}
 .sheet-card .segmented{margin-block:14px 16px}
 .sheet-card h2{margin-bottom:6px}
 .sheet-card .timer-grid{gap:12px}
 .sheet-card .timer-grid button{min-height:64px}
 .timer-grid button.sel{background:var(--mintd);color:#fff;border-color:var(--mintd)}
 .timer-grid button.sel small{color:rgba(255,255,255,.88)}
}
@media(min-width:900px){
 #books .book-card.hero .cover,#books .hero .cover{width:160px!important;height:auto!important;aspect-ratio:3/4;max-height:213px;flex:0 0 160px!important}
 #books .book-card.hero{padding:28px 40px;gap:40px;align-items:center}
 #books .hero .book-info strong{font-size:30px;line-height:1.3}
 #books .hero .book-info small,#books .hero .prow,#books .hero .prow span{font-size:17px}
 #books .hero .book-info .prow,#books .hero .book-info .progress{max-width:none}
 #books .hero .book-actions{max-width:360px}
 #books .book-card.prep{padding:24px 32px;align-items:center;gap:28px;min-height:0}
 #books .book-card.prep .cover{flex:0 0 112px;width:112px;height:150px}
 #books .book-card.prep strong{font-size:24px}
 #books .book-card.prep small{font-size:17px}
 #books .book-card.prep .badge{font-size:15px;padding:3px 14px}
 #books .book-card.prep .progress,#books .book-card.prep .progress.ind,#books .book-card.prep .prow{max-width:none;width:100%}
 #books .book-card.prep .progress.ind{height:6px;margin-top:14px;border-radius:99px}
 #books .book-card.prep .prow span{font-size:16px}
 #books .shelf-tip h2{font-size:20px}
 #books .shelf-tip .lead{font-size:17px}
 /* dialogs */
 .sheet-card{font-size:16px}
 .sheet-card h2{font-size:24px;line-height:1.35}
 .sheet-card .lead,.sheet-card p{font-size:17px;line-height:1.6}
 .sheet-card .mood,.sheet-card .chip-mood{min-height:56px;font-size:17px!important}
 .sheet-card .radio{min-height:60px;font-size:18px}
 .sheet-card .radio-list,.sheet-card .timer-grid,.sheet-card .mood-grid{gap:12px!important}
 .sheet-card .timer-grid button{min-height:64px;font-size:18px}
 .sheet-card .stops,.sheet-card .range-label,.sheet-card .speed-row,.sheet-card small,.sheet-card .cap-auto{font-size:15px}
 .sheet-card .segmented button{min-height:52px;font-size:17px}
 /* settings tip */
 .set-grid>.tip,.set-grid .tip{text-align:start}
 .set-grid .tip .lead,.set-grid .tip>div,.set-grid .tip p{text-align:start;font-size:17px;line-height:1.65}
 .set-grid{align-items:stretch}
 .set-grid>.card-block{height:auto}
 /* player */
 #player .ptitle-wrap .sub,#player .read-head .sub,#player .pinfo .sub{color:var(--ink);opacity:.82;font-size:15px}
 #player .ptitle-wrap b{font-size:19px}
 #player .control svg{width:32px;height:32px}
 #player .play{width:88px;height:88px}
 #player .controls .control{min-width:72px;min-height:72px}
}
:root[data-theme=dark] .tip,:root[data-theme=dark] .shelf-tip,:root[data-theme=dark] .set-grid>.tip{background:#1f2a2b;border:1px solid #2f4b47;box-shadow:inset 3px 0 0 var(--mint)}
:root[data-theme=dark] .passage{background:#1c2a2a;border:1px solid #2f4b47;box-shadow:inset 3px 0 0 var(--mint)}
:root[data-theme=dark] .passage p{color:var(--ink)}
:root[data-theme=dark] .mood.sel{background:#1f3a37;border:2px solid var(--mint);color:var(--ink)}
:root[data-theme=dark] .book-card.prep{background:#1c2a2a;border-color:#2f4b47}
:root[data-theme=dark] .ptitle-wrap .sub,:root[data-theme=dark] .read-head .sub{color:#d5dedc}
@media(prefers-color-scheme:dark){
 :root:not([data-theme=light]) .tip,:root:not([data-theme=light]) .shelf-tip,:root:not([data-theme=light]) .set-grid>.tip{background:#1f2a2b;border:1px solid #2f4b47;box-shadow:inset 3px 0 0 var(--mint)}
 :root:not([data-theme=light]) .passage{background:#1c2a2a;border:1px solid #2f4b47;box-shadow:inset 3px 0 0 var(--mint)}
 :root:not([data-theme=light]) .passage p{color:var(--ink)}
 :root:not([data-theme=light]) .mood.sel{background:#1f3a37;border:2px solid var(--mint);color:var(--ink)}
 :root:not([data-theme=light]) .book-card.prep{background:#1c2a2a;border-color:#2f4b47}
 :root:not([data-theme=light]) .ptitle-wrap .sub,:root:not([data-theme=light]) .read-head .sub{color:#d5dedc}
 :root:not([data-theme=light]) .timer-grid button.sel{background:var(--mint);color:var(--on-mint)}
}
@media(min-width:900px){.sheet-card{width:min(680px,92vw)!important;max-width:680px!important;padding:32px 36px!important}.sheet-card .mood{min-height:60px}.sheet-card .toggle-row,.sheet-card .field{min-height:68px}}
:root[data-theme=dark]{--hl:#23403d}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]){--hl:#23403d}}
:root[data-theme=dark] .s.cur{box-shadow:inset 0 -2px 0 var(--mint)}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]) .s.cur{box-shadow:inset 0 -2px 0 var(--mint)}}
@media(min-width:900px){
 .set-grid>.tip{display:flex!important;flex-direction:row!important;align-items:flex-start!important;justify-content:flex-start!important;gap:20px;text-align:start!important;padding:28px 36px}
 .set-grid>.tip>div{text-align:start!important;max-width:none;flex:1}
 .set-grid>.tip .tip-ico{flex:none;margin:0}
 .set-grid>.tip h2{font-size:22px}
 .set-grid .segmented button{font-size:17px;min-height:52px}
 .set-grid .lead{font-size:16px}
}
@media(min-width:900px){
 .set-grid>.tip .lead,.set-grid>.tip>div>*{margin:6px 0 0!important;max-width:none!important;width:auto!important;text-align:start!important;align-self:flex-start}
 .set-grid>.tip h2{margin:0!important}
}
.set-grid>.tip,.shelf-tip{background:color-mix(in srgb,var(--mint) 16%,var(--surface))}
:root[data-theme=dark] .set-grid>.tip,:root[data-theme=dark] .shelf-tip{background:#1f2a2b}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]) .set-grid>.tip,:root:not([data-theme=light]) .shelf-tip{background:#1f2a2b}}
.set-grid>.tip,.set-grid .tip,.card-block.tip,#books>.shelf-tip,.shelf-tip{background-image:none!important;background-color:color-mix(in srgb,var(--mint) 16%,var(--surface))!important}
:root[data-theme=dark] .card-block.tip,:root[data-theme=dark] .shelf-tip,:root[data-theme=dark] .set-grid>.tip{background-color:#1f2a2b!important}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]) .card-block.tip,:root:not([data-theme=light]) .shelf-tip,:root:not([data-theme=light]) .set-grid>.tip{background-color:#1f2a2b!important}}
.sheet-card .timer-grid button.sel{background:var(--mintd)!important;color:#fff!important;border-color:var(--mintd)!important;box-shadow:0 0 0 4px color-mix(in srgb,var(--mint) 55%,transparent)!important}
.sheet-card .timer-grid button.sel small{color:rgba(255,255,255,.9)!important}
.sheet-card .mood.sel{background:color-mix(in srgb,var(--mint) 35%,var(--surface))!important;border-color:var(--mintd)!important}
:root[data-theme=dark] .sheet-card .timer-grid button.sel{background:var(--mint)!important;color:var(--on-mint)!important}
:root[data-theme=dark] .sheet-card .timer-grid button.sel small{color:var(--on-mint)!important}
:root[data-theme=dark] .sheet-card .mood.sel{background:#1f3a37!important;border-color:var(--mint)!important}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]) .sheet-card .timer-grid button.sel{background:var(--mint)!important;color:var(--on-mint)!important}:root:not([data-theme=light]) .sheet-card .timer-grid button.sel small{color:var(--on-mint)!important}:root:not([data-theme=light]) .sheet-card .mood.sel{background:#1f3a37!important;border-color:var(--mint)!important}}
.sheet-card .timer-grid button.rec:not(.sel){background:color-mix(in srgb,var(--mint) 30%,var(--surface));border:2px solid var(--mintd)}
.sheet-card .timer-grid button.rec:not(.sel) small{color:var(--mintd);font-weight:700}

/* ===== final layer r8 ===== */
/* preparing progress: light full-width track, fill grows from left */
.book-card.prep .progress.ind{background:color-mix(in srgb,var(--mint) 30%,var(--surface));height:8px;position:relative;overflow:hidden}
.book-card.prep .progress.ind i{display:block;width:0!important;margin-left:0!important;height:100%;background:linear-gradient(90deg,var(--mint),var(--mintd));animation:grow8 2.4s ease-in-out infinite}
@keyframes grow8{0%{width:28%}70%{width:100%;opacity:1}100%{width:100%;opacity:.25}}
@media(prefers-reduced-motion:reduce){.book-card.prep .progress.ind i{animation:none;width:60%!important}}
.book-card.prep .badge{background:var(--mintd);color:#fff;border-color:var(--mintd);font-weight:700}
.book-card.prep .badge .pulse{background:#fff}
:root[data-theme=dark] .book-card.prep .progress.ind{background:#2a3d3b}
:root[data-theme=dark] .book-card.prep .badge{background:var(--mint);color:var(--on-mint);border-color:var(--mint)}
:root[data-theme=dark] .book-card.prep .badge .pulse{background:var(--on-mint)}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]) .book-card.prep .progress.ind{background:#2a3d3b}:root:not([data-theme=light]) .book-card.prep .badge{background:var(--mint);color:var(--on-mint);border-color:var(--mint)}:root:not([data-theme=light]) .book-card.prep .badge .pulse{background:var(--on-mint)}}
/* shelf mobile */
#books{padding-bottom:calc(96px + env(safe-area-inset-bottom))}
#books .sec-head{align-items:baseline;margin:18px 0 10px}
#books .sec-head span{line-height:26px}
#books .add-tile{border:2px dashed var(--mintd);min-height:64px;font-weight:700;background:color-mix(in srgb,var(--mint) 8%,transparent)}
#books .shelf-tip{margin-top:14px;padding:14px 16px;gap:12px;align-items:flex-start;border:1px solid var(--line);box-shadow:inset 0 2px 0 var(--mint)!important;background-color:color-mix(in srgb,var(--mint) 8%,var(--surface))!important}
#books .shelf-tip h2{font-size:16px;line-height:24px}
#books .shelf-tip .lead{font-size:14px;line-height:22px}
#books .shelf-tip .tip-ico{width:36px;height:36px}
:root[data-theme=dark] #books .shelf-tip{background-color:#1b2526!important;border-color:#2f4b47}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]) #books .shelf-tip{background-color:#1b2526!important;border-color:#2f4b47}}
@media(max-width:899px){#books .add-tile{margin-bottom:6px}#books .shelf-tip{margin-top:12px}}
/* desktop shelf */
@media(min-width:900px){
 #books{max-width:1040px;margin:0 auto;min-height:0}
 #books:has(.hero-grid){display:grid;grid-template-columns:minmax(0,1.55fr) minmax(0,1fr);column-gap:24px;align-items:start;max-width:1120px}
 #books:has(.hero-grid)>*{grid-column:1/-1}#books:has(.hero-grid)>.sec-head+.grid.hero-grid{display:contents}
 #books:has(.hero-grid) .book-card.hero{grid-column:1;grid-row:span 2}#books:has(.hero-grid) .book-card:not(.hero){grid-column:1/-1}
 #books:has(.hero-grid)>.add-tile{grid-column:2;margin-top:0;min-height:96px}
 #books:has(.hero-grid)>.shelf-tip{grid-column:2;margin-top:0;padding:20px 22px;align-self:stretch}
 #books:has(.hero-grid)>.sec-head:has(+.hero-grid){grid-column:1;grid-row:auto}
 #books .shelf-tip h2{font-size:18px}
 #books .shelf-tip .lead{font-size:15px;line-height:24px}
 #books .book-card.hero{flex-wrap:nowrap;padding:24px 28px;gap:28px}
 #books .hero .book-info strong{font-size:26px}
 #books .book-card.prep{padding:22px 28px}
 #books .book-card.prep .cover{flex:0 0 112px;width:112px;height:150px;min-width:112px;overflow:hidden}
 #books .book-card.prep .cover *{font-size:13px!important;line-height:1.3!important}
 #books .book-card.prep .book-info{min-width:0;flex:1}
 .empty{min-height:calc(100dvh - 380px)}
}
/* emotion tiles */
.mood-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
.mood-grid .mood{min-width:0;width:100%;white-space:nowrap}
@media(min-width:900px){.sheet-card .mood-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-top:12px}.sheet-card .mood{min-height:64px}.sheet-card #custom{margin-bottom:0}}
/* timer */
.timer-grid button{border:2px solid var(--line2);font-weight:600}
.timer-grid button small{white-space:nowrap}
.sheet-card .timer-grid button.rec:not(.sel) small{white-space:nowrap;display:inline-block;padding:1px 10px;border-radius:99px;font-size:12px;line-height:18px}
.sheet-card .timer-grid button.sel{font-weight:800}
.sheet-card .timer-grid button.sel::after{content:"✓";margin-inline-start:8px}
/* radios */
:root[data-theme=dark] .radio::after{border-color:#8da5a1}
:root[data-theme=dark] .radio.sel{background:#1d3532;border-color:var(--mint)}
:root[data-theme=dark] .radio.sel::after{border:2px solid var(--mint);background:radial-gradient(circle,var(--mint) 0 4px,transparent 5px)}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]) .radio::after{border-color:#8da5a1}:root:not([data-theme=light]) .radio.sel{background:#1d3532;border-color:var(--mint)}:root:not([data-theme=light]) .radio.sel::after{border:2px solid var(--mint);background:radial-gradient(circle,var(--mint) 0 4px,transparent 5px)}}
/* player */
.read-link{font-size:17px;font-weight:700;min-height:44px;padding:0 18px;border-radius:99px;background:color-mix(in srgb,var(--mint) 22%,var(--surface));margin-top:10px}
:root[data-theme=dark] .passage{background:#22302f;border:1px solid #3a5a56}
:root[data-theme=dark] .read-link{background:#23403d;color:#bfeee2}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]) .passage{background:#22302f;border:1px solid #3a5a56}:root:not([data-theme=light]) .read-link{background:#23403d;color:#bfeee2}}
.mood-grid{grid-template-columns:repeat(8,minmax(0,1fr))!important}
.mood-grid .mood{grid-column:span 2}
.mood-grid .mood:nth-child(5){grid-column:2/4}
.sheet-card .timer-grid button.rec:not(.sel) small{background:var(--mintd);color:#fff;font-weight:700;margin-inline-start:6px}
:root[data-theme=dark] .sheet-card .timer-grid button.rec:not(.sel) small{background:var(--mint);color:var(--on-mint)}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]) .sheet-card .timer-grid button.rec:not(.sel) small{background:var(--mint);color:var(--on-mint)}}
@media(max-width:380px){.mood-grid{grid-template-columns:repeat(8,minmax(0,1fr))!important}}
.mood-grid .mood:nth-child(5){grid-column:2/4!important}
.mood-grid .mood:nth-child(6){grid-column:4/6!important}
.mood-grid .mood:nth-child(7){grid-column:6/8!important}

/* offline + pdf page view */
.off{margin-top:10px;display:flex;flex-direction:column;gap:6px;align-items:flex-start}
.off .progress{width:100%}
.off .prow{width:100%;margin-top:0;padding-top:2px}
.off .badge{margin-top:0}
.off .badge svg{width:15px;height:15px}
.off .dlbtn{min-height:44px;padding:8px 16px;font-size:14px;font-weight:700}
.pv{position:fixed;inset:0;z-index:60;display:flex;flex-direction:column;background:var(--soft);color:var(--ink);font-family:var(--font)}
.pv[hidden]{display:none}
.pv-top{display:flex;align-items:center;gap:10px;padding:calc(env(safe-area-inset-top) + 8px) 12px 8px;background:var(--surface);border-bottom:1px solid var(--line)}
.pv-title{flex:1;min-width:0;display:flex;flex-direction:column}
.pv-title b{font-size:15px;line-height:22px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pv-title span{font-size:13px;line-height:18px;color:var(--muted)}
.pv-tg{min-height:44px;padding:0 16px;border-radius:99px;border:1.5px solid var(--line2);background:transparent;color:var(--ink);font:700 14px var(--font)}
.pv-tg.on{background:var(--mint);color:var(--on-mint);border-color:var(--mint)}
.pv-stage{position:relative;flex:1;min-height:0;display:flex;align-items:center;justify-content:center;overflow:hidden;touch-action:pan-y;cursor:pointer;-webkit-user-select:none;user-select:none}
.pv-stage canvas{background:#fff;border-radius:6px;box-shadow:0 6px 28px rgba(0,0,0,.22)}
.pv-load{position:absolute;left:0;right:0;top:50%;text-align:center;color:var(--muted);font-size:15px;pointer-events:none}
.pv-state{position:absolute;right:20px;bottom:18px;width:56px;height:56px;border-radius:50%;background:var(--mint);color:var(--on-mint);display:none;align-items:center;justify-content:center;box-shadow:var(--sh)}
.pv-state.on{display:flex}.pv-state svg{width:26px;height:26px}
.pv-cap{padding:12px 18px;background:var(--surface);border-top:1px solid var(--line);font-size:17px;line-height:1.6;max-height:28vh;overflow:auto;text-align:center}
.pv-cap[hidden]{display:none}
.pv-bot{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 14px calc(env(safe-area-inset-bottom) + 8px);background:var(--surface);border-top:1px solid var(--line)}
.pv-hint{font-size:13px;color:var(--muted);text-align:center}
.pv-bot .control{min-width:56px;min-height:48px}
body.pv-on{overflow:hidden}
#toPages{display:inline-flex!important}
