:root{--green:#227763;--ink:#243b36;--muted:#7b8984;--line:#e3eae6;--pale:#f1f5f2}*{box-sizing:border-box}body{margin:0;background:#fff;color:var(--ink);font:15px "MaeMoo Thai",system-ui,sans-serif;height:var(--app-height,100%);display:flex;flex-direction:column;overflow:hidden}button,select,input{font:inherit}button{border:0;background:transparent;color:inherit;min-width:44px;height:44px;display:inline-flex;align-items:center;justify-content:center;border-radius:12px;cursor:pointer;touch-action:manipulation}button:active,button.active{background:#dceee5;color:var(--green)}button svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}header{height:62px;flex-shrink:0;display:flex;align-items:center;padding:0 8px;border-bottom:1px solid var(--line);background:#f6f8f6;gap:2px}#identity{flex:1;min-width:0;padding:0 6px}#title{font-weight:650;font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:2px 0}small{color:var(--muted);font-size:10px}#workspace{overflow:auto;flex:1;min-height:0;overscroll-behavior:contain;background:#fff}#editor{outline:0;min-height:100%;padding:22px 20px 90px;font-family:"MaeMoo Thai",system-ui,sans-serif;font-size:18px;line-height:1.75;word-break:normal;line-break:auto;overflow-wrap:break-word;text-justify:auto;text-align-last:auto;color:#263c35;caret-color:var(--green)}#editor:empty:before{content:attr(data-placeholder);color:#a4b1aa;pointer-events:none}#editor p{margin:.4em 0}#editor h1{font-size:1.75em;line-height:1.4}#editor h2{font-size:1.4em;line-height:1.4}#editor h3{font-size:1.15em}#editor blockquote{border-left:3px solid #8fbda9;padding-left:14px;color:#61726a;margin:14px 0}#editor img{max-width:100%;height:auto;border-radius:4px}#editor img.selected{outline:3px solid #227763;outline-offset:2px}footer{height:50px;flex-shrink:0;border-top:1px solid var(--line);display:flex;align-items:center;padding:0 8px;gap:3px;background:#f6f8f6}#count{flex:1;text-align:right;padding-right:8px;color:var(--muted);font-size:10px}#formatbar{background:#f6f8f6;border-top:1px solid var(--line);flex-shrink:0;padding:4px 6px}#formatbar .row{display:flex;align-items:center;justify-content:space-between;gap:2px}#formatbar button{min-width:38px;height:42px}select{color:var(--ink);border:0;background:#e7eee8;border-radius:8px;height:34px;max-width:100px;padding:0 5px}#size{width:42px}.color{position:relative;width:38px;height:36px;text-align:center;padding-top:4px;font-weight:bold;text-decoration:underline;text-decoration-color:var(--green);text-decoration-thickness:3px}.color input{opacity:0;position:absolute;inset:0;width:100%;height:100%}[hidden]{display:none!important}#overlay{position:fixed;inset:0;background:#183c3355;display:flex;align-items:flex-end;z-index:5}#sheet{background:white;width:100%;max-height:86%;border-radius:24px 24px 0 0;display:flex;flex-direction:column;box-shadow:0 -8px 40px #1b40351a}#sheetBody{overflow:auto;padding:0 20px 24px}.sheet-head{display:flex;align-items:center;justify-content:space-between;padding:13px 15px 7px 22px;flex-shrink:0}h2{font-size:20px;margin:8px 0}.menu-item{width:100%;justify-content:flex-start;text-align:left;gap:14px;border-radius:10px;height:53px}.menu-item span{flex:1}.menu-item small{font-size:12px}.primary{background:var(--green);color:white;padding:0 20px}.secondary{background:var(--pale);padding:0 18px}.form-label{display:block;font-size:12px;margin:14px 0 5px;color:#718278}.field{width:100%;border:1px solid #cbd8d0;border-radius:10px;padding:12px;outline:0;color:var(--ink);background:#fff;font-size:16px}.field:focus{border-color:var(--green)}.actions{display:flex;gap:10px;margin-top:20px}.hint{font-size:13px;line-height:1.6;color:#75847c}.docrow{display:flex;border-bottom:1px solid var(--line);align-items:center;gap:4px}.docopen{flex:1;justify-content:flex-start;min-width:0;height:auto;padding:14px 0;display:block}.docopen strong{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:16px}.docopen small{display:block;margin-top:4px}.gallery{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:12px}.gallery button{height:110px;width:100%;padding:0;overflow:hidden;background:var(--pale)}.gallery img{width:100%;height:100%;object-fit:cover}.pill{display:inline-block;background:#e3efe7;color:var(--green);padding:5px 9px;border-radius:20px;font-size:12px}#toast{position:fixed;bottom:65px;left:18px;right:18px;padding:12px 16px;border-radius:14px;background:#243d35;color:#fff;font-size:13px;z-index:10;pointer-events:none;opacity:0;transition:opacity .2s;max-height:120px;overflow:hidden}#toast.show{opacity:1}#findbar{display:flex;padding:5px 12px;border-bottom:1px solid var(--line)}#findtext{flex:1;min-width:0;border:0;outline:0;font-size:16px}#focusExit{position:fixed;right:10px;top:10px;background:#eef5eef0;box-shadow:0 2px 14px #183c3320;z-index:2}body.focus header,body.focus footer,body.focus #formatbar{display:none!important}body.focus #focusExit{display:flex!important}.empty{text-align:center;padding:24px 10px}.danger{color:#b44242}input[type=range]{width:100%;accent-color:var(--green)}@media(min-width:700px){#editor{max-width:820px;margin:auto;padding:38px 50px 130px}#sheet{max-width:600px;margin:auto;border-radius:24px;max-height:80dvh}#overlay{align-items:center}#formatbar .row{justify-content:center;gap:12px}header{padding:0 20px}footer{padding:0 20px}}

html{height:100%;overflow:hidden}#toolDock{flex-shrink:0;background:#f6f8f6}
body.keyboard-open #toolDock{margin:4px 10px 8px;border:1px solid #dbe7df;border-radius:16px;overflow:hidden;box-shadow:0 4px 18px #20473521}
body.keyboard-open footer{border-top:0;height:48px}body.keyboard-open #formatbar{border-top:0;border-bottom:1px solid var(--line)}
body.keyboard-open #editor{padding-bottom:48px}body.focus #toolDock{display:none!important}
#editor{display:flow-root}#editor::after{content:"";display:block;clear:both}
.wrap-choices{display:flex;gap:8px;margin-top:8px}.wrap-choice{flex:1;height:64px;flex-direction:column;gap:3px;border:1px solid var(--line);background:var(--pale);font-size:11px}
.wrap-choice.active{border-color:var(--green);background:#dceee5;color:var(--green)}

#overlay.image-inspector{background:transparent;pointer-events:none}#overlay.image-inspector #sheet{pointer-events:auto;max-height:min(340px,48%);border:1px solid var(--line);box-shadow:0 -4px 24px #173f3320}
#overlay.image-inspector .sheet-head{padding:4px 12px 0 18px}#overlay.image-inspector h2{font-size:17px}
#overlay.image-inspector #sheetBody{padding:0 16px 12px}#overlay.image-inspector .form-label{margin:5px 0 2px}
#overlay.image-inspector .wrap-choice{height:52px}#overlay.image-inspector .actions{margin-top:8px}#overlay.image-inspector .actions button{height:36px;flex:1}
.image-placement{display:flex;gap:6px;margin-top:8px}.image-placement button{height:36px;padding:0 10px;gap:4px;font-size:11px;flex:1}
body.image-editing #editor{padding-bottom:420px}body.placing-image #editor{cursor:crosshair}body.placing-image #editor p:active,body.placing-image #editor div:active{background:#e1f1e6}
@media(min-width:700px){#overlay.image-inspector{align-items:flex-end}#overlay.image-inspector #sheet{margin:0 auto}}

#placementHint{display:flex;align-items:center;justify-content:space-between;background:#e1f1e6;padding:2px 10px 2px 16px;font-size:12px;flex-shrink:0}#placementHint button{font-size:12px;color:var(--green);height:36px;padding:0 10px}

#formatbar .row:nth-child(2){display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:0;width:100%;max-width:480px;margin-inline:auto}#formatbar .row:nth-child(2) button{min-width:0;width:100%}#formatbar .row:nth-child(2) #size{width:100%;min-width:0;max-width:42px;justify-self:center}

#count{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#focusKeyboard{position:fixed;right:62px;top:10px;background:#eef5eef0;box-shadow:0 2px 14px #183c3320;z-index:2}body.focus #focusKeyboard{display:flex!important}
.preference-row{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:14px 0;border-bottom:1px solid var(--line)}.preference-row strong{display:block;font-size:16px}.preference-row small{display:block;font-size:12px;margin-top:5px}.preference-row input{width:22px;height:22px;accent-color:var(--green)}#keyboardOption{max-width:none;height:46px}

/* Export snapshots retain editor typography outside the scrolling document. */
.office-snapshot{outline:0;min-height:100%;padding:22px 20px 90px;font-family:"MaeMoo Thai",system-ui,sans-serif;font-size:18px;line-height:1.75;word-break:normal;line-break:auto;overflow-wrap:break-word;text-justify:auto;text-align-last:auto;color:#263c35;caret-color:var(--green)}.office-snapshot:empty:before{content:attr(data-placeholder);color:#a4b1aa;pointer-events:none}.office-snapshot p{margin:.4em 0}.office-snapshot h1{font-size:1.75em;line-height:1.4}.office-snapshot h2{font-size:1.4em;line-height:1.4}.office-snapshot h3{font-size:1.15em}.office-snapshot blockquote{border-left:3px solid #8fbda9;padding-left:14px;color:#61726a;margin:14px 0}.office-snapshot img{max-width:100%;height:auto;border-radius:4px}.office-snapshot img.selected{outline:3px solid #227763;outline-offset:2px}.office-snapshot{max-width:820px;margin:auto;padding:38px 50px 130px}
body.keyboard-open .office-snapshot{padding-bottom:48px}
.office-snapshot{display:flow-root}.office-snapshot::after{content:"";display:block;clear:both}
body.image-editing .office-snapshot{padding-bottom:420px}body.placing-image .office-snapshot{cursor:crosshair}body.placing-image .office-snapshot p:active,body.placing-image .office-snapshot div:active{background:#e1f1e6}
.feature-table{width:100%;border-collapse:collapse;font-size:13px}.feature-table th,.feature-table td{text-align:left;padding:10px 6px;border-bottom:1px solid var(--line);vertical-align:top}.feature-table th{color:var(--green)}

.font-preview{margin-top:16px;padding:18px 12px;background:var(--pale);border-radius:12px;font-size:24px;line-height:1.7;overflow-wrap:break-word}#fontChoice,#fontScope{max-width:none}#fontButton{font-size:17px;font-weight:bold;min-width:34px!important}body.document-closed #toolDock,body.document-closed header [data-action=undo],body.document-closed header [data-action=redo],body.document-closed #focusKeyboard{display:none!important}#closedHome{padding:32px 20px}.document-closed #workspace{background:#fafcfb}#formatbar .row:first-child{gap:0}#formatbar .row:first-child #block{max-width:90px}@media(max-width:400px){#formatbar .row:first-child button{min-width:32px;width:32px}#formatbar .row:first-child #block{max-width:80px}.font-preview{font-size:22px}}
select.field{height:auto;min-height:48px;padding:10px 12px;line-height:1.4}

.menu-item svg{flex:0 0 22px}.menu-item span{min-width:0}

#size{width:54px;min-width:54px;font-size:13px;gap:2px;background:#e7eee8;height:34px}#size small{font-size:9px}.size-presets{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px;margin:12px 0}.size-presets button{min-width:0;padding:0;height:38px}.size-link{margin-top:12px}
#sizeScope{max-width:none}

.menu-item{display:flex;min-height:52px;height:auto;padding:10px 6px}.menu-item span{line-height:1.5;white-space:normal}.menu-item svg{align-self:center}
.menu-item span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

#workspaceShell{position:relative;display:flex;flex:1;min-height:0;overflow:hidden}#workspace{position:relative;min-width:0;width:100%}#paperFrame{min-height:100%}#pageTools{position:absolute;right:10px;bottom:10px;display:flex;background:#f6f8f6f5;border:1px solid var(--line);border-radius:12px;box-shadow:0 2px 10px #203a3520;z-index:2}#pageTools button{height:34px;min-width:34px;border-radius:10px;font-size:17px}#pageTools #pageZoom{font-size:12px;min-width:46px}body.paper-mode #workspace{background:#e7ece9;padding:12px}body.paper-mode #paperFrame{position:relative;min-height:0;margin:0 auto;overflow:hidden;overflow:clip;background:white;box-shadow:0 2px 9px #1a332b26}body.paper-mode #editor{position:absolute;left:0;top:0;width:210mm;max-width:none;min-height:297mm!important;box-sizing:border-box;margin:0;padding:18mm!important;background:white;transform-origin:0 0}body.document-closed #paperFrame,body.document-closed #pageTools{display:none!important}body.document-closed #workspace{padding:0;background:#fafcfb}

body.paper-mode.image-editing #workspace::after{content:"";display:block;height:420px}

#editor [data-page-break="1"]::before{content:"";display:block;border-top:1px dashed #a4b8af;margin-bottom:8px;pointer-events:none}

#pageBoundaries{position:absolute;left:0;top:0;pointer-events:none;z-index:1;overflow:hidden} .page-boundary{position:absolute;left:0;right:0;border-top:1px dashed #558f7b;pointer-events:none}.page-boundary span{position:absolute;right:3px;top:-8px;background:#e6f1eb;color:#28664f;border:1px solid #9ebfae;border-radius:4px;font:10px system-ui;padding:1px 4px}.page-boundary.first-page{border-top:0}.page-boundary.first-page span{top:0}#pageCount{font-size:11px;color:#557467;padding:0 6px;align-self:center}body.paper-mode #editor [data-page-break="1"]::before{display:none}body.paper-mode #editor img,.office-snapshot img{max-height:261mm;object-fit:contain}

.identity-meta{display:flex;align-items:center;gap:6px;white-space:nowrap;overflow:hidden}#appBrand{font-size:11px;font-weight:650;color:var(--green);letter-spacing:.1px}#state{overflow:hidden;text-overflow:ellipsis;font-size:9px}#appBrand::after{content:"·";margin-left:6px;color:var(--muted)}
