/* درصد | Darsad — shared design system (Mirza theme) */
:root{
  --bg:#EDF1F6; --surface:#FFFFFF; --surface-2:#F4F6FA; --surface-3:#E9EEF5; --fg:#0F1722; --muted:#667386; --line:#E0E6EE;
  --accent:#2481CC; --accent-2:#1B6FB3; --accent-soft:#E3EFFA; --accent-fg:#FFFFFF;
  --ok:#1F9D57; --ok-soft:#E1F4EA; --warn:#B87810; --warn-soft:#FBF0DC; --bad:#D9443C; --bad-soft:#FBE5E3;
  --violet:#7A5AF8; --violet-soft:#EEEAFE; --teal:#0E9F8E; --teal-soft:#DFF5F1;
  --shadow:0 1px 2px rgba(16,30,54,.06),0 4px 14px rgba(16,30,54,.05);
  --shadow-lg:0 10px 40px rgba(16,30,54,.16);
  --r:18px; --r-sm:12px;
  --font:"Vazirmatn",Tahoma,"Segoe UI",sans-serif;
  --side:256px;
  color-scheme:light;
}
:root[data-theme="dark"]{
  --bg:#0E1621; --surface:#17212B; --surface-2:#1E2A36; --surface-3:#243242; --fg:#E8EDF3; --muted:#8495A8; --line:#253241;
  --accent:#4EA4F6; --accent-2:#6CB5F8; --accent-soft:#1B3349; --accent-fg:#0E1621;
  --ok:#3FCB7E; --ok-soft:#173327; --warn:#F0B451; --warn-soft:#3A2D16; --bad:#F06A61; --bad-soft:#3B1D1C;
  --violet:#A48BFA; --violet-soft:#2A2448; --teal:#38C9B6; --teal-soft:#13332F;
  --shadow:0 1px 2px rgba(0,0,0,.3); --shadow-lg:0 12px 40px rgba(0,0,0,.5);
  color-scheme:dark;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
html,body{margin:0;background:var(--bg);color:var(--fg);font-family:var(--font);font-size:14px;line-height:1.65;direction:rtl}
body{min-height:100vh;-webkit-tap-highlight-color:transparent}
button,input,textarea,select{font:inherit;color:inherit}
button{cursor:pointer}
a{color:var(--accent);text-decoration:none}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
svg{flex:none}
.ltr{direction:ltr;text-align:left;unicode-bidi:plaintext}
.mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12.5px}
.num{font-variant-numeric:tabular-nums}
.muted{color:var(--muted)} .s{font-size:12px} .xs{font-size:11px} .b{font-weight:700} .xb{font-weight:800}
.ok-t{color:var(--ok)} .bad-t{color:var(--bad)} .warn-t{color:var(--warn)} .acc-t{color:var(--accent)}
.hide{display:none!important}
.grow{flex:1;min-width:0}
.row{display:flex;align-items:center;gap:10px}
.row.wrap{flex-wrap:wrap}
.between{display:flex;align-items:center;justify-content:space-between;gap:10px}
.stack{display:flex;flex-direction:column;gap:12px}
.stack.lg{gap:18px}
.grid{display:grid;gap:12px}
.grid>*{min-width:0}
.g2{grid-template-columns:repeat(2,minmax(0,1fr))} .g3{grid-template-columns:repeat(3,minmax(0,1fr))} .g4{grid-template-columns:repeat(4,minmax(0,1fr))}
.ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sep{height:1px;background:var(--line);margin:4px 0}

/* ------------------------------------------------------------ shell */
.shell{display:flex;min-height:100vh}
.side{position:fixed;inset-block:0;inset-inline-start:0;width:var(--side);background:var(--surface);border-inline-end:1px solid var(--line);display:flex;flex-direction:column;z-index:30;transition:transform .25s ease}
.side .brand{display:flex;align-items:center;gap:10px;padding:18px 18px 12px}
.logo{width:40px;height:40px;border-radius:13px;background:linear-gradient(135deg,var(--accent),#7AC0F8);display:grid;place-items:center;color:#fff;font-weight:900;font-size:19px;box-shadow:0 6px 16px color-mix(in srgb,var(--accent) 35%,transparent)}
.brand b{display:block;font-size:16px;line-height:1.2}
.brand small{color:var(--muted);font-size:11.5px}
.nav{flex:1;overflow:auto;padding:6px 10px 14px}
.nav .grp{font-size:11px;color:var(--muted);font-weight:700;padding:14px 10px 6px}
.nav a{display:flex;align-items:center;gap:11px;padding:9px 11px;border-radius:12px;color:var(--fg);font-weight:600;font-size:13.5px;position:relative}
.nav a svg{width:20px;height:20px;color:var(--muted)}
.nav a:hover{background:var(--surface-2)}
.nav a.on{background:var(--accent-soft);color:var(--accent)}
.nav a.on svg{color:var(--accent)}
.nav .cnt{margin-inline-start:auto;background:var(--bad);color:#fff;font-size:10.5px;font-weight:800;border-radius:999px;min-width:19px;height:19px;display:grid;place-items:center;padding:0 5px}
.side .me{border-top:1px solid var(--line);padding:12px 14px;display:flex;align-items:center;gap:10px}
.avatar{width:36px;height:36px;border-radius:50%;background:linear-gradient(135deg,var(--accent),#7AC0F8);display:grid;place-items:center;color:#fff;font-weight:800;flex:none;font-size:14px}
.avatar.sm{width:30px;height:30px;font-size:12px}
.main{flex:1;min-width:0;margin-inline-start:var(--side);display:flex;flex-direction:column}
.top{position:sticky;top:0;z-index:20;background:color-mix(in srgb,var(--bg) 88%,transparent);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);display:flex;align-items:center;gap:10px;padding:14px 26px}
.top h1{font-size:19px;margin:0;font-weight:800;line-height:1.3}
.top .crumb{font-size:12px;color:var(--muted)}
.content{padding:6px 26px 40px;max-width:1280px;width:100%}
.iconbtn{width:40px;height:40px;border-radius:12px;border:0;background:var(--surface);box-shadow:var(--shadow);display:grid;place-items:center;color:var(--fg)}
.iconbtn svg{width:20px;height:20px}
.iconbtn:hover{color:var(--accent)}
.menu-btn{display:none}
.scrim{position:fixed;inset:0;background:rgba(5,10,20,.45);z-index:25;display:none}
.searchbox{display:flex;align-items:center;gap:8px;background:var(--surface);border-radius:12px;padding:0 12px;height:40px;box-shadow:var(--shadow);min-width:240px;color:var(--muted);border:0;font-size:13px}
.searchbox kbd{margin-inline-start:auto;font-family:inherit;font-size:11px;background:var(--surface-2);border-radius:6px;padding:1px 6px}
.tabbar{display:none}

/* ------------------------------------------------------------ cards */
.card{background:var(--surface);border-radius:var(--r);padding:16px;box-shadow:var(--shadow)}
.card.pad-lg{padding:22px}
.card.flat{box-shadow:none;border:1px solid var(--line)}
.card h2,.card h3{margin:0;font-size:15px;font-weight:800}
.card-h{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}
.card-h .sub{font-size:12px;color:var(--muted);font-weight:500}
.kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.kpi{background:var(--surface);border-radius:var(--r);padding:14px 16px;box-shadow:var(--shadow);display:flex;flex-direction:column;gap:4px;min-width:0;position:relative;overflow:hidden}
.kpi .l{font-size:12px;color:var(--muted);font-weight:600;display:flex;align-items:center;gap:6px}
.kpi .v{font-size:22px;font-weight:800;line-height:1.25}
.kpi .v small{font-size:12px;font-weight:600;color:var(--muted);margin-inline-start:3px}
.kpi .f{font-size:11.5px;color:var(--muted)}
.kpi .ic{position:absolute;inset-inline-end:12px;top:12px;width:34px;height:34px;border-radius:11px;display:grid;place-items:center}
.kpi .ic svg{width:19px;height:19px}
.kpi.hl{background:linear-gradient(140deg,var(--accent),color-mix(in srgb,var(--accent) 60%,#7AC0F8));color:#fff}
.kpi.hl .l,.kpi.hl .f,.kpi.hl .v small{color:rgba(255,255,255,.82)}
.kpi.hl .ic{background:rgba(255,255,255,.18);color:#fff}
.t-acc{background:var(--accent-soft);color:var(--accent)} .t-ok{background:var(--ok-soft);color:var(--ok)}
.t-warn{background:var(--warn-soft);color:var(--warn)} .t-bad{background:var(--bad-soft);color:var(--bad)}
.t-vio{background:var(--violet-soft);color:var(--violet)} .t-teal{background:var(--teal-soft);color:var(--teal)}
.wallet-hero{border-radius:22px;padding:20px;color:#fff;background:radial-gradient(120% 140% at 0% 0%,#7AC0F8 0%,var(--accent) 45%,#145A94 100%);position:relative;overflow:hidden;box-shadow:0 12px 30px color-mix(in srgb,var(--accent) 30%,transparent)}
.wallet-hero::after{content:"";position:absolute;inset-inline-start:-50px;bottom:-80px;width:220px;height:220px;border-radius:50%;background:rgba(255,255,255,.09)}
.wallet-hero::before{content:"";position:absolute;inset-inline-end:-30px;top:-60px;width:160px;height:160px;border-radius:50%;background:rgba(255,255,255,.07)}
.wallet-hero>*{position:relative;z-index:1}
.wallet-hero .amt{font-size:30px;font-weight:900;line-height:1.2;margin:6px 0 2px}
.wallet-hero .amt small{font-size:14px;font-weight:600;opacity:.85;margin-inline-start:4px}
.wallet-hero .btn.white{background:#fff;color:#145A94}
.wallet-hero .btn.glass{background:rgba(255,255,255,.18);color:#fff}

/* ------------------------------------------------------------ pills, badges */
.pill{display:inline-flex;align-items:center;gap:5px;font-size:11.5px;font-weight:700;border-radius:999px;padding:2px 9px;white-space:nowrap;line-height:1.7}
.pill::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor;opacity:.9}
.pill.nodot::before{display:none}
.pill.ok{background:var(--ok-soft);color:var(--ok)} .pill.warn{background:var(--warn-soft);color:var(--warn)}
.pill.bad{background:var(--bad-soft);color:var(--bad)} .pill.info{background:var(--accent-soft);color:var(--accent)}
.pill.mute{background:var(--surface-2);color:var(--muted)} .pill.vio{background:var(--violet-soft);color:var(--violet)}
.tag{font-size:10.5px;font-weight:800;border-radius:6px;padding:1px 7px;color:#fff;white-space:nowrap}
.tag.sanaei{background:#7A5AF8}.tag.marzban{background:#2481CC}.tag.pasarguard{background:#0E9F8E}
.dot{width:9px;height:9px;border-radius:50%;display:inline-block;flex:none}
.dot.up{background:var(--ok);box-shadow:0 0 0 4px var(--ok-soft)} .dot.down{background:var(--bad);box-shadow:0 0 0 4px var(--bad-soft)} .dot.unknown{background:var(--muted)}

/* ------------------------------------------------------------ buttons */
.btn{border:0;border-radius:12px;padding:0 16px;height:40px;font-weight:700;font-size:13.5px;display:inline-flex;align-items:center;justify-content:center;gap:7px;white-space:nowrap;transition:filter .15s,transform .05s;background:var(--surface-2);color:var(--fg)}
.btn:active{transform:translateY(1px)}
.btn svg{width:18px;height:18px}
.btn.primary{background:var(--accent);color:var(--accent-fg)} .btn.primary:hover{filter:brightness(1.07)}
.btn.soft{background:var(--accent-soft);color:var(--accent)}
.btn.ok{background:var(--ok);color:#fff} .btn.danger{background:var(--bad);color:#fff}
.btn.bad{background:var(--bad-soft);color:var(--bad)} .btn.ghost{background:transparent;color:var(--fg)} .btn.ghost:hover{background:var(--surface-2)}
.btn.line{background:var(--surface);border:1px solid var(--line)}
.btn.sm{height:32px;padding:0 11px;font-size:12.5px;border-radius:10px} .btn.sm svg{width:16px;height:16px}
.btn.lg{height:48px;font-size:15px;border-radius:14px}
.btn.block{width:100%}
.btn:disabled,.btn.busy{opacity:.55;pointer-events:none}
.btn.busy::after{content:"";width:14px;height:14px;border-radius:50%;border:2px solid currentColor;border-inline-end-color:transparent;animation:spin .7s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.actions{display:flex;gap:8px;flex-wrap:wrap}

/* ------------------------------------------------------------ forms */
.field{display:flex;flex-direction:column;gap:5px;min-width:0}
.field>label{font-size:12.5px;color:var(--muted);font-weight:700}
.field .hint{font-size:11.5px;color:var(--muted)}
.input,select.input,textarea.input{width:100%;border:1.5px solid var(--line);background:var(--surface);border-radius:12px;padding:0 12px;height:42px;outline:none;transition:border-color .15s,box-shadow .15s;font-size:14px}
textarea.input{height:auto;min-height:96px;padding:10px 12px;resize:vertical;line-height:1.8}
.input:focus{border-color:var(--accent);box-shadow:0 0 0 4px color-mix(in srgb,var(--accent) 14%,transparent)}
.input[readonly]{background:var(--surface-2)}
.input-group{display:flex;align-items:stretch;border:1.5px solid var(--line);border-radius:12px;background:var(--surface);overflow:hidden}
.input-group:focus-within{border-color:var(--accent);box-shadow:0 0 0 4px color-mix(in srgb,var(--accent) 14%,transparent)}
.input-group .input{border:0;box-shadow:none!important;border-radius:0}
.input-group .addon{display:grid;place-items:center;padding:0 12px;background:var(--surface-2);color:var(--muted);font-size:12.5px;font-weight:700;white-space:nowrap}
.input-group button.addon{border:0}
.check{display:flex;align-items:center;gap:8px;font-size:13.5px;cursor:pointer}
.check input{width:18px;height:18px;accent-color:var(--accent)}
.switch{width:44px;height:26px;border-radius:999px;background:var(--line);position:relative;border:0;flex:none;transition:background .2s;padding:0}
.switch::after{content:"";position:absolute;top:3px;inset-inline-start:3px;width:20px;height:20px;border-radius:50%;background:#fff;transition:inset-inline-start .2s;box-shadow:0 1px 3px rgba(0,0,0,.25)}
.switch.on{background:var(--ok)} .switch.on::after{inset-inline-start:21px}
.setting{display:flex;align-items:center;gap:12px;padding:12px 0;border-top:1px solid var(--line)}
.setting:first-child{border-top:0}
.setting .t{font-weight:700;font-size:13.5px}
.setting .d{font-size:12px;color:var(--muted)}
.otp{display:flex;gap:8px;direction:ltr;justify-content:center}
.otp input{width:46px;height:54px;text-align:center;font-size:22px;font-weight:800;border:1.5px solid var(--line);border-radius:12px;background:var(--surface);outline:none}
.otp input:focus{border-color:var(--accent);box-shadow:0 0 0 4px color-mix(in srgb,var(--accent) 14%,transparent)}
.seg{display:inline-flex;background:var(--surface-2);border-radius:12px;padding:3px;gap:2px;max-width:100%;overflow-x:auto;scrollbar-width:none}
.seg button{border:0;background:none;border-radius:9px;padding:6px 14px;font-size:13px;color:var(--muted);white-space:nowrap;font-weight:600}
.seg button.on{background:var(--surface);color:var(--fg);font-weight:800;box-shadow:var(--shadow)}
.chips{display:flex;gap:6px;flex-wrap:wrap}
.chip{border:1.5px solid var(--line);background:var(--surface);border-radius:999px;padding:4px 13px;font-size:12.5px;white-space:nowrap;font-weight:600}
.chip.on{background:var(--accent);color:var(--accent-fg);border-color:var(--accent)}
.toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:12px}
.toolbar .search{flex:1;min-width:200px;max-width:380px}
.search{display:flex;align-items:center;gap:8px;background:var(--surface);border-radius:12px;padding:0 12px;height:42px;box-shadow:var(--shadow)}
.search input{border:0;background:none;outline:none;flex:1;min-width:0}
.search svg{width:18px;height:18px;color:var(--muted)}

/* ------------------------------------------------------------ tables */
.table-wrap{background:var(--surface);border-radius:var(--r);box-shadow:var(--shadow);overflow:hidden}
table.t{width:100%;border-collapse:collapse}
.t th{font-size:12px;color:var(--muted);font-weight:700;text-align:start;padding:11px 14px;background:var(--surface-2);white-space:nowrap}
.t td{padding:12px 14px;border-top:1px solid var(--line);vertical-align:middle}
.t tr.click{cursor:pointer}
.t tr.click:hover td{background:color-mix(in srgb,var(--surface-2) 60%,transparent)}
.t .end{text-align:end}
.pager{display:flex;align-items:center;justify-content:center;gap:8px;padding:12px}
.cell-main{font-weight:700}
.cell-sub{font-size:11.5px;color:var(--muted)}

/* ------------------------------------------------------------ lists */
.list{display:flex;flex-direction:column}
.li{display:flex;align-items:center;gap:12px;padding:11px 0;border-top:1px solid var(--line)}
.li:first-child{border-top:0}
.li.click{cursor:pointer}
.li .ic{width:38px;height:38px;border-radius:12px;display:grid;place-items:center;flex:none}
.li .ic svg{width:19px;height:19px}
.meter{height:7px;border-radius:999px;background:var(--surface-3);overflow:hidden}
.meter>div{height:100%;border-radius:999px;background:var(--accent);transition:width .4s}
.meter.warn>div{background:var(--warn)} .meter.bad>div{background:var(--bad)}
.sub-card{color:inherit;background:var(--surface);border-radius:var(--r);padding:14px;box-shadow:var(--shadow);display:flex;flex-direction:column;gap:10px;cursor:pointer;transition:transform .12s,box-shadow .12s;border:1.5px solid transparent}
.sub-card:hover{transform:translateY(-1px);box-shadow:var(--shadow-lg)}
.subs-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(270px,1fr));gap:12px}
.empty{text-align:center;padding:40px 16px;color:var(--muted)}
.empty .em{width:64px;height:64px;border-radius:20px;margin:0 auto 12px;display:grid;place-items:center;background:var(--accent-soft);color:var(--accent)}
.empty .em svg{width:30px;height:30px}
.empty b{display:block;font-size:15px;color:var(--fg);margin-bottom:4px}
.note{display:flex;gap:10px;align-items:flex-start;font-size:13px;background:var(--accent-soft);border-radius:14px;padding:12px 14px;color:var(--fg)}
.note svg{width:19px;height:19px;color:var(--accent);margin-top:2px}
.note.warn{background:var(--warn-soft)} .note.warn svg{color:var(--warn)}
.note.bad{background:var(--bad-soft)} .note.bad svg{color:var(--bad)}
.note.ok{background:var(--ok-soft)} .note.ok svg{color:var(--ok)}
.kv{display:grid;grid-template-columns:auto 1fr;gap:8px 16px;font-size:13.5px}
.kv dt{color:var(--muted)} .kv dd{margin:0;font-weight:700;text-align:end}
.copy{display:flex;align-items:center;gap:8px;background:var(--surface-2);border-radius:12px;padding:8px 8px 8px 12px}
.copy code{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;direction:ltr;text-align:left;font-size:12.5px}
.qr{background:#fff;border-radius:16px;padding:10px;display:grid;place-items:center;width:max-content;margin:0 auto}
.qr svg{width:190px;height:190px;display:block}
.steps{display:flex;gap:8px;align-items:center}
.steps i{flex:1;height:4px;border-radius:999px;background:var(--line)}
.steps i.on{background:var(--accent)}
.setup-step{display:flex;gap:12px;align-items:center;padding:12px;border-radius:14px;background:var(--surface-2)}
.setup-step .n{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;background:var(--surface);font-weight:800;flex:none}
.setup-step.done .n{background:var(--ok);color:#fff}
.chart{width:100%;height:auto;display:block;direction:ltr}
.legend{display:flex;gap:14px;font-size:12px;color:var(--muted);flex-wrap:wrap}
.legend i{display:inline-block;width:10px;height:10px;border-radius:3px;margin-inline-end:6px;vertical-align:-1px}

/* ------------------------------------------------------------ modal / toast */
.modal-bg{position:fixed;inset:0;background:rgba(5,10,20,.5);z-index:60;display:flex;align-items:center;justify-content:center;padding:20px;animation:fade .18s}
.modal{background:var(--bg);width:100%;max-width:520px;max-height:90vh;max-height:90dvh;overflow:auto;border-radius:22px;padding:20px;display:flex;flex-direction:column;gap:14px;box-shadow:var(--shadow-lg);animation:pop .2s ease;overscroll-behavior:contain}
.modal.wide{max-width:760px}
.modal .mh{display:flex;align-items:center;gap:10px}
.modal .mh h3{margin:0;font-size:17px;font-weight:800;flex:1}
.modal .mf{display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap;padding-top:4px}
.modal .grip{display:none}
@keyframes fade{from{opacity:0}}
@keyframes pop{from{transform:translateY(12px) scale(.98);opacity:.4}to{transform:none;opacity:1}}
@keyframes up{from{transform:translateY(40px)}to{transform:none}}
.toasts{position:fixed;bottom:24px;inset-inline-start:50%;transform:translateX(50%);z-index:80;display:flex;flex-direction:column;gap:8px;align-items:center;pointer-events:none}
.toast{background:var(--fg);color:var(--bg);padding:10px 18px;border-radius:999px;font-size:13.5px;font-weight:600;box-shadow:var(--shadow-lg);animation:pop .2s;max-width:90vw;text-align:center}
.toast.err{background:var(--bad);color:#fff} .toast.ok{background:var(--ok);color:#fff}
.skeleton{border-radius:var(--r);background:linear-gradient(90deg,var(--surface) 0%,var(--surface-2) 50%,var(--surface) 100%);background-size:200% 100%;animation:sk 1.2s infinite;min-height:110px}
@keyframes sk{to{background-position:-200% 0}}
.palette{position:fixed;inset:0;z-index:70;background:rgba(5,10,20,.45);display:flex;justify-content:center;padding-top:12vh;animation:fade .15s}
.palette .box{background:var(--surface);width:min(560px,92vw);border-radius:18px;box-shadow:var(--shadow-lg);overflow:hidden;align-self:flex-start}
.palette input{width:100%;border:0;outline:none;padding:16px 18px;font-size:16px;background:none;border-bottom:1px solid var(--line)}
.palette .res{max-height:50vh;overflow:auto;padding:6px}
.palette .res a{display:flex;gap:10px;align-items:center;padding:10px 12px;border-radius:12px;color:var(--fg)}
.palette .res a.sel,.palette .res a:hover{background:var(--accent-soft)}
.palette .res svg{width:18px;height:18px;color:var(--muted)}

/* ------------------------------------------------------------ auth */
.auth{min-height:100vh;display:grid;grid-template-columns:1fr 1fr}
.auth .art{background:radial-gradient(120% 120% at 100% 0%,#7AC0F8 0%,var(--accent) 40%,#0E3B63 100%);color:#fff;padding:48px;display:flex;flex-direction:column;justify-content:space-between;position:relative;overflow:hidden}
.auth .art::after{content:"%";position:absolute;inset-inline-start:-40px;bottom:-120px;font-size:420px;font-weight:900;opacity:.08;line-height:1}
.auth .art h2{font-size:32px;margin:0 0 10px;font-weight:900;line-height:1.35}
.auth .art p{opacity:.85;max-width:420px}
.auth .art .feat{display:flex;gap:10px;align-items:center;margin-top:10px;opacity:.95}
.auth .art .feat i{width:30px;height:30px;border-radius:10px;background:rgba(255,255,255,.16);display:grid;place-items:center;font-style:normal}
.auth .art .feat svg{width:17px;height:17px}
.auth .form{display:flex;align-items:center;justify-content:center;padding:32px 20px}
.auth .box{width:100%;max-width:380px;display:flex;flex-direction:column;gap:16px}
.auth .box h1{margin:0;font-size:22px;font-weight:900}
.pw-wrap{position:relative}
.pw-wrap button{position:absolute;inset-inline-end:6px;top:6px;width:30px;height:30px;border:0;background:none;color:var(--muted);display:grid;place-items:center}


/* ------------------------------------------------------------ telegram preview, themes, campaigns */
.tgp{border-radius:18px;padding:12px;background:linear-gradient(160deg,#A9C88E,#7FAE76);display:flex;flex-direction:column;gap:5px}
:root[data-theme="dark"] .tgp{background:linear-gradient(160deg,#2B3B2A,#1E2C22)}
.tgp .bubble{background:#fff;color:#111;border-radius:14px 14px 14px 4px;padding:9px 12px 16px;font-size:13px;line-height:1.8;white-space:pre-wrap;word-break:break-word;position:relative;align-self:flex-end;max-width:96%;margin-bottom:3px}
:root[data-theme="dark"] .tgp .bubble{background:#182533;color:#E8EDF3}
.tgp .bubble code{font-family:ui-monospace,Menlo,monospace;background:rgba(0,0,0,.06);padding:0 4px;border-radius:4px}
.tgp .bubble .tm{position:absolute;inset-inline-start:8px;bottom:2px;font-size:10px;opacity:.5}
.tgp .kbrow{display:flex;gap:5px}
.kbtn{flex:1;border-radius:9px;padding:8px 6px;font-size:12px;color:#fff;text-align:center;background:rgba(255,255,255,.28);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600;display:block}
.kbtn.primary{background:#4A8FD4}.kbtn.success{background:#4C9A4A}.kbtn.danger{background:#D0604F}
.tgp.compact .bubble{font-size:11.5px;max-height:120px;overflow:hidden}
.tgp.compact .kbtn{font-size:11px;padding:6px 4px}
.theme-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:14px}
.theme-card{border:2px solid transparent;background:var(--surface);border-radius:20px;padding:0 0 12px;box-shadow:var(--shadow);text-align:start;display:flex;flex-direction:column;gap:10px;overflow:hidden;transition:transform .15s,border-color .15s}
.theme-card:hover{transform:translateY(-2px)}
.theme-card.on{border-color:var(--accent);box-shadow:0 0 0 4px color-mix(in srgb,var(--accent) 18%,transparent)}
.theme-card .tgp{margin:0 12px}
.th-head{display:flex;align-items:center;gap:10px;padding:14px;color:#fff;position:relative}
.th-head b{display:block;font-size:15px}.th-head small{opacity:.9;font-size:11.5px;line-height:1.5;display:block}
.th-emoji{width:42px;height:42px;border-radius:14px;background:rgba(255,255,255,.22);display:grid;place-items:center;font-size:22px;flex:none}
.th-on{position:absolute;inset-inline-end:10px;top:10px;width:26px;height:26px;border-radius:50%;background:#fff;color:var(--ok);display:grid;place-items:center}
.th-on svg{width:16px;height:16px}
.th-plan{padding:0 12px}
.preset-row{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:10px}
.preset{border:1.5px dashed var(--line);background:var(--surface);border-radius:16px;padding:12px;text-align:start;display:flex;flex-direction:column;gap:4px}
.preset:hover{border-color:var(--accent);background:var(--accent-soft)}
.preset span{width:32px;height:32px;border-radius:10px;background:var(--accent-soft);color:var(--accent);display:grid;place-items:center}
.preset span svg{width:18px;height:18px}.preset small{color:var(--muted);font-size:11.5px}
.cstats{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
.cstat{background:var(--surface-2);border-radius:12px;padding:8px;text-align:center;display:flex;flex-direction:column}
.cstat b{font-size:16px}.cstat span{font-size:11px;color:var(--muted)}
.camp-ed{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);gap:18px;align-items:start}
.camp-ed > .stack:last-child{position:sticky;top:0}
.cbtn{display:grid;grid-template-columns:1.4fr 1fr .8fr auto;gap:6px;align-items:center}
.cbtn input[data-k=url]{grid-column:1/-1}
.frame{width:100%;height:calc(100vh - 120px);height:calc(100dvh - 120px);min-height:420px;border:0;border-radius:20px;background:var(--surface);box-shadow:var(--shadow);display:block}
.wizard-steps{display:flex;gap:6px;flex-wrap:wrap}
.wizard-steps span{display:flex;align-items:center;gap:6px;font-size:12.5px;font-weight:700;color:var(--muted);padding:6px 12px;border-radius:999px;background:var(--surface)}
.wizard-steps span.on{background:var(--accent);color:var(--accent-fg)} .wizard-steps span.done{color:var(--ok)}
.wizard-steps i{font-style:normal;width:20px;height:20px;border-radius:50%;display:grid;place-items:center;background:var(--surface-2);font-size:11px}
.wizard-steps span.on i{background:rgba(255,255,255,.25)}
.guide{counter-reset:g;display:flex;flex-direction:column;gap:10px}
.guide li{list-style:none;display:flex;gap:10px;align-items:flex-start}
.guide li::before{counter-increment:g;content:counter(g);width:26px;height:26px;border-radius:50%;background:var(--accent-soft);color:var(--accent);font-weight:800;display:grid;place-items:center;flex:none;font-size:12.5px}
.tier{border-radius:20px;padding:16px;background:linear-gradient(135deg,#1E293B,#334155);color:#fff;display:flex;flex-direction:column;gap:8px}
.tier .meter{background:rgba(255,255,255,.15)} .tier .meter>div{background:linear-gradient(90deg,#FCD34D,#F59E0B)}
.lb .li .avatar{background:var(--surface-2);color:var(--fg)} .lb .li.me{background:var(--accent-soft);border-radius:12px;padding-inline:8px}
.tip{display:flex;gap:10px;align-items:center;padding:12px 14px;border-radius:14px;background:var(--surface);box-shadow:var(--shadow)}
.tip .ic{width:36px;height:36px;border-radius:12px;display:grid;place-items:center;flex:none} .tip .ic svg{width:19px;height:19px}
@media (max-width:900px){.camp-ed{grid-template-columns:minmax(0,1fr)} .camp-ed > .stack:last-child{position:static} .cbtn{grid-template-columns:1fr 1fr}}

/* ------------------------------------------------------------ responsive */
@media (max-width:1100px){.kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.g4{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:900px){
  .side{transform:translateX(100%)}
  [dir=rtl] .side{transform:translateX(100%)}
  body.nav-open .side{transform:none}
  body.nav-open .scrim{display:block}
  .main{margin-inline-start:0}
  .menu-btn{display:grid}
  .top{padding:12px 16px}
  .content{padding:4px 16px 110px}
  .searchbox{min-width:0;width:40px;padding:0;justify-content:center}
  .searchbox span,.searchbox kbd{display:none}
  .g3,.g2.collapse{grid-template-columns:minmax(0,1fr)}
  .auth{grid-template-columns:1fr}
  .auth .art{display:none}
  .hide-m{display:none!important}
  /* tables become cards */
  table.t.resp thead{display:none}
  table.t.resp,table.t.resp tbody,table.t.resp tr,table.t.resp td{display:block;width:100%}
  table.t.resp tr{padding:10px 14px;border-top:1px solid var(--line)}
  table.t.resp tr:first-child{border-top:0}
  table.t.resp td{border:0;padding:3px 0;display:flex;justify-content:space-between;gap:10px;text-align:start}
  table.t.resp td::before{content:attr(data-l);color:var(--muted);font-size:12px;font-weight:600}
  table.t.resp td.main-cell::before{display:none}
  table.t.resp td.main-cell{padding-bottom:6px}
  .modal-bg{align-items:flex-end;padding:0}
  .modal{max-width:none;border-radius:22px 22px 0 0;padding:10px 16px calc(18px + env(safe-area-inset-bottom));animation:up .22s ease}
  .modal .grip{display:block;width:40px;height:5px;border-radius:999px;background:var(--line);margin:0 auto}
  .modal .mf .btn{flex:1}
  .tabbar{display:flex;position:fixed;bottom:0;inset-inline:0;z-index:20;background:color-mix(in srgb,var(--surface) 92%,transparent);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);border-top:1px solid var(--line);padding:6px 6px calc(8px + env(safe-area-inset-bottom))}
  .tabbar a{flex:1;display:flex;flex-direction:column;align-items:center;gap:2px;font-size:10.5px;color:var(--muted);font-weight:600;padding:3px 0}
  .tabbar a svg{width:23px;height:23px}
  .tabbar a.on{color:var(--accent);font-weight:800}
  .tabbar a.fab span{display:none}
  .tabbar a.fab div{width:50px;height:50px;border-radius:17px;background:var(--accent);color:#fff;display:grid;place-items:center;margin-top:-22px;box-shadow:0 8px 20px color-mix(in srgb,var(--accent) 40%,transparent)}
  .toasts{bottom:96px}
}
@media (max-width:560px){.kpis{gap:10px}.kpi .v{font-size:19px}.g4,.g2{grid-template-columns:1fr 1fr}.g2.one-m{grid-template-columns:1fr}.top h1{font-size:17px}}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

.plan-row{display:grid;grid-template-columns:minmax(0,.9fr) minmax(0,.9fr) minmax(0,1.5fr) minmax(0,1fr) auto;gap:8px;align-items:center}
.plan-row .pc{display:flex;flex-direction:column;line-height:1.5;text-align:center} .plan-row .pc b{font-size:15px}
.plan-row .iconbtn{width:36px;height:36px;box-shadow:none;background:var(--surface-2)}
.c-pos{color:var(--ok)} .c-neg{color:var(--bad)}
.qr svg{width:100%;height:auto;display:block}
@media (max-width:700px){.plan-head{display:none} .plan-row{grid-template-columns:1fr 1fr;padding:10px;border-radius:14px;background:var(--surface-2)} .plan-row .input-group:nth-child(3){grid-column:1/-1}}
.t-mute{background:var(--surface-2);color:var(--muted)}
@media (max-width:700px){.preset-row{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;padding-bottom:4px;scrollbar-width:none} .preset{flex:0 0 72%;scroll-snap-align:start}}

.mplans{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px}
.mplan{display:flex;flex-direction:column;gap:8px;position:relative;padding:18px}
.mplan.hot{outline:2px solid var(--accent)}
.mplan .price{font-size:26px;font-weight:900}
.mplan .tag{position:absolute;top:-10px;inset-inline-start:16px;background:var(--accent);color:var(--accent-fg);font-size:11px;font-weight:800;padding:3px 10px;border-radius:999px}
.choice{display:flex;gap:10px;align-items:flex-start;padding:12px;border-radius:14px;background:var(--surface-2);cursor:pointer}
.choice input{margin-top:4px;accent-color:var(--accent)} .choice span{display:flex;flex-direction:column;gap:2px} .choice small{color:var(--muted);font-size:12px}
.choice:has(input:checked){outline:2px solid var(--accent);background:var(--accent-soft)}
@media (max-width:700px){.frame{border-radius:16px}}
.logo.img{background:var(--surface);padding:0;overflow:hidden}.logo.img img{width:100%;height:100%;object-fit:contain;display:block}

.brand-ed{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);gap:16px;align-items:start}
@media (max-width:1000px){.brand-ed{grid-template-columns:minmax(0,1fr)} .brand-ed > .stack:last-child{position:static!important}}
.asset{display:flex;gap:12px;align-items:center;padding:12px;border-radius:14px;background:var(--surface-2)}
.asset .ph{width:64px;height:64px;border-radius:14px;background:var(--surface);display:grid;place-items:center;overflow:hidden;flex:none;color:var(--muted)}
.asset .ph.og{width:96px;height:52px} .asset .ph img{width:100%;height:100%;object-fit:contain}
.swatches{display:flex;flex-wrap:wrap;gap:8px}
.sw{display:flex;align-items:center;gap:6px;border:1.5px solid var(--line);background:var(--surface);border-radius:999px;padding:5px 10px 5px 12px;font-size:12.5px;cursor:pointer}
.sw i{width:16px;height:16px;border-radius:50%;background:var(--c)} .sw.on{border-color:var(--c);box-shadow:0 0 0 3px color-mix(in srgb,var(--c) 22%,transparent)}
.pv{display:grid;grid-template-columns:1fr 1fr;border-radius:16px;overflow:hidden;min-height:220px;border:1px solid var(--line)}
.pv-art{background:radial-gradient(120% 120% at 100% 0%,color-mix(in srgb,var(--a) 50%,#fff) 0%,var(--a) 45%,color-mix(in srgb,var(--a) 50%,#000) 100%);color:#fff;padding:14px;display:flex;flex-direction:column;gap:6px}
.pv-art .logo{width:28px;height:28px;font-size:14px;border-radius:9px} .pv-art h4{margin:6px 0 0;font-size:14px;line-height:1.5} .pv-art p{margin:0;font-size:11px;opacity:.85}
.pv-form{background:var(--bg);padding:14px;display:flex;flex-direction:column;gap:8px;justify-content:center}
.pv-in{height:22px;border-radius:7px;background:var(--surface);border:1px solid var(--line)} .pv-btn{background:var(--a);color:#fff;border-radius:8px;text-align:center;font-size:12px;padding:5px}
.li .dot{width:12px;height:12px;border-radius:50%;flex:none}
.txt-ed{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);gap:14px;padding:14px;border-radius:16px;background:var(--surface-2);align-items:start}
.txt-ed textarea{font-family:inherit;line-height:1.8;resize:vertical}
.tgp-wrap{min-width:0}
@media (max-width:800px){.txt-ed{grid-template-columns:minmax(0,1fr)} .pv{grid-template-columns:1fr}}
.savebar{position:sticky;bottom:12px;z-index:3;padding:10px;border-radius:16px;background:color-mix(in srgb,var(--surface) 88%,transparent);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);box-shadow:var(--shadow)}
.t .kbtn{display:inline-block;padding:6px 12px;border-radius:10px;font-size:12.5px;font-weight:700;background:var(--surface-2);color:var(--fg);white-space:nowrap}
.t .kbtn.primary{background:#3B82F6;color:#fff} .t .kbtn.success{background:#22A35A;color:#fff} .t .kbtn.danger{background:#D9534F;color:#fff}
