/* ══════════════════════════════════════════════════════════════════════════
   محطة — ورقة الأنماط الوحيدة للمتجر.
   تحلّ محلّ حزمة daisyUI/Tailwind المُنقّاة وملفّات التصحيح التي كانت تعوّض
   ما حُذف منها. كل قاعدة هنا مسمّاة ومقصودة:
     1. إعادة ضبط + التوكِنات (ألوان العلامة، سلّم رمادي آبل، النصّ، المسافات)
     2. سلّم الأنماط النصّية
     3. المكوّنات: أزرار، حقول، شارات، حوارات/ألواح، جداول، بطاقات، إشعارات
     4. الهيكل: الصفحات العامة، صفحات الحساب، الشريط الجانبي والقائمة
     5. الصفحات: الرئيسية، المتجر، الطلبات، الحساب
   ══════════════════════════════════════════════════════════════════════════ */

/* ───────────────── 1. إعادة ضبط وتوكِنات ───────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text); font: var(--t-body); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; margin: 0; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
:focus { outline: none; }
:focus-visible { box-shadow: var(--focus); border-radius: 8px; }
::selection { background: var(--accent-soft); }
[hidden] { display: none !important; }
dialog { margin: 0; padding: 0; border: 0; background: transparent; color: inherit; }

:root {
  color-scheme: light;
  --font: 'SF Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-display: 'SF Pro Display', 'SF Pro', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  /* سلّم النصّ الوحيد (12 · 14 · 16 · 18 · 22 · 28) — كل مقاس في المتجر واحد من هذه. الأوزان: 700 للعناوين، 600 للتسميات،
     400 للنصّ. نصّ الجوال 16px (لا يكبّر iOS الحقول). العناوين تكبر درجة واحدة فقط على الشاشات العريضة (أسفل). */
  --t-display: 700 28px/36px var(--font-display);
  --t-title-1: 700 22px/30px var(--font-display);
  --t-title-2: 700 18px/26px var(--font-display);
  --t-title-3: 700 16px/24px var(--font);
  --t-body: 400 16px/24px var(--font);
  --t-body-strong: 600 16px/24px var(--font);
  --t-callout: 400 14px/20px var(--font);
  --t-callout-strong: 600 14px/20px var(--font);
  --t-caption: 400 12px/16px var(--font);
  --t-caption-strong: 600 12px/16px var(--font);
  /* السعر: أرقام بوزن العناوين — 16 في البطاقات، 20 للإجمالي */
  --t-price: 700 16px/20px var(--font-display);
  --t-total: 700 20px/26px var(--font-display);

  /* سلّم المسافات (4/8): لا قيمة خارجه */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px; --s-16: 64px;
  /* إيقاع الصفحة: --gutter بين المحتوى وحافّة الشاشة، --page-gap بين كتل الصفحة، --section-gap بين عنوان القسم ومحتواه.
     أوسع منذ 2026-10-16 (المالك: «العناصر قريبة جداً من بعضها»): 32/16 على الجوال، 32/20 من 640px، 40/20 على الحاسوب */
  --gutter: 16px; --page-gap: 32px; --section-gap: 16px; --page-max: 1120px;
  --r-1: 8px; --r-2: 12px; --r-3: 16px; --r-4: 20px; --r-full: 999px;
  --control: 44px; --control-sm: 36px; --control-lg: 52px;
  --sidebar-w: 288px; --topbar-h: 56px; --content-max: 1120px;

  /* العلامة — من ملف الشعار نفسه */
  --brand-teal: #02A1A5; --brand-red: #FD655A; --brand-amber: #FCC300;
  --bc: 24% 0 0;
  --reference-page: oklch(100% 0 0);
  /* رمادي آبل */
  --gray-0: #FFFFFF; --gray-1: #F5F5F7; --gray-2: #E8E8ED; --gray-3: #D2D2D7; --gray-4: #AEAEB2; --gray-5: #8E8E93; --gray-6: #636366; --gray-10: #1C1C1E;

  --bg: var(--gray-1);
  --surface: var(--gray-0);
  --surface-2: var(--gray-1);
  --surface-3: var(--gray-2);
  --border: rgb(0 0 0 / .08);
  --border-strong: rgb(0 0 0 / .16);
  --text: #1D1D1F;
  --text-2: var(--gray-6);
  --text-3: var(--gray-5);
  --on-accent: #FFFFFF;

  --accent: #0B7F83;            /* تركواز العلامة بدرجة تحمل نصاً أبيض: 4.8:1 (#0E8F93 كان 3.9:1) */
  --accent-strong: #0A7A7E;
  --accent-soft: rgb(2 161 165 / .12);
  --accent-text: #087478;
  --danger: #D93A2F; --danger-soft: rgb(253 101 90 / .14); --danger-text: #B32A20;
  --warning-soft: rgb(252 195 0 / .2); --warning-text: #7A5A00;
  --success-soft: rgb(2 161 165 / .14); --success-text: #087478;

  --focus: 0 0 0 3px rgb(2 161 165 / .35);
  --shadow-1: 0 1px 2px rgb(0 0 0 / .06), 0 1px 1px rgb(0 0 0 / .04);
  --shadow-2: 0 4px 12px rgb(0 0 0 / .08), 0 1px 3px rgb(0 0 0 / .06);
  --shadow-3: 0 16px 40px rgb(0 0 0 / .16), 0 2px 8px rgb(0 0 0 / .08);
  --material: rgb(245 245 247 / .78);
  --material-strong: rgb(255 255 255 / .82);
  --public-header-bg: oklch(97% 0 0 / .8);
  --backdrop-glow: .3;
  --scrim: rgb(0 0 0 / .42);

  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --dur-1: 120ms; --dur-2: 200ms; --dur-3: 320ms;
}
@media (prefers-reduced-motion: reduce) { :root { --dur-1: 0ms; --dur-2: 0ms; --dur-3: 0ms; } }
@media (min-width: 640px) { :root { --gutter: 24px; --section-gap: 20px; } }
@media (min-width: 1024px) {
  :root { --gutter: 32px; --page-gap: 40px;
    --t-display: 700 32px/40px var(--font-display); --t-title-1: 700 24px/32px var(--font-display); --t-title-2: 700 20px/28px var(--font-display); }
}
/* ───────── الوضع الداكن: لوحة مصمّمة لا مقلوبة — أسطح دافئة متدرّجة، تركواز العلامة أفتح درجة كي
   يبلغ تباين AA على الداكن، والظلال أعمق بدل أن تختفي. يتبع النظام، ويمكن اختياره يدوياً. ───────── */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bc: 86% 0 0;
  --reference-page: #0C0C0E;
  --gray-0: #161618; --gray-1: #0C0C0E; --gray-2: #242427; --gray-3: #3A3A3F; --gray-4: #5B5B61; --gray-5: #8E8E94; --gray-6: #ADADB3; --gray-10: #2C2C30;
  --bg: #0C0C0E;
  --surface: #161618;
  --surface-2: #1D1D20;
  --surface-3: #2A2A2E;
  --border: rgb(255 255 255 / .09);
  --border-strong: rgb(255 255 255 / .18);
  --text: #F5F5F7;
  --text-2: #ADADB3;
  --text-3: #85858B;
  --accent: #14AFB3;
  --on-accent: #04292A;  /* the light teal of dark mode carries dark text (white was 2.7:1) */
  --accent-strong: #3CC6CA;
  --accent-soft: rgb(20 175 179 / .2);
  --accent-text: #5CD6D9;
  --danger: #FF6A5E; --danger-soft: rgb(255 106 94 / .16); --danger-text: #FF8C82;
  --warning-soft: rgb(252 195 0 / .16); --warning-text: #FFD255;
  --success-soft: rgb(20 175 179 / .18); --success-text: #5CD6D9;
  --focus: 0 0 0 3px rgb(60 198 202 / .45);
  --shadow-1: 0 1px 2px rgb(0 0 0 / .5);
  --shadow-2: 0 6px 18px rgb(0 0 0 / .45), 0 1px 3px rgb(0 0 0 / .4);
  --shadow-3: 0 18px 48px rgb(0 0 0 / .6), 0 2px 8px rgb(0 0 0 / .4);
  --material: rgb(22 22 24 / .74);
  --material-strong: rgb(22 22 24 / .86);
  --public-header-bg: rgb(28 28 31 / .78);
  --scrim: rgb(0 0 0 / .6);
  --backdrop-glow: .16;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bc: 86% 0 0;
    --reference-page: #0C0C0E;
    --gray-0: #161618; --gray-1: #0C0C0E; --gray-2: #242427; --gray-3: #3A3A3F; --gray-4: #5B5B61; --gray-5: #8E8E94; --gray-6: #ADADB3; --gray-10: #2C2C30;
    --bg: #0C0C0E;
    --surface: #161618;
    --surface-2: #1D1D20;
    --surface-3: #2A2A2E;
    --border: rgb(255 255 255 / .09);
    --border-strong: rgb(255 255 255 / .18);
    --text: #F5F5F7;
    --text-2: #ADADB3;
    --text-3: #85858B;
    --accent: #14AFB3;
    --on-accent: #04292A;
    --accent-strong: #3CC6CA;
    --accent-soft: rgb(20 175 179 / .2);
    --accent-text: #5CD6D9;
    --danger: #FF6A5E; --danger-soft: rgb(255 106 94 / .16); --danger-text: #FF8C82;
    --warning-soft: rgb(252 195 0 / .16); --warning-text: #FFD255;
    --success-soft: rgb(20 175 179 / .18); --success-text: #5CD6D9;
    --focus: 0 0 0 3px rgb(60 198 202 / .45);
    --shadow-1: 0 1px 2px rgb(0 0 0 / .5);
    --shadow-2: 0 6px 18px rgb(0 0 0 / .45), 0 1px 3px rgb(0 0 0 / .4);
    --shadow-3: 0 18px 48px rgb(0 0 0 / .6), 0 2px 8px rgb(0 0 0 / .4);
    --material: rgb(22 22 24 / .74);
    --material-strong: rgb(22 22 24 / .86);
    --public-header-bg: rgb(28 28 31 / .78);
    --scrim: rgb(0 0 0 / .6);
    --backdrop-glow: .16;
  }
}

@media (prefers-reduced-transparency: reduce) { :root { --material: var(--gray-1); } }

/* ───────────────── 2. أنماط نصّية ───────────────── */
.t-display { font: var(--t-display); } .t-title-1 { font: var(--t-title-1); } .t-title-2 { font: var(--t-title-2); }
.t-title-3 { font: var(--t-title-3); } .t-body { font: var(--t-body); } .t-body-strong { font: var(--t-body-strong); }
.t-callout { font: var(--t-callout); } .t-callout-strong { font: var(--t-callout-strong); }
.t-caption { font: var(--t-caption); } .t-caption-strong { font: var(--t-caption-strong); }
.text-2 { color: var(--text-2); } .text-3 { color: var(--text-3); } .text-accent { color: var(--accent-text); } .text-danger { color: var(--danger-text); }
.num, .ltr { direction: ltr; unicode-bidi: isolate; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.link { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.link:hover { color: var(--accent-strong); }
.stack { display: flex; flex-direction: column; } .stack-2 { gap: var(--s-2); } .stack-3 { gap: var(--s-3); } .stack-4 { gap: var(--s-4); } .stack-6 { gap: var(--s-6); }
.row { display: flex; align-items: center; } .row-2 { gap: var(--s-2); } .row-3 { gap: var(--s-3); } .between { justify-content: space-between; } .wrap { flex-wrap: wrap; } .grow { flex: 1 1 auto; min-width: 0; }
.center { text-align: center; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ───────────────── 3. المكوّنات ───────────────── */
/* أزرار — التغذية الراجعة عند الضغط لا عند الإفلات */
.ui-btn {
  --h: var(--control);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  height: var(--h); padding: 0 var(--s-5); border-radius: var(--r-2);
  font: var(--t-body-strong); white-space: nowrap; user-select: none; position: relative;
  border: 1px solid transparent;
  transition: background var(--dur-1) var(--ease-out), color var(--dur-1), border-color var(--dur-1), transform var(--dur-1) var(--ease-out), box-shadow var(--dur-1);
}
.ui-btn:active:not(:disabled) { transform: scale(.97); }
.ui-btn:disabled { opacity: .5; }
.ui-btn > svg { width: 18px; height: 18px; flex: none; }
.ui-btn-sm { --h: var(--control-sm); padding: 0 var(--s-4); font: var(--t-callout-strong); border-radius: var(--r-1); }
.ui-btn-lg { --h: var(--control-lg); padding: 0 var(--s-6); font: 600 17px/1 var(--font); border-radius: var(--r-3); }
.ui-btn-block { width: 100%; }
.ui-btn-primary { background: var(--accent); color: var(--on-accent); }
.ui-btn-primary:hover:not(:disabled) { background: var(--accent-strong); }
.ui-btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-1); }
.ui-btn-secondary:hover:not(:disabled) { background: var(--surface-2); }
.ui-btn-tertiary { background: transparent; color: var(--accent-text); }
.ui-btn-tertiary:hover:not(:disabled) { background: var(--accent-soft); }
.ui-btn-ghost { background: transparent; color: var(--text-2); }
.ui-btn-ghost:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.ui-btn-danger-outline { background: transparent; color: var(--danger-text); border-color: var(--danger); }
.ui-btn-danger-outline:hover:not(:disabled) { background: var(--danger-soft); }
.ui-btn-danger-soft { background: var(--danger-soft); color: var(--danger-text); }
.ui-btn-danger-soft:hover:not(:disabled) { background: var(--danger); color: #fff; }
.ui-btn-loading { color: transparent !important; pointer-events: none; }
.ui-btn-loading::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--on-accent); border-inline-end-color: transparent; animation: spin .7s linear infinite; }
.ui-btn-secondary.ui-btn-loading::after, .ui-btn-tertiary.ui-btn-loading::after, .ui-btn-ghost.ui-btn-loading::after { border-color: var(--text-2); border-inline-end-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { display: inline-grid; place-items: center; width: var(--control); height: var(--control); border-radius: var(--r-2); color: var(--text-2); transition: background var(--dur-1), color var(--dur-1), transform var(--dur-1) var(--ease-out); }
.icon-btn:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.icon-btn:active:not(:disabled) { transform: scale(.94); }
.icon-btn > svg { width: 20px; height: 20px; }
.icon-btn-sm { width: var(--control-sm); height: var(--control-sm); }
.icon-btn-sm > svg { width: 18px; height: 18px; }

/* حقول — تسمية 13/600، ضابط 44px، تلميح 12، خطأ 12 بأيقونة */
.field { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.field-label { font: var(--t-callout-strong); color: var(--text); display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); }
.field-label .req { color: var(--danger-text); margin-inline-start: 2px; }
/* a link at the end of the label («نسيت كلمة السر؟») keeps the label's line height: its larger touch area is drawn
   around it (::after, stopping short of the input below) — a 44px-tall link pushed this one field's input 30px lower
   than every other field's */
.field-label .link { position: relative; min-height: 0 !important; display: inline; }
.field-label .link::after { content: ""; position: absolute; inset: -10px -10px -6px; }
.field-hint { font: var(--t-caption); color: var(--text-2); }
.field-error { font: var(--t-caption-strong); color: var(--danger-text); display: flex; gap: var(--s-1); align-items: flex-start; }
.field-error::before { content: ""; flex: none; width: 14px; height: 14px; margin-top: 1px; border-radius: 50%; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1a7 7 0 1 1 0 14A7 7 0 0 1 8 1zm0 3.5a.9.9 0 0 0-.9.9v3.6a.9.9 0 0 0 1.8 0V5.4A.9.9 0 0 0 8 4.5zm0 6.3a1 1 0 1 0 0 2 1 1 0 0 0 0-2z'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1a7 7 0 1 1 0 14A7 7 0 0 1 8 1zm0 3.5a.9.9 0 0 0-.9.9v3.6a.9.9 0 0 0 1.8 0V5.4A.9.9 0 0 0 8 4.5zm0 6.3a1 1 0 1 0 0 2 1 1 0 0 0 0-2z'/%3E%3C/svg%3E") center/contain no-repeat; }
.control {
  display: flex; align-items: center; gap: var(--s-2); min-height: var(--control); padding: 0 var(--s-4);
  background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--r-2);
  transition: border-color var(--dur-1), box-shadow var(--dur-1), background var(--dur-1);
}
.control:hover { border-color: var(--text-3); }
.control:focus-within { border-color: var(--accent); box-shadow: var(--focus); }
.control[data-invalid="true"] { border-color: var(--danger); }
.control[data-invalid="true"]:focus-within { box-shadow: 0 0 0 3px var(--danger-soft); }
.control[data-disabled="true"] { background: var(--surface-2); color: var(--text-3); }
.control > input, .control > select, .control > textarea { flex: 1; min-width: 0; width: 100%; background: transparent; border: 0; padding: 0; font: var(--t-body); color: inherit; text-align: start; }
.control > input:focus-visible, .control > select:focus-visible, .control > textarea:focus-visible { box-shadow: none; }
.control > input::placeholder { color: var(--text-3); }
/* the field fills its box, so a tap anywhere on the box focuses it (not only the 23px text line) */
.control > input, .control > select { align-self: stretch; }
.control > select { appearance: none; padding-inline-end: var(--s-6); cursor: pointer; }
.control .affix { color: var(--text-2); font: var(--t-body-strong); flex: none; display: inline-flex; align-items: center; }
.control .affix > svg { width: 18px; height: 18px; }
.control .affix-btn { color: var(--accent-text); font: var(--t-callout-strong); height: 32px; padding: 0 var(--s-2); margin-inline-end: calc(-1 * var(--s-2)); border-radius: 6px; }
.control .affix-btn:hover { background: var(--accent-soft); }
.control-select { position: relative; }
.control-select .chevron { position: absolute; inset-inline-end: var(--s-4); width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.control-search { width: 100%; max-width: 384px; min-height: 48px; border-radius: var(--r-1); background: var(--surface-2); border-color: transparent; }
.control-search:hover { border-color: var(--border-strong); }
.control-search > input { font-size: 16px; }

/* OTP: ستّ خانات */
.otp { display: flex; gap: var(--s-2); direction: ltr; justify-content: center; }
.otp > input { width: 46px; height: 54px; text-align: center; font: 600 22px/1 var(--font); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-2); transition: border-color var(--dur-1), box-shadow var(--dur-1); }
.otp > input:focus { border-color: var(--accent); box-shadow: var(--focus); outline: none; }
.otp[data-invalid="true"] > input { border-color: var(--danger); }
/* the six boxes share the row and narrow together (at most 52px each): at 320px six fixed 44px boxes pushed the card
   past the screen's edge. Each box stays 52px tall — the tap target — and the first takes the whole code anyway. */
.otp-wrap, .otp-row { width: 100%; }
.otp-row > .otp { flex: 1 1 100%; min-width: 0; }
.otp > input { flex: 1 1 0; min-width: 0; max-width: 52px; width: auto; }

/* مفتاح ومربّع */
.switch { display: flex; align-items: center; gap: var(--s-3); cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 46px; height: 28px; padding: 3px; border-radius: var(--r-full); background: var(--gray-4); transition: background var(--dur-2) var(--ease-out); flex: none; }
.switch .track::after { content: ""; display: block; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .3); transition: transform var(--dur-2) var(--ease-out); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(-18px); }
.switch input:focus-visible + .track { box-shadow: var(--focus); }
.switch input:disabled + .track { opacity: .45; }
.switch > .stack { min-width: 0; flex: 1; }
.checkbox { display: flex; align-items: flex-start; gap: var(--s-3); cursor: pointer; font: var(--t-body); }
.checkbox input { appearance: none; width: 20px; height: 20px; margin-top: 2px; flex: none; border-radius: 6px; border: 1.5px solid var(--border-strong); background: var(--surface); display: grid; place-items: center; transition: background var(--dur-1), border-color var(--dur-1); }
.checkbox input:checked { background: var(--accent); border-color: var(--accent); }
.checkbox input:checked::after { content: ""; width: 10px; height: 6px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.checkbox input[aria-invalid="true"] { border-color: var(--danger); }
.checkbox input:focus-visible { box-shadow: var(--focus); }

/* عدّاد الكمية */
.stepper { display: inline-flex; align-self: flex-start; align-items: center; height: var(--control); border: 1px solid var(--border-strong); border-radius: var(--r-2); background: var(--surface); overflow: hidden; direction: ltr; }
.stepper > button { width: 44px; height: 100%; display: grid; place-items: center; color: var(--text-2); transition: background var(--dur-1); }
.stepper > button:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.stepper > button:disabled, .stepper > button[aria-disabled="true"] { opacity: .35; }
/* every touch shows on the button itself (tap highlight is off site-wide), no double-tap zoom, no text selection on a hold */
.stepper > button { touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.stepper > button:active:not(:disabled):not([aria-disabled="true"]) { background: var(--accent-soft, var(--surface-2)); color: var(--accent-text, var(--text)); }
.stepper > button > svg { transition: transform var(--dur-1); }
.stepper > button:active:not(:disabled):not([aria-disabled="true"]) > svg { transform: scale(.82); }
.stepper > button > svg { width: 16px; height: 16px; }
.stepper > input { width: 56px; height: 100%; text-align: center; border: 0; border-inline: 1px solid var(--border); background: transparent; font: var(--t-body-strong); }

/* خيارات الفئة (radio rows) */
.options { display: flex; flex-direction: column; gap: var(--s-2); }
.option { display: flex; align-items: center; gap: var(--s-3); min-height: var(--control); padding: var(--s-2) var(--s-4); border: 1px solid var(--border-strong); border-radius: var(--r-2); background: var(--surface); cursor: pointer; transition: border-color var(--dur-1), background var(--dur-1), box-shadow var(--dur-1); }
.option:hover { border-color: var(--text-3); }
.option input { position: absolute; opacity: 0; width: 0; height: 0; }
.option .radio { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--border-strong); display: grid; place-items: center; transition: border-color var(--dur-1); }
.option .radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); transform: scale(0); transition: transform var(--dur-2) var(--ease-out); }
.option[data-checked="true"] { border-color: var(--accent); background: var(--accent-soft); }
.option[data-checked="true"] .radio { border-color: var(--accent); }
.option[data-checked="true"] .radio::after { transform: scale(1); }
.option:has(input:focus-visible) { box-shadow: var(--focus); }
.option .opt-label { flex: 1; font: var(--t-body-strong); }
.option .opt-price { font: var(--t-body-strong); }

/* شرائح التصفية */
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-3); border-radius: var(--r-2); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.segmented::-webkit-scrollbar { display: none; }
.segmented > button { height: 36px; padding: 0 var(--s-4); border-radius: 9px; font: var(--t-callout-strong); color: var(--text-2); white-space: nowrap; transition: background var(--dur-2) var(--ease-out), color var(--dur-1), box-shadow var(--dur-2); }
.segmented > button:hover { color: var(--text); }
.segmented > button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
@media (pointer: coarse) { .segmented > button { height: 40px; } }

/* شارات الحالة: خلفية خفيفة ونصّ داكن */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 var(--s-3); border-radius: var(--r-full); font: var(--t-caption-strong); white-space: nowrap; background: var(--surface-3); color: var(--text-2); }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip-ok { background: var(--success-soft); color: var(--success-text); }
.chip-wait { background: var(--warning-soft); color: var(--warning-text); }
.chip-bad { background: var(--danger-soft); color: var(--danger-text); }
.chip-in { background: var(--success-soft); color: var(--success-text); } .chip-out { background: var(--danger-soft); color: var(--danger-text); }
.chip-plain::before { display: none; }

/* بطاقة / لوح */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-3); box-shadow: var(--shadow-1); }
.card-pad { padding: var(--s-6); }
@media (max-width: 640px) { .card-pad { padding: var(--s-5); } }

/* حالات فارغة وهياكل */
.empty { padding: var(--s-10) var(--s-5); text-align: center; display: flex; flex-direction: column; align-items: center; gap: var(--s-2); }
.empty-icon { width: 48px; height: 48px; border-radius: var(--r-3); display: grid; place-items: center; background: var(--surface-3); color: var(--text-3); margin-bottom: var(--s-2); }
.empty-icon > svg { width: 24px; height: 24px; }
.empty h3 { font: var(--t-title-3); }
.empty p { font: var(--t-callout); color: var(--text-2); max-width: 44ch; }
.empty .actions { margin-top: var(--s-3); display: flex; gap: var(--s-2); flex-wrap: wrap; justify-content: center; }
/* بحث بلا نتائج: الأقسام أزرار تلتفّ على الجوال، وواتساب تحتها (components/SearchEmpty.jsx) */
.search-empty-cats { margin-top: var(--s-3); display: flex; gap: var(--s-2); flex-wrap: wrap; justify-content: center; max-width: 100%; }
.search-empty-cats > .ui-btn { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.search-empty-wa { margin-top: var(--s-2); }
.search-empty-wa .wa { color: var(--accent-text); font-weight: 600; min-height: 44px; }

/* الجداول: أعمدة بعرض مقصود، صفوف متناسقة بلا فراغات زائدة، تحويم هادئ؛ على الجوال بطاقات */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font: var(--t-callout); }
.table th { text-align: start; padding: 6px var(--s-3); font: var(--t-caption-strong); color: var(--text-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 6px var(--s-3); height: 38px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
/* the table shows from 1280px only (cards below — DataTable.jsx): columns keep the widths they are given and the
   column without one (product, details) takes the rest; auto layout squeezed the order number and the product */
.table { table-layout: fixed; }
/* the order number and its copy icon on one line (inline-block put the icon under the number) */
.table td.ltr > .copy { display: inline-flex; white-space: nowrap; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .num { text-align: end; direction: ltr; }
.table td.ltr { text-align: right; }
.table td.ltr > *, .table td .ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; text-align: right; }
.table td.ltr > code, .table td.ltr > .text-2 { white-space: nowrap; }
.table th.cell-date, .table td.cell-date { text-align: right; }
.table td.cell-date > * { direction: ltr; unicode-bidi: isolate; display: inline-block; text-align: right; }
.table td .kv-inline { display: flex; flex-direction: column; gap: 1px; font: var(--t-caption); }
.table td .kv-inline > div { display: flex; gap: var(--s-2); align-items: baseline; }
.table td .kv-inline dt { color: var(--text-2); white-space: nowrap; }
.table td .kv-inline dd { color: var(--text); }
.table .cell-primary { font: var(--t-callout-strong); color: var(--text); }
.table .cell-sub { font: var(--t-caption); color: var(--text-2); margin-top: 1px; }
.table .price { font: var(--t-body-strong); }
.table .thumb { width: 32px; height: 32px; border-radius: var(--r-1); object-fit: cover; background: var(--surface-3); flex: none; }
/* المُعرف كاملاً (UUID بلا بادئة) بخطّ أحادي المسافات؛ لا يلتفّ إلا عند الشرطات */
.copy { display: inline-flex; align-items: flex-start; gap: 6px; font: 400 12px/16px ui-monospace, 'SF Mono', Menlo, Consolas, monospace; color: var(--text-2); padding: 3px 6px; margin: -3px -6px; border-radius: 6px; direction: ltr; unicode-bidi: isolate; text-align: left; max-width: 100%; }
.copy > span { overflow-wrap: normal; }
.copy.cell-code { white-space: pre-line; }
.table td.ltr > .copy.cell-code { display: block; overflow-wrap: anywhere; }
.copy > svg { flex: none; margin-top: 1px; }
.copy:hover { background: var(--surface-3); color: var(--text); }
.copy > svg { width: 13px; height: 13px; }
.rows { display: flex; flex-direction: column; }
.rowcard { display: grid; grid-template-columns: minmax(42%, 1fr) auto; gap: var(--s-1) var(--s-3); padding: var(--s-4) 0; border-bottom: 1px solid var(--border); }
.rowcard:last-child { border-bottom: 0; }
.rowcard .rc-title { font: var(--t-body-strong); display: flex; align-items: center; gap: var(--s-3); min-width: 0; }
.rowcard .rc-title .thumb { width: 40px; height: 40px; border-radius: var(--r-2); object-fit: cover; background: var(--surface-3); flex: none; }
.rowcard .rc-title .stack { min-width: 0; }
.rowcard .rc-sub { font: var(--t-caption); color: var(--text-2); }
/* the title keeps its share; a long rejection reason in the status chip wraps instead of squeezing it */
.rowcard .rc-end { min-width: 0; text-align: end; display: flex; flex-direction: column; align-items: flex-end; gap: var(--s-1); }
.rowcard .rc-meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); font: var(--t-caption); color: var(--text-2); }
.rowcard .rc-meta > span > b { font-weight: 600; color: var(--text); }
/* from tablet width up the list sits on one card as wide as the account panels: rows across the whole content put the
   price 600px away from its product, with nothing between */
@media (min-width: 640px) {
  .rows { max-width: 820px; padding: 0 var(--s-5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-3); box-shadow: var(--shadow-1); }
}

.steps { display: flex; gap: var(--s-2); align-items: center; font: var(--t-caption-strong); color: var(--text-2); }
.steps > span { display: inline-flex; align-items: center; gap: var(--s-1); }
.steps > span[aria-current="step"] { color: var(--accent-text); }
.steps .dot { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); font: var(--t-caption-strong); }
.steps > span[aria-current="step"] .dot { background: var(--accent); color: #fff; }
.steps .sep { width: 16px; height: 1px; background: var(--border-strong); }

/* تعليمات الدفع */
.instructions { display: flex; flex-direction: column; gap: var(--s-2); }
.instruction { display: flex; align-items: center; gap: var(--s-3); font: var(--t-body); line-height: 1.7; }
.instruction.code { padding: var(--s-2) var(--s-3); border-radius: var(--r-2); background: var(--surface-2); border: 1px solid var(--border); font: var(--t-callout); }
.instruction.code > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.instruction .copy-btn { flex: none; height: 32px; padding: 0 var(--s-3); border-radius: var(--r-1); font: var(--t-caption-strong); color: var(--accent-text); border: 1px solid var(--accent-soft); background: var(--surface); display: inline-flex; align-items: center; gap: 4px; transition: background var(--dur-1); }
.instruction .copy-btn:hover { background: var(--accent-soft); }
.instruction .copy-btn > svg { width: 14px; height: 14px; }

/* منطقة رفع الوصل */
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-2); padding: var(--s-4); border: 1.5px dashed var(--border-strong); border-radius: var(--r-3); cursor: pointer; color: var(--text-2); text-align: center; transition: border-color var(--dur-1), background var(--dur-1); min-height: 96px; }
.dropzone:hover, .dropzone[data-over="true"] { border-color: var(--accent); background: var(--accent-soft); }
.dropzone > svg { width: 24px; height: 24px; color: var(--text-3); }
.dropzone[data-invalid="true"] { border-color: var(--danger); }
.dropzone-file { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3); border: 1px solid var(--border); border-radius: var(--r-3); background: var(--surface-2); }
.dropzone-file img { width: 56px; height: 56px; border-radius: var(--r-2); object-fit: cover; flex: none; }
.dropzone-file .stack { min-width: 0; flex: 1; }

/* ملخّص المبلغ */
.summary { display: grid; grid-template-columns: 1fr auto; gap: var(--s-2) var(--s-4); padding: var(--s-4); border-radius: var(--r-2); background: var(--surface-2); font: var(--t-body); }
.summary dt { color: var(--text-2); }
.summary dd { text-align: end; direction: ltr; font: var(--t-body-strong); }
.summary .total dt, .summary .total dd { font: var(--t-title-3); }
.summary .neg dd { color: var(--danger-text); }

/* الإشعارات */
/* الإشعارات بعيداً عن الشعار والقائمة: على الجوال تحت الشريط العلوي (لا تغطّي أزرار الأوراق السفلية)،
   وعلى سطح المكتب في الزاوية السفلية المقابلة للقائمة الجانبية (يسار الشاشة). */
.toast-live { position: fixed; inset-inline: 0; top: calc(env(safe-area-inset-top) + var(--topbar-h, 56px) + var(--s-2)); z-index: 60; display: flex; justify-content: center; padding: 0 var(--s-4); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: var(--s-3); max-width: min(100%, 460px); padding: var(--s-3) var(--s-4); background: var(--gray-10); color: #fff; border-radius: var(--r-3); box-shadow: var(--shadow-3); font: var(--t-callout); animation: toast-in var(--dur-3) var(--ease-out); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } }
.toast > svg { width: 18px; height: 18px; flex: none; }
.toast-ok > svg { color: var(--brand-teal); } .toast-err > svg { color: var(--brand-red); } .toast-info > svg { color: #fff; }
/* the toast's one link («جرّبه من بطاقات رقمية»): inline after the text, a tap target of its own */
.toast-act { display: inline-block; padding: 4px 0; color: #fff; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.toast .toast-x { margin-inline-start: auto; color: rgb(255 255 255 / .7); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; }
.toast .toast-x:hover { color: #fff; background: rgb(255 255 255 / .12); }
/* الصفحات العامة: تحت شريطها العائم. صفحات الدخول بلا شريط: أسفل الشاشة بعيداً عن الشعار فوق البطاقة. */
body:has(.public-header) .toast-live { top: calc(var(--shell-top) + var(--shell-h) + var(--s-2)); }
body:has(.auth) .toast-live { top: auto; bottom: 0; padding-bottom: calc(var(--s-4) + env(safe-area-inset-bottom)); }
body:has(.auth) .toast { animation-name: toast-in-up; }
@keyframes toast-in-up { from { opacity: 0; transform: translateY(12px) scale(.97); } }
@media (min-width: 900px) {
  .toast-live, body:has(.public-header) .toast-live, body:has(.auth) .toast-live { inset-inline: auto 0; top: auto; bottom: 0; justify-content: flex-end; padding: 0 var(--s-6) calc(var(--s-6) + env(safe-area-inset-bottom)); }
  .toast { animation-name: toast-in-up; }
}
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

/* الشعار */
.logo-lockup { width: auto; height: 32px; object-fit: contain; }
.logo-lockup.lockup-sm { height: 1.568rem; }
.logo-lockup.lockup-md { height: 3.137rem; }
.logo-lockup.lockup-lg { height: 3.660rem; }

/* الرابط الخافت (تخطّ) */
.skip { position: fixed; inset-inline-start: var(--s-4); top: -64px; z-index: 9999; padding: var(--s-3) var(--s-4); border-radius: var(--r-2); background: var(--accent); color: #fff; font: var(--t-body-strong); transition: top var(--dur-2) var(--ease-out); }
.skip:focus { top: var(--s-4); }
/* focus put there by a script or a tap (not the keyboard) leaves it hidden; a browser without :focus-visible drops this rule */
.skip:focus:not(:focus-visible) { top: -64px; }

/* ───────────────── 4. الهيكل ───────────────── */
/* الصفحات العامة (الرئيسية): تدرّج العلامة خلف الترويسة فقط */
.public { min-height: 100dvh; display: flex; flex-direction: column; background: var(--gray-0); }
.hero-bg { position: absolute; inset: 0 0 auto; height: 620px; z-index: 0; pointer-events: none; overflow: hidden; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; opacity: .35; }
.hero-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 40%, var(--gray-0)); }
.public-wrap { position: relative; z-index: 1; width: 100%; max-width: calc(var(--page-max) + 2 * var(--gutter)); margin-inline: auto; padding: 0 var(--gutter); flex: 1; }
/* الرئيسية: كتلة بعد كتلة على مسافة واحدة (--page-gap)، وبين الأقسام ضعفها */
.public-main { display: flex; flex-direction: column; gap: var(--page-gap); padding-bottom: var(--s-12); }
.public-main > .section + .section { margin-top: var(--s-2); }
.section { display: flex; flex-direction: column; gap: var(--section-gap); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); }
.section-head h2 { font: var(--t-title-2); }

/* صفحات الحساب (دخول/تسجيل/استعادة) */
/* صفحات الدخول بشكل صفحة دخول الإدارة نفسه: بطاقة 400px في وسط الشاشة، الشعار صغير فوق العنوان وسطر يشرح
   الخطوة، وشفق هادئ خلفها. المحتوى الأطول من الشاشة (التسجيل) يبدأ من الأعلى وينمو للأسفل، لا يُقصّ. */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: var(--s-6) var(--s-4); position: relative; }
.auth .hero-bg { height: 420px; }
.auth-inner { position: relative; z-index: 1; width: min(100%, 400px); display: flex; flex-direction: column; gap: var(--s-6); }
.auth-inner.wide { width: min(100%, 520px); }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: var(--s-3); text-align: center; }
.auth-brand .logo-lockup { height: 40px; width: auto; }
.auth-brand h1 { font: var(--t-title-2); }  /* 22px كعنوان دخول الإدارة (--t-title-1 هناك) */
.auth-brand p { font: var(--t-callout); color: var(--text-2); max-width: 36ch; overflow-wrap: anywhere; }
.auth-brand p bdi { color: var(--text); font-weight: 600; }
.auth-form { display: flex; flex-direction: column; gap: var(--s-4); }
/* the column is the screen's width, not the content's: an auto track grew to the OTP row's widest size (six 52px
   boxes) and pushed the card past the screen's edge on phones */
.auth { grid-template-columns: minmax(0, 1fr); }
.auth-inner > .card { min-width: 0; }
@media (max-width: 359.98px) { .auth-inner > .card-pad { padding: var(--s-4); } }
.auth-links { display: flex; flex-direction: column; align-items: center; gap: var(--s-2); font: var(--t-callout); color: var(--text-2); text-align: center; }
.auth-links a { color: var(--accent-text); font-weight: 600; }
.wa { display: inline-flex; align-items: center; gap: 6px; }
.wa svg { width: 16px; height: 16px; flex: none; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: var(--s-4); }
@media (min-width: 480px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.form-grid .span-2 { grid-column: 1 / -1; }
.otp-card { display: flex; flex-direction: column; gap: var(--s-4); align-items: center; text-align: center; }
.otp-card p { font: var(--t-callout); color: var(--text-2); }
.otp-wrap { display: flex; flex-direction: column; align-items: center; gap: var(--s-2); }
.otp-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--s-2) var(--s-3); }
.otp-paste { gap: 6px; }
.otp-note { text-align: center; }
.resend { display: flex; gap: var(--s-2); align-items: center; justify-content: center; font: var(--t-callout); color: var(--text-2); }
.resend button { color: var(--accent-text); font: var(--t-callout-strong); }
.resend button:disabled { color: var(--text-3); }

/* الهيكل الداخلي: شريط جانبي لاصق + شريط علوي على الجوال */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100dvh; background: var(--bg); }
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: var(--s-4); padding: var(--s-5) var(--s-4); background: var(--surface); border-inline-start: 1px solid var(--border); overflow-y: auto; }
/* الشريط يتمرّر ولا يضغط ما فيه: على شاشة قصيرة كانت بطاقة الاسم والرصيد (overflow: hidden للّمعة) تنكمش فيلتصق النص بحافّتيها */
.sidebar > * { flex-shrink: 0; }
.sidebar-brand { position: relative; display: flex; align-items: center; justify-content: center; padding: var(--s-2) 0; margin-bottom: var(--s-2); min-height: 52px; }
.sidebar-brand .brand-link { display: block; }
.sidebar-brand .logo-lockup { height: 42px; }
.user-card { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3); border-radius: var(--r-3); background: var(--surface-2); margin-bottom: var(--s-3); }
.user-card .avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); font: var(--t-callout-strong); flex: none; overflow: hidden; direction: ltr; }
.user-card .avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-card .name { font: var(--t-body-strong); }
.user-card .balance { font: var(--t-title-3); color: var(--accent-text); direction: ltr; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-group { font: var(--t-caption-strong); color: var(--text-3); padding: var(--s-4) var(--s-3) var(--s-1); }
.nav-item { display: flex; align-items: center; gap: var(--s-3); height: 42px; padding: 0 var(--s-3); border-radius: var(--r-2); color: var(--text-2); font: 500 15px/1 var(--font); transition: background var(--dur-1), color var(--dur-1); }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.nav-item > svg { width: 18px; height: 18px; flex: none; }
.sidebar-foot { margin-top: auto; padding-top: var(--s-3); border-top: 1px solid var(--border); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.content { width: 100%; max-width: 1600px; margin-inline: auto; padding: var(--s-10) var(--s-10) var(--s-16); display: flex; flex-direction: column; gap: var(--page-gap); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-4); min-height: 44px; }
.page-head h1 { font: var(--t-title-1); margin: 0; line-height: 1.2; }
.page-head p { font: var(--t-callout); color: var(--text-2); margin-top: var(--s-1); }
.page-head .actions { display: flex; gap: var(--s-2); align-items: center; margin-inline-start: auto; }
.crumbs { display: flex; align-items: center; gap: var(--s-2); font: var(--t-caption); color: var(--text-2); margin-bottom: var(--s-2); }
.crumbs a { color: var(--accent-text); }
.crumbs svg { width: 12px; height: 12px; }
.filters { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.filters .search { flex: 1 1 260px; max-width: 420px; }
@media (max-width: 1023.98px) {
  .shell { grid-template-columns: 1fr; }
  /* الجوال: لا قائمة منزلقة فوق الصفحة — زرّ القائمة يفتح صفحة «القائمة» (/menu) */
  .sidebar { display: none; }
  .topbar { position: sticky; top: 0; z-index: 30; display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: var(--s-2); height: var(--topbar-h); padding: 0 var(--s-3); background: var(--material); backdrop-filter: blur(12px) saturate(180%); -webkit-backdrop-filter: blur(12px) saturate(180%); border-bottom: 1px solid var(--border); }
  .topbar .title { text-align: center; font: var(--t-body-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .balance-chip { display: inline-flex; align-items: center; height: 36px; padding: 0 var(--s-3); border-radius: var(--r-full); background: var(--accent-soft); color: var(--accent-text); font: var(--t-callout-strong); direction: ltr; }
  .content { padding: var(--s-4) var(--gutter) var(--s-12); }
  .page-head h1 { font: var(--t-title-2); }
}
@media (min-width: 1024px) and (max-width: 1279.98px) { .content { padding: var(--s-8); } }

/* الشريط كامل الارتفاع ومن لون أرضية الصفحة، وشريط المستخدم يرتب نفسه من لغة الاسم. */
.sidebar { min-height: 100dvh; background-color: var(--reference-page); overscroll-behavior: contain; }
.user-card { cursor: default; }
.user-card[data-username-script="latin"] { direction: ltr; }
.user-card[data-username-script="arabic"] { direction: rtl; }
.user-card .name { text-align: start; }
.user-card .balance { margin-inline-start: auto; }
.topbar .balance-chip { cursor: pointer; text-decoration: none; transition: transform var(--dur-1) var(--ease-out), background var(--dur-1); }
.topbar .balance-chip:active { transform: scale(.95); }
@media (hover: hover) { .topbar .balance-chip:hover { background: var(--accent-soft-2, var(--accent-soft)); box-shadow: inset 0 0 0 1.5px var(--accent); } }
a.balance { text-decoration: none; color: inherit; border-radius: 8px; }
@media (hover: hover) { a.balance:hover { text-decoration: underline; text-underline-offset: 3px; } }

/* ───────────────── 5. الصفحات ───────────────── */
/* شبكة البطاقات */
.tiles { display: grid; }
.tile { display: flex; flex-direction: column; text-align: center; width: 100%; color: inherit; }
.tile-img { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--surface-3); }
.tile-img img { width: 100%; height: 100%; object-fit: cover; }
.tile-img[data-empty="true"] { display: grid; place-items: center; color: var(--gray-4); }
.tile-img[data-empty="true"] > svg { width: 32px; height: 32px; }
/* غير متوفر: الصورة بألوانها كاملة (لا تبهيت ولا تدرّج رمادي)، شارة حمراء في زاويتها والاسم باهت — آخر الملف */
.tile[aria-disabled="true"] { cursor: pointer; }
.tile .badge { position: absolute; top: var(--s-2); inset-inline-start: var(--s-2); }
.tiles > li { width: 100%; }

/* ══════════ تطابق mahatta-react ══════════
   الخلفية، نقاطها، نسب الرئيسية وحركة المنتج من المرجع نفسه. */
#root { min-height: 100dvh; isolation: isolate; }
.site-backdrop { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; background: var(--reference-page); }
.site-backdrop > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: var(--backdrop-glow); }
.site-backdrop > .dots { position: absolute; inset: 0; background-image: radial-gradient(oklch(var(--bc) / .2) .05rem, transparent 0); background-size: 2rem 2rem; }
.public, .shell, .legal { position: relative; z-index: 1; background: transparent; }
.auth { z-index: 1; background: var(--gray-1); }


/* ══════════ الشريط العلوي ومسافة بداية الصفحات ══════════
   --shell-offset = بُعد الشريط عن أعلى الشاشة + ارتفاعه + فراغ ثابت قبل المحتوى. منه تبدأ الصفحات، وبه تلتصق العناصر
   اللاصقة (top: var(--shell-offset))، وscroll-padding-top كي لا يقف رابط داخلي تحت الشريط. صفحات الحساب تعيد تعريفه. */
:root { --shell-top: 8px; --shell-h: 56px; --shell-gap: 16px; --shell-offset: calc(var(--shell-top) + var(--shell-h) + var(--shell-gap)); }
@media (min-width: 768px) { :root { --shell-top: 16px; --shell-h: 64px; --shell-gap: 24px; } }
/* الحساب: على الحاسوب لا شريط علوي (القائمة جانبية)؛ على الجوال شريط بعرض الشاشة، وفوقه شريط المشرف إن وُجد */
:root:has(.shell) { --shell-offset: var(--s-6); }
:root:has(.shell .staff-banner) { --shell-offset: calc(48px + var(--s-6)); }
@media (max-width: 1023.98px) {
  :root:has(.shell) { --shell-offset: calc(var(--topbar-h) + var(--s-4)); }
  :root:has(.shell .staff-banner) { --shell-offset: calc(var(--topbar-h) + 44px + var(--s-4)); }
}
html { scroll-padding-top: var(--shell-offset); }

/* الشريط العائم: في مكانه الحقيقي (هامش علوي بقدر بُعده اللاصق) فلا ينزاح فوق المحتوى، وسطحه شبه مصمت فلا يختلط
   به ما يمرّ تحته. ::after هو السطح وظلّه، و::before شريط بلون الصفحة يتلاشى نحو الأسفل فيختفي المحتوى قبل أن
   يلامس الشريط. كلاهما يظهر بالشفافية حين تتحرّك الصفحة (data-scrolled — PublicShell.jsx). */
.public-header {
  position: sticky; top: var(--shell-top); z-index: 40; isolation: isolate;
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  height: var(--shell-h); min-height: 0; margin: var(--shell-top) 0 0; padding: 0 var(--s-2) 0 var(--s-3);
  background: none; border: 0; border-radius: var(--r-3); backdrop-filter: none; -webkit-backdrop-filter: none;
  transition: transform .45s cubic-bezier(.16, 1, .3, 1);
}
.public-header::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: color-mix(in srgb, var(--surface) 96%, transparent); border: 1px solid var(--border); box-shadow: var(--shadow-1); }
.public-header::before { content: ""; position: absolute; z-index: -2; pointer-events: none; inset-inline: calc(-1 * var(--gutter)); top: calc(-1 * var(--shell-top) - 1px);
  height: calc(var(--shell-top) + var(--shell-h) + var(--shell-gap));
  background: linear-gradient(to bottom, var(--reference-page) 25%, color-mix(in srgb, var(--reference-page) 70%, transparent) 62%, transparent);
  opacity: 0; transition: opacity .25s ease; }
.public-header[data-scrolled]::before { opacity: .92; }
/* ظلّ أعمق حين يطفو فوق المحتوى (تبديل مرّة واحدة، لا ظلّ يتحرّك) */
.public-header[data-scrolled]::after { box-shadow: var(--shadow-2); }
.public-logo { flex: none; display: inline-flex; align-items: center; }
.public-logo .logo-lockup { height: 28px; }
@media (min-width: 768px) { .public-logo .logo-lockup { height: 32px; } }
.public-actions { flex: 0 1 auto; min-width: 0; justify-content: flex-end; }
@media (min-width: 768px) { .public-header { padding-inline: var(--s-5) var(--s-3); border-radius: var(--r-4); } }
/* الجوال: الشريط يختفي إلى الأعلى ما دام الزائر ينزل، ويعود مع أوّل تمرير للأعلى — مساحة الشاشة للمحتوى */
@media (max-width: 899.98px) {
  .public-header[data-away]:not(:focus-within) { transform: translate3d(0, calc(-100% - var(--shell-top) - 12px), 0); }
}
@media (prefers-reduced-motion: reduce) { .public-header, .public-header::before { transition: none; } }
.public-login:hover { background: var(--accent-strong); color: var(--on-accent); }

/* بانر الفيديو (BannerVideo.jsx): عريض 8:3، وعلى الجوال 4:3 بنسخة مصمّمة له.
   لون الخلفية لون أول إطار في الفيديو كي لا يومض شيء قبل تحميل الغلاف. */
.banner { position: relative; overflow: hidden; isolation: isolate; aspect-ratio: 8 / 3; border-radius: 24px; background: #06282B; box-shadow: var(--shadow-2); }
.banner > .banner-video, .banner > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.banner > .banner-video { display: block; opacity: 0; transition: opacity .6s var(--ease-out); }
.banner > .banner-video[data-playing] { opacity: 1; }
.banner > img[data-hidden] { opacity: 0; }
.banner > img { transition: opacity .5s var(--ease-out); }
@media (max-width: 639.98px) { .banner { aspect-ratio: 4 / 3; border-radius: var(--r-4); } }
/* بانر المتجر على الجوال يقف على الشعار فقط: إطار 2:1 يقصّ الفراغ فوقه وتحته — الشعار (الأسطر 259–522 من 810)
   في منتصف الإطار ويبقى حوله نحو ربع الارتفاع من كل جهة. الحلقة الكاملة في الرئيسية تبقى 4:3 لأن مشاهدها تملأ الإطار. */
@media (max-width: 639.98px) { .banner-hold { aspect-ratio: 2 / 1; --banner-pos: 50% 44.6%; } .banner-hold > img { object-position: var(--banner-pos); } }
.home-banner { margin: var(--shell-gap) 0 var(--page-gap); }

/* شبكة البطاقات الوحيدة (الفئات والمنتجات): أعمدة بعرض أدنى ثابت تملأ ما يتّسع لها — 3 على أي جوال (320–430)،
   ثم 5–6 حسب عرض الصفحة لا الشاشة (داخل الحساب يأخذ الشريط الجانبي جزءاً منها). نتائج قليلة تبقى بحجمها لا تتمدّد.
   زوايا الصورة 22% كأيقونة تطبيق، والاسم 14px في سطرين على الأكثر. */
.tiles { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: var(--s-4) var(--s-3); align-items: start; margin: 0; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: var(--s-5) var(--s-4); } }
@media (min-width: 1024px) { .tiles { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: var(--s-6) var(--s-5); } }
.tile { gap: var(--s-2); }
/* الصورة تملأ المربّع حتى حوافه كأيقونة تطبيق على الجوال: لا حلقة ولا إطار ولا هامش، زوايا المربّع وحدها (المالك 2026-10-16).
   التحويم في motion.css (التحويم القديم: ميل درجة، حلقة تركوازية، تكبير الصورة). */
.tile-img { width: 100%; border-radius: 22%; transition: transform 150ms cubic-bezier(.4, 0, .2, 1); }
.tile-img img { position: absolute; inset: 0; transition: transform 150ms cubic-bezier(.4, 0, .2, 1); }
.tile:active .tile-img { transform: scale(.97); }
.tile:focus-visible { box-shadow: none; }
.tile .tile-name { font: var(--t-callout-strong); font-family: var(--font-display); min-height: 40px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.tile[aria-disabled="true"]:hover .tile-img, .tile[aria-disabled="true"]:focus-visible .tile-img { transform: none; }
.tile[aria-disabled="true"]:hover .tile-img img, .tile[aria-disabled="true"]:focus-visible .tile-img img { transform: none; }

/* محدد رمز البلد: الحقل الثاني هو العمود الأيسر فعلياً في واجهة RTL. */
.phone-country-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(142px, 180px); gap: var(--s-3); direction: rtl; align-items: start; }
.country-code-field { position: relative; direction: rtl; }
.country-code-trigger { min-height: var(--control); width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 7px; padding: 0 var(--s-3); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-2); }
.country-code-trigger:hover { border-color: var(--text-3); }
.country-code-trigger:focus-visible { border-color: var(--accent); box-shadow: var(--focus); }
.country-code-trigger[aria-invalid="true"] { border-color: var(--danger); }
.country-placeholder { color: var(--text-3); font: var(--t-callout); }
/* one label for the number and its code: the code's own label («رمز البلد») keeps its line (the two boxes stay level)
   but is not shown — it still names the button (aria-labelledby reads hidden text). The box is as tall as the input. */
.phone-country-row .country-code-field > .field-label { visibility: hidden; }
.country-code-trigger { min-height: var(--control); font: var(--t-body); }
@media (max-width: 768px), (pointer: coarse) { .country-code-trigger { min-height: 48px; font-size: 16px; } }
/* the «⌄» glyph sat on the baseline (low and off-centre): the same chevron as the other selects, drawn as a mask */
.country-chevron { margin-inline-start: auto; flex: none; width: 16px; height: 16px; font-size: 0; color: var(--text-3); background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat; }
.country-popover { position: absolute; z-index: 70; top: calc(100% + 6px); left: 0; width: min(340px, 86vw); padding: var(--s-2); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-3); box-shadow: var(--shadow-3); }
.country-search { width: 100%; height: 40px; padding: 0 var(--s-3); border: 1px solid var(--border-strong); border-radius: var(--r-2); background: var(--surface-2); }
.country-search:focus { border-color: var(--accent); box-shadow: var(--focus); }
.country-options { max-height: 280px; overflow-y: auto; margin-top: var(--s-2); overscroll-behavior: contain; }
.country-option { width: 100%; min-height: 44px; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: var(--s-2); align-items: center; padding: 7px var(--s-2); border-radius: var(--r-1); text-align: start; }
.country-option:hover, .country-option[aria-selected="true"] { background: var(--accent-soft); }
.country-option[data-active] { box-shadow: inset 0 0 0 2px var(--accent); }
.country-flag { font-size: 20px; }
.country-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.country-dial { color: var(--text-2); }
.country-empty { padding: var(--s-5); text-align: center; color: var(--text-2); }
.google-auth-button { text-align: center; }
@media (max-width: 479px) { .phone-country-row { grid-template-columns: minmax(0, 1fr) 132px; } }
/* 320px: رقم الهاتف كان يُحشر في 90px بجانب رمز البلد — كلّ منهما بعرض السطر */
@media (max-width: 359.98px) {
  .phone-country-row { grid-template-columns: minmax(0, 1fr); row-gap: var(--s-2); }
  .phone-country-row .country-code-field > .field-label { display: none; }
}
.back-link { display: inline-flex; align-items: center; gap: var(--s-2); font: var(--t-callout-strong); color: var(--accent-text); height: 36px; padding: 0 var(--s-3); border-radius: var(--r-2); background: var(--surface-2); border: 1px solid var(--border); transition: background var(--dur-1), border-color var(--dur-1); }
.back-link:hover { background: var(--surface-3); border-color: var(--accent-soft); }
.back-link svg { width: 16px; height: 16px; }

/* صفحات الحساب */
.panel { display: flex; flex-direction: column; gap: var(--s-5); max-width: 820px; }
/* تصفية السجلّات: الحالة، ثم الفترة والبحث. على الجوال الحالة بعرض السطر بقطع متساوية، والبحث والفترة معاً في سطر
   تحتها (كانت الفترة وحدها في سطر بعرض 150px). */
.filter-period { flex: 0 0 9.5rem; }
@media (max-width: 639.98px) {
  .filters .segmented { flex: 1 1 100%; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .filters .segmented > button { padding-inline: var(--s-2); }
  .filters .search { flex: 1 1 0; min-width: 0; max-width: none; order: -1; }
  .filters .segmented { order: -2; }
  .filter-period { flex-basis: 8.5rem; }
}
/* كشف الحساب: المبلغ بإشارته ولونه يقول نوع الحركة */
.amt { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
.amt-in { color: var(--success-text); }
.amt-out { color: var(--text); }
.panel-head h2 { font: var(--t-title-3); }
.panel-head p { font: var(--t-caption); color: var(--text-2); margin-top: 2px; }
.avatar-row { display: flex; align-items: center; gap: var(--s-4); }
.avatar-row .avatar-lg { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); font: var(--t-title-3); flex: none; direction: ltr; }
.avatar-row .avatar-lg img { width: 100%; height: 100%; object-fit: cover; }
.avatar-row .stack { gap: var(--s-1); }
.subsection { padding-top: var(--s-5); border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: var(--s-4); }
.subsection h3 { font: var(--t-title-3); }
.subsection .sub-hint { font: var(--t-caption); color: var(--text-2); margin-top: calc(-1 * var(--s-3)); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); }
.setting-row .stack { min-width: 0; }
.setting-row h3, .setting-row .lbl { font: var(--t-body-strong); }
.setting-row p { font: var(--t-caption); color: var(--text-2); }
.session-list { display: flex; flex-direction: column; }
.session { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) 0; border-top: 1px solid var(--border); }
.session:first-child { border-top: 0; }
.session .dev-icon { width: 40px; height: 40px; border-radius: var(--r-2); display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); flex: none; }
.session .dev-icon svg { width: 18px; height: 18px; }
.session .stack { flex: 1; min-width: 0; }
.session .dev { font: var(--t-body-strong); }
.session .meta { font: var(--t-caption); color: var(--text-2); }
.totp-setup { display: flex; flex-direction: column; align-items: center; gap: var(--s-3); text-align: center; padding: var(--s-4); border-radius: var(--r-3); background: var(--surface-2); }
.totp-setup img { width: 176px; height: 176px; border-radius: var(--r-2); background: #fff; padding: 6px; }
.totp-setup code { font: var(--t-callout-strong); letter-spacing: .08em; direction: ltr; padding: 6px 10px; border-radius: 8px; background: var(--surface-3); word-break: break-all; user-select: all; }
.totp-open { gap: 8px; }
.totp-key { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--s-2); }

/* صفحة نصّية */
.prose { max-width: 640px; font: var(--t-body); line-height: 1.8; }
.prose h2 { font: var(--t-title-2); margin: var(--s-6) 0 var(--s-3); }
.prose h3 { font: var(--t-title-3); margin: var(--s-5) 0 var(--s-2); }
.prose p { margin: 0 0 var(--s-3); }
.prose ul { list-style: disc; padding-inline-start: var(--s-5); margin: 0 0 var(--s-3); }
.prose a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
.legal { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; padding: var(--s-10) var(--s-4); gap: var(--s-6); background: transparent; }
.legal .prose { width: 100%; }
/* while the text loads, the «back» button waits below the fold instead of jumping down when it arrives */
.legal-loading { min-height: 75dvh; }

/* ══════════ سبب الرفض داخل شارة الحالة: «مرفوض · ID خاطئ» ══════════ */
.chip:has(.chip-reasoned) { height: auto; min-height: 26px; padding-block: 4px; white-space: normal; border-radius: 13px; max-width: 100%; align-items: flex-start; }
.chip:has(.chip-reasoned)::before { margin-top: 5px; flex: none; }
/* الحالة ثم السبب تحتها: سبب طويل يلتفّ بعرض الشارة كلها، لا كلمةً في كل سطر بجانب الحالة */
.chip-reasoned { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; text-align: start; }
.chip-reasoned > span:first-child { white-space: nowrap; }
.chip-reason { font-weight: 400; font-size: 12px; line-height: 17px; opacity: .92; overflow-wrap: anywhere; }

/* ══════════ صورة الفئة المركّبة من صور منتجاتها ══════════ */
.cover-mosaic { position: absolute; inset: 0; display: grid; gap: 4px; padding: 4px; background: var(--surface-3); }
.cover-mosaic img { position: static !important; inset: auto !important; width: 100%; height: 100%; min-height: 0; object-fit: cover; border-radius: 18px; }
@media (min-width: 640px) { .cover-mosaic { gap: 6px; padding: 6px; } .cover-mosaic img { border-radius: 28px; } }
.cover-mosaic[data-count="2"] { grid-template-columns: 1fr 1fr; }
.cover-mosaic[data-count="3"] { grid-template-columns: 1.35fr 1fr; grid-template-rows: 1fr 1fr; }
.cover-mosaic[data-count="3"] img:first-child { grid-row: 1 / 3; }
.cover-mosaic[data-count="4"] { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.tile:hover .cover-mosaic img, .tile:focus .cover-mosaic img { transform: scale(1.03); }

/* ══════════ صفحة الصيانة ══════════ */
.maint { position: relative; z-index: 1; min-height: 100dvh; display: grid; place-items: center; padding: var(--s-10) var(--s-4); }
.maint-card {
  width: 100%; max-width: 520px; display: flex; flex-direction: column; align-items: center; gap: var(--s-4); text-align: center;
  padding: var(--s-10) var(--s-8); border-radius: 32px; background: var(--material-strong); border: 1px solid var(--border);
  box-shadow: var(--shadow-3); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.maint-card h1 { font: var(--t-title-1); margin: 0; }
.maint-card > p { font: var(--t-body); color: var(--text-2); margin: 0; max-width: 40ch; }
.maint-card .maint-note { font: var(--t-caption); color: var(--text-3); }
.maint-art { position: relative; width: 140px; height: 120px; margin-block: var(--s-2); }
.maint-art .gear { position: absolute; fill: none; stroke-width: 5; stroke-linejoin: round; }
.maint-art .gear-lg { width: 96px; height: 96px; inset-inline-start: 0; top: 0; stroke: var(--brand-teal); fill: rgb(2 161 165 / .1); animation: maint-spin 9s linear infinite; }
.maint-art .gear-sm { width: 58px; height: 58px; inset-inline-end: 0; bottom: 0; stroke: var(--brand-amber); fill: rgb(252 195 0 / .14); animation: maint-spin 6s linear infinite reverse; }
@keyframes maint-spin { to { transform: rotate(360deg); } }
.maint-pill { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 14px; border-radius: var(--r-full); background: var(--warning-soft); color: var(--warning-text); font: var(--t-caption-strong); }
/* النبض حلقة تكبر وتتلاشى (تحويل وشفافية) لا ظلّ يتحرّك */
.maint-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--brand-amber); }
.maint-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: rgb(252 195 0 / .6); animation: maint-pulse 1.8s ease-out infinite; }
@keyframes maint-pulse { to { transform: scale(3.5); opacity: 0; } }
.maint-progress { width: 100%; max-width: 260px; height: 6px; border-radius: var(--r-full); background: var(--surface-3); overflow: hidden; }
.maint-progress span { display: block; width: 40%; height: 100%; border-radius: inherit; background: var(--brand-teal); animation: maint-bar 2.4s var(--ease-out) infinite; }
@keyframes maint-bar { from { transform: translateX(160%); } to { transform: translateX(-260%); } }
@media (max-width: 480px) { .maint-card { padding: var(--s-8) var(--s-5); border-radius: 24px; } }
@media (prefers-reduced-motion: reduce) { .maint-art .gear, .maint-dot::after, .maint-progress span { animation: none; } }

/* ══════════ إيداع USDT: عنوان خاص بالعميل ══════════ */
.deposit { display: flex; flex-direction: column; align-items: center; gap: var(--s-3); text-align: center; padding-block: var(--s-2); }
.field-label .opt { font: var(--t-caption); color: var(--text-3); font-weight: 400; }

/* ══════════ الحركة — نظام واحد مع لوحة الإدارة (src/ui/motion.jsx) ══════════
   تشرح تغيّر الحالة ولا تزيّن؛ transform وopacity فقط؛ «تقليل الحركة» يُطفئها أو يحوّلها إلى تلاشٍ. */
:root {
  --ease-spring: linear(0, .25 6%, .55 13%, .78 21%, .91 30%, .97 40%, .995 55%, 1);
  --dur-4: 480ms; --shift: 8px; --stagger: 30ms; --press: .97;
}
@media (prefers-reduced-motion: reduce) { :root { --dur-4: 0ms; --shift: 0px; --stagger: 0ms; --press: 1; } }

.page-transition { display: flex; flex-direction: column; gap: inherit; min-width: 0; }

/* البطاقات تدخل بتتابع قصير عند أول ظهور، والصورة تميل نحو المؤشّر عند التحويم */
.tiles { animation: none; }
.tiles > * { animation: tile-in var(--dur-3) var(--ease-out) backwards; animation-delay: calc(min(var(--i, 0), 12) * var(--stagger)); }
@keyframes tile-in { from { opacity: 0; transform: translateY(var(--shift)); } }
@media (hover: hover) and (pointer: fine) {
  .tile:hover .tile-img img { transform: scale(1.05) translate(var(--px, 0), var(--py, 0)); }
}
.tile:active .tile-img { transform: scale(var(--press)); }

/* قيمة تغيّرت (الرصيد بعد شراء أو حوالة): وميض هادئ مرّة واحدة */
.num-flash { position: relative; border-radius: 6px; }
/* طبقة تتلاشى (شفافية فقط) بدل خلفية وظلّ يتحرّكان */
.num-flash::after { content: ""; position: absolute; inset: -3px -4px; border-radius: 8px; background: var(--accent-soft); pointer-events: none; opacity: 0; animation: num-flash 1.2s var(--ease-out); }
@keyframes num-flash { 0%, 20% { opacity: 1; } 100% { opacity: 0; } }

/* شارة الحالة تتغيّر أمام العميل */
.chip-changed { animation: chip-in var(--dur-4) var(--ease-spring); }
@keyframes chip-in { from { opacity: 0; transform: scale(.88); } }

/* علامة الصح المرسومة */
.success-check { color: var(--success); flex: none; }
.toast .success-check { color: #4CC46A; }
.buy-done .success-check { margin-bottom: var(--s-2); }

/* عملة المبلغ (components/CurrencyPicker.jsx): مفتاح مقسّم بقطع متساوية واسم واحد لكل خيار، والمؤشّر ينزلق تحت المختار بالتحويل وحده */
.cur-switch { position: relative; isolation: isolate; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); width: 100%;
  padding: 3px; border-radius: 14px; background: var(--surface-3); }
.cur-switch-thumb { position: absolute; z-index: -1; inset-block: 3px; inset-inline-start: 3px; width: calc((100% - 6px) / var(--n)); border-radius: 11px;
  background: var(--surface); box-shadow: var(--shadow-1); transform: translateX(calc(var(--at) * 100%)); transition: transform .35s var(--ease-emph, ease); }
[dir="rtl"] .cur-switch-thumb { transform: translateX(calc(var(--at) * -100%)); }
/* dark: the chosen segment is lighter than its track (raised), not darker */
:root[data-theme="dark"] .cur-switch-thumb { background: rgb(255 255 255 / .16); box-shadow: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cur-switch-thumb { background: rgb(255 255 255 / .16); box-shadow: none; } }
.cur-switch > button { display: inline-flex; align-items: center; justify-content: center; min-width: 0; min-height: 44px; padding: 0 var(--s-2);
  border-radius: 11px; font: var(--t-callout-strong); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color var(--dur-1), transform .15s var(--ease-out); }
.cur-switch > button[aria-checked="true"] { color: var(--text); }
.cur-switch > button:hover:not([aria-checked="true"]) { color: var(--text); }
.cur-switch > button:active { transform: scale(.97); }
.cur-switch > button:focus-visible { outline: none; box-shadow: var(--focus); }
.cur-affix { font: var(--t-body-strong); color: var(--text-2); }
@media (prefers-reduced-motion: reduce) { .cur-switch-thumb, .cur-switch > button { transition: none; } }

/* إيداع USDT وصل والصفحة مفتوحة */
.deposit-arrived { display: flex; align-items: center; gap: var(--s-3); width: 100%; padding: var(--s-3) var(--s-4); border-radius: var(--r-3); background: var(--success-soft); color: var(--success-text); font: var(--t-callout); text-align: start; }

@media (prefers-reduced-motion: reduce) {
  .tiles > *, .chip-changed { animation: none; }
  .tile:hover .tile-img img { transform: none; }
  .num-flash::after { animation-timing-function: linear; }
}

/* مراجع طويلة (معاملة USDT: 66 خانة) تلتفّ داخل البطاقة بدل أن تدفع الصفحة جانبياً */
.ref-wrap { overflow-wrap: anywhere; word-break: break-all; min-width: 0; }

/* حوار الشراء: السعر تغيّر قبل التأكيد */
.price-changed { display: flex; gap: var(--s-2); align-items: flex-start; padding: var(--s-3) var(--s-4); border-radius: var(--r-2); background: var(--warning-soft, #FFF4D6); color: var(--warning-text, #7A5400); font: var(--t-callout); }
.price-changed svg { width: 16px; height: 16px; flex: none; margin-top: 3px; }

/* ───────── أهداف لمس 44px على الجوال (WCAG 2.5.5 / إرشادات آبل) ─────────
   على الحاسوب تبقى الأحجام المدمجة؛ على الشاشات اللمسية الضيقة يكبر كل ما يُضغط. */
@media (max-width: 768px), (pointer: coarse) {
  .control .affix-btn { height: 44px; min-width: 44px; padding: 0 var(--s-3); }
  .otp { gap: 6px; }
  .otp > input { height: 52px; }
  .segmented > button { height: 44px; }
  .instruction .copy-btn { height: 44px; padding: 0 var(--s-4); }
  .nav-item { height: 46px; }
  .icon-btn-sm { width: 44px; height: 44px; }
  .chip-btn, .of-radios > button { min-height: 44px; }
  .auth-links a, .link { display: inline-flex; align-items: center; min-height: 44px; }
  .ui-btn-sm { --h: 44px; }
  .back-link { height: 44px; }
  .cat-band-back { min-height: 44px; }
  .switch { min-height: 44px; }
  .control { min-height: 48px; }
  a:has(> .logo-lockup) { display: inline-flex; align-items: center; min-height: 44px; }
}

/* ───────── حقول الرقم والتاريخ: بلا أسهم المتصفّح ولا علبة 23px داخل الحقل ───────── */
.control input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
/* WebKit (Safari) يرسم حقل البحث بإطار ومربّع داخلي خاصّ به داخل إطارنا — بلا مظهر المتصفّح */
:where(input[type="search"]) { -webkit-appearance: none; appearance: none; }
input[type="search"]::-webkit-search-decoration, input[type="search"]::-webkit-search-results-decoration { -webkit-appearance: none; }
/* حقول البحث في المتجر لها زرّ مسح خاصّ بها: زرّ المسح الأصلي في Chrome وSafari كان يظهر بجانبه (علامتا ×) */
.control-search > input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
.control input[type="number"]::-webkit-inner-spin-button, .control input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.control input[type="date"] { min-height: calc(var(--control) - 2px); font-variant-numeric: tabular-nums; direction: ltr; text-align: end; }
.control input[type="date"]::-webkit-date-and-time-value { text-align: end; }
.control input[type="date"]::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; padding: 6px; margin-inline-start: 4px; border-radius: 6px; }
.control input[type="date"]::-webkit-calendar-picker-indicator:hover { opacity: 1; background: var(--surface-3); }
:root[data-theme="dark"] .control input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .control input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1); } }

/* عناوين طويلة وعناوين محافظ لا تتجاوز عرض الصفحة على الشاشات الضيقة */
.instruction > span { min-width: 0; overflow-wrap: anywhere; }
.deposit { width: 100%; min-width: 0; }

/* شعار وسيلة الدفع المولَّد حين لا توجد صورة */
.tile-img .method-art { position: absolute; inset: 0; border-radius: inherit; }
.tile-img .method-art .cat-art-glyph { font-size: 34px; }

/* تاريخ من ثلاث قوائم: اليوم · الشهر · السنة */
.date-parts { display: grid; grid-template-columns: 1fr 1.6fr 1.2fr; gap: var(--s-2); }
.date-parts > .field { gap: 0; }
.date-parts .field-error { display: none; }

/* ══════════ معلومات التحويل (عناصر يرتّبها فريق المتجر لكل وسيلة) ══════════ */
.pay-blocks { display: flex; flex-direction: column; gap: var(--s-3); width: 100%; min-width: 0; }
.pay-block { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pay-block[data-type="qr"], .pay-block[data-type="image"] { align-items: center; text-align: center; }
.pay-label { font: var(--t-caption-strong); color: var(--text-2); }
.pay-text { font: var(--t-body); line-height: 1.7; white-space: pre-line; overflow-wrap: anywhere; }
.pay-note { font: var(--t-callout); line-height: 1.7; padding: var(--s-2) var(--s-3); border-radius: var(--r-2); background: rgb(252 195 0 / .14);
  border: 1px solid rgb(252 195 0 / .35); color: var(--text); white-space: pre-line; }
.pay-copy { width: 100%; display: flex; align-items: center; gap: var(--s-2); padding: var(--s-3) var(--s-4); border-radius: var(--r-2);
  background: var(--surface-2); border: 1px solid var(--border); text-align: start; cursor: pointer; transition: background var(--dur-1), border-color var(--dur-2); }
.pay-copy:hover { background: var(--surface-3); }
.pay-copy[data-copied] { border-color: var(--success); }
.pay-value { flex: 1; min-width: 0; font: 600 14px/20px var(--font); overflow-wrap: anywhere; color: var(--text); }
.pay-value[dir="ltr"] { font: 500 13px/19px ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: .02em; }
.pay-copy-tag { flex: none; display: inline-flex; align-items: center; gap: 4px; font: var(--t-caption-strong); color: var(--accent-text); }
.pay-copy-tag > svg { width: 14px; height: 14px; }
.pay-qr { width: 180px; height: 180px; border-radius: 20px; padding: 10px; background: #fff; box-shadow: 0 0 0 1px var(--border), var(--shadow-2); }
.pay-image img { max-width: min(100%, 360px); border-radius: var(--r-3); box-shadow: 0 0 0 1px var(--border); }
.deposit .pay-blocks { text-align: start; }
@media (max-width: 899.98px) { .pay-copy { min-height: 52px; } }

/* جلسة فتحها مشرف من لوحة الإدارة: شريط واضح لا يُنسى، مع الخروج بضغطة */
.staff-banner { position: sticky; top: 0; z-index: 31; display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2) var(--s-4);
  background: #FCC300; color: #1D1D1F; font: var(--t-callout); }
.staff-banner > svg { width: 18px; height: 18px; flex: none; }
.staff-banner-exit { flex: none; height: 32px; padding: 0 var(--s-3); border-radius: var(--r-full); background: #1D1D1F; color: #fff; font: var(--t-caption-strong); }
.staff-banner-exit:hover { background: #000; }
/* على الجوال: الشريط بارتفاع ثابت وسطر واحد، والشريط العلوي يلتصق تحته (لا فوقه) فيبقى زرّ القائمة والرصيد ظاهرين */
@media (max-width: 899.98px) {
  .staff-banner { top: 0; height: 44px; padding-block: 0; font: var(--t-caption); }
  .staff-banner > .grow { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .staff-banner-exit { height: 30px; }
  .staff-banner + .topbar { top: 44px; }
  body:has(.staff-banner) .toast-live { top: calc(env(safe-area-inset-top) + var(--topbar-h, 56px) + 44px + var(--s-2)); }
}

/* ══════════ مظهر عناصر معلومات التحويل (يختاره فريق المتجر لكل عنصر) ══════════
   المسافة بين العناصر والمحاذاة العامة من الطريقة، وكل عنصر يغيّر محاذاته ومقاس نصّه ووزنه ولونه وتباعد أسطره
   وإطاره والمسافة قبله وبعده وبين عنوانه وقيمته. بلا اختيار تبقى القيم الافتراضية. */
.pay-blocks { gap: var(--pb-gap, var(--s-3)); }
.pay-blocks[data-align="center"] > .pay-block:not([data-align]) { align-items: center; text-align: center; }
.pay-blocks[data-align="end"] > .pay-block:not([data-align]) { align-items: flex-end; text-align: end; }
.pay-block { margin-block: var(--pb-before, 0) var(--pb-after, 0); gap: var(--pb-label-gap, var(--s-2)); padding: var(--pb-pad, 0); }
.pay-block[data-align="start"] { align-items: flex-start; text-align: start; }
.pay-block[data-align="center"] { align-items: center; text-align: center; }
.pay-block[data-align="end"] { align-items: flex-end; text-align: end; }
.pay-block[data-align="justify"] { align-items: stretch; text-align: justify; text-align-last: start; }
/* a copy row keeps the full width whatever the block's alignment (a row sized to its content had a zero-wide value
   box — the address disappeared and only «نسخ» was left); the alignment moves the text inside the row */
.pay-blocks .pay-block .pay-copy { width: 100%; max-width: 100%; align-self: stretch; }
.pay-block[data-align="center"] :is(.pay-value-box, .pay-value) { text-align: center; }
.pay-block[data-align="end"] :is(.pay-value-box, .pay-value) { text-align: end; }
.pay-block[data-label-align="start"] > .pay-label { align-self: flex-start; text-align: start; }
.pay-block[data-label-align="center"] > .pay-label { align-self: center; text-align: center; }
.pay-block[data-label-align="end"] > .pay-label { align-self: flex-end; text-align: end; }
.pay-block[data-label-align="justify"] > .pay-label { align-self: stretch; }
.pay-block[data-size] :is(.pay-text, .pay-note, .pay-value) { font-size: var(--pb-fs); }
.pay-block[data-size="xs"] { --pb-fs: 12px; }
.pay-block[data-size="sm"] { --pb-fs: 13.5px; }
.pay-block[data-size="md"] { --pb-fs: 15px; }
.pay-block[data-size="lg"] { --pb-fs: 18px; }
.pay-block[data-size="xl"] { --pb-fs: 22px; }
.pay-block[data-size="2xl"] { --pb-fs: 28px; }
.pay-block[data-weight="regular"] :is(.pay-text, .pay-note, .pay-value) { font-weight: 400; }
.pay-block[data-weight="medium"] :is(.pay-text, .pay-note, .pay-value) { font-weight: 500; }
.pay-block[data-weight="bold"] :is(.pay-text, .pay-note, .pay-value) { font-weight: 700; }
.pay-block[data-lh="tight"] :is(.pay-text, .pay-note) { line-height: 1.3; }
.pay-block[data-lh="normal"] :is(.pay-text, .pay-note) { line-height: 1.6; }
.pay-block[data-lh="relaxed"] :is(.pay-text, .pay-note) { line-height: 1.9; }
.pay-block[data-lh="loose"] :is(.pay-text, .pay-note) { line-height: 2.3; }
.pay-block[data-tone="muted"] :is(.pay-text, .pay-note, .pay-value) { color: var(--text-2); }
.pay-block[data-tone="accent"] :is(.pay-text, .pay-note, .pay-value) { color: var(--accent-text); }
.pay-block[data-tone="success"] :is(.pay-text, .pay-note, .pay-value) { color: var(--success-text); }
.pay-block[data-tone="warning"] :is(.pay-text, .pay-note, .pay-value) { color: var(--warning-text, #7A5A00); }
.pay-block[data-tone="danger"] :is(.pay-text, .pay-note, .pay-value) { color: var(--danger-text); }
.pay-block[data-frame="soft"] { padding: var(--pb-pad, var(--s-3) var(--s-4)); border-radius: var(--r-3); background: var(--surface-2); }
.pay-block[data-frame="outline"] { padding: var(--pb-pad, var(--s-3) var(--s-4)); border-radius: var(--r-3); border: 1px solid var(--border-strong); }

/* قيمة تُنسخ (عنوان حساب شام كاش، محفظة): سطر واحد دائماً. الخطّ أحادي المسافات، فعرض السطر = عدد الخانات × ‎0.6em؛
   مقاسه الأصغر بين مقاسه المختار وما يملأ عرض الصندوق (100cqi / الخانات) — يصغر على الهاتف الضيّق ولا ينكسر. */
.pay-value-box { flex: 1; min-width: 0; }
.pay-copy[data-fit] .pay-value-box { container-type: inline-size; }
.pay-copy[data-fit] .pay-value { display: block; white-space: nowrap; overflow: hidden; text-overflow: clip; letter-spacing: 0;
  font: 500 13px/1.5 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: min(var(--pb-fs, 15px), calc(100cqi / (var(--len) * .61))); }
.pay-copy { gap: var(--s-3); padding-inline: var(--s-3); }
/* الهاتف الضيّق (320px): كل بكسل للعنوان */
@media (max-width: 374.98px) { .pay-copy[data-fit] { gap: var(--s-2); padding-inline: var(--s-2); } .co-blocks.buy-step { padding-inline: var(--s-3); } }

/* ══════════ إيقاع المسافات في صفحات الحساب ══════════
   كل كتلة في الصفحة (البانر، العنوان، البحث، الفئات، الجداول، البطاقات) تفصلها المسافة نفسها: --page-gap
   (24px على الحاسوب، 20px على الجوال). لا هوامش إضافية فوقها تجعل فراغاً أكبر من غيره، وداخل كل قسم
   مسافة أصغر ثابتة (--section-gap) بين عنوانه ومحتواه. */
.content { gap: var(--page-gap); }
.content .page-transition { gap: var(--page-gap); }
.content .page-transition > *, .content .store-browse > * { margin-block: 0; }
.content .page-head { margin-bottom: 0; min-height: 0; }
.content .tiles { margin: 0; }
.content .section, .content .section:has(> .cat-band) { gap: var(--section-gap); }
.content .section > * { margin-block: 0; }
.content :is(.page-transition, .store-browse) > .section + .section { margin-top: var(--s-2); }
/* البانر والفئة المفتوحة يبدآن الصفحة: لا فراغ زائد فوقهما */
.content :is(.page-transition, .store-browse) > :is(.banner, .cat-band):first-child { margin-top: 0; }

/* ══════════ إيقاع أوسع (المالك 2026-10-16: «التباعد بين العناصر صغير والعناصر قريبة جداً من بعضها») ══════════
   سلّم 8 نفسه بدرجة أعلى: الكتل --page-gap و--section-gap (أعلى الملف)، صفوف البطاقات 20/24/32، حقول النماذج 20،
   أقسام لوحات الحساب 24، أول الصفحة 24 تحت الشريط العلوي (20/32 تحت الشريط العائم). الأعمدة والهوامش الجانبية كما هي:
   ثلاث بطاقات في سطر على 320px وشريط الشراء يلامس حافّتي الشاشة. */
:root { --shell-gap: 20px; }
@media (min-width: 768px) { :root { --shell-gap: 32px; } }
.tiles { row-gap: var(--s-5); }
@media (min-width: 640px) { .tiles { row-gap: var(--s-6); } }
@media (min-width: 1024px) { .tiles { row-gap: var(--s-8); } }
.form-grid, .auth-form { gap: var(--s-5); }
.panel { gap: var(--s-6); }
.subsection { padding-top: var(--s-6); gap: var(--s-5); }
.rowcard { padding-block: var(--s-5); }
.sub-page, .rec, .rec-body, .menu-page { gap: var(--s-5); }
.page-head p { margin-top: var(--s-2); }
.filters { gap: var(--s-4) var(--s-3); }
.legal { gap: var(--s-8); }
.prose p, .prose ul { margin-bottom: var(--s-4); }
@media (max-width: 1023.98px) {
  .content { padding-top: var(--s-6); }
  :root:has(.shell) { --shell-offset: calc(var(--topbar-h) + var(--s-6)); }
  :root:has(.shell .staff-banner) { --shell-offset: calc(var(--topbar-h) + 44px + var(--s-6)); }
}

/* ══════════ ثابتة كتطبيق على الجوال ══════════
   لا انزياح جانبي: ما يخرج عن عرض الشاشة يُقصّ (clip لا hidden: لا يُنشئ حاوية تمرير، فالشريط العلوي يبقى لاصقاً)،
   والسحب الأفقي لا يحرّك الصفحة ولا يرتدّ. لا تكبير: لا بإصبعين ولا بنقرتين (pan-y وحده — والـ viewport في index.html)،
   ولا يكبّر iOS الحقل حين يُلمس: يفعل ذلك لكل خطّ أصغر من 16px، ثم يبقى مكبَّراً فتنزاح الصفحة يميناً ويساراً. */
html, body { overflow-x: clip; }
/* الارتداد (المالك 2026-10-16): أفقياً ممنوع — لا انزياح ولا ارتداد جانبي. عمودياً متروك للمتصفّح: overscroll-behavior
   none على الجذر كان يُطفئ «اسحب للتحديث» الأصلي (Chrome على Android وSafari على iOS)، والمستخدم يجب أن يحدّث الصفحة بسحبها
   من الأعلى. الثمن: ارتداد عمودي قصير عند الحافّتين (iOS) لا يمكن منعه دون إطفاء السحب للتحديث. كي لا يظهر فيه شريط أبيض:
   أرضية الجذر بلون الصفحة نفسه (وداكنة في الوضع الداكن)، وحين يقترب التمرير من آخر الصفحة تأخذ لون التذييل
   (html[data-end] — مستمع تمرير سلبي في src/main.jsx، لا يمنع تمريراً ولا سحباً). */
html, body { overscroll-behavior-x: none; overscroll-behavior-y: auto; }
html { background-color: var(--reference-page); }
html[data-end] { background-color: var(--footer-bg, var(--reference-page)); }
html { -webkit-tap-highlight-color: transparent; }
body { touch-action: pan-y; }
/* ما يُمرَّر أفقياً بنفسه يبقى كذلك */
.segmented, .table-wrap { touch-action: pan-x pan-y; }
@media (max-width: 1023.98px), (pointer: coarse) {
  .control > input, .control > select, .control > textarea, .control-search > input, .stepper > input, .ss-search input, .country-search { font-size: 16px; }
}

/* ══════════ المتجر خلف صفحة المنتج ══════════
   يبقى مركَّباً (الفئة وموضع التمرير كما هما للرجوع) لكن بلا تنسيق ولا رسم وهو مخفي. */
.store-browse { display: flex; flex-direction: column; gap: var(--page-gap, var(--s-6)); min-width: 0; }
.store-browse[data-away] { content-visibility: hidden; margin-bottom: calc(-1 * var(--page-gap, var(--s-6))); }
/* Safari قبل 18 لا يعرف content-visibility: كان المتجر يبقى ظاهراً وصفحة المنتج تُرسم تحته في آخر الصفحة، فبدا أن المنتج
   لا يُفتح. هناك يُخفى كاملاً (الرجوع يعيد موضع التمرير المحفوظ — ScrollRestoration في ui/motion.jsx) */
@supports not (content-visibility: hidden) { .store-browse[data-away] { display: none; } }

/* ══════════ بطاقات المنتجات ══════════ */
/* غير متوفر: الصورة بألوانها، شارة صغيرة داكنة في زاويتها (كما كانت قبل 2026-11-09)، والاسم باهت؛ لا تُضغط */
.tile[aria-disabled="true"] .tile-name { color: var(--text-2); }
.tile-out { position: absolute; z-index: 3; top: 9px; inset-inline-end: 9px; display: inline-flex; align-items: center; height: 22px; padding: 0 9px;
  border-radius: 6px; background: rgb(0 0 0 / .62); color: #fff; font: var(--t-caption-strong); white-space: nowrap; pointer-events: none; }
@media (min-width: 640px) { .tile-out { top: 10px; inset-inline-end: 10px; } }
/* فئة طويلة (حتى 180 منتجاً): البطاقة خارج الشاشة لا تُنسَّق ولا تُرسم، وحجمها المتوقّع يحفظ طول الصفحة (auto يتذكّر
   حجمها الحقيقي بعد أول ظهور). على اللمس والشاشات الضيقة فقط: حصر الرسم يقصّ توهّج التحويم على الحاسوب.
   الحجم المتوقّع = عرض العمود (الشاشة ناقص الهوامش والفراغات) + الاسم تحته: صفّ بحجم خاطئ كان يزيح الشبكة عند الرجوع. */
@media (hover: none), (max-width: 760px) {
  .tiles-products > .tile { content-visibility: auto; contain-intrinsic-size: auto calc((100vw - 2 * var(--gutter) - 2 * var(--s-3)) / 3 + 48px); }
}
@media (min-width: 640px) { .tiles-products > .tile { contain-intrinsic-size: auto 180px; } }

/* ══════════ صفحة الشراء (/store/p/:id — components/BuyPanel.jsx) ══════════
   الجوال أولاً: صورة المنتج واسمه، ثم خطوات مرقّمة في بطاقات، وشريط سفلي لاصق بالإجمالي و«شراء».
   على الشاشات العريضة: المنتج في عمود لاصق والخطوات بجانبه. */
.buy-page { display: flex; flex-direction: column; gap: var(--s-4); width: 100%; max-width: 1080px; margin-inline: auto; min-width: 0; }
.buy-back { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 40px; padding: 0 var(--s-4) 0 var(--s-3);
  border-radius: var(--r-full); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-1); color: var(--text-2);
  font: var(--t-callout-strong); transition: background var(--dur-1), color var(--dur-1), transform var(--dur-2) var(--ease-out); }
[dir="rtl"] .buy-back { padding: 0 var(--s-3) 0 var(--s-4); }
.buy-back > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.buy-back > svg { width: 16px; height: 16px; flex: none; }
.buy-back:hover { background: var(--surface-2); color: var(--text); }
.buy-back:active { transform: scale(.96); }
@media (max-width: 768px), (pointer: coarse) { .buy-back { min-height: 44px; } }

.buy { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-4); align-items: start; min-width: 0; }
.buy-hero { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: var(--s-4); min-width: 0;
  padding: var(--hero-pt) var(--s-5) var(--s-5); border-radius: 24px; text-align: center; border: 1px solid var(--border); box-shadow: var(--shadow-1);
  background: var(--surface); }
.buy-hero { --pic: 112px; --hero-pt: var(--s-6); }
.buy-pic { position: relative; z-index: 1; flex: none; width: var(--pic); aspect-ratio: 1; border-radius: 22%; overflow: hidden; background: var(--surface-3);
  box-shadow: 0 10px 24px -14px rgb(0 0 0 / .35); }
.buy-pic > img { width: 100%; height: 100%; object-fit: cover; }
.buy-pic[data-empty] { display: grid; place-items: center; color: var(--gray-4); }
.buy-pic[data-empty] > svg { width: 40px; height: 40px; }
.buy-head { display: flex; flex-direction: column; align-items: center; gap: var(--s-2); min-width: 0; max-width: 46ch; }
.buy-cat { display: inline-flex; align-items: center; height: 26px; padding: 0 var(--s-3); border-radius: var(--r-full); background: var(--accent-soft); color: var(--accent-text); font: var(--t-caption-strong); }
.buy-title { font: var(--t-title-1); overflow-wrap: anywhere; }
.buy-desc { font: var(--t-callout); color: var(--text-2); white-space: pre-line; overflow-wrap: anywhere; }
/* المنتج يعمل في منطقة / دولة واحدة («متاح في Asia فقط»): صفحة المنتج وحدها */
.buy-region { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 3px var(--s-3); border-radius: var(--r-full);
  background: var(--accent-soft); color: var(--accent-text); font: var(--t-caption-strong); }
.buy-region > svg { flex: none; width: 14px; height: 14px; }
/* الجوال: الصورة بجانب الاسم، فتظهر الخطوة الأولى في الشاشة الأولى */
@media (max-width: 639.98px) {
  .buy-hero { --pic: 72px; --hero-pt: var(--s-4); --ring-x: calc(var(--s-4) + var(--pic) / 2); --ring-y: 50%;
    flex-direction: row; align-items: center; gap: var(--s-4); padding: var(--s-4); border-radius: var(--r-4); text-align: start; }
  .buy-head { align-items: flex-start; gap: var(--s-1); }
  .buy-title { font: var(--t-title-2); }
}

.buy-form { display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; }
.buy-step { display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; padding: var(--s-4); border-radius: var(--r-4); background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow-1); transition: border-color var(--dur-2); }
.buy-step[data-invalid] { border-color: var(--danger); }
.buy-step-title { display: flex; align-items: center; gap: var(--s-2); font: var(--t-title-3); }
.buy-step-n { display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: var(--r-1); background: var(--accent); color: var(--on-accent); font: 700 12px/1 var(--font); }
@media (min-width: 640px) { .buy-step { padding: var(--s-5); } }
/* الخيار («الدولة»): رقائق كبيرة؛ القائمة الطويلة تُمرَّر داخل إطارها */
.opt-search { max-width: none; }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 128px), 1fr)); gap: var(--s-2); }
.opt-grid[data-long] { max-height: min(48vh, 360px); overflow-y: auto; overscroll-behavior: contain; padding: 2px; margin: -2px; }
.opt-chip { position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; min-height: 44px; padding: var(--s-2) var(--s-3);
  border-radius: var(--r-2); border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text); font: var(--t-callout-strong); line-height: 1.3;
  text-align: center; overflow-wrap: anywhere; transition: background var(--dur-1), border-color var(--dur-1), color var(--dur-1), transform var(--dur-2) var(--ease-out); }
.opt-chip > svg { width: 16px; height: 16px; flex: none; }
.opt-chip, .pack { touch-action: manipulation; }
.opt-chip[aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.opt-chip:active:not(:disabled):not([data-out]) { transform: scale(.96); }
.opt-chip[data-out] { flex-direction: column; gap: 0; border-style: dashed; background: var(--surface-2); color: var(--text-3); }
.opt-chip[data-out] small { font: var(--t-caption); color: var(--danger-text); }
/* اسم بالإنجليزية (دولة، سيرفر، نوع — BuyPanel يضع dir لكل رقاقة): يبدأ من اليسار، و«غير متوفر» العربية تحته */
.opt-chip[dir="ltr"] { justify-content: flex-start; text-align: left; }
.opt-chip[dir="ltr"][data-out] { align-items: flex-start; }
/* الخيار المختار (dir="ltr"): الاسم يساراً و«تغيير» يميناً */
.opt-picked { display: flex; align-items: stretch; gap: var(--s-2); }
.opt-picked > .opt-chip { flex: 1; justify-content: flex-start; padding-inline: var(--s-4); }
.opt-change { flex: none; min-height: 44px; padding: 0 var(--s-5); border-radius: var(--r-2); background: var(--accent-soft); color: var(--accent-text); font: var(--t-callout-strong);
  transition: transform var(--dur-2) var(--ease-out); }
.opt-change:active { transform: scale(.96); }
.opt-empty { grid-column: 1 / -1; padding: var(--s-4); text-align: center; color: var(--text-2); font: var(--t-callout); }
/* نقر خيار/باقة غير متوفرة: مؤشّر «غير مسموح» ورسالة إرشادية بدل نقرة ميتة صامتة */
.opt-chip[data-out], .pack[data-out] { cursor: not-allowed; }
.opt-oos { margin-top: var(--s-2); padding: var(--s-2) var(--s-3); border-radius: var(--r-2); background: var(--danger-soft); color: var(--danger-text); font: var(--t-callout); text-align: center; }
@media (hover: hover) {
  .opt-chip:hover:not(:disabled):not([aria-checked="true"]):not([data-out]), .pack:hover:not(:disabled):not([aria-checked="true"]):not([data-out]) { border-color: var(--accent); }
}

/* الباقات: بطاقات كبيرة بالاسم والسعر */
.pack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: var(--s-2); }
@media (max-width: 479.98px) { .pack-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pack { position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: var(--s-1); min-width: 0; min-height: 68px;
  padding: var(--s-3); border-radius: var(--r-3); border: 1.5px solid var(--border-strong); background: var(--surface); text-align: start;
  transition: background var(--dur-1), border-color var(--dur-1), transform var(--dur-2) var(--ease-out); }
.pack-label { padding-inline-end: 24px; font: var(--t-callout-strong); color: var(--text); overflow-wrap: anywhere; }
.pack-price { font: var(--t-price); color: var(--accent-text); }
.pack[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); }
.pack:active:not(:disabled):not([data-out]) { transform: scale(.97); }
.pack-tick { position: absolute; top: var(--s-2); inset-inline-end: var(--s-2); display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: var(--on-accent); }
.pack-tick > svg { width: 13px; height: 13px; }
.pack[data-out] { border-style: dashed; background: var(--surface-2); }
.pack[data-out] .pack-label { color: var(--text-3); }
.pack-out { display: inline-flex; align-items: center; height: 22px; padding: 0 var(--s-2); border-radius: var(--r-full); background: var(--danger-soft); color: var(--danger-text); font: var(--t-caption-strong); }
/* أسماء الباقات بالإنجليزية: الشبكة تُقرأ من اليسار (أصغر باقة أعلى اليسار) والبطاقة كذلك — الاسم والسعر يساراً،
   وعلامة الاختيار (نهاية السطر) يميناً. «غير متوفر» عربية فتبقى من اليمين. */
.pack-grid, .pack { direction: ltr; text-align: left; }
.pack-out { direction: rtl; }

.qty-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding-top: var(--s-3); border-top: 1px dashed var(--border-strong); }
.qty-label { font: var(--t-callout-strong); color: var(--text-2); }
.qty-row .stepper { align-self: auto; }
.qty-max { margin: 0; font: var(--t-callout); color: var(--text-2); }
/* تحت الكمية (BuyPanel QtyNote): المجموع بالوحدات، ثم باقة أوفر أو تنبيه طلب كبير — سطر واحد لكل منهما */
.qty-note { display: flex; flex-direction: column; gap: 4px; margin-top: var(--s-2); font: var(--t-callout); color: var(--text-2); }
.qty-note p { margin: 0; }
.qty-note .num { color: var(--text); font-weight: 700; }
.qty-note[data-warn] p:last-child { color: var(--danger-text); }
/* زرّ نصّي داخل سطر (اخترها، الكمية 1، اختر «325 UC»): بلون التمييز، وهدف لمس كافٍ دون أن يكسر السطر */
.qty-act { display: inline; margin-inline-start: 6px; padding: 6px 2px; border: 0; background: none; color: var(--accent-text); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.qty-act:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* كميات سريعة كبيرة بسعر كل منها */
.buy .amount-presets > button { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; flex: 1 1 88px; min-height: 52px;
  padding: var(--s-1) var(--s-3); border-radius: var(--r-2); line-height: 1.2; transition: background var(--dur-1), border-color var(--dur-1), color var(--dur-1), transform var(--dur-2) var(--ease-out); }
.buy .amount-presets > button > small { font: var(--t-caption); opacity: .85; }
.buy .amount-presets > button:active { transform: scale(.96); }

.buy-note { display: flex; align-items: flex-start; gap: var(--s-2); padding: var(--s-3) var(--s-4); border-radius: var(--r-3); font: var(--t-callout); }
.buy-note > svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.buy-note .link { display: inline; min-height: 0; color: inherit; font-weight: 700; }
.buy-note-out { background: var(--surface-3); color: var(--text-2); }
.buy-note-lack { background: var(--warning-soft); color: var(--warning-text); }
/* نقص الرصيد مع الدفع المباشر: الجملة ثم «أضف رصيداً» بالأخضر نفسه لزر «ادفع الطلب» (خياران متساويان) */
.buy-note-choice { flex-wrap: wrap; }
.buy-note-choice > span { flex: 1 1 0; min-width: 0; }
.buy-note-choice > .buy-note-btn { flex: 1 0 100%; justify-content: center; }
.buy-note-btn > svg { width: 18px; height: 18px; }
.field-error.buy-note { background: var(--danger-soft); }
.field-error.buy-note::before { margin-top: 2px; }

/* الشريط السفلي: الإجمالي والرصيد و«شراء» — لاصق أسفل الشاشة ما دامت الصفحة تُمرَّر */
.buy-bar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: var(--s-3); margin-inline: calc(-1 * var(--s-4));
  padding: var(--s-3) var(--s-4) calc(var(--s-3) + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; background: var(--surface);
  border: 1px solid var(--border); border-bottom: 0; box-shadow: 0 -12px 28px -18px rgb(0 0 0 / .35); }
.buy-sum { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.buy-sum-label { font: var(--t-caption); color: var(--text-2); }
.buy-sum-total { font: var(--t-total); color: var(--text); }
.buy-sum-bal { font: var(--t-caption); color: var(--text-3); white-space: nowrap; }
.buy-go { flex: none; min-width: 136px; }
/* الجوال: الشريط يستقرّ على حافة الشاشة في آخر الصفحة (لا فوق هامش المحتوى السفلي) */
@media (max-width: 899.98px) { .buy-page { margin-bottom: calc(-1 * var(--s-12)); } }
.buy-go > svg { width: 20px; height: 20px; }

@media (min-width: 900px) {
  .buy { grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); grid-template-rows: auto 1fr auto; column-gap: var(--s-8); }
  .buy-hero { --pic: 128px; --hero-pt: var(--s-8); grid-row: 1 / span 3; position: sticky; top: var(--shell-offset); padding-inline: var(--s-6); padding-bottom: var(--s-6); }
  .buy-form, .buy-bar { grid-column: 2; }
  .buy-bar { bottom: var(--s-4); margin: 0; padding: var(--s-3) var(--s-5); border-radius: 22px; border-bottom: 1px solid var(--border); box-shadow: var(--shadow-3); }
}

/* صفحة المنتج (Store.jsx .product-page) فوق checkout.css الذي يُحمَّل بعد هذا الملف ويكتب مقاساتها حرفياً: الاسم بسلّم
   العناوين (18 جوال، 24 عريض)، الصورة 72/96، والإجمالي في الشريط 20px — لا مقاس خارج السلّم. */
.product-page .co-buy > .co-hero { --pic: 72px; gap: var(--s-4); padding: var(--s-4); border-radius: var(--r-4); }
.product-page .co-hero .buy-pic { border-radius: 22%; }
.product-page .co-hero .buy-title { font: var(--t-title-2); }
.product-page .co-sum-total > b { font: var(--t-total); }
@container co (min-width: 640px) {
  .product-page .co-buy > .co-hero { --pic: 96px; gap: var(--s-5); padding: var(--s-5) var(--s-6); border-radius: 24px; }
  .product-page .co-hero .buy-title { font: var(--t-title-1); }
}
@container co (min-width: 840px) {
  .product-page .co-side { border-radius: 24px; }
  .product-page .co-sum-total > b { font: var(--t-title-1); }
}

/* تمّ الطلب: وحده في وسط الصفحة (لا في عمود المنتج من شبكة الشاشة العريضة) */
.buy:has(> .buy-done) { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; min-height: min(70dvh, 640px); align-content: center; }
.buy-done { grid-column: 1 / -1; justify-self: center; display: flex; flex-direction: column; align-items: center; gap: var(--s-3); width: 100%; max-width: 520px; margin-inline: auto; padding: var(--s-10) var(--s-5) var(--s-6);
  border-radius: 24px; text-align: center; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-2); }
.buy-done h1 { font: var(--t-title-1); }
.buy-done-line { display: flex; flex-direction: column; align-items: center; gap: 2px; font: var(--t-body-strong); overflow-wrap: anywhere; }
.buy-done-pack { font: var(--t-callout); color: var(--text-2); }
.buy-done-note { font: var(--t-callout); color: var(--text-2); white-space: pre-line; }
.buy-done-actions { display: flex; flex-direction: column; gap: var(--s-2); width: 100%; margin-top: var(--s-3); }

/* ══════════ صفحات فرعية — كانت حوارات وأوراقاً فوق الصفحة (components/SubPage.jsx) ══════════
   الطلب (/orders/:id)، البطاقة (/gift-cards/:id)، طلب الرصيد (/transfers/:id)، وسيلة الدفع (/payment-methods/:slug).
   بشكل صفحة الشراء: زرّ رجوع، بطاقة علوية بالصورة والاسم (.buy-hero)، ثم بطاقات المحتوى (.buy-step)؛ على الشاشات
   العريضة البطاقة العلوية في عمود لاصق. القائمة خلف الصفحة تبقى مركَّبة بلا تنسيق ولا رسم (مثل .store-browse). */
.page-under { display: flex; flex-direction: column; gap: var(--page-gap, var(--s-6)); min-width: 0; }
.page-under[data-away] { content-visibility: hidden; margin-bottom: calc(-1 * var(--page-gap, var(--s-6))); }
/* Safari قبل 18 لا يعرف content-visibility: تُخفى القائمة كاملة (الرجوع يعيد موضع التمرير المحفوظ) */
@supports not (content-visibility: hidden) { .page-under[data-away] { display: none; } }
.content .page-under > * { margin-block: 0; }

.sub-page { display: flex; flex-direction: column; gap: var(--s-4); width: 100%; max-width: 1080px; margin-inline: auto; min-width: 0; }
/* صفحة بشريط سفلي لاصق (وسيلة الدفع): الشريط يستقرّ على حافة الشاشة في آخر الصفحة */
@media (max-width: 899.98px) { .sub-page[data-bar] { margin-bottom: calc(-1 * var(--s-12)); } }
.rec { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-4); align-items: start; min-width: 0; }
.rec-body { display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; }
.rec-amount { font: 800 26px/1.15 var(--font-display); color: var(--accent-text); direction: ltr; }
.rec-hero .steps { flex-wrap: wrap; justify-content: center; margin-top: var(--s-1); }
.rec-body .rs-code { background: var(--surface); border: 1.5px dashed var(--accent); box-shadow: var(--shadow-1); }
/* several codes (quantity > 1) come one per line: each keeps its line instead of running into the next */
.rec-body .rs-code code { white-space: pre-line; }
.rec-body .rs-status { align-self: stretch; }
@media (max-width: 639.98px) {
  .rec-amount { font-size: 22px; }
  .rec-hero .steps { justify-content: flex-start; }
}
@media (min-width: 900px) {
  .rec { grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); grid-template-rows: auto 1fr auto; column-gap: var(--s-8); }
  .rec-body { grid-column: 2; }
}
/* شريط وسيلة الدفع: الزرّ الرئيسي يملأ ما بقي، و«رجوع» بجانبه. على الجوال بطاقة عائمة داخل هامش الصفحة (لا لوح بعرض
   الشاشة يطفو فوق فراغ قبل التذييل) */
.pay-page { gap: var(--s-6); }
.pay-page > .rec-body { gap: var(--s-6); }
.pay-page .rec-body > .buy-step { gap: var(--s-4); padding: var(--s-5); }
@media (min-width: 640px) { .pay-page .rec-body > .buy-step { padding: var(--s-6); } }
.pay-page .rec-body form.stack { gap: var(--s-5); }
@media (max-width: 374.98px) { .pay-page .rec-body > .buy-step { padding-inline: var(--s-3); } }
.pay-page .pay-blocks { gap: max(var(--pb-gap, var(--s-4)), var(--s-4)); }
.pay-page > .pay-bar { margin-inline: 0; padding: var(--s-2); bottom: calc(var(--s-4) + env(safe-area-inset-bottom)); border-radius: var(--r-4);
  border-bottom: 1px solid var(--border); box-shadow: var(--shadow-3); }
.pay-bar .pay-go { flex: 1; min-width: 0; }
/* رأس صفحة الوسيلة على الهاتف: سطر بالصورة والاسم، لا بطاقة كبيرة لاسم واحد */
@media (max-width: 639.98px) {
  .pay-page > .buy-hero { --pic: 56px; gap: var(--s-3); padding: var(--s-3); border-radius: var(--r-4); }
  .pay-page > .buy-hero .buy-pic { border-radius: var(--r-3); }
  .pay-page > .buy-hero .buy-pic[data-empty] > svg { width: 24px; height: 24px; }
  .pay-page > .buy-hero .buy-title { font: var(--t-title-3); font-weight: 800; }
}
.pay-bar .pay-prev { flex: none; }
.pay-bar .pay-prev > svg { width: 18px; height: 18px; }
.pay-page .deposit { padding-block: 0; }

/* ══════════ القائمة على الجوال (/menu) — كانت قائمة تنزلق فوق الصفحة ══════════ */
.menu-page { display: flex; flex-direction: column; gap: var(--s-4); width: 100%; max-width: 560px; margin-inline: auto; min-width: 0; }
.menu-page .user-card { margin: 0; padding: var(--s-4); border-radius: 24px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-1); }
.menu-page .user-card .avatar { width: 48px; height: 48px; }
.menu-page > .nav { gap: var(--s-3); }
.menu-page > .nav > .nav { gap: 2px; padding: var(--s-2); border-radius: 24px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-1); }
.menu-page .nav-group { padding: var(--s-2) var(--s-3) var(--s-1); }
.menu-page .nav-item { height: 52px; border-radius: 16px; font-size: 16px; color: var(--text); }
.menu-page .nav-item:active { background: var(--surface-2); }
.menu-page .sidebar-foot { margin: 0; padding: var(--s-2); border: 1px solid var(--border); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow-1); }

/* تسجيل خروج جهاز: التأكيد في السطر نفسه */
.session-confirm { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: var(--s-2); }
.session-confirm-q { font: var(--t-callout-strong); color: var(--danger-text); }
@media (max-width: 479.98px) {
  .session[data-confirming] { flex-wrap: wrap; }
  .session[data-confirming] .session-confirm { flex-basis: 100%; justify-content: flex-start; }
}

/* شريط الحساب على الجوال: سطح شبه مصمت (لا يختلط به ما يمرّ تحته) */
@media (max-width: 1023.98px) { .topbar { background: color-mix(in srgb, var(--bg) 94%, transparent); } }

/* ── batch-2: الشريط العلوي على الجوال — وسطه فارغ في «شراء منتج» وشعار محطة في باقي الأقسام (Layout.jsx).
   عمودا الطرفين متساويان فيبقى الشعار في منتصف الشاشة؛ رصيد كبير يأخذ ما يحتاجه (1fr = minmax(auto, 1fr)) ولا يُقصّ. */
@media (max-width: 1023.98px) {
  .topbar { grid-template-columns: 1fr auto 1fr; }
  .topbar > :first-child { justify-self: start; }
  .topbar .balance-chip { justify-self: end; white-space: nowrap; flex: none; }
  .topbar-mid { display: flex; align-items: center; justify-content: center; min-width: 0; }
  .topbar-logo { height: 44px; padding: 0 var(--s-1); border-radius: var(--r-2); -webkit-tap-highlight-color: transparent; }
  .topbar-logo .logo-lockup { display: block; height: 28px; width: auto; max-width: 100%; }
  .topbar-logo:active .logo-lockup { transform: scale(.94); transition: transform .15s; }
}

/* ── batch-2: بطاقة العميل (الشريط الجانبي وصفحة القائمة) — الاسم كاملاً (يلتفّ على سطرين أو أكثر، لا نقاط)،
   والرصيد كاملاً في سطر تحته، والصورة الرمزية كاملة بجانبهما مهما طال الاسم أو كبر الرصيد. */
.user-card { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--s-3); row-gap: 2px; align-items: center; }
.user-card .avatar { grid-row: 1 / span 2; align-self: center; }
.user-card > .stack { grid-column: 2; min-width: 0; }
.user-card .name { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; line-height: 1.3; }
.user-card .balance { grid-column: 2; justify-self: start; margin-inline-start: 0; white-space: nowrap; line-height: 1.25; }
/* الاسم رابط إلى «البيانات الشخصية» يغطّي البطاقة كلّها (الصورة أيضاً)؛ الرصيد فوقه رابطه الخاص إلى «إضافة رصيد» */
.user-card { position: relative; transition: background var(--dur-1), box-shadow var(--dur-1); }
.user-card .user-link { color: inherit; text-decoration: none; outline: none; }
.user-card .user-link::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-3); }
.menu-page .user-card .user-link::after { border-radius: 24px; }
.user-card .balance { position: relative; z-index: 1; }
@media (hover: hover) { .user-card:has(.user-link:hover) { background: color-mix(in srgb, var(--accent) 7%, var(--surface-2)); } }
.user-card:has(.user-link:active) { transform: scale(.985); transition: transform .12s; }
.user-card:has(.user-link:focus-visible) { box-shadow: var(--focus); }

/* ───────── الشراء دون حساب (2026-10-14): الشريط العام، دعوة الحساب، التواصل والدفع، ومتابعة الطلب ───────── */
.public-shop-main { display: flex; flex-direction: column; gap: var(--page-gap); padding: var(--shell-gap) 0 var(--s-12); }
/* البحث في المنتجات (StoreSearch): الحقل نفسه في الرئيسية والمتجر، للزائر ولصاحب الحساب — على يمين الصفحة (بداية
   السطر) بعرض ثابت، وبعرض الشاشة على الجوال. والمتجر للزائر بإيقاع مسافات صفحات الحساب نفسه، فيقع البحث تحت
   العنوان على المسافة نفسها. */
.store-search { flex: none; width: 100%; max-width: 480px; margin-inline: 0 auto; align-self: flex-start; }
@media (max-width: 639.98px) { .store-search { max-width: none; align-self: stretch; } }
.public-shop-main .store-browse > * { margin-block: 0; }
.public-shop-main .page-head { margin-bottom: 0; min-height: 0; }
.public-shop-main .section { gap: var(--section-gap); }
.public-shop-main .section > * { margin-block: 0; }
.public-shop-main .store-browse > .section + .section { margin-top: var(--s-2); }
.public-header .row { flex-wrap: nowrap; }
.public-mine > svg { width: 16px; height: 16px; }
.public-account { display: none; }
/* الجوال: الشعار، زرّ المظهر، «طلباتي» أيقونة إن وُجدت، وزرّ واحد «دخول» يفتح نافذة فيها تسجيل الدخول وإنشاء حساب
   (وGoogle) — components/AuthPrompt.jsx. يتّسع لـ320px والشعار لا ينضغط أبداً. */
@media (max-width: 639.98px) {
  .public-login, .public-signup { display: none; }
  .public-account { display: inline-flex; gap: 6px; padding-inline: var(--s-3) var(--s-4); }
  .public-account > svg { width: 18px; height: 18px; }
  .public-mine { width: 44px; padding: 0; }
  .public-mine > span { display: none; }
  .public-actions { gap: var(--s-1); }
}
@media (max-width: 359.98px) {
  .public-account { padding-inline: var(--s-3); }
  .public-account > svg { display: none; }
  .public-actions > .icon-btn, .public-mine { width: 40px; }
}
@media (hover: hover) { .public-account:hover { background: var(--accent-strong); } }
.auth-theme { position: absolute; z-index: 2; top: calc(var(--s-3) + env(safe-area-inset-top)); inset-inline-end: var(--s-3); }
@media (min-width: 640px) { .auth-theme { top: var(--s-5); inset-inline-end: var(--s-5); } }

.gp-contact-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; border-radius: 14px; background: var(--surface-3); }
.gp-contact-mode > button { min-height: 44px; border-radius: 11px; font: var(--t-callout-strong); color: var(--text-2);
  transition: background var(--dur-2) var(--ease-out), color var(--dur-1); }
/* equal choices, the one picked in the brand's green (owner 2026-11-12: every equal option the same green) */
.gp-contact-mode > button[aria-checked="true"] { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-1); }
.gp-method-img { position: relative; width: 48px; height: 48px; border-radius: var(--r-2); overflow: hidden; background: var(--surface-3); }
.gp-method-img img { width: 100%; height: 100%; object-fit: cover; }
.gp-method-img .method-art { position: absolute; inset: 0; }
.gp-amount { display: flex; flex-direction: column; align-items: center; gap: var(--s-1); margin: 0; padding: var(--s-4); border-radius: var(--r-4);
  background: var(--surface-2); border: 1.5px dashed var(--accent); text-align: center; }
.gp-amount-label { font: var(--t-callout-strong); color: var(--text-2); }
/* المبلغ: الرقم ثم وحدته (‎$1.05 · ‏146 ل.س · 1.05 USDT)، أرقام جدولية فلا يقفز عند التبدّل */
.gp-amount-value { position: relative; isolation: isolate; display: inline-flex; align-items: baseline; justify-content: center; gap: var(--s-2);
  font: var(--t-title-1); font-weight: 800; color: var(--accent-text); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.gp-unit { font: var(--t-body-strong); color: var(--text-2); letter-spacing: 0; }
.gp-amount-none { color: var(--text-3); }
/* السعر يُطلب الآن: مكان الرقم ينبض بهدوء (شفافية فقط) */
.gp-amount-wait { display: inline-block; width: 3.4em; height: .8em; border-radius: var(--r-1); background: var(--surface-3); vertical-align: middle; animation: gp-wait .8s ease-in-out infinite alternate; }
.gp-hint-wait { width: 9em; height: 1em; }
@keyframes gp-wait { from { opacity: .45; } to { opacity: 1; } }
/* المبلغ تغيّر (سعر صرف جديد): وهج خلفه مرّة واحدة */
.gp-amount-value::before, .topup-rate::before { content: ""; position: absolute; inset: -2px -12px; z-index: -1; border-radius: var(--r-2); background: var(--warning-soft); opacity: 0; }
.gp-amount-value[data-flash]::before, .topup-rate[data-flash]::before { animation: gp-glow 1.8s var(--ease-out); }
@keyframes gp-glow { 12% { opacity: 1; } 100% { opacity: 0; } }
.topup-rate { position: relative; isolation: isolate; display: inline-block; }
@media (prefers-reduced-motion: reduce) { .gp-amount-wait { animation: none; } .gp-amount-value[data-flash]::before, .topup-rate[data-flash]::before { animation: none; opacity: 1; } }
.fam-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }

.track { display: flex; flex-direction: column; gap: var(--s-4); }
.track-line { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-4); position: relative; }
.track-line > li { position: relative; display: flex; gap: var(--s-3); align-items: flex-start; }
.track-line > li:not(:last-child)::after { content: ""; position: absolute; inset-inline-start: 8px; top: 22px; bottom: calc(-1 * var(--s-4) + 2px); width: 2px;
  border-radius: 2px; background: var(--border); }
.track-dot { width: 18px; height: 18px; flex: none; margin-top: 3px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--surface); }
.track-line > li[data-state="done"] .track-dot { border-color: var(--accent); background: var(--accent); }
.track-line > li[data-state="now"] .track-dot { border-color: var(--accent); background: var(--accent-soft); animation: track-pulse 1.6s var(--ease-out) infinite; }
.track-line > li[data-state="bad"] .track-dot { border-color: var(--danger); background: var(--danger-soft); }
@keyframes track-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
@media (prefers-reduced-motion: reduce) { .track-line > li[data-state="now"] .track-dot { animation: none; } }
.track-note { display: block; margin-top: 2px; font: var(--t-callout); color: var(--text-2); }
/* why it was refused: said plainly in the danger colour, no box; what happened to the money keeps its tinted line */
.track-note.track-why { color: var(--danger-text); font-weight: 600; }
.track-note.ov-refund { margin-top: var(--s-2); padding: var(--s-2) var(--s-3); border-radius: 12px; background: var(--surface-2); color: var(--text); }
.track-deposit { display: flex; flex-direction: column; gap: var(--s-3); }
.track-hint { text-align: center; }
.track-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.track-row { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-radius: 18px; background: var(--surface);
  border: 1px solid var(--border); }
.track-row > svg { width: 16px; height: 16px; color: var(--text-3); transform: scaleX(-1); }
@media (hover: hover) { .track-row:hover { border-color: var(--accent); } }

/* ══════════ Touch targets (store polish 2026-10-15b) ══════════
   On touch screens the small controls keep their look but get a 44px hit area: the order number copy button in the
   records (22px tall), the balance in the top bar (36px) and the balance in the menu card. */
@media (pointer: coarse) {
  button.copy, .topbar .balance-chip, .user-card .balance { position: relative; }
  button.copy::after { content: ""; position: absolute; inset: -11px -4px; }
  .topbar .balance-chip::after { content: ""; position: absolute; inset: -4px -2px; }
  .user-card .balance::after { content: ""; position: absolute; inset: -12px -8px; }
}

/* the animation code never arrived (frontend/src/ui/motion.jsx): show what waits for it in its starting state */
:root[data-motion="off"] [style*="opacity"] { opacity: 1 !important; transform: none !important; }

/* ══════════ «حدث خطأ غير متوقع» (components/ErrorBoundary.jsx, 2026-10-22) ══════════
   Calm, not alarming: an amber mark, one line, «أعد تحميل الصفحة» as the one primary action and the way back to the store.
   App level: centred on the whole screen; inside the bars (`.err-page`): a card in the content area, bars and menu kept. */
.err-box { display: flex; flex-direction: column; align-items: center; gap: var(--s-2); text-align: center;
  width: min(100% - 2 * var(--s-4), 440px); margin: max(12vh, var(--s-12)) auto; padding: var(--s-8) var(--s-5);
  border-radius: 24px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-2); color: var(--text);
  animation: m-rise .45s var(--ease-emph, cubic-bezier(.16, 1, .3, 1)) both; }
.err-page { margin: var(--s-6) auto; box-shadow: var(--shadow-1); }
.err-ic { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: var(--s-2); border-radius: 18px;
  background: var(--warning-soft); color: var(--warning-text); animation: err-nudge .6s .25s var(--ease-emph, ease) both; }
.err-ic > svg { width: 28px; height: 28px; }
.err-title { margin: 0; font: var(--t-title-2); }
.err-text { margin: 0; font: var(--t-callout); color: var(--text-2); max-width: 34ch; }
.err-actions { display: flex; flex-direction: column; align-items: stretch; gap: var(--s-2); width: 100%; margin-top: var(--s-4); }
@keyframes err-nudge { 0% { transform: scale(.6) rotate(-12deg); opacity: 0; } 60% { transform: scale(1.08) rotate(4deg); opacity: 1; } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .err-box, .err-ic { animation: none; } }

/* ── 2026-10-22: the account's top bar on a phone carries the theme button too (Layout.jsx «topbar-end»), beside the
   balance — the visitor's bar has it, the account had it only inside «القائمة». Fits 320 px with a five-digit balance:
   the button is 40 px there and the logo column gives way first (it never overlaps). */
@media (max-width: 1023.98px) {
  .topbar-end { justify-self: end; display: inline-flex; align-items: center; gap: var(--s-1); flex: none; }
  .topbar-end .balance-chip { justify-self: auto; }
}
@media (max-width: 359.98px) {
  .topbar { gap: var(--s-1); padding-inline: var(--s-2); }
  .topbar-end .topbar-theme { width: 40px; }
}

/* Order lists (OrdersTable/CardsTable «Paid»): what was paid, and under it what went back of a partial order */
.paid { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 1px; line-height: 1.25; }
.paid-back { font: var(--t-caption); color: var(--text-2); white-space: nowrap; }

/* «إلغاء الطلب» (components/CancelOrder.jsx): a quiet text button under the payment, asking once before it cancels */
.cxl { display: flex; flex-direction: column; align-items: center; gap: var(--s-2); text-align: center; }
.cxl-open { color: var(--danger-text); font: var(--t-callout-strong); min-height: 44px; background: none; border: 0; padding: 0 var(--s-3); cursor: pointer; }
.cxl[data-open] { align-items: stretch; padding: var(--s-4); border-radius: var(--r-3); background: var(--danger-soft);
  animation: m-rise .3s var(--ease-emph, ease) both; }
.cxl-q { margin: 0; font: var(--t-callout); color: var(--text); }
.cxl-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); }
.cxl[data-open] .ui-btn-danger-soft { background: var(--danger); color: #fff; }
@media (prefers-reduced-motion: reduce) { .cxl[data-open] { animation: none; } }
