/* دارُ الظلِّ السابع — موقعُ الدار · هويّةُ v5 «الأداة — داكنة» (‏2026-09-12)
   الألوانُ من مصدرِ الشركةِ الواحد (tokens.json) عبرَ scripts/sync_huwiyya.py — لا لونَ يُكتَبُ في هذا الملفِّ بيدٍ
   إلّا الأبيضُ نصًّا على الزرِّ الأساسيّ كما في ديوانِ الشركة. والمكوّناتُ على مفرداتِ الديوان (diwan.css):
   لوحٌ محفور · زرٌّ أساسيٌّ واحدٌ في المنطقة · شارةُ حالٍ بنقطةٍ وكلمة · مسطرةُ معايرة · الأرقامُ بالحبر. */
/* ⟦tokens:v5⟧ مولَّدٌ من design-system/nexus-prime-xr/tokens.json بـ scripts/sync_huwiyya.py — لا يُحرَّر يدويًّا */
:root {
  --bg: #0A0D12;
  --night: #0B1424;
  --deep: #07090D;
  --panel: #15181D;
  --raise: #1B2027;
  --line: #232830;
  --engrave: #2C323C;
  --edge: rgba(255, 255, 255, 0.06);
  --ink: #F2F4F7;
  --ink-2: #AEB5BF;
  --mute: #7C848F;
  --accent: #3D7BFF;
  --accent-ink: #8FB2FF;
  --accent-strong: #2F6BF0;
  --accent-press: #2A62E6;
  --accent-wash: rgba(61, 123, 255, 0.10);
  --accent-line: rgba(61, 123, 255, 0.45);
  --glow: rgba(61, 123, 255, 0.35);
  --live: #3DDC97;
  --wait: #FFB547;
  --down: #FF5A5F;
  --off: #7C8799;
  --live-wash: rgba(61, 220, 151, 0.12);
  --wait-wash: rgba(255, 181, 71, 0.12);
  --down-wash: rgba(255, 90, 95, 0.12);
  --live-line: rgba(61, 220, 151, 0.35);
  --wait-line: rgba(255, 181, 71, 0.35);
  --down-line: rgba(255, 90, 95, 0.38);
  --r-lg: 8px;
  --r-md: 6px;
  --r-sm: 4px;
  --ar: "IBM Plex Sans Arabic", "Noto Sans Arabic", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --lift: 0 18px 40px -22px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --grid: radial-gradient(rgba(174, 181, 191, 0.07) 1px, transparent 1.2px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --dur-1: 120ms;
  --dur-2: 180ms;
  --dur-3: 280ms;
  --dur-4: 460ms;
  --ease-breathe: cubic-bezier(0.37, 0, 0.63, 1);
  --paper-bg: #EEF1F4;
  --paper-bg-deep: #E4E8ED;
  --paper-panel: #E7EBF0;
  --paper-border: #C3CBD5;
  --paper-accent: #2F66E0;
  --paper-accent-dim: #2552B8;
  --paper-live: #16A06A;
  --paper-ink: #0C0E11;
  --paper-muted: #454D58;
  --paper-faint: #5F6773;
}
/* ⟦/tokens⟧ */

:root { --bar: 64px; --maxw: 1200px; --gut: clamp(16px, 4vw, 40px); --side: 248px; }

/* ─────────── الأساس ─────────── */
*, *::before, *::after { box-sizing: border-box; }
/* ‏09-12: صِيدَ في التصوير — .notice{display:flex} كانَ يغلبُ قاعدةَ المتصفّحِ لـ[hidden] فتظهرُ صناديقُ الخطأِ الفارغة */
[hidden] { display: none !important; }
html { background: var(--bg); color-scheme: dark; scroll-padding-top: calc(var(--bar) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; color: var(--ink); font-family: var(--ar);
  font-size: 16px; line-height: 1.75; direction: rtl; text-align: right; -webkit-font-smoothing: antialiased;
  background: radial-gradient(1100px 520px at 100% -8%, var(--night), transparent 62%), var(--grid) 0 0 / 24px 24px, var(--bg);
  background-attachment: fixed;
}
img, svg { max-width: 100%; }
a { color: var(--accent-ink); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.3; text-wrap: balance; font-weight: 600; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }
/* ‏09-12: العنوانُ الذي يُنقَلُ إليه التركيزُ برمجيًّا (tabindex=-1) ليس عنصرًا تفاعليًّا — كانَ يلبسُ إطارَ التركيزِ عندَ التحميل */
[tabindex="-1"]:focus { outline: none; }
.ic { display: inline-block; width: 1.1em; height: 1.1em; vertical-align: -0.18em; stroke: currentColor; fill: none;
  stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
/* ‏09-12: Plex Mono للأرقامِ وحدَها، وما فيه من حرفٍ عربيٍّ يرجعُ إلى Plex Sans Arabic — صِيدَ في التصوير «تجريبي محلّي»
   و«نجاح:» بخطٍّ أحاديِّ العرضِ متفرّقَ الحروف؛ فالخطأُ في صفحةٍ لا يُفرّقُ الحروفَ بعدَ اليوم */
:root { --mono-ar: "IBM Plex Mono", var(--ar); }
.mono, .num { font-family: var(--mono-ar); font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
bdi.fname { unicode-bidi: isolate; direction: ltr; }
.skip { position: absolute; inset-inline-start: 12px; top: -64px; z-index: 90; background: var(--accent-strong); color: #FFFFFF;
  padding: 8px 14px; border-radius: var(--r-md); transition: top var(--dur-2) var(--ease); }
.skip:focus { top: 12px; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gut); }
.label { font-size: 13px; color: var(--mute); }
.eyebrow { margin: 0 0 8px; font-family: var(--mono); font-size: 12px; letter-spacing: .2em; color: var(--mute);
  text-transform: uppercase; direction: ltr; text-align: right; }
.lede { color: var(--ink-2); font-size: 17px; max-width: 62ch; }
.muted { color: var(--ink-2); }
.hint { font-size: 13px; color: var(--mute); }

/* ─────────── العلامةُ والرأس ─────────── */
.mark { width: 34px; height: 34px; color: var(--ink-2); }
.mark .x { stroke: var(--accent); }
.bar { position: sticky; top: 0; z-index: 50; height: var(--bar); border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(10px); }
.bar .wrap { height: 100%; display: flex; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 600; font-size: 17px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.nav { display: flex; align-items: center; gap: 4px; margin-inline-start: 18px; }
.nav a { color: var(--ink-2); padding: 8px 12px; border-radius: var(--r-md); font-size: 15px; }
.nav a:hover { color: var(--ink); background: var(--raise); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.bar .acts { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.bar .menu-btn { display: none; }  /* خصوصيّةٌ أعلى من .btn الذي يليه وإلّا ظهرَ الزرُّ على المكتب */
@media (max-width: 900px) {
  .nav { position: fixed; inset: var(--bar) 0 auto 0; flex-direction: column; align-items: stretch; margin: 0; padding: 10px var(--gut) 16px;
    background: var(--panel); border-bottom: 1px solid var(--line); box-shadow: var(--lift); }
  .bar:not(.open) .nav { display: none; }
  .nav a { padding: 12px; }
  .bar .menu-btn { display: inline-flex; }
  .bar .acts .btn:not(.go) { display: none; }
}

/* ─────────── الأزرار ─────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px;
  background: transparent; border: 1px solid var(--line); border-radius: var(--r-md); padding: 8px 16px;
  font-size: 15px; color: var(--ink-2); white-space: nowrap; text-decoration: none;
  transition: border-color var(--dur-2) var(--ease), color var(--dur-2) var(--ease), background var(--dur-2) var(--ease), transform var(--dur-1) var(--ease); }
.btn:hover { border-color: var(--engrave); color: var(--ink); background: var(--raise); text-decoration: none; }
.btn.go { border-color: var(--accent-strong); color: #FFFFFF; background: var(--accent-strong); font-weight: 500; }
.btn.go:hover { border-color: var(--accent-press); background: var(--accent-press); }
.btn.lg { min-height: 48px; padding: 10px 22px; font-size: 16px; }
.btn.block { width: 100%; }
.btn.link { border-color: transparent; padding-inline: 6px; color: var(--accent-ink); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn:active { transform: scale(.98); }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-inline-end-color: transparent;
  animation: spin .8s linear infinite; display: none; }
.btn[aria-busy="true"] .spin { display: inline-block; }

/* ─────────── الألواحُ والشارات ─────────── */
.plate { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--lift); }
.pad { padding: clamp(16px, 2.4vw, 26px); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.card { display: flex; flex-direction: column; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 18px; box-shadow: inset 0 1px 0 var(--edge); color: var(--ink); transition: border-color var(--dur-2) var(--ease), transform var(--dur-2) var(--ease); }
a.card:hover { border-color: var(--engrave); text-decoration: none; transform: translateY(-2px); }
.card h3 { font-size: 18px; }
.card .ic-lg { width: 30px; height: 30px; color: var(--ink-2); }
.card .foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.badge { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; padding: 0 9px; border: 1px solid var(--line);
  border-radius: var(--r-sm); font-size: 13px; font-weight: 500; line-height: 1.8; color: var(--ink-2); background: var(--deep); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.live { color: var(--live); background: var(--live-wash); border-color: var(--live-line); }
.badge.wait { color: var(--wait); background: var(--wait-wash); border-color: var(--wait-line); }
.badge.down { color: var(--down); background: var(--down-wash); border-color: var(--down-line); }
.badge.off { color: var(--off); }
.badge.accent { color: var(--accent-ink); background: var(--accent-wash); border-color: var(--accent-line); }
.notice { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; border: 1px solid var(--wait-line);
  background: var(--wait-wash); border-radius: var(--r-md); color: var(--ink); font-size: 14px; }
.notice::before { content: ""; flex: 0 0 auto; width: 8px; height: 8px; margin-top: .6em; border-radius: 50%; background: var(--wait); box-shadow: 0 0 8px var(--wait-line); }
.notice.info { border-color: var(--line); background: var(--deep); }
.notice.info::before { background: var(--accent); box-shadow: 0 0 8px var(--glow); }
.notice.bad { border-color: var(--down-line); background: var(--down-wash); }
.notice.bad::before { background: var(--down); box-shadow: none; }

/* ─────────── مسطرةُ المعايرة ─────────── */
.ruler { position: relative; height: 14px; }
.ruler::after, .calibrated::after { content: ""; position: absolute; inset-inline: 14px; bottom: 6px; height: 8px; pointer-events: none;
  background: repeating-linear-gradient(90deg, var(--engrave) 0 1px, transparent 1px 40px) bottom / 100% 8px no-repeat,
              repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 8px) bottom / 100% 4px no-repeat; }
.calibrated { position: relative; padding-bottom: 22px; }
.topline { border-top: 2px solid var(--accent); }

/* ─────────── الرئيسيّة ─────────── */
.hero { display: grid; grid-template-columns: 1fr; gap: clamp(24px, 4vw, 56px); align-items: center; padding-block: clamp(36px, 7vw, 88px) 28px; }
.hero h1 { font-size: clamp(40px, 6.2vw, 76px); line-height: 1.12; letter-spacing: -.01em; }
.hero .lede { margin-top: 18px; font-size: clamp(16px, 1.6vw, 19px); }
.hero .acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.hero-visual { position: relative; aspect-ratio: 5 / 4; width: 100%; max-width: 560px; justify-self: center; }
.hero-visual canvas, .hero-visual svg { width: 100%; height: 100%; display: block; }
@media (min-width: 960px) { .hero { grid-template-columns: 1.05fr .95fr; } .hero-visual { justify-self: start; } }
.section { padding-block: clamp(36px, 6vw, 72px); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(24px, 3vw, 34px); }
.section-head p { color: var(--ink-2); max-width: 60ch; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--lift); }
.facts div { background: var(--panel); padding: 16px; }
.facts b { display: block; font-family: var(--mono-ar); font-size: 26px; font-weight: 500; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.facts span { display: block; margin-top: 8px; font-size: 13px; color: var(--mute); }

/* ─────────── مسطرةُ المراحلِ العشر ─────────── */
.stages { list-style: none; margin: 0; padding: 26px 0 0; display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); position: relative; }
.stages::before { content: ""; position: absolute; inset-inline: 5%; top: 30px; height: 1px; background: var(--engrave); }
.stages li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; min-width: 0; }
.stages .tick { width: 1px; height: 12px; background: var(--engrave); margin-top: -2px; }
.stages .gate .tick { height: 22px; background: var(--ink-2); }
.stages .done .tick { background: var(--ink); }
.stages .now .tick { background: var(--accent); box-shadow: 0 0 8px var(--glow); }
.stages .now::before { content: ""; position: absolute; top: -3px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--accent);
  background: var(--bg); box-shadow: 0 0 10px var(--glow); transition: transform var(--dur-3) var(--ease-out); }
.stages .nm { font-size: 13px; color: var(--mute); overflow-wrap: anywhere; line-height: 1.4; }
.stages .done .nm { color: var(--ink-2); }
.stages .now .nm { color: var(--ink); font-weight: 600; }
@media (max-width: 720px) {
  .stages { grid-template-columns: 1fr; padding: 0; gap: 0; }
  .stages::before { inset-inline: auto; inset-inline-start: 11px; top: 0; bottom: 0; width: 1px; height: auto; }
  .stages li { flex-direction: row; gap: 14px; padding: 7px 0; text-align: right; }
  .stages .tick { height: 1px; width: 12px; margin: 0 5px; }
  .stages .gate .tick { width: 22px; margin: 0; }
  .stages .now::before { inset-inline-start: 4px; top: calc(50% - 7px); }
}

/* ─────────── خطواتُ الرحلة (تبدأُ من اليمين) ─────────── */
.steps { list-style: none; margin: 0 0 22px; padding: 0; display: flex; gap: 0; counter-reset: s; }
.steps li { flex: 1 1 0; position: relative; padding-top: 22px; font-size: 13px; color: var(--mute); text-align: center; }
.steps li::before { content: ""; position: absolute; top: 4px; inset-inline-start: 50%; width: 12px; height: 12px; margin-inline-start: -6px;
  border-radius: 50%; border: 1px solid var(--engrave); background: var(--bg); z-index: 1; }
.steps li::after { content: ""; position: absolute; top: 10px; inset-inline-start: 50%; width: 100%; height: 1px; background: var(--engrave); }
.steps li:last-child::after { display: none; }
.steps .done { color: var(--ink-2); }
.steps .done::before { background: var(--ink-2); border-color: var(--ink-2); }
.steps .now { color: var(--ink); font-weight: 600; }
.steps .now::before { border: 2px solid var(--accent); box-shadow: 0 0 10px var(--glow); }

/* ─────────── الحقول ─────────── */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field > label, .field > .flabel { font-size: 14px; color: var(--ink-2); }
.in { width: 100%; min-height: 44px; background: var(--deep); border: 1px solid var(--line); border-radius: var(--r-md); padding: 9px 12px;
  color: var(--ink); transition: border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease); }
.in::placeholder { color: var(--mute); }
.in:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.in[aria-invalid="true"] { border-color: var(--down-line); }
textarea.in { min-height: 120px; resize: vertical; line-height: 1.7; }
select.in { appearance: none; }
.in.ltr { direction: ltr; text-align: left; font-family: var(--mono); }
.err { font-size: 13px; color: var(--down); min-height: 0; }
.err:empty { display: none; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > .grow { flex: 1 1 200px; }
.pw { position: relative; }
.pw .in { padding-inline-end: 48px; }
.pw button { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 36px; border: 0;
  background: transparent; color: var(--mute); border-radius: var(--r-sm); }
.pw button:hover { color: var(--ink); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); }
.check input { width: 18px; height: 18px; margin-top: .3em; accent-color: var(--accent); }

/* ─────────── خانةُ الرمز: مدخلٌ واحدٌ فوقَ ستِّ خلايا ─────────── */
.otp { position: relative; direction: ltr; width: min(100%, 360px); margin-inline: auto; }
.otp input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; font-family: var(--mono); letter-spacing: 3em;
  caret-color: transparent; border: 0; background: transparent; }
.otp .cells { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; pointer-events: none; }
.otp .cell { aspect-ratio: 4 / 5; display: grid; place-items: center; background: var(--deep); border: 1px solid var(--line); border-radius: var(--r-md);
  font-family: var(--mono-ar); font-size: 26px; color: var(--ink); box-shadow: inset 0 1px 0 var(--edge);
  transition: border-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease); }
.otp .cell.filled { transform: scale(.97); border-color: var(--engrave); }
.otp .cell.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.otp .cell.on:empty::after { content: ""; width: 2px; height: 26px; background: var(--accent); animation: breathe 1s steps(2) infinite; }
.otp.bad .cell { border-color: var(--down-line); }

/* ─────────── الرفع ─────────── */
.drop { display: grid; place-items: center; gap: 6px; padding: 22px; text-align: center; border: 1px dashed var(--engrave); border-radius: var(--r-lg);
  background: var(--deep); color: var(--ink-2); transition: border-color var(--dur-2) var(--ease), background var(--dur-2) var(--ease); cursor: pointer; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-wash); color: var(--ink); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.files { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.files li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--r-md); background: var(--panel); font-size: 14px; }
.progress { grid-column: 1 / -1; height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); transform-origin: right; transform: scaleX(var(--p, 0));
  transition: transform var(--dur-2) var(--ease); }

/* ─────────── التبويبُ والجداول ─────────── */
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; margin-bottom: 18px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; flex: 0 0 auto; background: transparent; border: 0; padding: 10px 0 12px; font-size: 15px; color: var(--mute); }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); }
.tab::after { content: ""; position: absolute; inset-inline: 0; bottom: -1px; height: 2px; background: var(--accent); transform: scaleX(0);
  transition: transform var(--dur-3) var(--ease-out); }
.tab[aria-selected="true"]::after { transform: none; box-shadow: 0 0 10px var(--glow); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: right; font-weight: 500; color: var(--mute); font-size: 13px; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: var(--raise); }
table.data .num, table.data .amount { white-space: nowrap; }  /* رقمُ الفاتورةِ كانَ ينكسرُ عندَ الشَّرطة */
.amount { font-family: var(--mono-ar); font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; white-space: nowrap; }

/* ─────────── المكتب: شريطٌ جانبيٌّ ومنطقةٌ رئيسة ─────────── */
.app { display: grid; grid-template-columns: 1fr; min-height: calc(100dvh - var(--bar)); }
.side { display: none; }
.app-main { min-width: 0; padding: 22px var(--gut) 96px; }
@media (min-width: 1000px) {
  .app { grid-template-columns: var(--side) 1fr; }
  .side { display: flex; flex-direction: column; gap: 4px; position: sticky; top: var(--bar); height: calc(100dvh - var(--bar));
    padding: 18px 12px; border-inline-end: 1px solid var(--line); background: color-mix(in srgb, var(--panel) 70%, transparent); }
}
.side a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-md); color: var(--ink-2); font-size: 15px; }
.side a:hover { background: var(--raise); color: var(--ink); text-decoration: none; }
.side a[aria-current="page"] { color: var(--ink); background: var(--raise); box-shadow: inset -2px 0 0 var(--accent); }
.side .brain { margin-top: auto; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--mute); padding: 10px 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--off); flex: 0 0 auto; }
.dot.live { background: var(--live); box-shadow: 0 0 8px var(--live-line); animation: breathe 4.8s ease-in-out infinite; }
.dot.wait { background: var(--wait); }
.dot.down { background: var(--down); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: clamp(22px, 2.6vw, 30px); }
.page-head .sub { color: var(--ink-2); margin-top: 4px; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 1100px) { .grid-2 { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); } }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.empty { padding: 28px; text-align: center; color: var(--ink-2); }
.tabbar { position: fixed; inset-inline: 0; bottom: 0; z-index: 40; display: flex; justify-content: space-around; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: var(--panel); border-top: 1px solid var(--line); }
.tabbar a { display: grid; justify-items: center; gap: 2px; min-width: 64px; padding: 6px; font-size: 12px; color: var(--mute); border-radius: var(--r-md); }
.tabbar a[aria-current="page"] { color: var(--ink); }
.tabbar .ic { width: 22px; height: 22px; }
@media (min-width: 1000px) { .tabbar { display: none; } }

/* ─────────── صفحاتُ الهويّةِ: لوحٌ واحدٌ في الوسط ─────────── */
.auth { min-height: calc(100dvh - var(--bar)); display: grid; place-items: center; padding: 32px var(--gut) 64px; }
.auth .plate { width: min(100%, 460px); }
.auth h1 { font-size: 28px; margin-bottom: 6px; }
.auth .alt { margin-top: 18px; text-align: center; font-size: 14px; color: var(--ink-2); }
.timer { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); }

/* ─────────── الفاتورة: ورقٌ مطبوعٌ بطقمِ الورق ─────────── */
.paper { background: var(--paper-bg); color: var(--paper-ink); border: 1px solid var(--paper-border); border-radius: var(--r-md);
  padding: clamp(18px, 3vw, 34px); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .8); }
.paper h2 { color: var(--paper-ink); font-size: 22px; }
.paper .rule { height: 1px; background: var(--paper-border); margin: 14px 0; }
.paper .muted, .paper .label { color: var(--paper-muted); }
.paper table { width: 100%; border-collapse: collapse; font-size: 14px; }
.paper th { text-align: right; color: var(--paper-muted); font-weight: 500; padding: 8px 0; border-bottom: 1px solid var(--paper-border); }
.paper td { padding: 10px 0; border-bottom: 1px solid var(--paper-border); }
.paper .total td { font-weight: 600; border-bottom: 0; font-size: 16px; }
.paper .stamp { display: inline-block; padding: 2px 10px; border: 1px solid var(--paper-border); border-radius: var(--r-sm); font-size: 13px; color: var(--paper-muted); }
.paper .qr { width: 132px; height: 132px; background: var(--paper-bg); }
.paper a { color: var(--paper-accent); }
@media print {
  @page { size: A4; margin: 14mm; }
  html, body { background: var(--paper-bg) !important; color: var(--paper-ink); }
  .bar, .side, .tabbar, .no-print, .toast { display: none !important; }
  .app { display: block; } .app-main { padding: 0; }
  .paper { box-shadow: none; border: 0; padding: 0; }
}

/* ─────────── التذييلُ والتنبيه ─────────── */
.site-foot { border-top: 1px solid var(--line); margin-top: 48px; padding-block: 28px 40px; color: var(--mute); font-size: 13px; }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; }
.site-foot a { color: var(--ink-2); }
.toast { position: fixed; inset-inline: 16px; bottom: 18px; z-index: 80; margin: 0 auto; display: flex; align-items: center; gap: 9px;
  width: fit-content; max-width: calc(100% - 32px); background: var(--raise); border: 1px solid var(--live-line); color: var(--ink);
  border-radius: var(--r-md); padding: 10px 16px; font-size: 14px; box-shadow: 0 16px 40px -10px rgba(0, 0, 0, .8), inset 0 1px 0 var(--edge);
  animation: toastin var(--dur-3) var(--ease-out) both; }
.toast::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--live); box-shadow: 0 0 8px var(--live-line); flex: 0 0 auto; }
.toast.bad { border-color: var(--down-line); }
.toast.bad::before { background: var(--down); box-shadow: none; }
.toast[hidden] { display: none !important; }
.sk { border: 1px solid var(--line); border-radius: var(--r-lg); min-height: 72px;
  background: linear-gradient(90deg, var(--panel) 0%, var(--raise) 45%, var(--panel) 90%) 0 0 / 250% 100%; animation: shimmer 1.6s linear infinite; }
dialog { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 0; width: min(92vw, 520px); box-shadow: var(--lift); }
dialog::backdrop { background: rgba(0, 0, 0, .6); backdrop-filter: blur(2px); }

/* ─────────── الحركة — تقولُ شيئًا، والخروجُ أسرعُ من الدخول ─────────── */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toastin { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes breathe { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes grow { from { transform: scaleX(0); } to { transform: none; } }
body[data-enter] .enter > * { animation: rise var(--dur-4) var(--ease-out) both; }
body[data-enter] .enter > :nth-child(2) { animation-delay: 60ms; }
body[data-enter] .enter > :nth-child(3) { animation-delay: 120ms; }
body[data-enter] .enter > :nth-child(4) { animation-delay: 180ms; }
body[data-enter] .enter > :nth-child(n+5) { animation-delay: 240ms; }
body[data-enter] .cards > * { animation: rise var(--dur-3) var(--ease-out) both; }
body[data-enter] .cards > :nth-child(2) { animation-delay: 65ms; }
body[data-enter] .cards > :nth-child(3) { animation-delay: 130ms; }
body[data-enter] .cards > :nth-child(4) { animation-delay: 195ms; }
body[data-enter] .cards > :nth-child(n+5) { animation-delay: 260ms; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media (pointer: coarse) {
  .btn, .nav a, .side a, .tab, .in { min-height: 44px; }
  .pw button { width: 44px; height: 44px; }
}
