.ad-editor-page{width:min(1240px,calc(100% - 40px));max-width:none;margin:0 auto;padding:28px 0 42px;color:var(--text)}
.ad-editor-topbar{display:flex;align-items:center;justify-content:flex-start;gap:16px;min-height:60px;margin:-28px 0 30px;padding:10px 0;border-bottom:1px solid rgba(255,255,255,.08)}
.ad-editor-back-icon,.ad-editor-expand{display:inline-grid;place-items:center;width:40px;height:40px;border:1px solid rgba(255,255,255,.12);border-radius:12px;color:#e8deeb;background:rgba(255,255,255,.025);font-size:24px;text-decoration:none;line-height:1}
.ad-editor-back-icon:hover,.ad-editor-expand:hover:not(.is-disabled){border-color:rgba(217,104,255,.65);color:#fff;background:rgba(174,55,225,.12)}
.ad-editor-brand{display:flex;align-items:center;gap:12px;color:#f5eef7;text-decoration:none;font-size:15px;letter-spacing:.04em}
.ad-editor-topbar-actions{display:flex;align-items:center;gap:12px;margin-left:auto}.ad-editor-help{display:inline-flex;align-items:center;min-height:40px;padding:0 15px;border:1px solid rgba(255,255,255,.14);border-radius:12px;color:#ddd4e1;text-decoration:none;font-size:13px}.ad-editor-help:hover{border-color:rgba(217,104,255,.65);color:#fff}.ad-editor-avatar{display:grid;place-items:center;width:38px;height:38px;border-radius:50%;color:#fff;font-size:12px;font-weight:800;background:linear-gradient(140deg,#9e45ff,#e83dd2)}
.ad-editor-cabinet-back{display:inline-block;margin-bottom:22px}
.ad-editor-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:28px;margin-bottom:24px}.ad-editor-heading-copy{min-width:0}.ad-editor-heading h1{max-width:920px;margin:8px 0 0;font-size:clamp(32px,4vw,48px);line-height:1.06;letter-spacing:-.055em;overflow-wrap:anywhere}.ad-editor-meta{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin-top:11px;color:var(--muted);font-size:14px}.ad-editor-status{display:inline-flex;align-items:center;min-height:25px;padding:0 10px;border:1px solid rgba(217,104,255,.32);border-radius:999px;color:#ea88ff;background:rgba(182,42,226,.14);font-size:12px;font-weight:700}.ad-editor-heading-actions{display:flex;align-items:center;justify-content:flex-end;gap:12px;flex:0 0 auto;padding-top:2px}.ad-editor-settings{display:inline-flex;align-items:center;flex:0 0 auto;min-height:44px;padding:0 16px;border:1px solid rgba(255,255,255,.14);border-radius:13px;color:#ddd5e2;text-decoration:none;font-size:13px}.ad-editor-settings:hover{border-color:rgba(217,104,255,.65);color:#fff}.ad-editor-settings[aria-disabled=true]{opacity:.55;pointer-events:none}
.ad-editor-workspace{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(300px,340px);grid-template-rows:auto auto;gap:18px 22px;align-items:start}.ad-editor-preview-card,.ad-editor-summary{min-width:0;border:1px solid rgba(255,255,255,.12);border-radius:22px;background:linear-gradient(145deg,rgba(20,16,24,.95),rgba(12,10,16,.97));box-shadow:0 20px 70px rgba(0,0,0,.26)}.ad-editor-preview-card{grid-column:1;grid-row:1;padding:0;overflow:hidden}.ad-editor-card-head{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:54px;padding:0 16px 0 20px;border-bottom:1px solid rgba(255,255,255,.08)}.ad-editor-preview-title{display:flex;align-items:center;gap:9px;font-size:14px}.ad-editor-preview-title i{width:8px;height:8px;border-radius:50%;background:#da5cff;box-shadow:0 0 14px rgba(218,92,255,.85)}.ad-editor-preview-title span{color:var(--muted);font-weight:500}.ad-editor-expand{width:36px;height:36px;padding:0;border-color:transparent;font-size:20px;cursor:pointer}.ad-editor-expand.is-disabled{opacity:.35}
.ad-editor-preview-frame{position:relative;display:grid;place-items:center;box-sizing:border-box;aspect-ratio:16/9;min-width:0;max-width:100%;margin:16px;overflow:hidden;border:1px solid rgba(255,255,255,.04);border-radius:15px;background-color:#0a080d;background-image:linear-gradient(rgba(255,255,255,.038) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.038) 1px,transparent 1px);background-size:32px 32px}.ad-editor-preview-frame:after{position:absolute;inset:0;pointer-events:none;content:"";background:radial-gradient(circle at 50% 50%,rgba(162,55,255,.13),transparent 42%)}.ad-editor-placeholder{position:relative;z-index:1;display:grid;justify-items:center;gap:12px;max-width:90%;color:var(--muted);text-align:center}.ad-editor-placeholder span{display:grid;place-items:center;width:54px;height:54px;border:1px solid #bf44e1;border-radius:18px;color:#ef7dff;background:rgba(138,36,167,.16);box-shadow:0 0 28px rgba(196,48,255,.24);font-size:27px}.ad-editor-placeholder strong{color:#f5eef7;font-size:20px}.ad-editor-placeholder small{max-width:420px;font-size:13px;line-height:1.5}.ad-editor-generating{position:relative;z-index:1;display:grid;justify-items:center;gap:12px;max-width:92%;color:#f5eef7;text-align:center}.ad-editor-generation-visual{position:relative;display:grid;place-items:center;width:190px;height:116px;isolation:isolate}.ad-editor-generation-visual:before{position:absolute;width:92px;height:92px;border-radius:50%;content:"";background:conic-gradient(from 20deg,#55e7ff,#7256ff,#f044ca,#7256ff,#55e7ff);filter:blur(13px);opacity:.58;animation:ad-editor-generation-glow 2.8s ease-in-out infinite}.ad-editor-generation-visual:after{position:absolute;inset:20px 12px;border:1px solid rgba(163,107,255,.2);border-radius:50%;content:"";transform:rotate(-22deg);animation:ad-editor-generation-orbit 4.8s linear infinite}.ad-editor-generation-ring{position:absolute;width:78px;height:78px;border:1px solid rgba(103,223,255,.8);border-top-color:#f34bcf;border-right-color:#765bff;border-radius:50%;box-shadow:inset 0 0 20px rgba(105,78,255,.18),0 0 25px rgba(150,75,255,.28);animation:ad-editor-generation-spin 3.2s linear infinite}.ad-editor-generation-ring:before,.ad-editor-generation-ring:after{position:absolute;width:7px;height:7px;border-radius:50%;content:"";box-shadow:0 0 13px currentColor}.ad-editor-generation-ring:before{top:5px;left:13px;color:#55e7ff;background:currentColor}.ad-editor-generation-ring:after{right:4px;bottom:13px;color:#f044ca;background:currentColor}.ad-editor-generation-core{position:relative;z-index:1;display:grid;place-items:center;width:47px;height:47px;border:1px solid rgba(255,255,255,.36);border-radius:15px;color:#fff;background:linear-gradient(145deg,rgba(85,231,255,.25),rgba(119,78,255,.35) 52%,rgba(240,68,202,.3));box-shadow:0 0 26px rgba(174,70,255,.48);font-size:24px;animation:ad-editor-generation-breathe 1.8s ease-in-out infinite}.ad-editor-generation-bars{position:absolute;right:8px;bottom:18px;left:8px;display:flex;align-items:end;justify-content:center;gap:6px;height:32px;opacity:.82}.ad-editor-generation-bars i{display:block;width:5px;height:12px;border-radius:999px;background:linear-gradient(#55e7ff,#765bff 55%,#f044ca);box-shadow:0 0 10px rgba(121,111,255,.55);animation:ad-editor-generation-bar 1.15s ease-in-out infinite}.ad-editor-generation-bars i:nth-child(2){height:22px;animation-delay:-.75s}.ad-editor-generation-bars i:nth-child(3){height:15px;animation-delay:-.45s}.ad-editor-generation-bars i:nth-child(4){height:27px;animation-delay:-.2s}.ad-editor-generation-bars i:nth-child(5){height:18px;animation-delay:-.9s}.ad-editor-generating strong{font-size:clamp(16px,2vw,20px)}.ad-editor-generating small{max-width:420px;color:var(--muted);font-size:13px;line-height:1.5}.ad-editor-loading-dots{display:inline-flex;gap:4px;margin-left:5px;vertical-align:.08em}.ad-editor-loading-dots i{width:5px;height:5px;border-radius:50%;background:#f044ca;box-shadow:0 0 9px rgba(240,68,202,.8);animation:ad-editor-loading-dot 1.15s ease-in-out infinite}.ad-editor-loading-dots i:nth-child(2){animation-delay:.16s}.ad-editor-loading-dots i:nth-child(3){animation-delay:.32s}.ad-editor-result{position:relative;z-index:1;display:grid;justify-items:center;width:100%;height:100%;min-height:0}.ad-editor-image-trigger{position:relative;display:grid;place-items:center;width:100%;height:100%;padding:0;border:0;background:transparent;cursor:zoom-in}.ad-editor-image-trigger .result-image{display:block;width:100%;height:100%;object-fit:contain}.ad-editor-result-status{position:absolute;z-index:2;top:12px;right:12px;display:inline-flex;align-items:center;gap:6px;min-height:27px;padding:0 10px;border:1px solid rgba(69,226,177,.38);border-radius:999px;color:#7ef0c1;background:rgba(12,42,33,.78);font-size:11px;font-weight:800}.ad-editor-result-status i{width:6px;height:6px;border-radius:50%;background:#62e8b6}.ad-editor-version-switcher{position:absolute;z-index:3;right:12px;bottom:12px;display:flex;align-items:center;gap:8px;min-height:38px;padding:4px 6px 4px 10px;border:1px solid rgba(217,104,255,.4);border-radius:13px;color:#e7dce9;background:rgba(17,10,23,.88);backdrop-filter:blur(12px)}.ad-editor-version-switcher>span{min-width:84px;text-align:center;font-size:12px}.ad-editor-version-switcher strong{color:#f2cfff}.ad-editor-version-switcher button{display:grid;place-items:center;width:28px;height:28px;padding:0;border:0;border-radius:8px;color:#f7ecfa;background:rgba(255,255,255,.08);font-size:17px;line-height:1}.ad-editor-version-switcher button:hover:not(:disabled){background:rgba(174,55,225,.45)}.ad-editor-version-switcher button:disabled{cursor:not-allowed;opacity:.32}
.ad-editor-summary{grid-column:2;grid-row:1;padding:21px 22px 20px}.ad-editor-card-kicker{margin-bottom:7px;color:#d66bfa;font-size:11px;font-weight:800;letter-spacing:.13em;text-transform:uppercase}.ad-editor-summary-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-bottom:17px;border-bottom:1px solid rgba(255,255,255,.1)}.ad-editor-summary-heading h2{margin:0;font-size:23px;letter-spacing:-.035em}.ad-editor-summary-heading span{color:#d6c9dc}.ad-editor-summary dl{margin:0}.ad-editor-summary dl>div{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.3fr);gap:16px;padding:14px 0;border-bottom:1px solid rgba(255,255,255,.08)}.ad-editor-summary dt{color:var(--muted);font-size:13px}.ad-editor-summary dd{min-width:0;margin:0;color:#f2edf5;font-size:13px;font-weight:800;line-height:1.35;text-align:right;overflow-wrap:anywhere}.ad-editor-ready{display:flex;align-items:center;gap:11px;margin-top:16px;padding:13px 14px;border-radius:15px;background:rgba(102,47,122,.17)}.ad-editor-ready>span{display:grid;flex:0 0 24px;place-items:center;width:24px;height:24px;border-radius:50%;color:#db9aff;background:rgba(187,73,255,.18);font-size:13px}.ad-editor-ready strong{display:block;font-size:13px}.ad-editor-ready small{display:block;margin-top:3px;color:var(--muted);font-size:11px;line-height:1.35}
.ad-editor-create-row{display:grid;grid-column:1;grid-row:2;grid-template-columns:220px minmax(0,1fr);gap:20px;align-items:center;min-width:0}.ad-editor-preview-card > .ad-editor-create-row{grid-column:auto;grid-row:auto;margin:18px 20px 20px}.ad-editor-cost strong{display:block;color:#db72fc;font-size:12px}.ad-editor-cost b{display:block;margin-top:6px;font-size:14px}.ad-editor-cost small{display:block;margin-top:7px;color:var(--muted-2);font-size:11px;line-height:1.35}.ad-editor-create-row form{min-width:0}.ad-editor-create-button{display:flex;align-items:center;justify-content:space-between;gap:14px;width:100%;min-width:0;min-height:58px;padding:0 20px;border:0;border-radius:17px;color:#fff;background:linear-gradient(110deg,#7256ff 0%,#c83cdd 52%,#f046c5 100%);box-shadow:0 12px 30px rgba(205,49,230,.28);font-size:17px;font-weight:800;cursor:pointer;transition:filter .2s ease,transform .2s ease}.ad-editor-create-button:hover{filter:brightness(1.08);transform:translateY(-1px)}.ad-editor-create-button span{flex:0 0 auto;font-size:24px}.ad-editor-create-button strong{min-width:0;overflow-wrap:anywhere;text-align:center}
.ad-advertising-result .ad-editor-create-row{grid-template-columns:minmax(0,1fr);gap:12px}.ad-advertising-result .ad-editor-create-row form{width:100%}.ad-advertising-result .ad-editor-preview-card > .ad-editor-create-row{margin-right:16px;margin-left:16px}
.ad-editor-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin-top:24px}.ad-editor-actions>section{min-width:0;padding:20px;border:1px solid rgba(255,255,255,.12);border-radius:20px;background:linear-gradient(145deg,rgba(28,19,33,.96),rgba(15,12,19,.98))}.ad-editor-actions h3{margin:0 0 8px;font-size:20px}.ad-editor-actions p{min-height:42px;margin:0 0 14px;color:var(--muted);line-height:1.45}.ad-editor-actions form{display:grid;gap:12px}.ad-editor-actions textarea,.ad-editor-actions select{width:100%}.ad-editor-actions .button{width:100%}.ad-editor-download{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;gap:18px}.ad-editor-download p{min-height:0;margin:0}
.ad-editor-page>.progress{display:flex;align-items:center;justify-content:center;gap:2px;min-height:38px;margin-top:16px;border:1px solid rgba(132,95,255,.28);border-radius:12px;color:#e8d8ef;background:linear-gradient(100deg,rgba(54,75,170,.18),rgba(131,51,201,.2),rgba(222,44,169,.15));font-size:12px}.ad-editor-page>.progress:after{display:inline-block;width:5px;height:5px;margin-left:1px;border-radius:50%;content:"";background:#f044ca;box-shadow:0 0 9px rgba(240,68,202,.8);animation:ad-editor-loading-dot 1.15s ease-in-out infinite;box-shadow:0 0 9px rgba(240,68,202,.8),6px 0 0 -1px #a85bff,12px 0 0 -1px #55e7ff}.ad-editor-page>.error{margin-top:16px}
@keyframes ad-editor-generation-spin{to{transform:rotate(360deg)}}@keyframes ad-editor-generation-orbit{to{transform:rotate(338deg)}}@keyframes ad-editor-generation-glow{0%,100%{transform:scale(.82);opacity:.42}50%{transform:scale(1.16);opacity:.72}}@keyframes ad-editor-generation-breathe{0%,100%{transform:scale(.92);filter:brightness(.92)}50%{transform:scale(1.08);filter:brightness(1.2)}}@keyframes ad-editor-generation-bar{0%,100%{transform:scaleY(.58);opacity:.54}50%{transform:scaleY(1.08);opacity:1}}@keyframes ad-editor-loading-dot{0%,60%,100%{transform:translateY(0);opacity:.38}30%{transform:translateY(-4px);opacity:1}}
@media(max-width:900px){.ad-editor-page{width:min(100% - 40px,720px);padding-top:25px}.ad-editor-topbar{margin:-25px 0 24px}.ad-editor-heading{align-items:start}.ad-editor-workspace{display:flex;flex-direction:column;gap:16px}.ad-editor-preview-card,.ad-editor-summary,.ad-editor-create-row,.ad-editor-actions{width:100%}.ad-editor-summary{order:2}.ad-editor-create-row{order:3}.ad-editor-actions{order:4}}
@media(max-width:520px){.ad-editor-page{width:calc(100% - 40px);padding:23px 0 34px}.ad-editor-topbar{min-height:58px;margin:-23px 0 20px;gap:9px}.ad-editor-brand{gap:8px;font-size:12px}.ad-editor-topbar-actions{gap:6px}.ad-editor-help{width:40px;height:40px;padding:0;font-size:0}.ad-editor-avatar{width:34px;height:34px}.ad-editor-cabinet-back{margin-bottom:15px}.ad-editor-heading{display:block;margin-bottom:18px}.ad-editor-heading h1{font-size:clamp(28px,8vw,38px)}.ad-editor-meta{gap:7px;margin-top:9px;font-size:12px}.ad-editor-settings{width:100%;margin-top:15px;justify-content:center}.ad-editor-card-head{min-height:49px;padding-left:14px}.ad-editor-preview-title{font-size:12px}.ad-editor-preview-frame{margin:12px;border-radius:12px}.ad-editor-placeholder{gap:9px}.ad-editor-placeholder span{width:46px;height:46px;border-radius:15px;font-size:22px}.ad-editor-placeholder strong{font-size:16px}.ad-editor-placeholder small{font-size:11px}.ad-editor-generating{gap:8px}.ad-editor-generation-visual{width:162px;height:100px;margin:-6px 0;transform:scale(.88)}.ad-editor-generating strong{font-size:16px}.ad-editor-generating small{font-size:11px}.ad-editor-page>.progress{min-height:36px;font-size:11px}.ad-editor-result-status{top:8px;right:8px}.ad-editor-version-switcher{right:8px;bottom:8px}.ad-editor-create-row{display:flex;flex-direction:column;align-items:stretch;gap:13px}.ad-editor-cost{padding:0 2px}.ad-editor-create-button{min-height:54px;border-radius:15px;font-size:15px}.ad-editor-summary{padding:16px 15px;border-radius:17px}.ad-editor-summary-heading{padding-bottom:13px}.ad-editor-summary-heading h2{font-size:19px}.ad-editor-summary dl>div{grid-template-columns:minmax(0,.75fr) minmax(0,1.25fr);gap:10px;padding:12px 0}.ad-editor-summary dt,.ad-editor-summary dd{font-size:12px}.ad-editor-actions{grid-template-columns:1fr;gap:12px}.ad-editor-actions>section{padding:16px;border-radius:17px}.ad-editor-download{display:block}.ad-editor-download .button{display:block;margin-top:14px}}
@media(max-width:520px){.ad-advertising-result .ad-editor-preview-card > .ad-editor-create-row{margin-right:12px;margin-left:12px}}
@media(max-width:900px){.ad-advertising-result .ad-editor-preview-card > .ad-editor-create-row{width:auto}}

/* Shared product-card/ad editor polish: dark matte controls stay readable on every viewport. */
.ad-editor-brand-logo{display:block;width:194px;max-width:100%;height:auto;filter:contrast(1.14) brightness(1.04)}
@media(max-width:520px){.ad-editor-brand-logo{width:156px}}
.ad-editor-actions>section{background:#0d0d10;border-color:rgba(255,255,255,.13);border-radius:14px;box-shadow:0 12px 34px rgba(0,0,0,.2)}
.ad-editor-actions textarea,.ad-editor-actions select{border:1px solid rgba(255,255,255,.16);border-radius:10px;background:#08090b;color:#f3eef5;box-shadow:inset 0 1px 0 rgba(255,255,255,.025)}
.ad-editor-actions textarea{min-height:104px;resize:vertical}
.ad-editor-actions textarea::placeholder{color:#9c969f;opacity:1}
.ad-editor-actions select{min-height:46px;padding:0 12px}
.ad-editor-custom-format{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.ad-editor-custom-format label{display:grid;gap:6px;color:#c8bccd;font-size:12px;font-weight:700}
.ad-editor-custom-format input{width:100%;min-height:44px;padding:0 12px;border:1px solid rgba(255,255,255,.12);border-radius:10px;background:#08090b;color:#f3eef5;font:inherit;font-size:13px}
.ad-editor-custom-format input:focus{border-color:rgba(218,92,255,.68);outline:2px solid rgba(218,92,255,.16);outline-offset:1px}
.ad-editor-actions textarea:focus,.ad-editor-actions select:focus{border-color:rgba(218,92,255,.68);outline:2px solid rgba(218,92,255,.16);outline-offset:1px}
.ad-product-card .ad-editor-preview-frame{aspect-ratio:3/4;max-height:70vh}
.ad-product-card .ad-editor-preview-frame .ad-editor-result{min-height:0}

@media(max-width:900px){.ad-product-card .ad-editor-preview-frame{max-height:none}}
@media(max-width:520px){.ad-editor-actions>section{border-radius:12px}.ad-editor-actions textarea{min-height:112px}.ad-product-card .ad-editor-preview-frame{aspect-ratio:3/4}.ad-editor-brand{white-space:nowrap}}

/* Advertising result preview: preserve the selected aspect ratio and keep tall results compact. */
.ad-editor-cabinet-link{font-size:15px;font-weight:700;letter-spacing:0}
.ad-editor-page.ad-advertising-result .ad-editor-preview-frame{width:min(calc(100% - 32px),calc(65vh * 16 / 9));height:auto;min-height:0;margin:16px auto;border-color:rgba(217,104,255,.22);box-shadow:0 18px 48px rgba(0,0,0,.24),0 0 34px rgba(139,55,198,.08)}
.ad-editor-page.ad-advertising-result .ad-editor-preview-frame:after{background:radial-gradient(circle at 50% 50%,rgba(162,55,255,.08),transparent 46%)}
.ad-editor-page.ad-advertising-result .ad-editor-result,.ad-editor-page.ad-advertising-result .ad-editor-image-trigger{min-height:0}
.ad-editor-page.ad-advertising-result .ad-editor-result .result-image{display:block;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;object-position:center}
.ad-editor-page.ad-advertising-result .ad-editor-preview-frame[data-preview-ratio="9:16"]{width:min(calc(100% - 32px),calc(75vh * 9 / 16))}
.ad-editor-page.ad-advertising-result .ad-editor-preview-frame[data-preview-ratio="4:5"]{width:min(calc(100% - 32px),calc(65vh * 4 / 5))}
.ad-editor-page.ad-advertising-result .ad-editor-preview-frame[data-preview-ratio="3:4"]{width:min(calc(100% - 32px),calc(65vh * 3 / 4))}
.ad-editor-page.ad-advertising-result .ad-editor-preview-frame[data-preview-ratio="1:1"]{width:min(calc(100% - 32px),65vh)}
.ad-editor-page.ad-advertising-result .ad-editor-preview-frame[data-preview-ratio="16:9"]{width:min(calc(100% - 32px),calc(65vh * 16 / 9))}
.ad-editor-page.ad-advertising-result .ad-editor-preview-frame[data-preview-ratio="3:1"]{width:min(calc(100% - 32px),calc(65vh * 3))}
.ad-editor-page.ad-advertising-result .ad-editor-status.is-ready{border-color:rgba(69,226,177,.38);color:#7ef0c1;background:rgba(12,42,33,.54)}

/* Compact, single-hero action hierarchy for a completed advertising result. */
.ad-editor-action-toolbar{display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap;margin:0 auto;padding:0 16px 16px}
.ad-editor-action-toolbar form{display:contents}
.ad-editor-action{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:0 17px;border:1px solid rgba(217,104,255,.34);border-radius:12px;color:#e9dced;background:#17121d;font-size:13px;font-weight:800;text-decoration:none;transition:border-color .2s ease,background .2s ease,filter .2s ease,transform .2s ease}
.ad-editor-action-primary{border-color:rgba(239,137,255,.66);color:#fff;background:linear-gradient(110deg,#8b39dc,#dc45d8);box-shadow:0 10px 25px rgba(205,49,230,.2)}
.ad-editor-action-accent{border-color:rgba(218,92,255,.56);color:#f5dfff;background:rgba(125,36,157,.26)}
.ad-editor-action-secondary{border-color:rgba(217,104,255,.3);background:#100d14;color:#d5c8d9}
.ad-editor-action:hover{border-color:rgba(235,126,255,.86);filter:brightness(1.07);transform:translateY(-1px)}
.ad-editor-action:disabled{cursor:not-allowed;opacity:.42;filter:saturate(.55);transform:none}
.ad-editor-mutation-controls{display:contents;margin:0;padding:0;border:0}
.ad-editor-readonly-note{grid-column:1/-1;padding:13px 15px;border:1px solid rgba(217,104,255,.24);border-radius:13px;color:#c9b9cf;background:rgba(217,104,255,.08);font-size:13px;line-height:1.45}
.ad-editor-action-primary:hover{box-shadow:0 12px 30px rgba(205,49,230,.3)}
.ad-editor-action:focus-visible,.ad-editor-actions :is(textarea,select,button):focus-visible{outline:2px solid rgba(218,92,255,.7);outline-offset:3px}
.ad-editor-action.is-loading{pointer-events:none;opacity:.7}

/* Result tools follow the same hierarchy and remain readable without excessive glow. */
.ad-editor-page.ad-advertising-result .ad-editor-actions{margin-top:18px;gap:14px}
.ad-editor-page.ad-advertising-result .ad-editor-actions>section{padding:18px 20px;border-color:rgba(255,255,255,.08);background:#0d0d10;box-shadow:0 12px 34px rgba(0,0,0,.18)}
.ad-editor-page.ad-advertising-result .ad-editor-actions h3{margin-bottom:7px}
.ad-editor-page.ad-advertising-result .ad-editor-actions p{min-height:0;margin-bottom:16px;line-height:1.5}
.ad-editor-page.ad-advertising-result .ad-editor-actions form{gap:12px}
.ad-editor-page.ad-advertising-result .ad-editor-actions textarea{min-height:180px;max-height:360px;padding:16px 17px;border:1px solid rgba(255,255,255,.1);border-radius:15px;background:#121017;color:#f3eef5;line-height:1.5;resize:none;overflow-y:hidden;transition:border-color .2s ease,box-shadow .2s ease}
.ad-editor-page.ad-advertising-result .ad-editor-actions textarea::placeholder{color:#8e8792}
.ad-editor-page.ad-advertising-result .ad-editor-actions textarea:focus{border-color:rgba(218,92,255,.68);box-shadow:0 0 0 3px rgba(218,92,255,.1),0 10px 24px rgba(0,0,0,.16);outline:0}
.ad-editor-action-cost{color:#8e8792;font-size:13px;line-height:1.4}
.ad-editor-edit-submit,.ad-editor-format-submit{min-height:48px;border-radius:13px;transition:filter .2s ease,transform .2s ease,opacity .2s ease}
.ad-editor-edit-submit{width:min(100%,320px)!important;background:linear-gradient(110deg,#8b39dc,#df43d6);box-shadow:0 8px 22px rgba(205,49,230,.16)}
.ad-editor-edit-submit:hover:not(:disabled),.ad-editor-format-submit:hover:not(:disabled){filter:brightness(1.07);transform:translateY(-1px)}
.ad-editor-edit-submit:disabled,.ad-editor-format-submit:disabled{opacity:.42;cursor:not-allowed;box-shadow:none}
.ad-editor-edit-submit.is-loading span,.ad-editor-format-submit.is-loading span{display:inline-flex;align-items:center;gap:8px}
.ad-editor-edit-submit.is-loading span:after,.ad-editor-format-submit.is-loading span:after{width:12px;height:12px;border:2px solid rgba(255,255,255,.38);border-top-color:#fff;border-radius:50%;content:"";animation:ad-editor-action-spinner .8s linear infinite}
.ad-editor-format-helper{display:block;color:#8e8792;font-size:12px;line-height:1.45}
.ad-editor-page.ad-advertising-result #ad-editor-revise,.ad-editor-page.ad-advertising-result #ad-editor-format{scroll-margin-top:20px}
.ad-editor-page.ad-advertising-result #ad-editor-format .ad-editor-format-submit{background:#17121d;border:1px solid rgba(217,104,255,.34);color:#e9dced;box-shadow:none}
.ad-editor-page.ad-advertising-result #ad-editor-format select{min-height:48px;border-radius:12px;background:#121017}
.ad-editor-page.ad-advertising-result #ad-editor-format option:disabled{color:#aaa2b2}
@keyframes ad-editor-action-spinner{to{transform:rotate(360deg)}}

@media(min-width:901px){
  .ad-editor-page.ad-advertising-result .ad-editor-workspace{grid-template-columns:minmax(0,1.65fr) minmax(330px,390px);gap:16px 20px}
  .ad-editor-page.ad-advertising-result .ad-editor-preview-card{box-shadow:0 20px 70px rgba(0,0,0,.23)}
  .ad-editor-page.ad-advertising-result .ad-editor-summary{padding:20px 22px 18px;box-shadow:0 14px 42px rgba(0,0,0,.2)}
  .ad-editor-page.ad-advertising-result .ad-editor-summary dl>div{padding:12px 0;border-bottom-color:rgba(255,255,255,.06)}
}
@media(max-width:700px){
  .ad-editor-page.ad-advertising-result{width:100%;margin:0;padding:0 0 calc(34px + env(safe-area-inset-bottom))}
  .ad-editor-page.ad-advertising-result .ad-editor-topbar{display:flex;min-height:56px;margin:0 12px 12px;padding:8px 4px}
  .ad-editor-page.ad-advertising-result .ad-editor-heading{padding:24px 16px 0}
  .ad-editor-page.ad-advertising-result .ad-editor-preview-card,.ad-editor-page.ad-advertising-result .ad-editor-summary{width:100%;border-radius:18px}
  .ad-editor-page.ad-advertising-result .ad-editor-preview-frame,.ad-editor-page.ad-advertising-result .ad-editor-preview-frame[data-preview-ratio]{width:min(calc(100% - 24px),860px);height:auto;min-height:0;margin:12px auto;border-radius:12px}
  .ad-editor-action-toolbar{align-items:stretch;display:grid;grid-template-columns:1fr;padding:0 12px 12px}
  .ad-editor-action-toolbar form{display:block}
  .ad-editor-action-toolbar .ad-editor-action{width:100%;padding:0 10px;text-align:center}
  .ad-editor-action-toolbar form .ad-editor-action{width:100%}
  .ad-editor-page.ad-advertising-result .ad-editor-actions{grid-template-columns:1fr;gap:12px;margin-top:14px}
  .ad-editor-page.ad-advertising-result .ad-editor-actions>section{padding:16px;border-radius:17px}
  .ad-editor-edit-submit{width:100%!important}
}
@media(max-width:520px){
  .ad-editor-page.ad-advertising-result .ad-editor-heading{padding:23px 12px 0}
  .ad-editor-page.ad-advertising-result .ad-editor-actions textarea{min-height:180px}
}

/* Product-card-only details kept when the product flow uses the shared editor. */
.ad-editor-reference-rail{display:flex;align-items:flex-start;gap:16px;margin:0 16px 18px;padding-top:16px;border-top:1px solid rgba(255,255,255,.08);overflow-x:auto}
.ad-editor-reference-item{display:grid;justify-items:center;gap:7px;flex:0 0 104px;color:var(--muted);font-size:11px;line-height:1.25;text-align:center}
.ad-editor-reference-thumb{display:block;width:104px;height:116px;padding:3px;border:1px solid rgba(217,104,255,.4);border-radius:13px;background:#fff;overflow:hidden;cursor:zoom-in;transition:border-color .18s ease,box-shadow .18s ease,transform .18s ease}
.ad-editor-reference-thumb:hover{border-color:rgba(238,91,235,.9);box-shadow:0 0 22px rgba(217,76,255,.22);transform:translateY(-1px)}
.ad-editor-reference-thumb img{display:block;width:100%;height:100%;object-fit:contain;border-radius:9px}
.ad-editor-summary dd{word-break:break-word}
.ad-editor-creator-brief{margin-top:16px;padding-top:15px;border-top:1px solid rgba(255,255,255,.08)}
.ad-editor-creator-brief>summary{display:flex;align-items:center;justify-content:space-between;gap:12px;color:#efe7f1;cursor:pointer;list-style:none}
.ad-editor-creator-brief>summary::-webkit-details-marker{display:none}.ad-editor-creator-brief>summary>span:first-child{display:grid;gap:4px}.ad-editor-creator-brief>summary .ad-editor-card-kicker{margin:0;font-size:10px}.ad-editor-creator-brief>summary strong{font-size:14px}.ad-editor-creator-brief>summary>span:last-child{color:#e99cff;font-size:20px;transition:transform .18s ease}.ad-editor-creator-brief[open]>summary>span:last-child{transform:rotate(180deg)}
.ad-editor-creator-brief>dl{display:grid;gap:0;margin:13px 0 0}.ad-editor-creator-brief>dl>div{display:grid;grid-template-columns:minmax(76px,.58fr) minmax(0,1.42fr);gap:10px;padding:9px 0;border-top:1px solid rgba(255,255,255,.06)}.ad-editor-creator-brief dt{color:var(--muted);font-size:11px}.ad-editor-creator-brief dd{margin:0;color:#e9dfea;font-size:11px;line-height:1.4;text-align:right}.ad-editor-creator-copy{display:grid;gap:7px;margin-top:13px;padding:12px;border:1px solid rgba(217,76,255,.22);border-radius:12px;background:rgba(217,76,255,.06)}.ad-editor-creator-copy .ad-editor-card-kicker{margin:0;font-size:9px}.ad-editor-creator-copy strong{color:#fff;font-size:13px}.ad-editor-creator-copy p{margin:0;color:#c8bccd;font-size:11px;line-height:1.45}.ad-editor-creator-copy ul{display:grid;gap:4px;margin:0;padding-left:17px;color:#c8bccd;font-size:11px}
.ad-editor-series-reference,.ad-editor-series-panel,.ad-editor-series-actions{width:min(100%,900px);margin-top:22px}
.ad-editor-series-reference{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:20px 22px;border:1px solid rgba(217,104,255,.4);border-radius:20px;background:linear-gradient(120deg,rgba(48,19,58,.72),rgba(16,11,22,.94));box-shadow:0 14px 40px rgba(0,0,0,.2)}
.ad-editor-series-reference strong{display:block;color:#f5eef7;font-size:17px}.ad-editor-series-reference p{max-width:640px;margin:7px 0 0;color:var(--muted);font-size:13px;line-height:1.5}.ad-editor-series-reference form{display:flex;align-items:center;gap:12px;flex:0 0 auto;flex-wrap:wrap}.ad-editor-series-reference input{max-width:220px;color:#eee5f0}
.ad-editor-series-complete{justify-content:flex-start}
.ad-editor-series-panel{position:relative;isolation:isolate;padding:30px 34px;border:1px solid rgba(217,76,255,.42);border-radius:24px;background:linear-gradient(145deg,rgba(29,15,40,.96),rgba(12,9,17,.98));box-shadow:0 22px 60px rgba(0,0,0,.26);overflow:hidden}
.ad-editor-series-panel::before,.ad-editor-series-panel::after{position:absolute;z-index:-1;content:"";width:30%;height:52%;border-radius:50%;filter:blur(38px);pointer-events:none}.ad-editor-series-panel::before{top:18%;left:-14%;background:rgba(173,46,255,.27)}.ad-editor-series-panel::after{right:-14%;bottom:14%;background:rgba(205,58,255,.3)}
.ad-editor-series-progress{display:flex;align-items:center;gap:15px;margin-bottom:22px}.ad-editor-series-progress>span{color:#db50ff;font-size:11px;font-weight:800;letter-spacing:.12em;white-space:nowrap}.ad-editor-series-progress>div{display:flex;gap:6px;width:min(100%,170px)}.ad-editor-series-progress i{position:relative;display:block;flex:1;height:5px;border-radius:999px;background:rgba(255,255,255,.1);overflow:hidden}.ad-editor-series-progress i.is-filled{background:linear-gradient(90deg,#a72bff,#ec4edc)}.ad-editor-series-progress i.is-current::after{position:absolute;inset:0;width:42%;content:"";border-radius:inherit;background:linear-gradient(90deg,#a72bff,#ec4edc);box-shadow:0 0 12px rgba(217,76,255,.72)}
.ad-editor-series-panel h2{margin:0 0 23px;font-size:clamp(28px,3vw,38px);letter-spacing:-.04em}.ad-editor-series-panel .status-line{margin:0;color:var(--muted);line-height:1.5}.ad-editor-series-form{display:grid;gap:14px}.ad-editor-series-field{display:grid;gap:9px;color:#eadff0;font-size:12px;font-weight:800;letter-spacing:.06em}.ad-editor-series-field input{width:100%;min-height:58px;padding:0 18px;border:1px solid rgba(217,76,255,.3);border-radius:14px;background:rgba(5,4,8,.72);color:#f7eef9;font:inherit;font-size:15px;letter-spacing:0}.ad-editor-series-field input:focus{border-color:rgba(217,76,255,.76);outline:0;box-shadow:0 0 0 3px rgba(217,76,255,.11)}
.ad-editor-series-topic-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.ad-editor-series-topic-actions .button{min-height:45px}.ad-editor-series-topic-actions .button:not(.ghost){border-color:rgba(255,196,255,.75);background:linear-gradient(135deg,#bd37ff,#e84add);color:#fff}.ad-editor-series-topic-actions>span{flex-basis:100%;color:var(--muted);font-size:12px}.ad-editor-series-saved{margin:0;padding:11px 14px;border-color:rgba(217,76,255,.42);background:rgba(217,76,255,.1);color:#f2c7fb;font-size:12px;font-weight:700}.ad-editor-series-text{gap:10px}.ad-editor-series-text>.editor-text-choices{display:grid;gap:9px;position:relative}.ad-editor-series-text .editor-text-choice{display:flex;align-items:center;justify-content:space-between;width:100%;min-height:53px;padding:14px 16px;border:1px solid rgba(255,255,255,.12);border-radius:13px;background:rgba(18,13,24,.72);color:#eee5f0;font:inherit;font-size:14px;font-weight:800;text-align:left;cursor:pointer}.ad-editor-series-text .editor-text-choice:hover{border-color:rgba(217,76,255,.62);background:rgba(33,17,43,.9)}.ad-editor-series-text .editor-text-choice-auto{justify-content:flex-start;gap:10px}.ad-editor-series-text .editor-text-choice-icon{color:#e46bff;font-size:17px}.ad-editor-series-text .editor-text-choice-auto.is-selected{border-color:rgba(255,196,255,.8);background:linear-gradient(100deg,rgba(181,44,255,.9),rgba(232,74,221,.9));color:#fff;box-shadow:0 10px 25px rgba(203,45,235,.2)}.ad-editor-series-text .editor-text-choice-auto.is-selected .editor-text-choice-icon{color:#fff}.ad-editor-series-text .editor-text-choice-chevron{color:#e99cff;font-size:20px;line-height:1;transition:transform .18s ease}.ad-editor-series-text .editor-text-choice-manual[aria-expanded=true]{border-color:rgba(217,76,255,.72);background:rgba(33,17,43,.9)}.ad-editor-series-text .editor-text-choice-manual[aria-expanded=true] .editor-text-choice-chevron{transform:rotate(180deg)}.ad-editor-series-text .editor-manual-text-menu{max-height:0;margin-top:-1px;border:1px solid rgba(217,76,255,.32);border-radius:13px;background:rgba(12,8,17,.84);overflow:hidden;opacity:0;pointer-events:none;transition:max-height .3s ease,opacity .2s ease}.ad-editor-series-text .editor-manual-text-menu.is-open{max-height:520px;opacity:1;pointer-events:auto}.ad-editor-series-text .editor-manual-text-inner{display:grid;gap:11px;padding:0 16px}.ad-editor-series-text .editor-manual-text-menu.is-open .editor-manual-text-inner{padding:14px 16px 17px}.ad-editor-series-text .editor-manual-verbatim-note{color:#d58be7;font-size:11px;font-weight:700}.ad-editor-series-text .editor-manual-text-inner label{display:grid;gap:6px;color:#eadff0;font-size:12px;font-weight:700;letter-spacing:0}.ad-editor-series-text .editor-manual-text-inner input,.ad-editor-series-text .editor-manual-text-inner textarea{width:100%;min-height:44px;padding:11px 13px;border:1px solid rgba(217,76,255,.22);border-radius:10px;background:rgba(5,4,8,.72);color:#f7eef9;font:inherit;font-size:13px}.ad-editor-series-text .editor-manual-text-inner textarea{min-height:78px;resize:vertical}.ad-editor-series-note{display:flex;align-items:center;justify-content:center;gap:8px;padding-top:7px;color:#817786;font-size:11px}.ad-editor-series-panel>.ad-editor-create-button,.ad-editor-series-form>.ad-editor-create-button{min-height:56px;margin-top:2px}
.ad-editor-series-actions{display:flex;align-items:center;justify-content:flex-end;gap:12px;flex-wrap:wrap}.ad-editor-series-actions form{margin:0}.ad-editor-series-actions .primary-action{border-color:rgba(255,196,255,.75);background:linear-gradient(135deg,#bd37ff,#e84add);color:#fff}
@media(max-width:900px){.ad-editor-series-reference,.ad-editor-series-panel,.ad-editor-series-actions{width:100%}.ad-editor-series-reference{align-items:flex-start;flex-direction:column}.ad-editor-series-reference form{width:100%}.ad-editor-series-reference input{max-width:none;flex:1}}
@media(max-width:520px){.ad-editor-reference-rail{margin-right:12px;margin-left:12px;gap:12px}.ad-editor-reference-item{flex-basis:92px}.ad-editor-reference-thumb{width:92px;height:98px}.ad-editor-series-reference{padding:17px 15px;border-radius:17px}.ad-editor-series-reference strong{font-size:15px}.ad-editor-series-reference p{font-size:12px}.ad-editor-series-reference form{display:grid;grid-template-columns:1fr;width:100%}.ad-editor-series-reference form input,.ad-editor-series-reference form .button{width:100%;max-width:none}.ad-editor-series-panel{padding:24px 18px;border-radius:18px}.ad-editor-series-progress{align-items:flex-start;flex-direction:column;gap:9px}.ad-editor-series-progress>div{width:100%}.ad-editor-series-panel h2{font-size:29px;margin-bottom:20px}.ad-editor-series-topic-actions{display:grid;grid-template-columns:1fr}.ad-editor-series-topic-actions .button{width:100%}.ad-editor-series-actions{display:grid;grid-template-columns:1fr}.ad-editor-series-actions .button,.ad-editor-series-actions form,.ad-editor-series-actions form .button{width:100%}}

/* Advertising source materials sit above the generation canvas so the preview
 * stays compact and both references remain visible at a glance. */
.ad-editor-page.ad-advertising-result .ad-editor-source-materials {
  position: relative;
  z-index: 1;
  order: 2;
  margin: 18px 20px 0;
}
.ad-editor-page.ad-advertising-result .ad-editor-source-materials-label {
  margin: 0 0 10px;
  color: #df79f6;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
}
.ad-editor-page.ad-advertising-result .ad-editor-source-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.ad-editor-page.ad-advertising-result .ad-editor-source-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 96px;
  padding: 10px;
  border: 1px solid rgba(217, 104, 255, .3);
  border-radius: 16px;
  color: #f4edf7;
  background: #211826;
  font: inherit;
  text-align: left;
  cursor: zoom-in;
  transition: border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}
.ad-editor-page.ad-advertising-result .ad-editor-source-card:hover {
  border-color: rgba(238, 126, 255, .78);
  background: #2a1b32;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  transform: translateY(-1px);
}
.ad-editor-page.ad-advertising-result .ad-editor-source-card:focus-visible {
  outline: 2px solid #f0a5ff;
  outline-offset: 3px;
}
.ad-editor-page.ad-advertising-result .ad-editor-source-thumb {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  overflow: hidden;
  border-radius: 11px;
  background: #f4eef0;
}
.ad-editor-page.ad-advertising-result .ad-editor-source-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.ad-editor-page.ad-advertising-result .ad-editor-source-copy {
  display: grid;
  min-width: 0;
  gap: 5px;
}
.ad-editor-page.ad-advertising-result .ad-editor-source-copy strong {
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.2;
}
.ad-editor-page.ad-advertising-result .ad-editor-source-copy small {
  overflow: hidden;
  color: #b9aebe;
  font-size: 12px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ad-editor-page.ad-advertising-result .ad-editor-source-chevron {
  align-self: center;
  color: #e79aff;
  font-size: 22px;
  line-height: 1;
}

/* The advertising branch no longer uses the legacy side rail; keep the
 * canvas centered below the new source-material row. */
.ad-editor-page.ad-advertising-result.ad-has-references .ad-editor-preview-card {
  display: flex !important;
  grid-template-columns: none !important;
  grid-template-rows: none !important;
}
.ad-editor-page.ad-advertising-result.ad-has-references .ad-editor-card-head,
.ad-editor-page.ad-advertising-result.ad-has-references .ad-editor-preview-frame,
.ad-editor-page.ad-advertising-result.ad-has-references .ad-editor-version-switcher,
.ad-editor-page.ad-advertising-result.ad-has-references .ad-editor-action-toolbar {
  grid-column: auto !important;
  grid-row: auto !important;
}
.ad-editor-page.ad-advertising-result .ad-editor-source-materials + .ad-editor-preview-frame {
  order: 3;
}
.ad-editor-page.ad-advertising-result .ad-editor-preview-card > .ad-editor-version-switcher,
.ad-editor-page.ad-advertising-result .ad-editor-preview-card > .ad-editor-preview-footer,
.ad-editor-page.ad-advertising-result .ad-editor-preview-card > .progress {
  order: 4;
}
.ad-editor-page.ad-advertising-result .ad-editor-preview-card > .ad-editor-action-toolbar {
  order: 5;
}

@media(max-width:700px) {
  .ad-editor-page.ad-advertising-result .ad-editor-source-materials { margin: 14px 12px 0; }
  .ad-editor-page.ad-advertising-result .ad-editor-source-grid { grid-template-columns: 1fr; gap: 9px; }
  .ad-editor-page.ad-advertising-result .ad-editor-source-card { min-height: 86px; }
  .ad-editor-page.ad-advertising-result .ad-editor-source-thumb { width: 64px; height: 64px; }
}

/* Keep the canvas grid visible while the empty creative is shown as a clean,
 * centered preview plate, matching the generation reference layout. */
.ad-editor-page.ad-advertising-result .ad-editor-preview-frame {
  background-color: #0a080d;
  background-image: linear-gradient(rgba(255,255,255,.038) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.038) 1px, transparent 1px);
  background-size: 32px 32px;
}
.ad-editor-page.ad-advertising-result .ad-editor-placeholder {
  display: grid;
  place-items: center;
  align-content: center;
  width: min(100%, 368px);
  height: min(520px, calc(100% - 32px));
  min-height: 260px;
  max-width: calc(100% - 32px);
  padding: 24px;
  box-sizing: border-box;
  border: 1px solid rgba(217,104,255,.52);
  border-radius: 16px;
  background: #120d17;
  box-shadow: 0 18px 42px rgba(0,0,0,.24), inset 0 1px rgba(255,255,255,.035);
}
.ad-editor-page.ad-advertising-result .ad-editor-placeholder small {
  max-width: 250px;
}
@media(min-width:701px) {
  .ad-editor-page.ad-advertising-result .ad-editor-preview-frame,
  .ad-editor-page.ad-advertising-result .ad-editor-preview-frame[data-preview-ratio] {
    width: calc(100% - 32px) !important;
    max-width: none !important;
    height: clamp(360px, 58vh, 560px) !important;
    aspect-ratio: auto !important;
    margin: 16px auto !important;
  }
}

/* Match the approved text-image generation state in advertising creatives. */
.ad-editor-page.ad-advertising-result .text-image-generation-note {
  position: absolute;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0;
  min-height: 38px;
  padding: 8px 14px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(69,226,177,.34);
  border-radius: 12px;
  color: #bdeed8;
  background: linear-gradient(100deg,rgba(18,91,70,.25),rgba(32,121,83,.18));
  font-size: 12px;
  line-height: 1.35;
}
.ad-editor-page.ad-advertising-result .text-image-generation-note::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  content: "";
  background: linear-gradient(105deg,transparent 0%,rgba(111,255,210,.05) 34%,rgba(255,255,255,.18) 48%,rgba(111,255,210,.05) 60%,transparent 100%);
  transform: translateX(-115%);
  animation: text-image-generation-sheen 3.8s ease-in-out infinite;
}
.ad-editor-page.ad-advertising-result .text-image-generation-note > strong,
.ad-editor-page.ad-advertising-result .text-image-generation-note > small {
  position: relative;
  z-index: 2;
}
.ad-editor-page.ad-advertising-result .text-image-generation-note > strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #7ef0c1;
  font-size: 12px;
  white-space: nowrap;
}
.ad-editor-page.ad-advertising-result .text-image-generation-note > strong::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  content: "";
  background: #62e8b6;
  box-shadow: 0 0 10px rgba(98,232,182,.8);
  animation: text-image-status-pulse 1.4s ease-in-out infinite;
}
.ad-editor-page.ad-advertising-result .text-image-generation-note > small {
  color: #c7e8d9;
  font-size: 12px;
}
.ad-editor-page.ad-advertising-result .text-image-generation-particles {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.ad-editor-page.ad-advertising-result .text-image-generation-particles i {
  position: absolute;
  left: -5%;
  top: var(--particle-top);
  width: var(--particle-size);
  height: var(--particle-size);
  border-radius: 50%;
  background: var(--particle-color);
  box-shadow: 0 0 8px var(--particle-color),0 0 16px rgba(130,255,215,.55);
  opacity: 0;
  animation: text-image-generation-particle-vortex var(--particle-duration) linear infinite;
  animation-delay: var(--particle-delay);
}
.ad-editor-page.ad-advertising-result .text-image-generation-particles i:nth-child(1){--particle-top:25%;--particle-size:3px;--particle-color:#86f9cf;--particle-duration:4.8s;--particle-delay:-1.2s}
.ad-editor-page.ad-advertising-result .text-image-generation-particles i:nth-child(2){--particle-top:68%;--particle-size:2px;--particle-color:#d5fff0;--particle-duration:3.9s;--particle-delay:-2.6s}
.ad-editor-page.ad-advertising-result .text-image-generation-particles i:nth-child(3){--particle-top:42%;--particle-size:4px;--particle-color:#69eebd;--particle-duration:5.6s;--particle-delay:-4.2s}
.ad-editor-page.ad-advertising-result .text-image-generation-particles i:nth-child(4){--particle-top:78%;--particle-size:2px;--particle-color:#f0fff9;--particle-duration:4.2s;--particle-delay:-.8s}
.ad-editor-page.ad-advertising-result .text-image-generation-particles i:nth-child(5){--particle-top:17%;--particle-size:3px;--particle-color:#b0ffe0;--particle-duration:5.1s;--particle-delay:-3.5s}
.ad-editor-page.ad-advertising-result .text-image-generation-particles i:nth-child(6){--particle-top:57%;--particle-size:2px;--particle-color:#72f4c4;--particle-duration:4.5s;--particle-delay:-1.9s}
.ad-editor-page.ad-advertising-result .text-image-generation-particles i:nth-child(7){--particle-top:34%;--particle-size:3px;--particle-color:#effff9;--particle-duration:5.3s;--particle-delay:-4.8s}
.ad-editor-page.ad-advertising-result .text-image-generation-particles i:nth-child(8){--particle-top:84%;--particle-size:2px;--particle-color:#86f9cf;--particle-duration:3.7s;--particle-delay:-2.1s}
.ad-editor-page.ad-advertising-result .text-image-generation-particles i:nth-child(9){--particle-top:51%;--particle-size:3px;--particle-color:#c9ffeb;--particle-duration:4.1s;--particle-delay:-3.1s}
.ad-editor-page.ad-advertising-result .text-image-generation-particles i:nth-child(10){--particle-top:11%;--particle-size:2px;--particle-color:#68e9b8;--particle-duration:5.4s;--particle-delay:-1.7s}
.ad-editor-page.ad-advertising-result .text-image-generation-particles i:nth-child(11){--particle-top:91%;--particle-size:3px;--particle-color:#effff9;--particle-duration:4.6s;--particle-delay:-4.1s}
.ad-editor-page.ad-advertising-result .text-image-generation-particles i:nth-child(12){--particle-top:62%;--particle-size:2px;--particle-color:#83f5c8;--particle-duration:3.8s;--particle-delay:-.4s}
.ad-editor-page.ad-advertising-result .text-image-generation-particles i:nth-child(13){--particle-top:30%;--particle-size:4px;--particle-color:#d5fff0;--particle-duration:5.8s;--particle-delay:-2.7s}
.ad-editor-page.ad-advertising-result .text-image-generation-particles i:nth-child(14){--particle-top:73%;--particle-size:2px;--particle-color:#6ee9b9;--particle-duration:4.3s;--particle-delay:-3.8s}
.ad-editor-page.ad-advertising-result .text-image-generation-particles i:nth-child(15){--particle-top:47%;--particle-size:3px;--particle-color:#f0fff9;--particle-duration:5s;--particle-delay:-1.1s}
.ad-editor-page.ad-advertising-result .text-image-generation-particles i:nth-child(16){--particle-top:6%;--particle-size:2px;--particle-color:#9dffd8;--particle-duration:4s;--particle-delay:-2.3s}
.ad-editor-page.ad-advertising-result .text-image-generation-particles i:nth-child(17){--particle-top:36%;--particle-size:2px;--particle-color:#73f1bf;--particle-duration:4.9s;--particle-delay:-4.6s}
.ad-editor-page.ad-advertising-result .text-image-generation-particles i:nth-child(18){--particle-top:81%;--particle-size:3px;--particle-color:#c2ffe8;--particle-duration:5.2s;--particle-delay:-.9s}
@keyframes text-image-status-pulse { 0%,100% { opacity:.45; transform:scale(.85); } 50% { opacity:1; transform:scale(1); } }
@keyframes text-image-generation-sheen { 0% { transform:translateX(-115%); opacity:0; } 12% { opacity:.25; } 62% { transform:translateX(115%); opacity:.95; } 78%,100% { transform:translateX(115%); opacity:0; } }
@keyframes text-image-generation-particle-vortex { 0% { left:-5%; transform:translate(-8px,8px) scale(.55) rotate(0deg); opacity:0; } 12% { opacity:.95; } 32% { left:28%; transform:translate(0,-8px) scale(1.05) rotate(80deg); opacity:.9; } 48% { left:49%; transform:translate(0,3px) scale(.8) rotate(135deg); opacity:.14; } 58% { left:57%; transform:translate(0,10px) scale(.42) rotate(170deg); opacity:.08; } 70% { left:70%; transform:translate(0,2px) scale(.9) rotate(220deg); opacity:.72; } 82% { left:84%; transform:translate(0,-6px) scale(1.2) rotate(275deg); opacity:.65; } 100% { left:105%; transform:translate(8px,7px) scale(.4) rotate(360deg); opacity:0; } }
@media(max-width:680px) {
  .ad-editor-page.ad-advertising-result .text-image-generation-note {
    right: 12px;
    bottom: 12px;
    left: 12px;
    flex-wrap: wrap;
    gap: 5px 10px;
    text-align: center;
  }
}
@media(prefers-reduced-motion:reduce) {
  .ad-editor-page.ad-advertising-result .text-image-generation-note::before,
  .ad-editor-page.ad-advertising-result .text-image-generation-particles i,
  .ad-editor-page.ad-advertising-result .text-image-generation-note > strong::before {
    animation: none;
  }
}

/* Keep generated results fully visible and make the selected format an outline-only state. */
.ad-editor-page.ad-advertising-result .ad-editor-result .result-image,
.ad-editor-page.ad-advertising-result .ad-editor-image-trigger .result-image {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
}
.ad-editor-page.ad-advertising-result .ad-editor-ratio {
  align-items: center !important;
  justify-content: center !important;
}
.ad-editor-page.ad-advertising-result .ad-editor-ratio[aria-checked="true"] {
  border-color: rgba(212,113,235,.82) !important;
  background: #100c15 !important;
  box-shadow: 0 0 0 1px rgba(212,113,235,.22) !important;
}
.ad-editor-page.ad-advertising-result .ad-editor-ratio[aria-checked="true"]:hover:not(:disabled) {
  background: #100c15 !important;
}

/* Final result actions: keep equal buttons close together and centered. */
.ad-editor-page.ad-advertising-result .ad-editor-preview-card > .ad-editor-action-toolbar {
  display: grid !important;
  grid-template-columns: repeat(2, 280px) !important;
  column-gap: 24px !important;
  row-gap: 12px !important;
  justify-content: center !important;
  width: calc(100% - 32px) !important;
  margin: 0 16px 16px !important;
  padding: 0 !important;
  box-sizing: border-box;
}
.ad-editor-page.ad-advertising-result .ad-editor-preview-card > .ad-editor-action-toolbar .ad-editor-action {
  width: 280px !important;
  max-width: 100%;
  justify-self: center;
}
@media(max-width:560px) {
  .ad-editor-page.ad-advertising-result .ad-editor-preview-card > .ad-editor-action-toolbar {
    grid-template-columns: minmax(0, 280px) !important;
    width: calc(100% - 24px) !important;
    margin: 0 12px 12px !important;
  }
}

/* Final result actions: keep the two-row layout, but size each control to
 * its label instead of stretching it across the grid column. */
.ad-editor-page.ad-advertising-result .ad-editor-preview-card > .ad-editor-action-toolbar {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
  width: calc(100% - 32px) !important;
  margin: 0 16px 16px !important;
  padding: 0 !important;
  box-sizing: border-box;
}
.ad-editor-page.ad-advertising-result .ad-editor-preview-card > .ad-editor-action-toolbar .ad-editor-action {
  width: fit-content !important;
  max-width: 100%;
  min-width: 0;
  min-height: 42px;
  justify-self: center;
  box-sizing: border-box;
  padding: 0 18px;
  white-space: nowrap;
}
@media(max-width:560px) {
  .ad-editor-page.ad-advertising-result .ad-editor-preview-card > .ad-editor-action-toolbar {
    grid-template-columns: 1fr !important;
    width: calc(100% - 24px) !important;
    margin: 0 12px 12px !important;
  }
}

/* Final result actions: match the compact two-row video layout, with a
 * stable inset from the preview-card edges even after legacy overrides. */
.ad-editor-page.ad-advertising-result .ad-editor-preview-card > .ad-editor-action-toolbar {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
  width: calc(100% - 32px) !important;
  margin: 0 16px 16px !important;
  padding: 0 !important;
  box-sizing: border-box;
}
.ad-editor-page.ad-advertising-result .ad-editor-preview-card > .ad-editor-action-toolbar .ad-editor-action {
  width: 100% !important;
  min-width: 0;
  min-height: 44px;
  box-sizing: border-box;
  padding: 0 14px;
}
@media(max-width:560px) {
  .ad-editor-page.ad-advertising-result .ad-editor-preview-card > .ad-editor-action-toolbar {
    grid-template-columns: 1fr !important;
    width: calc(100% - 24px) !important;
    margin: 0 12px 12px !important;
  }
}

/* Advertising result actions: four equal controls in two rows with clear
 * breathing room from the preview card edges. */
.ad-editor-page.ad-advertising-result .ad-editor-preview-card > .ad-editor-action-toolbar {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: calc(100% - 32px);
  margin: 0 16px 16px;
  padding: 0;
  box-sizing: border-box;
}
.ad-editor-page.ad-advertising-result .ad-editor-preview-card > .ad-editor-action-toolbar > form {
  display: contents;
}
.ad-editor-page.ad-advertising-result .ad-editor-preview-card > .ad-editor-action-toolbar .ad-editor-action {
  width: 280px !important;
  max-width: 100%;
  min-width: 0;
  min-height: 42px;
  justify-self: center;
  box-sizing: border-box;
  margin: 0;
  padding: 0 18px;
  white-space: nowrap;
}
@media(max-width:560px) {
  .ad-editor-page.ad-advertising-result .ad-editor-preview-card > .ad-editor-action-toolbar {
    grid-template-columns: 1fr;
    width: calc(100% - 24px);
    margin-right: 12px;
    margin-left: 12px;
    margin-bottom: 12px;
  }
}

/* Keep edit-panel actions compact, like the video branch, with breathing
 * room on both sides instead of stretching to the full panel width. */
.ad-editor-page.ad-advertising-result .ad-editor-result-controls .ad-editor-format-submit,
.ad-editor-page.ad-advertising-result .ad-editor-result-controls .ad-editor-edit-submit {
  min-height: 44px;
  margin: 12px auto 0 !important;
  padding: 0 16px;
  border-radius: 12px;
  box-sizing: border-box;
  font-size: 13px;
}
.ad-editor-page.ad-advertising-result .ad-editor-result-controls .ad-editor-format-submit {
  width: min(100%, 190px) !important;
}
.ad-editor-page.ad-advertising-result .ad-editor-result-controls .ad-editor-edit-submit {
  width: min(100%, 260px) !important;
}

/* Final page-edge alignment for full-bleed result layouts. */
@media(max-width:700px){
  .ad-editor-page.ad-advertising-result .ad-editor-topbar{margin-right:20px;margin-left:20px}
  .ad-editor-page.ad-advertising-result .ad-editor-heading{padding-right:20px;padding-left:20px}
}
@media(max-width:520px){.ad-editor-page.ad-advertising-result .ad-editor-heading{padding-right:20px;padding-left:20px}}

/* Product-card preview follows the approved advertising/text-image preview:
 * references above the canvas, centered ratio-aware canvas, version rail
 * below it, and a single readable generation status. Product parameters and
 * series controls remain outside this visual treatment. */
.ad-editor-page.ad-product-card .ad-editor-preview-card {
  display: flex !important;
  flex-direction: column !important;
  grid-column: 1 !important;
  grid-row: 1 !important;
  grid-template-columns: none !important;
  grid-template-rows: none !important;
  min-width: 0;
  overflow: hidden !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  border-radius: 22px !important;
  background: linear-gradient(145deg,rgba(20,16,24,.95),rgba(12,10,16,.97)) !important;
  box-shadow: 0 20px 70px rgba(0,0,0,.23) !important;
}
.ad-editor-page.ad-product-card .ad-editor-card-head {
  order: 1;
  grid-column: auto !important;
  grid-row: auto !important;
  width: 100%;
  box-sizing: border-box;
  border: 0 !important;
  border-bottom: 1px solid rgba(255,255,255,.08) !important;
  border-radius: 0 !important;
  background: transparent !important;
}
.ad-editor-page.ad-product-card .ad-editor-source-materials {
  position: relative;
  z-index: 1;
  order: 2;
  margin: 18px 20px 0;
}
.ad-editor-page.ad-product-card .ad-editor-source-materials-label {
  margin: 0 0 10px;
  color: #df79f6;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
}
.ad-editor-page.ad-product-card .ad-editor-source-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 12px;
}
.ad-editor-page.ad-product-card .ad-editor-source-card {
  display: grid;
  grid-template-columns: 74px minmax(0,1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 96px;
  padding: 10px;
  border: 1px solid rgba(217,104,255,.3);
  border-radius: 16px;
  color: #f4edf7;
  background: #211826;
  font: inherit;
  text-align: left;
  cursor: zoom-in;
  transition: border-color .18s ease,background .18s ease,transform .18s ease,box-shadow .18s ease;
}
.ad-editor-page.ad-product-card .ad-editor-source-card:hover {
  border-color: rgba(238,126,255,.78);
  background: #2a1b32;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  transform: translateY(-1px);
}
.ad-editor-page.ad-product-card .ad-editor-source-card:focus-visible {
  outline: 2px solid #f0a5ff;
  outline-offset: 3px;
}
.ad-editor-page.ad-product-card .ad-editor-source-thumb {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  overflow: hidden;
  border-radius: 11px;
  background: #f4eef0;
}
.ad-editor-page.ad-product-card .ad-editor-source-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.ad-editor-page.ad-product-card .ad-editor-source-thumb-style {
  background: #211826;
}
.ad-editor-page.ad-product-card .ad-editor-source-thumb-style img {
  object-fit: cover;
  background: #211826;
}
.ad-editor-page.ad-product-card .ad-editor-source-copy {
  display: grid;
  min-width: 0;
  gap: 5px;
}
.ad-editor-page.ad-product-card .ad-editor-source-copy strong {
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.2;
}
.ad-editor-page.ad-product-card .ad-editor-source-copy small {
  overflow: hidden;
  color: #b9aebe;
  font-size: 12px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ad-editor-page.ad-product-card .ad-editor-source-chevron {
  align-self: center;
  color: #e79aff;
  font-size: 22px;
  line-height: 1;
}
.ad-editor-page.ad-product-card .ad-editor-preview-frame {
  position: relative;
  order: 3;
  width: calc(100% - 32px);
  max-width: none !important;
  height: auto;
  min-height: 0;
  margin: 16px auto !important;
  box-sizing: border-box;
  border: 1px solid rgba(217,104,255,.22) !important;
  border-radius: 15px !important;
  background-color: #0a080d !important;
  background-image: linear-gradient(rgba(255,255,255,.038) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.038) 1px,transparent 1px) !important;
  background-size: 32px 32px !important;
  box-shadow: 0 18px 48px rgba(0,0,0,.24),0 0 34px rgba(139,55,198,.08) !important;
}
.ad-editor-page.ad-product-card .ad-editor-preview-frame:after {
  display: block !important;
  background: radial-gradient(circle at 50% 50%,rgba(162,55,255,.08),transparent 46%) !important;
}
.ad-editor-page.ad-product-card .ad-editor-result,
.ad-editor-page.ad-product-card .ad-editor-image-trigger {
  min-height: 0;
}
.ad-editor-page.ad-product-card .ad-editor-image-trigger {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden;
}
.ad-editor-page.ad-product-card .ad-editor-result .result-image,
.ad-editor-page.ad-product-card .ad-editor-image-trigger .result-image {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
}
.ad-editor-page.ad-product-card .ad-editor-placeholder {
  display: grid;
  place-items: center;
  align-content: center;
  width: min(100%,368px);
  height: min(520px,calc(100% - 32px));
  min-height: 260px;
  max-width: calc(100% - 32px);
  box-sizing: border-box;
  padding: 24px;
  border: 1px solid rgba(217,104,255,.52);
  border-radius: 16px;
  background: #120d17;
  box-shadow: 0 18px 42px rgba(0,0,0,.24),inset 0 1px rgba(255,255,255,.035);
}
.ad-editor-page.ad-product-card .ad-editor-placeholder small { max-width: 250px; }
.ad-editor-page.ad-product-card .ad-editor-preview-card > .ad-editor-version-switcher {
  position: relative !important;
  inset: auto !important;
  order: 4;
  display: grid !important;
  grid-template-columns: 34px minmax(0,1fr) 34px;
  grid-template-rows: auto auto;
  grid-template-areas: "prev items next" "meta meta meta";
  width: calc(100% - 40px);
  min-height: 0;
  margin: 4px auto 16px !important;
  padding: 0 0 5px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: none !important;
}
.ad-editor-page.ad-product-card .ad-editor-version-switcher > button:first-child { grid-area: prev; justify-self: start; align-self: center; }
.ad-editor-page.ad-product-card .ad-editor-version-switcher > button:nth-of-type(2) { grid-area: next; justify-self: end; align-self: center; }
.ad-editor-page.ad-product-card .ad-editor-version-switcher > button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(217,104,255,.38);
  border-radius: 50%;
  color: #f6e3fb;
  background: rgba(35,17,45,.9);
  font-size: 17px;
  line-height: 1;
}
.ad-editor-page.ad-product-card .ad-editor-version-switcher > button:hover:not(:disabled) { border-color: #ef89ff; background: rgba(94,29,132,.9); }
.ad-editor-page.ad-product-card .ad-editor-version-switcher > [data-carousel-items] {
  grid-area: items;
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(217,76,255,.5) transparent;
}
.ad-editor-page.ad-product-card .ad-editor-version-item {
  display: block;
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  padding: 2px;
  border: 1px solid rgba(255,255,255,.12) !important;
  border-radius: 10px;
  background: rgba(255,255,255,.035);
  opacity: .68;
  cursor: pointer;
  transition: transform .18s ease,border-color .18s ease,box-shadow .18s ease,opacity .18s ease;
}
.ad-editor-page.ad-product-card .ad-editor-version-item.is-current {
  position: relative;
  z-index: 2;
  border-color: #e35bff !important;
  box-shadow: 0 0 0 2px rgba(215,68,255,.18),0 0 18px rgba(215,68,255,.22) !important;
  opacity: 1;
  transform: scale(1.08) !important;
}
.ad-editor-page.ad-product-card .ad-editor-version-item img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 7px;
  object-fit: cover;
  pointer-events: none;
}
.ad-editor-page.ad-product-card .ad-editor-version-switcher > span {
  grid-area: meta;
  min-width: 0;
  margin-top: 8px;
  color: #9f91a5;
  font-size: 11px;
  text-align: center;
}
.ad-editor-page.ad-product-card .ad-editor-version-switcher strong { color: #f2cfff; }
.ad-editor-page.ad-product-card .ad-editor-preview-card.has-version-cards .ad-editor-preview-frame { margin-bottom: 16px !important; }

/* The shared generation note is also used by the product-card canvas. */
.ad-editor-generation-note {
  position: absolute;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 38px;
  margin: 0;
  padding: 8px 14px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(69,226,177,.34);
  border-radius: 12px;
  color: #bdeed8;
  background: linear-gradient(100deg,rgba(18,91,70,.25),rgba(32,121,83,.18));
  font-size: 12px;
  line-height: 1.35;
}
.ad-editor-generation-note::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  content: "";
  background: linear-gradient(105deg,transparent 0%,rgba(111,255,210,.05) 34%,rgba(255,255,255,.18) 48%,rgba(111,255,210,.05) 60%,transparent 100%);
  transform: translateX(-115%);
  animation: text-image-generation-sheen 3.8s ease-in-out infinite;
}
.ad-editor-generation-note > strong,
.ad-editor-generation-note > small { position: relative; z-index: 2; }
.ad-editor-generation-note > strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #7ef0c1;
  font-size: 12px;
  white-space: nowrap;
}
.ad-editor-generation-note > strong::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  content: "";
  background: #62e8b6;
  box-shadow: 0 0 10px rgba(98,232,182,.8);
  animation: text-image-status-pulse 1.4s ease-in-out infinite;
}
.ad-editor-generation-note > small { color: #c7e8d9; font-size: 12px; }
.ad-editor-generation-note .text-image-generation-particles { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.ad-editor-generation-note .text-image-generation-particles i {
  position: absolute;
  top: var(--particle-top);
  left: -5%;
  width: var(--particle-size);
  height: var(--particle-size);
  border-radius: 50%;
  background: var(--particle-color);
  box-shadow: 0 0 8px var(--particle-color),0 0 16px rgba(130,255,215,.55);
  opacity: 0;
  animation: text-image-generation-particle-vortex var(--particle-duration) linear infinite;
  animation-delay: var(--particle-delay);
}
.ad-editor-generation-note .text-image-generation-particles i:nth-child(1){--particle-top:25%;--particle-size:3px;--particle-color:#86f9cf;--particle-duration:4.8s;--particle-delay:-1.2s}
.ad-editor-generation-note .text-image-generation-particles i:nth-child(2){--particle-top:68%;--particle-size:2px;--particle-color:#d5fff0;--particle-duration:3.9s;--particle-delay:-2.6s}
.ad-editor-generation-note .text-image-generation-particles i:nth-child(3){--particle-top:42%;--particle-size:4px;--particle-color:#69eebd;--particle-duration:5.6s;--particle-delay:-4.2s}
.ad-editor-generation-note .text-image-generation-particles i:nth-child(4){--particle-top:78%;--particle-size:2px;--particle-color:#f0fff9;--particle-duration:4.2s;--particle-delay:-.8s}
.ad-editor-generation-note .text-image-generation-particles i:nth-child(5){--particle-top:17%;--particle-size:3px;--particle-color:#b0ffe0;--particle-duration:5.1s;--particle-delay:-3.5s}
.ad-editor-generation-note .text-image-generation-particles i:nth-child(6){--particle-top:57%;--particle-size:2px;--particle-color:#72f4c4;--particle-duration:4.5s;--particle-delay:-1.9s}
.ad-editor-generation-note .text-image-generation-particles i:nth-child(7){--particle-top:34%;--particle-size:3px;--particle-color:#effff9;--particle-duration:5.3s;--particle-delay:-4.8s}
.ad-editor-generation-note .text-image-generation-particles i:nth-child(8){--particle-top:84%;--particle-size:2px;--particle-color:#86f9cf;--particle-duration:3.7s;--particle-delay:-2.1s}
.ad-editor-generation-note .text-image-generation-particles i:nth-child(9){--particle-top:51%;--particle-size:3px;--particle-color:#c9ffeb;--particle-duration:4.1s;--particle-delay:-3.1s}
.ad-editor-generation-note .text-image-generation-particles i:nth-child(10){--particle-top:11%;--particle-size:2px;--particle-color:#68e9b8;--particle-duration:5.4s;--particle-delay:-1.7s}
.ad-editor-generation-note .text-image-generation-particles i:nth-child(11){--particle-top:91%;--particle-size:3px;--particle-color:#effff9;--particle-duration:4.6s;--particle-delay:-4.1s}
.ad-editor-generation-note .text-image-generation-particles i:nth-child(12){--particle-top:62%;--particle-size:2px;--particle-color:#83f5c8;--particle-duration:3.8s;--particle-delay:-.4s}
.ad-editor-generation-note .text-image-generation-particles i:nth-child(13){--particle-top:30%;--particle-size:4px;--particle-color:#d5fff0;--particle-duration:5.8s;--particle-delay:-2.7s}
.ad-editor-generation-note .text-image-generation-particles i:nth-child(14){--particle-top:73%;--particle-size:2px;--particle-color:#6ee9b9;--particle-duration:4.3s;--particle-delay:-3.8s}
.ad-editor-generation-note .text-image-generation-particles i:nth-child(15){--particle-top:47%;--particle-size:3px;--particle-color:#f0fff9;--particle-duration:5s;--particle-delay:-1.1s}
.ad-editor-generation-note .text-image-generation-particles i:nth-child(16){--particle-top:6%;--particle-size:2px;--particle-color:#9dffd8;--particle-duration:4s;--particle-delay:-2.3s}
.ad-editor-generation-note .text-image-generation-particles i:nth-child(17){--particle-top:36%;--particle-size:2px;--particle-color:#73f1bf;--particle-duration:4.9s;--particle-delay:-4.6s}
.ad-editor-generation-note .text-image-generation-particles i:nth-child(18){--particle-top:81%;--particle-size:3px;--particle-color:#c2ffe8;--particle-duration:5.2s;--particle-delay:-.9s}

@media(max-width:700px) {
  .ad-editor-page.ad-product-card .ad-editor-source-materials { margin: 14px 12px 0; }
  .ad-editor-page.ad-product-card .ad-editor-source-grid { grid-template-columns: 1fr; gap: 9px; }
  .ad-editor-page.ad-product-card .ad-editor-source-card { min-height: 86px; }
  .ad-editor-page.ad-product-card .ad-editor-source-thumb { width: 64px; height: 64px; }
  .ad-editor-page.ad-product-card .ad-editor-preview-frame {
    width: calc(100% - 24px) !important;
    margin: 12px auto !important;
    border-radius: 12px !important;
  }
  .ad-editor-page.ad-product-card .ad-editor-preview-card > .ad-editor-version-switcher { width: calc(100% - 24px); margin-top: 4px !important; }
  .ad-editor-generation-note { right: 12px; bottom: 12px; left: 12px; flex-wrap: wrap; gap: 5px 10px; text-align: center; }
}
@media(prefers-reduced-motion:reduce) {
  .ad-editor-generation-note::before,
  .ad-editor-generation-note .text-image-generation-particles i,
  .ad-editor-generation-note > strong::before { animation: none; }
}

/* Final action state and version emphasis. */
.ad-editor-page.ad-advertising-result #ad-editor-format .ad-editor-format-submit.is-active:not(:disabled) {
  border-color: transparent !important;
  color: #fff !important;
  background: linear-gradient(100deg,#942de0,#ca3ed7) !important;
  box-shadow: 0 8px 24px rgba(156,42,211,.22) !important;
  opacity: 1 !important;
}
.ad-editor-page.ad-advertising-result #ad-editor-format .ad-editor-format-submit.is-active:hover:not(:disabled) {
  filter: brightness(1.08);
}
.ad-editor-page.ad-advertising-result .ad-editor-version-item.is-current {
  position: relative;
  z-index: 2;
  transform: scale(1.08) !important;
}

/* Keep the compact credit summary readable with its two requested rows. */
.ad-editor-page.ad-advertising-result .ad-editor-panel-footer .ad-editor-billing-compact .ad-editor-billing-row {
  min-height: 20px;
  padding-left: 21px;
  font-size: 12px;
}

/* Make a changed format immediately actionable, matching the edit action. */
.ad-editor-page.ad-advertising-result #ad-editor-format .ad-editor-format-submit.is-active:not(:disabled) {
  border-color: transparent !important;
  color: #fff !important;
  background: linear-gradient(100deg,#942de0,#ca3ed7) !important;
  box-shadow: 0 8px 24px rgba(156,42,211,.22) !important;
  opacity: 1 !important;
}
.ad-editor-page.ad-advertising-result #ad-editor-format .ad-editor-format-submit.is-active:hover:not(:disabled) {
  filter: brightness(1.08);
}

.ad-editor-page.ad-advertising-result .ad-editor-placeholder {
  width: min(100%, 368px);
  height: auto;
  min-height: 0;
  max-height: calc(100% - 32px);
  align-self: center;
  justify-self: center;
}
@media(max-width:700px) {
  .ad-editor-page.ad-advertising-result .ad-editor-placeholder {
    width: min(100%, 330px);
    height: auto;
    min-height: 0;
    max-height: calc(100% - 24px);
    padding: 20px;
  }
  .ad-editor-page.ad-advertising-result .ad-editor-preview-frame,
  .ad-editor-page.ad-advertising-result .ad-editor-preview-frame[data-preview-ratio] {
    width: calc(100% - 24px) !important;
    max-width: none !important;
    height: clamp(300px, 62vh, 520px) !important;
    aspect-ratio: auto !important;
    margin: 12px auto !important;
  }
}

/* Product-card preview: references on the left, clean centered canvas, versions below. */
.ad-product-card .ad-editor-preview-card{display:grid;grid-template-columns:128px minmax(0,1fr);grid-template-rows:auto auto auto;overflow:visible;border:0;border-radius:0;background:transparent;box-shadow:none}
.ad-product-card .ad-editor-card-head{grid-column:1/-1;grid-row:1;border:1px solid rgba(255,255,255,.12);border-radius:16px;background:linear-gradient(145deg,rgba(20,16,24,.95),rgba(12,10,16,.97))}
.ad-product-card .ad-editor-reference-rail{grid-column:1;grid-row:2/4;display:flex;flex-direction:column;align-items:center;gap:14px;margin:16px 0 16px 0;padding:0;border:0;overflow:visible}
.ad-product-card .ad-editor-preview-frame{grid-column:2;grid-row:2;margin:16px 0 0;border:0;border-radius:0;background:#0a080d;background-image:none;box-shadow:none}
.ad-product-card .ad-editor-preview-frame:after{display:none}
.ad-product-card .ad-editor-preview-card>.progress{grid-column:2;grid-row:3;margin:12px 0 0}
.ad-product-card .ad-editor-preview-card.has-version-cards .ad-editor-preview-frame{margin-bottom:78px}
.ad-product-card .ad-editor-version-switcher{right:auto;bottom:-68px;left:50%;display:grid;grid-template-columns:32px minmax(0,1fr) 32px;grid-template-rows:auto auto;grid-template-areas:"prev items next" "meta meta meta";width:min(100% - 24px,390px);min-height:0;padding:7px 8px 6px;transform:translateX(-50%);border-radius:15px;background:rgba(17,10,23,.94);box-shadow:0 10px 24px rgba(0,0,0,.28)}
.ad-product-card .ad-editor-version-switcher>button:first-child{grid-area:prev}.ad-product-card .ad-editor-version-switcher>button:nth-of-type(2){grid-area:next}.ad-product-card .ad-editor-version-switcher>span{grid-area:meta;min-width:0;margin-top:4px;color:var(--muted);font-size:11px}.ad-product-card .ad-editor-version-switcher>[data-carousel-items]{grid-area:items;display:flex;align-items:center;justify-content:center;gap:7px;min-width:0;overflow-x:auto;scrollbar-width:thin;scrollbar-color:rgba(217,76,255,.5) transparent}
.ad-product-card .ad-editor-version-switcher>button{display:grid;place-items:center;width:30px;height:30px;padding:0;border:1px solid rgba(217,76,255,.38);border-radius:50%;background:rgba(35,17,45,.9);color:#f6e3fb;font-size:17px;line-height:1}.ad-product-card .ad-editor-version-switcher>button:hover:not(:disabled){border-color:#ef89ff;background:rgba(94,29,132,.9)}.ad-product-card .ad-editor-version-switcher>button:disabled{opacity:.3;cursor:not-allowed}
.ad-product-card .ad-editor-version-item{display:block;flex:0 0 47px;width:47px;height:60px;padding:2px;border:0 !important;border-radius:0;background:transparent;overflow:hidden;cursor:pointer;transition:transform .18s ease}.ad-product-card .ad-editor-version-item.is-current{border:0 !important;box-shadow:none !important;transform:none}.ad-product-card .ad-editor-version-item img{display:block;width:100%;height:100%;object-fit:cover;border-radius:0;pointer-events:none;border:0}
@media(max-width:900px){.ad-product-card .ad-editor-preview-card{grid-template-columns:1fr;grid-template-rows:auto auto auto auto}.ad-product-card .ad-editor-card-head{grid-column:1;grid-row:1}.ad-product-card .ad-editor-reference-rail{grid-column:1;grid-row:2;flex-direction:row;align-items:flex-start;margin:14px 0 0;overflow-x:auto;padding:0 2px 2px}.ad-product-card .ad-editor-preview-frame{grid-column:1;grid-row:3;margin:14px 0 0}.ad-product-card .ad-editor-preview-card>.progress{grid-column:1;grid-row:4;margin:12px 0 0}.ad-product-card .ad-editor-preview-card.has-version-cards .ad-editor-preview-frame{margin-bottom:78px}}
@media(max-width:520px){.ad-product-card .ad-editor-reference-rail{gap:12px}.ad-product-card .ad-editor-reference-item{flex:0 0 92px}.ad-product-card .ad-editor-reference-thumb{width:92px;height:98px}.ad-product-card .ad-editor-version-switcher{width:calc(100% - 8px)}}

/* The advertising result uses the same below-preview flow as text-to-image. */
.ad-editor-page .ad-editor-version-switcher,
.ad-product-card .ad-editor-version-switcher {
  position: relative;
  inset: auto;
  left: auto;
  right: auto;
  bottom: auto;
  display: flex;
  grid-template-columns: none;
  grid-template-rows: none;
  grid-template-areas: none;
  width: max-content;
  max-width: calc(100% - 24px);
  min-height: 38px;
  margin: 10px auto 0;
  padding: 4px 6px 4px 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  transform: none;
}
.ad-editor-page .ad-editor-version-switcher > [data-carousel-items] {
  order: 0;
}
@media(max-width:520px) {
  .ad-editor-page .ad-editor-version-switcher,
  .ad-product-card .ad-editor-version-switcher {
    width: max-content;
    margin-top: 8px;
    padding-left: 4px;
  }
}

/* Keep the version rail and the working-status plate in separate rows. */
.ad-editor-page .ad-editor-preview-card {
  display: flex;
  flex-direction: column;
}
.ad-editor-page .ad-editor-card-head,
.ad-editor-page .ad-editor-preview-frame,
.ad-editor-page .ad-editor-version-switcher,
.ad-editor-page .progress.ad-generation-status,
.ad-editor-page .ad-editor-action-toolbar,
.ad-editor-page .ad-editor-reference-rail {
  position: relative !important;
  inset: auto !important;
  transform: none !important;
  float: none !important;
  clear: both;
}
.ad-editor-page .ad-editor-version-switcher {
  flex: 0 0 auto;
  align-self: center;
  margin-top: 10px;
  margin-bottom: 0;
}
.ad-editor-page .progress.ad-generation-status {
  flex: 0 0 auto;
  align-self: center;
  margin-top: 12px;
  margin-bottom: 16px;
}
.ad-editor-page .ad-editor-card-head { order: 1; }
.ad-editor-page .ad-editor-preview-frame { order: 2; }
.ad-editor-page .ad-editor-version-switcher { order: 3; z-index: 3 !important; }
.ad-editor-page .progress.ad-generation-status { order: 4; z-index: 4 !important; margin-top: 12px !important; }
.ad-editor-page .ad-editor-action-toolbar { order: 5; }
.ad-editor-page .ad-editor-reference-rail { order: 6; }
@media(max-width:680px) {
  .ad-editor-page .progress.ad-generation-status { margin-top: 12px !important; }
}

/* Shared footer layout: version thumbnails always precede the working plate. */
.ad-editor-page .ad-editor-preview-footer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: 100%;
  margin: 10px 0 16px;
  padding: 0 16px;
}
.ad-editor-page .ad-editor-preview-footer .ad-editor-version-switcher {
  position: static !important;
  display: grid !important;
  grid-template-columns: 36px minmax(0, 1fr) 36px !important;
  grid-template-rows: 58px 16px !important;
  grid-template-areas: "prev items next" "meta meta meta" !important;
  column-gap: 12px;
  width: 100% !important;
  max-width: none;
  min-height: 74px;
  margin: 0 !important;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  transform: none !important;
}
.ad-editor-page .ad-editor-preview-footer .ad-editor-version-switcher > button:first-child { grid-area: prev; justify-self: start; align-self: center; }
.ad-editor-page .ad-editor-preview-footer .ad-editor-version-switcher > button:nth-of-type(2) { grid-area: next; justify-self: end; align-self: center; }
.ad-editor-page .ad-editor-preview-footer .ad-editor-version-switcher > span { grid-area: meta; align-self: start; min-width: 0; margin: 0; font-size: 11px; }
.ad-editor-page .ad-editor-preview-footer .ad-editor-version-switcher > [data-carousel-items] { grid-area: items; display: flex; align-items: center; justify-content: center; gap: 7px; min-width: 0; overflow-x: auto; }
.ad-editor-page .ad-editor-preview-footer .progress.ad-generation-status {
  position: static !important;
  order: initial;
  align-self: stretch;
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: 100%;
  margin: 0 !important;
  transform: none !important;
}
.ad-editor-page .ad-editor-preview-footer .ad-editor-version-switcher {
  display: flex !important;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  width: 100% !important;
  min-height: 0;
}
.ad-editor-page .ad-editor-version-nav-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  column-gap: 12px;
}
.ad-editor-page .ad-editor-version-nav-row > button:first-child { justify-self: start; }
.ad-editor-page .ad-editor-version-nav-row > button:last-child { justify-self: end; }
.ad-editor-page .ad-editor-version-thumbs {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  overflow-x: auto;
}
.ad-editor-page .ad-editor-version-caption {
  display: block;
  width: 100%;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 16px;
  text-align: center;
}
@media(max-width:520px) {
  .ad-editor-page .ad-editor-preview-footer { padding: 0 12px; gap: 12px; }
}

/* One return link for every project branch. The admin-only avatar and split
 * arrow/text controls are intentionally not part of the editor anymore. */
.ad-editor-cabinet-link,
.ad-editor-cabinet-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid rgba(233, 130, 255, .7);
  border-radius: 12px;
  color: #e982ff;
  background: rgba(215, 68, 255, .08);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.ad-editor-cabinet-link:hover,
.ad-editor-cabinet-back:hover {
  border-color: #f2b2ff;
  color: #ffd5ff;
  background: rgba(215, 68, 255, .16);
}
.ad-editor-cabinet-link:focus-visible,
.ad-editor-cabinet-back:focus-visible {
  outline: 2px solid #f2b2ff;
  outline-offset: 3px;
}
.ad-editor-topbar .ad-editor-topbar-actions { margin-left: 0; }
.ad-editor-cabinet-link { margin-left: auto; }
.ad-editor-page.ad-advertising-result .ad-editor-version-switcher {
  position: relative;
  right: auto;
  bottom: auto;
  left: auto;
  width: fit-content;
  margin: 0 auto 16px;
  transform: none;
}

/* Advertising creatives use the same left reference rail as product-card
 * projects when a photo or design reference is available. */
@media(min-width:901px) {
  .ad-editor-page.ad-advertising-result.ad-has-references .ad-editor-preview-card {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    grid-template-rows: auto auto auto auto;
    column-gap: 12px;
    overflow: hidden;
  }
  .ad-editor-page.ad-advertising-result.ad-has-references .ad-editor-card-head {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  .ad-editor-page.ad-advertising-result.ad-has-references .ad-editor-reference-rail {
    grid-column: 1;
    grid-row: 2 / 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin: 16px 0;
    padding: 0;
    border: 0;
    overflow: visible;
  }
  .ad-editor-page.ad-advertising-result.ad-has-references .ad-editor-preview-frame {
    grid-column: 2;
    grid-row: 2;
    width: min(100%, calc(65vh * 16 / 9));
    max-width: 100%;
    margin: 16px auto 0;
  }
  .ad-editor-page.ad-advertising-result.ad-has-references .ad-editor-version-switcher,
  .ad-editor-page.ad-advertising-result.ad-has-references .ad-editor-preview-card > .progress {
    grid-column: 2;
    grid-row: 3;
  }
  .ad-editor-page.ad-advertising-result.ad-has-references .ad-editor-version-switcher {
    margin-top: 12px;
    margin-bottom: 0;
  }
  .ad-editor-page.ad-advertising-result.ad-has-references .ad-editor-action-toolbar,
  .ad-editor-page.ad-advertising-result.ad-has-references .ad-editor-preview-card > .ad-editor-create-row {
    grid-column: 2;
    grid-row: 4;
  }
  .ad-editor-page.ad-advertising-result.ad-has-references .ad-editor-action-toolbar {
    margin: 0;
    padding: 18px 16px 16px;
  }
  .ad-editor-page.ad-advertising-result.ad-has-references .ad-editor-preview-card > .ad-editor-create-row {
    width: auto;
    margin: 18px 16px 20px;
  }
}

/* Final carousel overrides: the advertising editor keeps this rail below the
 * preview, with visible thumbnails and text-image-style arrows. */
.ad-editor-page.ad-advertising-result .ad-editor-version-switcher {
  position: relative !important;
  inset: auto !important;
  display: grid !important;
  grid-template-columns: 34px minmax(0,1fr) 34px;
  grid-template-rows: auto auto;
  grid-template-areas: "prev items next" "meta meta meta";
  width: min(calc(100% - 32px), 430px) !important;
  min-height: 0;
  margin: 0 auto 16px !important;
  padding: 0;
  gap: 0 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  transform: none !important;
}
.ad-editor-page.ad-advertising-result .ad-editor-version-switcher > button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(215,68,255,.34);
  border-radius: 10px;
  color: #f7eff8;
  background: rgba(255,255,255,.035);
  font-size: 19px;
  line-height: 1;
}
.ad-editor-page.ad-advertising-result .ad-editor-version-switcher > button:hover:not(:disabled) { border-color: rgba(215,68,255,.7); background: rgba(215,68,255,.16); }
.ad-editor-page.ad-advertising-result .ad-editor-version-switcher > button:disabled { opacity: .32; cursor: not-allowed; }
.ad-editor-page.ad-advertising-result .ad-editor-version-switcher > [data-carousel-items] {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  padding: 2px 0 5px;
  scrollbar-width: thin;
  scrollbar-color: rgba(215,68,255,.6) transparent;
}
.ad-editor-page.ad-advertising-result .ad-editor-version-item {
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  padding: 2px;
  border: 1px solid rgba(255,255,255,.12) !important;
  border-radius: 10px;
  background: rgba(255,255,255,.035);
  opacity: .68;
}
.ad-editor-page.ad-advertising-result .ad-editor-version-item:hover { opacity: .92; transform: translateY(-1px); }
.ad-editor-page.ad-advertising-result .ad-editor-version-item.is-current { border-color: #e35bff !important; box-shadow: 0 0 0 2px rgba(215,68,255,.18),0 0 18px rgba(215,68,255,.22) !important; opacity: 1; transform: none; }
.ad-editor-page.ad-advertising-result .ad-editor-version-item img { display: block; width: 100%; height: 100%; border-radius: 7px; object-fit: cover; pointer-events: none; }
.ad-editor-page.ad-advertising-result .ad-editor-version-switcher > span { grid-area: meta; min-width: 0; margin-top: 1px; color: #9f91a5; font-size: 11px; text-align: center; }

/* Keep the advertising result image tied to the full preview canvas. The
 * generic image-version wrapper is a grid elsewhere in the app and otherwise
 * constrains the trigger to the intrinsic image size. */
.ad-editor-preview-title small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.ad-editor-page.ad-advertising-result .ad-editor-result {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}
.ad-editor-page.ad-advertising-result .ad-editor-image-trigger {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}
.ad-editor-page.ad-advertising-result .ad-editor-result .result-image {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: center;
}
.ad-editor-page.ad-advertising-result .ad-editor-result .ad-editor-version-switcher {
  position: absolute !important;
  inset: auto 12px 12px auto !important;
  z-index: 3;
}

/* Shared billing plate shown immediately before every generation action. */
.ad-editor-billing {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 13px 15px;
  border: 1px solid rgba(217,104,255,.24);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(215,68,255,.08);
  font-size: 12px;
  line-height: 1.4;
}
.ad-editor-billing-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}
.ad-editor-billing-row strong { color: #f4edf6; text-align: right; }
.ad-editor-billing-primary span { color: #d9c9df; }
.ad-editor-billing-primary strong { color: #fff; font-size: 14px; }
.ad-editor-billing small { color: var(--muted-2); font-size: 11px; }
.ad-editor-action-billing { flex: 0 0 100%; width: min(100%, 560px); margin: 0 auto 2px; }
.ad-editor-action-billing .ad-editor-billing { width: 100%; box-sizing: border-box; }
@media(max-width:700px) {
  .ad-editor-action-billing { width: 100%; }
}

/* Generation controls live under the parameter summary in the right column. */
.ad-editor-side-column {
  display: grid;
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  gap: 18px;
  min-width: 0;
}
.ad-editor-side-column .ad-editor-summary {
  grid-column: auto;
  grid-row: auto;
}
.ad-editor-generation-card {
  min-width: 0;
  padding: 20px 22px;
  border: 1px solid rgba(217,104,255,.52);
  border-radius: 22px;
  background: linear-gradient(145deg,rgba(20,16,24,.95),rgba(12,10,16,.97));
  box-shadow: 0 0 0 1px rgba(217,104,255,.11),0 12px 38px rgba(141,39,166,.08),0 20px 70px rgba(0,0,0,.26);
}
.ad-editor-generation-card .ad-editor-billing {
  padding: 0;
  border: 0;
  background: transparent;
}
.ad-editor-generation-card form { margin-top: 16px; }
.ad-editor-generation-card .ad-editor-create-button { min-height: 54px; }

/* Make the edit and format panels use the same bright violet edge as the
 * preview and parameter cards. */
.ad-editor-page.ad-advertising-result .ad-editor-actions #ad-editor-revise,
.ad-editor-page.ad-advertising-result .ad-editor-actions #ad-editor-format {
  border-color: rgba(217,104,255,.68);
  box-shadow: 0 0 0 1px rgba(217,104,255,.16),0 12px 38px rgba(141,39,166,.1),0 20px 70px rgba(0,0,0,.26);
}

/* Advertising result controls live in the right column. References stay
 * visible beside the settings, while editing is kept in the same panel. */
.ad-editor-page.ad-advertising-result .ad-editor-reference-card,
.ad-editor-page.ad-advertising-result .ad-editor-result-controls {
  min-width: 0;
  padding: 20px 22px;
  border: 1px solid rgba(217,104,255,.52);
  border-radius: 22px;
  background: linear-gradient(145deg,rgba(20,16,24,.95),rgba(12,10,16,.97));
  box-shadow: 0 0 0 1px rgba(217,104,255,.11),0 12px 38px rgba(141,39,166,.08),0 20px 70px rgba(0,0,0,.26);
}
.ad-editor-page.ad-advertising-result .ad-editor-reference-list { display: grid; gap: 9px; }
.ad-editor-page.ad-advertising-result .ad-editor-reference-card-item {
  display: grid;
  grid-template-columns: 72px minmax(0,1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 72px;
  padding: 8px 10px 8px 8px;
  border: 1px solid rgba(217,104,255,.28);
  border-radius: 13px;
  color: #f2eaf4;
  background: rgba(217,104,255,.08);
  text-align: left;
  cursor: zoom-in;
  transition: border-color .2s ease,background .2s ease,transform .2s ease;
}
.ad-editor-page.ad-advertising-result .ad-editor-reference-card-item:hover { border-color: rgba(235,126,255,.76); background: rgba(217,104,255,.14); transform: translateY(-1px); }
.ad-editor-page.ad-advertising-result .ad-editor-reference-card-item:focus-visible { outline: 2px solid rgba(218,92,255,.8); outline-offset: 3px; }
.ad-editor-page.ad-advertising-result .ad-editor-reference-card-thumb { display: block; width: 72px; height: 72px; overflow: hidden; border-radius: 10px; background: #0a080d; }
.ad-editor-page.ad-advertising-result .ad-editor-reference-card-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ad-editor-page.ad-advertising-result .ad-editor-reference-card-thumb-style img { object-fit: contain; }
.ad-editor-page.ad-advertising-result .ad-editor-reference-card-copy { display: grid; min-width: 0; gap: 4px; }
.ad-editor-page.ad-advertising-result .ad-editor-reference-card-copy strong { overflow-wrap: anywhere; font-size: 13px; }
.ad-editor-page.ad-advertising-result .ad-editor-reference-card-copy small { overflow: hidden; color: #aa9aae; font-size: 11px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.ad-editor-page.ad-advertising-result .ad-editor-reference-card-chevron { color: #e99cff; font-size: 22px; line-height: 1; }
.ad-editor-page.ad-advertising-result .ad-editor-result-controls h2 { margin: 0 0 24px !important; color: #f7eef8; font-size: 22px; letter-spacing: -.035em; }
.ad-editor-page.ad-advertising-result .ad-editor-result-controls-desc { margin: 8px 0 18px; color: #aa9aae; font-size: 12px; line-height: 1.45; }
.ad-editor-page.ad-advertising-result .ad-editor-edit-running-note { margin: -10px 0 20px; color: #c5a8ca; }
.ad-editor-page.ad-advertising-result .ad-editor-result-control-label { display: block; margin-bottom: 9px; color: #dc73f2; font-size: 12px; font-weight: 800; }
.ad-editor-page.ad-advertising-result .ad-editor-result-format-select { display: block; width: 100%; min-height: 48px; box-sizing: border-box; padding: 0 42px 0 14px; border: 1px solid rgba(217,104,255,.46); border-radius: 12px; color: #f3eef5; background-color: #121017; font: 600 13px/1.35 Manrope,Inter,Arial,sans-serif; color-scheme: dark; }
.ad-editor-page.ad-advertising-result .ad-editor-result-format-select:disabled,
.ad-editor-page.ad-advertising-result .ad-editor-result-edit-form textarea:disabled { opacity: .62; cursor: wait; }
.ad-editor-page.ad-advertising-result .ad-editor-result-format-select:focus { border-color: rgba(235,126,255,.9); outline: 2px solid rgba(215,68,255,.16); outline-offset: 1px; box-shadow: 0 0 0 3px rgba(215,68,255,.1); }
.ad-editor-page.ad-advertising-result .ad-editor-result-controls .ad-editor-ratios { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 6px; }
.ad-editor-page.ad-advertising-result .ad-editor-result-controls .ad-editor-ratio { min-height: 62px; padding: 7px 3px; border-radius: 10px; }
.ad-editor-page.ad-advertising-result .ad-editor-result-controls .ad-editor-ratio-text { font-size: 11px; }
.ad-editor-page.ad-advertising-result .ad-editor-result-controls .ad-editor-ratio-current { font-size: 9px; }
.ad-editor-page.ad-advertising-result .ad-editor-result-controls .ad-editor-format-submit,
.ad-editor-page.ad-advertising-result .ad-editor-result-controls .ad-editor-edit-submit { width: 100% !important; margin-top: 12px; }
.ad-editor-page.ad-advertising-result .ad-editor-result-edit-divider { height: 1px; margin: 20px 0; background: rgba(255,255,255,.1); }
.ad-editor-page.ad-advertising-result .ad-editor-result-edit-form { display: grid; gap: 0; }
.ad-editor-page.ad-advertising-result .ad-editor-result-edit-form textarea { width: 100%; min-height: 112px; max-height: 260px; box-sizing: border-box; padding: 13px 14px; border: 1px solid rgba(217,104,255,.42); border-radius: 12px; outline: 0; color: #f3eef5; background: #0f0b14; font: 500 13px/1.5 Manrope,Inter,Arial,sans-serif; resize: vertical; transition: border-color .2s ease,box-shadow .2s ease; }
.ad-editor-page.ad-advertising-result .ad-editor-result-edit-form textarea::placeholder { color: #8e8792; }
.ad-editor-page.ad-advertising-result .ad-editor-result-edit-form textarea:focus,
.ad-editor-page.ad-advertising-result .ad-editor-result-controls.is-focused .ad-editor-result-edit-form textarea { border-color: rgba(235,126,255,.9); box-shadow: 0 0 0 3px rgba(215,68,255,.16),0 10px 24px rgba(0,0,0,.16); }
.ad-editor-page.ad-advertising-result .ad-editor-result-edit-form .ad-editor-field-tip { margin: 8px 0 0; color: #9e8ea4; font-size: 11px; line-height: 1.4; }
.ad-editor-page.ad-advertising-result .ad-editor-action-toolbar { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); width: calc(100% - 32px); padding-right: 0; padding-left: 0; }
.ad-editor-page.ad-advertising-result .ad-editor-action-toolbar .ad-editor-action { min-width: 0; padding-right: 10px; padding-left: 10px; text-align: center; }
@media(max-width:900px) {
  .ad-editor-page.ad-advertising-result .ad-editor-reference-card,
  .ad-editor-page.ad-advertising-result .ad-editor-result-controls { width: 100%; box-sizing: border-box; }
  .ad-editor-page.ad-advertising-result .ad-editor-action-toolbar { width: 100%; }
}
@media(max-width:520px) {
  .ad-editor-page.ad-advertising-result .ad-editor-reference-card,
  .ad-editor-page.ad-advertising-result .ad-editor-result-controls { padding: 16px 15px; border-radius: 17px; }
  .ad-editor-page.ad-advertising-result .ad-editor-reference-card-item { grid-template-columns: 64px minmax(0,1fr) auto; min-height: 64px; }
  .ad-editor-page.ad-advertising-result .ad-editor-reference-card-thumb { width: 64px; height: 64px; }
  .ad-editor-page.ad-advertising-result .ad-editor-result-controls .ad-editor-ratios { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .ad-editor-page.ad-advertising-result .ad-editor-action-toolbar { grid-template-columns: 1fr; }
}
@media(max-width:900px) {
  .ad-editor-side-column { display: contents; }
  .ad-editor-generation-card { order: 3; width: 100%; box-sizing: border-box; }
}

/* Advertising versions use the same carousel treatment as text-to-image:
 * visible thumbnails between the canvas and the result actions. */
.ad-editor-page .ad-editor-version-switcher {
  position: relative !important;
  inset: auto !important;
  display: grid !important;
  grid-template-columns: 34px minmax(0,1fr) 34px;
  grid-template-rows: auto auto;
  grid-template-areas: "prev items next" "meta meta meta";
  width: min(calc(100% - 32px), 430px);
  min-height: 0;
  margin: 0 auto 16px;
  padding: 0;
  gap: 0 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  transform: none !important;
}
.ad-editor-page .ad-editor-version-switcher > button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(215,68,255,.34);
  border-radius: 10px;
  color: #f7eff8;
  background: rgba(255,255,255,.035);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}
.ad-editor-page .ad-editor-version-switcher > button:hover:not(:disabled) {
  border-color: rgba(215,68,255,.7);
  background: rgba(215,68,255,.16);
}
.ad-editor-page .ad-editor-version-switcher > button:disabled { opacity: .32; cursor: not-allowed; }
.ad-editor-page .ad-editor-version-switcher > [data-carousel-items] {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  padding: 2px 0 5px;
  scrollbar-width: thin;
  scrollbar-color: rgba(215,68,255,.6) transparent;
}
.ad-editor-page .ad-editor-version-item {
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  padding: 2px;
  border: 1px solid rgba(255,255,255,.12) !important;
  border-radius: 10px;
  background: rgba(255,255,255,.035);
  cursor: pointer;
  opacity: .68;
  transition: border-color .2s ease, opacity .2s ease, transform .2s ease;
}
.ad-editor-page .ad-editor-version-item:hover { opacity: .92; transform: translateY(-1px); }
.ad-editor-page .ad-editor-version-item.is-current {
  border-color: #e35bff !important;
  box-shadow: 0 0 0 2px rgba(215,68,255,.18),0 0 18px rgba(215,68,255,.22) !important;
  opacity: 1;
  transform: none;
}
.ad-editor-page .ad-editor-version-item img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 7px;
  object-fit: cover;
  pointer-events: none;
}
.ad-editor-page .ad-editor-version-switcher > span {
  grid-area: meta;
  min-width: 0;
  margin-top: 1px;
  color: #9f91a5;
  font-size: 11px;
  text-align: center;
}

/* Generation status: a full-width plate below the versions rail. The particle
 * stream fades out before the centered copy so it never crosses the text. */
.ad-editor-page .ad-editor-preview-footer .progress.ad-generation-status {
  position: relative !important;
  isolation: isolate;
  display: flex !important;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  align-self: center;
  width: calc(100% - 60px) !important;
  min-height: 50px;
  margin: 0 auto !important;
  padding: 10px 18px;
  overflow: hidden;
  border: 1px solid rgba(92, 220, 173, .62);
  border-radius: 14px;
  color: #b8ffde;
  background: linear-gradient(100deg, rgba(45, 164, 124, .18), rgba(33, 110, 94, .24), rgba(45, 164, 124, .16));
  box-shadow: 0 0 18px rgba(92, 220, 173, .12);
}
.ad-editor-page .ad-editor-preview-footer .progress.ad-generation-status::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  content: "";
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(128, 239, 188, .08), transparent);
  animation: ad-generation-status-sheen 3.4s ease-in-out infinite;
}
.ad-editor-page .ad-editor-preview-footer .progress.ad-generation-status::after {
  display: none;
}
.ad-editor-page .ad-generation-status-copy {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
  flex-wrap: wrap;
  color: #b8ffde;
  text-align: center;
}
.ad-editor-page .ad-generation-status-copy strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #b8ffde;
  font-weight: 800;
  white-space: nowrap;
}
.ad-editor-page .ad-editor-preview-footer .progress.ad-generation-status .ad-generation-status-dot {
  display: inline-block;
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #80efbc;
  box-shadow: 0 0 8px rgba(128, 239, 188, .9);
  animation: ad-generation-status-pulse 1.45s ease-in-out infinite;
}
.ad-editor-page .ad-generation-status-copy [data-generation-copy] {
  display: inline;
  width: auto;
  color: #b8ffde;
  opacity: .88;
  line-height: 1.35;
}
.ad-editor-page .ad-generation-status-particles {
  position: absolute;
  z-index: 1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 10%, #000 54%, transparent 70%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 10%, #000 54%, transparent 70%, transparent 100%);
}
.ad-editor-page .ad-generation-status-particles i {
  position: absolute;
  left: -18px;
  top: var(--particle-top, 50%);
  display: block;
  width: var(--particle-size, 4px);
  height: var(--particle-size, 4px);
  border-radius: 50%;
  background: var(--particle-color, #80efbc);
  box-shadow: 0 0 9px var(--particle-color, #80efbc);
  opacity: 0;
  animation: ad-generation-particle-flow var(--particle-duration, 3.8s) linear infinite;
  animation-delay: var(--particle-delay, 0s);
}
.ad-editor-page .ad-generation-status-particles i:nth-child(1) { --particle-top: 30%; --particle-size: 4px; --particle-color: #80efbc; --particle-duration: 3.8s; --particle-delay: -2.7s; }
.ad-editor-page .ad-generation-status-particles i:nth-child(2) { --particle-top: 64%; --particle-size: 3px; --particle-color: #55e7ff; --particle-duration: 3.2s; --particle-delay: -1.4s; }
.ad-editor-page .ad-generation-status-particles i:nth-child(3) { --particle-top: 43%; --particle-size: 5px; --particle-color: #b8ffde; --particle-duration: 4.4s; --particle-delay: -3.3s; }
.ad-editor-page .ad-generation-status-particles i:nth-child(4) { --particle-top: 76%; --particle-size: 3px; --particle-color: #80efbc; --particle-duration: 3.6s; --particle-delay: -.8s; }
.ad-editor-page .ad-generation-status-particles i:nth-child(5) { --particle-top: 20%; --particle-size: 3px; --particle-color: #55e7ff; --particle-duration: 4.1s; --particle-delay: -2.1s; }
.ad-editor-page .ad-generation-status-particles i:nth-child(6) { --particle-top: 55%; --particle-size: 4px; --particle-color: #80efbc; --particle-duration: 3.4s; --particle-delay: -1.9s; }
.ad-editor-page .ad-generation-status-particles i:nth-child(7) { --particle-top: 84%; --particle-size: 2px; --particle-color: #b8ffde; --particle-duration: 4.7s; --particle-delay: -3.8s; }
.ad-editor-page .ad-generation-status-particles i:nth-child(8) { --particle-top: 48%; --particle-size: 3px; --particle-color: #55e7ff; --particle-duration: 3.9s; --particle-delay: -.4s; }
@keyframes ad-generation-particle-flow {
  0% { left: -18px; opacity: 0; transform: translateY(4px) scale(.65); }
  12% { opacity: .85; }
  52% { opacity: .72; transform: translateY(-3px) scale(1); }
  68% { opacity: 0; transform: translateY(2px) scale(.45); }
  100% { left: calc(100% + 18px); opacity: 0; transform: translateY(-2px) scale(.35); }
}
@keyframes ad-generation-status-pulse {
  0%, 100% { opacity: .55; transform: scale(.78); box-shadow: 0 0 5px rgba(128, 239, 188, .55); }
  50% { opacity: 1; transform: scale(1.2); box-shadow: 0 0 13px rgba(128, 239, 188, .98); }
}
@keyframes ad-generation-status-sheen {
  0%, 100% { opacity: .18; transform: translateX(-70%); }
  50% { opacity: .75; transform: translateX(70%); }
}
@media(max-width:520px) {
  .ad-editor-page .ad-editor-preview-footer .progress.ad-generation-status {
    width: calc(100% - 60px) !important;
    min-height: 58px;
    padding: 10px 12px;
  }
}
@media(prefers-reduced-motion:reduce) {
  .ad-editor-page .ad-generation-status-particles i,
  .ad-editor-page .ad-generation-status-dot,
  .ad-editor-page .ad-generation-status::before { animation: none; }
  .ad-editor-page .ad-generation-status-particles { opacity: .35; }
}

/* While a job is running, keep the status plate inside the preview canvas at
 * its bottom edge instead of taking space below the version rail. */
.ad-editor-page .ad-editor-preview-frame > .progress.ad-generation-status {
  position: absolute !important;
  z-index: 3;
  right: 30px !important;
  bottom: 30px !important;
  left: 30px !important;
  width: auto !important;
  min-height: 50px;
  margin: 0 !important;
}
.ad-editor-page .ad-editor-preview-frame > .progress.ad-generation-status::before {
  z-index: 0;
}
.ad-editor-page .ad-editor-preview-frame > .progress.ad-generation-status::after {
  display: none;
}
.ad-editor-page .ad-editor-preview-frame > .progress.ad-generation-status .ad-generation-status-dot {
  display: inline-block;
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  animation: ad-generation-status-pulse 1.45s ease-in-out infinite;
}
.ad-editor-page .ad-editor-cost .ad-editor-cost-note {
  margin-top: 4px;
  color: var(--muted-2);
}
@media(max-width:520px) {
  .ad-editor-page .ad-editor-preview-frame > .progress.ad-generation-status {
    right: 30px !important;
    bottom: 30px !important;
    left: 30px !important;
    min-height: 58px;
  }
}

@media(max-width:900px) {
  .ad-editor-page.ad-advertising-result.ad-has-references .ad-editor-reference-rail {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    margin: 14px 12px 0;
    padding: 0 2px 2px;
    border-top: 0;
    overflow-x: auto;
  }
}

@media(max-width:520px) {
.ad-editor-page.ad-advertising-result.ad-has-references .ad-editor-reference-rail {
    gap: 12px;
  }
}

/* Version carousel: compact thumbnails below the canvas, with arrows close to them. */
.ad-editor-page .ad-editor-version-switcher {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 28px;
  grid-template-rows: auto auto;
  grid-template-areas: "prev items next" "meta meta meta";
  width: min(calc(100% - 24px), 390px);
  min-height: 0;
  padding: 6px 7px 5px;
  gap: 0 7px;
  margin: 10px auto 14px;
}
.ad-editor-page .ad-editor-version-switcher > button:first-child { grid-area: prev; }
.ad-editor-page .ad-editor-version-switcher > button:nth-of-type(2) { grid-area: next; }
.ad-editor-page .ad-editor-version-switcher > span {
  grid-area: meta;
  min-width: 0;
  margin-top: 4px;
  font-size: 11px;
}
.ad-editor-page .ad-editor-version-switcher > [data-carousel-items] {
  grid-area: items;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(217,76,255,.5) transparent;
}
.ad-editor-page .ad-editor-version-item {
  display: block;
  flex: 0 0 44px;
  width: 44px;
  height: 56px;
  padding: 2px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: rgba(29,17,36,.9);
  overflow: hidden;
  cursor: pointer;
  transition: transform .18s ease;
}
.ad-editor-page .ad-editor-version-item.is-current {
  border: 0 !important;
  border-color: transparent !important;
  background: transparent;
  box-shadow: none !important;
  transform: none;
}
.ad-editor-page .ad-editor-version-item { border: 0 !important; border-color: transparent !important; background: transparent; box-shadow: none !important; }
.ad-editor-page .ad-editor-version-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  pointer-events: none;
}
@media(max-width:520px) {
  .ad-editor-page .ad-editor-version-switcher { width: calc(100% - 8px); }
  .ad-editor-page .ad-editor-version-item { flex-basis: 40px; width: 40px; height: 52px; }
}

@media(min-width:701px) {
  .ad-editor-page.ad-advertising-result.ad-has-references .ad-editor-preview-frame {
    width: min(100%, calc(65vh * 16 / 9));
    margin: 16px auto 0;
  }
}

/* The editor stylesheet is loaded after the base stylesheet, so explicitly hide the generic dots here. */
.ad-editor-page>.progress.generation-time-note::after{display:none}
.ad-editor-page>.progress.generation-time-note [data-generation-copy]{display:block;width:100%;text-align:center;line-height:1.35}.generation-time-note-break{display:none}
.ad-editor-page .progress.ad-generation-status{position:relative;isolation:isolate;display:flex;align-items:center;justify-content:center;gap:8px;width:calc(100% - 32px);min-height:38px;margin:12px auto 0;padding:9px 14px;overflow:hidden;border:1px solid rgba(92,220,173,.62);border-radius:13px;color:#b8ffde;background:linear-gradient(100deg,rgba(45,164,124,.16),rgba(33,110,94,.2),rgba(45,164,124,.14));box-shadow:0 0 18px rgba(92,220,173,.12)}
.ad-editor-page .progress.ad-generation-status::before,.ad-editor-page .progress.ad-generation-status::after{position:absolute;z-index:-1;width:4px;height:4px;border-radius:50%;content:"";background:#80efbc;box-shadow:0 0 8px rgba(128,239,188,.85),34px -7px 0 -1px #55e7ff,-42px 8px 0 -1px #b8ffde,68px 5px 0 -2px #80efbc,-75px -5px 0 -2px #55e7ff;animation:ad-status-particles 2.6s ease-in-out infinite}
.ad-editor-page .progress.ad-generation-status::after{animation-delay:-1.3s;transform:translateX(30px)}
.ad-editor-page .progress.ad-generation-status strong{display:inline-flex;align-items:center;gap:5px;color:#b8ffde;font-weight:800;white-space:nowrap}.ad-editor-page .progress.ad-generation-status strong i{width:6px;height:6px;border-radius:50%;background:#80efbc;box-shadow:0 0 8px rgba(128,239,188,.9)}.ad-editor-page .progress.ad-generation-status [data-generation-copy]{display:inline;width:auto;color:#b8ffde;opacity:.88}
@keyframes ad-status-particles{0%,100%{opacity:.35;transform:translateY(3px) scale(.8)}50%{opacity:1;transform:translateY(-3px) scale(1.1)}}
@media(max-width:680px){.ad-editor-page>.progress.generation-time-note{padding-right:24px;padding-left:24px}.generation-time-note-break{display:inline}}

/* Keep editor selects dark even though this stylesheet is loaded after style.css. */
.ad-editor-page select{color-scheme:dark;appearance:none;-webkit-appearance:none;padding-right:42px!important;border-color:rgba(255,255,255,.14);background-color:#121017;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23e99cff' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-position:right 14px center;background-repeat:no-repeat;background-size:16px;transition:border-color .2s ease,box-shadow .2s ease,background-color .2s ease}
.ad-editor-page select:hover{border-color:rgba(218,92,255,.48)}
.ad-editor-page select:focus{border-color:rgba(218,92,255,.72);outline:0;box-shadow:0 0 0 3px rgba(185,75,255,.11),0 8px 24px rgba(71,18,92,.12)}
.ad-editor-page select:focus,.ad-editor-page select:focus-visible{border-color:rgba(218,92,255,.82)!important;outline:2px solid rgba(218,92,255,.64)!important;outline-offset:1px!important;box-shadow:0 0 0 3px rgba(185,75,255,.14),0 8px 24px rgba(71,18,92,.12)!important}
.ad-editor-page select option,.ad-editor-page select optgroup{color:#f3eef7;background:#121017}
.ad-editor-page select option:checked{color:#fff;background-color:#5b1d75;background-image:linear-gradient(135deg,#5b1d75,#792a82)}

/* The violet accent belongs to the format control itself, not to the current-format row. */
.ad-editor-page #ad-editor-format select option:checked{color:#f3eef7;background-color:#121017;background-image:none}
.ad-editor-page #ad-editor-format select option:hover{color:#fff;background-color:#32163f;background-image:none}

/* Keep every visible advertising-result panel in one visual family. */
.ad-editor-page.ad-advertising-result .ad-editor-preview-card,
.ad-editor-page.ad-advertising-result .ad-editor-summary,
.ad-editor-page.ad-advertising-result .ad-editor-actions>section{border-color:rgba(217,104,255,.52);box-shadow:0 0 0 1px rgba(217,104,255,.11),0 12px 38px rgba(141,39,166,.08),0 20px 70px rgba(0,0,0,.26)}
@media(max-width:520px){
  .ad-editor-page.ad-advertising-result .ad-editor-preview-card,
  .ad-editor-page.ad-advertising-result .ad-editor-summary,
  .ad-editor-page.ad-advertising-result .ad-editor-actions>section{border-color:rgba(217,104,255,.58);box-shadow:0 0 0 1px rgba(217,104,255,.14),0 10px 30px rgba(141,39,166,.1),0 14px 40px rgba(0,0,0,.24)}
}

/* Final result layout: reference thumbs keep their own aspect ratio, while
 * the result canvas and its version rail share the same measured width. */
.ad-editor-page .ad-editor-reference-thumb {
  height: auto;
  min-height: 0;
  padding: 0;
  background: #0a080d;
}
.ad-editor-page .ad-editor-reference-thumb img {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  background: #0a080d;
}
@media(min-width:901px) {
  .ad-editor-page.ad-advertising-result.ad-has-references .ad-editor-preview-frame {
    justify-self: start;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .ad-editor-page.ad-advertising-result.ad-has-references .ad-editor-preview-footer {
    grid-column: 2;
    grid-row: 3;
    align-self: start;
    margin: 10px 0 16px;
    padding: 0;
  }
  .ad-editor-page.ad-advertising-result.ad-has-references .ad-editor-preview-footer .ad-editor-version-switcher {
    width: 100% !important;
    max-width: none;
    margin: 0 !important;
  }
  .ad-editor-page.ad-advertising-result.ad-has-references .ad-editor-action-toolbar {
    grid-column: 2;
    grid-row: 4;
    margin: 0;
    padding: 0 0 16px;
  }
}

/* Keep the canvas, version rail and actions centered in the preview card.
 * The reference rail occupies the left flexible track and stays close to the
 * canvas without changing its center point. */
@media(min-width:901px) {
  .ad-editor-page.ad-advertising-result.ad-has-references .ad-editor-preview-card {
    grid-template-columns: minmax(128px, 1fr) auto minmax(0, 1fr);
    column-gap: 10px;
  }
  .ad-editor-page.ad-advertising-result.ad-has-references .ad-editor-card-head {
    grid-column: 1 / -1;
  }
  .ad-editor-page.ad-advertising-result.ad-has-references .ad-editor-reference-rail {
    grid-column: 1;
    grid-row: 2 / 5;
    justify-self: end;
    align-self: start;
    margin: 16px 0 0;
  }
  .ad-editor-page.ad-advertising-result.ad-has-references .ad-editor-preview-frame {
    grid-column: 2;
    justify-self: center;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .ad-editor-page.ad-advertising-result.ad-has-references .ad-editor-preview-footer,
  .ad-editor-page.ad-advertising-result.ad-has-references .ad-editor-action-toolbar {
    grid-column: 2;
    justify-self: center;
  }
}

/* Last-in-file carousel skin so legacy editor rules cannot hide the ad
 * thumbnails or remove the active-version outline. */
.ad-editor-page.ad-advertising-result .ad-editor-version-switcher > [data-carousel-items] { display: flex !important; }
.ad-editor-page.ad-advertising-result .ad-editor-version-item {
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  padding: 2px;
  border: 1px solid rgba(255,255,255,.12) !important;
  border-radius: 10px;
  background: rgba(255,255,255,.035);
  opacity: .68;
}
.ad-editor-page.ad-advertising-result .ad-editor-version-item.is-current {
  border-color: #e35bff !important;
  box-shadow: 0 0 0 2px rgba(215,68,255,.18),0 0 18px rgba(215,68,255,.22) !important;
  opacity: 1;
}
.ad-editor-page.ad-advertising-result .ad-editor-version-item img { display: block; width: 100%; height: 100%; border-radius: 7px; object-fit: cover; pointer-events: none; }

/* Final compact result actions: keep all four controls in two equal columns,
 * with a fixed 15px internal gap and matching side insets.  This last rule
 * intentionally overrides older result-toolbar experiments above. */
.ad-editor-page.ad-advertising-result .ad-editor-preview-card > .ad-editor-action-toolbar {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 15px !important;
  width: min(calc(100% - 32px), 560px) !important;
  margin: 0 auto 16px !important;
  padding: 0 !important;
  box-sizing: border-box;
}
.ad-editor-page.ad-advertising-result .ad-editor-preview-card > .ad-editor-action-toolbar > form {
  display: contents !important;
}
.ad-editor-page.ad-advertising-result .ad-editor-preview-card > .ad-editor-action-toolbar .ad-editor-action {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  min-height: 42px !important;
  justify-self: stretch !important;
  margin: 0 !important;
  padding: 0 12px !important;
  box-sizing: border-box;
  white-space: nowrap;
}
@media(max-width:560px) {
  .ad-editor-page.ad-advertising-result .ad-editor-preview-card > .ad-editor-action-toolbar {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    width: calc(100% - 24px) !important;
    margin: 0 12px 12px !important;
  }
}

/* Keep the outer action cards neutral. The violet accent belongs only to the
 * outline of the edit field and the format control inside them. */
.ad-editor-page.ad-advertising-result .ad-editor-actions #ad-editor-revise,
.ad-editor-page.ad-advertising-result .ad-editor-actions #ad-editor-format {
  border-color: rgba(255,255,255,.12) !important;
  box-shadow: 0 12px 34px rgba(0,0,0,.2) !important;
}
@media(max-width:520px) {
  .ad-editor-page.ad-advertising-result .ad-editor-actions #ad-editor-revise,
  .ad-editor-page.ad-advertising-result .ad-editor-actions #ad-editor-format {
    border-color: rgba(255,255,255,.13) !important;
    box-shadow: 0 10px 30px rgba(0,0,0,.2) !important;
  }
}
.ad-editor-page.ad-advertising-result .ad-editor-actions #ad-editor-revise textarea,
.ad-editor-page.ad-advertising-result .ad-editor-actions #ad-editor-format select {
  outline: 1px solid rgba(217,104,255,.68) !important;
  outline-offset: 0;
}
.ad-editor-page.ad-advertising-result .ad-editor-actions #ad-editor-revise textarea:focus,
.ad-editor-page.ad-advertising-result .ad-editor-actions #ad-editor-format select:focus {
  outline-color: rgba(218,92,255,.88) !important;
}

/* Give the advertising version previews a clear 20px breathing room below
 * the main generated image. */
.ad-editor-page.ad-advertising-result .ad-editor-preview-card > .ad-editor-version-switcher {
  margin-top: 20px !important;
}

/* On desktop the readonly notice follows the preview column width instead of
 * stretching across the full two-column workspace. */
@media(min-width:901px) {
  .ad-editor-page.ad-advertising-result .ad-editor-readonly-note {
    width: calc(100% - 410px);
    box-sizing: border-box;
    justify-self: start;
  }
}

/* Prototype-aligned action cards for advertising creatives. */
.ad-editor-page.ad-advertising-result .ad-editor-actions > section#ad-editor-revise,
.ad-editor-page.ad-advertising-result .ad-editor-actions > section#ad-editor-format {
  display: flex;
  flex-direction: column;
  min-height: 560px;
  padding: 30px;
  border-color: rgba(71,48,79,.95) !important;
  border-radius: 24px;
  background: linear-gradient(155deg,#19121f 0%,#110d17 75%);
  box-shadow: 0 20px 60px rgba(0,0,0,.27), inset 0 1px rgba(255,255,255,.04) !important;
}
.ad-editor-page.ad-advertising-result .ad-editor-panel-head {
  display: flex;
  align-items: flex-start;
  gap: 17px;
}
.ad-editor-page.ad-advertising-result .ad-editor-panel-icon {
  display: grid;
  flex: 0 0 46px;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid #744182;
  border-radius: 14px;
  color: #e3a1f1;
  background: #3b1a47;
}
.ad-editor-page.ad-advertising-result .ad-editor-panel-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}
.ad-editor-page.ad-advertising-result .ad-editor-actions .ad-editor-card-kicker {
  margin: 2px 0 7px;
  color: #c978dc;
}
.ad-editor-page.ad-advertising-result .ad-editor-actions h3 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -.035em;
  line-height: 1.18;
}
.ad-editor-page.ad-advertising-result .ad-editor-panel-desc {
  max-width: 58ch;
  margin: 18px 0 23px !important;
  color: #b4aabc;
  font-size: 14px;
  line-height: 1.5;
}
.ad-editor-page.ad-advertising-result .ad-editor-actions form {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0;
  min-height: 0;
}
.ad-editor-page.ad-advertising-result .ad-editor-field-label {
  display: block;
  margin-bottom: 10px;
  color: #e7dce9;
  font-size: 13px;
  font-weight: 650;
}
.ad-editor-page.ad-advertising-result .ad-editor-actions #ad-editor-revise textarea {
  min-height: 160px;
  max-height: 300px;
  padding: 17px 18px;
  border: 1px solid #5b4262 !important;
  border-radius: 15px;
  background: #0d0a11;
  resize: vertical;
  outline: 0 !important;
}
.ad-editor-page.ad-advertising-result .ad-editor-actions #ad-editor-revise textarea:hover {
  border-color: #a063ae !important;
}
.ad-editor-page.ad-advertising-result .ad-editor-actions #ad-editor-revise textarea:focus {
  border-color: #d773ee !important;
  box-shadow: 0 0 0 3px rgba(184,68,215,.17), 0 10px 24px rgba(0,0,0,.16);
}
.ad-editor-page.ad-advertising-result .ad-editor-field-tip,
.ad-editor-page.ad-advertising-result .ad-editor-panel-hint {
  min-height: 0;
  margin: 10px 0 0 !important;
  color: #988c9f;
  font-size: 12px;
  line-height: 1.45;
}
.ad-editor-page.ad-advertising-result .ad-editor-panel-footer {
  display: grid;
  gap: 0;
  margin-top: auto;
  padding-top: 26px;
}
.ad-editor-page.ad-advertising-result .ad-editor-panel-footer .ad-editor-billing {
  gap: 4px;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 13px;
}
.ad-editor-page.ad-advertising-result .ad-editor-panel-footer .ad-editor-billing-primary {
  position: relative;
  padding-left: 23px;
}
.ad-editor-page.ad-advertising-result .ad-editor-panel-footer .ad-editor-billing-primary::before {
  position: absolute;
  top: 1px;
  left: 1px;
  color: #d67def;
  content: '✦';
  font-size: 17px;
  line-height: 1;
}
.ad-editor-page.ad-advertising-result .ad-editor-panel-footer .ad-editor-billing-primary span {
  color: #b8aabf;
}
.ad-editor-page.ad-advertising-result .ad-editor-panel-footer .ad-editor-billing-primary strong {
  color: #f4edf6;
  font-size: 14px;
}
.ad-editor-page.ad-advertising-result .ad-editor-panel-footer .ad-editor-billing-row strong {
  color: #f4edf6;
}
.ad-editor-page.ad-advertising-result .ad-editor-panel-footer .ad-editor-billing small {
  color: #9a8b9f;
}
.ad-editor-page.ad-advertising-result .ad-editor-edit-submit,
.ad-editor-page.ad-advertising-result .ad-editor-format-submit {
  width: 100% !important;
  min-height: 54px;
  border: 0;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(100deg,#942de0,#ca3ed7);
  box-shadow: 0 8px 24px rgba(156,42,211,.22);
  font-size: 15px;
}
.ad-editor-page.ad-advertising-result .ad-editor-edit-submit:disabled,
.ad-editor-page.ad-advertising-result .ad-editor-format-submit:disabled {
  color: #9a83a1;
  background: #40234a;
  box-shadow: none;
}
.ad-editor-page.ad-advertising-result .ad-editor-ratios {
  display: grid;
  grid-template-columns: repeat(5,minmax(0,1fr));
  gap: 9px;
}
.ad-editor-page.ad-advertising-result .ad-editor-ratio {
  display: flex;
  height: 126px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 4px;
  border: 1px solid #4b3952;
  border-radius: 14px;
  color: #bdb0c5;
  background: #100c15;
  transition: background .17s,border-color .17s,color .17s,transform .17s;
}
.ad-editor-page.ad-advertising-result .ad-editor-ratio:hover:not(:disabled) {
  border-color: #bb63d1;
  color: #fff;
  background: #211328;
  transform: translateY(-2px);
}
.ad-editor-page.ad-advertising-result .ad-editor-ratio[aria-pressed="true"] {
  border-color: #d471eb;
  color: #fff;
  background: #33183e;
  box-shadow: inset 0 0 0 1px rgba(212,113,235,.33);
}
.ad-editor-page.ad-advertising-result .ad-editor-ratio:disabled {
  cursor: not-allowed;
  opacity: .52;
  transform: none;
}
.ad-editor-page.ad-advertising-result .ad-editor-ratio-shape {
  width: 30px;
  height: 38px;
  border: 2px solid currentColor;
  border-radius: 3px;
}
.ad-editor-page.ad-advertising-result .ad-editor-ratio[data-value="1:1"] .ad-editor-ratio-shape { width: 35px; height: 35px; }
.ad-editor-page.ad-advertising-result .ad-editor-ratio[data-value="9:16"] .ad-editor-ratio-shape { width: 25px; height: 42px; }
.ad-editor-page.ad-advertising-result .ad-editor-ratio[data-value="16:9"] .ad-editor-ratio-shape { width: 42px; height: 24px; }
.ad-editor-page.ad-advertising-result .ad-editor-ratio[data-value="3:1"] .ad-editor-ratio-shape { width: 44px; height: 16px; }
.ad-editor-page.ad-advertising-result .ad-editor-ratio-text { font-size: 13px; font-weight: 750; }
.ad-editor-page.ad-advertising-result .ad-editor-ratio-current {
  min-height: 14px;
  color: #d69be3;
  font-size: 11px;
  font-weight: 650;
}
.ad-editor-page.ad-advertising-result .ad-editor-ratio-note {
  min-height: 18px;
  margin: 11px 0 0 !important;
  color: #a297aa;
  font-size: 12px;
}
.ad-editor-page.ad-advertising-result .ad-editor-format-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  border: 0 !important;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}
@media(max-width:900px) {
  .ad-editor-page.ad-advertising-result .ad-editor-actions > section#ad-editor-revise,
  .ad-editor-page.ad-advertising-result .ad-editor-actions > section#ad-editor-format {
    min-height: 0;
    padding: 24px;
    border-radius: 20px;
  }
}
@media(max-width:560px) {
  .ad-editor-page.ad-advertising-result .ad-editor-actions > section#ad-editor-revise,
  .ad-editor-page.ad-advertising-result .ad-editor-actions > section#ad-editor-format {
    padding: 21px;
    border-radius: 19px;
  }
  .ad-editor-page.ad-advertising-result .ad-editor-actions h3 { font-size: 21px; }
  .ad-editor-page.ad-advertising-result .ad-editor-ratios { grid-template-columns: repeat(3,1fr); }
  .ad-editor-page.ad-advertising-result .ad-editor-ratio { height: 105px; }
}

/* Calm, compact action section for the approved advertising result layout. */
.ad-editor-page.ad-advertising-result .ad-editor-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 28px;
  align-items: stretch;
}
.ad-editor-page.ad-advertising-result .ad-editor-actions-title {
  grid-column: 1 / -1;
  margin: 0;
  color: #f2eaf4;
  font-size: 24px;
  letter-spacing: -.025em;
  line-height: 1.2;
}
.ad-editor-page.ad-advertising-result .ad-editor-actions #ad-editor-revise,
.ad-editor-page.ad-advertising-result .ad-editor-actions #ad-editor-format {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  position: relative;
  padding: 30px;
  border: 1px solid rgba(185, 143, 198, .24) !important;
  border-radius: 20px;
  background: #17111d !important;
  box-shadow: 0 16px 38px rgba(0,0,0,.24) !important;
  isolation: isolate;
  overflow: hidden;
}
.ad-editor-page.ad-advertising-result .ad-editor-actions #ad-editor-revise::before,
.ad-editor-page.ad-advertising-result .ad-editor-actions #ad-editor-format::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: #17111d;
  content: '';
}
.ad-editor-page.ad-advertising-result .ad-editor-panel-head {
  gap: 12px;
  align-items: center;
}
.ad-editor-page.ad-advertising-result .ad-editor-panel-icon {
  flex-basis: 36px;
  width: 36px;
  height: 36px;
  border-radius: 11px;
}
.ad-editor-page.ad-advertising-result .ad-editor-panel-icon svg {
  width: 18px;
  height: 18px;
}
.ad-editor-page.ad-advertising-result .ad-editor-actions .ad-editor-card-kicker {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: .1em;
}
.ad-editor-page.ad-advertising-result .ad-editor-actions h3 {
  margin: 0;
  font-size: 22px;
}
.ad-editor-page.ad-advertising-result .ad-editor-panel-desc {
  max-width: 48ch;
  margin: 16px 0 20px !important;
  font-size: 13px;
  line-height: 1.45;
}
.ad-editor-page.ad-advertising-result .ad-editor-actions form {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0;
}
.ad-editor-page.ad-advertising-result .ad-editor-field-label {
  margin-bottom: 9px;
  font-size: 12px;
}
.ad-editor-page.ad-advertising-result .ad-editor-actions #ad-editor-revise textarea {
  min-height: 150px;
  max-height: 150px;
  padding: 15px 16px;
  border: 1px solid rgba(217,104,255,.46) !important;
  border-radius: 13px;
  background: #0f0b14;
  resize: none;
}
.ad-editor-page.ad-advertising-result .ad-editor-field-tip {
  margin: 8px 0 0 !important;
  font-size: 11px;
}
.ad-editor-page.ad-advertising-result .ad-editor-panel-footer {
  display: grid;
  gap: 0;
  margin-top: auto;
  padding-top: 22px;
}
.ad-editor-page.ad-advertising-result .ad-editor-panel-footer .ad-editor-billing-compact {
  margin: 0 0 11px;
  padding: 0;
  border: 0;
  background: transparent;
}
.ad-editor-page.ad-advertising-result .ad-editor-panel-footer .ad-editor-billing-compact .ad-editor-billing-primary {
  min-height: 20px;
  margin: 0;
  padding-left: 21px;
  font-size: 12px;
}
.ad-editor-page.ad-advertising-result .ad-editor-panel-footer .ad-editor-billing-compact .ad-editor-billing-primary::before {
  top: 0;
  left: 0;
  font-size: 15px;
}
.ad-editor-page.ad-advertising-result .ad-editor-panel-footer .ad-editor-billing-compact .ad-editor-billing-primary span {
  color: #b8aabf;
}
.ad-editor-page.ad-advertising-result .ad-editor-panel-footer .ad-editor-billing-compact .ad-editor-billing-primary strong {
  color: #f4edf6;
  font-size: 13px;
}
.ad-editor-page.ad-advertising-result .ad-editor-edit-submit,
.ad-editor-page.ad-advertising-result .ad-editor-format-submit {
  min-height: 48px;
  border-radius: 12px;
  font-size: 14px;
}
.ad-editor-page.ad-advertising-result .ad-editor-edit-submit:disabled,
.ad-editor-page.ad-advertising-result .ad-editor-format-submit:disabled {
  color: #c6a9cd;
  background: #38203f;
  opacity: 1;
}
.ad-editor-page.ad-advertising-result .ad-editor-ratios {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.ad-editor-page.ad-advertising-result .ad-editor-ratio {
  height: 92px;
  gap: 6px;
  border: 1px solid rgba(185,143,198,.27);
  border-radius: 12px;
  background: #100c15;
}
.ad-editor-page.ad-advertising-result .ad-editor-ratio[aria-checked="true"] {
  border-color: #d471eb;
  background: rgba(111,45,129,.38);
  box-shadow: inset 0 0 0 1px rgba(212,113,235,.28);
}
.ad-editor-page.ad-advertising-result .ad-editor-ratio-current {
  min-height: 13px;
  font-size: 10px;
}
.ad-editor-page.ad-advertising-result .ad-editor-ratio-note {
  min-height: 0;
  margin: 9px 0 0 !important;
  font-size: 11px;
}
.ad-editor-page.ad-advertising-result .ad-editor-admin-note {
  grid-column: 1 / -1;
  margin: -8px 0 0;
  color: #9f91a6;
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}
.ad-editor-page.ad-advertising-result .ad-editor-readonly-note {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  width: auto;
  justify-self: stretch;
  box-sizing: border-box;
  padding: 16px 18px;
  border: 1px solid rgba(185,143,198,.24);
  border-radius: 14px;
  color: #b9aabd;
  background: #17111d;
  font-size: 12px;
  line-height: 1.45;
}
.ad-editor-page.ad-advertising-result .ad-editor-readonly-note strong {
  color: #f1e8f3;
  font-size: 14px;
}
.ad-editor-page.ad-advertising-result .ad-editor-actions :is(textarea, button):focus-visible {
  outline: 2px solid #e59afa;
  outline-offset: 3px;
}

@media(max-width:900px) {
  .ad-editor-page.ad-advertising-result .ad-editor-actions {
    grid-template-columns: 1fr;
    gap: 18px;
    margin-top: 24px;
  }
  .ad-editor-page.ad-advertising-result .ad-editor-actions-title,
  .ad-editor-page.ad-advertising-result .ad-editor-admin-note,
  .ad-editor-page.ad-advertising-result .ad-editor-readonly-note {
    grid-column: 1;
  }
  .ad-editor-page.ad-advertising-result .ad-editor-actions #ad-editor-revise,
  .ad-editor-page.ad-advertising-result .ad-editor-actions #ad-editor-format {
    padding: 26px;
  }
}
@media(max-width:560px) {
  .ad-editor-page.ad-advertising-result .ad-editor-actions {
    gap: 14px;
    margin-top: 20px;
  }
  .ad-editor-page.ad-advertising-result .ad-editor-actions-title {
    font-size: 21px;
  }
  .ad-editor-page.ad-advertising-result .ad-editor-actions #ad-editor-revise,
  .ad-editor-page.ad-advertising-result .ad-editor-actions #ad-editor-format {
    padding: 22px;
  }
  .ad-editor-page.ad-advertising-result .ad-editor-ratios {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .ad-editor-page.ad-advertising-result .ad-editor-ratio {
    height: 92px;
  }
}

/* Final advertising-preview alignment: use the same side inset as the
 * source-material cards and keep the selected format exact. */
.ad-editor-page.ad-advertising-result .ad-editor-source-thumb-style {
  background: #211826;
}
.ad-editor-page.ad-advertising-result .ad-editor-source-thumb-style img {
  object-fit: cover;
  background: #211826;
}
.ad-editor-page.ad-advertising-result .ad-editor-placeholder[data-placeholder-ratio="3:4"] {
  aspect-ratio: 3 / 4 !important;
}
.ad-editor-page.ad-advertising-result .ad-editor-placeholder[data-placeholder-ratio="1:1"] {
  aspect-ratio: 1 / 1 !important;
}
.ad-editor-page.ad-advertising-result .ad-editor-placeholder[data-placeholder-ratio="9:16"] {
  aspect-ratio: 9 / 16 !important;
}
.ad-editor-page.ad-advertising-result .ad-editor-placeholder[data-placeholder-ratio="16:9"] {
  aspect-ratio: 16 / 9 !important;
}
.ad-editor-page.ad-advertising-result .ad-editor-placeholder[data-placeholder-ratio="3:1"] {
  aspect-ratio: 3 / 1 !important;
}
@media(min-width:701px) {
  .ad-editor-page.ad-advertising-result .ad-editor-preview-frame,
  .ad-editor-page.ad-advertising-result .ad-editor-preview-frame[data-preview-ratio] {
    width: calc(100% - 40px) !important;
    margin-left: 20px !important;
    margin-right: 20px !important;
    justify-self: center !important;
  }
}
@media(max-width:700px) {
  .ad-editor-page.ad-advertising-result .ad-editor-preview-frame,
  .ad-editor-page.ad-advertising-result .ad-editor-preview-frame[data-preview-ratio] {
    width: calc(100% - 24px) !important;
    margin-left: 12px !important;
    margin-right: 12px !important;
    justify-self: center !important;
  }
}

/* Final result fit: use the image's intrinsic ratio inside the selected canvas. */
.ad-editor-page.ad-advertising-result .ad-editor-image-trigger {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden;
}
.ad-editor-page.ad-advertising-result .ad-editor-result .result-image,
.ad-editor-page.ad-advertising-result .ad-editor-image-trigger .result-image {
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
}

/* Final format tiles: equal centering and outline-only selected state. */
.ad-editor-page.ad-advertising-result .ad-editor-ratio {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box;
}
.ad-editor-page.ad-advertising-result .ad-editor-ratio[aria-checked="true"] {
  border-color: rgba(212,113,235,.82) !important;
  background: #100c15 !important;
  box-shadow: 0 0 0 1px rgba(212,113,235,.22) !important;
}
.ad-editor-page.ad-advertising-result .ad-editor-ratio[aria-checked="true"]:hover:not(:disabled) {
  background: #100c15 !important;
}
