@font-face{font-family:Sarabun;src:url('/static/fonts/Sarabun-Regular.ttf')}@font-face{font-family:Sarabun;src:url('/static/fonts/Sarabun-Bold.ttf');font-weight:700}*{box-sizing:border-box}body{margin:0;background:#f4f3ee;color:#263b37;font-family:Sarabun,sans-serif;font-size:15px}button,input,textarea,select{font:inherit}button{cursor:pointer;border:1px solid #ccd3ca;border-radius:9px;padding:10px 17px;background:#fff;color:#263b37;transition:background .15s}button:hover{background:#edf1e9}button:disabled{opacity:.4;cursor:not-allowed}.primary{background:#284c40;color:#fff;border-color:#284c40}.primary:hover{background:#3b6253}header{height:88px;display:flex;gap:16px;align-items:center;padding:0 28px;background:#fff;border-bottom:1px solid #dfe2d9}.brand{display:flex;gap:10px;align-items:center;color:#284c40;text-decoration:none;font-size:30px;font-weight:bold}.brand small{font-size:8px;letter-spacing:2px;display:block;font-weight:400}.filename{flex:1;padding-left:30px;max-width:40%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#738078;font-size:13px}.local{font-size:11px;color:#667c60;margin-left:auto}#welcome{max-width:1080px;margin:auto;padding:72px 40px 50px}.eyebrow{font-size:10px;letter-spacing:2px;color:#7a8972}h1{font-size:68px;font-weight:400;line-height:1.22;letter-spacing:-2px;margin:24px 0}h1 em{font-style:normal;color:#829574}#welcome p{font-size:18px;line-height:1.9;color:#758074;margin-bottom:28px}#welcome button{padding:15px 28px}.hint{display:block;font-size:12px;color:#879080;margin:16px 0}.features{display:grid;grid-template-columns:repeat(3,1fr);gap:36px;border-top:1px solid #d4dacd;padding-top:28px;margin-top:60px}.features div{display:flex;flex-direction:column;gap:10px}.features b{font-size:12px;color:#8d9d7e}.features strong{font-size:17px;font-weight:400}.features span{font-size:13px;color:#85907e}.toolbar{height:66px;display:flex;align-items:center;justify-content:space-between;padding:12px 28px;border-bottom:1px solid #d8ded2;background:#fafbf7}.toolbar button{font-size:13px;padding:7px 12px}.toolbar>div{display:flex;align-items:center;gap:12px}.toolbar label{font-size:12px}.toolbar select{background:transparent;border:0}.editor-layout{display:grid;grid-template-columns:minmax(0,1fr) 310px;height:calc(100vh - 190px)}.canvas-area{overflow:auto;padding:34px;background:#e4e7df;background-image:radial-gradient(#cdd3c5 .7px,transparent .7px);background-size:12px 12px}#paper{position:relative;margin:0 auto;background:white;box-shadow:0 8px 26px #273b3718}#pageImage{display:block;width:100%;height:100%}#hotspots{position:absolute;inset:0}.hotspot{position:absolute;border:1px solid transparent;background:transparent;padding:0;border-radius:2px;cursor:text;min-width:6px}.hotspot:hover{border-color:#779665;background:#90b67918}.hotspot.selected{border-color:#3f7755;box-shadow:0 0 0 1px #3f7755;background:#93bd7615}.hotspot.changed{border:1px dashed #739361}aside{background:#fff;padding:26px 24px;overflow:auto;border-left:1px solid #d7ddd1}aside h2{font-size:21px;font-weight:400;margin:16px 0}aside p{font-size:13px;line-height:1.8;color:#7d8778}label{display:block;font-size:12px;color:#667362}input,textarea{width:100%;padding:9px;border:1px solid #d6dfd0;border-radius:6px;background:#fbfcf9;color:#243b30;margin:7px 0 12px}textarea{resize:vertical;font-size:16px;line-height:1.7}.duo{display:grid;grid-template-columns:1fr 1fr;gap:0 12px}input[type=color]{height:40px;padding:3px}.check{display:flex;align-items:center;gap:9px}.check input{width:17px;margin:0}.wide{width:100%;margin-top:12px}.subtle{border:0;background:transparent;color:#7f8d77;font-size:12px}details{margin-top:20px}summary{cursor:pointer;font-size:12px;margin-bottom:12px}.note-box{border-top:1px solid #e3e7dd;margin-top:28px;padding-top:20px}.note-box strong{font-size:12px;font-weight:400}.note{font-size:11px!important}#status{min-height:36px;padding:8px 24px;background:#fff;border-top:1px solid #e1e5dc;font-size:12px;color:#687a5e}#status.error{color:#a63e37}#busy{position:fixed;inset:0;background:#f6f8f3d9;display:flex;align-items:center;justify-content:center;gap:16px;z-index:20}#busy span{width:24px;height:24px;border:2px solid #d0d9c9;border-top-color:#284c40;border-radius:50%;animation:spin 1s linear infinite}[hidden]{display:none!important}@keyframes spin{to{transform:rotate(360deg)}}:focus-visible{outline:3px solid #a7bd83;outline-offset:3px}@media(max-width:800px){header{padding:16px;height:auto;flex-wrap:wrap}.filename,.local{display:none}.brand{font-size:24px;margin-right:auto}header button{font-size:12px;padding:8px}#welcome{padding:50px 24px}h1{font-size:48px}.features{gap:18px}.features span{font-size:11px}.editor-layout{display:flex;flex-direction:column;height:auto}.canvas-area{height:55vh;padding:20px}aside{border-left:0}.toolbar{padding:10px;gap:10px;height:auto;flex-wrap:wrap}.toolbar button{font-size:11px}#status{position:sticky;bottom:0}.features{grid-template-columns:1fr}.features div{gap:5px}}

.inline-editor{position:absolute;z-index:5}.inline-editor textarea{display:block;min-width:100%;width:100%;border:2px solid #477857;border-radius:2px;margin:0;padding:2px 0;background:#fffffffa;line-height:1.05;resize:none;box-shadow:0 2px 12px #263b3720;overflow:auto}.inline-editor textarea:focus{outline:none}.inline-tools{display:flex;gap:4px;position:absolute;bottom:100%;left:0;white-space:nowrap;padding-bottom:5px}.inline-tools button{padding:5px 9px;font-size:11px;background:#284c40;color:white;border:0;border-radius:5px}.inline-tools button:last-child{background:#fff;color:#9f423a;border:1px solid #e1ccc7}

@font-face{font-family:THSarabunNew;src:url('/static/fonts/THSarabunNew-Regular.ttf');font-weight:400;font-style:normal}
@font-face{font-family:THSarabunNew;src:url('/static/fonts/THSarabunNew-Bold.ttf');font-weight:700;font-style:normal}
@font-face{font-family:THSarabunNew;src:url('/static/fonts/THSarabunNew-Italic.ttf');font-weight:400;font-style:italic}
@font-face{font-family:THSarabunNew;src:url('/static/fonts/THSarabunNew-BoldItalic.ttf');font-weight:700;font-style:italic}
@font-face{font-family:Sarabun;src:url('/static/fonts/Sarabun-Regular.ttf');font-weight:400;font-style:normal}
@font-face{font-family:Sarabun;src:url('/static/fonts/Sarabun-Bold.ttf');font-weight:700;font-style:normal}
@font-face{font-family:Sarabun;src:url('/static/fonts/Sarabun-Italic.ttf');font-weight:400;font-style:italic}
@font-face{font-family:Sarabun;src:url('/static/fonts/Sarabun-BoldItalic.ttf');font-weight:700;font-style:italic}
@font-face{font-family:Prompt;src:url('/static/fonts/Prompt-Regular.ttf');font-weight:400;font-style:normal}
@font-face{font-family:Prompt;src:url('/static/fonts/Prompt-Bold.ttf');font-weight:700;font-style:normal}
@font-face{font-family:Prompt;src:url('/static/fonts/Prompt-Italic.ttf');font-weight:400;font-style:italic}
@font-face{font-family:Prompt;src:url('/static/fonts/Prompt-BoldItalic.ttf');font-weight:700;font-style:italic}
aside select{width:100%;padding:10px 8px;border:1px solid #d6dfd0;border-radius:6px;background:#fbfcf9;color:#243b30;margin:7px 0 16px}.fit-check{margin-top:18px;font-size:11px}

.inline-tools button[aria-pressed]{background:#fff;color:#284c40;border:1px solid #b8c7b5}.inline-tools button[aria-pressed=true]{background:#284c40;color:white}.inline-tools button[aria-label='ใช้ตัวหนา']{font-weight:700}

.inline-tools select{font:11px Sarabun;background:white;color:#284c40;border:1px solid #b8c7b5;border-radius:5px;padding:3px}.inline-tools{max-width:90vw;flex-wrap:wrap;min-width:300px}

.inline-tools .move-handle{cursor:grab;touch-action:none;background:#e9efe3;color:#284c40;border:1px solid #b8c7b5}.inline-editor.moving .move-handle{cursor:grabbing}.inline-editor.moving{opacity:.85}.inline-tools{min-width:390px}

.inline-tools{position:fixed;left:24px;bottom:48px;top:auto;z-index:15;min-width:0;max-width:calc(100vw - 48px);width:max-content;padding:10px;background:#f7faf4;border:1px solid #b8c7b5;border-radius:10px;box-shadow:0 4px 18px #263b3730;gap:6px}.inline-tools button,.inline-tools select{min-height:36px;font-size:13px}.inline-tools .move-handle{background:#dbe8d1}

.inline-editor > .move-handle{position:absolute;right:0;top:-30px;width:30px;height:30px;padding:0;display:grid;place-items:center;font:22px/1 sans-serif;background:#284c40;color:#fff;border:1px solid #fff;border-radius:7px 7px 0 0;box-shadow:0 2px 6px #263b3730;cursor:grab;touch-action:none;user-select:none;z-index:6}.inline-editor > .move-handle:hover{background:#396750}.inline-editor > .move-handle:focus-visible{outline:3px solid #96bb7c;outline-offset:2px}.inline-editor.moving > .move-handle{cursor:grabbing}
/* Paperroom workspace */
:root{--ink:#272b36;--accent:#d82b50}body{background:#fff;color:#272b36}header{background:#fff;border-bottom:1px solid #e7e7ed;height:82px;padding:16px 28px}.brand{color:#d82b50}.brand small{color:#858593}.primary{background:#d82b50!important;color:white!important;border-color:#d82b50!important;border-radius:9px}button{border-radius:7px}header .filename{font-size:14px;border:1px solid #dedee5;border-radius:7px;padding:10px 14px;max-width:380px}#welcome{padding:54px 24px 36px;max-width:1100px;margin:auto;text-align:center}#welcome h1{font-size:48px;line-height:1.3;margin:14px 0 18px;letter-spacing:-1px}#welcome h1 em{color:#d82b50;font-style:normal}#welcome>p{font-size:17px;color:#727480}.eyebrow{color:#a04760;font-size:11px;letter-spacing:2px}.upload-card{max-width:680px;margin:32px auto;padding:30px;background:#fff7f9;border:2px dashed #edb6c2;border-radius:18px}.upload-symbol{display:block;color:#d82b50;font-size:44px}.upload-card h2{font-size:23px;margin:4px}.upload-card p{color:#7b7180;font-size:14px}.upload-card .primary{padding:15px 48px}.hint{display:block;margin-top:16px;color:#86818b;font-size:12px}.features{border:0;margin:34px auto 0;gap:24px}.features>div{text-align:left;background:#fafafd;border:1px solid #ededf2;border-radius:12px;padding:20px}.features b{color:#d82b50}.toolbar{background:#fcfcfe;border-bottom:1px solid #dedee7;padding:12px 20px;gap:16px}.toolbar button{background:transparent;border-color:transparent;color:#494b57}.toolbar button:hover{background:#fcebf0}.editor-layout{display:grid;grid-template-columns:160px minmax(0,1fr) 270px;height:calc(100vh - 177px);min-height:480px}.canvas-area{background:#e8e8eb;padding:38px 32px 80px;overflow:auto;display:block}#paper{margin:0 auto;box-shadow:0 2px 12px #20203020;flex-shrink:0}aside{background:#fff;border-left:1px solid #dedee7;padding:20px;overflow:auto}aside h2{font-size:19px}aside .note-box{font-size:11px;padding:12px;background:#fafafd}.page-rail{background:#f5f5f8;border-right:1px solid #dedee7;padding:16px 12px;overflow:auto}.page-rail h3{font-size:13px;font-weight:500;margin:0 0 20px;text-align:center}.page-thumb{display:block;width:100%;background:none;border:0;padding:5px;margin-bottom:18px;color:#727480}.page-thumb img{display:block;width:100%;min-height:100px;background:white;border:2px solid transparent;box-shadow:0 2px 5px #20203015;border-radius:4px}.page-thumb.active img{border-color:#d82b50}.page-thumb span{display:block;margin-top:8px}.page-thumb.active{color:#d82b50}#status{background:white;border-top:1px solid #e7e7ed;font-size:12px}.inline-tools{left:50%;transform:translateX(-50%);background:white;border-color:#dddde7}.inline-tools button{background:#444654}.inline-editor>.move-handle{background:#d82b50}.inline-editor textarea{border-color:#d82b50}dialog{width:min(420px,90vw);border:1px solid #e7e7ed;border-radius:18px;padding:34px;box-shadow:0 22px 100px #15152944;color:#272b36}dialog::backdrop{background:#20223880;backdrop-filter:blur(3px)}dialog h2{font-size:25px;margin:18px 0 10px}dialog p{color:#777887;font-size:14px}dialog label{display:block;font-size:14px;margin:18px 0}dialog input{display:block;width:100%;box-sizing:border-box;padding:12px;border:1px solid #d8d8e3;border-radius:7px;margin-top:7px;font:inherit}.dialog-close{position:absolute;right:12px;top:10px;border:0;background:none;font-size:24px}#authError{color:#c82c48}#authSwitch{margin-top:15px}.wide{width:100%}@media(max-width:1050px){.editor-layout{grid-template-columns:120px minmax(0,1fr) 235px}.canvas-area{padding:25px 15px 80px}header .filename{max-width:200px}}@media(max-width:760px){header{height:auto;flex-wrap:wrap;padding:12px}.brand small{display:none}header .filename{order:5;max-width:100%;width:100%}.editor-layout{grid-template-columns:minmax(0,1fr);height:auto}.page-rail{display:none}.canvas-area{height:65vh}aside{border-top:1px solid #ddd}.toolbar{flex-wrap:wrap}#welcome h1{font-size:34px}.features{display:grid;grid-template-columns:1fr}.inline-tools{width:max-content;max-width:94vw}}

.tool-icon{width:23px;height:23px;flex-shrink:0;pointer-events:none}.icon-button{display:inline-flex;align-items:center;justify-content:center;gap:9px;min-width:40px;min-height:40px}.toolbar .icon-button{padding:10px 14px}.toolbar>div{display:flex;align-items:center;gap:8px}.alignment-buttons{display:flex;gap:4px;align-items:center}.alignment-buttons button{background:white;border:1px solid #dedee7;padding:8px;color:#535463}.alignment-buttons button[aria-pressed=true]{color:#c32449;background:#fff0f4;border-color:#d82b50}.inline-tools .icon-button{padding:8px}.inline-tools .alignment-buttons button[aria-pressed=true]{background:#fff0f4;color:#c32449}.inline-editor>.move-handle .tool-icon{width:20px;height:20px}#fields>.alignment-buttons{margin:12px 0}

.inline-editor .resize-handle{position:absolute;width:10px;height:10px;min-width:0;min-height:0;padding:0;background:#fff;border:1.5px solid #d82b50;border-radius:2px;z-index:7;touch-action:none}.resize-n{top:-5px;left:calc(50% - 5px);cursor:ns-resize}.resize-s{bottom:-5px;left:calc(50% - 5px);cursor:ns-resize}.resize-e{right:-5px;top:calc(50% - 5px);cursor:ew-resize}.resize-w{left:-5px;top:calc(50% - 5px);cursor:ew-resize}.resize-ne{top:-5px;right:-5px;cursor:nesw-resize}.resize-nw{top:-5px;left:-5px;cursor:nwse-resize}.resize-se{bottom:-5px;right:-5px;cursor:nwse-resize}.resize-sw{bottom:-5px;left:-5px;cursor:nesw-resize}.inline-editor.resizing textarea{overflow:hidden;opacity:.9}.inline-editor textarea{min-width:0!important;box-sizing:border-box}.resize-handle:focus-visible{outline:3px solid #e8a0b0;outline-offset:2px}

#signatureDialog{width:min(620px,92vw)}#signatureCanvas{width:100%;height:auto;display:block;border:1px dashed #a7a8b4;border-radius:8px;background:#fafafd;touch-action:none}.signature-actions{display:flex;gap:10px;margin-top:12px}#signatureSaveLabel{display:flex;align-items:center;gap:8px}#signatureSaveLabel input{width:auto;margin:0}.saved-signature{display:flex;gap:10px;margin:8px 0}.saved-signature>button:first-child{flex:1;background:white}.saved-signature img{max-width:100%;height:60px;object-fit:contain}#signatureError{color:#c32449}.signature-surface{border:2px solid #d82b50;box-sizing:border-box}.signature-frame{background:#d82b5008}

.object-menu{position:fixed;z-index:1000;min-width:250px;background:#fff;border:1px solid #e2dfe6;border-radius:10px;padding:6px;box-shadow:0 10px 35px #20203030}.object-menu[hidden]{display:none}.object-menu button{display:flex;align-items:center;gap:12px;width:100%;padding:10px 12px;background:none;border:0;text-align:left;color:#363541}.object-menu button:hover,.object-menu button:focus-visible{background:#fff0f4;outline:none}.object-menu button:disabled{opacity:.35}.object-menu small{margin-left:auto;color:#85808b;font-size:11px}.object-menu .tool-icon{width:18px;height:18px}

.toolbar #signature{flex-direction:column;gap:3px;padding:7px 15px;border-radius:12px;background:#f0f0f3;color:#414148;min-width:64px}.toolbar #signature .tool-icon{width:30px;height:30px;stroke-width:1.9}.toolbar #signature span{font-size:13px;line-height:1.2}.toolbar #signature:hover{background:#fce8ee;color:#c32449}

#drawSurface{position:absolute;left:0;top:0;z-index:8;pointer-events:none;touch-action:none}#drawTool,#eraseTool{flex-direction:column;gap:3px;font-size:12px}#drawTool[aria-pressed=true],#eraseTool[aria-pressed=true]{background:#fce8ee;color:#c32449}#drawOptions{align-items:center;gap:5px}#drawOptions:not([hidden]){display:inline-flex}#penColor{width:30px;height:30px;padding:0}.toolbar{flex-wrap:wrap}

body:has(#welcome:not([hidden])){background:radial-gradient(ellipse at top,#ffe1ef,#f9edf5 60%,#f3e6f0);padding:18px;min-height:100vh;box-sizing:border-box}body:has(#welcome:not([hidden])) header{border-radius:32px 32px 0 0;border:1px solid white;border-bottom:0;background:#fffcfddd;height:85px;padding:18px 6%;}body:has(#welcome:not([hidden])) header .filename{display:none}body:has(#welcome:not([hidden])) #download,body:has(#welcome:not([hidden])) #open{display:none}.language-switch{display:flex;gap:8px;margin-left:auto}.language-switch button{width:37px;height:37px;min-width:0;padding:3px;border-radius:50%;background:white;border:2px solid transparent;display:grid;place-items:center}.language-switch svg{width:27px;height:27px}.language-switch button[aria-pressed=true]{border-color:#cb2454;box-shadow:0 0 0 3px #f7dfeb}#welcome{position:relative;isolation:isolate;max-width:none;min-height:calc(100vh - 160px);padding:30px 30px 45px;background:radial-gradient(ellipse at center,#fff 20%,#fff8fc 100%);border:1px solid white;border-top:0;border-radius:0 0 32px 32px;overflow:hidden;margin:0;box-sizing:border-box}#welcome h1{position:relative;z-index:2;font-size:clamp(30px,3.7vw,52px);font-weight:700;color:#20162d;letter-spacing:-1.4px;margin:10px 0 14px}#welcome .hero-subtitle{font-size:19px;color:#4a3a55;margin:0}#welcome .hero-divider{color:#c7a1cd;margin:20px 0 25px;letter-spacing:5px}.upload-scene{position:relative;width:min(760px,70%);margin:70px auto 25px}.upload-scene .upload-card{position:relative;z-index:2;display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;max-width:none;min-height:260px;margin:0;padding:28px;background:linear-gradient(125deg,#d52d60,#bf1e4b);border:10px solid #fff7fb;outline:1px dashed #d73568;outline-offset:9px;border-radius:48px;color:white;box-shadow:0 15px 50px #c52f5420;cursor:pointer;transition:transform .2s,box-shadow .2s}.upload-card:hover,.upload-card.drag-active{transform:translateY(-3px);box-shadow:0 18px 50px #c52f5440}.upload-plus{display:grid;place-items:center;background:white;color:#23142e;border-radius:50%;width:75px;height:75px;font:56px/1 Arial;margin-bottom:17px;box-shadow:0 3px 0 #00000012}.upload-card strong{font-size:clamp(21px,2.4vw,30px);font-weight:600}.upload-limit{margin-top:18px;font-size:17px;color:white}.upload-mascot{position:absolute;z-index:3;width:260px;height:400px;object-fit:contain;right:-183px;bottom:-5px;pointer-events:none;filter:drop-shadow(0 12px 10px #73416d17)}.hero-benefits{display:flex;justify-content:center;gap:42px;margin:42px 0 20px;position:relative;z-index:3}.hero-benefits>span{display:flex;align-items:center;gap:12px;color:#34233f}.hero-benefits i{display:grid;place-items:center;width:45px;height:45px;border:1px dashed #c29ec8;border-radius:14px;color:#be2858;font-size:28px;font-style:normal}.hero-benefits b{font-weight:500}.hero-note{font-size:13px!important;color:#7e6b85!important}.hero-ribbon{position:absolute;z-index:-1;width:480px;height:170px;border:24px solid #f4c8e3;border-right-color:transparent;border-left-color:transparent;border-radius:50%;opacity:.35;transform:rotate(-33deg)}.ribbon-left{left:-280px;top:140px}.ribbon-right{right:-280px;top:50px}.hero-spark{position:absolute;color:#d9b8df;font-size:42px;z-index:-1}.spark-one{left:12%;top:45%}.spark-two{right:8%;bottom:12%}.hero-doc{position:absolute;color:#d8b4dd;border:2px solid #ead7ee;background:#fbf3fc;border-radius:12px;padding:30px 13px;transform:rotate(-15deg);font-size:24px;opacity:.65;z-index:-1}.doc-left{left:11%;top:40%}.doc-right{right:6%;top:50%;transform:rotate(20deg)}@media(max-width:900px){.upload-mascot{width:180px;right:-110px;height:300px}.upload-scene{width:75%;margin-top:50px}.hero-benefits{gap:18px;font-size:13px}.hero-doc{display:none}}@media(max-width:600px){body:has(#welcome:not([hidden])){padding:8px}body:has(#welcome:not([hidden])) header{padding:12px;height:auto;border-radius:22px 22px 0 0}.brand{font-size:23px}.language-switch{gap:4px}#account{padding:8px;font-size:12px}#welcome{padding:25px 15px 30px}#welcome h1{font-size:30px;letter-spacing:-.5px}#welcome .hero-subtitle{font-size:15px}.upload-scene{width:95%;margin-top:115px}.upload-mascot{height:160px;width:135px;right:-12px;bottom:auto;top:-125px;z-index:1}.upload-scene .upload-card{min-height:225px;padding:22px 12px;border-radius:32px}.upload-plus{width:58px;height:58px;font-size:43px}.upload-card strong{font-size:20px}.upload-limit{font-size:13px}.hero-benefits{gap:15px;flex-wrap:wrap;margin-top:30px}.hero-benefits>span{gap:6px}.hero-benefits i{width:30px;height:30px;font-size:21px}}
/* Desktop editor layout, matching the supplied reference structure. */
body:has(#workspace:not([hidden])){padding:0;background:#e7e7e9;overflow:hidden}body:has(#workspace:not([hidden])) header{height:76px;padding:12px 24px;gap:16px;background:white;box-sizing:border-box}body:has(#workspace:not([hidden])) .brand small{display:none}body:has(#workspace:not([hidden])) .filename{max-width:300px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}body:has(#workspace:not([hidden])) #open{display:none}#doneEditor{min-width:120px}body:has(#welcome:not([hidden])) #doneEditor{display:none}#workspace .toolbar{height:74px;box-sizing:border-box;display:flex;flex-wrap:nowrap;justify-content:flex-start;padding:6px 18px;gap:6px;background:#fafafc;overflow-x:auto}#workspace .toolbar>div{display:flex;gap:3px;margin:0;flex:1;justify-content:center}#workspace .toolbar .icon-button{flex-direction:column;gap:4px;padding:6px 10px;min-width:56px;min-height:56px;font-size:11px;color:#51515a;border-radius:7px;background:transparent}#workspace .toolbar .tool-icon{width:24px;height:24px}#workspace .toolbar .icon-button:hover,#workspace .toolbar .icon-button[aria-pressed=true]{background:#fceef1;color:#d82b50}#workspace .editor-layout{height:calc(100vh - 150px);min-height:0;grid-template-columns:190px minmax(0,1fr);position:relative}#workspace .canvas-area{padding:48px 48px 120px;background:#e7e7e9}#workspace .page-rail{padding:18px 14px;background:#f4f4f7}#workspace .page-thumb.active img{border-color:#287aff;border-width:3px}#workspace .page-thumb.active{color:#287aff}#workspace aside{display:none;position:absolute;right:0;top:0;bottom:0;width:285px;box-sizing:border-box;z-index:12;box-shadow:-5px 0 20px #20203012}#workspace.inspect-open aside{display:block}#workspace.inspect-open .canvas-area{padding-right:310px}#workspace.hide-pages .page-rail{display:none}#workspace.hide-pages .editor-layout{grid-template-columns:minmax(0,1fr)}.page-dock{position:fixed;bottom:26px;left:calc(50% + 95px);transform:translateX(-50%);z-index:14;display:flex;align-items:center;gap:15px;padding:8px 18px;border-radius:40px;background:#393b48;color:white;box-shadow:0 4px 20px #23233244;font-size:12px}.page-dock>div{display:flex;align-items:center;gap:10px}.page-dock button{color:white;background:transparent;border:0;min-width:28px;padding:4px}.page-dock select{background:transparent;color:white;border:0}.page-dock select option{color:#333;background:white}.page-dock label{display:flex;align-items:center;gap:7px}body:has(#workspace:not([hidden])) #status{max-width:450px;font-size:11px;padding:4px 12px;background:#ffffffd9;border:0;pointer-events:none}.inline-tools{bottom:100px}#inspectorClose{float:right;padding:3px;font-size:11px;min-height:28px}@media(max-width:760px){body:has(#workspace:not([hidden])) header{gap:8px;height:65px;padding:8px}.filename{display:none}body:has(#workspace:not([hidden])) .brand{font-size:20px}#doneEditor{min-width:65px}body:has(#workspace:not([hidden])) #download{display:none}#workspace .toolbar{height:72px;padding:4px}#workspace .editor-layout{height:calc(100vh - 137px);grid-template-columns:minmax(0,1fr)}#workspace .canvas-area{height:auto;padding:25px 15px 120px}#workspace.inspect-open .canvas-area{padding-right:15px}#workspace .page-rail{display:none}.page-dock{left:50%;bottom:30px;gap:5px;white-space:nowrap}#workspace aside{width:270px}}
.insert-page{display:flex;align-items:center;gap:12px;width:100%;border:0;background:transparent;padding:9px 0;color:#9aa2b2}.insert-page span{height:1px;background:#cbd0d8;flex:1}.insert-page b{font-size:23px}.insert-page:hover{color:#2478ef;background:#e4edff}.page-insert-menu,.page-layout-panel{background:white;border:1px solid #dddfe5;border-radius:15px;box-shadow:0 12px 35px #19203524;padding:15px;z-index:60}.page-insert-menu{position:fixed;width:200px}.page-insert-menu button{display:flex;gap:15px;width:100%;border:0;padding:13px;background:white}.page-layout-panel{position:absolute;right:24px;top:80px;width:300px}.page-layout-panel>div{display:flex;gap:7px;align-items:center;padding:15px 0;border-bottom:1px solid #ececf0}.page-layout-panel>div:last-child{border:0}.page-layout-panel span{flex:1}.page-layout-panel button{padding:9px;border:0;background:#f3f4f6;border-radius:9px}.page-layout-panel button[aria-pressed=true]{color:#f04455;background:#ffe4e7}.page-layout-panel svg{width:23px;height:23px}.page-rail #managePages{display:flex;align-items:center;justify-content:center;gap:9px;width:100%;font-size:13px;background:white;border:1px solid #d9dce3;border-radius:7px;margin-bottom:10px}.page-manager{width:min(950px,90vw);max-height:85vh;border:0;border-radius:20px;padding:25px}.manager-heading{display:flex;justify-content:space-between;align-items:center}.manager-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:20px}.manager-card{background:#f3f4f6;border-radius:10px;padding:12px;text-align:center}.manager-card img{width:100%;height:210px;object-fit:contain;background:white}.manager-card>div{display:flex;justify-content:center;margin-top:10px;gap:5px}.manager-card button span{display:none}.manager-card svg{width:19px;height:19px}.page-stack{display:flex;flex-direction:column;align-items:center;gap:25px;min-width:min-content;margin:auto}.page-stack.two-pages{display:grid;grid-template-columns:repeat(2,max-content);align-items:start;justify-content:center}.layout-preview{padding:0;border:0;box-shadow:0 2px 15px #0002;background:white;max-width:600px}.layout-preview img{display:block;width:100%;min-height:250px}.page-stack #paper{margin:0}.page-insert-menu[hidden],.page-layout-panel[hidden]{display:none}

.page-layout-panel{padding-top:46px}.page-layout-panel .page-layout-close{position:absolute;top:10px;right:10px;display:grid;place-items:center;width:30px;height:30px;padding:5px;background:transparent;color:#626775}.page-layout-panel .page-layout-close:hover{background:#fceef1;color:#d82b50}.page-layout-panel .page-layout-close:focus-visible{outline:2px solid #287aff;outline-offset:2px}.page-layout-panel .page-layout-close svg{width:20px;height:20px}
/* Anchor the mascot's hands to the upload card rather than its feet. */
.upload-scene{--mascot-width:280px;width:min(760px,calc(100% - 240px));margin:145px auto 30px}
.upload-scene .upload-mascot{width:var(--mascot-width);height:auto;object-fit:initial;right:-110px;bottom:auto;top:calc(10px - var(--mascot-width)*.43);z-index:3}
.upload-scene .upload-card:hover,.upload-scene .upload-card.drag-active{transform:none}
@media(min-width:901px){.upload-scene .upload-card{padding-right:70px}}
@media(min-width:601px) and (max-width:900px){.upload-scene{--mascot-width:220px;width:calc(100% - 150px);margin-top:115px}.upload-scene .upload-mascot{right:-85px}.upload-scene .upload-card{padding:28px 48px 28px 20px}.upload-card strong{font-size:24px}.upload-limit{font-size:15px}}
@media(max-width:600px){
 body:has(#welcome:not([hidden])) header{flex-wrap:nowrap;gap:8px}
 body:has(#welcome:not([hidden])) .brand{font-size:21px}
 .language-switch button{width:32px;height:32px}.language-switch svg{width:24px;height:24px}
 #welcome{padding:24px 20px 30px}#welcome h1{font-size:clamp(25px,6.7vw,32px);line-height:1.4}#welcome .hero-subtitle{font-size:15px;line-height:1.7}
 .upload-scene{--mascot-width:180px;width:100%;margin:100px auto 25px}
 .upload-scene .upload-mascot{right:0;top:calc(10px - var(--mascot-width)*.43);clip-path:inset(0 0 56% 0);z-index:3}
 .upload-scene .upload-card{min-height:240px;padding:30px 14px 24px;border-width:7px;border-radius:30px;outline-offset:6px}
 .upload-card strong{font-size:clamp(19px,4.7vw,24px);line-height:1.5;text-wrap:balance}.upload-limit{font-size:12px;line-height:1.6;margin-top:12px}.upload-plus{width:58px;height:58px;margin-bottom:15px}
 .hero-benefits{gap:12px 18px}.hero-benefits>span{font-size:12px}.hero-note{line-height:1.7}
}
.pdf-mode-switch{display:flex;justify-content:center;gap:8px;position:relative;z-index:4;margin:0 auto 22px}.pdf-mode-switch button{display:flex;align-items:center;gap:8px;border-radius:24px;font-size:13px;background:white;padding:10px 18px}.pdf-mode-switch button[aria-pressed=true]{background:#d82b50;border-color:#d82b50;color:white}.pdf-mode-switch svg{width:20px;height:20px}#thaiReader{width:min(1200px,96vw);max-width:none;max-height:94dvh;padding:24px;overflow:auto}#thaiReader .reader-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.reader-heading h2{margin:3px 0}.reader-heading small{color:#bc2852;letter-spacing:1px}#readerClose{border:0;font-size:28px;padding:4px 12px}.reader-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.reader-actions button{font-size:13px;padding:9px 13px}#readerStatus{min-height:22px;color:#b02750}.reader-columns{display:grid;grid-template-columns:1fr 1fr;gap:22px}.reader-original{background:#ededf2;border-radius:12px;padding:14px;max-height:57vh;overflow:auto}.reader-original img{width:100%;height:auto;box-shadow:0 3px 12px #0002}.reader-output{display:flex;flex-direction:column;gap:10px}.reader-output label{margin:0}.reader-output textarea{width:100%;min-height:260px;flex:1;resize:vertical;border:1px solid #d8d8e0;border-radius:10px;padding:16px;font:16px/1.8 Sarabun,sans-serif;color:#272b36}.reader-output>div{display:flex;gap:10px}.reader-output small{color:#777;line-height:1.6}@media(max-width:650px){#thaiReader{padding:16px;width:96vw}.reader-columns{grid-template-columns:1fr}.reader-original{max-height:240px}.reader-output textarea{min-height:300px}.reader-description{font-size:12px!important}.pdf-mode-switch button{font-size:12px;padding:9px 12px}}
.reader-output .reader-word-controls{display:flex;flex-wrap:wrap;border-top:1px solid #e4e4eb;padding-top:12px;gap:10px}.reader-word-controls select{max-width:100%;padding:9px;border:1px solid #ddd;border-radius:8px;font:inherit;font-size:13px}.reader-word-controls small{flex-basis:100%}#readerWord{display:flex;align-items:center;gap:8px;font-size:13px}#readerWord svg{width:20px;height:20px}

/* Primary tools stay available in both upload and editor views. */
header .pdf-mode-switch{margin:0;flex-shrink:0;gap:4px;background:#f5f2f6;border-radius:28px;padding:4px}
header .pdf-mode-switch button{padding:10px 14px;border:0;background:transparent;white-space:nowrap;font-size:12px}
header .pdf-mode-switch button[aria-pressed=true]{background:#d82b50;color:#fff}
header .filename{min-width:0;padding-left:12px}
.reader-output .reader-word-controls{border-top:0;border-bottom:1px solid #e4e4eb;padding:0 0 14px}
@media(max-width:1100px){header .filename{display:none}header .pdf-mode-switch{margin-right:auto}}
@media(max-width:650px){header .pdf-mode-switch{order:10;width:100%;justify-content:center;margin:8px 0 0}header .pdf-mode-switch button{flex:1;justify-content:center}}
@media(max-width:800px){body:has(#welcome:not([hidden])) header,body:has(#workspace:not([hidden])) header{flex-wrap:wrap;height:auto}header .pdf-mode-switch{order:10;width:100%;justify-content:center;margin:6px 0 0}header .pdf-mode-switch button{flex:1;justify-content:center}}

/* Mobile artwork has its own complete silhouette, with hands on the card edge. */
@media(max-width:600px){
 .upload-scene{--mascot-width:clamp(132px,36vw,176px);margin-top:145px}
 .upload-scene .upload-mascot{width:var(--mascot-width);height:auto;right:14px;top:calc(7px - var(--mascot-width)*.89);clip-path:none;z-index:3;filter:drop-shadow(0 3px 3px #73416d12)}
}

/* One peeking pose across desktop, tablet and mobile. */
.upload-scene{--mascot-width:220px;width:min(760px,calc(100% - 80px));margin-top:195px}
.upload-scene .upload-mascot{width:var(--mascot-width);height:auto;right:24px;top:calc(10px - var(--mascot-width)*.89);bottom:auto;clip-path:none;z-index:3;filter:drop-shadow(0 3px 3px #73416d12)}
.upload-scene .upload-card{padding:28px}
@media(min-width:601px) and (max-width:900px){.upload-scene{--mascot-width:190px;margin-top:170px}.upload-scene .upload-mascot{right:20px}}
@media(max-width:600px){.upload-scene{--mascot-width:clamp(132px,36vw,176px);width:100%;margin-top:145px}.upload-scene .upload-mascot{right:14px;top:calc(7px - var(--mascot-width)*.89)}.upload-scene .upload-card{padding:30px 14px 24px}}

/* Registered eight-pose sprite: blink, point twice, then rest. */
.upload-scene .mascot-animated{display:block;height:var(--mascot-width);background-image:url('/static/mascot-sprite-smile.png');background-size:400% 200%;background-repeat:no-repeat;background-position:0 0;top:calc(10px - var(--mascot-width)*.84);animation:sweetie-gesture 6s steps(1,end) infinite}
@keyframes sweetie-gesture{
 0%,30%{background-position:0 0}
 31%{background-position:33.333333% 0}32.5%{background-position:66.666667% 0}34%{background-position:100% 0}35.5%{background-position:0 0}
 51%{background-position:0 100%}53%{background-position:33.333333% 100%}55%,59%{background-position:66.666667% 100%}61%{background-position:100% 100%}
 63%{background-position:33.333333% 100%}65%,69%{background-position:66.666667% 100%}71%{background-position:100% 100%}73%{background-position:0 100%}75%,100%{background-position:0 0}
}
@media(max-width:600px){.upload-scene .mascot-animated{top:calc(7px - var(--mascot-width)*.84)}}
@media(prefers-reduced-motion:reduce){.upload-scene .mascot-animated{animation:none;background-position:0 0}}
body:has(#welcome[hidden]) .mascot-animated{animation-play-state:paused}

.suite-links{display:flex;gap:12px;white-space:nowrap;font-size:13px}.suite-links a{color:#a3234d;text-decoration:none}@media(max-width:800px){.suite-links{order:11;width:100%;justify-content:center}}
.reader-word-controls .word-mode-choices{border:0;padding:0;margin:0;display:flex;gap:10px;flex:1 1 480px;min-width:0}.word-mode-choices legend{font-size:13px;color:#69586d;margin-bottom:8px}.word-mode-choices label{position:relative;display:flex;flex:1;min-width:0;cursor:pointer}.word-mode-choices input{position:absolute;opacity:0;width:1px;height:1px}.word-choice{display:flex;align-items:center;gap:10px;width:100%;padding:12px 14px;border:1px solid #e3d8e2;border-radius:14px;background:#fff;color:#48364f;font-size:14px}.word-choice svg{width:30px;height:30px;flex-shrink:0}.word-mode-choices input:checked+.word-choice{background:#fff0f5;border-color:#ce2858;box-shadow:0 0 0 1px #ce2858;color:#9f2047}.word-mode-choices input:focus-visible+.word-choice{outline:3px solid #9764be;outline-offset:3px}.word-mode-choices:disabled{opacity:.5}.reader-word-controls select[hidden]{display:none!important}@media(max-width:600px){.reader-word-controls .word-mode-choices{flex-direction:column;flex-basis:100%}.word-choice{font-size:14px}}

.save-toast{position:fixed;bottom:28px;left:50%;transform:translateX(-50%);z-index:10000;padding:12px 22px;border-radius:14px;background:#203b30;color:#fff;box-shadow:0 8px 28px #0003;font-size:14px;max-width:calc(100vw - 32px);text-align:center;pointer-events:none}.save-toast.error{background:#98233e}.save-toast[hidden]{display:none}

/* Shared document status pill, including narrow screens. */
#status{position:relative;bottom:auto;display:flex;align-items:center;gap:12px;width:calc(100% - 40px);max-width:1080px;min-height:58px;margin:18px auto;padding:14px 20px;border:1px solid #efcade;border-radius:18px;background:linear-gradient(110deg,#fff2f8,#fffafd);box-shadow:0 4px 16px #a8275910;color:#92516e;font-size:15px;font-weight:500;line-height:1.6;overflow-wrap:anywhere;pointer-events:auto}
#status::before{content:'i';display:grid;place-items:center;flex:0 0 30px;width:30px;height:30px;border-radius:50%;background:#f8dce9;color:#c92160;font:bold 19px Georgia,serif}
#status.success{color:#256641;border-color:#bfe4cc;background:#f0fbf4}
#status.success::before{content:'✓';background:#d9f2e2;color:#23814c;font-family:Arial,sans-serif}
#status.error{color:#a52940;border-color:#edbdc6;background:#fff2f4}
#status.error::before{content:'!';background:#fbd7de;color:#bd2441}
#status.is-busy:not(.error)::before{content:'';box-sizing:border-box;flex-basis:26px;width:26px;height:26px;margin:2px;border:3px solid #f1cddd;border-top-color:#ce235e;background:transparent;animation:document-status-spin .8s linear infinite}
@keyframes document-status-spin{to{transform:rotate(360deg)}}
@media(max-width:600px){#status{width:calc(100% - 24px);margin:14px auto;padding:12px 14px;min-height:54px;font-size:14px;border-radius:15px}}
@media(prefers-reduced-motion:reduce){#status.is-busy:not(.error)::before{animation:none}}
