/* Bot كلستر A — نظام التصميم الرسمي (التطبيق + لوحة الإدارة)
   هوية هادئة: أسطح كحلية/بيضاء، لون نحاسي واحد للخط الذهبي، أزرق فولاذي للعادي، رمادي لبدون ربط. */
:root {
  --bg: #0e141f;
  --surface: #151d2b;
  --surface-2: #1b2537;
  --line: #26324a;
  --line-2: #34425d;
  --text: #e8edf5;
  --muted: #97a4b8;
  --dim: #66748b;
  --gold: #c9a54e;          /* الخط الذهبي + الإجراء الرئيسي */
  --gold-strong: #e0c27a;   /* نص ذهبي على الأسطح */
  --gold-ink: #1d1505;      /* نص فوق خلفية ذهبية */
  --gold-soft: rgba(201, 165, 78, .12);
  --gold-line: rgba(201, 165, 78, .4);
  --steel: #7f95b3;         /* الخط العادي */
  --steel-ink: #0e141f;
  --steel-soft: rgba(127, 149, 179, .14);
  --grey: #8a93a3;          /* بدون ربط */
  --ok: #3aae7c;
  --warn: #d79a32;
  --bad: #e05764;
  --info: #6c9be0;
  --field: #101828;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 30px -18px rgba(0, 0, 0, .7);
  --r: 12px;
  --r-lg: 16px;
  --font: 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  /* أسماء مستعملة في لوحة الإدارة والسكربت */
  --panel: var(--surface); --panel-2: var(--surface-2); --stroke: var(--line); --stroke-2: var(--line-2);
  --gold-1: var(--gold-strong); --gold-2: var(--gold); --gold-3: var(--gold); --display: var(--font); --glass: var(--surface);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f2f4f7;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --line: #e1e6ee;
  --line-2: #cbd3df;
  --text: #121826;
  --muted: #5a6577;
  --dim: #8b95a5;
  --gold: #a7822c;
  --gold-strong: #86671d;
  --gold-ink: #ffffff;
  --gold-soft: rgba(167, 130, 44, .1);
  --gold-line: rgba(167, 130, 44, .38);
  --steel: #587091;
  --steel-ink: #ffffff;
  --steel-soft: rgba(88, 112, 145, .1);
  --grey: #7c8594;
  --ok: #1f8a5c; --warn: #a96a07; --bad: #c33442; --info: #2f6bc4;
  --field: #ffffff;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px -16px rgba(16, 24, 40, .2);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.6;
  min-height: 100dvh; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--gold-strong); text-decoration: none; }
.num, .mono { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
h1, h2, h3, h4 { text-wrap: balance; }

/* ---------- عناصر عامة ---------- */
[data-i] { display: inline-grid; place-items: center; }
[data-i] > svg { width: 1.15em; height: 1.15em; }
.gold-text { color: var(--gold-strong); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text);
  padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 14.5px; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--surface-2); border-color: var(--dim); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn.primary { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: color-mix(in srgb, var(--ok) 9%, var(--surface)); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); background: color-mix(in srgb, var(--bad) 8%, var(--surface)); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--surface-2); }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn.lg { padding: 13px 18px; font-size: 15.5px; }
.btn.block { width: 100%; }
button:not(:disabled):active, a.btn:active { transform: translateY(1px); }
.field { display: grid; gap: 7px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 600; }
.input {
  width: 100%; background: var(--field); border: 1px solid var(--line-2); border-radius: 10px;
  padding: 12px 14px; font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.input::placeholder { color: var(--dim); }
.input-ic { position: relative; }
.input-ic > [data-i] { position: absolute; inset-inline-start: 13px; top: 50%; transform: translateY(-50%); color: var(--dim); pointer-events: none; }
.input-ic > [data-i] svg { width: 18px; height: 18px; }
.input-ic .input { padding-inline-start: 42px; }
.hint { font-size: 12.5px; color: var(--muted); }
.err { color: var(--bad); font-size: 13.5px; }
.err:empty { display: none; }
.check { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--muted); cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--gold); }
.link { background: none; border: 0; padding: 0; color: var(--gold-strong); font-weight: 600; font-size: 12.5px; text-decoration: underline; text-underline-offset: 3px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
}
.chip svg { width: 14px; height: 14px; flex: none; color: var(--muted); }
.chip.gold { background: var(--gold-soft); border-color: var(--gold-line); color: var(--gold-strong); }
.chip.gold svg { color: var(--gold-strong); }
.chip.normal { background: var(--steel-soft); border-color: color-mix(in srgb, var(--steel) 40%, transparent); color: var(--steel); }
.chip.none { color: var(--grey); }
.chip.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.chip.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.chip.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }
.k { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.k.gold { background: var(--gold); }
.k.normal { background: var(--steel); }
.k.none { background: transparent; box-shadow: inset 0 0 0 1.5px var(--grey); }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--line-2); border-top-color: var(--gold); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }
.toast {
  position: fixed; inset-inline: 16px; bottom: calc(18px + var(--safe-b)); margin-inline: auto; max-width: 420px; z-index: 50;
  background: #1b2537; color: #e8edf5; border: 1px solid #34425d; border-radius: 10px; padding: 11px 16px;
  box-shadow: var(--shadow); font-weight: 600; text-align: center; font-size: 14px; animation: fade .2s ease;
}
.toast.bad { border-color: var(--bad); }

/* ---------- شاشة البداية: الشعار يُرسم بهدوء ---------- */
#splash { position: fixed; inset: 0; z-index: 100; display: grid; place-content: center; justify-items: center; gap: 14px; background: var(--bg); transition: opacity .35s ease; }
#splash svg { width: 96px; height: 96px; }
#splash .s-ring { stroke-dasharray: 490; stroke-dashoffset: 490; animation: s-draw .7s .1s ease-out forwards; }
#splash .s-bolt { opacity: 0; animation: s-in .35s .45s ease forwards; }
#splash b { font-size: 18px; font-weight: 700; color: var(--text); opacity: 0; animation: s-in .35s .5s ease forwards; }
#splash.out { opacity: 0; pointer-events: none; }
@keyframes s-draw { to { stroke-dashoffset: 0; } }
@keyframes s-in { to { opacity: 1; } }

/* شريط تقدم رفيع وثابت أعلى الشاشة */
#topbar { position: fixed; top: env(safe-area-inset-top, 0px); inset-inline: 0; height: 2px; z-index: 60; pointer-events: none; opacity: 0; overflow: hidden; }
#topbar::after { content: ''; position: absolute; top: 0; bottom: 0; width: 35%; background: var(--gold); }
#topbar.run { opacity: 1; }
#topbar.run::after { animation: bar 1.1s ease-in-out infinite; }
#topbar.done { opacity: 0; transition: opacity .3s; }
@keyframes bar { from { right: -35%; } to { right: 100%; } }

/* سحب للتحديث */
#ptr { position: fixed; top: calc(env(safe-area-inset-top, 0px) - 44px); left: 50%; z-index: 40; width: 38px; height: 38px; margin-left: -19px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line-2); color: var(--muted); box-shadow: var(--shadow);
  transform: translateY(var(--d, 0)); opacity: 0; transition: opacity .15s; }
#ptr.show { opacity: 1; }
#ptr.ready { color: var(--gold); }
#ptr.spin [data-i] { animation: spin .8s linear infinite; }
#ptr svg { width: 18px; height: 18px; }

/* ---------- البوابة ---------- */
.gate { min-height: 100dvh; display: grid; place-items: center; padding: 28px 16px calc(28px + var(--safe-b)); }
.gate-grid { width: 100%; max-width: 1040px; display: grid; grid-template-columns: 1fr; gap: 28px; align-items: center; }
.showcase { display: none; }
.auth { width: 100%; max-width: 420px; margin: 0 auto; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; margin-bottom: 22px; }
.brand img { width: 72px; height: 72px; border-radius: 18px; }
.brand h1 { margin: 0; font-size: 26px; font-weight: 700; line-height: 1.25; }
.brand p { margin: 0; color: var(--muted); font-size: 14px; }
.glass { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow); }
.auth-card { padding: 18px 22px 24px; }
.form { display: grid; gap: 16px; }
.tabs { position: relative; display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.tabs button { position: relative; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 6px 12px; border: 0; background: none; color: var(--muted); font-weight: 600; font-size: 14.5px; }
.tabs button svg { width: 17px; height: 17px; }
.tabs button.on { color: var(--text); }
.tabs-ind { position: absolute; bottom: -1px; height: 2px; inset-inline-start: 0; width: 50%; background: var(--gold); transition: transform .25s ease; }
[dir="rtl"] .tabs[data-on="admin"] .tabs-ind { transform: translateX(-100%); }
.lock-note { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.lock-note svg { width: 17px; height: 17px; flex: none; color: var(--gold); margin-top: 2px; }
.wait { text-align: center; display: grid; gap: 12px; justify-items: center; padding-top: 6px; }
.wait h2 { margin: 0; font-size: 19px; }
.wait p { margin: 0; color: var(--muted); }
.pulse-ring { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); }
.pulse-ring [data-i] svg { width: 28px; height: 28px; }
.pulse-ring.bad { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); }
.req-id { background: var(--surface-2); border: 1px solid var(--line); padding: 5px 12px; border-radius: 8px; font-size: 13px; color: var(--muted); }
.req-id b { color: var(--text); letter-spacing: .06em; }
.row-c { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.gate-foot { display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap; text-align: center; color: var(--dim); font-size: 12px; margin: 16px 0 0; }

@media (min-width: 900px) {
  .gate { padding: 40px 32px; }
  .gate-grid { grid-template-columns: 1.1fr 1fr; gap: 48px; }
  .auth .brand { display: none; }
  .showcase { display: grid; gap: 24px; padding: 40px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
  .sc-brand { display: flex; align-items: center; gap: 12px; }
  .sc-brand img { border-radius: 14px; width: 52px; height: 52px; }
  .sc-brand b { font-size: 19px; display: block; line-height: 1.2; }
  .sc-brand small { color: var(--muted); }
  .sc-title { margin: 0; font-size: 34px; line-height: 1.3; font-weight: 700; }
  .sc-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .mini { position: relative; border-radius: 12px; padding: 16px; display: grid; gap: 2px; border: 1px solid var(--line); border-top: 3px solid var(--k-color, var(--line)); background: var(--surface-2); }
  .mini b { font-size: 30px; line-height: 1.15; }
  .mini small { color: var(--muted); }
  .mini-k { font-size: 12px; font-weight: 700; width: fit-content; padding: 2px 9px; border-radius: 99px; margin-bottom: 4px; }
  .mini.gold { --k-color: var(--gold); }
  .mini.gold .mini-k { background: var(--gold); color: var(--gold-ink); }
  .mini.normal { --k-color: var(--steel); }
  .mini.normal .mini-k { background: var(--steel); color: var(--steel-ink); }
  .mini-ring { display: none; }
  .sc-feats { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 12px; }
  .sc-feats li { display: flex; align-items: center; gap: 12px; color: var(--muted); }
  .sc-feats [data-i] { width: 32px; height: 32px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); color: var(--gold); }
  .sc-feats [data-i] svg { width: 16px; height: 16px; }
  .orbit { display: none; }
}

/* ---------- التطبيق ---------- */
.app { max-width: 760px; margin: 0 auto; padding: 0 16px calc(40px + var(--safe-b)); }
.top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 0 10px; background: var(--bg); border-bottom: 1px solid var(--line); margin-bottom: 14px;
}
.top .logo { display: flex; align-items: center; gap: 10px; }
.top .logo img { width: 36px; height: 36px; border-radius: 10px; }
.top .logo b { font-size: 16px; display: block; line-height: 1.2; }
.top .logo small { color: var(--muted); font-size: 12px; }
.top-acts { display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.avatar { border-radius: 50%; font-weight: 700; font-size: 15px; }
.icon-btn.avatar.gold { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.admin-link { color: var(--gold-strong); border-color: var(--gold-line); }
.net { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); margin-inline-end: 6px; vertical-align: 2px; }
.net.off { background: var(--dim); }

.search { position: relative; display: flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; padding: 5px; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; }
.search:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; font-size: 20px; font-weight: 600; padding: 8px 4px; font-variant-numeric: tabular-nums; }
.search input::placeholder { font-size: 15.5px; font-weight: 500; color: var(--dim); }
.search .go { height: 44px; padding: 0 18px; }
.search .lead-wrap { position: relative; width: 38px; height: 38px; flex: none; border: 0; background: none; color: var(--muted); border-radius: 8px; display: grid; place-items: center; }
.search .lead-wrap > span { position: absolute; transition: opacity .15s, transform .15s; }
.search .lead-wrap svg { width: 20px; height: 20px; }
.search .lead-wrap .ic-x { opacity: 0; transform: scale(.7); }
.search .lead-wrap.has .ic-s { opacity: 0; transform: scale(.7); }
.search .lead-wrap.has .ic-x { opacity: 1; transform: none; }
.search .mode { flex: none; height: 36px; min-width: 40px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font-weight: 700; font-size: 13.5px; }
.search .mode.on { color: var(--gold-strong); border-color: var(--gold-line); }
.under { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 10px 0 8px; }
.under .hint { font-size: 12px; }
.kind-f { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--surface); }
.kind-f button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 5px 12px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.kind-f button + button { border-inline-start: 1px solid var(--line); }
.kind-f button.on { background: var(--surface-2); color: var(--text); }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; min-height: 4px; margin: 4px 0 12px; }
.suggest button { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
.suggest button:hover { border-color: var(--line-2); }
.demo-bar { display: flex; align-items: center; gap: 9px; margin: 0 0 10px; padding: 8px 12px; border-radius: 10px; font-size: 13px; color: var(--info); background: color-mix(in srgb, var(--info) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--info) 30%, transparent); }
.demo-bar svg { width: 16px; height: 16px; flex: none; }
.demo-bar.over { color: var(--warn); background: color-mix(in srgb, var(--warn) 8%, var(--surface)); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.offline-bar { background: color-mix(in srgb, var(--warn) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); color: var(--warn); border-radius: 10px; padding: 8px 12px; font-size: 13px; margin-top: 8px; text-align: center; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); margin: 6px 0 4px; overflow: hidden; }
.stats div { padding: 12px 14px; display: grid; gap: 2px; min-width: 0; }
.stats div + div { border-inline-start: 1px solid var(--line); }
.stats span { color: var(--muted); font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.stats b { font-size: 22px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stats .g span::before, .stats .n span::before { content: ''; width: 8px; height: 8px; border-radius: 50%; }
.stats .g span::before { background: var(--gold); }
.stats .n span::before { background: var(--steel); }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 24px 0 10px; color: var(--muted); font-size: 13px; font-weight: 700; }
.section-title svg { width: 16px; height: 16px; vertical-align: -3px; }
.recent { display: flex; flex-wrap: wrap; gap: 6px; }
.empty { text-align: center; padding: 34px 16px 10px; color: var(--muted); display: grid; justify-items: center; gap: 8px; }
.empty .art { width: 96px; height: 96px; }
.empty h3 { margin: 0; color: var(--text); font-size: 18px; }
.empty p { margin: 0; max-width: 340px; font-size: 14px; }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; width: 100%; max-width: 420px; }
.legend div { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); text-align: start; font-size: 12.5px; border-inline-start: 3px solid var(--k-color); }
.legend b { display: block; font-size: 14px; color: var(--text); }
.legend .lg-gold { --k-color: var(--gold); }
.legend .lg-normal { --k-color: var(--steel); }
.govs #govs { display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.gov { display: grid; grid-template-columns: minmax(70px, 110px) 1fr auto auto; align-items: center; gap: 12px; padding: 9px 14px; border: 0; background: none; text-align: start; }
.gov + .gov { border-top: 1px solid var(--line); }
.gov:hover { background: var(--surface-2); }
.gov-n { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gov-bar { height: 6px; border-radius: 4px; background: var(--steel-soft); overflow: hidden; }
.gov-bar i { display: block; height: 100%; width: var(--w); background: var(--gold); border-radius: 4px; }
.gov-p { font-weight: 700; font-size: 13px; min-width: 3.2ch; text-align: end; }
.gov small { color: var(--dim); font-size: 11.5px; }
.install { display: flex; align-items: center; gap: 12px; margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.install img { width: 36px; height: 36px; border-radius: 9px; }
.install div { flex: 1; font-size: 13px; color: var(--muted); }
.install div b { display: block; color: var(--text); font-size: 14px; }
.foot { text-align: center; color: var(--dim); font-size: 12px; margin-top: 28px; }

/* ---------- بطاقة الموقع ---------- */
.result { animation: fade .25s ease; }
.hero { --k: var(--dim); position: relative; border-radius: var(--r-lg); padding: 20px; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--k); box-shadow: var(--shadow); }
.hero.gold { --k: var(--gold); }
.hero.normal { --k: var(--steel); }
.hero.none { --k: var(--grey); }
.hero .frame { display: none; }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.hero .site-lbl { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.hero .site-no { font-size: 42px; font-weight: 700; line-height: 1.1; margin: 2px 0 10px; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.hero .badge { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 8px; font-weight: 700; font-size: 13.5px; white-space: nowrap; background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.hero .badge svg { width: 16px; height: 16px; }
.hero.gold .badge { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.hero.normal .badge { background: var(--steel); border-color: var(--steel); color: var(--steel-ink); }
.hero.none .badge { background: transparent; border-color: var(--grey); color: var(--grey); }
.hero .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.dial { position: relative; width: 104px; height: 104px; flex: none; }
.dial svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.dial .track { stroke: var(--line); opacity: 1 !important; }
.dial .arc { stroke: var(--k); stroke-dasharray: var(--len) 999; transition: stroke-dasharray .6s ease; }
.dial .lbl { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.dial .lbl b { font-size: 26px; font-weight: 700; color: var(--text); }
.dial .lbl b.gold-text { color: var(--text); }
.dial .lbl b svg { width: 24px; height: 24px; color: var(--grey); }
.dial .lbl small { font-size: 11px; color: var(--muted); }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 13px 14px; min-width: 0; }
.tile.wide { grid-column: 1 / -1; }
.tile .t { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.tile .t svg { width: 16px; height: 16px; color: var(--gold); flex: none; }
.tile .v { font-size: 19px; font-weight: 700; margin-top: 4px; overflow-wrap: anywhere; line-height: 1.35; font-variant-numeric: tabular-nums; }
.tile .v .date { font-size: 16px; }
.tile .v small { font-size: 12.5px; color: var(--muted); font-weight: 500; margin-inline-start: 4px; }
.tile .sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.tile.accent { border-inline-start: 3px solid var(--gold); }
.tile.warn { border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: color-mix(in srgb, var(--warn) 6%, var(--surface)); }
.tile.warn .sub { color: var(--warn); font-weight: 600; }
.tile .actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.tile .actions a, .tile .actions button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 8px; font-size: 13px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); }
.tile .actions svg { width: 15px; height: 15px; }
.tile .actions .wa { color: var(--ok); }
.strip { position: relative; height: 10px; border-radius: 5px; margin-top: 12px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.strip i { position: absolute; top: 0; bottom: 0; background: var(--gold); }
.strip.normal i { background: var(--steel); }
.strip-ticks { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--dim); margin-top: 4px; }

.block { margin-top: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 4px 14px; }
.block h4 { margin: 10px 0 4px; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.block h4 svg, .kv svg { width: 16px; height: 16px; flex: none; color: var(--gold); }
.kv { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.kv:first-of-type { border-top: 0; }
.kv span { color: var(--muted); }
.kv b { font-weight: 600; text-align: end; overflow-wrap: anywhere; }
details.more summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; padding: 11px 0; font-size: 13px; font-weight: 700; color: var(--muted); }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::after { content: ''; margin-inline-start: auto; width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .2s; }
details.more[open] summary::after { transform: rotate(-135deg); }
details.more summary svg { width: 16px; height: 16px; color: var(--gold); }
.timeline { list-style: none; margin: 0; padding: 2px 0 6px; }
.timeline li { position: relative; padding: 9px 20px 9px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.timeline li:first-child { border-top: 0; }
.timeline li::before { content: ''; position: absolute; right: 4px; top: 17px; width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.timeline li.gold::before { background: var(--gold); }
.timeline li.normal::before { background: var(--steel); }
.timeline li em { display: block; font-style: normal; font-size: 12px; color: var(--dim); }
.timeline li.switch { justify-content: flex-start; gap: 8px; color: var(--gold-strong); font-size: 12.5px; font-weight: 700; padding-block: 6px; background: var(--gold-soft); border-radius: 6px; border-top: 0; padding-inline: 10px; margin: 2px 0; }
.timeline li.switch::before { display: none; }
.timeline li.switch svg { width: 15px; height: 15px; }
.timeline .d { color: var(--muted); font-size: 13px; white-space: nowrap; }
.pchart { display: flex; align-items: flex-end; gap: 10px; height: 116px; padding: 8px 2px 4px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.pc { flex: 1; max-width: 60px; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
.pc i { width: 100%; border-radius: 4px 4px 0 0; background: var(--dim); }
.pc.gold i { background: var(--gold); }
.pc.normal i { background: var(--steel); }
.pc-v { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pc small { font-size: 11px; color: var(--dim); white-space: nowrap; }
.chip.up { font-weight: 700; }

.notfound { text-align: center; padding: 30px 16px; border: 1px dashed var(--line-2); border-radius: var(--r-lg); color: var(--muted); background: var(--surface); }
.notfound b { color: var(--text); font-size: 20px; display: block; margin-bottom: 4px; }
.nf-art { display: block; width: 110px; height: 84px; margin: 0 auto 8px; color: var(--dim); }
.dym { margin-top: 14px; display: grid; gap: 8px; justify-items: center; }
.dym > span { font-size: 13px; font-weight: 700; color: var(--text); }
.dym .suggest { justify-content: center; margin: 0; }
.rlist { display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.ritem { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 12px; text-align: start; padding: 11px 14px; border: 0; background: none; }
.ritem + .ritem { border-top: 1px solid var(--line); }
.ritem:hover { background: var(--surface-2); }
.ritem b { font-size: 17px; font-variant-numeric: tabular-nums; }
.ritem .r-meta { display: grid; min-width: 0; }
.ritem .r-meta span { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ritem .r-meta small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ritem .r-kind { font-size: 12px; color: var(--muted); font-weight: 600; }
.ritem.gold .r-kind { color: var(--gold-strong); }
.mtable-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.mtable { width: 100%; border-collapse: collapse; font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mtable th { text-align: start; color: var(--muted); font-size: 12px; font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.mtable td { padding: 9px 12px; border-bottom: 1px solid var(--line); }
.mtable tr:last-child td { border-bottom: 0; }
.mtable tbody tr[data-s] { cursor: pointer; }
.mtable tbody tr[data-s]:hover td { background: var(--surface-2); }
.mtable tr.miss td { color: var(--dim); }

/* هيكل التحميل */
.sk { display: grid; gap: 10px; }
.sk-hero { border-radius: var(--r-lg); padding: 20px; border: 1px solid var(--line); background: var(--surface); display: grid; gap: 12px; min-height: 170px; }
.sk i { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--line) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.sk i.big { height: 38px; } .sk i.pill { height: 26px; }
.sk .w30 { width: 30%; } .sk .w40 { width: 40%; } .sk .w50 { width: 50%; } .sk .w60 { width: 60%; } .sk .w70 { width: 70%; }
.sk-t { display: grid; gap: 10px; min-height: 80px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- القائمة ---------- */
dialog.menu { padding: 0; border: 0; background: none; color: inherit; max-width: calc(100vw - 32px); }
dialog.menu::backdrop { background: rgba(8, 12, 20, .55); }
dialog.menu[open] { animation: fade .2s ease; }
.menu-card { padding: 20px; display: grid; gap: 10px; width: min(340px, calc(100vw - 32px)); }
.me { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.me b { display: block; font-size: 16px; }
.me small { color: var(--muted); font-size: 12.5px; }
.avatar.big { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; font-weight: 700; background: var(--gold); color: var(--gold-ink); flex: none; }
.theme-sw { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.theme-sw button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: none; padding: 8px 6px; font-weight: 600; font-size: 13px; color: var(--muted); }
.theme-sw button + button { border-inline-start: 1px solid var(--line); }
.theme-sw button svg { width: 15px; height: 15px; }
.theme-sw button.on { background: var(--surface-2); color: var(--text); }
@media (max-width: 620px) {
  dialog.menu { margin: auto 0 0; width: 100%; max-width: 100%; }
  dialog.menu .menu-card { width: 100%; border-radius: 16px 16px 0 0; padding-bottom: calc(20px + var(--safe-b)); border-bottom: 0; }
  dialog.menu .menu-card::before { content: ''; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--line-2); margin: -6px auto 4px; }
  dialog.menu[open] { animation: sheet-up .25s ease-out; }
  dialog.menu.closing { animation: sheet-down .2s ease-in forwards; }
}
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes sheet-down { to { transform: translateY(100%); } }

/* انتقال هادئ بين الشاشات */
::view-transition-old(root) { animation: vt-out .12s ease both; }
::view-transition-new(root) { animation: vt-in .18s ease both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }

@media (min-width: 620px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero { padding: 24px; }
  .hero .site-no { font-size: 50px; }
  .dial { width: 120px; height: 120px; }
}
@media (max-width: 380px) {
  .hero .site-no { font-size: 36px; }
  .dial { width: 88px; height: 88px; }
  .dial .lbl b { font-size: 22px; }
  .search input { font-size: 18px; }
  .search .go { padding: 0 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
