.edit-main .resize-heading h1 { word-break:keep-all; overflow-wrap:anywhere; }
.edit-workspace { grid-template-columns:minmax(0,1fr) minmax(0,1.15fr); }
.edit-main label:not(.edit-check) { display:block; font-size:13px; font-weight:600; margin:16px 0 9px; }
.edit-main input:not([type="checkbox"]):not([type="color"]),.edit-main select,.edit-main textarea { display:block; max-width:100%; width:100%; min-width:0; min-height:44px; border:1px solid #b7c8c0; border-radius:7px; padding:10px; background:#fff; color:var(--ink); font:inherit; font-size:14px; }
.edit-main input[type="file"] { font-size:12px!important; padding:5px!important; border:0!important; background:transparent!important; }
.edit-main input::file-selector-button { border:0; padding:12px; margin-right:8px; background:var(--ink); color:#fff; border-radius:6px; }
.edit-main textarea { resize:vertical; }
.edit-main input[type="color"] { width:70px; min-height:44px; padding:4px; border:1px solid #b7c8c0; border-radius:6px; background:#fff; }
.edit-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 14px; }
.edit-fields > div { min-width:0; }
.edit-main button:not(.resize-primary),.edit-element-list button { background:#fff; color:var(--ink); min-height:44px; border:1px solid #b7c8c0; border-radius:7px; padding:10px 12px; font:inherit; font-size:13px; line-height:1.6; }
.edit-actions { display:flex; gap:10px; flex-wrap:wrap; margin-top:18px; }
.edit-actions button { flex:1 1 180px; }
.edit-actions .resize-primary { flex-basis:100%; margin:0; }
.edit-main button:disabled,.edit-main input:disabled,.edit-main select:disabled { opacity:.5; cursor:default; }
.edit-main button:focus-visible,.edit-main input:focus-visible,.edit-main select:focus-visible,.edit-main textarea:focus-visible,.edit-main a:focus-visible { outline:3px solid #235e8a; outline-offset:3px; }
.edit-main [hidden] { display:none!important; }
.edit-main progress { display:block; width:100%; margin-top:12px; height:14px; }
.edit-check { display:flex; gap:10px; align-items:flex-start; font-size:13px; line-height:1.8; margin-top:16px; }
.edit-check input { flex:none; width:20px; height:20px; margin-top:2px; }
.edit-preview-controls { align-items:end; }
.edit-preview-controls button { margin-top:12px; }
.edit-preview-wrap { position:relative; width:100%; min-height:180px; margin-top:18px; overflow:hidden; border:1px solid #cdd9d2; background:#e9eeeb; text-align:center; border-radius:6px; }
.edit-preview-wrap.has-image { min-height:0; }
.edit-preview-wrap img { display:block; width:100%; height:auto; max-width:100%; background:#fff; }
.edit-preview-wrap > p { padding:50px 20px; color:var(--muted); font-size:13px; line-height:1.8; }
#edit-crop-overlay { position:absolute; border:2px dashed #166a4d; background:#4dba8614; pointer-events:none; box-shadow:0 0 0 2000px #152b3c44; }
body[data-edit-tool="crop"] .edit-preview-wrap { touch-action:none; cursor:crosshair; }
body[data-edit-tool="signature"] .edit-preview-wrap,body[data-edit-tool="edit"] .edit-preview-wrap { cursor:default; }
.edit-asset-preview { display:block; max-width:100%; max-height:120px; object-fit:contain; margin-top:12px; background:repeating-conic-gradient(#e7ede9 0 25%,#fff 0 50%) 0/16px 16px; }
/* Keep the drawing paper light even when the browser applies automatic darkening.
   This CSS background is intentionally not painted into the transparent PNG. */
#edit-signature-canvas { width:100%; height:auto; display:block; touch-action:none; color-scheme:only light; forced-color-adjust:none; background-color:#fff; color:#000; border:1px dashed #8aa698; border-radius:7px; }
#edit-signature-clear { margin-top:10px; }
.edit-element-list { list-style:none; margin:15px 0 0; padding:0; display:grid; gap:8px; }
.edit-element-list button { display:block; text-align:left; width:100%; overflow-wrap:anywhere; }
.edit-element-list button[aria-pressed="true"] { border-color:#166a4d; background:#edf6f0; box-shadow:inset 0 0 0 1px #166a4d; }
@media(min-width:1000px) { .edit-preview-panel { position:sticky; top:18px; } }
@media(max-width:800px) { .edit-workspace { grid-template-columns:minmax(0,1fr); } }
@media(max-width:480px) { .edit-fields { grid-template-columns:minmax(0,1fr); } .edit-main .resize-heading h1 { font-size:27px; } }
.edit-fine-controls { margin-top:16px; border:1px solid #cdd9d2; border-radius:7px; padding:12px; }
.edit-fine-controls summary { cursor:pointer; font-size:13px; font-weight:600; }
#edit-live-layer { position:absolute; inset:0; pointer-events:none; }
.edit-live-box { position:absolute; pointer-events:none; }
.edit-main .edit-live-element { position:absolute; inset:0; width:100%; height:100%; min-height:0!important; border:0!important; border-radius:0!important; padding:0!important; background:transparent!important; pointer-events:auto; cursor:move; touch-action:none; user-select:none; }
.edit-live-element::before { content:""; position:absolute; inset:-6px; }
.edit-main .edit-live-element[aria-pressed="true"] { outline:2px solid #166a4d; outline-offset:1px; }
.edit-live-element img { width:100%; height:100%; background:transparent; pointer-events:none; }
.edit-live-element svg { display:block; width:100%; height:100%; overflow:visible; pointer-events:none; }
.edit-main .edit-resize-handle { position:absolute; transform:translate(-50%,-50%); width:24px; height:24px; min-height:24px!important; padding:0!important; border:2px solid white!important; border-radius:5px!important; background:#166a4d!important; box-shadow:0 0 0 1px #166a4d; cursor:nwse-resize; touch-action:none; pointer-events:auto; z-index:2; }
.edit-resize-handle::after { content:"↘"; color:white; font-size:18px; position:absolute; inset:0; line-height:20px; }
#edit-continue { margin-top:12px; }
.edit-pending-changes { margin-top:18px; padding:12px; border:2px solid #946518; border-radius:7px; background:#fff8e7; color:#503800; }
.edit-pending-changes p { margin:0 0 10px; font-size:13px; line-height:1.8; overflow-wrap:anywhere; }
