/* Studio UI: no external dependencies, existing storage and tools remain intact. */
:root{--ink:#192335;--muted:#657287;--accent:#3458db;--green:#3458db;--line:#e0e5ef;--bg:#f5f7fb;--surface:#fff;--soft:#edf1ff;--hover:#f0f3fb;--workspace:#e9edf4;--shadow:0 12px 40px #18233d1a; font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;--pf-radius:12px}
body{font-size:14px}.brand{letter-spacing:-.9px;gap:11px;font-size:23px}.brandmark{width:40px;height:40px;border-radius:12px;background:#3458db;box-shadow:none;display:grid;place-items:center}.brandmark svg{width:25px;height:25px;stroke:white}.brand small{font-size:9px;letter-spacing:1.6px}.top{min-height:76px;padding:12px max(24px,calc((100vw - 1160px)/2));position:sticky;top:0;z-index:12;background:var(--surface)}
.library{max-width:1220px;padding:36px 32px 60px}.intro{background:transparent;border:0;border-radius:0;padding:0;margin:0 0 28px;align-items:center;gap:22px}.intro h1{font-size:clamp(30px,4vw,44px);letter-spacing:-1.8px;font-weight:750;margin:8px 0 10px;line-height:1.1}.eyebrow{color:var(--muted);letter-spacing:1.8px;font-size:10px;font-weight:750}.intro .muted{font-size:14px;line-height:1.6}.btn{border-radius:9px;padding:10px 15px;font-weight:620;min-height:40px}.primary{background:#3458db;border-color:#3458db;color:white;box-shadow:0 3px 7px #3458db22}.primary:hover{background:#2948c1}.intro .primary{padding:13px 18px;min-height:46px}.stats{display:flex;align-items:center;gap:12px;background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:16px 20px;margin:0 0 36px}.stats span{display:flex;align-items:center;gap:5px;font-size:12px}.stats b{font-size:20px;margin-right:2px;letter-spacing:-.5px}.stats span+span{padding-left:20px;border-left:1px solid var(--line)}#storageStatus{margin-left:auto;color:var(--muted)}#storageStatus:before{content:'';width:7px;height:7px;border-radius:50%;background:#209578;display:inline-block;margin-right:4px}.librarybar{gap:10px;margin-bottom:20px}.librarybar h2{font-size:22px;font-weight:720}.search{border-radius:9px;min-height:42px;width:min(245px,100%);padding:10px 14px}.librarybar .btn,.librarybar .tool{border:1px solid var(--line);background:var(--surface);border-radius:9px;padding:10px 14px;min-height:42px;font-size:13px}.books{grid-template-columns:repeat(auto-fill,minmax(164px,1fr));gap:28px 20px}.cover{aspect-ratio:.79;border-radius:4px 12px 12px 4px;box-shadow:0 6px 12px #16213a18,4px 5px 0 -2px #d4dbe6;padding:20px 16px 15px 24px}.cover:before{width:12px;background:#0002;border-right:1px solid #fff3}.cover:after{width:120px;height:120px;right:-60px;bottom:-60px;box-shadow:0 0 0 16px #ffffff0d,0 0 0 32px #ffffff10}.covertitle{font-family:inherit;font-weight:690;font-size:clamp(19px,2vw,26px);letter-spacing:-.5px}.covermeta{font-size:9px;letter-spacing:1.4px}.bookname{font-size:14px;font-weight:650;margin-top:13px}.bookinfo{font-size:12px}.book:hover .cover{transform:translateY(-3px);transition:transform .16s ease}.bookmenu{border:0;min-width:30px;min-height:30px;background:transparent;font-size:21px;bottom:0}.newtile{aspect-ratio:.79;border:1px dashed #aab8dc;border-radius:12px;background:var(--soft);font-size:13px;gap:12px}.newtile span{display:grid;place-items:center;border-radius:50%;width:44px;height:44px;font-size:28px;background:var(--surface);color:var(--accent);margin:auto}.newtile:hover{border-color:var(--accent);background:var(--hover)}.footerhint{margin-top:32px;font-size:12px}.advlinks{padding-top:18px;border-top:1px solid var(--line);gap:22px}.advlinks a{text-decoration:none;font-weight:600}
.edithead{min-height:65px;padding:10px 22px;gap:12px}.edithead h2{font-size:17px;letter-spacing:-.4px}.edithead .muted{font-size:11px;margin-top:3px}.edithead #exportPng{background:#3458db;color:#fff;border-color:#3458db}.edithead #pageAddTop{background:var(--surface)}.iconbtn{width:38px;height:38px}.pf-icon{width:19px;height:19px;display:inline-block;vertical-align:middle;flex:none;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.toolbar{display:flex;flex-direction:column;gap:0;padding:0;background:var(--surface);box-shadow:0 2px 6px #13203b08;z-index:10}.studio-row{display:flex;align-items:center;justify-content:center;gap:12px;width:100%;min-height:54px;padding:7px 18px;flex-wrap:wrap}.studio-row.secondary{justify-content:center;min-height:44px;border-top:1px solid var(--line);gap:10px;padding:5px 18px}.studio-row .sep{height:27px;background:var(--line);margin:0 1px}.toolbar .tool,.toolbar .iconbtn{min-height:40px;border-radius:9px;padding:8px 10px;gap:6px}.studio-row .pf-group{gap:4px}.studio-row .pf-maincolors{gap:9px}.studio-row .pf-menu .pf-trigger{background:transparent;border:1px solid transparent;min-height:34px;padding:7px 10px;font-size:12px;gap:7px}.studio-row .pf-menu[open]>.pf-trigger,.studio-row .pf-menu .pf-trigger:hover{background:var(--soft);color:var(--accent)}.studio-row .pf-trigger:after{color:var(--muted);margin-left:3px}.studio-row .pf-pop{top:calc(100% + 7px);max-height:min(55dvh,480px);padding:10px;border-radius:13px;box-shadow:0 12px 40px #14284c25}.studio-row .pf-pop .tool,.studio-row .pf-pop .btn{border-radius:7px;min-height:39px}.studio-row .pf-status{font-size:11px;background:var(--soft);max-width:200px}.toolbar .swatch{width:25px;height:25px}.toolbar .swatch.active{box-shadow:0 0 0 2px var(--accent)}.toolbar #width{min-width:88px;height:36px;border-radius:8px}.studio-icononly{font-size:0!important;width:40px;min-width:40px;position:relative;justify-content:center!important;gap:0!important}.studio-icononly .pf-icon{width:20px;height:20px}.studio-icononly#smartShapes{font-size:0!important;box-shadow:none}.studio-icononly#smartShapes[aria-pressed=true]{background:var(--soft);color:var(--accent)}.studio-icononly#smartShapes:after{content:'';width:6px;height:6px;border-radius:50%;background:currentColor;position:absolute;right:5px;top:5px}.studio-icononly#smartShapes[aria-pressed=false]:after{display:none}.studio-row #undo,.studio-row #redo{font-size:0}.sidebar{width:154px;padding:15px 12px;background:var(--surface);border-right:1px solid var(--line);gap:12px}.sidebar .eyebrow{padding:2px 6px}.thumb{padding:8px;border-radius:10px;border:1px solid var(--line);background:var(--bg)}.thumb.active{border:2px solid var(--accent);background:var(--soft);padding:7px}.thumb canvas{border:0;box-shadow:0 1px 5px #19233512;border-radius:3px}.thumb label{font-weight:600;font-size:11px;padding:3px 0 0}.workspace{background:var(--workspace);padding:30px 26px 55px}.paper{width:min(100%,850px);box-shadow:0 4px 22px #1c29471c,0 0 0 1px #14284c09;border-radius:2px}.foot{height:40px;padding:4px 18px}.foot #pagePosition{font-weight:650;color:var(--ink)}.foot button{border-radius:7px}.modal{border:1px solid var(--line);border-radius:18px;padding:25px;box-shadow:0 20px 65px #111c3b30}.modalback{background:#101b3659;backdrop-filter:blur(4px)}.modal h2{font-size:24px;font-weight:740;letter-spacing:-.7px}.modal .field{font-weight:650}.mathpanel{border-radius:14px;border:1px solid var(--line);box-shadow:var(--shadow)}.pf-focus .workspace{padding:22px 16px 40px}.pf-focus .paper{width:min(100%,1000px)}
:root[data-pf-theme=dark]{--ink:#e8edf7;--muted:#a5b2c7;--accent:#a8baff;--green:#a8baff;--line:#344057;--bg:#171e2d;--surface:#222c3e;--soft:#34456a;--hover:#303e57;--workspace:#111827}:root[data-pf-theme=dark] .intro{background:transparent;border:0}:root[data-pf-theme=dark] .newtile{background:var(--soft)}:root[data-pf-theme=dark] .primary,:root[data-pf-theme=dark] .edithead #exportPng{background:#4566d7;color:#fff;border-color:#4566d7}
@media(max-width:800px){.library{padding:26px 20px 45px}.top{padding:10px 20px;min-height:66px}.stats{margin-bottom:26px;padding:13px 15px}.studio-row{gap:7px;padding:5px 9px;min-height:48px}.studio-row.secondary{gap:5px;padding:4px 8px;min-height:40px}.studio-row .pf-menu .pf-trigger{padding:6px 8px;font-size:12px}.studio-row .pf-pop{position:fixed;top:var(--pf-popup-top,140px);left:10px!important;right:10px!important;width:auto;max-width:none}.sidebar{width:125px}.workspace{padding:16px 12px 36px}.edithead{padding:8px 10px;gap:7px}.edithead .btn{min-height:36px;padding:8px 10px}.studio-row .pf-status{max-width:150px}}
@media(max-width:480px){.brand{font-size:20px}.brandmark{width:35px;height:35px}.library{padding:22px 16px 35px}.intro{gap:16px;margin-bottom:20px}.intro .primary{width:100%}.stats{flex-wrap:wrap;gap:9px}.stats span+span{padding-left:10px}.stats #storageStatus{width:100%;padding:9px 0 0;margin-left:0;border-left:0;border-top:1px solid var(--line)}.librarybar h2{width:100%}.librarybar .search{width:100%;order:1}.books{grid-template-columns:repeat(2,minmax(0,1fr));gap:22px 14px}.studio-row{gap:4px;padding:4px 6px}.studio-row .sep{display:none}.studio-row .pf-group{gap:1px}.studio-icononly{width:34px;min-width:34px;min-height:34px!important;padding:6px!important}.studio-row .pf-menu .pf-trigger{font-size:11px;padding:5px 5px;gap:4px}.studio-row .pf-trigger .pf-icon{width:15px;height:15px}.studio-row .pf-status{max-width:100%;width:auto}.toolbar #width{min-width:65px;width:65px;font-size:11px}.studio-row .pf-maincolors{gap:6px}.edithead .btn{font-size:11px;padding:6px 8px}.edithead .iconbtn{width:30px;height:33px}.foot{padding:3px 8px}.workspace{padding:10px 7px 32px}}
.covertitle{font-size:clamp(18px,1.55vw,23px);overflow-wrap:break-word;hyphens:auto;max-width:100%}.stats #storageStatus[data-warning=true]:before{background:#b77925}.studio-row .pf-menu .pf-trigger:focus-visible,.studio-icononly:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
