:root { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; color: #212922; background: #f7f4ee; font-synthesis: none; }
*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button{cursor:pointer}button:disabled{opacity:.4;cursor:not-allowed}
.loading-cover{padding:18vh 12px;text-align:center;color:#23463d}
.app-shell{min-height:100svh;padding-bottom:env(safe-area-inset-bottom)}.app-header{background:linear-gradient(155deg,#13392c,#254f3f);color:white;display:flex;align-items:center;gap:12px;padding:calc(11px + env(safe-area-inset-top)) 16px 13px;box-shadow:0 2px 10px #183b3129;position:sticky;top:0;z-index:10}
.logo{width:55px;height:55px;border-radius:14px;object-fit:cover;box-shadow:0 0 0 2px #c9ab66}.brand{flex:1;min-width:0}.brand h1{font-size:1.27rem;line-height:1.25;margin:0}.brand small{color:#f0dfb8;font-size:.82rem}.menu-back,.icon-button{border:1px solid #c0bbab80;border-radius:14px;background:#fffc;color:#143a2d;min-height:41px;padding:0 12px}
.app-header .menu-back{background:#ffffff1a;color:#fff;border-color:#ffffff60}
main{max-width:1030px;margin:auto;padding:18px 15px 55px}.intro{margin:3px 3px 20px}.intro h2{margin:0 0 7px;font-size:1.35rem;color:#1b4937}.subtle{color:#6c776f;font-size:.92rem;line-height:1.6}.status-bar{display:flex;flex-wrap:wrap;gap:10px;align-items:center;justify-content:space-between;border-radius:13px;padding:9px 12px;background:#ecf2ed;color:#285039;font-size:.83rem;margin:15px 0}
.category-title{color:#1e493a;margin:21px 3px 9px;font-size:1.15rem;border-bottom:1px solid #d9ddcf;padding-bottom:7px}.menu-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:12px}.menu-card{display:flex;align-items:center;gap:12px;width:100%;text-align:right;background:#fff;border:1px solid #dedcd3;border-radius:19px;padding:18px 16px;box-shadow:0 3px 12px #25351d0b;color:#252c26}.menu-card:hover{border-color:#c9aa69}.menu-card:focus-visible,button:focus-visible{outline:3px solid #e4b64d;outline-offset:3px}.menu-card .symbol{width:48px;height:48px;flex:none;display:grid;place-items:center;background:#f5efe2;border-radius:12px;color:#ad8430;font-size:24px}.menu-card .card-copy{flex:1}.card-copy strong{font-size:1.1rem;display:block}.card-copy small{color:#878a85;display:block;margin-top:4px}.arrow{color:#ba993e;font-size:1.4rem}
.toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;background:#fff;border:1px solid #deddd2;border-radius:15px;padding:9px;margin:0 0 14px;position:sticky;top:82px;z-index:9;box-shadow:0 4px 12px #0000000b}.toolbar .tools{display:flex;gap:6px;align-items:center;flex-wrap:wrap}.toolbar button,.pill{border:1px solid #ded8c9;background:#fdfaf3;border-radius:11px;padding:9px 12px;color:#254e3c}.toolbar input{width:68px;border:1px solid #d8d1c1;border-radius:9px;padding:9px 5px;text-align:center;direction:ltr}.toolbar strong{color:#224b3b}.reader-title{margin:0 0 10px;color:#244c3b;font-size:1.2rem}
.pdf-pages{display:flex;flex-direction:column;align-items:center;gap:17px;min-height:60vh}.page-slot{width:min(100%,760px);min-height:350px;aspect-ratio:468/668;background:white;border:1px solid #dadada;box-shadow:0 4px 15px #302e2538;position:relative;overflow:hidden}.page-slot canvas{width:100%;height:100%;display:block}.page-label{position:absolute;bottom:0;left:0;background:#17382fd4;color:white;font-size:.74rem;padding:5px 8px;border-radius:0 10px 0 0;z-index:2}.page-loading{position:absolute;top:48%;left:0;right:0;text-align:center;color:#89918c;font-size:.88rem}.page-slot .page-audio{position:absolute;bottom:33px;left:10px;z-index:4}.section-notice{padding:9px 12px;border:1px solid #e6dfd2;background:#fffaf0;color:#79603d;border-radius:12px;margin:0 0 12px;font-size:.87rem}
.audio-panel{padding:15px;border:1px solid #ded7c8;background:#fff;border-radius:18px;margin:12px 0}.audio-panel h3{margin:0 0 9px;color:#274b3e;font-size:1.06rem}.song{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-top:9px;padding:9px 0;border-top:1px solid #eee8da}.song span{font-weight:600}.song button{background:#1d4a39;color:white;border:0;border-radius:12px;padding:10px 16px}.song button.playing{background:#a34c1e}.audio-error{font-size:.82rem;color:#a12a2a}
.settings{background:#fff;border-radius:18px;border:1px solid #dddcd2;padding:20px}.settings label{display:block;margin:15px 0 7px}.settings select,.settings input{width:100%;max-width:360px;padding:10px;border:1px solid #d3d2c9;border-radius:12px;background:#fcfbf7}.settings button{background:#194736;color:white;border:0;border-radius:12px;padding:11px;margin:5px}.settings pre{white-space:pre-wrap;text-align:start;background:#f7f4ee;border-radius:12px;padding:12px;font-size:.83rem;max-height:160px;overflow:auto}.sticky-player{position:fixed;bottom:calc(12px + env(safe-area-inset-bottom));left:12px;right:12px;max-width:600px;margin:auto;z-index:20;background:#173e31;color:white;padding:12px;border-radius:17px;box-shadow:0 5px 18px #1118;display:none;align-items:center;justify-content:space-between;gap:10px}.sticky-player.active{display:flex}.sticky-player button{padding:8px 10px;border:0;border-radius:10px;color:#143c30;background:#f5eacb}.hidden{display:none!important}
#toast{position:fixed;bottom:95px;right:20px;left:20px;margin:auto;max-width:600px;padding:12px;text-align:center;background:#2b362d;color:white;border-radius:13px;z-index:50;display:none}.error{color:#a62b22}.load-problem{padding:35px 15px;background:#fff;border-radius:20px;text-align:center}
@media(max-width:500px){.app-header{padding-right:12px;padding-left:12px}.brand h1{font-size:1.05rem}.logo{width:46px;height:46px}.toolbar{top:70px}.page-slot{min-height:300px}.menu-grid{grid-template-columns:1fr}}
.page-slot{aspect-ratio:unset;min-height:0;margin:0;max-width:780px;overflow:hidden}.page-slot img{display:block;width:100%;height:auto;aspect-ratio:468/670;object-fit:contain;background:#fff}.page-slot .page-loading{z-index:0}.page-slot.is-loaded .page-loading{display:none}.page-slot .page-label{z-index:2}.page-audio{z-index:4}.reader-extra{display:flex;justify-content:center;margin:20px}.reader-extra button{min-width:180px;padding:12px}.source-link{text-align:center;padding:14px}.source-link a,.settings a{color:#135d49}.secondary-action{border:1px solid #cfaf65;background:#fff9ec;border-radius:12px;color:#4b4425;padding:11px 15px;margin:10px 0}.download-status{padding:10px 0;color:#4c5e51;font-size:.9rem}.progress-rail{height:9px;background:#ece7da;border-radius:12px;overflow:hidden}.progress-fill{height:100%;width:0;background:#437858;transition:width .1s}.todo-list{font-size:.88rem;color:#62675f}.todo-list p{margin:7px 0}.settings h3{margin-top:25px}.pdf-pages{gap:14px}.page-slot img{position:relative;z-index:1}.page-slot .page-audio{position:absolute;z-index:3;bottom:34px;left:15px}.loading-cover{padding-top:20vh}

.pdf-pages{overflow-x:auto;scroll-padding-top:120px;scrollbar-width:thin;} .page-slot{scroll-margin-top:160px;flex:none} .date-disclaimer{font-size:.76rem;opacity:.7} .page-loading[hidden]{display:none} .reader-title{padding:0 4px} .audio-panel .song button{min-width:86px} a{color:#276a5a} .page-slot .mapped-highlight{mix-blend-mode:multiply}

/* Standalone offline music library */
.music-heading{display:flex;justify-content:space-between;align-items:center;padding:7px 3px 16px}.music-heading h2{color:#174636;margin:0 0 8px;font-size:1.45rem}.music-heading p{color:#69796f;margin:0;line-height:1.6;font-size:.92rem}
.music-search-label{display:block;color:#34604b;font-size:.85rem;margin:7px 3px}.music-search{background:#fff;border:1px solid #d7d5c9;border-radius:15px;padding:13px 16px;display:block;width:100%;font-size:1rem;outline-color:#bfa15a}
.music-tabs{display:flex;gap:8px;margin:15px 0;flex-wrap:wrap}.music-tabs button{border:1px solid #d9d9ce;background:white;border-radius:22px;padding:9px 15px;color:#315c48}.music-tabs .selected{background:#214d3c;color:white}
.music-section-title{margin:22px 0 12px;color:#204a39;font-size:1.08rem}.music-folder-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:12px}
.music-folder{display:flex;gap:12px;align-items:center;text-align:right;background:white;border:1px solid #e2e0d6;border-radius:17px;padding:12px;min-width:0;color:#23352b}.folder-art{display:grid;place-items:center;width:66px;height:66px;border-radius:12px;background:linear-gradient(140deg,#215341,#17352e);color:#e8cf97;font-size:29px;flex:none}.folder-meta{min-width:0;flex:1}.folder-meta strong,.folder-meta small{display:block}.folder-meta strong{font-size:1.1rem;margin-bottom:7px}.folder-meta small{font-size:.84rem;color:#7b817a;line-height:1.4}
.music-album-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:20px}.music-album-head h3{margin:0;color:#224b3b}.music-album-head p{margin:5px 0;color:#6e7a72}.music-album-head button{background:#275843;color:white;border:0;padding:11px 14px;border-radius:13px;flex:none}
.music-song-list{border:1px solid #e4e0d5;border-radius:17px;background:white;overflow:hidden}.music-song{display:flex;gap:10px;align-items:center;padding:11px 12px;border-bottom:1px solid #f0ede5}.music-song:last-child{border-bottom:0}.song-cover{width:46px;height:46px;display:grid;place-items:center;border-radius:10px;background:#f0eddf;color:#b39349;font-size:21px;flex:none}.music-song-copy{flex:1;min-width:0}.music-song-copy strong{display:block;color:#1e3b2d;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.music-song-copy small{color:#7d817d;font-size:.8rem}.music-favorite,.music-play{border:0;background:transparent;color:#245944;font-size:24px;min-height:44px;min-width:38px}.music-favorite{color:#ac7438}.music-play{border-radius:99px;background:#255741;color:#fff;font-size:19px}
.music-empty{background:white;border:1px dashed #c6c4b9;border-radius:18px;padding:34px 14px;text-align:center;color:#667568}.music-empty span{font-size:40px;display:block;color:#ad9560;margin-bottom:10px}.music-empty strong{display:block;color:#315440}.music-empty p{line-height:1.7;font-size:.92rem}
.sticky-player{flex-direction:column;align-items:stretch;gap:4px;padding:11px 15px 12px}.player-header{display:flex;justify-content:space-between;gap:10px;align-items:center;font-size:.92rem}.player-label{font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.player-header #player-time{white-space:nowrap;font-variant-numeric:tabular-nums;color:#e0d6ba;font-size:.75rem}.sticky-player #player-seek{width:100%;accent-color:#e2c377;height:17px}.player-buttons{display:flex;align-items:center;justify-content:space-around;gap:5px}.sticky-player .player-buttons button{font-size:1rem;min-width:38px;min-height:37px}.sticky-player .player-buttons #player-action{font-size:1.2rem;background:#e4c177}.sticky-player .player-buttons .active-mode{background:#d6a448;color:#102f25}
.autoscroll-bar{display:flex;gap:5px;align-items:center;flex-wrap:wrap;background:#fff;border:1px solid #e1dfd6;border-radius:12px;padding:8px;margin-bottom:12px;color:#42594e}.autoscroll-bar span{margin-left:auto;font-size:.88rem}.autoscroll-bar button{border:1px solid #d8d5c8;border-radius:10px;padding:8px 11px;background:#f5f3ed;color:#3a5449}.autoscroll-bar button.selected{background:#2b5b48;color:white}
.app-shell:has(.sticky-player.active){padding-bottom:110px}
@media(max-width:500px){.music-folder-grid{grid-template-columns:1fr}.music-folder .folder-art{width:55px;height:55px}.sticky-player{bottom:calc(6px + env(safe-area-inset-bottom));left:7px;right:7px}.autoscroll-bar span{width:100%;}}
