/* One visual contract, embedded inline in the two self-contained editors. */
:root{color-scheme:dark;background:#000;--editor-controls-width:320px;--editor-gap:32px;--editor-preview-height:600px;--editor-ease:cubic-bezier(.16,1,.3,1)}
.heatmap-main,.tool-main.editor-page{max-width:1500px;margin:0 auto;padding:48px 30px 44px;min-height:0}
.editor-page .page-heading,.editor-page .tool-heading{margin:0 0 32px}
.editor-page .page-heading h1,.editor-page .tool-heading h1{margin:0;font-size:clamp(32px,4vw,56px);line-height:1.2;font-weight:700;letter-spacing:-.04em}
.editor-page,.embedded-editor{container-type:inline-size}
.editor-shell{display:grid;grid-template-columns:var(--editor-controls-width) minmax(0,1fr);gap:var(--editor-gap);align-items:start}
.editor-controls{min-width:0;height:812px;overflow:auto;padding:20px;border:1px solid #303030;border-radius:16px;background:#0d0d0d;scrollbar-width:thin;scrollbar-color:#555 #151515}
.editor-controls h1,.editor-controls h2,.editor-controls .section-label h2{font:700 22px/1.4 "Microsoft YaHei",sans-serif;margin:0 0 20px;color:#eee}
.editor-controls label{color:#bbb;font-size:12px}
.editor-controls input:not([type=checkbox]):not([type=file]),.editor-controls textarea,.editor-controls select{max-width:100%;width:100%;padding:10px 12px;border:1px solid #444;border-radius:8px;background:#151515;color:#eee;font:14px/1.55 "Microsoft YaHei",sans-serif;caret-color:#eee}
.editor-controls input::placeholder,.editor-controls textarea::placeholder{color:#aaa;opacity:1}
.editor-controls button{min-height:44px;border:1px solid #444;border-radius:22px;padding:10px 14px;background:#1a1a1a;color:#eee;font:600 13px/1.4 "Microsoft YaHei",sans-serif;transition:background-color 180ms var(--editor-ease),color 180ms var(--editor-ease)}
.editor-controls button:hover:not(:disabled){background:#303030;color:#fff;translate:none}
.editor-controls button.primary,.editor-controls button.light{background:#eee;color:#111;border-color:#eee}
.editor-controls button.primary:hover:not(:disabled),.editor-controls button.light:hover:not(:disabled){background:#d6d6d6;color:#111}
.editor-controls button:disabled{opacity:.35;cursor:not-allowed}
.editor-stage{min-width:0;min-height:0;height:auto;display:block;background:transparent}
.editor-stage-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;height:48px;margin:0}
.editor-stage-heading h2{font:700 26px/1.35 "Microsoft YaHei",sans-serif;margin:0;color:#eee}
.editor-stage-heading .source-label{font-size:11px;line-height:1.6;color:#aaa;max-width:220px;text-align:right}
.editor-toolbar{position:relative;display:flex;align-items:flex-start;align-content:flex-start;justify-content:flex-start;flex-wrap:wrap;gap:8px;height:104px;margin:0;padding:8px 216px 0 0;background:transparent;border:0}
.editor-toolbar button:not(.editor-export){min-height:44px;border-radius:22px;padding:10px 14px;font:600 12px/1.4 "Microsoft YaHei",sans-serif;background:#171717;color:#bbb;border:1px solid #333;transition:background-color 180ms var(--editor-ease),color 180ms var(--editor-ease)}
.editor-toolbar button:not(.editor-export):hover:not(:disabled){background:#303030;color:#fff;translate:none}
.editor-toolbar .editor-export{position:absolute;right:0;top:8px;display:inline-flex;align-items:center;justify-content:center;width:200px;height:44px;min-height:44px;margin:0;padding:10px 16px;border:1px solid #eee;border-radius:24px;background:#eee;color:#111;font:700 14px/1.4 "Microsoft YaHei",sans-serif;white-space:nowrap;transition:background-color 180ms var(--editor-ease),color 180ms var(--editor-ease)}
.editor-toolbar .editor-export:hover:not(:disabled){background:#d6d6d6;color:#111;translate:none;filter:none}
.editor-toolbar .editor-export:disabled{opacity:.35;cursor:not-allowed}
.editor-toolbar .map-actions{display:contents}

.editor-toolbar .view-switch,.editor-toolbar .theme-switch{margin:0;min-width:0;flex:none;gap:4px}
.editor-toolbar .view-switch button,.editor-toolbar .theme-switch button{padding:8px 12px;border:0;background:transparent}
.editor-toolbar .view-switch button.selected,.editor-toolbar .theme-switch button.selected{color:#111;background:transparent}
.editor-preview,.editor-stage #viewport{position:relative;display:block;width:100%;height:var(--editor-preview-height);min-height:0;flex:none;margin:0;padding:0;aspect-ratio:auto;overflow:hidden;border:1px solid #333;border-radius:16px;background:#080808}
.editor-preview .map-pan>img{width:100%;height:100%;object-fit:contain}
.editor-stage .stage.editor-preview{display:flex;align-items:center;justify-content:center;padding:16px;text-align:center}
.editor-preview .poster-preview{display:block;position:relative;width:min(100%,calc((var(--editor-preview-height) - 32px) * var(--poster-ratio,.5625)));height:auto;max-width:100%;max-height:100%;aspect-ratio:var(--poster-ratio,.5625);margin:0}
.editor-preview .poster-preview canvas{display:block;width:100%!important;height:100%!important;min-height:0;max-width:100%;max-height:100%;margin:0;object-fit:contain;box-shadow:none}
.editor-stage #dimensions,.editor-stage .editor-dimensions{color:#aaa;font:12px/1.6 "Microsoft YaHei",sans-serif;margin:12px 0 0}
.editor-page .editor-frame{display:block;width:100%;height:812px;border:0;border-radius:0;background:transparent}
.editor-page>.editor-caption{justify-content:flex-end;margin:20px 0 0}
.embedded-editor{display:block;width:100%;margin:0;padding:0;min-height:0;height:auto;background:#000;color:#eee;font:14px/1.6 "Microsoft YaHei",sans-serif;overflow-x:hidden}
.embedded-editor main.editor-shell{height:auto;min-height:0}
.embedded-editor .editor-controls{border-left:1px solid #303030}
.embedded-editor .editor-controls header{display:block;height:auto;padding:0;margin:0;background:transparent;border:0}
.embedded-editor .editor-controls header .eyebrow{display:none}
.embedded-editor .editor-controls .actions{display:flex;flex-wrap:wrap;gap:8px}
.embedded-editor .editor-controls .actions button{flex:1;white-space:nowrap}
.embedded-editor .editor-controls .group{padding:16px;margin:0 0 16px;border:1px solid #333;border-radius:12px;background:#141414}
.embedded-editor .editor-controls .group h2{font-size:16px;margin:0 0 12px}
.embedded-editor .editor-controls .row{min-width:0}
.embedded-editor .editor-controls #status{color:#bbb;font-size:12px}
.embedded-editor .editor-toolbar output{padding:12px 4px;color:#bbb;font-size:12px;font-variant-numeric:tabular-nums}
.editor-page button:focus-visible,.editor-page a:focus-visible,.embedded-editor button:focus-visible,.embedded-editor input:focus-visible,.embedded-editor textarea:focus-visible,.embedded-editor select:focus-visible{outline:2px solid #aaa;outline-offset:3px}
.editor-page ::selection,.embedded-editor ::selection{background:#ddd;color:#111}
@media(max-width:1100px){.editor-stage-heading .source-label{max-width:180px;font-size:11px}.editor-stage-heading h2{font-size:23px}}
@container(max-width:850px){.editor-shell{--editor-preview-height:480px}.editor-page .page-heading,.editor-page .tool-heading{margin-bottom:28px}.editor-shell{display:flex;flex-direction:column;gap:24px}.editor-controls{order:1;width:100%;height:640px}.editor-stage{order:0;width:100%}.editor-stage-heading{height:72px;flex-wrap:wrap;gap:4px;align-content:flex-start}.editor-stage-heading h2{font-size:23px;width:100%}.editor-stage-heading .source-label{text-align:left;max-width:100%;font-size:11px}.editor-toolbar{height:164px;padding-right:0;padding-top:64px;gap:8px}.editor-toolbar .editor-export{top:8px;width:200px}.editor-toolbar .view-switch button,.editor-toolbar .theme-switch button{font-size:11px;padding:8px 10px}.editor-page .editor-frame{height:1428px}.embedded-editor .editor-controls{margin-top:0}.editor-controls .section-label h2{font-size:22px}}
@media(prefers-reduced-motion:reduce){.editor-toolbar .editor-export,.editor-toolbar button:not(.editor-export),.editor-controls button{transition:none}}

@media(max-width:850px){.heatmap-main,.tool-main.editor-page{padding:34px 18px 32px}}

.editor-controls .section-label{margin:0 0 16px}
.editor-controls .upload{margin:0 0 12px;color:#111}
.editor-controls .upload strong{color:#111}
.editor-controls .upload small{color:#444}
.editor-controls .sample-row{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 16px}
.editor-controls .sample-row button{flex:1;min-width:0;padding:10px 8px;font-size:12px}
.editor-controls #clear-input{min-width:44px;padding:8px}
.editor-results{margin:24px 0 0 calc(var(--editor-controls-width) + var(--editor-gap))}
@container(max-width:850px){.editor-results{margin-left:0}}
