/* ==========================================================================
   Design system — Arabic-first, RTL, mobile-first.
   Calm working shell (approved 27 Oct 2026, structure after Safka and Taager): white surfaces and a
   white side menu, 1px lines, one indigo accent for actions, tiles tinted by what the number is,
   and green only on money. Profit leads every product and order surface, with its stage.
   ========================================================================== */

/* ---------- 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 ---------- */
:root {
  --bg: #F7F8FA;
  --surface: #FFFFFF;
  --surface-2: #FAFBFC;
  --sunken: #F1F3F6;
  --line: #E3E7ED;
  --line-strong: #CFD6DF;
  --ink: #18212D;
  --ink-2: #3B4552;
  --muted: #616C7B;          /* 5.33:1 on white */
  --faint: #8592A3;          /* decorative only, never for body text */

  --plum: #18212D;           /* dark panels on public pages (footer, sign-in art) */
  --plum-2: #243041;
  --plum-ink: #EEF2F7;
  --plum-muted: #A9B4C2;

  --accent: #5454C4;         /* the one accent: actions, links, the current page */
  --accent-hover: #4545AE;
  --accent-tint: #EEEEFB;
  --accent-ink: #3F3FA6;

  --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(24, 33, 45, .45);
  --placeholder: #6E7886;    /* 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='%23616C7B' 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: #2F5BD3; --info-tint: #EEF3FF; --info-ink: #26408F;
  --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: #EEF3FF; --tile-orders-ink: #2F5BD3;
  --tile-rates: #FFF6E0;  --tile-rates-ink: #9A6200;
  --tile-money: #EAF7F0;  --tile-money-ink: #087A50;

  --r-xs: 8px; --r-sm: 10px; --r: 16px; --r-lg: 20px; --r-full: 999px;
  --sh-1: none;
  --sh-2: 0 8px 24px rgba(24, 33, 45, .08);
  --sh-3: 0 20px 56px rgba(24, 33, 45, .20);
  --focus: 0 0 0 3px rgba(84, 84, 196, .25);          /* soft halo for fields (their border turns accent too) */
  --focus-ring: 0 0 0 2px var(--surface), 0 0 0 4px rgba(84, 84, 196, .8);  /* 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: 248px;
  --top-h: 64px;
  --bnav-h: 70px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F141B; --surface: #161C25; --surface-2: #1A212B; --sunken: #121820;
    --line: #2A3340; --line-strong: #3A4555;
    --ink: #EEF2F7; --ink-2: #C9D1DC; --muted: #9AA6B5; --faint: #6F7C8C;
    --plum: #0B1016; --plum-2: #1C2533; --plum-ink: #EEF2F7; --plum-muted: #9AA6B5;
    --accent: #A3A3F7; --accent-hover: #BABAFA; --accent-tint: #23234A; --accent-ink: #C6C6FB;
    --money: #4FD19B; --money-hover: #6EDCAF; --money-tint: #10322A; --money-ink: #86E3C4;
    --money-solid: #3CC48D; --on-money: #04241A; --on-accent: #12123A; --on-danger: #2E0A08;
    --focus: 0 0 0 3px rgba(163, 163, 247, .35); --focus-ring: 0 0 0 2px var(--surface), 0 0 0 4px rgba(186, 186, 250, .9);
    --tag-string: rgba(238, 242, 247, .4); --placeholder: #8E9AAA;
    --select-chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239AA6B5' 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: #8EA9F5; --info-tint: #1B2647; --info-ink: #B5C6F8;
    --warn: #E9B566; --warn-tint: #33280F; --warn-ink: #F1CF8F;
    --danger: #F28A8F; --danger-tint: #3D1D22; --danger-ink: #F7B5B8;
    --tile-orders: #1B2647; --tile-orders-ink: #B5C6F8;
    --tile-rates: #33280F;  --tile-rates-ink: #F1CF8F;
    --tile-money: #10322A;  --tile-money-ink: #86E3C4;
    --sh-2: 0 8px 24px rgba(0, 0, 0, .35); --sh-3: 0 20px 56px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F141B; --surface: #161C25; --surface-2: #1A212B; --sunken: #121820;
  --line: #2A3340; --line-strong: #3A4555;
  --ink: #EEF2F7; --ink-2: #C9D1DC; --muted: #9AA6B5; --faint: #6F7C8C;
  --plum: #0B1016; --plum-2: #1C2533; --plum-ink: #EEF2F7; --plum-muted: #9AA6B5;
  --accent: #A3A3F7; --accent-hover: #BABAFA; --accent-tint: #23234A; --accent-ink: #C6C6FB;
  --money: #4FD19B; --money-hover: #6EDCAF; --money-tint: #10322A; --money-ink: #86E3C4;
  --money-solid: #3CC48D; --on-money: #04241A; --on-accent: #12123A; --on-danger: #2E0A08;
  --focus: 0 0 0 3px rgba(163, 163, 247, .35); --focus-ring: 0 0 0 2px var(--surface), 0 0 0 4px rgba(186, 186, 250, .9);
  --tag-string: rgba(238, 242, 247, .4); --placeholder: #8E9AAA;
  --select-chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239AA6B5' 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: #8EA9F5; --info-tint: #1B2647; --info-ink: #B5C6F8;
  --warn: #E9B566; --warn-tint: #33280F; --warn-ink: #F1CF8F;
  --danger: #F28A8F; --danger-tint: #3D1D22; --danger-ink: #F7B5B8;
  --tile-orders: #1B2647; --tile-orders-ink: #B5C6F8;
  --tile-rates: #33280F;  --tile-rates-ink: #F1CF8F;
  --tile-money: #10322A;  --tile-money-ink: #86E3C4;
  --sh-2: 0 8px 24px rgba(0, 0, 0, .35); --sh-3: 0 20px 56px rgba(0, 0, 0, .55);
  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 night-plum frame the rose halo disappears: use a light ring instead */
.pub-foot :focus-visible, .auth-art :focus-visible { box-shadow: 0 0 0 2px #BABAFA; }
::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; }
.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); }

/* ---------- type ---------- */
h1, h2, h3, h4 { font-family: var(--f-display); color: var(--ink); margin: 0; font-weight: 600; letter-spacing: 0; line-height: 1.35; }
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); }
.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-y: auto;
    background: var(--surface); color: var(--ink-2); border-inline-end: 1px solid var(--line); padding: 18px 14px 16px; gap: 6px;
    scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
  }
  .content { padding: 28px 32px 56px; }
}

.brand { display: flex; align-items: center; gap: 10px; color: inherit; padding: 4px 8px 14px; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-name { font-family: var(--f-display); font-weight: 600; font-size: 21px; letter-spacing: 0; line-height: 1; }
.brand-sub { display: block; font-size: 12px; color: var(--muted); font-family: var(--f-body); font-weight: 400; margin-top: 4px; }

.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"] .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 {
  border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; color: var(--ink);
  display: block; text-decoration: none; background: var(--money-tint);
}
.side-wallet:hover { text-decoration: none; border-color: color-mix(in srgb, var(--money) 35%, var(--line)); }
.side-wallet .lbl { font-size: 12.5px; color: var(--money-ink); }
.side-wallet .val { font-family: var(--f-display); font-size: 20px; font-weight: 600; color: var(--money-ink); font-variant-numeric: tabular-nums; }
.side-wallet .sub { font-size: 12px; color: var(--ink-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 .brand { display: none; } }
.topbar .brand { color: var(--ink); padding: 0; }
.topbar .brand-name { font-size: 19px; }
.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(--accent); color: var(--on-accent); 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); }

/* 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 span.plus {
  width: 52px; height: 52px; border-radius: 16px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center;
  margin-top: -18px; box-shadow: 0 0 0 4px var(--surface), 0 8px 20px rgba(84, 84, 196, .32);
}
.bnav .bnav-new .i { color: var(--on-accent); width: 24px; height: 24px; }
.bnav .bnav-new[aria-current="page"] .i { color: var(--on-accent); }

/* 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; }
.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: 42px; padding: 0 16px;
  border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  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;
}
.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); }
.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-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: 50px; padding: 0 22px; font-size: 16px; border-radius: var(--r); }
.btn-block { width: 100%; }
.btn-icon { width: 42px; 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: small buttons and text buttons still get a 40px touch target */
@media (max-width: 759px), (pointer: coarse) {
  .btn-sm { height: 40px; padding: 0 14px; }
  .btn-icon.btn-sm { width: 40px; }
  .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: 44px; padding: 9px 12px; border-radius: var(--r-sm); 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; }
.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-sm); 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(--money); }
.pw-meter[data-level="4"] span { width: 100%; background: var(--money); }

/* ---------- 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; }
.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)); } }
@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; }
.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: var(--accent-tint); color: var(--accent-ink); }
.pill-gold { background: var(--gold-tint); color: var(--gold-ink); }
.pill-muted { background: var(--sunken); color: var(--muted); }
.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(--money-tint); color: var(--money-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 9px; border-radius: var(--r-full); background: var(--gold); color: #3B2800; 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(--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; }
.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; }
.flow-step.is-available { order: -1; grid-column: 1 / -1; padding: 16px 18px; }
@media (min-width: 900px) {
  .flow { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .flow-step { padding: 18px 20px; }
  .flow-step.is-available { order: 0; grid-column: auto; padding: 18px 20px; }
  .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.is-available::after { background: var(--money-tint); }
}
.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; }
.flow-step.is-available { background: var(--money-tint); }
.flow-step.is-available .val { color: var(--money-ink); font-size: 28px; }
.flow-step.is-available .lbl { color: var(--money-ink); font-weight: 600; }
.flow-step.is-available .hint { color: var(--money-ink); }

/* ---------- the hang-tag (profit) ----------
   A clothing tag: pointed at the start side (right in RTL) with an eyelet in the point,
   flat with rounded corners at the end side. Text starts after the eyelet. */
.htag {
  --tag-bg: var(--money-solid); --tag-ink: var(--on-money); --notch: 14px; --eye: 7px; --eye-at: 11px;
  --eye-x: calc(var(--eye-at) + var(--eye) / 2);
  position: relative; display: inline-flex; flex-direction: column; align-items: flex-start; justify-content: center;
  min-height: 46px; padding-block: 6px; padding-inline: calc(var(--notch) + 13px) 14px;
  color: var(--tag-ink); background: var(--tag-bg); line-height: 1.25;
  border-start-end-radius: var(--r-sm); border-end-end-radius: var(--r-sm);
  clip-path: polygon(var(--notch) 0, 100% 0, 100% 100%, var(--notch) 100%, 0 50%);
  /* a real punched hole: whatever is behind the tag (photo, thread, panel) shows through */
  -webkit-mask: radial-gradient(circle at var(--eye-x) 50%, transparent calc(var(--eye) / 2), #000 calc(var(--eye) / 2 + .8px));
  mask: radial-gradient(circle at var(--eye-x) 50%, transparent calc(var(--eye) / 2), #000 calc(var(--eye) / 2 + .8px));
}
[dir="rtl"] .htag {
  --eye-x: calc(100% - var(--eye-at) - var(--eye) / 2);
  clip-path: polygon(0 0, calc(100% - var(--notch)) 0, 100% 50%, calc(100% - var(--notch)) 100%, 0 100%);
}
.htag::before { /* the eyelet ring around the hole */
  content: ""; position: absolute; width: calc(var(--eye) + 5px); height: calc(var(--eye) + 5px); border-radius: 50%;
  top: 50%; inset-inline-start: calc(var(--eye-at) - 2.5px); transform: translateY(-50%);
  border: 1.5px solid color-mix(in srgb, var(--tag-ink) 40%, transparent); box-sizing: border-box;
}
.htag .t { font-size: 12px; font-weight: 500; white-space: nowrap; }
.htag .v { font-family: var(--f-display); font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: 0; }
.htag-lg { --notch: 20px; --eye: 10px; --eye-at: 14px; min-height: 76px; padding-block: 10px; padding-inline: calc(var(--notch) + 18px) 20px; }
.htag-lg .t { font-size: 13px; }
.htag-lg .v { font-size: 30px; line-height: 1.2; }
.htag-muted { --tag-bg: var(--sunken); --tag-ink: var(--muted); }
.htag-danger { --tag-bg: var(--danger); --tag-ink: var(--on-danger); }
.htag-paper { --tag-bg: #FFFFFF; --tag-ink: #221A2C; }          /* on the plum art panel */
.htag-plum { --tag-bg: #4A3863; --tag-ink: #F3EEF9; }

/* hanging variant (product cards): tied by a thread at the eyelet, hanging off the photo's
   bottom edge and drooping slightly under its own weight. */
.hang {
  position: absolute; z-index: 2; bottom: -15px; inset-inline-end: 10px; max-width: calc(100% - 20px);
  transform: rotate(var(--droop, 3deg)); transform-origin: 14px 50%;
  filter: drop-shadow(0 5px 6px rgba(11, 70, 52, .28));
}
[dir="rtl"] .hang { --droop: -3deg; transform-origin: calc(100% - 14px) 50%; }
.hang::after { /* the thread: tied through the eyelet, running up into the photo */
  content: ""; position: absolute; z-index: 1; bottom: 50%; inset-inline-start: 13.75px; width: 1.5px; height: 36px;
  background: var(--tag-string); border-radius: 2px; transform-origin: 50% 100%; transform: rotate(-14deg);
}
[dir="rtl"] .hang::after { transform: rotate(14deg); }
.hang .htag { max-width: 100%; }
.hang .htag .t, .hang .htag .v { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* ---------- 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)); } }
.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(--money); }
.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; }
.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: grid; place-items: center; color: var(--faint); }
.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(--money); box-shadow: 0 0 0 3px color-mix(in srgb, var(--money) 28%, transparent); }
.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(--money-ink); font-weight: 500; }
.price-msg.err { color: var(--danger-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 · max — the middle two are tappable */
.ladder { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); }
@container (min-width: 500px) { .ladder { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.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); }
.calc-body { padding: 0 18px 18px; display: grid; gap: 14px; }
.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; }

.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(--money-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(--money); color: var(--money-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-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(--sunken); }
.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); }

/* ---------- 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); }
.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(--ink); 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(--money-tint); color: var(--money-ink); }
.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 .brand { color: var(--ink); padding: 0; }
/* 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; background: var(--plum); color: var(--plum-ink); overflow: hidden; }
@media (min-width: 1000px) { .auth-art { display: flex; flex-direction: column; justify-content: center; gap: 56px; padding: 56px clamp(40px, 5vw, 72px); } }
.auth-art h2 { color: #fff; font-size: 28px; line-height: 1.45; max-width: 18ch; }
.auth-art p { color: var(--plum-muted); max-width: 40ch; margin: 10px 0 0; }
/* three tags on one thread spell out the deal: our base price, your price, your profit */
.tag-stack { position: relative; display: grid; gap: 20px; justify-items: start; padding-top: 4px; }
.tag-stack > .htag:not(.htag-lg) { min-height: 56px; padding-inline-end: 18px; }
.tag-stack > .htag:not(.htag-lg) .t { font-size: 13px; }
.tag-stack > .htag:not(.htag-lg) .v { font-size: 21px; }
.tag-stack > .htag-lg { min-height: 88px; padding-inline-end: 26px; }
.tag-stack > .htag-lg .t { font-size: 14px; }
.tag-stack > .htag-lg .v { font-size: 36px; }
.tag-stack::before { /* the thread, running through every eyelet */
  content: ""; position: absolute; top: -56px; bottom: 38px; inset-inline-start: 16.75px; width: 1.5px;
  background: linear-gradient(to bottom, transparent, rgba(234, 227, 243, .55) 48px); border-radius: 2px;
}
.tag-stack > .htag { transform-origin: 17.5px 50%; }
[dir="rtl"] .tag-stack > .htag { transform-origin: calc(100% - 17.5px) 50%; }
.tag-stack > .htag:nth-child(1) { transform: rotate(-2deg); }
.tag-stack > .htag:nth-child(2) { transform: rotate(1.5deg); }
.tag-stack > .htag-lg { transform: rotate(-3deg); }
.tag-stack .htag { --eye-at: 14px; }
.tag-stack .htag-lg { --eye-at: 12.5px; }
.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; }
.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: 12px 16px; }
.pub-head .brand { color: var(--ink); padding: 0; }
.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; } }
.wrap-pub { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.hero { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); padding: 40px 0 28px; align-items: center; }
@media (min-width: 1000px) { .hero { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); padding: 72px 0 56px; gap: 48px; } }
.hero h1 { font-size: 34px; line-height: 1.35; font-weight: 700; max-width: 16ch; }
@media (min-width: 760px) { .hero h1 { font-size: 48px; } }
.hero .lead { margin: 16px 0 24px; max-width: 46ch; }
.hero-stage { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
/* desktop: the two sample products stand in a night-plum "shop window", echoing the app frame */
@media (min-width: 1000px) {
  .hero-stage { gap: 18px; padding: 40px 36px 64px; background: var(--plum); border-radius: 28px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--plum-ink) 10%, transparent); }
  .hero-stage .pcard { border-color: transparent; box-shadow: 0 18px 40px rgba(0, 0, 0, .28); }
  .hero-stage .pcard:nth-child(2) { transform: translateY(32px); }
}
.hero-note { display: flex; align-items: center; gap: 8px; margin-top: 18px; font-size: 13.5px; color: var(--muted); }
.hero-note .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--money); flex: none; }
.facts { display: grid; gap: 0; grid-template-columns: minmax(0, 1fr); border-top: 1px solid var(--line); }
@media (min-width: 760px) { .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.fact { padding: 22px 0; border-bottom: 1px solid var(--line); }
@media (min-width: 760px) { .fact { padding: 26px 24px 26px 0; border-bottom: 0; border-inline-start: 1px solid var(--line); padding-inline-start: 24px; } .fact:first-child { border-inline-start: 0; padding-inline-start: 0; } }
.fact h3 { font-size: 17px; margin-bottom: 6px; }
.fact p { color: var(--muted); margin: 0; font-size: 14.5px; }
.pub-section { padding-block: 48px; }
@media (min-width: 1000px) { .pub-section { padding-block: 64px; } }
.pub-section > h2 { font-size: 26px; margin-bottom: 8px; }
.pub-section > .lead { max-width: 60ch; margin-bottom: 20px; }
.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: var(--plum); color: var(--plum-muted); padding: 36px 0 28px; margin-top: 40px; font-size: 14px; }
.pub-foot a { color: var(--plum-ink); }
.pub-foot .brand { color: #fff; padding: 0; }
.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; }
@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(--money); }
.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; }
.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; }
.tile .ic { width: 36px; height: 36px; border-radius: 11px; background: var(--surface); 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(--ink); 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(--ink-2); }
.tile .tip { color: var(--ink-2); }
.tile.t-orders { background: var(--tile-orders); } .tile.t-orders .ic { color: var(--tile-orders-ink); }
.tile.t-rates { background: var(--tile-rates); } .tile.t-rates .ic { color: var(--tile-rates-ink); }
.tile.t-money { background: var(--tile-money); } .tile.t-money .ic { 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 .money-card { grid-column: 1 / -1; } }
@media (min-width: 1280px) { .home-row { grid-template-columns: 5fr 4fr 3fr; } .home-row .money-card { grid-column: auto; } }
.money-card .card-h { margin-bottom: 6px; }
.money-card .lbl { font-size: 13px; color: var(--muted); }
.money-card .big { font-family: var(--f-display); font-size: 34px; font-weight: 600; color: var(--money-ink); line-height: 1.25; font-variant-numeric: tabular-nums; white-space: nowrap; }
.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; }
.money-card .note { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); text-align: center; }
.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; transition: border-color .15s ease; }
.ocard:hover { text-decoration: none; border-color: var(--line-strong); }
.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-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); }
.ocard-ft { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); 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: none; }
.pcard:hover { box-shadow: none; border-color: var(--line-strong); }
.pcard-media { border-radius: 0; aspect-ratio: 4 / 5; }
.pcard-media img { border-radius: 0; }
.pcard-media .ph { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.pcard-flags .pill { box-shadow: none; }
.pill-new { background: var(--accent); color: var(--on-accent); }
.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; gap: 6px; margin-top: auto; padding-top: 6px; }
.pcard-acts .btn-primary { flex: 1; }
@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(--warn-tint); border: 1px solid color-mix(in srgb, var(--warn) 25%, var(--line)); }
.media-card .mi { width: 40px; height: 40px; border-radius: 11px; background: var(--surface); color: var(--warn); 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(--warn-ink); }
.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; }
.ladder button.is-suggested { background: var(--money-tint); border-color: color-mix(in srgb, var(--money) 30%, var(--line)); }
.ladder button.is-suggested .k { color: var(--money-ink); }
.ladder button.is-suggested .v { color: var(--money-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); }
/* sign-in art: the profit equation as the same tinted rows the product cards use */
.auth-demo { display: grid; gap: 8px; width: min(320px, 100%); padding: 16px; border-radius: var(--r-lg); background: #FFFFFF; color: #3B4552; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); }
.auth-demo .ad-cap { font-size: 12.5px; color: #616C7B; }
.auth-demo .prow { min-height: 42px; font-size: 13.5px; background: #F1F3F6; color: #3B4552; }
.auth-demo .prow b { font-size: 18px; color: #18212D; }
.auth-demo .prow.is-profit { background: #EAF7F0; color: #0B5E40; }
.auth-demo .prow.is-profit b { color: #086747; font-size: 22px; }
/* 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; }
  .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: green money 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 .money-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; }
  .money-card { background: var(--money-solid); border-color: var(--money-solid); color: var(--on-money); }
  .money-card .card-h h2, .money-card .card-h a, .money-card .lbl, .money-card .big, .money-card .stages .k, .money-card .stages b, .money-card .note { color: var(--on-money); }
  .money-card .lbl, .money-card .stages .k, .money-card .note { opacity: .88; }
  .money-card .stagebar { background: color-mix(in srgb, var(--on-money) 14%, transparent); }
  .money-card .stagebar .s-av { background: var(--on-money); }
  .money-card .stagebar .s-pay { background: color-mix(in srgb, var(--on-money) 60%, transparent); }
  .money-card .stagebar .s-hold { background: color-mix(in srgb, var(--on-money) 35%, transparent); }
  .money-card .stagebar .s-exp { background: color-mix(in srgb, var(--on-money) 18%, transparent); }
  .money-card .btn-money { background: var(--surface); border-color: var(--surface); color: var(--money-ink); }
}
/* 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; }
  .help-btn { position: relative; }
  .help-btn::after { content: ""; position: absolute; inset: -4px 0; }
}

/* ==========================================================================
   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; }
  .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; }
