/* خط إنتاج من 14 محطة: عمود واحد، سكة عمودية تربط المحطات، ولون كهرماني للمحطة الحالية مثل إشارات السلامة في المصنع */
/* ملاحظة: الألوان الفعلية للموقع (ثيم الشماغ) في theme.css، وهذي قيم احتياطية */
:root{
  --bg:#0f1923;--surface:#16232f;--surface-2:#1b2a38;--ink:#e3e9ed;--muted:#9aabb9;--line:#2a3b4c;
  --steel:#8db4d8;--steel-ink:#0f1923;--amber:#f2b630;--amber-soft:#3a2e10;--amber-ink:#f5c95a;
  --ok:#4cc27e;--ok-soft:#163626;--bad:#f0776b;--bad-soft:#3d1d1a;--lock:#5b6874;--shade:rgba(0,0,0,.6);color-scheme:dark;
  --f-display:'Readex Pro','Segoe UI',Tahoma,system-ui,sans-serif;
  --f-body:'Readex Pro','Segoe UI',Tahoma,system-ui,sans-serif;
  --r:10px;
  --bld:#2c5578;--panel:#14273a;--panel-ink:#dfe8ef;--roof:#0e1d2b;--smoke:#5f6f7b;--belt:#0b1116;--box:#b47a30;--box-edge:#7f5420;--glass:#f2b630;
}

*{box-sizing:border-box}
html,body{background:var(--bg)}
body{color:var(--ink);font-family:var(--f-body);font-size:16px;line-height:1.75;direction:rtl;
  padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px))}
button{font:inherit;color:inherit;cursor:pointer}
button:focus-visible,input:focus-visible{outline:3px solid var(--amber);outline-offset:2px}
.wrap{max-width:780px;margin:0 auto;padding-block:20px 56px;display:flex;flex-direction:column;gap:22px}
h1,h2,h3{font-family:var(--f-display);text-wrap:balance;margin:0;line-height:1.35}
h1{font-size:clamp(1.7rem,4.5vw,2.3rem);font-weight:700;letter-spacing:-.01em}
h2{font-size:1.15rem;font-weight:600}
p{margin:0}
.m{font-family:var(--f-display);font-variant-numeric:tabular-nums;font-weight:500}
.m[dir=ltr]{display:inline-block;max-width:100%;direction:ltr;unicode-bidi:isolate;vertical-align:bottom}
.ma{unicode-bidi:isolate}
.eyebrow{font-family:var(--f-display);font-size:.8rem;font-weight:600;color:var(--amber-ink);letter-spacing:.02em}
.muted{color:var(--muted)}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:0;border-radius:8px;padding:11px 20px;font-weight:600;min-height:46px;text-decoration:none}
.btn-p{background:var(--steel);color:var(--steel-ink)}
.btn-a{background:var(--amber);color:#1b1300}
.btn-g{background:transparent;border:1px solid var(--line);color:var(--ink)}
.btn-d{background:var(--bad);color:var(--bg)}
.btn:disabled{opacity:.5;cursor:not-allowed}
.row{display:flex;flex-wrap:wrap;gap:10px;align-items:center}

/* الرأس */
.top{display:flex;flex-direction:column;gap:16px}
.lede{color:var(--muted);max-width:60ch}
.belt{display:grid;grid-template-columns:repeat(14,1fr);gap:4px}
.seg{height:12px;border-radius:3px;background:var(--line)}
.seg.done{background:var(--steel)}
.seg.cur{background:var(--amber)}
.tiles{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.tile{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:12px 14px;display:flex;flex-direction:column;gap:2px;min-width:0}
.tl{font-size:.8rem;color:var(--muted)}
.tv{font-family:var(--f-display);font-size:1.5rem;font-weight:700;font-variant-numeric:tabular-nums;line-height:1.3}
.tv small{font-size:.9rem;color:var(--muted);font-weight:500}
.tv-s{font-size:1.05rem;line-height:1.5;overflow-wrap:anywhere}
@media (max-width:480px){.tiles{grid-template-columns:1fr 1fr}.tiles .tile:last-child{grid-column:1/-1}}

.note-bar{background:var(--amber-soft);color:var(--ink);border-radius:var(--r);padding:12px 16px;border-inline-start:4px solid var(--amber)}
.start{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:18px;display:flex;flex-direction:column;gap:12px}
.trial{border-color:var(--amber);border-inline-start-width:4px}.trial h2,.trial p{margin:0}.res+.trial{margin-top:18px}
.rules{margin:0;padding-inline-start:20px;display:flex;flex-direction:column;gap:4px}

/* خط المحطات */
.line{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.st{position:relative}
.st::before{content:"";position:absolute;inset-inline-start:23px;top:0;bottom:0;width:2px;background:var(--line)}
.st:first-child::before{top:24px}
.st:last-child::before{bottom:calc(100% - 24px)}
.st.st-done::before{background:var(--steel)}
.st-b{position:relative;display:grid;grid-template-columns:48px minmax(0,1fr) auto;gap:14px;align-items:start;width:100%;text-align:start;background:none;border:0;padding:10px 0}
.st-b[aria-disabled="true"]{cursor:default}
.mk{width:48px;height:48px;border-radius:10px;display:grid;place-items:center;font-family:var(--f-display);font-weight:700;font-size:1.05rem;background:var(--surface);border:2px solid var(--line);color:var(--muted);font-variant-numeric:tabular-nums;position:relative;z-index:1}
.st-done .mk{background:var(--steel);border-color:var(--steel);color:var(--steel-ink)}
.st-open .mk,.st-cool .mk{background:var(--amber);border-color:var(--amber);color:#1b1300}
.st-locked .mk{color:var(--lock)}
.mk svg{width:20px;height:20px}
.st-c{display:flex;flex-direction:column;gap:1px;padding-top:2px;min-width:0}
.st-n{font-family:var(--f-display);font-size:.78rem;color:var(--muted);font-weight:600}
.st-t{font-weight:600;font-size:1.02rem;line-height:1.5}
.st-locked .st-t{color:var(--muted)}
.st-s{font-size:.86rem;color:var(--muted)}
.st-open .st-s,.st-cool .st-s{color:var(--amber-ink);font-weight:600}
.st-done .st-s{color:var(--ok)}
.go{align-self:center;font-size:.85rem;font-weight:600;color:var(--steel);white-space:nowrap}
.st-b:not([aria-disabled="true"]):hover .st-t{text-decoration:underline;text-underline-offset:4px}

.foot{border-top:1px solid var(--line);padding-top:18px;display:flex;flex-direction:column;gap:12px;font-size:.9rem;color:var(--muted)}
.sync{display:inline-flex;align-items:center;gap:8px}
.dot{width:8px;height:8px;border-radius:50%;background:var(--lock)}
.dot.on{background:var(--ok)}

/* الدرس */
.back{align-self:flex-start;background:none;border:0;color:var(--steel);font-weight:600;padding:6px 0}
.dhead{display:flex;flex-direction:column;gap:8px}
.chip{display:inline-flex;align-items:center;gap:6px;font-size:.82rem;font-weight:600;padding:3px 10px;border-radius:99px;background:var(--surface-2);border:1px solid var(--line)}
.chip.ok{background:var(--ok-soft);color:var(--ok);border-color:transparent}
.chip.am{background:var(--amber-soft);color:var(--amber-ink);border-color:transparent}
.ls{display:flex;flex-direction:column;gap:10px}
.ls h2{padding-bottom:6px;border-bottom:1px solid var(--line)}
.lb ul,.lb ol{margin:0;padding-inline-start:22px;display:flex;flex-direction:column;gap:6px}
.lb b{font-weight:600}
.lb p{margin:0}
.steps li::marker{font-family:var(--f-display);font-weight:600;color:var(--amber-ink)}
.fx{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:var(--r);background:var(--surface);overflow:hidden}
.fr{display:grid;grid-template-columns:minmax(110px,30%) minmax(0,1fr);gap:12px;padding:10px 14px;border-bottom:1px solid var(--line);align-items:baseline}
.fr:last-child{border-bottom:0}
.fl{font-weight:600;font-size:.92rem}
.fv{overflow-wrap:anywhere}
.ex{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:14px 16px;margin-bottom:10px}
.ex-h{font-weight:600;margin-bottom:6px}
.ex ol{gap:4px}
.warn{background:var(--bad-soft);border-radius:var(--r);padding:12px 16px}
.warn-h{font-weight:700;color:var(--bad);margin-bottom:4px;font-size:.92rem}
.note{margin-top:10px;color:var(--amber-ink);font-weight:600}
.tw{overflow-x:auto;margin:6px 0;border:1px solid var(--line);border-radius:8px;background:var(--surface)}
.qt{border-collapse:collapse;width:100%;font-size:.92rem;font-variant-numeric:tabular-nums}
.qt th,.qt td{padding:8px 12px;border-bottom:1px solid var(--line);text-align:start;white-space:nowrap}
.qt th{background:var(--surface-2);font-weight:600;font-size:.85rem}
.qt tr:last-child td{border-bottom:0}
.lb .qt td{white-space:normal;min-width:110px}
.grids{display:flex;flex-wrap:wrap;gap:10px;margin:8px 0}
.grids .tw{margin:0}
.qt.grid3{width:auto}
.qt.grid3 caption{caption-side:top;padding:6px 10px 4px;font-size:.8rem;font-weight:600;color:var(--muted,inherit);text-align:start}
.qt.grid3 td,.lb .qt.grid3 td{min-width:0;width:44px;height:40px;text-align:center;font-family:var(--f-display);font-weight:600;border:1px solid var(--line);white-space:nowrap}
.src{margin-top:8px!important;font-size:.8rem;opacity:.75}
.lb ol.ol{padding-inline-start:22px}

/* بطاقة الكويز */
.qcardx{background:var(--surface);border:2px solid var(--steel);border-radius:14px;padding:18px;display:flex;flex-direction:column;gap:12px}
.qcardx h2{display:flex;align-items:center;gap:8px}
.facts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.fact{background:var(--surface-2);border-radius:8px;padding:8px 10px;display:flex;flex-direction:column}
.fact b{font-family:var(--f-display);font-size:1.2rem;font-variant-numeric:tabular-nums}
.fact span{font-size:.78rem;color:var(--muted)}
.confirm{background:var(--amber-soft);border-radius:8px;padding:12px 14px;display:flex;flex-direction:column;gap:10px}
.cd{font-family:var(--f-display);font-variant-numeric:tabular-nums;font-weight:700}

/* شاشة الكويز */
.qz{position:fixed;inset:0;z-index:20;background:var(--bg);overflow-y:auto;
  padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px));padding-bottom:env(safe-area-inset-bottom,0px)}
.qz-top{position:sticky;top:0;z-index:2;background:var(--bg);padding-top:calc(env(safe-area-inset-top,0px) + 12px);padding-bottom:12px;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:12px;max-width:780px;margin:0 auto}
.qz-meta{flex:1;min-width:0;font-size:.88rem;color:var(--muted)}
.qz-meta b{color:var(--ink);font-family:var(--f-display)}
.timer{font-family:var(--f-display);font-weight:700;font-size:1.35rem;font-variant-numeric:tabular-nums;background:var(--surface);border:1px solid var(--line);border-radius:8px;padding:2px 12px;direction:ltr}
.timer.low{color:var(--bad);border-color:var(--bad)}
.strk{display:flex;gap:4px}
.strk i{width:10px;height:10px;border-radius:50%;background:var(--line);display:block}
.strk i.on{background:var(--bad)}
.qz-body{max-width:780px;margin:0 auto;padding-block:18px 40px;display:flex;flex-direction:column;gap:16px}
.qbox{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:18px;display:flex;flex-direction:column;gap:14px}
.qtag{font-size:.8rem;font-weight:600;color:var(--muted)}
.qq{font-size:1.06rem;font-weight:500;line-height:1.8}
.opts{display:flex;flex-direction:column;gap:8px}
.opt{display:grid;grid-template-columns:32px minmax(0,1fr);gap:10px;align-items:center;text-align:start;background:var(--surface-2);border:2px solid transparent;border-radius:10px;padding:10px 12px;min-height:52px}
.opt .ol{width:32px;height:32px;border-radius:8px;display:grid;place-items:center;background:var(--surface);border:1px solid var(--line);font-family:var(--f-display);font-weight:600}
.opt.sel{border-color:var(--steel);background:var(--surface)}
.opt.sel .ol{background:var(--steel);color:var(--steel-ink);border-color:var(--steel)}
.numrow{display:flex;gap:10px;align-items:center}
.numrow input{flex:1;min-width:0;font:inherit;font-family:var(--f-display);font-size:1.3rem;font-variant-numeric:tabular-nums;padding:10px 14px;border-radius:10px;border:2px solid var(--line);background:var(--surface-2);color:var(--ink);direction:ltr;text-align:left}
.numrow input:focus{border-color:var(--steel)}
.unit{color:var(--muted);font-size:.9rem;white-space:nowrap}
.qnav{display:flex;justify-content:space-between;gap:10px}
.pal{display:flex;flex-wrap:wrap;gap:6px}
.pb{width:38px;height:38px;border-radius:8px;border:1px solid var(--line);background:var(--surface);font-family:var(--f-display);font-weight:600;font-variant-numeric:tabular-nums}
.pb.on{background:var(--steel);color:var(--steel-ink);border-color:var(--steel)}
.pb.cur{outline:2px solid var(--amber);outline-offset:1px}
.subrow{display:flex;justify-content:flex-end}
.modal{position:fixed;inset:0;z-index:30;background:var(--shade);display:grid;place-items:center;padding:20px}
.modal-c{background:var(--surface);border-radius:14px;max-width:420px;width:100%;padding:20px;display:flex;flex-direction:column;gap:12px;border-top:6px solid var(--bad)}

/* النتيجة */
.res{display:flex;flex-direction:column;gap:14px}
.score{display:flex;align-items:baseline;gap:14px;flex-wrap:wrap}
.score b{font-family:var(--f-display);font-size:3.4rem;font-weight:700;line-height:1;font-variant-numeric:tabular-nums}
.stamp{display:inline-block;font-family:var(--f-display);font-weight:700;padding:4px 14px;border-radius:6px;border:2px solid currentColor;transform:rotate(-2deg)}
.stamp.ok{color:var(--ok)}
.stamp.bad{color:var(--bad)}
.rv{display:flex;flex-direction:column;gap:10px}
.rvi{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:14px 16px;display:flex;flex-direction:column;gap:8px;border-inline-start:5px solid var(--ok)}
.rvi.x{border-inline-start-color:var(--bad)}
.rvi .qq{font-size:.98rem}
.ans{display:grid;grid-template-columns:auto minmax(0,1fr);gap:4px 10px;font-size:.92rem}
.ans span:nth-child(odd){color:var(--muted)}
.sol{background:var(--surface-2);border-radius:8px;padding:10px 12px;font-size:.92rem}
@media (prefers-reduced-motion:no-preference){.st-b,.opt,.btn{transition:background-color .15s,border-color .15s}}

/* آلة حاسبة داخل الكويز */
.calc-b{min-height:38px;padding:6px 12px;gap:6px;font-size:.9rem}
.calc-b[aria-expanded="true"]{border-color:var(--amber);color:var(--amber-ink)}
@media (max-width:420px){.calc-bt{display:none}}
.calc{position:fixed;z-index:25;left:16px;bottom:16px;width:300px;background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:12px;display:flex;flex-direction:column;gap:8px;box-shadow:0 12px 32px rgba(0,0,0,.45)}
.calc-h{display:flex;align-items:center;justify-content:space-between;font-family:var(--f-display)}
.calc-x{border:0;background:transparent;color:var(--muted);font-size:1.1rem;min-width:36px;min-height:36px;border-radius:8px}
#calc-in{font:inherit;font-family:var(--f-display);font-size:1.25rem;font-variant-numeric:tabular-nums;width:100%;min-width:0;padding:8px 12px;border-radius:9px;border:1px solid var(--line);background:var(--surface-2);color:var(--ink);text-align:left;direction:ltr}
#calc-in:focus{border-color:var(--steel);outline:none}
.calc-out{min-height:1.6em;font-family:var(--f-display);font-weight:700;font-size:1.15rem;color:var(--amber-ink);text-align:left;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.calc-k{display:grid;grid-template-columns:repeat(5,1fr);gap:6px}
.calc-k button{min-height:44px;border-radius:9px;border:1px solid var(--line);background:var(--surface-2);color:var(--ink);font-family:var(--f-display);font-weight:600;font-size:1.05rem}
.calc-k button.d{background:var(--bg)}
.calc-k button.eq{grid-column:span 3;background:var(--steel);color:var(--steel-ink);border-color:var(--steel)}
.calc-k button:active{transform:scale(.97)}
.calc-use{width:100%;min-height:44px}
.calc-use:disabled{background:var(--surface-2);color:var(--muted)}
@media (min-width:601px){.calc-open .qz{padding-left:340px}}
@media (max-width:600px){
  .calc{left:0;right:0;bottom:0;width:auto;border-radius:16px 16px 0 0;padding:10px 12px calc(10px + env(safe-area-inset-bottom,0px));max-height:62vh;overflow-y:auto}
  .calc-k button{min-height:42px}
  .calc-open .qz{padding-bottom:60vh}
}

/* عيّنة المسائل في التجربة المجانية */
.sample{border-color:var(--steel);border-inline-start-width:4px}
.sample h2,.sample p{margin:0}
.sample .qbox{background:var(--surface-2)}
.s-tabs{display:flex;flex-wrap:wrap;gap:6px}
.s-tabs button{border:1px solid var(--line);background:transparent;border-radius:999px;padding:6px 14px;font-weight:600;font-size:.9rem;color:var(--muted);min-height:38px}
.s-tabs button[aria-selected="true"]{background:var(--steel);border-color:var(--steel);color:var(--steel-ink)}
.s-fb{display:flex;flex-direction:column;gap:8px;border-radius:10px;padding:12px 14px;border-inline-start:4px solid var(--ok);background:var(--ok-soft)}
.s-fb.x{border-inline-start-color:var(--bad);background:var(--bad-soft)}
.s-fb b{font-family:var(--f-display)}
.s-fb .sol{background:var(--surface)}

/* ===== صفحات الدخول والتسجيل والانتظار والإدارة ===== */
[hidden]{display:none!important}
#shell{max-width:1040px;margin:0 auto;padding-block:24px 48px}
.auth{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.1fr);gap:0;background:var(--surface);border:1px solid var(--line);border-radius:16px;overflow:hidden;min-height:560px}
.auth-form{padding:36px clamp(20px,4vw,44px);display:flex;flex-direction:column;gap:18px;justify-content:center;min-width:0}
.auth-art,#fband{--roof:#1d3954}
.auth-art{background:var(--panel);color:var(--panel-ink);display:flex;flex-direction:column;justify-content:space-between;gap:20px;padding:32px 28px 0;min-width:0;overflow:hidden}
.auth-art h2{font-size:clamp(1.3rem,2.6vw,1.7rem);font-weight:700;color:var(--panel-ink)}
.auth-art p{opacity:.85;font-size:.95rem;max-width:36ch}
.auth-art .eyebrow{color:var(--glass)}
.factory{display:block;width:calc(100% + 24px);margin-inline:-12px;height:auto}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.fname{font-size:.88rem;color:var(--muted);overflow-wrap:anywhere}
.tabs{display:grid;grid-template-columns:1fr 1fr;background:var(--surface-2);border:1px solid var(--line);border-radius:10px;padding:4px;gap:4px}
.tabs button{border:0;background:transparent;border-radius:7px;padding:9px 10px;font-weight:600;color:var(--muted)}
.tabs button[aria-selected="true"]{background:var(--surface);color:var(--ink);box-shadow:0 1px 3px rgba(0,0,0,.12)}
.fld{display:flex;flex-direction:column;gap:6px}
.fld label{font-weight:600;font-size:.92rem}
.fld input{font:inherit;color:var(--ink);background:var(--surface-2);border:1px solid var(--line);border-radius:9px;padding:11px 13px;width:100%;min-width:0}
.fld input:focus{border-color:var(--steel);outline:none;box-shadow:0 0 0 3px color-mix(in srgb,var(--steel) 25%,transparent)}
.fld input[dir=ltr]{text-align:left}
.pw{position:relative}
.pw input{padding-left:72px;padding-right:13px}
.pw button{position:absolute;left:6px;right:auto;top:50%;transform:translateY(-50%);border:0;background:transparent;color:var(--steel);font-size:.82rem;font-weight:600;padding:6px 8px}
.hint{font-size:.83rem;color:var(--muted)}
.btn-main{border:0;border-radius:10px;padding:12px 18px;font-weight:700;background:var(--steel);color:var(--steel-ink);font-size:1rem;text-decoration:none;display:inline-flex;align-items:center;justify-content:center}
.btn-main[disabled]{opacity:.6;cursor:progress}
.btn-ghost{border:1px solid var(--line);background:transparent;border-radius:9px;padding:8px 14px;font-weight:600;color:var(--ink)}
.link{border:0;background:transparent;color:var(--steel);font-weight:600;padding:0;text-decoration:underline;text-underline-offset:3px}
.alert{border-radius:9px;padding:10px 13px;font-size:.92rem;font-weight:500}
.alert.err{background:var(--bad-soft);color:var(--bad)}
.alert.ok{background:var(--ok-soft);color:var(--ok)}
.alert.info{background:var(--amber-soft);color:var(--amber-ink)}
.form-h h1{font-size:clamp(1.4rem,3vw,1.8rem)}
.form-h p{color:var(--muted);margin-top:4px}
.acct{margin:0;background:var(--surface-2);border:1px solid var(--line);border-radius:12px;overflow:hidden}
.acct>div{display:grid;grid-template-columns:8.5em minmax(0,1fr);gap:12px;align-items:baseline;padding:12px 16px}
.acct>div+div{border-top:1px solid var(--line)}
.acct dt{color:var(--muted);font-size:.86rem;font-weight:600}
.acct dd{margin:0;font-weight:700;overflow-wrap:anywhere}
.acct dd.em{text-align:right;font-weight:600}
.motto{margin:0;padding:16px 20px 16px 18px;border-radius:12px;background:var(--panel);color:var(--panel-ink);border:1px solid var(--line);box-shadow:inset -4px 0 0 var(--glass)}
.motto p{margin:0;font-family:var(--f-display);font-weight:700;font-size:clamp(1.1rem,2.5vw,1.3rem);line-height:1.6}
.motto span{display:block;margin-top:6px;font-size:.86rem;opacity:.8}
.state-ico{width:54px;height:54px;border-radius:14px;display:grid;place-items:center;background:var(--amber-soft);color:var(--amber-ink);font-family:var(--f-display);font-weight:700;font-size:1.4rem}

/* شريط المستخدم أعلى الصفحة */
#userbar{position:sticky;top:env(safe-area-inset-top,0px);z-index:15;background:color-mix(in srgb,var(--bg) 88%,transparent);backdrop-filter:blur(6px);border-bottom:1px solid var(--line);margin-inline:calc(-1 * max(16px,env(safe-area-inset-left,0px)))}
#userbar .in{max-width:780px;margin:0 auto;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px max(16px,env(safe-area-inset-left,0px))}
#userbar .who{display:flex;align-items:center;gap:10px;min-width:0}
#userbar .av{width:34px;height:34px;flex:none;border-radius:50%;display:grid;place-items:center;background:var(--steel);color:var(--steel-ink);font-family:var(--f-display);font-weight:700}
#userbar .nm{display:block;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#userbar .sub{display:block;font-size:.78rem;color:var(--muted);line-height:1.2}
#userbar .acts{display:flex;gap:8px;flex:none;align-items:center}
#userbar .acts button,#userbar .acts a{padding:6px 12px;font-size:.88rem}
body.wide #userbar .in{max-width:1040px}

/* لوحة الإدارة */
.adm{max-width:1040px;margin:0 auto;padding-block:20px 56px;display:flex;flex-direction:column;gap:20px}
.adm-sec{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:18px;display:flex;flex-direction:column;gap:14px}
.adm-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.adm-stat{background:var(--surface-2);border-radius:10px;padding:10px 12px}
.adm-stat b{display:block;font-family:var(--f-display);font-size:1.5rem;font-variant-numeric:tabular-nums}
.adm-stat span{font-size:.82rem;color:var(--muted)}
.ulist{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:10px;overflow:hidden}
.urow{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center;padding:12px 14px;border-bottom:1px solid var(--line)}
.urow:last-child{border-bottom:0}
.urow .u-nm{font-weight:700}
.urow .u-em{font-size:.86rem;color:var(--muted);overflow-wrap:anywhere}
.urow .u-dt{font-size:.82rem;color:var(--muted);margin-top:2px}
.urow .chip-s,.rr-h .chip-s{margin-inline-start:8px}
.u-acts{display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-content:flex-end}
.urow .u-det{grid-column:1/-1}
@media (max-width:600px){.urow{grid-template-columns:minmax(0,1fr)}.u-acts{justify-content:flex-start}}
.btn-ok,.btn-no{border:0;border-radius:9px;padding:8px 16px;font-weight:700;min-height:40px}
.btn-ok{background:var(--ok);color:#fff}
.btn-no{background:var(--bad);color:#fff}
.btn-ok:disabled,.btn-no:disabled,.btn-ghost:disabled{opacity:.55;cursor:progress}
.chip-s{display:inline-block;font-size:.75rem;font-weight:700;padding:1px 9px;border-radius:999px;vertical-align:middle;white-space:nowrap}
.chip-s.a{background:var(--ok-soft);color:var(--ok)}
.chip-s.p{background:var(--amber-soft);color:var(--amber-ink)}
.chip-s.x{background:var(--bad-soft);color:var(--bad)}
.bdg{display:inline-grid;place-items:center;min-width:22px;height:22px;padding:0 6px;border-radius:999px;font-size:.78rem;font-weight:700;font-variant-numeric:tabular-nums;vertical-align:middle}
.empty{padding:28px 16px;text-align:center;color:var(--muted)}
.filters{display:flex;flex-wrap:wrap;gap:6px}
.filters button{border:2px solid var(--line);background:transparent;border-radius:999px;padding:6px 14px;font-weight:600;font-size:.9rem;min-height:38px;color:var(--muted)}
.filters button[aria-pressed="true"]{background:var(--steel);border-color:var(--steel);color:var(--steel-ink)}

/* تقدّم المشترك */
.u-prog{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;margin-top:8px}
.u-ps{font-size:.84rem;color:var(--muted)}
.u-ps b{color:var(--ink)}
.pbar{display:inline-grid;grid-template-columns:repeat(14,10px);gap:3px}
.pbar i{height:10px;border-radius:3px;background:var(--line)}
.pbar i.d{background:var(--ok)}
.pbar i.c{background:var(--amber)}
.pbar i.f{background:var(--bad)}
.u-det{display:flex;flex-direction:column;gap:12px;margin-top:12px;padding:14px;border-radius:12px;background:var(--surface-2)}
.u-det h3{font-size:1rem;margin:4px 0 0}
.adm-stats.u-facts,.adm-stats.g-stats{grid-template-columns:repeat(auto-fit,minmax(120px,1fr))}
.sx-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:8px}
.sx{background:var(--surface);border:1px solid var(--line);border-inline-start:5px solid var(--line);border-radius:10px;padding:8px 10px;display:flex;flex-direction:column;gap:2px;min-width:0}
.sx.d{border-inline-start-color:var(--ok)}
.sx.c{border-inline-start-color:var(--amber)}
.sx.f{border-inline-start-color:var(--bad)}
.sx-h{display:flex;justify-content:space-between;gap:6px;font-size:.78rem}
.sx-n{font-weight:700;font-variant-numeric:tabular-nums}
.sx-s{color:var(--muted)}
.sx-t{font-weight:600;font-size:.88rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sx-m{display:flex;gap:8px;font-size:.78rem;color:var(--muted)}
.hist{list-style:none;margin:0;padding:0;border-radius:10px;overflow:hidden;background:var(--surface)}
.hist li{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:4px 10px;align-items:center;padding:8px 12px;border-bottom:1px solid var(--line);font-size:.88rem}
.hist li:last-child{border-bottom:0}
.h-s{font-weight:700;font-variant-numeric:tabular-nums}
.h-t{grid-column:1/-1;font-size:.78rem;color:var(--muted)}

/* البلاغات في لوحة الإدارة */
.rrow{display:flex;flex-direction:column;gap:6px;padding:14px;border-bottom:1px solid var(--line)}
.rrow:last-child{border-bottom:0}
.rrow.done{opacity:.7}
.rr-h{display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px}
.rr-h .u-dt{margin-inline-start:auto;font-size:.8rem;color:var(--muted)}
.rr-ctx{font-size:.84rem;color:var(--muted)}
.rr-ans{font-size:.88rem;background:var(--surface-2);border-radius:8px;padding:6px 10px}
.rr-msg{font-weight:500;white-space:pre-wrap;overflow-wrap:anywhere}
.rr-img img{display:block;max-width:min(100%,360px);max-height:280px;border-radius:10px;border:1px solid var(--line)}
.rrow .u-acts{justify-content:flex-start}
.rp-q{margin:0;padding:8px 12px;border-inline-start:4px solid var(--line);background:var(--surface-2);border-radius:8px;font-size:.88rem;color:var(--muted);overflow-wrap:anywhere}

/* نافذة «بلّغ عن خطأ» */
body.rp-lock{overflow:hidden}
.rp-ov{position:fixed;inset:0;z-index:60;background:var(--shade);display:grid;place-items:center;padding:20px;overflow-y:auto}
.rp{width:min(520px,100%);background:var(--surface);border-radius:16px;padding:18px;display:flex;flex-direction:column;gap:12px}
.rp-hd{display:flex;align-items:center;justify-content:space-between;gap:10px}
.rp-x{width:40px;height:40px;border-radius:50%;border:2px solid var(--line);background:transparent;font-size:1.4rem;line-height:1}
.rp-ctx{font-size:.86rem;color:var(--muted);font-weight:600}
.rp-lb{font-weight:600}
.rp textarea{font:inherit;color:var(--ink);width:100%;min-height:110px;resize:vertical;padding:10px 12px;border-radius:12px}
.rp textarea:focus{border-color:var(--steel);outline:none}
.rp-img,.rp-prev{display:flex;flex-direction:column;align-items:flex-start;gap:8px}
.rp-pick{display:inline-flex;align-items:center;gap:8px;cursor:pointer}
.rp-prev img{max-width:100%;max-height:200px;border-radius:10px;border:1px solid var(--line)}
@media (max-width:600px){
  .rp-ov{place-items:end center;padding:0}
  .rp{border-radius:20px 20px 0 0;max-height:92vh;overflow-y:auto;padding-bottom:calc(18px + env(safe-area-inset-bottom,0px))}
}

/* التنبيه المنبثق: يطلع تحت ويختفي */
.toast{position:fixed;z-index:90;left:50%;bottom:calc(20px + env(safe-area-inset-bottom,0px));transform:translate(-50%,20px);max-width:min(92vw,460px);padding:12px 18px;border-radius:14px;font-weight:600;text-align:center;box-shadow:0 10px 30px rgba(0,0,0,.3);opacity:0;pointer-events:none;transition:opacity .2s,transform .2s}
.toast.on{opacity:1;transform:translate(-50%,0)}

/* زر البلاغ والشريط العلوي في الجوال */
.rb{display:inline-flex;align-items:center;gap:6px}
.rep-l{margin:0}
.rep-btn{border:0;background:transparent;padding:4px 0;font-size:.86rem;font-weight:600;text-decoration:underline;text-underline-offset:3px;align-self:flex-start}
@media (max-width:520px){
  .rb-t,#userbar .sub{display:none}
  #userbar .acts{flex:1 1 auto;flex-wrap:wrap;justify-content:flex-end;gap:6px}
  #userbar .acts button,#userbar .acts a{padding:5px 10px;font-size:.8rem}
}

/* صفحة التعريف */
.intro{display:flex;flex-direction:column;gap:22px}
.lead{font-size:1.05rem;color:var(--muted);max-width:46ch}
.alt-l{gap:8px}
.back-l{font-size:.9rem;text-decoration:none}
.i-foot{text-align:center;font-size:.84rem;color:var(--muted)}
.feats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.ft{display:flex;flex-direction:column;gap:4px;padding:12px 14px}
.ft span{font-size:.92rem;color:var(--muted)}
.i-st{list-style:none;margin:0;padding:0}
.i-st li{display:flex;align-items:center;gap:12px;padding:8px 2px}
.i-st li:last-child{border-bottom:0}
.i-st .n{flex:none;min-width:2.2em;font-variant-numeric:tabular-nums}
.i-st li>span:nth-child(2){flex:1;min-width:0}
.steps{margin:0;padding-inline-start:22px;display:flex;flex-direction:column;gap:8px}

/* الجوال: صفحات الدخول عمود واحد */
@media (max-width:760px){
  .auth{grid-template-columns:minmax(0,1fr);min-height:0}
  .auth-art{display:none;order:-1;padding:20px 18px 0}
  .auth-form{padding:24px 18px 28px}
  .hero .row .btn-main{flex:1 1 100%}
}
.hero .cta{padding:13px 22px;font-size:1.05rem}
