.template-editor-layout{display:grid;grid-template-columns:minmax(360px,1fr) minmax(340px,.95fr);gap:28px;align-items:start;max-width:1360px}.template-form{border:1px solid var(--line);border-radius:18px;background:var(--surface)}.template-form-top{display:flex;justify-content:space-between;gap:14px;align-items:center;padding:22px 26px;border-bottom:1px solid var(--line);font-size:12px}.template-form>fieldset{padding:0;margin:0;border:0;min-width:0}.template-form .form-error:not(:empty){margin:20px 26px;padding:14px;border:1px solid #b46346;background:#47281e;color:#ffdbb5;border-radius:9px;line-height:1.6}.template-form-section{padding:26px;border-bottom:1px solid var(--line)}.template-section-title{display:flex;gap:14px;align-items:flex-start;margin-bottom:24px}.template-section-title>span{background:#173b39;border:1px solid #27534a;border-radius:10px;padding:8px;color:#70dcc2;font-size:11px;font-variant-numeric:tabular-nums}.template-section-title h2{font-size:17px;letter-spacing:-.3px;margin:1px 0 6px}.template-section-title p{font-size:12px;margin:0;color:var(--muted);line-height:1.6}.template-logo-upload{display:flex;gap:18px;align-items:center;margin:24px 0}.template-logo-thumb{display:grid;place-items:center;width:132px;height:96px;border:1px dashed #cbd5e1;border-radius:10px;background:#fff;padding:12px;flex-shrink:0;overflow:hidden}.template-logo-thumb img{max-width:100%;max-height:100%;object-fit:contain}.template-logo-thumb>span{font-size:10px;letter-spacing:.2em;color:#94a3b8}.template-logo-upload .field-note{font-size:10px;line-height:1.7}.template-file{position:absolute;width:1px;height:1px;opacity:0;overflow:hidden}.template-logo-upload:focus-within .template-logo-thumb{outline:2px solid var(--teal);outline-offset:3px}.template-field-label{display:block;font-size:12px;margin-bottom:12px}.template-palette{display:flex;flex-wrap:wrap;gap:8px}.template-palette label{display:flex;flex-direction:column;align-items:center;cursor:pointer;gap:5px;position:relative;padding:5px;border:1px solid transparent;border-radius:10px;min-width:52px}.template-palette label:has(input:checked){border-color:var(--teal);background:#133c35}.template-palette input{position:absolute;opacity:0;width:1px;height:1px}.template-palette label:has(input:focus-visible){outline:2px solid var(--teal);outline-offset:3px}.template-palette label>span{width:27px;height:27px;border-radius:50%;background:var(--swatch);border:1px solid #ffffff40;display:grid;place-items:center}.template-palette input:checked+span:after{content:'✓';color:#fff;font-weight:700}.template-palette small{font-size:9px;color:var(--muted)}.template-number-unit{display:flex;max-width:180px;gap:12px;align-items:center;color:var(--muted);font-size:12px}.template-number-unit input{width:110px}.template-toggle{display:flex;align-items:center;gap:15px;padding:17px 0;border-bottom:1px solid var(--line);cursor:pointer;position:relative}.template-toggle>span:first-child{flex:1}.template-toggle strong{display:block;font-size:13px;font-weight:500;margin-bottom:5px}.template-toggle small{display:block;color:var(--muted);font-size:11px;line-height:1.6}.template-toggle input{position:absolute;right:0;width:40px;height:24px;opacity:0;cursor:pointer}.template-switch{width:37px;height:22px;border-radius:15px;background:#354249;flex-shrink:0;position:relative}.template-switch:after{content:'';position:absolute;top:3px;left:3px;width:16px;height:16px;border-radius:50%;background:#8e9ca2;transition:.18s}.template-toggle input:checked+.template-switch{background:#2d9e7a}.template-toggle input:checked+.template-switch:after{left:18px;background:#fff}.template-toggle input:focus-visible+.template-switch{outline:2px solid var(--teal);outline-offset:4px}.template-fixed-note{font-size:11px;line-height:1.7;color:var(--muted);padding:15px;background:#ffffff04;border-radius:9px;margin:18px 0 0}.template-save-bar{position:sticky;bottom:16px;z-index:2;background:#13232bfa;border:1px solid #35464a;box-shadow:0 10px 30px #0005;border-radius:13px;padding:16px 20px;display:flex;align-items:center;justify-content:space-between;gap:12px;margin:12px}.template-save-bar>div:first-child{display:flex;align-items:center;gap:8px;font-size:11px;color:var(--muted);line-height:1.4}.template-save-dot{width:6px;height:6px;flex-shrink:0;border-radius:50%;background:var(--teal)}.template-save-dot.dirty{background:#f6bd60}.template-save-actions{display:flex;gap:5px;flex-wrap:wrap}.template-save-actions .btn{white-space:nowrap}.template-preview-sticky{position:sticky;top:98px}.template-preview-label{display:flex;align-items:center;justify-content:space-between;margin:4px 4px 15px}.template-preview-label>span:last-child{font-size:10px;border:1px solid var(--line);border-radius:20px;padding:5px 9px;color:var(--muted)}.template-preview-paper{--preview-accent:#176449;background:#fff;color:#173026;padding:34px;border-radius:3px;box-shadow:0 18px 60px #0003;border-top:4px solid var(--preview-accent)}.preview-brand{display:flex;align-items:center;justify-content:space-between;gap:18px;min-height:45px}.preview-brand>img{max-width:55%;max-height:52px;object-fit:contain}.preview-brand>strong{font-size:17px;line-height:1.3;letter-spacing:-.5px;overflow-wrap:anywhere}.preview-brand>span{font-size:7px;letter-spacing:1px;color:#64748b;text-align:right;line-height:1.6;flex-shrink:0}.preview-rule{height:1px;background:#e2e8f0;margin:20px 0}.preview-kicker{font-size:8px;font-weight:600;color:var(--preview-accent);text-transform:uppercase;letter-spacing:.7px;display:block;overflow-wrap:anywhere}.template-preview-paper h3{font-size:26px;letter-spacing:-.8px;line-height:1.2;margin:10px 0 7px}.preview-location{font-size:10px;color:#64748b;margin:0}.preview-message{font-size:11px;line-height:1.7;color:#475569;overflow-wrap:anywhere;margin:16px 0}.preview-project-facts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;border-block:1px solid #e2e8f0;padding:14px 0;margin:20px 0 16px}.preview-project-facts>span{font-size:8px;color:#64748b}.preview-project-facts b{display:block;font-size:11px;font-weight:600;color:#173026;margin-top:5px}.preview-scene{background:#f0f7f4;border-radius:6px;overflow:hidden;position:relative;height:170px;display:grid;place-items:center}.preview-scene img{width:85%;height:100%;object-fit:contain}.preview-scene>span{position:absolute;bottom:9px;left:12px;font-size:6px;letter-spacing:.1em;color:#456256}.preview-metrics{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:15px 0}.preview-metrics>div{padding:13px 12px;border:1px solid #e2e8f0;border-radius:6px;background:#f8faf9}.preview-metrics span{font-size:8px;display:block;color:#64748b;margin-bottom:7px}.preview-metrics b{font-size:16px;color:var(--preview-accent);letter-spacing:-.4px}.preview-metrics small{font-size:9px;font-weight:400}.preview-products{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin:20px 0}.preview-products>span{padding:11px 7px;border:1px solid #e2e8f0;border-radius:5px;color:#64748b;font-size:6px;letter-spacing:.1em}.preview-products b{display:block;font-size:9px;color:#173026;letter-spacing:0;margin-top:6px}.preview-terms{border-top:1px solid #e2e8f0;padding-top:16px;margin-top:20px}.preview-terms h4{font-size:10px;margin:0 0 8px}.preview-terms p{font-size:9px;line-height:1.7;color:#64748b;margin:0;white-space:pre-wrap;overflow-wrap:anywhere}.preview-footer{margin-top:25px;border-top:1px solid #e2e8f0;padding-top:13px;font-size:8px;color:#64748b;overflow-wrap:anywhere}.preview-footer>strong{color:var(--preview-accent)}.preview-footer p{margin:6px 0;font-size:8px}.preview-footer>span{display:block;text-align:right;font-size:6px;letter-spacing:.1em;margin-top:14px}.template-preview-caption{font-size:11px;line-height:1.7;color:var(--muted);margin:16px 4px}.template-history{border-top:1px solid var(--line);padding:16px 4px;font-size:12px}.template-history summary{cursor:pointer;display:flex;justify-content:space-between;list-style:none}.template-history summary:after{content:'⌄';margin-left:12px}.template-history summary>span{margin-left:auto;color:var(--muted)}#template-history-list>div{display:flex;justify-content:space-between;gap:16px;padding:13px 0;border-bottom:1px solid var(--line);font-size:11px}#template-history-list strong{color:var(--teal);margin-right:5px}#template-history-list time{color:var(--muted);white-space:nowrap}#template-history-list>p{color:var(--muted);line-height:1.6}.template-form fieldset:disabled{opacity:.75}
@media(min-width:1500px){.template-preview-paper{padding:42px}.preview-scene{height:210px}}
@media(max-width:1180px){.template-editor-layout{grid-template-columns:minmax(320px,1fr) minmax(280px,.85fr);gap:20px}.template-preview-paper{padding:24px}.template-form-section{padding:22px}.template-save-bar{flex-wrap:wrap}.preview-brand>span{display:none}}
@media(max-width:960px){.template-editor-layout{grid-template-columns:minmax(0,1fr)}.template-preview-column{grid-row:1}.template-preview-sticky{position:static}.template-preview-paper{max-width:580px;margin:auto}.template-preview-caption{max-width:580px;margin:14px auto}.template-history{display:none}.template-preview-label{max-width:580px;margin:0 auto 14px}.template-preview-paper .preview-scene{height:150px}.template-preview-paper .preview-products,.template-preview-paper .preview-terms{display:none}.template-preview-paper .preview-footer{margin-top:14px}.template-save-bar{bottom:10px}.template-form-top{padding:20px}.template-save-actions{width:100%;justify-content:space-between}.template-save-actions>.primary{flex:1}.template-logo-upload{gap:12px}.template-logo-thumb{width:110px}.template-form .form-grid{grid-template-columns:1fr}}
@media(prefers-reduced-motion:reduce){.template-switch:after{transition:none}}
.template-preview-toggle{display:none}@media(max-width:960px){.template-preview-toggle{display:flex;align-items:center;justify-content:space-between;width:100%;padding:17px 20px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:var(--text);font-size:13px;font-weight:600}.template-preview-toggle>span{color:var(--teal);font-size:18px}.template-preview-sticky:not(.preview-open){display:none}.template-preview-sticky.preview-open{padding-top:20px}}
