:root{--bg:#0b0d12;--panel:#11141b;--panel-2:#171b23;--panel-3:#1e232d;--line:#2a303c;--text:#f5f6f7;--muted:#939aa8;--accent:#dfff4f;--accent-2:#5ef2d6;--danger:#ff6b73;--radius:14px;--shadow:0 20px 55px rgba(0,0,0,.32)}
*{box-sizing:border-box}html,body{height:100%;margin:0}body{background:var(--bg);color:var(--text);font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-size:16px;overflow:hidden}button,input,select{font:inherit}button{color:inherit}.svg-defs{position:absolute;width:0;height:0;overflow:hidden}svg:not(#logoCanvas){width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.topbar{height:68px;display:grid;grid-template-columns:300px 1fr 300px;align-items:center;border-bottom:1px solid var(--line);padding:0 18px;background:rgba(11,13,18,.95);position:relative;z-index:5}.brand{display:flex;align-items:center;gap:11px;text-decoration:none;color:var(--text);width:max-content}.brand-mark{width:36px;height:36px;border-radius:10px;background:var(--accent);color:#0b0d12;display:grid;place-items:center;font-weight:900;letter-spacing:-1px}.brand strong,.brand small{display:block}.brand strong{font-size:15px;line-height:1.2}.brand small{font-size:11px;color:var(--muted);margin-top:2px}.project-title{display:flex;justify-content:center;align-items:center;gap:8px;color:var(--muted);font-size:13px}.project-title input{width:130px;border:0;background:transparent;color:var(--text);text-align:right;outline:0;padding:6px 2px;border-bottom:1px solid transparent}.project-title input:focus{border-color:var(--accent)}.save-state{width:6px;height:6px;border-radius:50%;background:var(--accent-2)}.saved-label{font-size:12px}.top-actions{display:flex;gap:8px;justify-content:flex-end;align-items:center}.btn,.icon-btn{border:1px solid var(--line);background:var(--panel-2);border-radius:10px;min-height:38px;display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:0 14px;cursor:pointer;transition:.18s ease}.btn:hover,.icon-btn:hover{border-color:#4a5363;background:var(--panel-3)}.icon-btn{width:38px;padding:0}.icon-btn:disabled{opacity:.35;cursor:not-allowed}.btn.primary{background:var(--accent);border-color:var(--accent);color:#10120c;font-weight:800}.btn.primary:hover{background:#e7ff72;transform:translateY(-1px)}.btn.ghost{background:transparent}.btn.wide{width:100%;height:48px}.compact{width:31px;min-height:31px;border-radius:8px;background:transparent}
.studio{height:calc(100vh - 68px);display:grid;grid-template-columns:304px minmax(420px,1fr) 316px}.template-panel,.properties-panel{background:var(--panel);min-width:0;overflow:hidden}.template-panel{border-right:1px solid var(--line);padding:20px 14px 16px;display:flex;flex-direction:column}.properties-panel{border-left:1px solid var(--line);display:flex;flex-direction:column}.panel-head{display:flex;justify-content:space-between;align-items:flex-start;padding:0 4px 15px}.eyebrow{margin:0 0 6px;color:var(--accent);text-transform:uppercase;font-size:11px;font-weight:800;letter-spacing:.12em}.panel-head h1{font-size:19px;margin:0;letter-spacing:-.025em}.count-badge{background:var(--panel-3);color:var(--muted);font-size:12px;padding:5px 8px;border-radius:20px;border:1px solid var(--line)}.search-box{height:40px;display:flex;align-items:center;gap:9px;padding:0 10px;border:1px solid var(--line);border-radius:10px;background:#0e1117}.search-box:focus-within{border-color:#687386}.search-box svg{color:var(--muted);flex:0 0 auto}.search-box input{min-width:0;flex:1;color:var(--text);border:0;background:transparent;outline:0;font-size:13px}.search-box input::placeholder{color:#707785}.search-box kbd{font-size:11px;color:#7c8492;background:var(--panel-3);border:1px solid var(--line);border-radius:5px;padding:2px 6px}.category-row{display:flex;gap:7px;overflow-x:auto;padding:13px 0 12px;scrollbar-width:none}.category-row::-webkit-scrollbar{display:none}.category-row button{white-space:nowrap;border:1px solid var(--line);background:transparent;color:var(--muted);padding:7px 10px;border-radius:20px;font-size:12px;cursor:pointer}.category-row button.active{background:var(--text);color:#111319;border-color:var(--text);font-weight:700}.template-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px;overflow:auto;padding:0 3px 8px 0;align-content:start}.template-grid::-webkit-scrollbar{width:5px}.template-grid::-webkit-scrollbar-thumb{background:#353b47;border-radius:6px}.template-card{aspect-ratio:1;border:1px solid var(--line);background:#f5f5f2;border-radius:11px;padding:0;overflow:hidden;cursor:pointer;position:relative;transition:.16s ease}.template-card:hover{transform:translateY(-2px);border-color:#7a8494}.template-card.active{outline:2px solid var(--accent);outline-offset:1px}.template-card svg{width:100%;height:100%;display:block}.template-card .template-num{position:absolute;right:6px;bottom:5px;font-size:9px;background:rgba(0,0,0,.58);color:#fff;border-radius:5px;padding:2px 4px}.load-more{border:1px solid var(--line);background:var(--panel-2);color:var(--muted);padding:9px;border-radius:9px;margin-top:8px;font-size:12px;cursor:pointer}
.workspace{min-width:0;display:flex;flex-direction:column;background:#1a1e26}.canvas-toolbar{height:54px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 16px}.segmented{display:flex;background:#10131a;border:1px solid var(--line);border-radius:9px;padding:3px}.segmented button{border:0;background:transparent;color:var(--muted);font-size:12px;padding:6px 10px;border-radius:6px;cursor:pointer}.segmented button.active{background:var(--panel-3);color:var(--text)}.zoom-tools{display:flex;align-items:center;gap:5px}.zoom-tools span{width:50px;text-align:center;color:var(--muted);font-size:12px}.canvas-stage{flex:1;min-height:0;display:grid;place-items:center;padding:42px;overflow:auto;background-color:#1b2028;background-image:linear-gradient(45deg,#20252e 25%,transparent 25%),linear-gradient(-45deg,#20252e 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#20252e 75%),linear-gradient(-45deg,transparent 75%,#20252e 75%);background-size:24px 24px;background-position:0 0,0 12px,12px -12px,-12px 0}.canvas-wrap{height:min(68vh,660px);max-width:100%;aspect-ratio:1;background:#fff;box-shadow:var(--shadow);position:relative;transform-origin:center;transition:width .2s,aspect-ratio .2s}.canvas-wrap.wide{width:min(80%,760px);height:auto;aspect-ratio:16/9}.canvas-wrap.mark{height:min(60vh,570px)}#logoCanvas{width:100%;height:100%;display:block}.selection-outline{position:absolute;inset:30% 12% 25%;border:1px solid rgba(52,115,255,.65);pointer-events:none;opacity:0}.canvas-wrap:hover .selection-outline{opacity:.45}.selection-outline span{position:absolute;width:7px;height:7px;background:#fff;border:1px solid #3473ff}.selection-outline span:nth-child(1){left:-4px;top:-4px}.selection-outline span:nth-child(2){right:-4px;top:-4px}.selection-outline span:nth-child(3){left:-4px;bottom:-4px}.selection-outline span:nth-child(4){right:-4px;bottom:-4px}.canvas-status{height:34px;border-top:1px solid var(--line);display:flex;justify-content:space-between;align-items:center;padding:0 16px;color:var(--muted);font-size:11px}.canvas-status span{display:flex;align-items:center;gap:6px}.canvas-status svg{width:14px;height:14px;color:var(--accent-2)}
.property-tabs{height:54px;border-bottom:1px solid var(--line);padding:0 18px;display:flex;gap:22px}.property-tabs button{border:0;border-bottom:2px solid transparent;background:transparent;color:var(--muted);cursor:pointer;padding:2px 1px 0;font-size:13px}.property-tabs button.active{color:var(--text);border-bottom-color:var(--accent)}.properties-content{overflow:auto;min-height:0;flex:1}.properties-content.hidden{display:none}.control-section{border-bottom:1px solid var(--line)}.section-title{border:0;background:transparent;width:100%;height:48px;padding:0 18px;display:flex;align-items:center;justify-content:space-between;font-size:13px;font-weight:700;cursor:pointer}.section-title svg{transition:transform .2s}.control-section:not(.open) .section-title svg{transform:rotate(-90deg)}.section-body{padding:0 18px 18px}.control-section:not(.open) .section-body{display:none}.section-body>label:not(.switch-row,.range-label){display:block;color:var(--muted);font-size:11px;margin-bottom:12px}.section-body input[type=text],.section-body input:not([type]),.section-body select{display:block;width:100%;height:38px;border:1px solid var(--line);background:#0e1117;color:var(--text);border-radius:8px;padding:0 10px;margin-top:6px;outline:0;font-size:13px}.section-body input:focus,.section-body select:focus{border-color:#697586}.control-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.control-grid label{color:var(--muted);font-size:11px}.control-grid select{padding-right:4px}.range-label{display:block;margin-top:13px}.range-label span{display:flex;justify-content:space-between;color:var(--muted);font-size:11px;margin-bottom:8px}.range-label output{color:var(--text)}input[type=range]{appearance:none;width:100%;height:4px;background:linear-gradient(90deg,var(--accent) 25%,var(--line) 25%);border-radius:8px}input[type=range]::-webkit-slider-thumb{appearance:none;width:15px;height:15px;border-radius:50%;background:var(--accent);border:3px solid #11141b;box-shadow:0 0 0 1px var(--accent)}.layout-options{display:grid;grid-template-columns:repeat(4,1fr);gap:7px}.layout-options button{height:46px;border:1px solid var(--line);background:#0e1117;border-radius:8px;cursor:pointer;display:grid;place-items:center}.layout-options button.active{border-color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent)}.layout-icon{display:block;position:relative;width:26px;height:24px}.layout-icon:before,.layout-icon:after{content:"";position:absolute;background:#858e9d;border-radius:2px}.layout-icon.stacked:before{width:11px;height:10px;left:8px;top:1px}.layout-icon.stacked:after{width:25px;height:5px;left:1px;bottom:2px}.layout-icon.horizontal:before{width:9px;height:16px;left:0;top:4px}.layout-icon.horizontal:after{width:14px;height:6px;right:0;top:9px}.layout-icon.badge:before{width:20px;height:20px;border-radius:50%;left:3px;top:2px}.layout-icon.badge:after{width:10px;height:3px;left:8px;top:11px;background:#11141b}.layout-icon.wordmark:after{width:26px;height:8px;left:0;top:8px}.color-list{display:grid;gap:7px}.color-list label{display:flex;justify-content:space-between;align-items:center;color:var(--muted);font-size:12px}.color-control{display:flex;align-items:center;gap:7px}.color-control input{width:27px;height:27px;border:1px solid var(--line);border-radius:7px;background:transparent;padding:2px}.color-control code{width:62px;color:#c5cad3;font-family:ui-monospace,monospace;font-size:10px}.switch-row{display:flex;align-items:center;justify-content:space-between;color:var(--muted);font-size:12px;margin-top:13px;position:relative}.switch-row input{position:absolute;opacity:0}.switch-row i{width:36px;height:21px;border-radius:20px;background:#343a46;position:relative;transition:.2s}.switch-row i:after{content:"";position:absolute;width:15px;height:15px;border-radius:50%;background:#fff;left:3px;top:3px;transition:.2s}.switch-row input:checked+i{background:var(--accent)}.switch-row input:checked+i:after{transform:translateX(15px);background:#111}.layers-list{padding:12px}.layer-row{width:100%;display:grid;grid-template-columns:34px 1fr 24px;align-items:center;text-align:left;border:1px solid transparent;background:transparent;border-radius:9px;padding:9px;color:var(--muted);cursor:pointer}.layer-row.active{background:var(--panel-3);border-color:var(--line);color:var(--text)}.layer-row>svg{width:17px}.layer-row span strong,.layer-row span small{display:block}.layer-row span strong{font-size:12px}.layer-row span small{font-size:10px;color:var(--muted);margin-top:2px}.layer-action{justify-self:end}.pricing-note{margin:12px;border:1px solid rgba(223,255,79,.25);background:rgba(223,255,79,.06);border-radius:11px;padding:12px;display:flex;gap:10px;align-items:center}.price-glyph{width:31px;height:31px;border-radius:8px;background:var(--accent);color:#111;display:grid;place-items:center;font-weight:900}.pricing-note strong,.pricing-note small{display:block}.pricing-note strong{font-size:12px}.pricing-note small{font-size:10px;color:var(--muted);margin-top:3px}
.modal-backdrop{position:fixed;inset:0;background:rgba(4,5,8,.76);backdrop-filter:blur(8px);z-index:20;display:grid;place-items:center;padding:20px}.modal-backdrop.hidden{display:none}.export-modal{width:min(460px,100%);background:var(--panel);border:1px solid var(--line);border-radius:20px;padding:30px;box-shadow:var(--shadow);position:relative;text-align:center}.modal-close{position:absolute;right:13px;top:13px;width:35px;height:35px;border:0;border-radius:9px;background:var(--panel-3);color:var(--muted);cursor:pointer}.modal-icon{width:54px;height:54px;border-radius:16px;background:var(--accent);color:#111;display:grid;place-items:center;margin:0 auto 16px}.modal-icon svg{width:26px;height:26px}.export-modal h2{font-size:25px;letter-spacing:-.035em;margin:0 0 8px}.export-modal>p:not(.eyebrow){color:var(--muted);font-size:14px;margin:0 0 20px}.price-card{display:grid;grid-template-columns:1fr 1fr;border:1px solid var(--line);border-radius:12px;overflow:hidden;margin-bottom:14px}.price-card div{padding:15px;background:#0e1117}.price-card div+div{border-left:1px solid var(--line)}.price-card span,.price-card strong{display:block}.price-card span{color:var(--muted);font-size:11px}.price-card strong{font-size:22px;margin-top:4px}.format-options{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:0 0 16px}.format-options label{position:relative;text-align:left}.format-options input{position:absolute;opacity:0}.format-options span{display:block;border:1px solid var(--line);border-radius:10px;padding:11px 12px;cursor:pointer}.format-options input:checked+span{border-color:var(--accent);background:rgba(223,255,79,.05)}.format-options strong,.format-options small{display:block}.format-options strong{font-size:12px}.format-options small{color:var(--muted);font-size:10px;margin-top:2px}.secure-note{display:flex;justify-content:center;gap:5px;color:var(--muted);margin-top:12px;font-size:10px}.secure-note svg{width:13px;height:13px}.toast{position:fixed;left:50%;bottom:28px;transform:translate(-50%,18px);background:#f7f8fa;color:#111;border-radius:9px;padding:10px 14px;font-size:12px;font-weight:700;opacity:0;pointer-events:none;transition:.22s;z-index:30}.toast.show{opacity:1;transform:translate(-50%,0)}
@media(max-width:1050px){.studio{grid-template-columns:260px minmax(390px,1fr) 285px}.topbar{grid-template-columns:260px 1fr 285px}.btn.ghost{display:none}.canvas-stage{padding:28px}.template-panel{padding-left:10px;padding-right:10px}}
@media(max-width:820px){body{overflow:auto;overflow-x:hidden}.topbar{position:sticky;top:0;grid-template-columns:1fr auto;height:62px}.project-title{display:none}.top-actions .icon-btn{display:none}.studio{height:auto;min-height:calc(100vh - 62px);display:flex;flex-direction:column}.workspace{order:1;height:68vh;min-height:500px}.template-panel{order:2;height:520px;border-right:0;border-top:1px solid var(--line)}.properties-panel{order:3;border-left:0;border-top:1px solid var(--line);min-height:620px}.canvas-stage{padding:24px}.canvas-wrap{height:auto;width:min(78vw,520px)}.template-grid{grid-template-columns:repeat(3,1fr)}.top-actions .btn{padding:0 11px}}
@media(max-width:520px){.brand small{display:none}.topbar{padding:0 10px}.btn.primary svg{display:none}.workspace{height:61vh;min-height:430px}.canvas-stage{padding:18px}.canvas-toolbar{padding:0 10px}.template-grid{grid-template-columns:1fr 1fr}.template-panel{height:570px}.export-modal{padding:26px 18px}.price-card,.format-options{grid-template-columns:1fr}.price-card div+div{border-left:0;border-top:1px solid var(--line)}}
.template-grid{grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:max-content;overflow-y:auto;overflow-x:hidden;flex:1 1 0;min-height:0}
.template-card{display:block;width:100%;height:auto;aspect-ratio:1/1;min-height:0;flex:none}
.template-card>svg{width:100%!important;height:100%!important;min-height:0;overflow:hidden;stroke:none}
.template-card>svg *{stroke:none}
.hidden{display:none!important}
.product-switch{display:grid;grid-template-columns:1fr 1fr;gap:4px;background:#0d1016;border:1px solid var(--line);border-radius:11px;padding:4px;margin:0 3px 16px}.product-switch button{height:34px;border:0;border-radius:8px;background:transparent;color:var(--muted);font-size:12px;font-weight:700;cursor:pointer}.product-switch button.active{background:var(--accent);color:#10120c;box-shadow:0 4px 14px rgba(223,255,79,.12)}
.canvas-wrap.story{height:min(69vh,650px);width:auto;aspect-ratio:9/16}.canvas-wrap.ad-wide{width:min(83%,780px);height:auto;aspect-ratio:1200/628}
.ad-layout-icon{display:block;width:27px;height:22px;position:relative}.ad-layout-icon:before,.ad-layout-icon:after{content:"";position:absolute;border-radius:2px;background:#858e9d}.ad-layout-icon.product:before{width:11px;height:17px;right:1px;top:2px}.ad-layout-icon.product:after{width:12px;height:5px;left:0;top:5px}.ad-layout-icon.offer:before{width:20px;height:8px;left:3px;top:2px}.ad-layout-icon.offer:after{width:13px;height:6px;left:3px;bottom:2px}.ad-layout-icon.split:before{width:11px;height:21px;left:0}.ad-layout-icon.split:after{width:11px;height:21px;right:0}.ad-layout-icon.minimal:before{width:24px;height:5px;left:1px;top:3px}.ad-layout-icon.minimal:after{width:15px;height:4px;left:1px;top:12px}
.template-card.ad-template{background:#10131a}.template-card.ad-template .template-num{background:rgba(255,255,255,.88);color:#111}.performance-chip{position:absolute;left:6px;top:6px;padding:3px 5px;border-radius:5px;background:#dfff4f;color:#111;font-size:8px;font-weight:900;letter-spacing:.04em}
.empty-results{color:var(--muted);font-size:12px;grid-column:1/-1;text-align:center;padding:28px 10px}
@media(min-width:821px){
  body{height:100dvh;min-height:0}
  .studio{height:calc(100dvh - 68px);min-height:0}
  .template-panel,.workspace,.properties-panel,.properties-content{min-height:0}
  .canvas-stage{padding:10px 18px}
  .canvas-wrap{height:min(100%,660px);max-height:100%;width:auto}
  .canvas-wrap.story{height:100%;max-height:100%;width:auto}
  .canvas-wrap.wide{width:min(100%,820px);height:auto;max-height:100%}
  .canvas-wrap.ad-wide{width:min(100%,860px);height:auto;max-height:100%}
}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}
