/* Creative Studio (v1) */
.cs-studio{display:grid;grid-template-columns:minmax(300px,380px) minmax(0,1fr);gap:24px;align-items:start}
.cs-panel{display:flex;flex-direction:column;gap:12px}
.cs-step{background:#FFFFFF;border:1px solid #DCE5F7;border-radius:18px;padding:16px 18px;display:flex;flex-direction:column;gap:12px}
.cs-step h3{margin:0;display:flex;align-items:center;gap:10px;font-size:16px;color:#0A1530;letter-spacing:-.01em}
.cs-step h3 i{font-style:normal;width:24px;height:24px;border-radius:8px;display:grid;place-items:center;background:#EEF3FC;color:#1F66FF;font-size:12.5px;font-weight:800}
.cs-step h3 small{font-weight:500;color:#667190;font-size:13px}
.cs-step h3 .cs-mini,.cs-step h3 .cs-switch{margin-left:auto}
.cs-sub{margin:2px 0 -4px;font-size:12px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:#667190}
.cs-mini{background:none;border:0;padding:0;color:#1F66FF;font:inherit;font-size:13.5px;font-weight:700;cursor:pointer}
.cs-mini:hover{text-decoration:underline}

.cs-drop{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;text-align:center;padding:22px 16px;border:2px dashed #C5D4F2;border-radius:16px;background:#F7FAFF;color:#1F66FF;cursor:pointer;transition:border-color .15s,background .15s}
.cs-drop.sm{padding:14px;flex-direction:row;gap:10px}
.cs-drop input{position:absolute;inset:0;opacity:0;cursor:pointer}
.cs-drop b{color:#0A1530;font-size:14.5px;overflow:hidden;text-overflow:ellipsis;max-width:100%;white-space:nowrap}
.cs-drop small{color:#667190;font-size:12.5px;line-height:1.4}
.cs-drop:hover,.cs-drop.over{border-color:#1F66FF;background:#EEF3FC}
.cs-drop.has{border-style:solid;border-color:#1F66FF;background:#EEF3FC}
.cs-drop:focus-within{outline:3px solid rgba(31,102,255,.35);outline-offset:2px}

.cs-chips{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
.cs-chip{position:relative;cursor:pointer}
.cs-chip input,.cs-pill input,.cs-seg input{position:absolute;opacity:0;pointer-events:none}
.cs-chip span{display:flex;flex-direction:column;gap:1px;padding:8px 10px;border:1px solid #DCE5F7;border-radius:12px;background:#FFFFFF;transition:all .15s}
.cs-chip b{font-size:13.5px;color:#0A1530}
.cs-chip small{font-size:11.5px;color:#667190;line-height:1.25}
.cs-chip input:checked+span{border-color:#1F66FF;background:#EEF3FC;box-shadow:inset 0 0 0 1px #1F66FF}
.cs-chip input:checked+span b{color:#1F66FF}
.cs-chip input:focus-visible+span,.cs-pill input:focus-visible+span,.cs-seg input:focus-visible+span{outline:3px solid rgba(31,102,255,.35);outline-offset:1px}

.cs-seg{display:flex;padding:3px;border-radius:12px;background:#EEF3FC;gap:3px}
.cs-seg label{flex:1;position:relative;cursor:pointer}
.cs-seg span{display:block;text-align:center;padding:7px 8px;border-radius:9px;font-size:13.5px;font-weight:600;color:#3F4B66;transition:all .15s}
.cs-seg input:checked+span{background:#FFFFFF;color:#0A1530;box-shadow:0 1px 3px rgba(10,21,48,.12)}

.cs-field{display:flex;flex-direction:column;gap:6px;font-size:13.5px;font-weight:600;color:#0A1530}
.cs-field[hidden]{display:none}
.cs-field input[type=text]{border:1px solid #DCE5F7;border-radius:10px;padding:9px 11px;font:inherit;font-weight:500}
.cs-inline{flex-direction:row;align-items:center;justify-content:space-between}
.cs-range{display:flex;align-items:center;gap:10px}
.cs-range input{flex:1;accent-color:#1F66FF}
.cs-range output{min-width:42px;text-align:right;font-weight:700;font-size:13.5px}
.cs-color{display:inline-flex;align-items:center;gap:6px;border:1px solid #DCE5F7;border-radius:10px;padding:3px 8px 3px 3px;background:#fff}
.cs-color input{width:28px;height:28px;border:0;padding:0;background:none;border-radius:7px;cursor:pointer}
.cs-color code{font-size:12.5px;color:#3F4B66}
.cs-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.cs-check{display:flex;align-items:center;gap:8px;font-size:13.5px;color:#3F4B66;font-weight:500;cursor:pointer}
.cs-check input{width:17px;height:17px;accent-color:#1F66FF}
.cs-hint{margin:0;display:flex;gap:8px;align-items:center;font-size:13px;color:#1F66FF;background:#EEF3FC;border-radius:10px;padding:8px 10px}
.cs-note{font-weight:500;color:#667190;font-size:12.5px;line-height:1.4}

.cs-switch{position:relative;display:inline-block;width:40px;height:24px;cursor:pointer}
.cs-switch input{position:absolute;opacity:0;width:100%;height:100%;margin:0;cursor:pointer;z-index:1}
.cs-switch span{position:absolute;inset:0;border-radius:99px;background:#C5D0E6;transition:background .15s}
.cs-switch span::after{content:"";position:absolute;top:3px;left:3px;width:18px;height:18px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(10,21,48,.25);transition:transform .15s}
.cs-switch input:checked+span{background:#1F66FF}
.cs-switch input:checked+span::after{transform:translateX(16px)}
.cs-cta-body{display:flex;flex-direction:column;gap:12px;transition:opacity .15s}
.cs-cta-body.off{opacity:.4;pointer-events:none}
.cs-pills{display:flex;flex-wrap:wrap;gap:6px;max-height:132px;overflow:auto;padding:2px}
.cs-pill{position:relative;cursor:pointer}
.cs-pill span{display:inline-block;padding:6px 11px;border-radius:999px;border:1px solid #DCE5F7;font-size:13px;font-weight:600;color:#3F4B66;background:#fff;transition:all .15s}
.cs-pill input:checked+span{background:#1F66FF;border-color:#1F66FF;color:#fff}
.cs-grid9{display:grid;grid-template-columns:repeat(3,26px);grid-template-rows:repeat(3,20px);gap:4px;padding:6px;border-radius:12px;background:#EEF3FC;width:max-content}
.cs-grid9 button{border:0;border-radius:6px;background:#fff;cursor:pointer;padding:0;transition:background .15s}
.cs-grid9 button:hover{background:#C9D9FF}
.cs-grid9 button.on{background:#1F66FF}

/* work area */
.cs-work{position:sticky;top:calc(var(--header-h,72px) + 14px);display:flex;flex-direction:column;gap:14px;min-width:0}
.cs-editor{background:#0A1530;border-radius:22px;padding:12px;display:flex;flex-direction:column;gap:10px;box-shadow:0 30px 60px -36px rgba(10,21,48,.65)}
.cs-tabs{display:flex;gap:6px;overflow-x:auto;padding-bottom:2px;scrollbar-width:thin}
.cs-tabs button{flex:0 0 auto;display:flex;flex-direction:column;align-items:flex-start;gap:0;border:1px solid #24365F;background:#111F45;color:#C9D6F2;border-radius:10px;padding:6px 10px;font:inherit;cursor:pointer;transition:all .15s}
.cs-tabs b{font-size:13px;color:#FFFFFF}
.cs-tabs small{font-size:11px}
.cs-tabs button[aria-selected=true]{background:#1F66FF;border-color:#1F66FF;color:#DCE7FF}
.cs-stage{position:relative;display:flex;align-items:center;justify-content:center;min-height:360px;max-height:62vh;padding:18px;border-radius:14px;background:repeating-conic-gradient(#17264F 0 25%,#111F45 0 50%) 0 0/20px 20px;overflow:hidden}
.cs-stage canvas{display:block;max-width:100%;max-height:calc(62vh - 36px);width:auto;height:auto;touch-action:none;box-shadow:0 10px 30px rgba(0,0,0,.35);border-radius:4px;outline:none}
.cs-stage canvas:focus-visible{box-shadow:0 0 0 3px #8FB3FF}
.cs-stage canvas.is-drag{cursor:grabbing}
.cs-badge{position:absolute;right:12px;bottom:10px;font-size:11.5px;font-weight:700;color:#C9D6F2;background:rgba(10,21,48,.75);border-radius:999px;padding:3px 9px}
.cs-bar{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;padding:2px 4px}
.cs-layer{font-size:13px;color:#8FB3FF;transition:color .15s}
.cs-layer.ok{color:#5BE3A0}
.cs-bar-btns{margin-left:auto;display:flex;gap:6px;flex-wrap:wrap}
.cs-ghost{border:1px solid #24365F;background:transparent;color:#FFFFFF;border-radius:10px;padding:7px 12px;font:inherit;font-size:13.5px;font-weight:600;cursor:pointer}
.cs-ghost:hover{border-color:#8FB3FF}
.cs-primary{border:0;background:#1F66FF;color:#FFFFFF;border-radius:10px;padding:8px 14px;font:inherit;font-size:13.5px;font-weight:700;cursor:pointer;box-shadow:0 8px 20px -10px rgba(31,102,255,.9)}
.cs-primary:hover{background:#1557E6}
.cs-primary.lg{padding:11px 18px;font-size:15px;border-radius:12px}
.cs-status{display:flex;gap:10px;align-items:flex-start;border-radius:12px;padding:10px 12px;font-size:13.5px;line-height:1.45;background:#EAF8F1;color:#14532D}
.cs-status p{margin:0}
.cs-status i{flex:0 0 8px;height:8px;margin-top:6px;border-radius:50%;background:#16A34A}
.cs-status.warn{background:#FFF6E5;color:#7A4B00}.cs-status.warn i{background:#E0A100}
.cs-status.bad{background:#FDECEC;color:#8A1C14}.cs-status.bad i{background:#D92D20}
.cs-export{display:flex;align-items:center;justify-content:space-between;gap:12px;background:#FFFFFF;border:1px solid #DCE5F7;border-radius:16px;padding:12px 14px}
.cs-export b{display:block;font-size:15px;color:#0A1530}
.cs-export small{font-size:12.5px;color:#667190}
.cs-thumbs{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:10px}
.cs-thumb{position:relative;margin:0;background:#FFFFFF;border:1px solid #DCE5F7;border-radius:14px;padding:8px;display:flex;flex-direction:column;gap:6px;transition:border-color .15s,box-shadow .15s}
.cs-thumb.on{border-color:#1F66FF;box-shadow:0 0 0 2px rgba(31,102,255,.25)}
.cs-thumb-img{display:flex;align-items:center;justify-content:center;height:96px;border:0;border-radius:9px;padding:6px;cursor:pointer;background:repeating-conic-gradient(#F1F4FA 0 25%,#fff 0 50%) 0 0/14px 14px}
.cs-thumb-img img{max-width:100%;max-height:84px;width:auto;height:auto;box-shadow:0 1px 3px rgba(10,21,48,.18)}
.cs-thumb figcaption{display:flex;flex-direction:column;gap:1px;font-size:12px;color:#667190;padding-right:30px}
.cs-thumb figcaption b{font-size:13px;color:#0A1530}
.cs-thumb em{font-style:normal;font-size:11px;font-weight:700;border-radius:6px;padding:1px 6px;align-self:flex-start;margin-top:2px}
.cs-thumb em.bad{background:rgba(217,45,32,.1);color:#B42318}
.cs-thumb em.warn{background:#FFF6E5;color:#7A4B00}
.cs-icon{position:absolute;right:8px;bottom:8px;width:28px;height:28px;border-radius:8px;border:1px solid #DCE5F7;background:#fff;color:#1F66FF;display:grid;place-items:center;cursor:pointer}
.cs-icon:hover{border-color:#1F66FF;background:#EEF3FC}

@media (max-width:980px){
 .cs-studio{grid-template-columns:minmax(0,1fr)}
 .cs-work{position:static;order:-1}
 .cs-stage{min-height:240px}
}
@media (max-width:480px){.cs-chips,.cs-row{grid-template-columns:minmax(0,1fr)}.cs-bar-btns{margin-left:0}}
.cs-work.ak-out{border:0;padding:0;background:none;box-shadow:none;border-radius:0}
.cs-custom{display:flex;flex-direction:column;gap:8px;padding:12px;border:1px dashed #C5D4F2;border-radius:14px;background:#F7FAFF}
.cs-custom input{border:1px solid #DCE5F7;border-radius:10px;padding:8px 10px;font:inherit;font-weight:500;width:100%;min-width:0;background:#fff}
.cs-custom-wh{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr) auto;gap:8px;align-items:end}
.cs-custom-wh>span{padding-bottom:9px;color:#667190;font-weight:700}
.cs-custom-wh .cs-primary{height:38px}
.cs-note.err{color:#B42318}
#cs-custom-list:empty{display:none}
.cs-chip-x span{padding-right:28px}
.cs-x{position:absolute;top:6px;right:6px;width:20px;height:20px;border-radius:6px;border:0;background:#fff;color:#667190;font-size:15px;line-height:1;cursor:pointer;display:grid;place-items:center}
.cs-x:hover{background:#FDECEC;color:#B42318}
/* background remover, resize, target size (v4) */
.cs-bg-body{display:flex;flex-direction:column;gap:12px;transition:opacity .15s}
.cs-bg-body.off{opacity:.4;pointer-events:none}
.cs-bg-lead{margin:-4px 0 0}
.cs-keyrow{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.cs-key{width:34px;height:34px;border-radius:10px;border:1px solid #DCE5F7;background:repeating-conic-gradient(#F1F4FA 0 25%,#fff 0 50%) 0 0/10px 10px;flex:0 0 auto}
.cs-keytxt{display:flex;flex-direction:column;line-height:1.2;margin-right:auto}
.cs-keytxt b{font-size:13.5px;color:#0A1530}
.cs-keytxt small{font-size:11.5px;color:#667190}
.cs-ghost-l{display:inline-flex;align-items:center;gap:6px;border:1px solid #DCE5F7;background:#fff;color:#0A1530;border-radius:10px;padding:7px 10px;font:inherit;font-size:13px;font-weight:600;cursor:pointer}
.cs-ghost-l:hover{border-color:#1F66FF;color:#1F66FF}
.cs-ghost-l.on{background:#1F66FF;border-color:#1F66FF;color:#fff}
.cs-seg-wrap{flex-wrap:wrap}
.cs-seg-wrap label{flex:1 1 30%}
.cs-fill{align-items:center;padding-top:10px;border-top:1px solid #EEF3FC}
.cs-field input[type=number]{border:1px solid #DCE5F7;border-radius:10px;padding:8px 10px;font:inherit;font-weight:500}
.cs-custom .cs-check input{width:17px;height:17px;flex:0 0 auto;padding:0}
/* ===== Creative Studio v2: modes, stepper, panes, AI previews ===== */
.cs-studio{display:flex;flex-direction:column;gap:18px}
.cs-modes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:6px;background:#EEF3FC;border-radius:18px}
.cs-modes button{display:flex;align-items:center;gap:12px;padding:12px 16px;border:0;border-radius:14px;background:transparent;color:#3F4B66;font:inherit;text-align:left;cursor:pointer;transition:all .15s}
.cs-modes button span{display:flex;flex-direction:column;line-height:1.25}
.cs-modes button b{font-size:16px;color:#0A1530}
.cs-modes button small{font-size:12.5px;color:#667190}
.cs-modes button svg{flex:0 0 auto;width:36px;height:36px;padding:8px;border-radius:10px;background:#fff;color:#1F66FF}
.cs-modes button[aria-selected=true]{background:#FFFFFF;box-shadow:0 2px 10px rgba(10,21,48,.08)}
.cs-modes button[aria-selected=true] svg{background:#1F66FF;color:#fff}
.cs-mode[hidden]{display:none}
.cs-shell{display:grid;grid-template-columns:minmax(300px,390px) minmax(0,1fr);gap:22px;align-items:start}
.cs-panel{display:flex;flex-direction:column;gap:14px;background:#FFFFFF;border:1px solid #DCE5F7;border-radius:20px;padding:16px;position:sticky;top:calc(var(--header-h,72px) + 14px);max-height:calc(100vh - var(--header-h,72px) - 28px);overflow:auto}
.cs-stepper{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}
.cs-stepper button{width:100%;display:flex;flex-direction:column;align-items:flex-start;gap:4px;padding:8px;border:0;border-radius:12px;background:transparent;font:inherit;cursor:pointer;text-align:left;position:relative}
.cs-stepper button::after{content:"";position:absolute;left:8px;right:8px;bottom:0;height:3px;border-radius:3px;background:#E3EAF7}
.cs-stepper i{font-style:normal;width:24px;height:24px;border-radius:50%;display:grid;place-items:center;background:#EEF3FC;color:#667190;font-size:12.5px;font-weight:800}
.cs-stepper span{display:flex;flex-direction:column;line-height:1.2}
.cs-stepper b{font-size:13.5px;color:#3F4B66}
.cs-stepper small{font-size:11px;color:#8A93A6}
.cs-stepper button[aria-current=step] i{background:#1F66FF;color:#fff}
.cs-stepper button[aria-current=step] b{color:#0A1530}
.cs-stepper button[aria-current=step]::after{background:#1F66FF}
.cs-stepper button.done i{background:#DCE8FF;color:#1F66FF}
.cs-stepper button.done::after{background:#8FB3FF}
.cs-pane{display:flex;flex-direction:column;gap:14px}
.cs-pane[hidden]{display:none}
.cs-pane-h h3{margin:0 0 4px;font-size:19px;color:#0A1530;letter-spacing:-.01em}
.cs-pane-h p{margin:0;font-size:14px;line-height:1.5;color:#3F4B66}
.cs-nav{display:flex;align-items:center;justify-content:space-between;gap:10px;padding-top:12px;border-top:1px solid #EEF3FC;position:sticky;bottom:-16px;background:#fff;margin:0 -16px -16px;padding:12px 16px 16px;border-radius:0 0 20px 20px}
.cs-nav-i{font-size:12.5px;color:#8A93A6;font-weight:600}
.cs-nav .cs-primary{padding:10px 16px}
.cs-info{display:flex;gap:10px;align-items:center;padding:10px 12px;border-radius:12px;background:#EAF8F1;color:#14532D}
.cs-info[hidden]{display:none}
.cs-info b{display:block;font-size:13.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:260px}
.cs-info small{font-size:12px;color:#2F6B47;line-height:1.35}
.cs-info-i{flex:0 0 26px;height:26px;border-radius:50%;display:grid;place-items:center;background:#16A34A;color:#fff;font-weight:800;font-size:13px}
.cs-more{border:1px solid #DCE5F7;border-radius:14px;padding:0;background:#fff}
.cs-more summary{list-style:none;display:flex;align-items:center;gap:10px;padding:12px;cursor:pointer;color:#1F66FF}
.cs-more summary::-webkit-details-marker{display:none}
.cs-more summary span{display:flex;flex-direction:column;margin-right:auto;line-height:1.25}
.cs-more summary b{color:#0A1530;font-size:14px}
.cs-more summary small{color:#667190;font-size:12px}
.cs-more[open] summary{border-bottom:1px solid #EEF3FC}
.cs-more>.cs-bg-body,.cs-more>.cs-fill{margin:12px}
.cs-sizes-h{display:flex;justify-content:space-between;align-items:center;padding-top:6px;border-top:1px solid #EEF3FC}
.cs-sizes-h b{font-size:14.5px;color:#0A1530}
.cs-card{border:1px solid #DCE5F7;border-radius:16px;padding:14px;display:flex;flex-direction:column;gap:12px}
.cs-card-h{display:flex;align-items:center;gap:8px}
.cs-card-h b{font-size:15px;color:#0A1530;margin-right:auto}
.cs-card-h small{color:#667190;font-size:12.5px;margin-right:auto}
.cs-block{width:100%;justify-content:center;text-align:center}
.cs-ghost-l.cs-block{display:flex}
.cs-ghost-l.sm{padding:5px 9px;font-size:12.5px}
.cs-filelist table{width:100%;border-collapse:collapse;font-size:12.5px}
.cs-filelist th{text-align:left;color:#667190;font-weight:600;padding:6px 4px;border-bottom:1px solid #EEF3FC}
.cs-filelist td{padding:6px 4px;border-bottom:1px solid #F3F6FB;color:#0A1530;word-break:break-all}
.cs-filelist td.ok{color:#15803D;font-weight:600;word-break:normal}
.cs-filelist td.bad{color:#B42318;font-weight:700;word-break:normal}
.cs-thumb em.okc{background:#EAF8F1;color:#15803D}
.cs-field textarea{border:1px solid #DCE5F7;border-radius:10px;padding:9px 11px;font:inherit;font-weight:500;resize:vertical}
.cs-count{float:right;font-weight:500;font-size:11.5px;color:#8A93A6}
.cs-limits{display:flex;flex-direction:column;gap:4px}
.cs-limits span{font-size:12.5px;font-weight:600;border-radius:8px;padding:5px 9px}
.cs-limits .ok{background:#EAF8F1;color:#15803D}.cs-limits .warn{background:#FFF6E5;color:#7A4B00}.cs-limits .bad{background:#FDECEC;color:#B42318}
.cs-chips-3{grid-template-columns:repeat(2,minmax(0,1fr))}
.cs-ai-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.cs-ai-card{margin:0;background:#FFFFFF;border:1px solid #DCE5F7;border-radius:18px;padding:12px;display:flex;flex-direction:column;gap:10px}
.cs-ai-h{display:flex;justify-content:space-between;align-items:center;gap:8px}
.cs-ai-h b{font-size:15px;color:#0A1530}
.cs-ai-c{display:block;width:100%;height:auto;border-radius:12px;border:1px solid #EEF3FC}
.cs-ai-card figcaption{font-size:12.5px;line-height:1.45;color:#667190}
.cs-work{position:sticky;top:calc(var(--header-h,72px) + 14px)}
@media (max-width:980px){
 .cs-shell{grid-template-columns:minmax(0,1fr)}
 .cs-panel{position:static;max-height:none;overflow:visible}
 .cs-nav{position:static;margin:0;padding:12px 0 0;border-radius:0}
 .cs-work{position:static;order:-1}
 .cs-ai-grid{grid-template-columns:minmax(0,1fr)}
}
@media (max-width:520px){.cs-stepper small{display:none}.cs-modes button small{display:none}.cs-modes button{padding:10px}}
