.pdf-editor-shell{max-width:none;width:100%;margin:auto}.editor-workspace{display:grid;grid-template-columns:160px minmax(0,1fr) 260px;grid-template-rows:minmax(0,1fr);height:calc(100dvh - 124px);min-height:560px;background:#e8edf4}.editor-sidebar,.editor-properties{background:#fff;overflow:auto;padding:1rem}.editor-sidebar{border-right:1px solid #dbe3ee}.editor-properties{border-left:1px solid #dbe3ee}.editor-properties h3{font-size:1rem;font-weight:700;margin-bottom:1rem}.editor-properties label{display:flex;flex-direction:column;gap:.35rem;margin-bottom:1rem;color:#475569;font-size:.8rem;font-weight:600}.editor-properties input[type=color]{width:100%;height:38px;border:1px solid #cbd5e1;border-radius:.55rem;padding:.2rem;background:#fff}.editor-properties input[type=number]{width:100%;height:38px;border:1px solid #cbd5e1;border-radius:.55rem;padding:0 .65rem;background:#fff}.editor-properties .tool-btn{width:100%;justify-content:center;margin-top:.5rem}.editor-properties #delete-object{color:#dc2626;border-color:#fecaca}.editor-stage{overflow:auto;padding:1.5rem 2rem;position:relative}.editor-toolbar{position:sticky;top:64px;z-index:40;background:#fff;border-bottom:1px solid #dbe3ee;padding:.55rem .75rem;display:flex;align-items:center;justify-content:space-between;gap:.75rem;min-height:60px}.toolbar-tools,.toolbar-actions{display:flex;align-items:center;gap:.35rem}.toolbar-tools{min-width:0;overflow-x:auto;padding-bottom:2px}.toolbar-actions{flex:none;border-left:1px solid #e2e8f0;padding-left:.75rem}.tool-btn{display:inline-flex;align-items:center;justify-content:center;gap:.35rem;min-height:38px;white-space:nowrap;border:1px solid #dbe3ee;border-radius:.65rem;padding:.48rem .7rem;font-size:.8rem;font-weight:600;background:#fff;color:#334155;transition:.15s}.tool-btn.active,.tool-btn:hover{background:#eef2ff;color:#4338ca;border-color:#a5b4fc}.tool-btn.primary{background:#4f46e5!important;color:#fff!important;border-color:#4f46e5!important;padding-inline:1rem}.tool-btn.primary:hover{background:#4338ca!important}.tool-btn:disabled{opacity:.4;cursor:not-allowed}.zoom-value{min-width:44px;text-align:center;font-size:.75rem;font-weight:700;color:#475569}.pdf-page{position:relative;margin:0 auto 1.5rem;background:#fff;box-shadow:0 8px 28px #0f172a20;width:max-content}.pdf-page canvas{display:block}.form-layer,.object-layer{position:absolute;inset:0}.object-layer{pointer-events:none}.pdf-object{pointer-events:auto;cursor:grab}.pdf-object:active{cursor:grabbing}.pdf-object .resize-handle{position:absolute;right:-7px;bottom:-7px;width:14px;height:14px;background:#4f46e5;border:2px solid #fff;border-radius:50%;cursor:nwse-resize;touch-action:none}.pdf-object-freehand svg,.draw-preview svg{width:100%;height:100%;display:block}.draw-preview{position:absolute;inset:0;pointer-events:none;z-index:5}.form-layer input,.form-layer textarea,.form-layer select{position:absolute;background:#eff6ff55;border:1px solid #6366f180;border-radius:3px;padding:2px;outline:none}.form-layer input:hover,.form-layer textarea:hover,.form-layer select:hover,.form-layer input:focus,.form-layer textarea:focus,.form-layer select:focus{background:#eef2ffff;border-color:#4f46e5;box-shadow:0 0 0 2px #c7d2fe88}.pdf-object{position:absolute;border:1px dashed transparent;touch-action:none;box-sizing:border-box;overflow:hidden}.pdf-object.selected{border-color:#4f46e5;box-shadow:0 0 0 2px #c7d2fe}.pdf-object textarea{resize:none}.pdf-object-text{background:#ffffffaa;border:1px dashed #818cf8;padding:3px}.pdf-object-symbol{font-size:2rem;color:#16a34a;display:flex;align-items:center;justify-content:center}.pdf-object-image img,.pdf-object-signature img{width:100%;height:100%;object-fit:contain}.pdf-object-highlight{background:#fde04780}.pdf-object-whiteout{background:#fff}.pdf-object-shape{border:2px solid #4f46e5;background:#eef2ff66}.thumb{width:100%;border:1px solid transparent;border-radius:.6rem;margin-bottom:.6rem;padding:.65rem;background:#f8fafc;font-size:.8rem;font-weight:600;color:#475569}.thumb:hover,.thumb.active{border-color:#a5b4fc;background:#eef2ff;color:#4338ca}.drop-zone.dragover{background:#eef2ff;border-color:#6366f1}
/* โหมดแก้ไข: editor เต็มจอพอดี viewport — ล็อกหน้าเว็บ เลื่อนเฉพาะภายใน stage,
   ซ่อนเนื้อหา SEO ที่อยู่ใต้ editor (ยังแสดงปกติบนหน้า landing ก่อนเปิดไฟล์) */
body.editor-active{overflow:hidden;height:100dvh}
body.editor-active .pdf-editor-shell{height:calc(100dvh - 64px);overflow:hidden}
body.editor-active .editor-toolbar{position:static}
body.editor-active #workspace{display:flex;flex-direction:column;height:100%}
body.editor-active .editor-workspace{flex:1;min-height:0;height:auto}
body.editor-active > section{display:none}
.toolbar-sep{width:1px;align-self:stretch;background:#e2e8f0;margin:0 .3rem;flex:none}
.page-card{border:1px solid #dbe3ee;border-radius:.6rem;background:#f8fafc;padding:.5rem .55rem;margin-bottom:.45rem;cursor:pointer;transition:.15s}.page-card:hover,.page-card.active{border-color:#a5b4fc;background:#eef2ff}
.page-card-top{display:flex;justify-content:space-between;align-items:center;gap:.3rem}.page-card-label{font-size:.78rem;font-weight:700;color:#334155}.page-card-badges{display:flex;gap:.2rem}
.page-badge{font-size:.62rem;font-weight:700;background:#e0e7ff;color:#4338ca;border-radius:999px;padding:.1rem .45rem;white-space:nowrap}
.page-card-actions{display:flex;gap:.25rem;margin-top:.45rem}.page-card-actions button{flex:1;min-height:26px;border:1px solid #dbe3ee;background:#fff;border-radius:.4rem;font-size:.72rem;font-weight:600;color:#334155;cursor:pointer}.page-card-actions button:hover{background:#eef2ff;border-color:#a5b4fc;color:#4338ca}.page-card-actions button:disabled{opacity:.35;cursor:not-allowed}
.insert-divider{display:flex;align-items:center;justify-content:center;width:100%;border:1px dashed #c7d2fe;background:transparent;color:#6366f1;font-size:.68rem;font-weight:700;border-radius:.5rem;padding:.22rem;margin:0 0 .45rem;opacity:0;transition:.15s;cursor:pointer}.editor-sidebar:hover .insert-divider,.insert-divider:focus-visible{opacity:1}.insert-divider:hover{background:#eef2ff}
.editor-properties label.inline{flex-direction:row;align-items:center;gap:.5rem}
.pdf-object svg{width:100%;height:100%;display:block}
.pdf-object-link{border:1.5px dashed #6366f1;background:#eef2ff66;display:flex;align-items:center;justify-content:center;overflow:hidden}.pdf-object-link .link-label{font-size:.68rem;font-weight:700;color:#4338ca;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;padding:0 .3rem}
.signature-modal{position:fixed;inset:0;background:#0f172a66;display:flex;align-items:center;justify-content:center;z-index:100;padding:1rem}.signature-dialog{background:#fff;border-radius:1rem;padding:1.25rem;width:min(680px,100%);box-shadow:0 24px 60px #0f172a33}.signature-dialog h3{font-weight:800;color:#0f172a;margin-bottom:.75rem}
.signature-canvas{width:100%;height:220px;border:2px dashed #c7d2fe;border-radius:.75rem;background:#fff;touch-action:none;cursor:crosshair}.signature-hint{font-size:.75rem;color:#64748b;margin:.4rem 0 .8rem}
.signature-actions{display:flex;gap:.5rem;align-items:center}.signature-actions .grow{flex:1}
.pdf-page.blank-page{background:#fff}@media(max-width:1100px){.editor-workspace{grid-template-columns:130px minmax(0,1fr) 220px}.tool-btn{padding-inline:.55rem}}@media(max-width:900px){.editor-workspace{grid-template-columns:1fr;height:calc(100dvh - 124px)}.editor-sidebar,.editor-properties{display:none}.editor-stage{padding:1rem}.editor-toolbar{top:64px;padding:.45rem}.toolbar-actions{border-left:0;padding-left:0}.tool-btn span{display:none}.tool-btn.primary span{display:inline}.zoom-value{display:none}}
