/* A self-contained drawing dialog; all image pixels remain local until Save. */
.beta .banner-editor-overlay { position:fixed; inset:0; z-index:120; display:flex; align-items:center; justify-content:center; padding:24px; background:#0009; overscroll-behavior:contain; }
.beta .banner-editor { width:min(1100px,100%); max-height:calc(100dvh - 48px); min-width:0; overflow:auto; overscroll-behavior:contain; border:1px solid var(--ui-border,#e3e7ef); border-radius:20px; background:var(--ui-surface,#fff); color:var(--ui-text,#182033); box-shadow:0 24px 100px #0004; padding:22px; }
.beta .banner-editor :is(button,input) { font:inherit; }
.beta .banner-editor button { border:1px solid transparent; cursor:pointer; color:var(--ui-text,#182033); background:var(--ui-soft,#f2f4f8); border-radius:9px; min-height:40px; }
.beta .banner-editor :is(button,input):focus-visible,.beta .banner-editor canvas:focus-visible { outline:3px solid var(--ui-accent,#2449df); outline-offset:3px; }
.beta .banner-editor button:disabled { cursor:default; opacity:.42; }
.beta .banner-editor svg { width:21px; height:21px; flex-shrink:0; }
.beta .banner-editor-header { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:19px; }
.beta .banner-editor-header h2 { margin:0; font-size:21px; line-height:1.3; letter-spacing:-.5px; }
.beta .banner-editor-header p { margin:5px 0 0; font-size:12px; color:var(--ui-muted,#626f85); line-height:1.5; }
.beta .banner-editor-confirm { position:sticky; top:0; z-index:2; padding:16px; margin-bottom:16px; border:1px solid var(--ui-border,#e3e7ef); border-radius:12px; background:var(--ui-surface,#fff); box-shadow:0 4px 20px #0002; }
.beta .banner-editor-confirm[hidden] { display:none; }
.beta .banner-editor-confirm p { font-size:14px; line-height:1.5; margin:0 0 12px; }
.beta .banner-editor-confirm > div { display:flex; flex-wrap:wrap; gap:8px; }
.beta .banner-editor-confirm button { flex:1 1 180px; min-height:44px; padding:10px 12px; font-size:13px; }
.beta .banner-editor-confirm [data-banner-action="continue"] { color:var(--ui-on-accent,#fff); background:var(--ui-accent,#2449df); }
.beta .banner-editor-confirm [data-banner-action="discard"] { color:var(--ui-danger,#a12e45); }
.beta .banner-editor .banner-icon-button { display:inline-flex; align-items:center; justify-content:center; width:40px; height:40px; padding:8px; flex-shrink:0; font-size:23px; }
.beta .banner-editor-toolbar { display:flex; justify-content:space-between; flex-wrap:wrap; align-items:center; gap:12px; padding-bottom:15px; border-bottom:1px solid var(--ui-border,#e3e7ef); }
.beta .banner-editor-tools,.beta .banner-editor-history { display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
.beta .banner-editor .banner-tool { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px; min-width:61px; min-height:60px; padding:7px 10px; font-size:10px; }
.beta .banner-tool > span { max-width:100%; overflow-wrap:anywhere; }
.beta .banner-editor button[aria-pressed=true] { background:var(--ui-accent-soft,#edf1ff); color:var(--ui-accent,#2449df); border-color:var(--ui-accent,#2449df); }
.beta .banner-editor-options { display:flex; flex-wrap:wrap; gap:14px 27px; align-items:center; margin:16px 0; }
.beta .banner-editor-options fieldset { border:0; padding:0; margin:0; display:flex; flex-wrap:wrap; align-items:center; gap:5px; min-width:0; }
.beta .banner-editor-options legend { float:left; padding:0; margin-right:8px; color:var(--ui-muted,#626f85); font-size:11px; line-height:40px; }
.beta .banner-editor-widths button { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; width:37px; height:42px; padding:4px; }
.beta .banner-editor-widths button > span { display:block; width:var(--brush-size); height:var(--brush-size); max-height:22px; border-radius:50%; background:currentColor; }
.beta .banner-editor-widths small { font-size:9px; line-height:1; }
.beta .banner-editor .banner-editor-colors > button { width:29px; min-height:29px; border-radius:50%; background:var(--swatch); border:1px solid #0003; position:relative; padding:0; }
.beta .banner-editor .banner-editor-colors > button[aria-pressed=true] { outline:2px solid var(--ui-text,#182033); outline-offset:2px; margin:0 3px; }
.beta .banner-editor-custom { position:relative; display:grid; place-items:center; width:38px; height:40px; border-radius:8px; border:1px solid var(--ui-border,#e3e7ef); margin-left:5px; overflow:hidden; background:conic-gradient(#f44,#ff4,#4f4,#4ff,#44f,#f4f,#f44); }
.beta .banner-editor-custom > span { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.beta .banner-editor-custom input { opacity:0; width:100%; height:100%; cursor:pointer; padding:0; border:0; }
.beta .banner-editor-custom:focus-within { outline:3px solid var(--ui-accent,#2449df); outline-offset:3px; }
.beta .banner-editor-workspace { width:100%; min-width:0; overflow:auto; background:var(--ui-soft,#f2f4f8); border:1px solid var(--ui-border,#e3e7ef); border-radius:12px; padding:14px; overscroll-behavior:contain; }
.beta .banner-editor-canvas-wrap { width:100%; min-width:0; margin:0 auto; flex-shrink:0; }
.beta .banner-editor canvas { display:block; width:100%; height:auto; aspect-ratio:3 / 1; background:#fff; touch-action:none; box-shadow:0 2px 9px #0002; }
.beta .banner-editor-bottom { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px 15px; margin:13px 0 4px; }
.beta .banner-editor-upload { display:flex; align-items:center; gap:7px; min-height:42px; font-size:11px; position:relative; padding:7px 9px; border:1px solid var(--ui-border,#e3e7ef); border-radius:9px; overflow:hidden; cursor:pointer; }
.beta .banner-editor-upload input { position:absolute; inset:0; opacity:0; cursor:pointer; width:100%; height:100%; }
.beta .banner-editor-upload:focus-within { outline:3px solid var(--ui-accent,#2449df); outline-offset:2px; }
.beta .banner-editor-upload:has(input:disabled) { opacity:.42; cursor:default; }
.beta .banner-editor-zoom { display:flex; align-items:center; gap:5px; }
.beta .banner-editor-zoom > button { padding:7px 10px; font-size:11px; }
.beta .banner-editor-zoom output { min-width:43px; font-size:10px; text-align:center; color:var(--ui-muted,#626f85); }
.beta .banner-editor-size { font-size:10px; color:var(--ui-muted,#626f85); white-space:nowrap; }
.beta .banner-editor-error { border-radius:9px; background:var(--ui-danger-bg,#ffebef); color:var(--ui-danger,#a12e45); font-size:12px; line-height:1.5; padding:10px 12px; margin:13px 0 0; }
.beta .banner-editor-error[hidden] { display:none; }
.beta .banner-editor-status { font-size:11px; line-height:1.4; color:var(--ui-muted,#626f85); margin:6px 0; min-height:15px; }
.beta .banner-editor-footer { display:flex; align-items:center; justify-content:space-between; gap:12px; border-top:1px solid var(--ui-border,#e3e7ef); padding-top:16px; margin-top:8px; }
.beta .banner-editor-footer > p { margin:0; font-size:10px; color:var(--ui-muted,#626f85); }
.beta .banner-editor-footer > div { display:flex; gap:8px; }
.beta .banner-editor-footer button { padding:11px 16px; font-size:12px; font-weight:650; min-height:44px; }
.beta .banner-editor-footer .banner-editor-save { color:var(--ui-on-accent,#fff); background:var(--ui-accent,#2449df); }
@media (max-width:600px) {
 .beta .banner-editor-overlay { padding:8px; padding-top:max(8px,env(safe-area-inset-top)); padding-bottom:max(8px,env(safe-area-inset-bottom)); }
 .beta .banner-editor { max-height:calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); padding:15px 12px; border-radius:15px; }
 .beta .banner-editor-header { margin-bottom:14px; gap:8px; }
 .beta .banner-editor-header h2 { font-size:18px; }
 .beta .banner-editor-header p { font-size:10px; }
 .beta .banner-editor-toolbar { gap:9px; padding-bottom:10px; }
 .beta .banner-editor-tools { gap:4px; width:100%; }
 .beta .banner-editor .banner-tool { flex:1; min-width:0; min-height:56px; padding:6px 2px; font-size:8px; }
 .beta .banner-editor-tools svg { width:19px; height:19px; }
 .beta .banner-editor-history { width:100%; justify-content:flex-end; }
 .beta .banner-editor-options { gap:10px; margin:11px 0; }
 .beta .banner-editor-options fieldset { width:100%; gap:6px; }
 .beta .banner-editor-options legend { font-size:10px; margin-right:4px; }
 .beta .banner-editor-widths button { width:31px; }
 .beta .banner-editor .banner-editor-colors > button { width:27px; min-height:27px; }
 .beta .banner-editor-options .banner-editor-colors { row-gap:9px; }
 .beta .banner-editor-colors legend { width:100%; line-height:1.3; margin-bottom:0; }
 .beta .banner-editor-custom { width:32px; height:32px; margin-left:0; }
 .beta .banner-editor-workspace { padding:7px; border-radius:9px; }
 .beta .banner-editor-bottom { gap:8px; margin-top:9px; }
 .beta .banner-editor-upload { font-size:10px; }
 .beta .banner-editor-zoom { gap:3px; margin-left:auto; }
 .beta .banner-editor-zoom .banner-icon-button { width:32px; }
 .beta .banner-editor-zoom > button { padding:6px; }
 .beta .banner-editor-zoom output { min-width:36px; }
 .beta .banner-editor-size { width:100%; text-align:right; font-size:9px; }
 .beta .banner-editor-footer { padding-top:12px; margin-top:0; flex-wrap:wrap; }
 .beta .banner-editor-footer > p { width:100%; font-size:9px; }
 .beta .banner-editor-footer > div { width:100%; }
 .beta .banner-editor-footer button { flex:1; padding:10px; font-size:11px; }
 .beta .banner-editor-footer .banner-editor-save { flex:1.6; }
}

/* Static swatches work with the application CSP without inline style attributes. */
.beta [data-banner-width="2"] > span { --brush-size:2px; }
.beta [data-banner-width="4"] > span { --brush-size:4px; }
.beta [data-banner-width="8"] > span { --brush-size:8px; }
.beta [data-banner-width="12"] > span { --brush-size:12px; }
.beta [data-banner-width="20"] > span { --brush-size:20px; }
.beta [data-banner-width="32"] > span { --brush-size:22px; }
.beta [data-banner-color="#171717"] { --swatch:#171717; }
.beta [data-banner-color="#ffffff"] { --swatch:#ffffff; }
.beta [data-banner-color="#ef4444"] { --swatch:#ef4444; }
.beta [data-banner-color="#f97316"] { --swatch:#f97316; }
.beta [data-banner-color="#facc15"] { --swatch:#facc15; }
.beta [data-banner-color="#22c55e"] { --swatch:#22c55e; }
.beta [data-banner-color="#06b6d4"] { --swatch:#06b6d4; }
.beta [data-banner-color="#3b82f6"] { --swatch:#3b82f6; }
.beta [data-banner-color="#8b5cf6"] { --swatch:#8b5cf6; }
.beta [data-banner-color="#ec4899"] { --swatch:#ec4899; }
.beta [data-banner-color="#92400e"] { --swatch:#92400e; }
.beta [data-banner-color="#9ca3af"] { --swatch:#9ca3af; }
