/* ==========================================================================
   Design system — Arabic-first, RTL, mobile-first.
   Msweq identity (D28, 1 Nov 2026; spec docs/superpowers/specs/2026-11-01-msweq-identity-design.md):
   light, calm working pages on a pale blue ground; blue for actions, navy for headings, cyan for highlights,
   the brand gradient in a few hero places only, green only on money. Profit leads every product and order surface.
   ========================================================================== */

/* ---------- fonts (self-hosted; OFL — see static/fonts/LICENSE-*) ---------- */
@font-face { font-family: "Readex Pro"; font-style: normal; font-weight: 160 700; font-display: swap;
  src: url("../fonts/readex-pro-arabic-wght-normal.d81b2377546d.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Readex Pro"; font-style: normal; font-weight: 160 700; font-display: swap;
  src: url("../fonts/readex-pro-latin-wght-normal.aa0c29916314.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Arabic"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/ibm-plex-sans-arabic-arabic-400-normal.4fa3d81d41ab.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Plex Arabic"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/ibm-plex-sans-arabic-arabic-500-normal.106892212ea7.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Plex Arabic"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/ibm-plex-sans-arabic-arabic-600-normal.64891a810259.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Plex Arabic"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/ibm-plex-sans-arabic-arabic-700-normal.a4390abc98c2.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Plex Arabic"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/ibm-plex-sans-arabic-latin-400-normal.4767e1197706.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Arabic"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/ibm-plex-sans-arabic-latin-500-normal.80ebc672c915.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Arabic"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/ibm-plex-sans-arabic-latin-600-normal.f417eeb0d15e.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Arabic"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/ibm-plex-sans-arabic-latin-700-normal.8d04403cf599.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- tokens ---------- */
/* Msweq identity (D28, 1 Nov 2026): blue for actions, navy for headings, cyan only as highlight, the navy→cyan
   gradient only in a few hero places (hero, wallet card, new-order button, CTA band, "our role" card), green only
   for money. Every token is defined here; both dark blocks below redefine the same names with the same values. */
:root {
  --bg: #F4F9FD;
  --surface: #FFFFFF;
  --surface-2: #F9FBFE;
  --sunken: #EDF4FA;
  --line: #DFE8F0;           /* the logo's light grey lives in lines and dividers */
  --line-strong: #C8D6E4;
  --ink: #172B45;
  --ink-2: #2F4560;
  --muted: #5B6B81;          /* 5.3:1 on white */
  --faint: #8A9BB0;          /* decorative only, never for body text */

  --navy: #0A3F7A;           /* headings and brand text, from the logo's name */
  --navy-2: #0A4A8C;
  --cyan: #12C7E8;           /* highlight and decoration only, never text on a light ground */
  --cyan-tint: #DDF6FC;
  --cyan-ink: #075E73;
  --grad-brand: linear-gradient(135deg, #0A4A8C 0%, #0867C9 52%, #12C7E8 120%);
  --hero-top: #01307F;       /* the 3D render's own ground, so the picture melts into the hero */
  --hero-mid: #021F57;
  --hero-floor: #0D4BAA;
  --on-hero: #FFFFFF;
  --on-hero-muted: #B9CCEA;
  --on-hero-accent: #3AD6F2;

  --plum: #05275A;           /* dark brand panels on public pages (footer, sign-in art) */
  --plum-2: #0A3F7A;
  --plum-ink: #EEF5FF;
  --plum-muted: #B9CCEA;

  --accent: #0867C9;         /* actions, links, the current page */
  --accent-hover: #0757AC;
  --accent-tint: #E6F1FC;
  --accent-ink: #0757AC;

  --money: #087A50;          /* money only: profit, balances, payouts */
  --money-hover: #066B45;
  --money-tint: #EAF7F0;
  --money-ink: #0B5E40;
  --money-solid: #086747;    /* filled money surfaces that carry text: 6.9:1 with white */
  --on-money: #FFFFFF;
  --on-accent: #FFFFFF;
  --on-danger: #FFFFFF;
  --tag-string: rgba(23, 43, 69, .45);
  --placeholder: #6B7B90;    /* 4.6:1 on white */
  --select-chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235B6B81' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9.5 6 6 6-6'/%3E%3C/svg%3E");

  --gold: #F2B33D;           /* "new", goals, highlights */
  --gold-tint: #FFF6E0;
  --gold-ink: #855400;

  --info: #0867C9; --info-tint: #E6F1FC; --info-ink: #0757AC;
  --warn: #9A6200; --warn-tint: #FFF6E0; --warn-ink: #855400;
  --danger: #C8323E; --danger-tint: #FFF0F2; --danger-ink: #B42332;

  /* tinted number tiles: what kind of number it is, at a glance */
  --tile-orders: #E6F1FC; --tile-orders-ink: #0867C9;
  --tile-ship: #DDF6FC;   --tile-ship-ink: #087A93;
  --tile-rates: #FFF6E0;  --tile-rates-ink: #9A6200;
  --tile-money: #EAF7F0;  --tile-money-ink: #087A50;

  --r-xs: 8px; --r-sm: 10px; --r-ctl: 12px; --r: 18px; --r-lg: 22px; --r-xl: 28px; --r-full: 999px;
  --sh-1: 0 1px 2px rgba(10, 40, 80, .04), 0 6px 20px rgba(10, 40, 80, .06);   /* calm card shadow */
  --sh-2: 0 10px 28px rgba(10, 40, 80, .12);
  --sh-3: 0 22px 56px rgba(5, 30, 70, .24);
  --sh-accent: 0 6px 16px rgba(8, 103, 201, .24);
  --focus: 0 0 0 4px rgba(8, 103, 201, .16);         /* soft halo for fields (their border turns accent too) */
  --focus-ring: 0 0 0 2px var(--surface), 0 0 0 4px rgba(8, 103, 201, .85);  /* buttons, links, cards: >3:1 */

  --f-body: "Plex Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
  --f-display: "Readex Pro", "Plex Arabic", "Segoe UI", Tahoma, sans-serif;

  --side-w: 252px;
  --top-h: 64px;
  --bnav-h: 70px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #06111F; --surface: #0C1A2E; --surface-2: #0F1F35; --sunken: #0A1627;
    --line: #1B3049; --line-strong: #284263;
    --ink: #EAF2FB; --ink-2: #C3D2E3; --muted: #93A7BF; --faint: #5E7390;
    --navy: #DCEBFF; --navy-2: #9CCBFF; --cyan: #3AD6F2; --cyan-tint: #0B3341; --cyan-ink: #8FE8F8;
    --plum: #030C18; --plum-2: #0C1A2E; --plum-ink: #EAF2FB; --plum-muted: #93A7BF;
    --accent: #4EA2FF; --accent-hover: #73B6FF; --accent-tint: #0F2A4D; --accent-ink: #9CCBFF;
    --money: #4FD19B; --money-hover: #6EDCAF; --money-tint: #10322A; --money-ink: #86E3C4;
    --money-solid: #3CC48D; --on-money: #04241A; --on-accent: #04203F; --on-danger: #2E0A08;
    --focus: 0 0 0 4px rgba(78, 162, 255, .28); --focus-ring: 0 0 0 2px var(--surface), 0 0 0 4px rgba(115, 182, 255, .9);
    --tag-string: rgba(234, 242, 251, .4); --placeholder: #8399B3;
    --select-chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2393A7BF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9.5 6 6 6-6'/%3E%3C/svg%3E");
    --gold: #F0B536; --gold-tint: #33280F; --gold-ink: #F1CF8F;
    --info: #4EA2FF; --info-tint: #0F2A4D; --info-ink: #9CCBFF;
    --warn: #E9B566; --warn-tint: #33280F; --warn-ink: #F1CF8F;
    --danger: #F28A8F; --danger-tint: #3D1D22; --danger-ink: #F7B5B8;
    --tile-orders: #0F2A4D; --tile-orders-ink: #9CCBFF;
    --tile-ship: #0B3341;   --tile-ship-ink: #8FE8F8;
    --tile-rates: #33280F;  --tile-rates-ink: #F1CF8F;
    --tile-money: #10322A;  --tile-money-ink: #86E3C4;
    --sh-1: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .22);
    --sh-2: 0 10px 28px rgba(0, 0, 0, .4); --sh-3: 0 22px 56px rgba(0, 0, 0, .6); --sh-accent: 0 6px 16px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #06111F; --surface: #0C1A2E; --surface-2: #0F1F35; --sunken: #0A1627;
  --line: #1B3049; --line-strong: #284263;
  --ink: #EAF2FB; --ink-2: #C3D2E3; --muted: #93A7BF; --faint: #5E7390;
  --navy: #DCEBFF; --navy-2: #9CCBFF; --cyan: #3AD6F2; --cyan-tint: #0B3341; --cyan-ink: #8FE8F8;
  --plum: #030C18; --plum-2: #0C1A2E; --plum-ink: #EAF2FB; --plum-muted: #93A7BF;
  --accent: #4EA2FF; --accent-hover: #73B6FF; --accent-tint: #0F2A4D; --accent-ink: #9CCBFF;
  --money: #4FD19B; --money-hover: #6EDCAF; --money-tint: #10322A; --money-ink: #86E3C4;
  --money-solid: #3CC48D; --on-money: #04241A; --on-accent: #04203F; --on-danger: #2E0A08;
  --focus: 0 0 0 4px rgba(78, 162, 255, .28); --focus-ring: 0 0 0 2px var(--surface), 0 0 0 4px rgba(115, 182, 255, .9);
  --tag-string: rgba(234, 242, 251, .4); --placeholder: #8399B3;
  --select-chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2393A7BF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9.5 6 6 6-6'/%3E%3C/svg%3E");
  --gold: #F0B536; --gold-tint: #33280F; --gold-ink: #F1CF8F;
  --info: #4EA2FF; --info-tint: #0F2A4D; --info-ink: #9CCBFF;
  --warn: #E9B566; --warn-tint: #33280F; --warn-ink: #F1CF8F;
  --danger: #F28A8F; --danger-tint: #3D1D22; --danger-ink: #F7B5B8;
  --tile-orders: #0F2A4D; --tile-orders-ink: #9CCBFF;
  --tile-ship: #0B3341;   --tile-ship-ink: #8FE8F8;
  --tile-rates: #33280F;  --tile-rates-ink: #F1CF8F;
  --tile-money: #10322A;  --tile-money-ink: #86E3C4;
  --sh-1: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .22);
  --sh-2: 0 10px 28px rgba(0, 0, 0, .4); --sh-3: 0 22px 56px rgba(0, 0, 0, .6); --sh-accent: 0 6px 16px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--f-body); font-size: 15px; line-height: 1.7;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; display: block; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
::placeholder { color: var(--placeholder); opacity: 1; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--r-xs); }
/* on the navy and gradient brand panels the blue halo disappears: a navy ring inside a cyan one shows against a white
   button, the navy ground, the gradient's cyan end and the white side menu alike (design review M4) */
.pub-foot :focus-visible, .auth-art :focus-visible, .hero-band :focus-visible, .cta-band :focus-visible, .wallet-card :focus-visible,
.role-us :focus-visible, .side-wallet:focus-visible { box-shadow: 0 0 0 2px var(--hero-mid), 0 0 0 4px var(--on-hero-accent); }
::selection { background: var(--accent-tint); color: var(--accent-ink); }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
[hidden] { display: none !important; }
/* light/dark picture pairs (the logo with a navy or a white name): <picture> cannot see the manual toggle */
.theme-dark-only { display: none !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-dark-only { display: block !important; }
  :root:not([data-theme="light"]) .theme-light-only { display: none !important; }
}
:root[data-theme="dark"] .theme-dark-only { display: block !important; }
:root[data-theme="dark"] .theme-light-only { display: none !important; }
/* the folded ribbon from the logo, as a quiet decoration on brand panels only */
.ribbon { position: absolute; pointer-events: none; color: #FFFFFF; opacity: .2; width: 300px; height: auto; }
.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; }
.skip { position: absolute; inset-inline-start: 12px; top: -48px; background: var(--ink); color: var(--surface); padding: 8px 14px; border-radius: var(--r-sm); z-index: 100; }
.skip:focus { top: 12px; }

.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.i-sm { width: 16px; height: 16px; }
.i-lg { width: 24px; height: 24px; }
/* Direction-dependent glyphs flip in RTL (chevrons that mean "next/back"). */
[dir="rtl"] .i-flip { transform: scaleX(-1); }
/* The chevrons and the sign-out arrow are drawn for RTL, so English (LTR) turns them around (D33). */
[dir="ltr"] .i-flip-ltr { transform: scaleX(-1); }

/* ---------- type ---------- */
h1, h2, h3, h4 { font-family: var(--f-display); color: var(--navy); margin: 0; font-weight: 600; letter-spacing: 0; line-height: 1.35; text-wrap: balance; }
h1 { font-size: 24px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
h4 { font-size: 15px; }
p { margin: 0 0 12px; }
small, .small { font-size: 13px; }
.muted { color: var(--muted); }
.ink2 { color: var(--ink-2); }
/* Numbers inside Arabic text: isolate them so phones, codes and ranges keep their order.
   Only inline runs switch to LTR; a block (td, dd, div, h1) keeps the page direction so it
   still lines up with its RTL siblings and headers. */
.num { font-variant-numeric: tabular-nums; unicode-bidi: isolate; }
:is(span, b, strong, a, small, em, i, bdi, label, time).num { direction: ltr; white-space: nowrap; }
.amount { font-family: var(--f-display); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.amount-money { color: var(--money-ink); }
.amount-neg { color: var(--danger-ink); }
.amount-warn { color: var(--warn-ink); }  /* D39: a price above twice the suggested one (asked, never refused) */
.ltr { direction: ltr; unicode-bidi: isolate; }
.lead { font-size: 17px; color: var(--ink-2); }
.prose { max-width: 70ch; }
.prose p { margin-bottom: 14px; }
.prose h2 { margin: 28px 0 10px; }
.prose ul, .prose ol { padding-inline-start: 22px; margin: 0 0 14px; }
.prose li { margin-bottom: 6px; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nowrap { white-space: nowrap; }
.bdi { unicode-bidi: isolate; }

/* ---------- app shell ---------- */
.app { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); }
.side { display: none; }
.main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.content { width: 100%; max-width: 1200px; margin-inline: auto; padding: 18px 16px calc(var(--bnav-h) + env(safe-area-inset-bottom) + 28px); flex: 1; }

@media (min-width: 1024px) {
  .app { grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .side {
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow: hidden;
    background: var(--surface); color: var(--ink-2); border-inline-end: 1px solid var(--line); padding: 18px 14px 16px; gap: 6px;
  }
  /* the menu list scrolls on short screens; the logo and the wallet card at the foot stay in view */
  .side .nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; margin-inline: -14px; padding-inline: 14px;
    scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
  .side .side-foot { flex: none; }
  .content { padding: 28px 32px 56px; }
}

/* the logo: the M mark beside "Msweq" over «مسّوق» (images cut from the owner's logo, D28) */
.lockup { display: inline-flex; align-items: center; gap: 10px; flex: none; text-decoration: none; }
.lockup:hover { text-decoration: none; }
.lockup-mark { width: auto; height: 34px; }
.lockup-names { display: grid; gap: 3px; justify-items: center; }
.lockup-en { width: 92px; height: auto; }
.lockup-ar { width: 58px; height: auto; }
.lockup-side { padding: 2px 8px 16px; }
.lockup-top .lockup-mark { height: 30px; }
.lockup-top .lockup-en { width: 80px; }
.lockup-top .lockup-ar { width: 50px; }
@media (max-width: 399px) { .lockup-top .lockup-names, .pub-head .lockup-names { display: none; } }
.side-team { margin: -8px 8px 8px; font-size: 12.5px; color: var(--muted); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-group { margin-top: 16px; padding: 0 12px 4px; font-size: 12px; color: var(--muted); }
.nav a {
  display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: 11px;
  color: var(--ink-2); text-decoration: none; font-size: 14.5px; position: relative;
}
.nav a .i { color: var(--muted); }
.nav a:hover { background: var(--sunken); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--accent-tint); color: var(--accent-ink); font-weight: 600; }
.nav a[aria-current="page"]::before {
  content: ""; position: absolute; inset-inline-start: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 4px;
  background: linear-gradient(180deg, var(--cyan), var(--accent));
}
.nav a[aria-current="page"] .i { color: var(--accent); }
.nav .count { margin-inline-start: auto; min-width: 22px; height: 22px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: var(--r-full); background: var(--warn-tint); color: var(--warn-ink); font-family: var(--f-display); font-size: 12px; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; }
.nav .count.is-danger { background: var(--danger-tint); color: var(--danger-ink); }
.nav .soon { margin-inline-start: auto; font-size: 11.5px; color: var(--muted); }

.side-foot { margin-top: auto; padding-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.side-wallet {
  position: relative; overflow: hidden; display: block; text-decoration: none; border-radius: var(--r); padding: 14px 16px;
  background: var(--grad-brand); color: #FFFFFF; box-shadow: 0 10px 24px rgba(8, 80, 170, .24);
}
.side-wallet:hover { text-decoration: none; filter: brightness(1.05); }
.side-wallet .lbl { position: relative; font-size: 12.5px; color: #DDEBFB; }
.side-wallet .val { position: relative; font-family: var(--f-display); font-size: 21px; font-weight: 600; color: #FFFFFF; font-variant-numeric: tabular-nums; }
.side-wallet .sub { position: relative; font-size: 12px; color: #DDEBFB; }
.side-wallet .ribbon { width: 170px; inset-inline-end: -46px; bottom: -44px; opacity: .2; }
.side-help { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: 13.5px; min-height: 40px; padding: 0 12px; border-radius: var(--r-sm); }
.side-help:hover { color: var(--ink); background: var(--sunken); text-decoration: none; }

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--top-h);
  display: flex; align-items: center; gap: 10px; padding: 0 16px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
@media (min-width: 1024px) { .topbar { padding: 0 32px; } .topbar .lockup-top { display: none; } }
.topbar-search { flex: 1; max-width: 480px; position: relative; display: none; }
@media (min-width: 760px) { .topbar-search { display: block; } }
.topbar-search input {
  width: 100%; height: 42px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg); padding-block: 0; padding-inline: 40px 14px;
}
.topbar-search .i { position: absolute; inset-inline-start: 13px; top: 11px; color: var(--muted); pointer-events: none; }
.topbar-search input:focus { border-color: var(--accent); box-shadow: var(--focus); outline: none; }
.topbar-end { margin-inline-start: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn {
  position: relative; width: 42px; height: 42px; border-radius: 12px; border: 1px solid transparent;
  display: inline-grid; place-items: center; background: transparent; color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: var(--sunken); border-color: var(--line); text-decoration: none; }
/* the always-visible "how it works" button (a help-videos button in the reference apps) */
.help-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border-radius: 12px;
  border: 1px solid var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 13.5px; white-space: nowrap; text-decoration: none;
}
.help-btn:hover { background: var(--accent-tint); text-decoration: none; }
.help-btn .i { width: 16px; height: 16px; }
@media (max-width: 759px) { .help-btn { height: 36px; padding: 0 10px; font-size: 12.5px; } .help-btn .lg { display: none; } }
@media (min-width: 760px) { .help-btn .sm { display: none; } }
/* unread count sits on the bell's shoulder, not on top of it */
.icon-btn .badge {
  position: absolute; top: 1px; inset-inline-end: -2px; min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: var(--r-full); background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 600; line-height: 15px;
  text-align: center; font-variant-numeric: tabular-nums; border: 2px solid var(--bg); direction: ltr;
}
.wallet-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding-inline: 12px 14px;
  border-radius: var(--r-full); background: var(--money-tint); color: var(--money-ink);
  font-family: var(--f-display); font-weight: 600; font-variant-numeric: tabular-nums; text-decoration: none; white-space: nowrap;
}
.wallet-chip:hover { text-decoration: none; filter: brightness(.98); }
.wallet-chip .i { color: var(--money); }
.avatar {
  width: 36px; height: 36px; border-radius: var(--r-full); display: inline-grid; place-items: center;
  background: var(--grad-brand); color: #FFFFFF; font-family: var(--f-display); font-weight: 600; font-size: 14px;
}

/* menus built on <details> */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel {
  position: absolute; inset-inline-end: 0; top: calc(100% + 8px); min-width: 230px; z-index: 40;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-2);
  padding: 6px;
}
.menu-panel a, .menu-panel button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: var(--r-sm);
  color: var(--ink); background: none; border: 0; text-align: start; cursor: pointer; font-size: 14px;
}
.menu-panel a:hover, .menu-panel button:hover { background: var(--sunken); text-decoration: none; }
.menu-head { padding: 10px 10px 8px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-head b { display: block; font-family: var(--f-display); font-weight: 600; }
.menu-head span { font-size: 13px; color: var(--muted); }
/* the language switch (D33): a small text button with a globe in a header; in the account menu it is an item like the others */
.lang-switch { margin: 0; }
.lang-switch:not(.lang-switch-menu) { display: inline-flex; }
.lang-switch:not(.lang-switch-menu) button {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 10px; border-radius: var(--r-ctl);
  border: 1px solid transparent; background: transparent; color: var(--ink-2); font-size: 13.5px; font-weight: 600;
  white-space: nowrap; cursor: pointer;
}
.lang-switch:not(.lang-switch-menu) button:hover { background: var(--sunken); border-color: var(--line); }
.lang-switch:not(.lang-switch-menu) .i { color: var(--muted); }
/* column chooser on a list's header (D32): checkboxes in a .menu. It sits outside .table-wrap, whose overflow would clip the panel. */
.cols-menu[open] > summary { background: var(--sunken); }
.cols-menu .menu-panel { min-width: 200px; display: grid; gap: 2px; }
.cols-menu .check { align-items: center; padding: 8px 10px; border-radius: var(--r-sm); color: var(--ink); cursor: pointer; }
.cols-menu .check:hover { background: var(--sunken); }
.cols-menu .check input { margin-top: 0; cursor: pointer; }
@media (pointer: coarse) { .cols-menu .check { min-height: 44px; } }

/* bottom navigation (phones & tablets) */
.bnav {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 35; height: calc(var(--bnav-h) + env(safe-area-inset-bottom));
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: stretch;
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 1024px) { .bnav { display: none; } }
.bnav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: 11.5px; text-decoration: none;
}
.bnav a:hover { text-decoration: none; color: var(--ink-2); }
.bnav a:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); border-radius: var(--r-sm); }
.bnav a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.bnav a[aria-current="page"] .i { color: var(--accent); }
.bnav .bnav-new { position: relative; }
.bnav .bnav-new { color: var(--ink); font-weight: 600; }
.bnav .bnav-new span.plus {
  width: 54px; height: 54px; border-radius: 18px; background: var(--grad-brand); color: #FFFFFF; display: grid; place-items: center;
  margin-top: -22px; box-shadow: 0 0 0 4px var(--surface), 0 10px 22px rgba(8, 103, 201, .36);
}
.bnav .bnav-new .i { color: #FFFFFF; width: 24px; height: 24px; }
.bnav .bnav-new[aria-current="page"] .i { color: #FFFFFF; }

/* drawer (mobile full menu): slides in from the start side, where the menu button is */
.drawer {
  position: fixed; inset-block: 0; inset-inline-start: 0; inset-inline-end: auto; margin: 0;
  border: 0; padding: 0; width: min(320px, 88vw); height: 100%; max-height: none; max-width: none;
  background: var(--surface); color: var(--ink-2); overflow-y: auto; overscroll-behavior: contain;
}
.drawer[open] { animation: drawer-in .22s ease-out; }
@keyframes drawer-in { from { transform: translateX(100%); } to { transform: none; } }
[dir="ltr"] .drawer[open] { animation-name: drawer-in-ltr; }
@keyframes drawer-in-ltr { from { transform: translateX(-100%); } to { transform: none; } }
.drawer::backdrop { background: rgba(15, 20, 27, .45); }
.drawer-inner { padding: 16px 14px; display: flex; flex-direction: column; min-height: 100%; gap: 6px; }

/* ---------- page header ---------- */
.phead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin-bottom: 20px; }
.phead h1 { font-size: 22px; }
@media (min-width: 760px) { .phead h1 { font-size: 26px; } }
.phead .sub { color: var(--muted); margin: 4px 0 0; font-size: 14.5px; }
.phead-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.phead-actions.has-seg { min-width: 0; }   /* the period switch scrolls inside it instead of widening the page */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13.5px; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); }
.crumbs .i { width: 14px; height: 14px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px;
  border-radius: var(--r-ctl); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font-family: var(--f-display); font-weight: 600; font-size: 14.5px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease;
}
@media (prefers-reduced-motion: no-preference) { .btn:active { transform: translateY(1px); } }
.btn:hover { text-decoration: none; background: var(--sunken); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: var(--sh-accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-money { background: var(--money-solid); border-color: var(--money-solid); color: var(--on-money); }
.btn-money:hover { background: var(--money-hover); border-color: var(--money-hover); }
.btn-soft { background: var(--accent-tint); border-color: transparent; color: var(--accent-ink); }
.btn-soft:hover { background: color-mix(in srgb, var(--accent-tint) 80%, var(--accent) 20%); }
.btn-secondary { background: var(--surface); border-color: var(--line-strong); color: var(--accent-ink); }
.btn-secondary:hover { background: var(--surface); border-color: var(--accent); }
/* on the navy brand panels (hero, CTA band, wallet card) */
.btn-hero { background: #FFFFFF; border-color: #FFFFFF; color: #05275A; }
.btn-hero:hover { background: #E8F6FD; border-color: #E8F6FD; }
.btn-hero-ghost { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .3); color: #FFFFFF; }
.btn-hero-ghost:hover { background: rgba(255, 255, 255, .16); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--sunken); }
.btn-danger { background: var(--surface); border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); color: var(--danger-ink); }
.btn-danger:hover { background: var(--danger-tint); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: var(--r-xs); }
.btn-lg { height: 52px; padding: 0 24px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-icon { width: 44px; padding: 0; }
.btn-icon.btn-sm { width: 34px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn-row.center { justify-content: center; }
.btn[aria-busy="true"] { cursor: progress; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent-ink); font-weight: 600; cursor: pointer; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
/* phones and touch screens: small buttons get the full 44px touch target, text buttons 40px */
@media (max-width: 759px), (pointer: coarse) {
  .btn-sm { height: 44px; padding: 0 14px; }
  .btn-icon.btn-sm { width: 44px; height: 44px; }
  .link-btn { min-height: 40px; display: inline-flex; align-items: center; }
}

/* ---------- forms ---------- */
.form { display: grid; gap: 16px; }
.form-grid { display: grid; gap: 14px 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 760px) { .form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .form-grid .span-2 { grid-column: 1 / -1; } }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .label { font-weight: 600; font-size: 14px; color: var(--ink); }
.field .req { color: var(--accent); }
.field .help { font-size: 13px; color: var(--muted); }
.field .err, .errlist { font-size: 13px; color: var(--danger-ink); margin: 0; padding: 0; list-style: none; }
.input, .field input[type="text"], .field input[type="tel"], .field input[type="email"], .field input[type="password"],
.field input[type="number"], .field input[type="url"], .field input[type="search"], .field input[type="date"],
.field select, .field textarea, .select, .textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: var(--r-ctl); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font-size: 15px; line-height: 1.5;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea, .textarea { min-height: 96px; resize: vertical; }
.field select, .select { appearance: none; -webkit-appearance: none; padding-inline-end: 38px; cursor: pointer;
  background-image: var(--select-chev); background-repeat: no-repeat; background-size: 16px 16px; background-position: left 12px center; }
[dir="ltr"] .field select, [dir="ltr"] .select { background-position: right 12px center; }
input[type="file"].input, .field input[type="file"] { padding: 6px; min-height: 48px; cursor: pointer; color: var(--muted); font-size: 14px; }
input[type="file"]::file-selector-button {
  height: 34px; padding: 0 14px; margin-inline-end: 12px; border-radius: var(--r-xs); border: 1px solid var(--line-strong);
  background: var(--sunken); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer;
}
input[type="file"]:hover::file-selector-button { background: var(--surface-2); border-color: var(--ink-2); }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: var(--focus);
}
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.input-ltr, input[type="tel"], input[type="email"], input[type="url"], input[inputmode="numeric"], input[inputmode="decimal"] { direction: ltr; text-align: right; }
/* on a left-to-right page (English) those fields start at the left like every other */
[dir="ltr"] :is(.input-ltr, input[type="tel"], input[type="email"], input[type="url"], input[inputmode="numeric"], input[inputmode="decimal"]) { text-align: left; }
.input-group { display: flex; align-items: stretch; }
.input-group > input { border-start-end-radius: 0; border-end-end-radius: 0; min-width: 0; }
.input-group > .addon {
  display: inline-flex; align-items: center; padding: 0 12px; border: 1px solid var(--line-strong); border-inline-start: 0;
  border-start-end-radius: var(--r-sm); border-end-end-radius: var(--r-sm); background: var(--sunken); color: var(--muted); font-size: 14px; white-space: nowrap;
}
.pw-wrap { position: relative; }
.pw-wrap input { padding-inline-end: 44px; }
.pw-wrap button { position: absolute; inset-inline-end: 4px; top: 4px; width: 36px; height: 36px; border: 0; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; border-radius: var(--r-xs); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--accent); flex: none; }
input.pick { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); cursor: pointer; }
input.pick + label, td > label[for] { cursor: pointer; }
.fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.choice-grid.wide { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.choice-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice > span {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font-size: 14px; line-height: 1.45;
}
.choice > span:hover { border-color: var(--ink-2); }
/* the box / dot tells single-choice from multi-choice at a glance */
.choice > span::before {
  content: ""; flex: none; width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--line-strong);
  background: var(--surface) no-repeat center / 12px 12px;
}
.choice input[type="radio"] + span::before { border-radius: 50%; }
.choice input:checked + span { border-color: var(--accent); background: var(--accent-tint); color: var(--accent-ink); font-weight: 600; }
.choice input[type="checkbox"]:checked + span::before {
  border-color: var(--accent); background-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}
.choice input[type="radio"]:checked + span::before { border-color: var(--accent); box-shadow: inset 0 0 0 4px var(--surface); background-color: var(--accent); }
.choice input:focus-visible + span { box-shadow: var(--focus-ring); }
.otp { display: flex; gap: 8px; direction: ltr; justify-content: center; }
.otp input { width: 48px; height: 56px; min-width: 0; flex: 0 1 48px; text-align: center; font-size: 24px; font-family: var(--f-display); border-radius: var(--r-ctl); border: 1px solid var(--line-strong); background: var(--surface); }
.otp input:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.pw-meter { height: 4px; border-radius: 4px; background: var(--sunken); overflow: hidden; }
.pw-meter span { display: block; height: 100%; width: 0; background: var(--danger); transition: width .2s ease; }
.pw-meter[data-level="2"] span { width: 50%; background: var(--warn); }
.pw-meter[data-level="3"] span { width: 75%; background: var(--accent); }
.pw-meter[data-level="4"] span { width: 100%; background: var(--accent); }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--sh-1); }
@media (min-width: 760px) { .card { padding: 22px; } }
.card-flush { padding: 0; overflow: hidden; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-h h2, .card-h h3 { font-size: 16.5px; }
.section { margin-top: 28px; }
.section-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-h h2 { font-size: 18px; }
/* header links ("كل الطلبات", "نزّل الكل"): icon inline, and a 40px tall hit area without moving the layout */
.card-h > a, .section-h > a {
  display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; white-space: nowrap;
  padding: 9px 8px; margin: -9px -8px;
}
.card-col { display: flex; flex-direction: column; }
.card-col > .push-end { margin-top: auto; padding-top: 16px; }
.panel { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.stack { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.stack-sm { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wrap { flex-wrap: wrap; }
.break-any { overflow-wrap: anywhere; }   /* D59: a campaign or ad value typed in an address breaks inside its cell */
.grow { flex: 1; min-width: 0; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.grid-3 { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* «ربط متجرك»: a platform's own icon beside its name. The marks were drawn for a light ground, so they sit on white in both themes. */
.platform-name { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
/* D46: the partner's card takes the whole row, with the owner's line in the display face */
.grid-2 > .card[data-featured] { grid-column: 1 / -1; border-color: var(--gold-ink); background: linear-gradient(180deg, var(--gold-tint), var(--surface) 72%); }
.partner-line { margin: 12px 0 4px; font-family: var(--f-display); font-weight: 600; font-size: 18px; line-height: 1.5; color: var(--ink); }
.platform-logo { flex: none; box-sizing: border-box; width: 40px; height: 40px; padding: 5px; border-radius: 12px; border: 1px solid var(--line); background: #FFFFFF; object-fit: contain; }
.platform-logo.is-letter { display: grid; place-items: center; padding: 0; background: var(--accent-tint); color: var(--accent-ink); font-family: var(--f-display); font-weight: 600; font-size: 17px; line-height: 1; }
@media (min-width: 1100px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.split { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .split { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; } .split-wide { grid-template-columns: minmax(0, 1fr) 400px; } .sticky-col { position: sticky; top: calc(var(--top-h) + 12px); } }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; font-size: 14.5px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
/* Arabic data on an English page (typed_dir) sits next to its label: a short value («قطيفة») does not float to the far edge,
   a long one still fills the row and ends its lines on the right (3 Nov 2026) */
.dl dd[dir="rtl"] { justify-self: start; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 14.5px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; text-align: end; }
.kv.total { border-top: 1px solid var(--line-strong); border-bottom: 0; margin-top: 4px; padding-top: 12px; font-size: 16px; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }

/* ---------- callouts ---------- */
.callout { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--sunken); color: var(--ink-2); font-size: 14px; }
.callout .i { margin-top: 2px; }
.callout b { color: var(--ink); }
.callout p:last-child { margin-bottom: 0; }
.callout ul.errs { margin: 6px 0 0; padding-inline-start: 18px; }
.callout-info { background: var(--info-tint); color: var(--info-ink); }
.callout-warn { background: var(--warn-tint); color: var(--warn-ink); }
.callout-danger { background: var(--danger-tint); color: var(--danger-ink); }
.callout-money { background: var(--money-tint); color: var(--money-ink); }
.callout-rose { background: var(--accent-tint); color: var(--accent-ink); }
.callout-info b, .callout-warn b, .callout-danger b, .callout-money b, .callout-rose b { color: inherit; }

/* ---------- pills & chips ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--r-full); font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--sunken); color: var(--ink-2); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .85; }
.pill-info { background: var(--info-tint); color: var(--info-ink); }
.pill-warn { background: var(--warn-tint); color: var(--warn-ink); }
.pill-danger { background: var(--danger-tint); color: var(--danger-ink); }
.pill-money { background: var(--money-tint); color: var(--money-ink); }
.pill-brand { background: color-mix(in srgb, var(--navy) 10%, var(--surface)); color: var(--navy); }
.pill-gold { background: var(--gold-tint); color: var(--gold-ink); }
.pill-ship { background: var(--cyan-tint); color: var(--cyan-ink); }
.pill-muted { background: var(--sunken); color: var(--muted); }
/* fine, but no money in it (store connected, account approved, row valid): blue with a check, never green */
.pill-ok { background: var(--accent-tint); color: var(--accent-ink); }
.pill-ok .dot { width: 9px; height: 5px; border-radius: 0; background: none; border: solid currentColor; border-width: 0 0 2px 2px;
  transform: translateY(-1.5px) rotate(-45deg); opacity: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px 6px; }
.chip { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--r-full); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); font-size: 13px; text-decoration: none; white-space: nowrap; }
:is(a, button).chip { cursor: pointer; font-family: inherit; }
:is(a, button).chip:hover { text-decoration: none; border-color: var(--ink-2); }
/* invisible hit-area extension: 32px visual, 40px touch */
:is(a, button).chip::after { content: ""; position: absolute; inset: -4px 0; }
.chip[aria-current="true"], .chip.is-on { background: var(--accent-tint); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.chip.is-done { border-color: transparent; background: var(--accent-tint); color: var(--accent-ink); }
.chip .x { margin-inline-start: 2px; opacity: .7; }
.chips.gap-lg { gap: 8px; }
.badge-new { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--r-full); background: var(--cyan); color: #04203F; font-family: var(--f-display); font-size: 12px; font-weight: 700; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 12px; color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--accent-ink); border-bottom-color: var(--accent); }
.tabs .n { font-size: 12px; min-width: 22px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: var(--r-full); background: var(--sunken); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tabs a[aria-current="page"] .n { background: var(--accent-tint); color: var(--accent-ink); }

/* ---------- metrics ---------- */
.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-1); overflow: hidden; }
@media (min-width: 760px) { .metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); } .metrics.m-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .metrics.m-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.metric { padding: 14px 16px; border-inline-start: 1px solid var(--line); border-top: 1px solid var(--line); min-width: 0; }
.metric .lbl { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.metric .val { font-family: var(--f-display); font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.3; margin-top: 2px; color: var(--navy); }
.metric .val small { font-size: 14px; font-weight: 500; color: var(--muted); }
.metric .foot { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.metric.money .val { color: var(--money-ink); }
.metric a.val { color: inherit; text-decoration: none; display: block; }
.metrics > .metric:nth-child(-n+2) { border-top: 0; }
.metrics > .metric:nth-child(2n+1) { border-inline-start: 0; }
@media (min-width: 760px) {
  .metrics > .metric { border-top: 1px solid var(--line); border-inline-start: 1px solid var(--line); }
  .metrics > .metric:nth-child(-n+4) { border-top: 0; }
  .metrics > .metric:nth-child(4n+1) { border-inline-start: 0; }
  .metrics.m-3 > .metric:nth-child(-n+3) { border-top: 0; }
  .metrics.m-3 > .metric:nth-child(4n+1) { border-inline-start: 1px solid var(--line); }
  .metrics.m-3 > .metric:nth-child(3n+1) { border-inline-start: 0; }
  .metrics.m-5 > .metric:nth-child(-n+5) { border-top: 0; }
  .metrics.m-5 > .metric:nth-child(4n+1) { border-inline-start: 1px solid var(--line); }
  .metrics.m-5 > .metric:nth-child(5n+1) { border-inline-start: 0; }
}
.tip { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: var(--faint); cursor: help; position: relative; }
.tip .i { width: 15px; height: 15px; }
.tip:hover, .tip:focus { color: var(--ink-2); }
.tip[data-tip]:hover::after, .tip[data-tip]:focus::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); inset-inline-start: -10px; width: max-content; max-width: 260px;
  background: var(--ink); color: var(--surface); font-size: 12.5px; line-height: 1.6; font-weight: 400; padding: 8px 10px; border-radius: var(--r-sm); z-index: 50; white-space: normal; box-shadow: var(--sh-2);
  text-align: start;
}
/* phones: an anchored bubble can run off-screen, so the explanation shows as a bar above the bottom nav */
@media (max-width: 759px) {
  .tip[data-tip]:hover::after, .tip[data-tip]:focus::after {
    position: fixed; inset-inline: 16px; bottom: calc(var(--bnav-h) + env(safe-area-inset-bottom) + 12px); width: auto; max-width: none;
    font-size: 13.5px; padding: 12px 14px; border-radius: var(--r); box-shadow: var(--sh-3); z-index: 60;
  }
}

.progress { height: 8px; border-radius: var(--r-full); background: var(--sunken); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--gold); }
.progress.money > span { background: var(--money); }

/* ---------- money flow (wallet stages) ----------
   Phones: what you can withdraw first and big, the other four stages as a 2×2 grid.
   Desktop: the five stages in order, left to right in reading direction, with arrows. */
.flow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-1); }
.flow-step { position: relative; padding: 14px 16px; background: var(--surface); min-width: 0; }
/* The wallet card above the strip leads with the balance (design review M10), so no step is a second hero.
   On phones a fifth step gets the whole last row instead of leaving an empty cell. */
.wallet-top { margin-bottom: 16px; }
.flow-step:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (min-width: 900px) {
  .flow { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .flow-step { padding: 18px 20px; }
  .flow-step:last-child:nth-child(odd) { grid-column: auto; }
  .flow-step:not(:last-child)::after {
    content: ""; position: absolute; top: 50%; inset-inline-end: -7px; width: 12px; height: 12px; background: var(--surface);
    border-top: 1px solid var(--line-strong); border-inline-end: 1px solid var(--line-strong); transform: translateY(-50%) rotate(45deg); z-index: 1;
  }
  [dir="rtl"] .flow-step:not(:last-child)::after { transform: translateY(-50%) rotate(-135deg); }
}
.flow-step .lbl { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.flow-step .val { font-family: var(--f-display); font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 2px; line-height: 1.35; }
@media (min-width: 900px) { .flow-step .val { font-size: 22px; } }
.flow-step .hint { font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.6; }

/* ---------- product grid & card ---------- */
.pgrid { display: grid; gap: 16px 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) { .pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 16px; } }
@media (min-width: 1280px) { .pgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* «موديلات مشابهة» sits in a half-width card on a computer: its columns follow the card, not the window, so a product card
   never gets narrower than its profit row (3 columns from 640 px of card: 3 × 200 px cards and their gaps) */
.similar { container-type: inline-size; }
.similar .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@container (min-width: 640px) { .similar .pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* a narrow card (a 1024 px screen, a tablet) has phone-sized product cards: they drop the same extras a phone drops (like
   .rail), take the phone's row size, and an amount that leaves no room for its label goes under it instead of over it */
@container (max-width: 399px) {
  .similar .pgrid { column-gap: 12px; }
  .similar .pcard-body { padding: 10px; }
  .similar .pcard-acts .btn-primary { padding-inline: 6px; font-size: 13px; }
  .similar .prow { flex-wrap: wrap; padding: 4px 8px; font-size: 12px; }
  .similar .prow b { font-size: 14px; }
  .similar .prow .hide-sm { display: none; }
}
.pcard { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: visible; box-shadow: var(--sh-1); transition: border-color .15s ease, box-shadow .15s ease; }
.pcard:hover { border-color: var(--line-strong); box-shadow: var(--sh-2); }
.pcard:has(.pcard-title a:focus-visible) { border-color: var(--accent); box-shadow: var(--focus-ring); }
.pcard-title a:focus-visible { box-shadow: none; }
.pcard-media { position: relative; aspect-ratio: 4 / 5; background: var(--sunken); border-radius: calc(var(--r) - 1px) calc(var(--r) - 1px) 0 0; }
.pcard-media img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.pcard-media .ph { width: 100%; height: 100%; display: grid; place-items: center; color: var(--faint); }
.pcard-flags { position: absolute; top: 8px; inset-inline-start: 8px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; z-index: 2; pointer-events: none; }
.pcard .hang { pointer-events: none; }
.pcard-flags .pill { height: 24px; font-size: 12px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--surface) 70%, transparent); }
.pcard-fav { position: absolute; top: 6px; inset-inline-end: 6px; z-index: 3; }
.pcard-fav button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--ink-2); padding: 0; }
.pcard-fav button::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: color-mix(in srgb, var(--surface) 92%, transparent); box-shadow: var(--sh-1); z-index: -1; }
.pcard-fav button:hover { color: var(--accent-ink); }
.pcard-fav button[aria-pressed="true"] { color: var(--accent); }
.pcard-fav button[aria-pressed="true"] .i { fill: var(--accent); }
.pcard-fav button:focus-visible { border-radius: 50%; }
.pcard-body { padding: 24px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
@media (min-width: 760px) { .pcard-body { padding: 26px 14px 14px; } }
.pcard-title { font-size: 14.5px; font-weight: 600; color: var(--ink); line-height: 1.55; margin: 0; min-height: calc(2 * 1.55em); }
.pcard-title a { color: inherit; }
.pcard-title a:hover { text-decoration: none; }
.pcard-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: var(--r); }
.pcard-meta { font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 2px 10px; }
/* the two numbers a marketer prices against, as label / value rows (never squeezed into columns) */
.pcard-prices { display: grid; gap: 3px; margin: auto 0 0; padding-top: 9px; border-top: 1px dashed var(--line); font-size: 12.5px; }
.pcard-prices > div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.pcard-prices dt { color: var(--muted); }
.pcard-prices dd { margin: 0; color: var(--ink); font-family: var(--f-display); font-size: 14.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stockline { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.stockline .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.stockline.low .dot { background: var(--warn); }
.stockline.out .dot { background: var(--danger); }
.stockline.out { color: var(--danger-ink); }
.pcard.is-out .pcard-media img { filter: grayscale(.85); opacity: .7; }

/* coming-soon categories */
.soon-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) { .soon-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.soon { border: 1px dashed var(--line-strong); border-radius: var(--r); padding: 14px; color: var(--muted); font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.soon b { color: var(--ink-2); font-family: var(--f-display); font-weight: 600; }

/* filters bar (shared with the ops console) */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.filters .select, .filters .input { width: auto; min-width: 150px; min-height: 40px; height: 40px; padding-block: 0; }
.filters .grow { min-width: 200px; }
.filters .btn { height: 40px; }

/* follow-up task rows: «تمّت» and «تعديل» open a small form under the buttons (D32) */
.fu-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; }
.fu-pop > summary { list-style: none; cursor: pointer; }
.fu-pop > summary::-webkit-details-marker { display: none; }
.fu-pop[open] { flex-basis: 100%; }
.fu-form { margin-top: 8px; padding: 12px; gap: 10px; max-width: 340px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); }
.result-count { font-size: 14px; color: var(--muted); }

/* marketer filter bars: a tidy 2-column grid on phones, one row on wide screens */
.fbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-items: center; margin-bottom: 16px; }
.fbar > .f-full { grid-column: 1 / -1; }
.fbar .input, .fbar .select { width: 100%; min-width: 0; height: 42px; min-height: 42px; padding-block: 0; }
.fbar .btn { height: 42px; }
.fbar .f-pair { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13.5px; color: var(--muted); }
.fbar .f-pair > span { flex: none; }
.fbar .f-end { display: flex; gap: 8px; min-width: 0; }
.fbar .f-end > .f-check { flex: 1; }
@media (max-width: 759px) { .fbar .f-btn { width: 44px; padding: 0; flex: none; } }
.fbar .f-check {
  display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; min-width: 0; white-space: nowrap;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); font-size: 14px; color: var(--ink-2); cursor: pointer;
}
.fbar .f-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); flex: none; }
.fbar .f-check:has(input:checked) { border-color: var(--accent); background: var(--accent-tint); color: var(--accent-ink); font-weight: 600; }
.fbar .f-clear { justify-self: start; font-size: 14px; font-weight: 600; padding-block: 8px; }
/* very narrow phones: date pickers need a full row each, and the toggle label may wrap */
@media (max-width: 359px) {
  .fbar > .f-pair { grid-column: 1 / -1; }
  .fbar .f-check { white-space: normal; line-height: 1.2; font-size: 13.5px; }
}
@media (min-width: 1024px) {
  .fbar { display: flex; flex-wrap: wrap; }
  .fbar > * { flex: none; }
  .fbar > .f-grow { flex: 1 1 240px; }
  .fbar > .select, .fbar > .input:not(.f-grow) { width: auto; min-width: 150px; }
  .fbar .f-pair .input { width: auto; }
  .fbar > .f-submit { order: 10; }
  .fbar > .f-clear { order: 11; }
}

/* ---------- product page ---------- */
.pdp { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .pdp { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; } }
@media (min-width: 1200px) { .pdp { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 32px; } }
.gallery { display: grid; gap: 10px; align-self: start; align-content: start; min-width: 0; }
.gallery-main { aspect-ratio: 4 / 5; border-radius: var(--r-lg); overflow: hidden; background: var(--sunken); position: relative; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-main .ph { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; font-size: 14px; color: var(--accent-ink); background: linear-gradient(160deg, var(--accent-tint), var(--sunken)); }
.thumbs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 2px; }
.thumbs button { flex: none; width: 64px; height: 80px; border-radius: var(--r-sm); overflow: hidden; border: 2px solid transparent; padding: 0; background: var(--sunken); cursor: pointer; }
.thumbs button:hover { border-color: var(--line-strong); }
.thumbs button[aria-current="true"] { border-color: var(--accent); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 760px) { .gallery { position: sticky; top: calc(var(--top-h) + 12px); } }
.pdp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pdp-title { font-size: 22px; line-height: 1.45; }
@media (min-width: 760px) { .pdp-title { font-size: 26px; } }
.pdp-code { font-size: 13.5px; color: var(--muted); }
.pdp .chips .pill { white-space: normal; height: auto; min-height: 26px; padding-block: 3px; line-height: 1.5; }
.fav-btn { flex: none; margin-top: -2px; }
.fav-btn[aria-pressed="true"] { color: var(--accent); }
.fav-btn[aria-pressed="true"] .i { fill: var(--accent); }

/* the money box: set a price, watch the profit tag */
.moneybox { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--sh-1); overflow: hidden; container-type: inline-size; }
.moneybox-top { display: grid; gap: 16px; padding: 18px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
@container (min-width: 500px) { .moneybox-top { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 20px; } }
.moneybox-top > .htag { justify-self: start; }
.moneybox-price { display: grid; gap: 8px; min-width: 0; }
.moneybox-price > label { font-weight: 600; font-size: 15px; font-family: var(--f-display); }
.price-input { display: flex; align-items: stretch; gap: 8px; }
.price-input .step { width: 48px; height: 52px; flex: none; border-radius: var(--r); }
.price-field { position: relative; flex: 1 1 auto; min-width: 0; }
@container (min-width: 500px) { .price-field { max-width: 200px; } }
.price-field input {
  width: 100%; height: 52px; padding: 0 46px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--surface);
  font-family: var(--f-display); font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: center; direction: ltr;
}
.price-field input:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.price-field .unit { position: absolute; inset-block: 0; inset-inline-end: 14px; display: flex; align-items: center; color: var(--muted); font-size: 14px; pointer-events: none; }
.price-msg { font-size: 13px; min-height: 20px; color: var(--accent-ink); font-weight: 500; }
.price-msg.err { color: var(--danger-ink); }
.price-msg.warn { color: var(--warn-ink); }
.moneybox.is-invalid .price-field input { border-color: var(--danger); }
.moneybox.is-invalid .price-field input:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 25%, transparent); }
.moneybox .htag { transition: background-color .2s ease, color .2s ease; }
.moneybox.is-invalid .htag { --tag-bg: var(--sunken); --tag-ink: var(--muted); }

/* price ladder: base · min · suggested — the last two are tappable (no maximum since D39) */
.ladder { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.ladder > * { display: block; min-width: 0; padding: 12px 16px; background: var(--surface); text-align: start; border: 0; font: inherit; color: inherit; }
.ladder .k { font-size: 12.5px; color: var(--muted); display: flex; gap: 4px; align-items: center; }
.ladder .v { display: block; font-family: var(--f-display); font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ladder button { cursor: pointer; width: 100%; }
.ladder button .v { color: var(--accent-ink); text-decoration: underline dotted; text-decoration-thickness: 1.5px; text-underline-offset: 5px; }
.ladder button:hover { background: var(--accent-tint); }
.ladder button:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); border-radius: 0; }
.ladder button[aria-pressed="true"] { background: var(--accent-tint); }
.ladder button[aria-pressed="true"] .v { text-decoration: none; }

/* actions: stacked full-width in a narrow box, one row when the box has room */
.moneybox-actions { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--line); }
.moneybox-actions .btn, .moneybox-actions .inline-form { width: 100%; }
.moneybox-actions .stock-note { font-size: 13px; color: var(--muted); text-align: center; }
@container (min-width: 500px) {
  .moneybox-actions { display: flex; flex-wrap: wrap; }
  .moneybox-actions .btn, .moneybox-actions .inline-form { width: auto; }
  .moneybox-actions .stock-note { margin-inline-start: auto; text-align: start; }
}

.calc { border-top: 1px solid var(--line); }
.calc > summary { cursor: pointer; padding: 14px 18px; min-height: 52px; display: flex; align-items: center; gap: 10px; font-weight: 600; list-style: none; }
.calc > summary::-webkit-details-marker { display: none; }
.calc > summary:hover { background: var(--surface-2); }
.calc > summary:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); border-radius: 0; }
.calc > summary .i:last-child { margin-inline-start: auto; transition: transform .2s ease; }
.calc[open] > summary .i:last-child { transform: rotate(180deg); }
/* one column no wider than the box: the ad-cost table («جرّب أكثر من تكلفة للطلب») widened it, and the box's
   overflow: hidden then cut the figures and the third column (help-center pictures, 15 Nov 2026) */
.calc-body { padding: 0 18px 18px; display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.calc-inputs { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.calc-inputs label { font-size: 13.5px; }
.calc-out { display: grid; gap: 0; }
.cpa-ladder { margin-top: 12px; }
.cpa-ladder-h { font-size: 14px; font-weight: 600; margin: 0 0 6px; }
.cpa-ladder .table-wrap { margin-bottom: 6px; }
.cpa-ladder td { font-variant-numeric: tabular-nums; }
.cpa-ladder tr.is-current td { background: var(--accent-tint); font-weight: 600; }
/* its three columns fit a 360 px phone: the headings wrap, each amount stays whole */
.cpa-ladder .table th { white-space: normal; padding-inline: 8px; }
.cpa-ladder .table td { white-space: nowrap; padding-inline: 8px; }

.stockgrid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.stockgrid th, .stockgrid td { padding: 10px 8px; text-align: center; border-bottom: 1px solid var(--line); }
.stockgrid thead th { font-size: 12.5px; color: var(--muted); font-weight: 600; background: var(--surface-2); }
.stockgrid tbody th { text-align: start; font-weight: 600; white-space: nowrap; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .15); vertical-align: -2px; margin-inline-end: 6px; }
.cell-stock { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; min-width: 58px; }
.cell-stock .n { font-weight: 700; font-variant-numeric: tabular-nums; }
.cell-stock.ok .n { color: var(--ink); }
.cell-stock.low .n { color: var(--warn-ink); }
.cell-stock.out .n { color: var(--danger-ink); }
.cell-stock small { font-size: 11.5px; color: var(--muted); }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.copybox { position: relative; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; white-space: pre-line; font-size: 14.5px; line-height: 1.8; color: var(--ink-2); }
.copybox .copy-btn { position: absolute; top: 10px; inset-inline-end: 10px; }
.btn.is-copied { border-color: var(--accent); color: var(--accent-ink); }
.hooks { display: grid; gap: 8px; }
.hook { display: flex; align-items: center; gap: 10px; padding: 6px; padding-inline-start: 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.hook p { margin: 0; flex: 1; padding-block: 4px; }

/* ---------- lists & tables ---------- */
.table-wrap { position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); box-shadow: var(--sh-1); }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: start; font-weight: 600; font-size: 12.5px; color: var(--muted); background: var(--surface-2); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table .end { text-align: end; }
.table a.rowlink { color: var(--ink); font-weight: 600; }
.table-dense td { padding: 9px 12px; }
.table tfoot td { background: var(--surface-2); font-weight: 700; border-top: 1px solid var(--line-strong); }

/* order rows: stacked cards on phones (3 lines × 2 sides), a 6-column table on desktop */
.olist { display: grid; gap: 10px; }
.orow {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "id status" "cust amt" "place profit";
  gap: 4px 12px; align-items: center; padding: 13px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  color: var(--ink); text-decoration: none; position: relative; transition: background-color .12s ease, border-color .12s ease;
}
.orow:hover { text-decoration: none; border-color: var(--line-strong); }
.orow > * { min-width: 0; }
.orow .o-calls { grid-column: 1 / -1; overflow-wrap: anywhere; }
.orow .o-id { grid-area: id; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.orow .o-num { font-family: var(--f-display); font-weight: 600; font-size: 15px; }
.orow .o-time { font-size: 12.5px; color: var(--muted); }
.orow .o-cust { grid-area: cust; color: var(--ink-2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.orow .o-place { grid-area: place; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.orow .o-src { margin-inline-start: 6px; }
.orow .o-status { grid-area: status; justify-self: end; }
.orow .o-amt { grid-area: amt; justify-self: end; font-family: var(--f-display); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.orow .o-profit { grid-area: profit; justify-self: end; font-size: 13px; color: var(--money-ink); font-weight: 600; white-space: nowrap; }
.orow .o-profit.is-expected { color: var(--muted); font-weight: 500; }
.orow .o-profit.void { color: var(--muted); text-decoration: line-through; font-weight: 500; }
.olist-head { display: none; }
@media (min-width: 600px) and (max-width: 899px) { .olist { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) {
  .olist { gap: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; box-shadow: var(--sh-1); }
  .olist-head, .orow { grid-template-columns: 128px minmax(0, 1.2fr) minmax(0, 1.3fr) 150px 116px 120px; grid-template-areas: "id cust place status amt profit"; gap: 14px; }
  .olist-head { display: grid; padding: 10px 16px; font-size: 12.5px; color: var(--muted); font-weight: 600; background: var(--surface-2); border-bottom: 1px solid var(--line); }
  .olist-head > :nth-child(n+5) { text-align: end; }
  .orow { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 12px 16px; }
  .orow:last-child { border-bottom: 0; }
  .orow:hover { background: var(--surface-2); }
  .orow:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); border-radius: 0; }
  .orow .o-id { flex-direction: column; gap: 0; }
  .orow .o-status { justify-self: start; }
  .orow .o-cust { font-size: 14.5px; color: var(--ink); }
  .orow .o-place { font-size: 13.5px; }
}

/* responsive tables: real tables on wide screens, one block per row on phones.
   Cells marked .c-end sit on the end side (amounts, status); data-label prints a caption. */
@media (max-width: 759px) {
  .rtable thead { display: none; }
  .rtable, .rtable tbody, .rtable tfoot { display: block; width: 100%; }
  .rtable tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-auto-flow: row dense; gap: 3px 14px; align-items: baseline; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .rtable tbody tr:last-child { border-bottom: 0; }
  .rtable td { display: block; grid-column: 1; padding: 0; border: 0; min-width: 0; text-align: start; }
  .rtable td.c-end { grid-column: 2; text-align: end; }
  .rtable td.c-full { grid-column: 1 / -1; }
  .rtable td.c-hide-sm { display: none; }
  .rtable td.c-muted { color: var(--muted); font-size: 13px; }
  .rtable td.c-lead { order: -1; font-weight: 600; color: var(--ink); }
  .rtable td.c-lead .small { font-weight: 400; }
  .rtable tr.is-bad { background: color-mix(in srgb, var(--danger-tint) 55%, transparent); }
  .rtable tr.is-bad td { background: none; }
  .rtable td.c-last { order: 1; }
  .rtable td[data-label]::before { content: attr(data-label) " "; color: var(--muted); font-size: 12.5px; font-weight: 400; }
  .rtable tr.is-total { background: var(--surface-2); }
  .table.rtable tbody tr:hover { background: none; }
  /* store page: pick products and set the store price */
  .t-push tr { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "chk name profit" "chk price price"; align-items: center; }
  .t-push td:nth-child(1) { grid-area: chk; align-self: start; padding-top: 2px; }
  .t-push td:nth-child(2) { grid-area: name; }
  .t-push td:nth-child(3) { grid-area: price; }
  .t-push td:nth-child(4) { grid-area: profit; text-align: end; }
  .t-push .input-group { max-width: none; }
}
.table tr.is-total td { background: var(--surface-2); font-weight: 600; }

/* ---------- timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding-inline-start: 26px; padding-bottom: 16px; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: 6px; top: 8px; bottom: -8px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .tl-dot { position: absolute; inset-inline-start: 0; top: 5px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--line-strong); }
.timeline .tone-money .tl-dot { border-color: var(--money); }
.timeline .tone-brand .tl-dot { border-color: var(--accent); }
.timeline .tone-info .tl-dot { border-color: var(--info); }
.timeline .tone-warn .tl-dot { border-color: var(--warn); }
.timeline .tone-danger .tl-dot { border-color: var(--danger); }
.timeline .tl-title { font-weight: 600; font-size: 14.5px; }
.timeline .tl-meta { font-size: 12.5px; color: var(--muted); }
.timeline .tl-body { font-size: 13.5px; color: var(--ink-2); }

/* status track on order page */
.track { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin: 4px 0 6px; }
.track span { height: 6px; border-radius: var(--r-full); background: var(--line); }   /* --sunken all but vanished on dark cards */
.track span.on { background: var(--accent); }
.track.done span.on { background: var(--money); }
.track.stopped span.on { background: var(--danger); }
.track-labels { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; font-size: 11.5px; color: var(--muted); }
.track-labels span { min-width: 0; overflow-wrap: anywhere; hyphens: auto; }   /* a longer word in another language wraps in its slot, never runs into the next */

/* ---------- empty states ---------- */
.empty { text-align: center; padding: 40px 20px; display: grid; justify-items: center; gap: 8px; }
.empty .ic { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-tint); color: var(--accent); margin-bottom: 6px; }
.empty .ic .i { width: 26px; height: 26px; }
.empty h3 { font-size: 17px; }
.empty h1 { font-size: 24px; }
.empty p { color: var(--muted); max-width: 46ch; margin: 0 auto 8px; }
.empty-sm { padding: 20px 0; }
.empty-flush { padding-inline: 0; }
.empty-start { padding-inline: 0; text-align: start; justify-items: start; }
.empty-start p { margin-inline: 0; }
.ic.ic-money { background: var(--money-tint); color: var(--money); }
.ic.ic-info { background: var(--info-tint); color: var(--info); }
.ic.ic-danger { background: var(--danger-tint); color: var(--danger); }
.ic.ic-muted { background: var(--sunken); color: var(--muted); }

/* misc components that used to be inline styles */
a.card-link { display: block; color: inherit; text-decoration: none; transition: border-color .15s ease, box-shadow .15s ease; }
a.card-link:hover { text-decoration: none; border-color: var(--line-strong); }
.cta-card { padding: 40px 20px; text-align: center; display: grid; justify-items: center; gap: 4px; }
.cta-card h2 { font-size: 26px; }
.cta-card .lead { margin: 4px 0 14px; }
.attn.attn-pad { padding-inline: 18px; }
.msg { max-width: 100%; }
.msg-staff { background: var(--accent-tint); border-color: color-mix(in srgb, var(--accent) 25%, var(--line)); }
.msg-staff .msg-who { color: var(--accent-ink); }
progress.progress { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 8px; border: 0; border-radius: var(--r-full); background: var(--sunken); color: var(--gold); overflow: hidden; }
progress.progress::-webkit-progress-bar { background: var(--sunken); border-radius: var(--r-full); }
progress.progress::-webkit-progress-value { background: var(--gold); border-radius: var(--r-full); }
progress.progress::-moz-progress-bar { background: var(--gold); border-radius: var(--r-full); }
/* the catalog moving to a marketer's store: the site's blue, a little taller, and it glides as the figure grows */
progress.progress.accent { height: 10px; color: var(--accent); }
progress.progress.accent::-webkit-progress-value { background: var(--accent); transition: width .6s ease; }
progress.progress.accent::-moz-progress-bar { background: var(--accent); }
.goal-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 12.5px; color: var(--muted); }

/* ---------- flash messages ---------- */
.flashes { position: fixed; z-index: 60; top: 12px; inset-inline: 12px; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
@media (min-width: 760px) { .flashes { inset-inline-start: auto; inset-inline-end: 24px; top: 18px; justify-items: end; width: 420px; } }
.flash { pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 12px 14px; border-radius: var(--r); background: var(--navy); color: var(--surface); box-shadow: var(--sh-3); font-size: 14px; animation: flash-in .25s ease-out; }
.flash .i { margin-top: 1px; }
.flash.success .i { color: #8EE6C6; }
.flash.error { background: var(--danger); color: #fff; }
.flash.warning .i { color: var(--gold); }
.flash button { margin-inline-start: auto; background: none; border: 0; color: inherit; opacity: .75; cursor: pointer; padding: 0; }
.flash.is-leaving { opacity: 0; transform: translateY(-6px); transition: opacity .2s ease, transform .2s ease; }
@keyframes flash-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- dialogs ---------- */
dialog.modal { border: 0; padding: 0; border-radius: var(--r-lg); width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); background: var(--surface); color: var(--ink); box-shadow: var(--sh-3); }
dialog.modal::backdrop { background: rgba(23, 16, 32, .5); backdrop-filter: blur(2px); }
.modal-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-h h2 { font-size: 17px; }
.modal-b { padding: 18px; overflow-y: auto; max-height: calc(100vh - 190px); }
.modal-f { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 18px; border-top: 1px solid var(--line); background: var(--surface-2); }
@media (max-width: 759px) {
  dialog.modal.sheet { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: var(--r-lg) var(--r-lg) 0 0; }
  dialog.modal.sheet .modal-f { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  dialog.modal.sheet .modal-f > .btn { flex: 1; }
}
dialog.modal[open] { animation: modal-in .2s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- pagination ---------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 18px; font-size: 14px; }
.pager a, .pager span { min-width: 40px; height: 40px; padding: 0 10px; display: inline-grid; place-items: center; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; }
.pager a:hover { border-color: var(--ink-2); text-decoration: none; }
.pager .cur { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.pager .gap { border: 0; background: none; }

/* ---------- steps (onboarding, guides) ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: s; }
.steps li { position: relative; padding-inline-start: 44px; counter-increment: s; }
.steps li::before { content: counter(s); position: absolute; inset-inline-start: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-tint); color: var(--accent-ink); font-family: var(--f-display); font-weight: 600; display: grid; place-items: center; font-size: 14px; }
.steps li.done::before { content: "✓"; background: var(--accent); color: var(--on-accent); }
.steps b { display: block; }
.steps p { margin: 0; color: var(--muted); font-size: 14px; }
/* landing: the five steps as one horizontal journey on wide screens */
.steps-row { max-width: 760px; }
@media (min-width: 900px) {
  .steps-row { max-width: none; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px; }
  .steps-row li { padding-inline-start: 0; padding-top: 46px; }
  .steps-row li::before { width: 34px; height: 34px; font-size: 15px; }
  .steps-row li:not(:last-child)::after { content: ""; position: absolute; top: 17px; inset-inline-start: 46px; inset-inline-end: -12px; height: 1px; background: var(--line-strong); }
  .steps-row li:last-child::before { background: var(--money-tint); color: var(--money-ink); }
}

/* goal (activation) */
.goal { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); align-items: center; }
@media (min-width: 760px) { .goal { grid-template-columns: minmax(0, 1fr) 260px; } }
.goal h3 { font-size: 16.5px; display: flex; align-items: center; gap: 8px; }
.goal .count { font-family: var(--f-display); font-weight: 600; font-size: 15px; }

/* dashboard attention list */
.attn { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.attn li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.attn li:last-child { border-bottom: 0; }
.attn .ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--sunken); color: var(--ink-2); }
.attn .ic.warn { background: var(--warn-tint); color: var(--warn-ink); }
.attn .ic.danger { background: var(--danger-tint); color: var(--danger-ink); }
.attn .ic.money { background: var(--money-tint); color: var(--money-ink); }
.attn .ic.info { background: var(--info-tint); color: var(--info-ink); }
.attn .t { font-weight: 600; font-size: 14.5px; }
.attn .d { font-size: 13px; color: var(--muted); }
.attn .go { margin-inline-start: auto; }

/* rails (horizontal product strips) */
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(164px, 46%); gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 2px 18px; scrollbar-width: thin; }
.rail > * { scroll-snap-align: start; }
@media (min-width: 760px) { .rail { grid-auto-columns: minmax(200px, 23%); } }

/* ---------- auth & public ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); background: var(--bg); }
@media (min-width: 1000px) { .auth { grid-template-columns: minmax(0, 1fr) minmax(420px, 46%); } }
.auth-main { display: flex; flex-direction: column; padding: 20px 16px 40px; }
@media (min-width: 760px) { .auth-main { padding: 28px 48px 48px; } }
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 28px; }
.auth-top-end { display: flex; align-items: center; gap: 12px; }

/* text links that stand alone ("ادخل", "نسيت كلمة السر؟") get a taller hit area */
.auth-top a:not(.brand), .field .row-between > a { display: inline-block; padding: 10px 4px; margin: -10px -4px; }
.auth-top .link-btn { padding-inline: 8px; margin-inline: -8px; }
.auth-box { width: 100%; max-width: 440px; margin: 0 auto; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.auth-box h1 { font-size: 26px; margin-bottom: 6px; }
.auth-box .sub { color: var(--muted); margin-bottom: 22px; }
.auth-art {
  display: none; position: relative; overflow: hidden; color: var(--on-hero);
  background: radial-gradient(70% 55% at 80% 15%, rgba(18, 199, 232, .18), transparent 60%),
              linear-gradient(180deg, var(--hero-top) 0%, var(--hero-mid) 62%, var(--hero-floor) 100%);
}
@media (min-width: 1000px) { .auth-art { display: flex; flex-direction: column; justify-content: center; gap: 26px; padding: 48px clamp(40px, 5vw, 72px) 0; } }
.auth-lockup { width: 132px; height: auto; position: relative; }
.auth-copy { position: relative; }
.auth-art h2 { color: #FFFFFF; font-size: 30px; font-weight: 700; line-height: 1.4; max-width: 18ch; }
.auth-art p { color: var(--on-hero-muted); max-width: 40ch; margin: 10px 0 0; }
.auth-demo { position: relative; display: grid; gap: 6px; max-width: 320px; padding: 14px; border-radius: var(--r); background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); }
.auth-demo .ad-cap { font-size: 12px; color: var(--on-hero-muted); }
.auth-demo .prow { background: rgba(255, 255, 255, .1); color: #E3EEFB; font-size: 13px; }
.auth-demo .prow b { color: #FFFFFF; }
.auth-demo .prow.is-profit { background: rgba(79, 209, 155, .2); color: #C9F5E2; }
.auth-demo .prow.is-profit b { color: #FFFFFF; }
.auth-render { width: min(440px, 100%); height: auto; margin-top: auto; align-self: center; position: relative;
  -webkit-mask-image: radial-gradient(closest-side, #000 64%, transparent 100%); mask-image: radial-gradient(closest-side, #000 64%, transparent 100%); }
.auth-art .ribbon { width: 320px; inset-inline-start: -80px; top: 40%; opacity: .1; }
.auth-foot { font-size: 13px; color: var(--muted); text-align: center; margin-top: 28px; }
.auth-foot a { color: var(--muted); }
.err-page { min-height: 100vh; padding: 24px 16px; }
.err-mark { width: 96px; height: auto; margin: 0 auto 8px; }
.stepper-mini { display: flex; gap: 6px; margin-bottom: 18px; }
.stepper-mini span { height: 4px; flex: 1; border-radius: 4px; background: var(--line); }
.stepper-mini span.on { background: var(--accent); }

/* landing */
.pub-head { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.pub-head .in { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 16px; padding: 10px 16px; }
.pub-head nav { margin-inline-start: auto; display: flex; align-items: center; gap: 4px; }
.pub-head nav a.plain { color: var(--ink-2); padding: 8px 10px; font-size: 14.5px; display: none; }
@media (min-width: 760px) { .pub-head nav a.plain { display: inline-block; } }
.pub-actions { display: contents; }
/* phones: the account buttons stay together beside the logo and the language switch (last in the nav) takes a row of its
   own at the end when they do not fit on one line, so the header never scrolls sideways (D33) */
@media (max-width: 559px) {
  .pub-head .in { gap: 8px; }
  .pub-head nav { flex-wrap: wrap; justify-content: flex-end; gap: 2px; }
  .pub-actions { display: flex; gap: 2px; }
  .pub-head nav .btn-sm { padding-inline: 10px; }
}
.wrap-pub { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
/* landing (D28): a navy hero that melts into the 3D render, then light sections that answer, in order,
   who it is for, who does what, how an order travels, the sum, what you sell, what you can follow, shipping */
.pub main { overflow-x: clip; }
.hero-band {
  position: relative; overflow: hidden; color: var(--on-hero);
  background: radial-gradient(55% 70% at 12% 30%, rgba(18, 199, 232, .16), transparent 62%),
              linear-gradient(180deg, var(--hero-top) 0%, var(--hero-mid) 64%, var(--hero-floor) 100%);
}
.hero-in { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; align-items: center; padding-top: 36px; }
@media (min-width: 1000px) { .hero-in { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); padding-top: 64px; } }
.hero-copy { padding-bottom: 24px; }
.badge-soon {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid rgba(58, 214, 242, .55); color: #BFF3FD;
  background: rgba(18, 199, 232, .10); border-radius: var(--r-full); padding: 4px 14px; font-size: 13px; font-weight: 600; font-family: var(--f-display);
}
.badge-soon::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--on-hero-accent); box-shadow: 0 0 0 4px rgba(58, 214, 242, .22); }
.hero-band h1 { color: #FFFFFF; font-weight: 700; font-size: clamp(36px, 6vw, 62px); line-height: 1.18; margin-top: 16px; max-width: none; }
.hero-band h1 span { display: block; color: var(--on-hero-accent); }
.hero-lead { color: var(--on-hero-muted); font-size: clamp(15.5px, 1.7vw, 18px); max-width: 46ch; margin: 16px 0 0; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.pillars { list-style: none; margin: 26px 0 0; padding: 18px 0 0; display: flex; flex-wrap: wrap; gap: 10px 22px; border-top: 1px solid rgba(255, 255, 255, .14); }
.pillars li { display: inline-flex; align-items: center; gap: 8px; font-family: var(--f-display); font-weight: 600; font-size: 15px; color: #FFFFFF; }
.pillars .i { color: var(--on-hero-accent); }
.hero-note { margin: 16px 0 0; font-size: 13.5px; color: var(--on-hero-muted); max-width: 52ch; }
.hero-art { align-self: end; }
/* stacked hero: the render's top fades into the navy, so pull it up to the text instead of leaving an empty band */
@media (max-width: 999px) { .hero-art { margin-top: -56px; } }
.hero-art img { width: 100%; max-width: 580px; height: auto; margin-inline: auto;
  -webkit-mask-image: radial-gradient(closest-side, #000 64%, transparent 100%); mask-image: radial-gradient(closest-side, #000 64%, transparent 100%); }
.hero-band > .ribbon { inset-inline-end: -60px; top: -30px; width: 360px; opacity: .05; }
@media (prefers-reduced-motion: no-preference) {
  .hero-art img { animation: hero-rise .9s cubic-bezier(.2, .7, .2, 1) both; }
  .hero-copy > * { animation: hero-up .7s cubic-bezier(.2, .7, .2, 1) both; }
  .hero-copy > :nth-child(2) { animation-delay: .06s; } .hero-copy > :nth-child(3) { animation-delay: .12s; }
  .hero-copy > :nth-child(4) { animation-delay: .18s; } .hero-copy > :nth-child(5) { animation-delay: .24s; }
}
@keyframes hero-rise { from { transform: translateY(18px) scale(.98); } to { transform: none; } }
@keyframes hero-up { from { transform: translateY(10px); } to { transform: none; } }

.pub-section { padding-block: 48px 8px; }
@media (min-width: 1000px) { .pub-section { padding-block: 72px 8px; } }
.s-h { display: grid; gap: 8px; justify-items: center; text-align: center; margin-bottom: 26px; }
.s-h h2 { font-size: clamp(24px, 3.2vw, 34px); font-weight: 700; }
.s-h h2 em { font-style: normal; color: var(--accent); }
.s-h p { color: var(--muted); max-width: 58ch; margin: 0; }
.s-note { margin: 14px 0 0; text-align: center; font-size: 13.5px; color: var(--muted); }

.aud { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .aud { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.aud-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--sh-1);
  display: grid; gap: 10px; align-content: start; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.aud-card:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); box-shadow: var(--sh-2); }
@media (prefers-reduced-motion: no-preference) { .aud-card:hover { transform: translateY(-3px); } }
/* the 3D icons were drawn on white, so they sit on a light well in both themes */
.aud-ico { width: 84px; height: 84px; border-radius: 22px; display: grid; place-items: center; background: linear-gradient(160deg, #F2F8FF, #FFFFFF); border: 1px solid #E3EDF7; }
.aud-ico img { width: 64px; height: auto; }
.aud-card h3 { font-size: 19px; }
.aud-card p { color: var(--muted); font-size: 14.5px; margin: 0; }

.roles { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .roles { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); } }
.role { position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 24px; display: grid; gap: 14px; align-content: start; }
.role h3 { font-size: 20px; display: flex; align-items: center; gap: 10px; }
.role-tag { font-size: 12.5px; font-weight: 600; font-family: var(--f-display); border-radius: var(--r-full); padding: 2px 10px; }
.role ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; position: relative; z-index: 1; }
.role li { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.role li .i { margin-top: 3px; }
.role-you { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1); }
.role-you .role-tag { background: var(--accent-tint); color: var(--accent-ink); }
.role-you li .i { color: var(--accent); }
.role-us { background: var(--grad-brand); color: #FFFFFF; }
.role-us h3 { color: #FFFFFF; }
.role-us .role-tag { background: rgba(255, 255, 255, .16); color: #FFFFFF; }
.role-us li .i { color: #BFF3FD; }
@media (min-width: 500px) { .role-us ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.role-us .ribbon { inset-inline-start: -40px; bottom: -50px; width: 260px; }

.journey { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); counter-reset: step; position: relative; }
.journey li { position: relative; display: grid; gap: 6px; justify-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--sh-1); counter-increment: step; }
.journey li::before {
  content: counter(step); width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; position: relative; z-index: 1;
  font-family: var(--f-display); font-weight: 700; font-size: 20px; color: #FFFFFF; background: var(--grad-brand); box-shadow: 0 8px 20px rgba(8, 103, 201, .28);
}
.journey li:last-child::before { background: linear-gradient(135deg, #087A50, #12B886); box-shadow: 0 8px 20px rgba(8, 122, 80, .28); }
.journey b { font-family: var(--f-display); font-size: 16.5px; color: var(--navy); }
.journey p { color: var(--muted); font-size: 14px; margin: 0; }
@media (min-width: 1000px) {
  .journey { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .journey::before { content: ""; position: absolute; top: 25px; inset-inline: 10%; height: 3px; border-radius: 3px; background: linear-gradient(270deg, #0A4A8C, #0867C9, #12C7E8); opacity: .45; }
  .journey li { justify-items: center; text-align: center; background: none; border: 0; box-shadow: none; padding: 0 8px; }
}

.pgrid-pub { margin-bottom: 18px; }
.cats-pub { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .cats-pub { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cat-pub { display: grid; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.cat-pub b { font-family: var(--f-display); color: var(--navy); }
.cat-pub.is-soon { background: var(--surface-2); border-style: dashed; }

.track-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }   /* not .track: that is the order stage bar */
@media (min-width: 760px) { .track-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.track-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; display: grid; gap: 10px; align-content: start; box-shadow: var(--sh-1); }
.track-ico { width: 44px; height: 44px; border-radius: 14px; background: var(--accent-tint); color: var(--accent); display: grid; place-items: center; }
.track-card h3 { font-size: 17px; }
.track-card p { color: var(--muted); font-size: 14px; margin: 0; }
.stages-pub { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.stages-pub li { font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: var(--r-full); background: var(--sunken); color: var(--ink-2); }
.stages-pub li.is-av { background: var(--money-tint); color: var(--money-ink); }

.cta-band { position: relative; overflow: hidden; display: grid; gap: 12px; justify-items: start; border-radius: var(--r-xl); background: var(--grad-brand); color: #FFFFFF; padding: 32px 24px; }
@media (min-width: 760px) { .cta-band { padding: 44px 40px; } }
.cta-band h2 { color: #FFFFFF; font-size: clamp(22px, 3vw, 30px); font-weight: 700; position: relative; z-index: 1; }
.cta-band p { color: #DDEBFB; max-width: 52ch; margin: 0; position: relative; z-index: 1; }
.cta-band .hero-cta { margin-top: 8px; position: relative; z-index: 1; }
.cta-band .ribbon { inset-inline-end: -60px; bottom: -70px; width: 360px; opacity: .3; }
.math { display: grid; gap: 0; grid-template-columns: minmax(0, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
@media (min-width: 760px) { .math { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.math > div { position: relative; padding: 22px 24px; border-top: 1px solid var(--line); }
.math > div:first-child { border-top: 0; border-start-start-radius: inherit; border-start-end-radius: inherit; }
.math > div:last-child { border-end-start-radius: inherit; border-end-end-radius: inherit; }
@media (min-width: 760px) {
  .math > div { border-top: 0; border-inline-start: 1px solid var(--line); }
  .math > div:first-child { border-inline-start: 0; border-radius: 0; border-start-start-radius: inherit; border-end-start-radius: inherit; }
  .math > div:last-child { border-radius: 0; border-start-end-radius: inherit; border-end-end-radius: inherit; }
}
/* the operator sits on the seam between two numbers: 969 − 625 = 344 */
.math > [data-op]::before {
  content: attr(data-op); position: absolute; z-index: 1; top: -15px; inset-inline-start: 20px; width: 30px; height: 30px;
  display: grid; place-items: center; border-radius: 50%; background: var(--surface); border: 1px solid var(--line-strong);
  font-family: var(--f-display); font-weight: 600; font-size: 16px; line-height: 1; color: var(--ink-2);
}
@media (min-width: 760px) { .math > [data-op]::before { top: 50%; inset-inline-start: -15px; transform: translateY(-50%); } }
.math .k { color: var(--muted); font-size: 14px; }
.math .v { font-family: var(--f-display); font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; }
.math .is-profit { background: var(--money-tint); }
.math .is-profit .v, .math .is-profit .k { color: var(--money-ink); }
.math .is-profit::before { color: var(--money-ink); }
.pub-foot { background: linear-gradient(180deg, #04224D, #021530); color: #B9CCEA; padding: 40px 0 24px; margin-top: 56px; font-size: 14px; }
.pub-foot a { color: #E3EEFB; }
.pub-foot a:hover { color: var(--on-hero-accent); }
.pub-foot p { margin: 12px 0 0; max-width: 38ch; }
.foot-brand img { width: 128px; height: auto; }
.foot-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 28px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: 12.5px; }
.foot-tagline { font-family: var(--f-display); letter-spacing: .14em; direction: ltr; unicode-bidi: isolate; color: #7FA3D6; }
.pub-foot .cols { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .pub-foot .cols { grid-template-columns: 2fr 1fr 1fr; } }
.pub-foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }

/* policies */
.zones { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .zones { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.zone { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; background: var(--surface); }
.zone-h { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 6px; }
.zone-h b { font-family: var(--f-display); font-size: 16px; }
.zone-h .fee { font-family: var(--f-display); font-size: 18px; font-weight: 600; }
.zone p { margin: 0; color: var(--muted); font-size: 14px; }
.status-dict { display: grid; gap: 0; }
.status-dict > div { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: start; }
.status-dict p { margin: 0; color: var(--ink-2); font-size: 14.5px; }
.status-dict .pill { justify-self: start; }   /* one column on phones: a pill keeps its own width */
@media (max-width: 560px) { .status-dict > div { grid-template-columns: minmax(0, 1fr); gap: 6px; } }

/* ---------- order page ---------- */
.order-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.money-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); }
@media (min-width: 760px) { .money-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.money-tiles > div { padding: 12px 14px; border-inline-start: 1px solid var(--line); border-top: 1px solid var(--line); }
.money-tiles > div:nth-child(-n+2) { border-top: 0; }
.money-tiles > div:nth-child(2n+1) { border-inline-start: 0; }
@media (min-width: 760px) { .money-tiles > div { border-top: 0; border-inline-start: 1px solid var(--line); } .money-tiles > div:first-child { border-inline-start: 0; } .money-tiles > div:nth-child(3) { border-inline-start: 1px solid var(--line); } }
.money-tiles .k { font-size: 12.5px; color: var(--muted); }
.money-tiles .v { font-family: var(--f-display); font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; }
.money-tiles .is-profit { background: var(--money-tint); }
.money-tiles .is-profit .v { color: var(--money-ink); }
.money-tiles .is-void .v { color: var(--faint); text-decoration: line-through; }
.items { display: grid; gap: 0; }
.item { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item img, .item .ph { width: 56px; height: 70px; border-radius: var(--r-sm); object-fit: cover; background: var(--sunken); }
.item .nm { font-weight: 600; font-size: 14.5px; }
.item .vr { font-size: 13px; color: var(--muted); }
.item .pr { text-align: end; font-size: 13.5px; white-space: nowrap; }
.item .pr .lp-plus { color: var(--money-ink); font-weight: 600; }
.item .pr .lp-void { color: var(--muted); text-decoration: line-through; }

/* ---------- new order form ----------
   Each line: product on top (remove button at its end), then quantity + price side by side,
   then the line's profit. Lines that have room put everything on one row. */
.lines { display: grid; gap: 10px; container-type: inline-size; }
.line {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "prod rm" "qty qty" "price price" "lp lp";
  gap: 10px 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); align-items: start;
}
@container (min-width: 300px) {
  .line { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "prod prod rm" "qty price price" "lp lp lp"; }
}
.line > .line-prod { grid-area: prod; min-width: 0; align-self: center; }
.line > .line-qty { grid-area: qty; }
.line > .line-price { grid-area: price; min-width: 0; }
.line > .lp { grid-area: lp; }
.line > .rm { grid-area: rm; align-self: start; margin: -4px; }
@container (min-width: 620px) {
  .line { grid-template-columns: minmax(0, 1fr) auto 150px auto; grid-template-areas: "prod qty price rm" "prod lp lp rm"; row-gap: 4px; }
  .line > .rm { align-self: center; margin: 0; }
}
.line .lp { font-size: 13px; color: var(--muted); }
.line .lp b { color: var(--money-ink); font-family: var(--f-display); }
.line .thumb { width: 44px; height: 55px; object-fit: cover; border-radius: 6px; flex: none; background: var(--sunken); }
.line .field > label { font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.line .help { font-size: 12px; }
.line.is-bad { border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); background: color-mix(in srgb, var(--danger-tint) 45%, var(--surface-2)); }
.qty { display: flex; align-items: center; gap: 4px; }
.qty .btn { width: 40px; height: 42px; padding: 0; }
.qty .input { width: 52px; min-height: 42px; height: 42px; padding: 4px; text-align: center; font-family: var(--f-display); font-weight: 600; }
.line .input-group > input { height: 42px; min-height: 42px; }
.summary { position: relative; }
.summary .kv .v.profit { color: var(--money-ink); }
.picker-results { display: grid; gap: 6px; max-height: 320px; overflow-y: auto; margin-top: 8px; }
.picker-results button { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: center; text-align: start; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); cursor: pointer; }
.picker-results button:hover { border-color: var(--accent); }
.picker-results button:disabled { opacity: .5; cursor: not-allowed; }
.picker-results img { width: 44px; height: 55px; object-fit: cover; border-radius: 6px; background: var(--sunken); }

/* import preview */
.rowstate { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.rowstate.ok { background: var(--accent); }
.rowstate.bad { background: var(--danger); }
tr.is-bad td { background: color-mix(in srgb, var(--danger-tint) 55%, transparent); }

/* ---------- ops console ---------- */
.ops .content { max-width: 1320px; padding-bottom: 48px; }
.ops .side-help { cursor: default; }
.ops .side-help:hover { background: none; color: var(--ink-2); }
.ops-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.queue { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .queue { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.queue a { display: block; padding: 14px 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; }
.queue a:hover { border-color: var(--line-strong); text-decoration: none; box-shadow: var(--sh-1); }
.queue .n { font-family: var(--f-display); font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.queue .l { font-size: 13.5px; color: var(--muted); }
.queue a.hot { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); background: var(--warn-tint); }
.queue a.hot .l { color: var(--warn-ink); }
.inline-form { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline-form .input, .inline-form .select { min-height: 34px; height: 34px; padding: 4px 10px; width: auto; font-size: 13.5px; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; background: var(--sunken); padding: 2px 6px; border-radius: 4px; direction: ltr; unicode-bidi: isolate; overflow-wrap: anywhere; }
.secret { display: block; padding: 12px; border: 1px dashed var(--warn); background: var(--warn-tint); border-radius: var(--r-sm); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; direction: ltr; text-align: left; overflow-wrap: anywhere; }

/* ---------- misc ---------- */
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 36px; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.ta-c { text-align: center; } .ta-e { text-align: end; }
.w-100 { width: 100%; }
.w-150 { max-width: 150px; }
.w-auto { width: auto !important; }
.w-170 { width: 170px !important; }
.mw-520 { max-width: 520px; } .mw-560 { max-width: 560px; } .mw-680 { max-width: 680px; } .mw-760 { max-width: 760px; } .mw-none { max-width: none !important; }
.pre-line { white-space: pre-line; }
/* Free text on an English page (a description, an ad sentence, a ticket, an address, a note): every line of it finds its own
   direction, so Arabic and Latin lines of one text each start and end at their own edge. A container that `{% typed_dir %}`
   marked lang="ar" dir="rtl" is included. Arabic pages keep the browser's own handling. */
[dir="ltr"] :is(.copybox, .pre-line, .hook p, :is(p, div, dd, td)[lang="ar"][dir="rtl"]) { unicode-bidi: plaintext; }
.text-danger { color: var(--danger-ink); } .text-money { color: var(--money-ink); }
/* responsive visibility: only ever hides, never changes an element's own display type */
@media (max-width: 759px) { .hide-sm { display: none !important; } }
@media (min-width: 760px) { .hide-md { display: none !important; } }
@media (min-width: 1024px) { .hide-lg { display: none !important; } }
@media (max-width: 1023px) { .only-lg { display: none !important; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

@media print {
  .side, .topbar, .bnav, .flashes, .phead-actions, .no-print { display: none !important; }
  body { background: #fff; }
  .content { padding: 0; }
  .card, .table-wrap { box-shadow: none; }
}
.push-start { margin-inline-start: auto; }

/* ==========================================================================
   Marketer pages — calm working shell (27 Oct 2026)
   ========================================================================== */
.h-sub { font-family: var(--f-body); font-size: 14px; font-weight: 400; color: var(--muted); }
.card-h h2 { display: flex; align-items: center; gap: 8px; }
.card-flush > .card-h { padding: 16px 18px 8px; margin: 0; }

/* segmented period control (title row) */
.seg { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.seg::-webkit-scrollbar { display: none; }
.seg a { flex: none; display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 9px; color: var(--ink-2); font-size: 13.5px; font-weight: 500; white-space: nowrap; text-decoration: none; }
.seg a:hover { background: var(--sunken); text-decoration: none; }
.seg a[aria-current="true"] { background: var(--accent-tint); color: var(--accent-ink); font-weight: 600; }

/* number tiles, tinted by what the number is: orders, rates, money */
.tiles { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; } }
@media (min-width: 1280px) { .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.tile { border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1); }
.tile .ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 8px; }
.tile .v { font-family: var(--f-display); font-size: 22px; font-weight: 600; line-height: 1.3; color: var(--navy); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (min-width: 760px) { .tile .v { font-size: 24px; } }
.tile .l { font-size: 13.5px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 4px; }
.tile .f { font-size: 12px; color: var(--muted); }
.tile .tip { color: var(--muted); }
/* white tiles; the icon chip says what kind of number it is */
.tile.t-orders .ic { background: var(--tile-orders); color: var(--tile-orders-ink); }
.tile.t-rates .ic { background: var(--tile-rates); color: var(--tile-rates-ink); }
.tile.t-money .ic { background: var(--tile-money); color: var(--tile-money-ink); } .tile.t-money .v { color: var(--money-ink); }

/* home: money · needs you · running low */
.home-row { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 900px) { .home-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .home-row .wallet-card { grid-column: 1 / -1; } }
@media (min-width: 1280px) { .home-row { grid-template-columns: 5fr 4fr 3fr; } .home-row .wallet-card { grid-column: auto; } }
/* the balance leads in the brand's wallet card (one of the few places the gradient is allowed) */
.wallet-card { position: relative; overflow: hidden; background: var(--grad-brand); border: 0; color: #FFFFFF; box-shadow: 0 16px 36px rgba(8, 80, 170, .26); }
.wallet-card > :not(.ribbon) { position: relative; z-index: 1; }
.wallet-card .card-h { margin-bottom: 6px; }
.wallet-card .card-h h2 { color: #FFFFFF; }
/* the M on a white tile, like the app icon (spec §4: the mark on the wallet card) */
.w-mark { width: 34px; height: 34px; border-radius: 10px; background: #FFFFFF; display: inline-grid; place-items: center; flex: none; box-shadow: 0 2px 8px rgba(5, 30, 70, .18); }
.w-mark img { width: 25px; height: auto; }
.wallet-card .card-h a { color: #DDEBFB; }
.wallet-card .lbl { font-size: 13px; color: #DDEBFB; }
.wallet-card .big { font-family: var(--f-display); font-size: 36px; font-weight: 600; color: #FFFFFF; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wallet-card .stagebar { background: rgba(255, 255, 255, .16); }
.wallet-card .stagebar .s-av { background: #FFFFFF; }
.wallet-card .stagebar .s-pay { background: rgba(255, 255, 255, .7); }
.wallet-card .stagebar .s-hold { background: rgba(255, 255, 255, .45); }
.wallet-card .stagebar .s-exp { background: rgba(255, 255, 255, .24); }
.wallet-card .stages .k { color: #CFE2F8; }
.wallet-card .stages b { color: #FFFFFF; }
.wallet-card .note { margin: 8px 0 0; font-size: 12.5px; color: #DDEBFB; text-align: center; }
.wallet-card .ribbon { width: 300px; inset-inline-end: -60px; bottom: -70px; opacity: .2; }
.stagebar { display: flex; gap: 3px; height: 8px; margin: 12px 0 10px; border-radius: 4px; background: var(--sunken); }
.stagebar span { border-radius: 4px; min-width: 0; flex-basis: 0; }
.stagebar .s-av { background: var(--money-solid); }
.stagebar .s-pay { background: color-mix(in srgb, var(--money) 55%, var(--surface)); }
.stagebar .s-hold { background: color-mix(in srgb, var(--money) 25%, var(--surface)); }
.stagebar .s-exp { background: var(--line-strong); }
.stages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.stages .k { display: block; font-size: 12px; color: var(--muted); }
.stages b { font-family: var(--f-display); font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.attn-card .attn li { display: block; padding: 0; border-bottom: 0; border-top: 1px solid var(--line); }
.attn-card .attn a { display: flex; align-items: center; gap: 12px; padding: 11px 18px; min-height: 58px; color: inherit; text-decoration: none; }
.attn-card .attn a:hover { background: var(--surface-2); }
.attn-card .attn .t, .attn-card .attn .d { display: block; }
.attn-card .attn .t { font-size: 14px; }
.attn-card .attn .d { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attn-card .attn .go { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--accent-ink); }
.attn-card .attn .i { color: var(--faint); }
.attn-card .empty, .low-card .empty { padding-inline: 18px; }
.low-card .card-h h2 .i { color: var(--danger); }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list a { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.mini-list a:hover { background: var(--surface-2); }
.mini-list img, .mini-list .ph { width: 42px; height: 42px; border-radius: 10px; object-fit: cover; flex: none; background: var(--sunken); display: grid; place-items: center; color: var(--faint); }
.mini-list .t { display: block; font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-list .d { display: block; font-size: 12.5px; color: var(--warn-ink); }
.goal h2 { font-size: 16.5px; display: flex; align-items: center; gap: 8px; }

/* order cards (home, orders list) */
.ogrid { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .ogrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } }
@media (min-width: 1280px) { .ogrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ocard { display: flex; flex-direction: column; gap: 1px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); color: var(--ink); text-decoration: none; min-width: 0; box-shadow: var(--sh-1); transition: border-color .15s ease, box-shadow .15s ease; }
.ocard:hover { text-decoration: none; border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); box-shadow: var(--sh-2); }
.ocard.is-warn { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.ocard > span { min-width: 0; }
.ocard-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.ocard-num { font-family: var(--f-display); font-weight: 600; color: var(--accent-ink); }
.ocard-cust { font-size: 15px; font-weight: 600; }
.ocard-meta { font-size: 12.5px; color: var(--muted); }
.ocard-why { font-size: 12.5px; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--ink-2); }
.ocard-why.tone-warn { color: var(--warn-ink); }
.ocard-why.tone-danger { color: var(--danger-ink); }
.ocard .track { margin: 10px 0 0; gap: 4px; }   /* the order page's stage bar, thinner on the card */
.ocard .track span { height: 4px; }
.ocard-item { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 8px; border-radius: 12px; background: var(--bg); }
.ocard-item img, .ocard-item .ph { width: 40px; height: 40px; border-radius: 9px; object-fit: cover; flex: none; background: var(--sunken); display: grid; place-items: center; color: var(--faint); }
.ocard-item .nm, .ocard-item .lb { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ocard-item .nm { font-size: 13px; font-weight: 500; }
.ocard-item .lb { font-size: 12px; color: var(--muted); }
/* the profit cell gets the widest share so «Your profit · Expected» stays on one line on a phone (3 Nov 2026);
   bottom-aligned so the amounts still line up when a long label wraps */
.ocard-ft { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) minmax(0, 4fr); align-items: end; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.ocard-ft .k { display: block; font-size: 11.5px; color: var(--muted); }
.ocard-ft b { display: block; font-family: var(--f-display); font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ocard-ft b.amount-money { color: var(--money-ink); }
.ocard-ft b.muted { color: var(--muted); }

/* product cards: photo first, then three tinted rows (profit, our price, stock), then actions */
.pcard { overflow: hidden; box-shadow: var(--sh-1); }
.pcard:hover { box-shadow: var(--sh-2); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.pcard-media { border-radius: 0; aspect-ratio: 4 / 5; overflow: hidden; }
.pcard-media img { border-radius: 0; position: absolute; inset: 0; }   /* the photo fills a fixed 4:5 frame, so titles line up */
.pcard-media .ph { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-size: 12.5px; color: var(--accent-ink); background: linear-gradient(160deg, var(--accent-tint), var(--sunken)); }
.pcard-flags .pill { box-shadow: none; }
.pill-new { background: var(--cyan); color: #04203F; }
.pill-new .dot { display: none; }
.pcard-fav button[aria-pressed="true"] { color: var(--danger); }
.pcard-fav button[aria-pressed="true"] .i { fill: var(--danger); }
.pcard-body { padding: 12px; gap: 6px; }
@media (min-width: 760px) { .pcard-body { padding: 12px 14px 14px; } }
.pcard-title { font-size: 14px; min-height: calc(2 * 1.55em); }
.prow { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 30px; padding: 4px 10px; border-radius: 9px; background: var(--sunken); color: var(--ink-2); font-size: 12.5px; }
.prow > span { min-width: 0; }
.prow b { font-family: var(--f-display); font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.prow.is-profit { background: var(--money-tint); color: var(--money-ink); }
.prow.is-profit b { color: var(--money-ink); }
.prow.is-stock { background: var(--info-tint); color: var(--info-ink); }
.prow.is-stock.low { background: var(--warn-tint); color: var(--warn-ink); }
.prow.is-stock.out { background: var(--danger-tint); color: var(--danger-ink); }
.prow .wt { font-size: 12px; white-space: nowrap; }
.prow .dots { display: flex; gap: 3px; flex: none; }
.prow .dots i { width: 12px; height: 12px; border-radius: 50%; display: block; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14); }
.pcard-acts { position: relative; z-index: 2; display: flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 6px; }
/* the main button takes the room the download button leaves and no more: a longer label ("Create an order") wraps
   inside it instead of pushing the download button out of the card */
.pcard-acts .btn-primary { flex: 1 1 0; min-width: 0; height: auto; min-height: 34px; padding-inline: 8px; white-space: normal; line-height: 1.2; text-align: center; }
.pcard-acts .btn-icon { flex: none; }
@media (max-width: 759px), (pointer: coarse) { .pcard-acts .btn-primary { min-height: 44px; } }
@media (max-width: 420px) { .prow { padding: 4px 8px; font-size: 12px; } .prow b { font-size: 14px; } }

/* category tiles (catalogue) */
.cats { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; margin-bottom: 14px; padding-bottom: 2px; }
.cats::-webkit-scrollbar { display: none; }
.cats a { flex: none; display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 16px 0 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 500; white-space: nowrap; text-decoration: none; }
.cats a:hover { border-color: var(--line-strong); text-decoration: none; }
.cats .ci { width: 32px; height: 32px; border-radius: 9px; background: var(--sunken); display: grid; place-items: center; color: var(--ink-2); }
.cats a[aria-current="true"] { border-color: var(--accent); background: var(--accent-tint); color: var(--accent-ink); font-weight: 600; }
.cats a[aria-current="true"] .ci { background: var(--surface); color: var(--accent); }

/* a filter bar sitting in its own white card */
.fbar-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; }

/* product page (27 Oct 2026): media card by the gallery, price boxes, green profit box, helper links */
.pdp-media { display: grid; gap: 14px; align-self: start; align-content: start; min-width: 0; }
@media (min-width: 760px) { .pdp-media { position: sticky; top: calc(var(--top-h) + 12px); } .pdp-media .gallery { position: static; } }
.media-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r); background: var(--accent-tint); border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line)); }
.media-card .mi { width: 40px; height: 40px; border-radius: 11px; background: var(--surface); color: var(--accent); display: grid; place-items: center; flex: none; }
.media-card b { display: block; font-size: 14.5px; color: var(--ink); }
.media-card span:not(.mi) { display: block; font-size: 12.5px; color: var(--accent-ink); }
/* product videos (D38): 9:16 players under the photo-download card; nothing loads before play */
.pdp-videos h2 { margin: 0 0 8px; font-size: 14.5px; font-weight: 600; color: var(--ink); }
.pdp-videos-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.pdp-videos video { display: block; width: 100%; max-width: 260px; aspect-ratio: 9 / 16; border-radius: var(--r); background: var(--sunken); }
.moneybox-top { background: var(--surface); }
.price-field input:focus { border-color: var(--accent); box-shadow: var(--focus); }
.profit-box { justify-self: start; min-width: 190px; padding: 10px 16px; border-radius: 14px; background: var(--money-solid); color: var(--on-money); transition: background-color .2s ease, color .2s ease; }
.profit-box .t { display: block; font-size: 12.5px; opacity: .9; }
.profit-box .v { display: block; font-family: var(--f-display); font-size: 28px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; }
.moneybox.is-invalid .profit-box { background: var(--sunken); color: var(--muted); }
.ladder { gap: 8px; background: none; padding: 14px 18px 0; }
.ladder > * { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
/* the suggested price is a price, not profit: blue like the other tappable rungs, a little stronger */
.ladder button.is-suggested { background: var(--accent-tint); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.ladder button.is-suggested .k { color: var(--accent-ink); }
.ladder button.is-suggested .v { color: var(--accent-ink); }
.ladder button[aria-pressed="true"] { border-color: var(--accent); }
.moneybox-actions { border-top: 0; padding-top: 14px; }
.help-grid { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 560px) { .help-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.help-grid a { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: inherit; text-decoration: none; }
.help-grid a:hover { border-color: var(--line-strong); text-decoration: none; }
.help-grid b { display: block; font-size: 13.5px; color: var(--ink); }
.help-grid small { display: block; font-size: 12px; color: var(--muted); }
.help-grid .hi { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--sunken); color: var(--ink-2); }
.help-grid .hi.t-orders { background: var(--tile-orders); color: var(--tile-orders-ink); }
.help-grid .hi.t-rates { background: var(--tile-rates); color: var(--tile-rates-ink); }
.help-grid .hi.t-money { background: var(--tile-money); color: var(--tile-money-ink); }
.cell-stock.ok .n { color: var(--ink); }
.fav-btn[aria-pressed="true"] { color: var(--danger); }
.fav-btn[aria-pressed="true"] .i { fill: var(--danger); }

/* orders: status cards that filter in one tap */
.stcards { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 16px; }
@media (min-width: 760px) { .stcards { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; } }
.stcards a { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); text-decoration: none; }
.stcards a:hover { border-color: var(--line-strong); text-decoration: none; }
.stcards a[aria-current="page"] { border: 2px solid var(--accent); padding: 9px 13px; }
.stcards .si { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--info-tint); color: var(--info); }
.stcards b { display: block; font-family: var(--f-display); font-weight: 600; font-size: 21px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stcards .l { display: block; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.stcards .st-all .si { background: var(--accent-tint); color: var(--accent); }
.stcards .st-attention .si { background: var(--warn-tint); color: var(--warn); }
.stcards .st-delivered .si { background: var(--money-tint); color: var(--money); }
.stcards .st-returned .si { background: var(--danger-tint); color: var(--danger); }
.stcards .st-cancelled .si { background: var(--sunken); color: var(--muted); }
.tabs .n.is-danger { background: var(--danger-tint); color: var(--danger-ink); }
.seg-sm a { min-height: 34px; padding: 0 12px; gap: 6px; font-size: 13px; }
.pager .cur { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
/* phones: title and price come right after the photos; the photo-download card moves below the price box */
@media (max-width: 759px) {
  .pdp-media { display: contents; }
  .pdp-media .media-card { order: 2; }
  .pdp-media .pdp-videos { order: 2; }
  .gallery-main { aspect-ratio: 1 / 1; }
}

/* review fixes (28 Oct 2026) */
.attn-card .attn { grid-template-columns: minmax(0, 1fr); }
.rail .prow .hide-sm { display: none !important; }
.pdp ~ .grid-2 { align-items: start; }
/* phone home, in the approved order: the wallet card, tiles 2×2, needs you, new arrivals, then the rest */
@media (max-width: 759px) {
  .home { display: flex; flex-direction: column; gap: 16px; }
  .home > .section { margin-top: 0; }
  .home .home-row { display: contents; }
  .home .wallet-card { order: 1; }
  .home .tiles { order: 2; }
  .home .attn-card { order: 3; }
  .home .home-new { order: 4; }
  .home .low-card { order: 5; }
  .home .home-recent { order: 6; }
  .home .home-calls { order: 7; }
  .home .home-recent .ogrid > :nth-child(n+3) { display: none; }
}
/* phones: period and view switches get full 44px touch targets; the help button an invisible 44px hit area */
@media (max-width: 759px) {
  .seg a, .seg-sm a { min-height: 44px; }
  /* the home period switch takes the whole row and wraps when its choices do not fit, so none hides off the edge (3 Nov 2026) */
  .phead-actions.has-seg, .has-seg .seg { flex: 1 1 100%; }
  .has-seg .seg { flex-wrap: wrap; overflow: visible; }
  .has-seg .seg a { flex: 1 1 auto; justify-content: center; padding: 0 8px; }
  .help-btn { position: relative; }
  .help-btn::after { content: ""; position: absolute; inset: -4px 0; }
}
/* phones: every other control a marketer taps reaches 44px too (design review M3, 1 Nov 2026) */
@media (max-width: 759px) {
  .icon-btn { width: 44px; height: 44px; }
  .lockup-top, .pub-head .lockup { min-height: 44px; }
  .menu-panel a, .menu-panel button { min-height: 44px; }
  .lang-switch:not(.lang-switch-menu) button { min-height: 44px; }
  .pager a, .pager span { min-width: 44px; height: 44px; }
  .pcard-fav { top: 4px; inset-inline-end: 4px; }            /* the visible circle stays where it was */
  .pcard-fav button { width: 44px; height: 44px; }
  .pcard-fav button::before { inset: 6px; }
  .fbar .input, .fbar .select, .fbar .btn, .fbar .f-check { height: 44px; min-height: 44px; }
  .pw-wrap input { padding-inline-end: 48px; }
  .pw-wrap button { width: 44px; height: 44px; top: 1px; inset-inline-end: 1px; }
  nav.chips .chip { height: 36px; }                          /* + the chips' invisible 4px above and below = 44px */
}
@media (max-width: 399px) { .topbar { gap: 8px; } .topbar-end { gap: 4px; } }   /* four 44px buttons still fit at 360px */
/* narrow phones: «المتاح فقط» wraps inside its box instead of running past it (code review 8) */
@media (max-width: 399px) { .fbar .f-check { white-space: normal; line-height: 1.2; padding: 0 10px; gap: 6px; font-size: 13.5px; } }

/* ==========================================================================
   Staff console — the same calm shell as the marketer pages (28 Oct 2026)
   ========================================================================== */
/* tile rows with a fixed count */
@media (min-width: 760px) and (max-width: 1099px) { .tiles.tiles-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .tiles.tiles-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } .tiles.tiles-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile.t-void { background: var(--sunken); } .tile.t-void .ic { color: var(--muted); } .tile.t-void .v { color: var(--faint); text-decoration: line-through; }

/* small tinted icon square in card titles */
.qi { width: 30px; height: 30px; border-radius: 9px; display: inline-grid; place-items: center; flex: none; background: var(--sunken); color: var(--ink-2); }
.qi .i { width: 17px; height: 17px; }
.qi.t-orders { background: var(--tile-orders); color: var(--tile-orders-ink); }
.qi.t-money { background: var(--tile-money); color: var(--tile-money-ink); }
.qi.t-rates { background: var(--tile-rates); color: var(--tile-rates-ink); }

/* home: the work queues in three cards (orders · money · marketers and risk) */
.qgroups { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1000px) { .qgroups { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.qlist { list-style: none; margin: 0; padding: 0 0 4px; }
.qlist a { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 18px; border-top: 1px solid var(--line); color: var(--ink-2); text-decoration: none; }
.qlist a[href]:hover { background: var(--surface-2); text-decoration: none; }
.qr-i { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--sunken); color: var(--muted); }
.qr-i .i { width: 17px; height: 17px; }
.qr-t { flex: 1; min-width: 0; font-size: 14px; }
.qr-t small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.qr-n { min-width: 34px; height: 28px; padding: 0 9px; border-radius: var(--r-full); display: inline-grid; place-items: center; font-family: var(--f-display); font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; background: var(--sunken); color: var(--muted); }
.qlist .qr-go { color: var(--faint); }
.qlist a.hot { color: var(--ink); }
.qlist a.hot .qr-t { font-weight: 600; }
.qlist a.hot .qr-i { background: var(--warn-tint); color: var(--warn); }
.qlist a.hot .qr-n { background: var(--warn-tint); color: var(--warn-ink); }
.qlist a.hot .qr-go { color: var(--accent); }

/* home: the warehouse link in four small numbers */
.wstats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 6px; }
@media (min-width: 560px) { .wstats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.wstats > * { padding: 10px 12px; border-radius: 12px; background: var(--bg); color: var(--ink); text-decoration: none; min-width: 0; }
.wstats a:hover { background: var(--accent-tint); text-decoration: none; }
.wstats b { display: block; font-family: var(--f-display); font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.wstats span { display: block; font-size: 12px; color: var(--muted); }
.wstats .is-warn { background: var(--warn-tint); } .wstats .is-warn b { color: var(--warn-ink); }

/* lists: a row of status cards that filter in one tap, scrolling sideways on phones */
.stcards.st-row { display: flex; overflow-x: auto; scrollbar-width: none; gap: 8px; }
.stcards.st-row::-webkit-scrollbar { display: none; }
.stcards.st-row a { flex: 1 0 auto; min-width: 128px; min-height: 58px; padding: 8px 12px; gap: 10px; }
.stcards.st-row a[aria-current="page"] { padding: 7px 11px; }
.stcards.st-row .si { width: 34px; height: 34px; border-radius: 10px; }
.stcards.st-row b { font-size: 19px; }
.stcards.st-row .l { font-size: 12.5px; white-space: nowrap; }
.stcards .st-info .si { background: var(--info-tint); color: var(--info); }
.stcards .st-brand .si { background: var(--accent-tint); color: var(--accent); }
.ops-content .filters { padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }

/* phones: table rows become cards (number and status on top, then the money, then the rest) */
@media (max-width: 759px) {
  .table-wrap:has(> .table-cards) { border: 0; border-radius: 0; background: none; box-shadow: none; overflow: visible; }
  .table-cards, .table-cards tbody, .table-cards tfoot { display: block; }
  .table-cards thead { display: none; }
  .cols-menu { display: none; }                                      /* a card has no columns to choose... */
  .table-cards td[data-col][hidden] { display: block !important; }   /* ...so a choice made on a wide screen never strips the cards */
  .table-cards tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; padding: 12px 14px; margin-bottom: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
  .table-cards tbody tr:hover { background: var(--surface); }
  .table-cards td, .table-dense.table-cards td { display: block; padding: 0; border: 0; min-width: 0; text-align: start; }
  .table-cards td.end { text-align: start; }
  .table-cards td[data-label]::before { content: attr(data-label); display: block; font-size: 11.5px; font-weight: 400; color: var(--muted); }
  .table-cards .tc-head { order: -3; align-self: center; font-size: 15.5px; }
  .table-cards .tc-pill { order: -2; justify-self: end; align-self: center; }
  .table-cards .tc-wide { order: -1; grid-column: 1 / -1; }
  .table-cards .tc-money { order: 0; font-size: 16px; }
  .table-cards .tc-meta { order: 1; }
  .table-cards .tc-flags { order: 2; }
  .table-cards .tc-flags:has(> .muted:only-child) { display: none; }
  .table-cards .tc-act { order: 3; grid-column: 1 / -1; } .table-cards .tc-act > .btn { width: 100%; }
  .table-cards td.tc-img, .table-dense.table-cards td.tc-img { display: none; }
  .table-cards .tc-note { max-width: none !important; }
  .table-cards tfoot tr { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
  .table-cards tfoot td { padding: 0; border: 0; background: none; }
  .table-cards tfoot td:empty { display: none; }
  /* the secondary facts sit two per row in one small line each: «المحافظة: الجيزة» */
  .table-cards td.tc-meta { font-size: 12.5px; color: var(--ink-2); }
  .table-cards td.tc-meta { white-space: normal; }
  .table-cards td.tc-meta[data-label]::before { display: inline; content: attr(data-label) ": "; font-size: 12px; }
  .table-cards td.tc-meta.amount[data-label]::before { display: block; content: attr(data-label); }
  .table-cards tfoot td[data-label]::before { content: attr(data-label) ": "; font-size: 12px; font-weight: 400; color: var(--muted); }
  .table-cards tbody tr { gap: 6px 12px; }
  .table-cards .tc-money { margin-top: 2px; }
  /* filters: search on its own row, the rest two per row */
  .ops-content .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ops-content .filters .grow { grid-column: 1 / -1; }
  .ops-content .filters .input, .ops-content .filters .select { width: 100%; min-width: 0; }
  .ops-content .filters label.row { min-width: 0; }
  .ops-content .filters label.row .input { flex: 1; }
}
.ops-pair { align-items: start; }


/* ==========================================================================
   Staff console — detail and settings pages (28 Oct 2026)
   ========================================================================== */
/* a page about one thing (a marketer, a payout, a ticket, a product) opens with a white header card */
.phead.dhead { padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); align-items: center; }
.dh-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.dh-main > div { min-width: 0; }
.dh-av { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; flex: none; background: var(--accent-tint); color: var(--accent-ink); font-family: var(--f-display); font-size: 22px; font-weight: 600; }
.dh-av .i { width: 24px; height: 24px; }
.dh-av.t-money { background: var(--tile-money); color: var(--tile-money-ink); }
.dh-av.t-rates { background: var(--tile-rates); color: var(--tile-rates-ink); }
@media (max-width: 759px) { .phead.dhead { padding: 14px; } .dh-av { width: 44px; height: 44px; border-radius: 13px; font-size: 19px; } }
@media (min-width: 1100px) { .tiles.tiles-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tile .v.amount-neg { color: var(--danger-ink); }

/* a marketer's balance: the available amount, the stage bar, then each stage with its colour */
.bal-card .card-h { margin-bottom: 6px; }
.bal-card .lbl { font-size: 13px; color: var(--muted); }
.bal-card .big { font-family: var(--f-display); font-size: 30px; font-weight: 600; color: var(--money-ink); line-height: 1.25; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bal-card .big.is-neg { color: var(--danger-ink); }
.bal-card .stagebar { margin-bottom: 4px; }
.dot-k { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-inline-end: 7px; vertical-align: 1px; }
.dot-k.s-pay { background: color-mix(in srgb, var(--money) 55%, var(--surface)); }
.dot-k.s-hold { background: color-mix(in srgb, var(--money) 25%, var(--surface)); }
.dot-k.s-exp { background: var(--line-strong); }

/* phones: editable cells keep their field full width under the label; button groups stack */
@media (max-width: 759px) {
  .table-cards td.tc-field[data-label]::before { display: block; margin-bottom: 3px; }
  .table-cards td.tc-field .input, .table-cards td.tc-field .select { width: 100%; }
  .table-cards td.tc-field .inline-form { flex-wrap: wrap !important; }
  .table-cards .tc-btns { display: flex; flex-wrap: wrap; gap: 8px; }
  .table-cards .tc-btns form { flex: 1 1 140px; }
  .table-cards .tc-btns .btn { width: 100%; }
  .table-cards tr.is-bad td { grid-column: 1 / -1; }
  .table-cards td.nowrap { white-space: normal; }
}


/* ==========================================================================
   Fixes from the team SOP (29 Oct 2026)
   ========================================================================== */
/* a table wider than its column keeps its action column in view while the rest scrolls sideways
   (staff and API keys at 1366 px). The console is RTL, so the column's inner edge is its right side. */
.table .c-sticky { position: sticky; inset-inline-end: 0; z-index: 1; background: var(--surface); box-shadow: inset -1px 0 0 var(--line); }
.table thead .c-sticky { background: var(--surface-2); }
.table tbody tr:hover .c-sticky { background: var(--surface-2); }
@media (max-width: 759px) { .table-cards .c-sticky { position: static; background: none; box-shadow: none; } }

/* a long account number (IBAN) wraps instead of running off a phone screen */
.num.num-wrap { white-space: normal; overflow-wrap: anywhere; }

/* audit «العملية»: 190 px on wide screens; on phones the phone rule's full width wins (it was an inline style) */
.filters .f-action { width: 190px; }
.filters .f-action:placeholder-shown { direction: rtl; }
@media (max-width: 759px) { .ops-content .filters .f-action { grid-column: 1 / -1; } }  /* its example needs a full row */

/* JSON (store messages, audit details): read left to right; Arabic in the UI font, so its letters join
   instead of spreading out in the monospace one, and each Arabic value is isolated in a <bdi> */
.json-box { display: block; white-space: pre-wrap; overflow-wrap: break-word; text-align: left; overflow: auto; margin: 6px 0 0; max-height: 320px;
  font-family: "Plex Arabic", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.json-box-lg { margin: 0; padding: 12px; max-height: 60vh; }

/* ==========================================================================
   Daily chart on the reports page (D32). Drawn on the server (apps/ops/chart.py), no JavaScript.
   The plot runs left to right like every number. The drawing stretches to its box: the lines and dots keep their
   screen size (non-scaling-stroke), and the words are HTML placed by percent, so they stay readable on a phone.
   Series colours are existing tokens, so both themes work: «أُنشئت» amber (the «new» colour), «تم تسليمها» the action
   blue, the profit green (money only). Counts and profit sit in two panels, never on two scales in one plot.
   ========================================================================== */
.trend { --t-created: var(--gold-ink); --t-delivered: var(--accent); --t-profit: var(--money); margin: 0; }
.trend-legend { display: flex; flex-wrap: wrap; gap: 6px 20px; list-style: none; margin: 0 0 14px; padding: 0; font-size: 13.5px; color: var(--ink-2); }
.trend-legend li { display: inline-flex; align-items: center; gap: 7px; }
.trend-legend b { color: var(--ink); font-family: var(--f-display); font-weight: 600; font-variant-numeric: tabular-nums; }
.trend-key { width: 18px; height: 3px; border-radius: 2px; flex: none; }
.trend-key.is-created { background: var(--t-created); }
.trend-key.is-delivered { background: var(--t-delivered); }
.trend-key.is-profit { background: var(--t-profit); }
.trend-plot { display: grid; grid-template-columns: 52px minmax(0, 1fr); grid-template-rows: 260px auto; column-gap: 10px; }
@media (min-width: 760px) { .trend-plot { grid-template-rows: 320px auto; } }
.trend-y, .trend-area, .trend-x { position: relative; min-width: 0; }
.trend-yl { position: absolute; inset-inline-end: 0; transform: translateY(-50%); font-size: 11.5px; line-height: 1; color: var(--muted); white-space: nowrap; }
.trend-svg { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; overflow: visible; }
.trend-gl { stroke: var(--line); stroke-width: 1px; vector-effect: non-scaling-stroke; }
.trend-gl.is-base { stroke: var(--line-strong); }
.trend-hit { fill: transparent; }
.trend-hit:hover { fill: var(--accent); fill-opacity: .08; }
.trend-line { fill: none; stroke-width: 2px; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; pointer-events: none; }
.trend-line.is-created, .trend-dot.is-created { stroke: var(--t-created); }
.trend-line.is-delivered, .trend-dot.is-delivered { stroke: var(--t-delivered); }
.trend-line.is-profit, .trend-dot.is-profit { stroke: var(--t-profit); }
/* the end dot: a zero-length stroke with round caps is a circle of the stroke's width, whatever the box is stretched to */
.trend-ring, .trend-dot { fill: none; stroke-linecap: round; vector-effect: non-scaling-stroke; pointer-events: none; }
.trend-ring { stroke: var(--surface); stroke-width: 12px; }
.trend-dot { stroke-width: 8px; }
/* where the two counts end on the same figure (or there is one day only) the amber dot is a size larger, so it shows as a ring round the blue one */
.trend-ring.is-created { stroke-width: 14px; }
.trend-dot.is-created { stroke-width: 10px; }
.trend-cap { position: absolute; left: 0; max-width: 100%; direction: rtl; font-size: 12.5px; line-height: 1.3; color: var(--ink-2); padding-top: 2px; white-space: nowrap; }
.trend-x { height: 24px; margin-top: 8px; }
.trend-xl { position: absolute; top: 0; font-size: 11.5px; line-height: 1.3; color: var(--muted); white-space: nowrap; }
.trend-xl.is-mid { transform: translateX(-50%); }
.trend-xl.is-last { transform: translateX(-100%); }
.trend-table { margin-top: 14px; }
.trend-table > summary { cursor: pointer; width: fit-content; }
.trend-table[open] > summary { margin-bottom: 10px; }
.trend-table .table-wrap { max-height: 340px; overflow-y: auto; box-shadow: none; }
.trend-table thead th { position: sticky; top: 0; z-index: 1; }
.trend-table tbody th, .trend-table tfoot th { text-align: start; font-weight: 500; font-size: 14px; color: var(--ink); background: none; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.trend-table tfoot th, .trend-table tfoot td { font-weight: 600; background: var(--surface-2); border-top: 1px solid var(--line-strong); }
@media print { .trend-hit { display: none; } }

/* Local creation-period controls retain the existing .has-seg phone wrapping. */
.home-period { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; max-width: 100%; }
.home-period label { display: flex; align-items: center; gap: 6px; min-width: 0; }
.home-period .input { width: 145px; min-width: 0; }
a.tile { color: inherit; text-decoration: none; }
a.tile:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.order-kpis .tile { min-width: 0; }

/* Phase 1 reports reuse the home switch, number tiles and card/table components. */
.report-period { min-width: 0; max-width: 100%; }
.report-period .home-period { flex: 1 1 100%; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); }
.report-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.report-tiles .tile { min-width: 0; padding: 16px 12px; }
.report-tiles .v { max-width: 100%; overflow-wrap: anywhere; white-space: normal; }
.report-tiles .l, .report-tiles .f { overflow-wrap: anywhere; }
.report-bar { min-width: 0; }
.report-bar .row-between { gap: 8px; margin-bottom: 6px; }
.report-details { min-width: 0; }
.report-details .table-wrap { max-width: 100%; }
.report-details .table { min-width: 560px; }
.spend-entry { max-width: 640px; }
@media (min-width: 1024px) { .report-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 759px) {
  .report-period { flex: 1 1 100%; }
  .report-period .home-period label { flex: 1 1 120px; flex-direction: column; align-items: stretch; }
  .report-period .home-period .input { width: 100%; }
}
.report-model-filter .row > .select { flex: 1; width: 0; min-width: 0; }
.report-model-filter .row > .btn { flex: none; }
.report-tiles .l { display: block; }
.report-calculation .dl { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

/* Monthly leaderboard: make the viewer's own rank visible in both themes. */
.table tr.is-current { background: var(--accent-tint); color: var(--accent-ink); font-weight: 600; }
.card.is-current { border-inline-start: 4px solid var(--accent); background: var(--accent-tint); }
.seg a[aria-current="page"] { background: var(--accent-tint); color: var(--accent-ink); font-weight: 600; }

/* SEO-01/03 (21 Nov 2026): landing questions, public catalog crumbs and links */
.faq-pub { display: grid; gap: 10px; max-width: 820px; }
.faq-pub details { border: 1px solid var(--line, #E3E7ED); border-radius: 12px; padding: 14px 16px; background: var(--surface, #FFFFFF); }
.faq-pub summary { cursor: pointer; font-weight: 600; }
.faq-pub details p { margin: 10px 0 0; line-height: 1.8; }
.crumbs { margin-bottom: 12px; color: var(--muted, #5B6577); }
.crumbs a { color: inherit; }
.cat-pub b a { color: inherit; text-decoration: none; }
.cat-pub b a:hover, a.chip:hover { text-decoration: underline; }
a.chip { text-decoration: none; color: inherit; }
.pcard-public .pcard-title { margin-bottom: 6px; }

/* SEO batch 2 (D63): guides and comparisons */
.guide { max-width: 860px; }
.guide-head h1 { margin: 6px 0 10px; line-height: 1.5; }
.guide-lead { font-size: 17px; line-height: 1.9; color: var(--ink-2); }
.guide-body { line-height: 2; font-size: 16px; }
.guide-body h2 { margin: 32px 0 10px; font-size: 22px; }
.guide-body h3 { margin: 22px 0 8px; font-size: 18px; }
.guide-body ul, .guide-body ol { padding-inline-start: 22px; }
.guide-body li { margin: 6px 0; }
.guide-body .note { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.guide-body table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 14.5px; }
.guide-body th, .guide-body td { border: 1px solid var(--line); padding: 8px 10px; text-align: start; vertical-align: top; }
.guide-body th { background: var(--surface-2); }
.table-scroll { overflow-x: auto; }
.guide-related { margin-top: 32px; border-top: 1px solid var(--line); padding-top: 16px; }
.guide-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin: 12px 0 28px; }
.guide-card { display: grid; gap: 6px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: inherit; text-decoration: none; }
.guide-card:hover { border-color: var(--line-strong); }
.guide-card span { color: var(--muted); font-size: 14px; line-height: 1.8; }
.calc { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.calc label { display: grid; gap: 4px; font-size: 14px; }
.calc input { height: 40px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 10px; font: inherit; background: var(--surface); color: inherit; }
.calc-out { margin-top: 14px; }
.calc-out td:last-child { font-weight: 600; white-space: nowrap; }
.calc-out tr.total td { font-size: 17px; }
