/* ===== الاستوديو: واجهة فاتحة بلمسة ذهبي ===== */
:root{
  --bg:#f7f5f0; --surface:#fff; --surface2:#fbfaf7; --ink:#1b1915; --ink2:#3b362e; --muted:#6f685d; --dim:#a39b8e;
  --line:#ebe6dc; --line2:#ddd5c6;
  --gold:#c39a4f; --gold2:#e2c48a; --gold-ink:#8a6420; --gold-soft:#f6eedd; --gold-rgb:195,154,79;
  --danger:#b4412f; --ok:#2f7d4f;
  --r:16px; --r-sm:12px; --ease:cubic-bezier(.2,.75,.15,1);
  --shadow:0 1px 2px rgba(40,30,10,.05),0 8px 24px -12px rgba(40,30,10,.14);
  --shadow-lg:0 24px 60px -20px rgba(40,30,10,.35);
  --head:"Alexandria","IBM Plex Sans Arabic",system-ui,sans-serif;
  --body:"IBM Plex Sans Arabic","Alexandria",system-ui,sans-serif;
  --safe-b:env(safe-area-inset-bottom,0px);
  color-scheme:light;
}
*{box-sizing:border-box;margin:0;padding:0}
html{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}
body{background:var(--bg);color:var(--ink);font-family:var(--body);font-size:16px;line-height:1.7;-webkit-font-smoothing:antialiased;min-height:100dvh}
body.has-bar{padding-bottom:calc(96px + var(--safe-b))}
button{font:inherit;color:inherit;background:none;border:0;cursor:pointer}
input,select{font:inherit;color:inherit}
svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none}
h1,h2,h3{font-family:var(--head);line-height:1.35;font-weight:700}
:focus-visible{outline:2px solid var(--gold);outline-offset:2px;border-radius:10px}
[hidden]{display:none!important}
.muted{color:var(--muted)} .small{font-size:14px}
.gold{background:linear-gradient(100deg,#9c7330,var(--gold) 40%,#d9b46a 60%,#a97d35);-webkit-background-clip:text;background-clip:text;color:transparent}

/* ===== الهيدر ===== */
.top{position:sticky;top:0;z-index:20;background:rgba(247,245,240,.86);backdrop-filter:saturate(1.4) blur(14px);-webkit-backdrop-filter:saturate(1.4) blur(14px);border-bottom:1px solid transparent;transition:border-color .2s}
.top.scrolled{border-color:var(--line)}
.top-in{max-width:1180px;margin:0 auto;padding:10px 16px;display:flex;align-items:center;justify-content:space-between;gap:12px}
.brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:inherit;min-width:0}
.brand-mark{width:38px;height:38px;display:block;flex:none}
.brand-mark img{width:100%;height:100%;display:block}
.brand-txt{display:flex;flex-direction:column;line-height:1.25;min-width:0}
.brand-txt b{font-family:var(--head);font-size:17px}
.brand a{text-decoration:none}
.brand-txt a{color:inherit}
.brand-txt .by{color:var(--muted);font-size:12.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:color .2s}
.brand-txt .by:hover{color:var(--gold2)}
.icon-btn{width:42px;height:42px;border-radius:12px;display:grid;place-items:center;color:var(--ink2);transition:background .15s}
.icon-btn:hover{background:rgba(0,0,0,.05)}

/* ===== أزرار ===== */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:48px;padding:0 18px;border-radius:14px;font-weight:600;font-size:15.5px;white-space:nowrap;transition:transform .12s var(--ease),box-shadow .2s,background .2s,opacity .2s;user-select:none}
.btn:active{transform:scale(.97)}
.btn:disabled{opacity:.45;pointer-events:none}
.btn-gold{background:linear-gradient(180deg,#dcb76c,#c39a4f);color:#20180a;box-shadow:inset 0 1px 0 rgba(255,255,255,.45),0 6px 16px -6px rgba(var(--gold-rgb),.75)}
.btn-gold:hover{box-shadow:inset 0 1px 0 rgba(255,255,255,.45),0 10px 22px -8px rgba(var(--gold-rgb),.9)}
.btn-ghost{background:var(--surface);border:1px solid var(--line2);color:var(--ink)}
.btn-ghost:hover{border-color:var(--gold)}
.btn-danger{color:var(--danger)}
.btn-lg{min-height:54px;font-size:16.5px;padding:0 22px}
.btn-square{width:50px;padding:0;flex:none}
.grow{flex:1}
.link-btn{display:inline-flex;align-items:center;gap:6px;color:var(--gold-ink);font-weight:600;font-size:14.5px;padding:8px 4px;border-radius:10px}
.link-btn svg{width:18px;height:18px}

/* ===== البداية ===== */
.hero{padding:22px 16px 40px}
.hero-in{max-width:640px;margin:0 auto;text-align:center}
.pill{display:inline-flex;align-items:center;gap:6px;font-size:12.5px;color:var(--gold-ink);background:var(--gold-soft);border:1px solid rgba(var(--gold-rgb),.3);padding:5px 12px;border-radius:99px;margin-bottom:18px}
.pill svg{width:14px;height:14px}
.hero h1{font-size:clamp(30px,8vw,46px);margin-bottom:12px;letter-spacing:-.01em}
.lead{color:var(--muted);font-size:16.5px;max-width:520px;margin:0 auto 24px}
.drop{display:flex;flex-direction:column;align-items:center;gap:4px;padding:30px 20px;border-radius:22px;border:1.5px dashed rgba(var(--gold-rgb),.6);background:linear-gradient(180deg,#fff,var(--surface2));cursor:pointer;transition:border-color .2s,background .2s,transform .2s var(--ease);box-shadow:var(--shadow)}
.drop:hover{border-color:var(--gold);background:#fff}
.drop:active{transform:scale(.99)}
.drop-ic{width:62px;height:62px;border-radius:18px;display:grid;place-items:center;background:var(--gold-soft);color:var(--gold-ink);margin-bottom:8px}
.drop-ic svg{width:30px;height:30px}
.drop b{font-family:var(--head);font-size:18px}
.drop .muted{font-size:14px}
.drop .btn{margin-top:14px;pointer-events:none;min-width:220px}
.hero-actions .btn{width:100%}
.hero-actions{margin-top:10px}
.steps{list-style:none;display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:28px}
.steps li{display:flex;flex-direction:column;align-items:center;text-align:center;gap:8px;padding:14px 8px;background:var(--surface);border:1px solid var(--line);border-radius:var(--r)}
.steps li>span{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;background:var(--ink);color:var(--gold2);font-family:var(--head);font-weight:700;flex:none}
.steps b{display:block;font-size:13.5px;line-height:1.45}
.steps small{color:var(--muted);font-size:12px;display:block;line-height:1.4;margin-top:2px}
@media (min-width:720px){
  .hero{padding:56px 24px 64px}
  .drop{padding:46px 20px}
  .steps li{padding:18px 12px}
  .steps b{font-size:15px}
}

/* ===== مساحة الشغل ===== */
.work{max-width:1180px;margin:0 auto;padding:12px 16px 24px}
.banner{background:var(--ink);color:#fff;border-radius:var(--r);padding:14px 16px 12px;margin-bottom:14px;box-shadow:var(--shadow)}
.banner-row{display:flex;align-items:center;gap:12px}
.banner-txt{flex:1;display:flex;flex-direction:column;line-height:1.4}
.banner-txt small{color:#cfc6b6;font-size:13px}
.banner-pct{font-family:var(--head);color:var(--gold2);font-variant-numeric:tabular-nums}
.banner .meter{margin-top:10px;background:rgba(255,255,255,.14)}
.spinner{width:22px;height:22px;border-radius:50%;border:2.5px solid rgba(255,255,255,.2);border-top-color:var(--gold2);animation:spin .8s linear infinite;flex:none}
@keyframes spin{to{transform:rotate(360deg)}}
.meter{height:6px;border-radius:99px;background:var(--line);overflow:hidden}
.meter i{display:block;height:100%;width:0;border-radius:inherit;background:linear-gradient(90deg,#c39a4f,#e8cf98);transition:width .3s var(--ease)}
html[dir="rtl"] .meter i{margin-inline-start:0}

/* لوحة الشكل */
.panel{background:var(--surface);border:1px solid var(--line);border-radius:20px;box-shadow:var(--shadow);margin-bottom:22px;overflow:hidden}
.panel-head{width:100%;display:flex;align-items:center;gap:12px;padding:14px 16px;text-align:start}
.panel-ic{width:40px;height:40px;border-radius:12px;display:grid;place-items:center;background:var(--gold-soft);color:var(--gold-ink);flex:none}
.panel-title{flex:1;display:flex;flex-direction:column;line-height:1.35;min-width:0}
.panel-title b{font-family:var(--head);font-size:16px}
.panel-title small{color:var(--muted);font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chev{color:var(--dim);transition:transform .25s var(--ease)}
.panel-head[aria-expanded="true"] .chev{transform:rotate(180deg)}
.panel-body{padding:4px 16px 18px;display:grid;gap:18px;border-top:1px solid var(--line);padding-top:16px}
.panel-head[aria-expanded="false"]+.panel-body{display:none}
@media (min-width:900px){
  .panel-body{grid-template-columns:1fr 1fr;column-gap:32px}
  .toggles,.wm-opts{grid-column:span 1}
}

.field{display:grid;gap:8px}
.label{font-weight:600;font-size:14.5px;color:var(--ink2)}
.label .opt,.opt{font-weight:400;color:var(--dim);font-size:12.5px;margin-inline-start:4px}
.label-row{display:flex;align-items:center;justify-content:space-between;gap:8px}
.label-row output{font-size:13px;color:var(--gold-ink);font-weight:600;font-variant-numeric:tabular-nums}
.range-hints{display:flex;justify-content:space-between;margin-top:-6px}
.range-hints small{color:var(--dim);font-size:12px}

.seg{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;gap:4px;padding:4px;background:#f1ede5;border-radius:14px}
.seg button{min-height:44px;border-radius:10px;font-weight:600;font-size:14.5px;color:var(--muted);display:flex;align-items:center;justify-content:center;gap:8px;transition:background .2s,color .2s,box-shadow .2s}
.seg button small{font-weight:400;font-size:12px;color:var(--dim)}
.seg button[aria-checked="true"]{background:#fff;color:var(--ink);box-shadow:0 1px 3px rgba(0,0,0,.08),0 0 0 1px rgba(var(--gold-rgb),.35)}
.seg-sm button{min-height:34px;font-size:13.5px;padding:0 14px}
.ratio{display:inline-block;border:1.6px solid currentColor;border-radius:3px}
.ratio.r11{width:14px;height:14px}.ratio.r45{width:13px;height:16px}

input[type=range]{-webkit-appearance:none;appearance:none;width:100%;height:28px;background:transparent}
input[type=range]::-webkit-slider-runnable-track{height:6px;border-radius:99px;background:linear-gradient(to left,var(--gold) var(--p,50%),var(--line) var(--p,50%))}
input[type=range]::-moz-range-track{height:6px;border-radius:99px;background:var(--line)}
input[type=range]::-moz-range-progress{height:6px;border-radius:99px;background:var(--gold)}
input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:24px;height:24px;border-radius:50%;background:#fff;border:2px solid var(--gold);margin-top:-9px;box-shadow:0 2px 6px rgba(0,0,0,.15)}
input[type=range]::-moz-range-thumb{width:20px;height:20px;border-radius:50%;background:#fff;border:2px solid var(--gold);box-shadow:0 2px 6px rgba(0,0,0,.15)}

.toggles{display:grid;gap:2px;margin:0 -6px}
.tg{display:flex;align-items:center;gap:12px;padding:10px 6px;border-radius:12px;cursor:pointer}
.tg:hover{background:var(--surface2)}
.tg input{position:absolute;opacity:0;pointer-events:none}
.tg>span:last-child{display:flex;flex-direction:column;line-height:1.35}
.tg b{font-size:15px;font-weight:600}
.tg small{color:var(--muted);font-size:12.5px}
.sw{width:46px;height:28px;border-radius:99px;background:#ddd6c9;position:relative;flex:none;transition:background .2s}
.sw::after{content:"";position:absolute;top:3px;inset-inline-start:3px;width:22px;height:22px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.25);transition:transform .22s var(--ease)}
.tg input:checked+.sw{background:var(--gold)}
.tg input:checked+.sw::after{transform:translateX(-18px)}
html[dir="ltr"] .tg input:checked+.sw::after{transform:translateX(18px)}
.tg input:focus-visible+.sw{outline:2px solid var(--gold);outline-offset:2px}

.wm-opts{display:grid;gap:16px;padding:14px;border-radius:14px;background:var(--surface2);border:1px solid var(--line)}
.wm-opts.off{display:none}
.wm-logo{display:flex;align-items:center;gap:12px}
.wm-logo .thumb{width:52px;height:52px;border-radius:12px;border:1px solid var(--line);background:#fff center/contain no-repeat;flex:none}
.wm-logo .txt{flex:1;font-size:13.5px;color:var(--muted);line-height:1.45}
.wm-logo .txt b{display:block;color:var(--ink);font-size:14.5px}
.corners{display:grid;grid-template-columns:1fr 1fr;gap:6px;width:112px;height:112px;padding:6px;border-radius:14px;border:1px solid var(--line2);background:#fff}
.corners button{border-radius:8px;background:#f3efe7;position:relative}
.corners button::after{content:"";position:absolute;width:14px;height:14px;border-radius:4px;background:var(--dim);opacity:.35}
.corners [data-v="tr"]::after{top:6px;right:6px}.corners [data-v="tl"]::after{top:6px;left:6px}
.corners [data-v="br"]::after{bottom:6px;right:6px}.corners [data-v="bl"]::after{bottom:6px;left:6px}
.corners button[aria-checked="true"]{background:var(--gold-soft);box-shadow:inset 0 0 0 1.5px var(--gold)}
.corners button[aria-checked="true"]::after{background:var(--gold);opacity:1}

/* ===== الشبكة ===== */
.grid-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 2px 12px}
.grid-head h2{font-size:19px}
.count{color:var(--dim);font-weight:500;font-size:15px}
.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
@media (min-width:640px){.grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}}
@media (min-width:1000px){.grid{grid-template-columns:repeat(4,minmax(0,1fr))}}

.card{background:var(--surface);border:1px solid var(--line);border-radius:18px;overflow:hidden;box-shadow:var(--shadow);display:flex;flex-direction:column;animation:pop .35s var(--ease) both}
@keyframes pop{from{opacity:0;transform:translateY(8px) scale(.98)}}
.card-media{position:relative;background:#fff;cursor:pointer;display:block;width:100%;border-bottom:1px solid var(--line)}
.card-media canvas,.card-media img{display:block;width:100%;height:100%;object-fit:contain;background:#fff}
.card-media .orig{object-fit:cover;filter:saturate(.9)}
.card[data-status="queued"] .card-media .orig,.card[data-status="working"] .card-media .orig{opacity:.55}
.shimmer{position:absolute;inset:0;background:linear-gradient(110deg,transparent 30%,rgba(255,255,255,.65) 50%,transparent 70%);background-size:220% 100%;animation:sh 1.4s linear infinite}
@keyframes sh{from{background-position:120% 0}to{background-position:-120% 0}}
.status-chip{position:absolute;inset-inline:8px;bottom:8px;display:flex;align-items:center;gap:8px;padding:7px 10px;border-radius:10px;background:rgba(27,25,21,.82);color:#fff;font-size:12.5px;font-weight:500;backdrop-filter:blur(6px)}
.status-chip .spinner{width:14px;height:14px;border-width:2px}
.status-chip.err{background:rgba(180,65,47,.92)}
.status-chip.err button{margin-inline-start:auto;display:inline-flex;align-items:center;gap:4px;background:rgba(255,255,255,.18);padding:3px 8px;border-radius:8px;font-size:12px}
.status-chip.err button svg{width:14px;height:14px}
.done-tick{position:absolute;top:8px;inset-inline-start:8px;width:24px;height:24px;border-radius:50%;background:var(--ok);color:#fff;display:grid;place-items:center;animation:pop .3s var(--ease)}
.done-tick svg{width:14px;height:14px;stroke-width:2.6}
.card-body{padding:10px 10px 8px;display:flex;flex-direction:column;gap:6px;flex:1}
.card-name{font-weight:600;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.card-name.empty{color:var(--dim);font-weight:500}
.card-meta{display:flex;align-items:center;gap:6px;min-height:22px;flex-wrap:wrap}
.tag{font-size:12px;padding:1px 8px;border-radius:99px;background:var(--gold-soft);color:var(--gold-ink);font-weight:500}
.tag.warn{background:#fbefe6;color:#a2582a}
.dots{display:flex;gap:0}
.dots i{width:14px;height:14px;border-radius:50%;border:1.5px solid #fff;box-shadow:0 0 0 1px rgba(0,0,0,.12);margin-inline-start:-4px}
.dots i:first-child{margin-inline-start:0}
.dots em{font-style:normal;font-size:11.5px;color:var(--muted);margin-inline-start:4px}
.card-actions{display:flex;gap:4px;margin-top:auto;padding-top:4px}
.card-actions button{flex:1;height:38px;border-radius:10px;display:grid;place-items:center;color:var(--ink2);background:var(--surface2);border:1px solid var(--line)}
.card-actions button:hover{border-color:var(--gold);color:var(--gold-ink)}
.card-actions button:disabled{opacity:.4;pointer-events:none}
.card-actions svg{width:18px;height:18px}
.card-actions .primary{flex:2;font-size:13.5px;font-weight:600;display:flex;gap:6px;align-items:center;justify-content:center}

/* ===== المستوى التاني ===== */
.ai{margin-top:28px;border-radius:20px;padding:18px 16px;background:linear-gradient(150deg,#221e17,#14120e);color:#f3ede2;position:relative;overflow:hidden}
.ai::before{content:"";position:absolute;width:280px;height:280px;border-radius:50%;background:rgba(var(--gold-rgb),.22);filter:blur(70px);top:-140px;inset-inline-start:-60px}
.ai-head{display:flex;align-items:center;gap:12px;position:relative}
.ai-head>div{flex:1;display:flex;flex-direction:column;line-height:1.4}
.ai-head b{font-family:var(--head);font-size:16px}
.ai-head small{color:#bdb3a2;font-size:13px}
.ai-ic{width:42px;height:42px;border-radius:12px;display:grid;place-items:center;background:rgba(var(--gold-rgb),.16);color:var(--gold2);flex:none}
.badge{font-size:12px;font-weight:600;padding:3px 10px;border-radius:99px;background:rgba(var(--gold-rgb),.2);color:var(--gold2);border:1px solid rgba(var(--gold-rgb),.35)}
.badge.on{background:rgba(47,125,79,.25);color:#9be2b6;border-color:rgba(47,125,79,.5)}
.ai-list{list-style:none;display:grid;gap:8px;margin-top:14px;position:relative}
.ai-list li{display:flex;flex-direction:column;padding:10px 12px;border-radius:12px;background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.07);line-height:1.5}
.ai-list b{font-size:14px;color:#fff}
.ai-list span{font-size:13px;color:#bdb3a2}
@media (min-width:720px){.ai-list{grid-template-columns:repeat(3,1fr)}}
.ai-how{margin-top:12px;font-size:13px;color:#bdb3a2;line-height:1.6;position:relative}
.ai-opt{display:flex;align-items:center;gap:8px;font-size:13.5px;color:#e9e1d2;cursor:pointer}
.ai-opt input{width:18px;height:18px;accent-color:var(--gold)}
.ai-gen textarea{font-size:12px;min-height:90px}

/* ===== الشريط اللي تحت ===== */
.bar{position:fixed;inset-inline:0;bottom:0;z-index:30;padding:10px 12px calc(10px + var(--safe-b));background:rgba(255,255,255,.92);backdrop-filter:saturate(1.4) blur(16px);-webkit-backdrop-filter:saturate(1.4) blur(16px);border-top:1px solid var(--line);box-shadow:0 -10px 30px -18px rgba(40,30,10,.3);animation:up .35s var(--ease)}
@keyframes up{from{transform:translateY(100%)}}
.bar-in{max-width:760px;margin:0 auto;display:flex;align-items:center;gap:8px}
.bar-status{flex:1;min-width:0;display:flex;flex-direction:column;gap:6px;padding-inline:4px}
.bar-txt{display:flex;align-items:baseline;gap:8px;line-height:1.3;min-width:0}
.bar-txt b{font-size:14.5px;white-space:nowrap}
.bar-txt small{color:var(--muted);font-size:12.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bar.busy #dlAll{flex:none;padding:0 14px}
.bar.busy #dlAll span{display:none}

/* ===== الشيتات ===== */
.sheet{border:0;padding:0;background:transparent;max-width:none;max-height:none;width:100%;height:100%;margin:0;color:inherit;overflow:hidden}
.sheet::backdrop{background:rgba(20,16,10,.45);backdrop-filter:blur(2px)}
.sheet[open]{display:flex;align-items:flex-end;justify-content:center}
.sheet-in{width:100%;max-width:560px;max-height:92dvh;background:var(--surface);border-radius:24px 24px 0 0;display:flex;flex-direction:column;box-shadow:var(--shadow-lg);animation:sheetUp .32s var(--ease)}
@keyframes sheetUp{from{transform:translateY(40px);opacity:0}}
.grip{width:40px;height:5px;border-radius:99px;background:var(--line2);margin:8px auto 0;flex:none}
.sheet-head{display:flex;align-items:center;justify-content:space-between;padding:8px 12px 6px 8px;padding-inline-start:18px;flex:none}
.sheet-head h3{font-size:17px}
.sheet-body{overflow-y:auto;overscroll-behavior:contain;padding:6px 18px 18px;display:flex;flex-direction:column;gap:18px;flex:1 1 auto;min-height:0}
.sheet-body>*{flex:none}
.sheet-foot{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 16px calc(12px + var(--safe-b));border-top:1px solid var(--line);flex:none;flex-wrap:wrap}
.sheet-foot .btn-gold:not(.grow){min-width:120px}
@media (min-width:720px){
  .sheet[open]{align-items:center}
  .sheet-in{border-radius:24px;max-height:88dvh}
  .grip{display:none}
  .sheet-head{padding-top:14px}
}

.ed-preview{position:relative;border-radius:16px;overflow:hidden;border:1px solid var(--line);background:#fff}
.ed-stage{position:relative}
.ed-stage{display:grid;place-items:center;background:#fff}
.ed-stage canvas,.ed-stage img{display:block;max-width:100%;max-height:46dvh;width:auto;height:auto;object-fit:contain}
.ed-stage .checker{background-color:#fff;background-image:linear-gradient(45deg,#eee 25%,transparent 25%),linear-gradient(-45deg,#eee 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#eee 75%),linear-gradient(-45deg,transparent 75%,#eee 75%);background-size:20px 20px;background-position:0 0,0 10px,10px -10px,-10px 0}
.ed-stage .placeholder{aspect-ratio:1;display:grid;place-items:center;color:var(--muted);font-size:14px;gap:8px;align-content:center}
.ed-ba{position:absolute;z-index:2;bottom:10px;inset-inline-end:10px;background:rgba(241,237,229,.92);backdrop-filter:blur(6px)}

.chips{display:flex;flex-wrap:wrap;gap:8px}
.chip{min-height:40px;padding:0 14px;border-radius:12px;border:1px solid var(--line2);background:#fff;font-size:14.5px;font-weight:500;display:inline-flex;align-items:center;gap:6px;transition:background .15s,border-color .15s,color .15s}
.chip:hover{border-color:var(--gold)}
.chip[aria-checked="true"],.chip[aria-pressed="true"]{background:var(--ink);border-color:var(--ink);color:#fff}
.sizes{display:flex;flex-wrap:wrap;gap:8px}
.schip{min-width:52px;height:44px;padding:0 14px;border-radius:12px;border:1px solid var(--line);background:#fff;font-family:var(--head);font-weight:600;font-size:14px;color:inherit;cursor:pointer;transition:border-color .15s,background .15s}
.schip[aria-pressed=true]{border-color:var(--gold);background:var(--gold-soft);box-shadow:inset 0 0 0 1px var(--gold)}
.schip.add{color:var(--gold-ink);border-style:dashed}
.sizes .custom-row{flex-basis:100%}
.colors{display:grid;grid-template-columns:repeat(auto-fill,minmax(76px,1fr));gap:8px}
.cchip{display:flex;flex-direction:column;align-items:center;gap:5px;padding:9px 4px 7px;border-radius:12px;border:1px solid var(--line);background:#fff;font-size:12.5px;font-weight:500;position:relative;transition:border-color .15s,background .15s}
.cchip i{width:28px;height:28px;border-radius:50%;box-shadow:inset 0 0 0 1px rgba(0,0,0,.14);position:relative}
.cchip[aria-pressed="true"]{border-color:var(--gold);background:var(--gold-soft);box-shadow:0 0 0 1px var(--gold)}
.cchip[aria-pressed="true"] i::after{content:"";position:absolute;inset:0;margin:auto;width:12px;height:7px;border-left:2.4px solid var(--ck,#fff);border-bottom:2.4px solid var(--ck,#fff);transform:translateY(-2px) rotate(-45deg)}
.cchip .rm{position:absolute;top:2px;inset-inline-end:2px;width:20px;height:20px;border-radius:50%;display:grid;place-items:center;color:var(--dim)}
.cchip .rm svg{width:12px;height:12px}
.cchip.add{border-style:dashed;color:var(--gold-ink);justify-content:center}
.cchip.add i{display:grid;place-items:center;background:var(--gold-soft);box-shadow:none}
.cchip.add i svg{width:16px;height:16px}
.custom-row{grid-column:1/-1;display:flex;gap:8px;align-items:center;padding:10px;border-radius:14px;background:var(--surface2);border:1px solid var(--line)}
.custom-row input[type=color]{width:46px;height:46px;border:0;border-radius:12px;padding:0;background:none;flex:none;cursor:pointer}
.custom-row input[type=color]::-webkit-color-swatch-wrapper{padding:0}
.custom-row input[type=color]::-webkit-color-swatch{border:1px solid var(--line2);border-radius:12px}
.custom-row .input{flex:1;min-width:0}
.custom-row .btn{min-height:46px;padding:0 14px}

.input{width:100%;min-height:48px;padding:0 14px;border-radius:12px;border:1px solid var(--line2);background:#fff;font-size:16px;transition:border-color .15s,box-shadow .15s}
.input:focus{outline:none;border-color:var(--gold);box-shadow:0 0 0 3px rgba(var(--gold-rgb),.18)}
.input.ltr{direction:ltr;text-align:left}
.ed-actions{display:grid;grid-template-columns:repeat(auto-fit,minmax(90px,1fr));gap:8px}
.ed-actions .btn{min-height:44px;font-size:14.5px}
.ed-actions #edCut{grid-column:1/-1;order:5}
.ed-actions #edDl{grid-column:1/-1;height:auto;min-height:56px;padding:8px 14px;white-space:normal}
.ed-actions .two{display:flex;flex-direction:column;align-items:flex-start;line-height:1.35;text-align:start}
.ed-actions .two small{font-weight:500;font-size:12.5px;color:var(--muted)}
.ed-actions #edCut{white-space:normal;height:auto;padding:8px 14px}
.ai-dl{display:flex;gap:8px}
.ai-dl .btn{flex:1}
.ai-dl .btn-square{flex:none}

.logo-box{display:flex;align-items:center;gap:12px;padding:12px;border-radius:14px;border:1px dashed var(--line2);background:var(--surface2)}
.logo-box .thumb{width:64px;height:64px;border-radius:14px;background:#fff center/contain no-repeat;border:1px solid var(--line);flex:none;display:grid;place-items:center;color:var(--dim)}
.logo-box .acts{display:flex;gap:8px;flex-wrap:wrap}
.logo-box .btn{min-height:40px;font-size:14px;padding:0 12px}
.adv summary{cursor:pointer;color:var(--gold-ink);font-weight:600;font-size:14.5px;padding:6px 0;list-style:none}
.adv summary::-webkit-details-marker{display:none}
.adv[open]{display:grid;gap:14px}

.ai-gen{display:grid;gap:10px;padding:14px;border-radius:16px;background:linear-gradient(150deg,#221e17,#14120e);color:#f3ede2}
.ai-gen b{font-family:var(--head);font-size:15px}
.ai-gen small{color:#bdb3a2;font-size:12.5px;line-height:1.5}
.ai-gen select{min-height:44px;border-radius:12px;padding:0 10px;background:#2c271f;color:#fff;border:1px solid #4a4235}
.ai-gen .row{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.ai-gen .row>*{flex:1 1 0;min-width:0}
.ai-gen .row select{flex-basis:100%}
.ai-outs{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.ai-outs a{display:block;border-radius:10px;overflow:hidden;background:#fff;aspect-ratio:1}
.ai-outs img{width:100%;height:100%;object-fit:contain}

/* ===== رسائل ===== */
.toasts{position:fixed;inset-inline:0;top:calc(12px + env(safe-area-inset-top,0px));z-index:60;display:flex;flex-direction:column;align-items:center;gap:8px;pointer-events:none;padding:0 16px}
.toast{background:var(--ink);color:#fff;padding:10px 16px;border-radius:14px;font-size:14.5px;box-shadow:var(--shadow-lg);display:flex;align-items:center;gap:8px;animation:tin .3s var(--ease);max-width:520px}
.toast svg{color:var(--gold2);width:18px;height:18px}
.toast.err svg{color:#ffb4a6}
.toast.out{opacity:0;transform:translateY(-8px);transition:.25s}
@keyframes tin{from{opacity:0;transform:translateY(-10px)}}

.dropcover{position:fixed;inset:0;z-index:70;background:rgba(247,245,240,.88);backdrop-filter:blur(4px);display:none;place-items:center;pointer-events:none}
.dropcover.on{display:grid}
.dropcover div{display:flex;flex-direction:column;align-items:center;gap:10px;padding:40px 60px;border:2px dashed var(--gold);border-radius:24px;color:var(--gold-ink);background:#fff}
.dropcover svg{width:40px;height:40px}
.dropcover b{font-family:var(--head);font-size:20px}

@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important}}
