@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@400;500;600;700;800;900&display=swap');
:root{font-family:'Noto Sans Thai',system-ui,sans-serif;color:#f5f6fb;background:#11141e;font-synthesis:none;--bg:#11141e;--surface:#191d29;--surface2:#202536;--border:#ffffff16;--muted:#9ba4bb;--ink:#f5f6fb;--accent:#8aa5ff;--button:#f1f4ff;--button-ink:#161d34;--shadow:0 16px 50px #0003;color-scheme:dark}*{box-sizing:border-box}body{margin:0;min-width:320px}button,input,textarea,select{font:inherit}button,a,input,textarea,select{-webkit-tap-highlight-color:transparent}button,a{touch-action:manipulation}button{cursor:pointer}button:disabled{opacity:.4;cursor:not-allowed}a{color:inherit;text-decoration:none}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid var(--accent);outline-offset:4px}img{display:block;max-width:100%}button{border:0}h1,h2,h3,p{margin-top:0}p{line-height:1.8}button{transition:background .18s,transform .18s}button:active:not(:disabled){transform:translateY(1px)}[hidden]{display:none!important}.skip{position:absolute;left:12px;top:-90px;z-index:100}.skip:focus{top:10px;background:var(--button);color:var(--button-ink);padding:12px}body.light{--bg:#f6f8fc;--surface:#fff;--surface2:#edf1f9;--border:#15254318;--muted:#607087;--ink:#172238;--accent:#4968c8;--button:#19243f;--button-ink:#fff;color:var(--ink);background:var(--bg);color-scheme:light}.loading{padding:25vh 20px;text-align:center;color:var(--muted)}.site-header{max-width:1392px;margin:18px auto 0;padding:13px 24px;display:flex;align-items:center;justify-content:space-between;border:1px solid var(--border);border-radius:22px;background:var(--surface);gap:20px}.brand{display:flex;align-items:center;gap:10px;font-weight:800;letter-spacing:-.03em}.brand img{width:34px;height:34px}.brand small{display:block;font-size:11px;letter-spacing:.16em;font-weight:500;color:var(--muted)}.nav-links{display:flex;gap:6px;align-items:center}.nav-links button{background:none;color:var(--muted);padding:10px 16px;border-radius:12px;font-size:14px}.nav-links button.active{color:var(--ink);background:var(--surface2)}.header-actions{display:flex;gap:12px;align-items:center}.private-label{display:flex;align-items:center;gap:7px;font-size:12px;color:var(--muted)}.private-label svg{width:15px}.avatar{width:34px;height:34px;border:1px solid var(--border);background:var(--surface2);color:var(--accent);border-radius:50%;display:grid;place-items:center;font-weight:800}.icon-button{background:var(--surface2);color:var(--ink);width:42px;height:42px;border-radius:12px;display:grid;place-items:center;font-size:22px}.icon-button svg{width:18px;height:18px}.primary,.secondary,.ghost,.danger{padding:11px 19px;border-radius:12px;min-height:44px;font-size:14px;font-weight:650;display:inline-flex;align-items:center;justify-content:center;gap:8px}.primary{background:var(--button);color:var(--button-ink)}.primary:hover{filter:brightness(.94)}.secondary{border:1px solid var(--border);background:var(--surface2);color:var(--ink)}.ghost{background:transparent;color:var(--muted)}.ghost:hover{background:var(--surface2);color:var(--ink)}.danger{background:#f0657516;color:#ff9ba6}.primary svg,.secondary svg{width:17px;height:17px}.container{max-width:1220px;margin:auto;padding:0 30px}.hero{display:grid;grid-template-columns:1.12fr 1fr;gap:60px;align-items:center;min-height:500px;padding:70px 0 54px}.eyebrow{display:block;font-size:11px;letter-spacing:.16em;text-transform:uppercase;color:var(--muted);font-weight:600;margin-bottom:18px}.hero h1{font-size:clamp(38px,4.6vw,68px);line-height:1.2;letter-spacing:-.055em;font-weight:850;margin-bottom:22px}.hero h1 span{color:var(--accent)}.hero p{color:var(--muted);font-size:15px;max-width:430px}.hero-actions{display:flex;gap:12px;margin-top:28px;align-items:center}.mini-note{font-size:12px;color:var(--muted);margin-top:18px}.book-preview{position:relative;min-height:345px;display:grid;place-items:center;isolation:isolate}.preview-ground{position:absolute;inset:42px 0 0;background:radial-gradient(ellipse at 50% 62%,#607aff12,transparent 65%);z-index:-1}.display-book{width:213px;height:293px;transform:perspective(1200px) rotateY(-17deg) rotateZ(5deg);position:relative;background:linear-gradient(145deg,#36445f,#212b42 60%);border-radius:3px 9px 9px 3px;box-shadow:inset 8px 0 14px #0004,16px 24px 40px #0006;color:#fff;padding:26px 24px 26px 29px}.display-book:before{content:'';position:absolute;left:6px;top:0;height:100%;width:1px;background:#ffffff25}.display-book:after{content:'';position:absolute;right:-7px;top:5px;bottom:5px;width:7px;background:repeating-linear-gradient(to bottom,#e2e5e9 0,#e2e5e9 1px,#aab2c1 1px,#aab2c1 2px);border-radius:0 3px 3px 0;transform:skewY(-12deg);z-index:-1}.cover-label{font-size:9px;letter-spacing:.18em;color:#b7c7ec}.cover-mark{font-size:72px;line-height:1;margin:32px 0 14px;color:#a3b7fb;font-weight:300}.display-book h2{font-size:27px;line-height:1.3;font-weight:700;letter-spacing:-.04em;margin:0}.display-book small{font-size:8px;display:block;margin-top:18px;color:#c2cade}.preview-label{position:absolute;bottom:3px;left:50%;transform:translateX(-50%);white-space:nowrap;font-size:11px;color:var(--muted);padding:7px 14px;border:1px solid var(--border);border-radius:20px}.preview-chip{position:absolute;background:var(--surface);border:1px solid var(--border);box-shadow:var(--shadow);padding:12px 17px;border-radius:13px;bottom:40px;right:5px;display:flex;gap:10px;align-items:center;font-size:12px}.preview-chip svg{width:18px;color:var(--accent)}.collection-head{display:flex;justify-content:space-between;gap:20px;align-items:end;padding:26px 0 24px;border-top:1px solid var(--border)}.collection-head h2{font-size:24px;letter-spacing:-.04em;margin-bottom:4px}.collection-head p{font-size:13px;color:var(--muted);margin-bottom:0}.collection-controls{display:flex;gap:12px;align-items:center}.search{display:flex;align-items:center;background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:0 13px;width:250px;gap:10px}.search svg{width:17px;color:var(--muted)}.search input{width:100%;background:none;border:0;color:var(--ink);padding:11px 0;outline:none;font-size:13px}.filters{display:flex;gap:8px;margin-bottom:24px}.filter{border:1px solid var(--border);border-radius:20px;padding:7px 16px;font-size:12px;background:none;color:var(--muted)}.filter.active{background:var(--surface2);color:var(--ink);border-color:#8aa5ff35}.book-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:24px;padding-bottom:42px}.book-card{min-width:0;position:relative}.book-thumb{width:100%;aspect-ratio:4/4.9;background:var(--surface);border:1px solid var(--border);border-radius:14px;overflow:hidden;padding:24px;display:flex;align-items:center;justify-content:center;cursor:pointer;position:relative}.book-thumb img{width:auto;max-height:100%;object-fit:contain;box-shadow:7px 9px 15px #0005;transition:transform .22s;border-radius:2px}.book-thumb:hover img{transform:translateY(-5px) rotate(-1deg)}.cover-placeholder{background:#283653;color:#b7c6ee;width:72%;height:100%;display:flex;flex-direction:column;justify-content:space-between;padding:18px;border-left:5px solid #0002;border-radius:2px}.cover-placeholder strong{font-size:20px;line-height:1.5;overflow-wrap:anywhere}.cover-placeholder span{font-size:10px;opacity:.65}.book-meta{padding:14px 2px}.book-meta h3{font-size:16px;line-height:1.5;margin:8px 0 5px;overflow-wrap:anywhere}.meta-row{display:flex;align-items:center;justify-content:space-between;gap:10px}.status{font-size:10px;font-weight:600;padding:3px 8px;border-radius:5px;color:var(--muted);background:var(--surface2)}.status.ready{color:#9cd9bd;background:#2f9d721c}.book-meta small{font-size:11px;color:var(--muted)}.book-actions{display:flex;gap:5px;margin-top:8px}.book-actions button{font-size:11px;min-height:34px;padding:6px 9px;border-radius:8px}.new-book{border:1px dashed #ffffff22;border-radius:14px;display:flex;min-height:265px;align-items:center;justify-content:center;flex-direction:column;gap:12px;color:var(--muted);background:none}.new-book svg{width:28px;color:var(--accent)}.empty{grid-column:1/-1;border:1px solid var(--border);border-radius:18px;background:var(--surface);padding:40px;text-align:center;color:var(--muted)}.empty h3{color:var(--ink);font-size:20px;margin:18px 0 8px}.empty svg{width:32px;color:var(--accent)}.empty p{font-size:14px}.footer{border-top:1px solid var(--border);padding:25px 0 36px;color:var(--muted);display:flex;justify-content:space-between;gap:15px;font-size:11px}.footer .brand{font-size:13px}.footer .brand img{width:23px;height:23px}.error-panel{padding:20px;background:#ff738718;border:1px solid #ff738733;border-radius:12px;color:#ffbdc7}.auth-page{min-height:100vh;display:grid;grid-template-columns:1fr 1fr}.auth-story{padding:65px max(40px,8vw);display:flex;flex-direction:column;justify-content:center;border-right:1px solid var(--border);background:var(--surface)}.auth-story h1{font-size:clamp(34px,4vw,60px);line-height:1.25;letter-spacing:-.045em;margin:50px 0 22px}.auth-story h1 span{color:var(--accent)}.auth-story>p{max-width:390px;color:var(--muted);font-size:14px}.auth-panel{padding:60px;display:flex;align-items:center;justify-content:center}.auth-card{max-width:360px;width:100%}.auth-card h2{font-size:27px;letter-spacing:-.04em;margin-bottom:8px}.auth-card>p{font-size:13px;color:var(--muted);margin-bottom:26px}.field{display:flex;flex-direction:column;gap:7px;font-size:13px;color:var(--muted);margin-bottom:18px}.field input,.field textarea,.field select{width:100%;border:1px solid var(--border);background:var(--surface);color:var(--ink);border-radius:10px;padding:12px 14px;outline:none;font-size:14px}.field textarea{resize:vertical;min-height:90px}.field input:focus,.field textarea:focus{border-color:var(--accent)}.form-error{color:#ff9ba6;font-size:13px;min-height:22px}.auth-card .primary{width:100%;margin:5px 0 18px}.privacy-note{color:var(--muted);font-size:11px;line-height:1.8}.editor-layout{max-width:1330px;margin:auto;padding:32px;display:grid;grid-template-columns:300px 1fr;gap:32px}.editor-sidebar{background:var(--surface);border:1px solid var(--border);border-radius:16px;padding:23px;align-self:start;position:sticky;top:20px}.editor-sidebar h2{font-size:18px;margin-bottom:24px}.editor-main{min-width:0}.editor-head{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:20px}.editor-head h1{font-size:24px;letter-spacing:-.04em;margin:0}.editor-head p{color:var(--muted);font-size:12px;margin:6px 0}.drop-zone{border:1px dashed #8aa5ff65;border-radius:16px;background:#8aa5ff05;text-align:center;padding:32px 20px;position:relative;transition:background .2s}.drop-zone.drag{background:#8aa5ff18}.drop-zone svg{width:29px;color:var(--accent)}.drop-zone h3{font-size:16px;margin:14px 0 8px}.drop-zone p{font-size:12px;color:var(--muted);margin-bottom:15px}.page-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-top:25px}.page-card{min-width:0;background:var(--surface);border:1px solid var(--border);border-radius:10px;overflow:hidden}.page-card img{width:100%;aspect-ratio:.707;object-fit:contain;background:#e3e5eb}.page-card-footer{padding:8px;display:flex;flex-wrap:wrap;gap:3px;align-items:center;justify-content:space-between}.page-card-footer span{color:var(--muted);font-size:11px}.page-card-footer button{font-size:11px;padding:7px;background:var(--surface2);color:var(--ink);border-radius:6px}.upload-progress{padding:15px;margin-top:15px;border:1px solid var(--border);background:var(--surface);border-radius:12px;font-size:13px}.upload-progress progress{width:100%;height:7px;accent-color:var(--accent)}.editor-note{font-size:12px;color:var(--muted);margin-top:20px}.wide-button{width:100%}dialog{background:var(--surface);color:var(--ink);border:1px solid var(--border);border-radius:20px;width:calc(100% - 32px);max-width:480px;box-shadow:var(--shadow);padding:28px}dialog::backdrop{background:#070b18b3;backdrop-filter:blur(4px)}dialog h2{font-size:23px;margin:0 0 20px}.dialog-actions{display:flex;justify-content:end;gap:10px;margin-top:22px}.dialog-description{color:var(--muted);font-size:13px}.copy-link{width:100%;background:var(--bg);border:1px solid var(--border);padding:12px;border-radius:10px;color:var(--ink);font-size:12px}.access-page{max-width:900px;margin:50px auto;padding:0 25px}.access-title{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:30px}.access-title h1{font-size:30px;letter-spacing:-.03em}.access-title p{color:var(--muted);font-size:13px}.access-list{display:flex;flex-direction:column;gap:12px}.access-row{display:flex;justify-content:space-between;gap:15px;align-items:center;background:var(--surface);border:1px solid var(--border);padding:18px 23px;border-radius:14px}.access-row h3{font-size:15px;margin-bottom:4px}.access-row p{font-size:12px;color:var(--muted);margin:0}.access-row small{display:block;color:var(--muted);font-size:11px}.reader-shell{position:fixed;inset:0;background:var(--bg);z-index:50;display:flex;flex-direction:column}.reader-head{display:flex;justify-content:space-between;gap:20px;align-items:center;padding:18px 30px;border-bottom:1px solid var(--border)}.reader-head>div:nth-child(2){min-width:0;text-align:center}.reader-head .eyebrow{font-size:10px;margin-bottom:2px}.reader-head h1{font-size:14px;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:40vw}.reader-tools{display:flex;align-items:center;gap:5px}.reader-stage{flex:1;min-height:0;overflow:auto;display:grid;place-items:center;padding:25px 35px;touch-action:pan-y}.book-stage{perspective:2200px;display:grid;place-items:center;width:100%;height:100%}.book{position:relative;display:grid;grid-template-columns:1fr;max-height:100%;height:min(67vh,760px);aspect-ratio:var(--page-ratio,.707);box-shadow:0 25px 60px #0005;transform:scale(var(--zoom,1));transform-origin:center center;transition:width .3s,aspect-ratio .3s;border-radius:3px;isolation:isolate}.book.spread{grid-template-columns:1fr 1fr;aspect-ratio:calc(var(--page-ratio,.707)*2)}.book.spread:after{content:'';position:absolute;top:0;bottom:0;left:50%;width:14px;transform:translateX(-50%);background:linear-gradient(90deg,transparent,#0003,transparent);pointer-events:none}.paper{background:#fff;position:relative;width:100%;height:100%;min-width:0;overflow:hidden}.paper img{width:100%;height:100%;object-fit:contain;user-select:none}.paper.blank{background:#eef0f3}.book:before{content:'';position:absolute;bottom:-5px;left:3px;right:3px;height:5px;background:repeating-linear-gradient(to bottom,#cfd5dc 0,#fff 1px,#b8c1cc 2px);border-radius:0 0 3px 3px}.reader-nav{display:flex;justify-content:center;align-items:center;gap:22px;padding:15px}.page-counter{color:var(--muted);font-size:12px;min-width:145px;text-align:center}.page-counter select{border:1px solid var(--border);border-radius:7px;background:var(--surface);color:var(--ink);padding:6px;margin:0 4px}.reader-hint{text-align:center;color:var(--muted);font-size:10px;padding:0 15px 12px;margin:0}.thumb-strip{display:flex;gap:10px;overflow:auto;padding:12px 25px;border-top:1px solid var(--border);max-height:115px}.thumb-strip button{flex:0 0 55px;background:var(--surface);border:2px solid transparent;color:var(--muted);padding:3px;border-radius:5px;font-size:10px}.thumb-strip button.active{border-color:var(--accent)}.thumb-strip img{height:65px;width:100%;object-fit:contain}.turn-sheet{position:absolute;top:0;height:100%;width:50%;z-index:5;transform-style:preserve-3d;pointer-events:none}.single .turn-sheet{width:100%}.turn-next{right:0;transform-origin:left center;animation:turn-next .48s ease-in-out forwards}.turn-prev{left:0;transform-origin:right center;animation:turn-prev .48s ease-in-out forwards}.sheet-front,.sheet-back{position:absolute;inset:0;backface-visibility:hidden}.sheet-front{box-shadow:-6px 0 15px #0002}.sheet-back{transform:rotateY(180deg);box-shadow:6px 0 15px #0002}.sheet-front:after,.sheet-back:after{content:'';position:absolute;inset:0;background:linear-gradient(90deg,#0001,transparent 45%);pointer-events:none}@keyframes turn-next{to{transform:rotateY(-180deg)}}@keyframes turn-prev{to{transform:rotateY(180deg)}}#toast{position:fixed;bottom:25px;left:50%;transform:translate(-50%,20px);opacity:0;pointer-events:none;z-index:100;background:var(--button);color:var(--button-ink);padding:12px 22px;border-radius:12px;font-size:13px;box-shadow:var(--shadow);transition:.2s;max-width:90vw}#toast.show{transform:translate(-50%,0);opacity:1}.error-text{color:#ff9ba6}.subtle{color:var(--muted)}
@media(min-width:1600px){.container{max-width:1320px}.hero{min-height:550px}.book-preview{min-height:370px}.display-book{width:235px;height:325px}}@media(max-width:1000px){.site-header{margin:12px 16px 0}.private-label{display:none}.book-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.hero{gap:25px;min-height:445px}.hero h1{font-size:49px}.editor-layout{grid-template-columns:260px 1fr;gap:22px;padding:25px}.page-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.preview-chip{right:-8px}.auth-story{padding:40px}.auth-panel{padding:35px}}@media(max-width:700px){.site-header{margin:10px 12px 0;padding:12px 15px;border-radius:17px;gap:10px}.brand{font-size:14px}.brand small{font-size:9px}.brand img{width:28px;height:28px}.nav-links{display:none}.header-actions{gap:7px}.header-actions .ghost{padding:8px;font-size:11px}.header-actions .avatar{display:none}.container{padding:0 22px}.hero{grid-template-columns:1fr;gap:20px;padding:44px 0 30px}.hero h1{font-size:clamp(36px,9vw,53px);margin-bottom:20px;line-height:1.25}.hero p{font-size:14px}.hero-actions{margin-top:23px}.hero .eyebrow{font-size:10px;margin-bottom:18px}.book-preview{min-height:295px}.display-book{width:175px;height:240px;padding:20px 23px}.cover-mark{font-size:52px;margin:28px 0 10px}.display-book h2{font-size:23px}.preview-chip{right:8px;bottom:30px;font-size:10px;padding:11px}.preview-label{font-size:10px;bottom:3px}.collection-head{align-items:start;flex-direction:column;gap:17px;padding-top:25px}.collection-head h2{font-size:22px}.collection-controls{width:100%}.search{width:100%}.collection-controls>.secondary{white-space:nowrap}.book-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.book-thumb{padding:15px;aspect-ratio:.8}.book-meta h3{font-size:14px}.book-actions{flex-wrap:wrap}.new-book{min-height:200px}.cover-placeholder strong{font-size:16px}.empty{padding:28px 20px}.footer{font-size:10px;flex-direction:column}.footer .brand{margin-bottom:5px}.auth-page{display:flex;flex-direction:column}.auth-story{padding:30px 28px;border:0}.auth-story h1{font-size:34px;margin:28px 0 12px}.auth-story>p{font-size:12px;margin-bottom:0}.auth-panel{padding:32px 28px 60px}.auth-card{max-width:100%}.editor-layout{display:flex;flex-direction:column;padding:20px;gap:25px}.editor-sidebar{position:static;order:2}.editor-main{order:1}.editor-head{gap:10px;flex-wrap:wrap}.editor-head h1{font-size:21px}.editor-head .secondary{font-size:12px;padding:9px 12px}.page-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}.page-card-footer{padding:6px;gap:5px}.page-card-footer button{font-size:9px;padding:5px;min-height:28px}.page-card-footer span{font-size:10px}.drop-zone{padding:25px 14px}.access-title{align-items:start;flex-direction:column}.access-title h1{font-size:25px}.access-row{padding:16px;gap:8px}.access-row p{font-size:11px;overflow-wrap:anywhere}.access-row .secondary{padding:7px 11px;font-size:11px}.reader-head{padding:12px;gap:6px}.reader-head h1{font-size:11px;max-width:35vw}.reader-head .ghost{font-size:11px;padding:7px 10px}.reader-tools{gap:0}.reader-tools .icon-button{width:34px;height:34px}.fullscreen-btn{display:none}.reader-stage{padding:18px 15px}.book{height:auto;width:min(100%,calc(62vh * var(--page-ratio,.707)));max-height:100%}.reader-nav{gap:10px;padding:12px}.reader-nav button{font-size:12px;padding:9px 12px}.page-counter{font-size:11px;min-width:120px}.reader-hint{font-size:9px}.thumb-strip{padding:8px 12px}.filters{gap:6px;flex-wrap:wrap}.filter{font-size:11px;padding:7px 12px}}
@media(max-width:700px){.site-header{flex-wrap:wrap}.nav-links{display:flex;order:3;width:100%;border-top:1px solid var(--border);padding-top:8px}.nav-links button{flex:1;min-height:44px;font-size:12px}.page-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.page-card-footer{flex-wrap:wrap}.page-card-footer button{min-height:40px;min-width:38px;font-size:11px}.page-card-footer>div{display:flex;flex-wrap:wrap}.reader-head .ghost,.reader-tools .icon-button{min-height:44px;min-width:44px}.book-actions .ghost,.book-actions .secondary{min-height:44px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
