/* E-REP — design D «Route» (2026-11-10): BayanIQ blue to navy, amber for the day's action, Readex Pro on screen; Plex stays for printed slips (print.js / pages.js). */
@font-face { font-family: Readex; font-weight: 400; font-display: swap; src: url(../fonts/readex-ar-400.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: Readex; font-weight: 500; font-display: swap; src: url(../fonts/readex-ar-500.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: Readex; font-weight: 700; font-display: swap; src: url(../fonts/readex-ar-700.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: Readex; font-weight: 400; font-display: swap; src: url(../fonts/readex-la-400.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2116; }
@font-face { font-family: Readex; font-weight: 500; font-display: swap; src: url(../fonts/readex-la-500.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2116; }
@font-face { font-family: Readex; font-weight: 700; font-display: swap; src: url(../fonts/readex-la-700.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2116; }
@font-face { font-family: Plex; font-weight: 400; font-display: swap; src: url(../fonts/plex-ar-400.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: Plex; font-weight: 500; font-display: swap; src: url(../fonts/plex-ar-500.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: Plex; font-weight: 600; font-display: swap; src: url(../fonts/plex-ar-600.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: Plex; font-weight: 700; font-display: swap; src: url(../fonts/plex-ar-700.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: Plex; font-weight: 400; font-display: swap; src: url(../fonts/plex-la-400.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: Plex; font-weight: 500; font-display: swap; src: url(../fonts/plex-la-500.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: Plex; font-weight: 600; font-display: swap; src: url(../fonts/plex-la-600.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: Plex; font-weight: 700; font-display: swap; src: url(../fonts/plex-la-700.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; }

:root {
  /* light — cool blue-grey neutrals */
  --bg: #F2F3F7; --surface: #FFFFFF; --ink: #0F1B33; --muted: #5C6779; --faint: #8A93A5; --line: #E3E6EE;
  --tab-ink: #5F6878;   /* tab-bar labels: 12px text needs 4.5:1 on the surface (--faint is 3.1:1) */
  --hero: #0B2E63; --hero-ink: #FFFFFF;
  /* amber: the one colour for «do it» (main shortcut, centre tab, basket); dark text on it */
  --act: #FFB020; --act-ink: #2B1A00; --act-wash: #FFF2D6;
  --ok: #1F7A45; --ok-wash: #E3F3EA; --warn: #A15C00; --warn-wash: #FCEFD9; --danger: #C23A2B; --danger-wash: #FCE6E2;
  --shadow: 0 1px 2px rgba(15, 27, 51, .05), 0 10px 26px rgba(15, 27, 51, .08);
  /* accent — E-REP blue (default) */
  --brand: #12408A; --brand-deep: #0B2E63; --brand-2: #2E6BC6; --brand-wash: #E8EEF8; --brand-rgb: 18, 64, 138; --brand-ink: #12408A;
  --r: 12px; --r-tile: 22px; --tap: 52px; --tabbar: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --gut-l: max(16px, env(safe-area-inset-left, 0px)); --gut-r: max(16px, env(safe-area-inset-right, 0px));
  color-scheme: light;
}
:root[data-accent="teal"]     { --brand: #0B6F74; --brand-deep: #064A4E; --brand-2: #14A39D; --brand-wash: #E1F2F0; --brand-rgb: 11, 111, 116;  --brand-ink: #0B6F74; }
:root[data-accent="green"]    { --brand: #1F6B3A; --brand-deep: #124526; --brand-2: #34A35A; --brand-wash: #E3F2E8; --brand-rgb: 31, 107, 58;   --brand-ink: #1F6B3A; }
:root[data-accent="violet"]   { --brand: #4B3BC0; --brand-deep: #2E2385; --brand-2: #7466F0; --brand-wash: #EDEBFD; --brand-rgb: 75, 59, 192;   --brand-ink: #4B3BC0; }
:root[data-accent="amber"]    { --brand: #9C4A06; --brand-deep: #6B3203; --brand-2: #E08A2E; --brand-wash: #FCEBD9; --brand-rgb: 156, 74, 6;    --brand-ink: #9C4A06; }
:root[data-accent="graphite"] { --brand: #2B3448; --brand-deep: #161C29; --brand-2: #5C6B8A; --brand-wash: #E8EBF1; --brand-rgb: 43, 52, 72;    --brand-ink: #2B3448; }
/* dark — deep navy, accents lifted for contrast */
:root[data-scheme="dark"] {
  --bg: #0A1020; --surface: #131B2E; --ink: #E7ECF7; --muted: #9AA6C0; --faint: #6B7792; --line: #24304A; --tab-ink: #8E9AB3;
  --hero: #1C2741; --ok: #5FCB8A; --ok-wash: #14341F; --warn: #F2AE57; --warn-wash: #3B2A10; --danger: #F27A69; --danger-wash: #43201B;
  --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 10px 26px rgba(0, 0, 0, .35); color-scheme: dark;
  --brand-wash: rgba(var(--brand-rgb), .24); --brand-2: color-mix(in srgb, var(--brand) 50%, white); --brand-ink: color-mix(in srgb, var(--brand) 42%, white);
}
@media (prefers-color-scheme: dark) {
  :root[data-scheme="auto"] {
    --bg: #0A1020; --surface: #131B2E; --ink: #E7ECF7; --muted: #9AA6C0; --faint: #6B7792; --line: #24304A; --tab-ink: #8E9AB3;
    --hero: #1C2741; --ok: #5FCB8A; --ok-wash: #14341F; --warn: #F2AE57; --warn-wash: #3B2A10; --danger: #F27A69; --danger-wash: #43201B;
    --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 10px 26px rgba(0, 0, 0, .35); color-scheme: dark;
    --brand-wash: rgba(var(--brand-rgb), .24); --brand-2: color-mix(in srgb, var(--brand) 50%, white); --brand-ink: color-mix(in srgb, var(--brand) 42%, white);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
/* no pull-to-refresh: in a browser tab a pull at the top of a list reloaded the app and lost what was on screen */
html, body { overscroll-behavior-y: none; }
/* in a browser (Safari / Chrome, not the Android shell): no double-tap zoom, taps land at once, inputs never below 16px (iOS zooms into smaller ones) */
html, body, button, a, label, input, select, textarea, .row, .lcard, .tile, .chip { touch-action: manipulation; }
input, select, textarea { font-size: max(16px, 1em); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 41; background: var(--brand-deep); }
body { font-family: Readex, Plex, system-ui, sans-serif; font-size: 16.5px; line-height: 1.5; background: var(--bg); color: var(--ink); }
/* Kurdish (Sorani): ە ێ ۆ ڕ ڵ ی ک گ چ پ ژ are in Plex, not in Readex's Arabic subset — a word set in two fonts breaks
   apart, so Kurdish text is set in Plex (the whole app in Kurdish, and the «کوردی» buttons elsewhere) */
:root[lang="ckb"] body, button[lang="ckb"] { font-family: Plex, Readex, system-ui, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
/* a dropdown's list (on a computer) is drawn from the options' own colours: never white names on a white list */
select option, select optgroup { color: var(--ink); background-color: var(--surface); }
.num, .money { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
:focus-visible { outline: 3px solid var(--brand-2); outline-offset: 2px; }
/* reduced motion: every animation at its end state at once (1.23.0 — «none» left the saved tick undrawn), no transitions */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: 0s !important; transition-delay: 0s !important; } }
#app { min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- header bar (every inner screen) ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40;
  display: flex; align-items: center; gap: 4px; min-height: 60px;
  padding-block: 6px; padding-left: max(8px, env(safe-area-inset-left, 0px)); padding-right: max(8px, env(safe-area-inset-right, 0px));
  background: linear-gradient(120deg, var(--brand-deep), var(--brand)); color: #fff; box-shadow: 0 4px 16px rgba(var(--brand-rgb), .28);
}
.topbar h1 { flex: 1; margin: 0; text-align: center; font-size: 19px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .sub { display: block; font-size: 13px; font-weight: 400; opacity: .85; }
.topbar .spacer { width: 44px; }
.iconbtn { width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; display: grid; place-items: center; cursor: pointer; color: inherit; flex-shrink: 0; }
.iconbtn:active { background: rgba(255, 255, 255, .15); }
.iconbtn svg { width: 24px; height: 24px; }

main.screen { flex: 1; padding-top: 16px; padding-bottom: calc(var(--tabbar) + 28px + var(--safe-b)); padding-left: var(--gut-l); padding-right: var(--gut-r); }
main.screen.no-tabs { padding-bottom: calc(120px + var(--safe-b)); }
@media (min-width: 720px) { main.screen { max-width: 720px; margin: 0 auto; width: 100%; } }

/* ---------- tab pages: soft backdrop, logo, tiles ---------- */
/* soft brand light behind tab pages */
.backdrop { position: fixed; inset: 0; z-index: -1; background:
  radial-gradient(60% 40% at 15% 10%, rgba(var(--brand-rgb), .14), transparent 70%),
  radial-gradient(55% 45% at 90% 35%, rgba(var(--brand-rgb), .12), transparent 70%),
  var(--bg); }
.homehead { display: flex; align-items: center; justify-content: space-between; padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
.homehead .iconbtn { color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
.brandmark { display: flex; justify-content: center; margin: 4px 0 18px; }
.brandmark svg { height: 120px; width: auto; max-width: 80%; }

.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  aspect-ratio: 1 / .92; padding: 14px 10px; border: 1px solid var(--line); border-radius: var(--r-tile);
  background: var(--surface); box-shadow: var(--shadow); cursor: pointer; text-decoration: none; color: var(--ink);
  font-size: 15px; font-weight: 600; text-align: center; line-height: 1.35;
}
.tile:active { transform: scale(.98); }
.tile .ic { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; background: var(--brand-wash); color: var(--brand-ink); }
.tile .ic svg { width: 30px; height: 30px; }
.tile small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.tile.alert { background: linear-gradient(160deg, #E0624E, #C2412D); border-color: transparent; color: #fff; }
.tile.alert .ic { background: rgba(255, 255, 255, .2); color: #fff; }
.tile.alert small { color: rgba(255, 255, 255, .85); }
.tile:disabled { opacity: .45; }


/* bottom navigation (design B): four labelled tabs and the main action raised in amber in the middle */
.tabbar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 30;
  height: calc(var(--tabbar) + var(--safe-b)); padding-bottom: var(--safe-b);
  padding-left: var(--gut-l); padding-right: var(--gut-r);
  display: grid; grid-template-columns: 1fr 1fr 1.15fr 1fr 1fr;
  background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -4px 20px rgba(11, 46, 99, .07);
}
.tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; color: var(--tab-ink); font-size: 12px; font-weight: 700; }
.tabbar a svg { width: 25px; height: 25px; }
.tabbar a[aria-current="page"] { color: var(--brand-ink); }
.tabbar a.centre { color: var(--ink); }
.tabbar a.centre .bub { display: grid; place-items: center; width: 58px; height: 58px; margin-top: -30px; border-radius: 50%; background: var(--act); color: var(--act-ink); box-shadow: 0 8px 18px rgba(255, 176, 32, .45), 0 0 0 5px var(--surface); }
.tabbar a.centre .bub svg { width: 28px; height: 28px; }
.tabbar a.centre:active .bub { transform: scale(.94); }
.tabbar .badge { position: absolute; top: 4px; inset-inline-start: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }

/* ---------- lists ---------- */
.searchbar {
  position: sticky; top: calc(60px + env(safe-area-inset-top, 0px)); z-index: 20;
  display: flex; align-items: center; gap: 8px; margin: -16px calc(-1 * var(--gut-r)) 8px calc(-1 * var(--gut-l));
  padding: 8px var(--gut-r) 8px var(--gut-l); background: var(--surface); border-bottom: 1px solid var(--line);
}
.searchbar input { flex: 1; min-width: 0; height: 46px; border: 0; border-bottom: 2px solid var(--line); background: transparent; font-size: 16px; padding: 0 4px; }
.searchbar input:focus { outline: 0; border-bottom-color: var(--brand-2); }
.searchbar svg { width: 22px; height: 22px; color: var(--faint); }
.searchbar .iconbtn { color: var(--ink); }

.list { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 10px 16px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; background: none; width: 100%; text-align: start; border-inline: 0; border-top: 0; }
.row:last-child { border-bottom: 0; }
button.row, a.row { cursor: pointer; }
button.row:active, a.row:active { background: var(--brand-wash); }
.row .main { flex: 1; min-width: 0; }
.row .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .meta { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .end { text-align: end; flex-shrink: 0; }
/* an icon at the row's end (settings: printer, companies) — it had no size and filled the row in the Android app */
.row > svg { width: 22px; height: 22px; flex: none; color: var(--muted); }
.group-title { font-size: 14px; font-weight: 600; color: var(--muted); margin: 18px 4px 8px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.chip { flex-shrink: 0; min-height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 500; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }

.tag { display: inline-block; padding: 1px 9px; border-radius: 10px; font-size: 12px; font-weight: 600; line-height: 20px; }
.tag.ok { background: var(--ok-wash); color: var(--ok); }
.tag.wait { background: var(--warn-wash); color: var(--warn); }
.tag.err { background: var(--danger-wash); color: var(--danger); }
.tag.info { background: var(--brand-wash); color: var(--brand-ink); }
.money { font-weight: 600; }
.neg { color: var(--danger); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }


/* ---------- forms (report filters, receipt) ---------- */
.form { display: grid; gap: 18px; min-width: 0; }
.form > * { min-width: 0; }
.uline { display: block; }
.uline > span { display: block; font-size: 14px; font-weight: 600; color: var(--muted); }
.uline input { width: 100%; height: 48px; border: 0; border-bottom: 1.5px solid var(--faint); background: transparent; font-size: 19px; font-weight: 600; padding: 0 2px; }
.uline input:focus { outline: 0; border-bottom-color: var(--brand-2); }
.outlined { position: relative; display: block; }
.outlined > span { position: absolute; top: -10px; inset-inline-start: 18px; padding: 0 6px; background: var(--bg); font-size: 13px; font-weight: 600; color: var(--muted); }
.outlined select, .outlined input { width: 100%; max-width: 100%; min-width: 0; text-overflow: ellipsis; height: 58px; border: 1.5px solid var(--brand-2); border-radius: 18px; background: var(--surface); padding: 0 18px; font-size: 16px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; font-weight: 500; }
.switch input { appearance: none; width: 46px; height: 26px; border-radius: 13px; background: var(--line); position: relative; cursor: pointer; transition: background .15s; flex-shrink: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; inset-inline-end: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: inset-inline-end .15s; }
.switch input:checked { background: var(--brand-2); }
.switch input:checked::after { inset-inline-end: 23px; }
.pill { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 30px; border-radius: 24px; border: 0; background: linear-gradient(135deg, var(--brand), var(--brand-deep)); color: #fff; font-weight: 700; font-size: 16px; cursor: pointer; text-decoration: none; box-shadow: 0 4px 12px rgba(var(--brand-rgb), .25); }
.pill.ghost { background: var(--surface); color: var(--brand-ink); box-shadow: none; border: 1.5px solid var(--brand-2); }
.pill.danger { background: var(--surface); color: var(--danger); box-shadow: none; border: 1.5px solid var(--danger); }
.pill:disabled { opacity: .45; cursor: default; }
.pill svg { width: 20px; height: 20px; }
.center { display: flex; justify-content: center; }
.input { width: 100%; min-height: 50px; padding: 10px 14px; border: 1.5px solid var(--faint); border-radius: var(--r); background: var(--surface); font-size: 17px; }
.input:focus { border-color: var(--brand-2); outline: 0; }
.input.ltr { direction: ltr; text-align: right; }
textarea.input { min-height: 84px; resize: vertical; }

/* ---------- invoice ---------- */
.docbar { position: sticky; top: calc(60px + env(safe-area-inset-top, 0px)); z-index: 20; margin: -16px calc(-1 * var(--gut-r)) 0 calc(-1 * var(--gut-l)); padding: 12px var(--gut-r) 6px var(--gut-l); background: var(--surface); border-bottom: 1px solid var(--line); }
.docbar .cust { margin: 0; text-align: center; font-size: 22px; font-weight: 700; color: var(--brand-ink); line-height: 1.3; }
.docbar .chips { justify-content: center; padding: 10px 0 4px; }
.cols { display: grid; grid-template-columns: 1fr 1.1fr 1.2fr .9fr; gap: 6px; padding: 10px 14px 6px; font-size: 13px; font-weight: 700; color: var(--brand-ink); text-align: center; }
.cols > :first-child, .lcard .vals > :first-child { text-align: start; }
.lcard { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 10px 14px; margin-bottom: 8px; cursor: pointer; border: 1px solid transparent; width: 100%; text-align: start; }
.lcard:active { border-color: var(--brand-2); }
.lcard .name { font-weight: 600; }
.lcard .vals { display: grid; grid-template-columns: 1fr 1.1fr 1.2fr .9fr; gap: 6px; margin-top: 4px; text-align: center; font-variant-numeric: tabular-nums; }
.lcard .bonus { color: var(--ok); font-weight: 700; }
.lcard .req { font-size: 13px; color: var(--warn); margin-top: 4px; }
.lcard .req.dis { color: var(--brand); }
.docfoot {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 30; padding: 12px var(--gut-r) calc(12px + var(--safe-b)) var(--gut-l);
  background: var(--surface); border-radius: 22px 22px 0 0; box-shadow: 0 -4px 20px rgba(18, 41, 46, .1);
  display: flex; align-items: center; gap: 10px;
}
.docfoot .sum { flex: 1; min-width: 0; }
.docfoot .sum small { display: block; color: var(--muted); font-size: 13px; }
.docfoot .sum b { font-size: 22px; }
.docfoot .pill { padding: 0 18px; }

/* item picker: the line being edited stays on top */
.items { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.round { width: 52px; height: 52px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--brand); color: #fff; cursor: pointer; flex-shrink: 0; box-shadow: 0 4px 12px rgba(var(--brand-rgb), .3); }
.round.light { background: var(--brand-wash); color: var(--brand-ink); box-shadow: none; }
.round svg { width: 24px; height: 24px; }

/* ---------- cards, sheets, toasts ---------- */
.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; }
.card + .card, .card + .list, .list + .card { margin-top: 12px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: end; }
.custhead { text-align: center; }
.custhead h2 { margin: 0 0 4px; font-size: 21px; color: var(--brand-ink); line-height: 1.35; }
.custhead .bal { margin-top: 10px; font-size: 14px; color: var(--muted); }
.custhead .bal b { display: block; font-size: 28px; color: var(--ink); }
.minitiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.minitiles button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 2px; border: 0; border-radius: 16px; background: var(--brand-wash); color: var(--brand-ink); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.minitiles button svg { width: 26px; height: 26px; }
.minitiles button.alert { background: var(--danger); color: #fff; }
.minitiles button:disabled { opacity: .4; }

.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(6, 12, 28, .5); display: flex; align-items: flex-end; animation: fadein .2s ease-out; backdrop-filter: blur(2px); }
.sheet { width: 100%; max-height: 92vh; overflow: auto; background: var(--surface); border-radius: 22px 22px 0 0; padding: 8px var(--gut-r) calc(16px + var(--safe-b)) var(--gut-l); animation: sheetup .42s cubic-bezier(.16, 1, .3, 1); }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 12px; }
.sheet h3 { margin: 0 0 12px; font-size: 18px; text-align: center; }
@keyframes up { from { transform: translateY(30px); opacity: .6; } }
.toast { position: fixed; inset-inline: 16px; top: calc(70px + env(safe-area-inset-top, 0px)); z-index: 70; background: var(--hero); color: var(--hero-ink); padding: 12px 16px; border-radius: var(--r); font-weight: 500; box-shadow: var(--shadow); animation: toastin .34s cubic-bezier(.16, 1, .3, 1); }
.toast.err { background: var(--danger); }
.toast.act { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 6px; padding-inline-end: 6px; }
.toast.act > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast.act button { flex-shrink: 0; min-height: 40px; padding: 0 16px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, .16); color: #FFB020; font: inherit; font-weight: 700; cursor: pointer; }
.netstrip { font-size: 13px; padding: 6px 16px; text-align: center; }
.netstrip.offline { background: var(--warn-wash); color: var(--warn); }
.netstrip.sending { background: var(--brand-wash); color: var(--brand-ink); }

/* login */
.login { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding-block: 24px; padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); max-width: 440px; margin: 0 auto; }
.login .brandmark svg { height: 190px; }
.login .form { margin-top: 8px; }
.pin { letter-spacing: 8px; text-align: center; }
.err-text { color: var(--danger); font-size: 14px; margin: 0; min-height: 21px; text-align: center; }
.login-forgot { margin-top: 10px; background: none; border: 0; padding: 8px 12px; min-height: 44px; color: var(--brand, var(--accent)); font: inherit; font-size: 14px; cursor: pointer; }
.login-forgot:disabled { opacity: .6; }
.login-note { margin: 4px 0 10px; padding: 10px 12px; border-radius: 12px; background: var(--bg); color: var(--ink, inherit); font-size: 14px; line-height: 1.6; text-align: start; }

.map { height: calc(100vh - 200px); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }

/* ---------- home layout: brand row, visit banner, main action, quick grid, today ---------- */
.toprow { display: flex; align-items: center; gap: 10px; padding-top: calc(12px + env(safe-area-inset-top, 0px)); margin-bottom: 14px; }
.toprow .logo-sm { width: 46px; height: 46px; flex-shrink: 0; filter: drop-shadow(0 4px 10px rgba(18, 54, 168, .28)); }
.toprow .who { flex: 1; min-width: 0; }
.toprow .who b { display: block; font-size: 17px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toprow .who span { font-size: 13px; color: var(--muted); }
.toprow .iconbtn { color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }

.visitban { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px; margin-bottom: 14px; }
.visitban.on { background: var(--hero); color: var(--hero-ink); }
.visitban.off { background: var(--surface); border: 1.5px dashed var(--faint); color: var(--ink); cursor: pointer; width: 100%; text-align: start; font: inherit; }
.visitban .ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0; }
.visitban.on .ic { background: rgba(255, 255, 255, .14); }
.visitban.off .ic { background: var(--brand-wash); color: var(--brand-ink); }
.visitban .ic svg { width: 24px; height: 24px; }
.visitban .main { flex: 1; min-width: 0; }
.visitban .main b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.visitban .main span { font-size: 13px; opacity: .8; }
.visitban .end { min-height: 42px; padding: 0 18px; border-radius: 21px; border: 0; background: var(--danger); color: #fff; font-weight: 700; cursor: pointer; }
.visitban .timer { font-variant-numeric: tabular-nums; }

.mainaction { display: flex; align-items: center; gap: 16px; width: 100%; min-height: 92px; padding: 16px 20px; border: 0; border-radius: 22px;
  background: linear-gradient(125deg, var(--brand-deep), var(--brand) 55%, color-mix(in srgb, var(--brand) 70%, var(--brand-2))); color: #fff; box-shadow: 0 10px 24px rgba(var(--brand-rgb), .3); cursor: pointer; text-align: start; font: inherit; }
.mainaction .ic { width: 56px; height: 56px; border-radius: 18px; background: rgba(255, 255, 255, .16); display: grid; place-items: center; flex-shrink: 0; }
.mainaction .ic svg { width: 30px; height: 30px; }
.mainaction b { display: block; font-size: 20px; }
.mainaction span { font-size: 13px; opacity: .85; }
.mainaction .go { margin-inline-start: auto; opacity: .7; transform: scaleX(-1); }

.quick3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.quick3 button { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 6px; border: 1px solid var(--line); border-radius: 18px;
  background: var(--surface); box-shadow: var(--shadow); cursor: pointer; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.3; text-align: center; }
.quick3 button .ic { width: 46px; height: 46px; border-radius: 14px; background: var(--brand-wash); color: var(--brand-ink); display: grid; place-items: center; }
.quick3 button .ic svg { width: 24px; height: 24px; }
.quick3 button .n { min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--warn); color: #fff; font-size: 11px; line-height: 20px; }


/* menu lists on بطاقات / كشوفات */
.pagetitle { padding-top: calc(16px + env(safe-area-inset-top, 0px)); margin: 0 0 14px; font-size: 24px; font-weight: 700; }
.menu { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.menu + .menu { margin-top: 14px; }
.menu button { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 72px; padding: 12px 16px; border: 0; border-bottom: 1px solid var(--line); background: none; cursor: pointer; text-align: start; font: inherit; color: var(--ink); }
.menu button:last-child { border-bottom: 0; }
.menu button:active { background: var(--brand-wash); }
.menu .ic { width: 46px; height: 46px; border-radius: 14px; background: var(--brand-wash); color: var(--brand-ink); display: grid; place-items: center; flex-shrink: 0; }
.menu .ic svg { width: 24px; height: 24px; }
.menu .t { flex: 1; min-width: 0; }
.menu .t b { display: block; font-size: 16px; }
.menu .t span { font-size: 13px; color: var(--muted); }
.menu .chev { color: var(--faint); transform: scaleX(-1); }
.menu .chev svg { width: 20px; height: 20px; }

/* theme picker */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--bg); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { min-height: 42px; border: 0; border-radius: 10px; background: none; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* home status strip */
.strip { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 16px; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.strip > * { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 72px; padding: 8px 4px; border: 0; background: none; font: inherit; color: var(--ink); text-decoration: none; cursor: pointer; }
.strip > * + * { border-inline-start: 1px solid var(--line); }
.strip b { font-size: 20px; font-variant-numeric: tabular-nums; }
.strip b.small { font-size: 14px; }
.strip b.warn { color: var(--warn); }
.strip small { font-size: 12.5px; color: var(--muted); }
.menu .ic.err { background: var(--danger-wash); color: var(--danger); }


/* =====================================================================
   Motion: page transitions, entering lists, press feedback, pops
   ===================================================================== */
@keyframes fadein { from { opacity: 0; } }
@keyframes sheetup { from { transform: translateY(100%); } }
@keyframes toastin { from { transform: translateY(-16px) scale(.96); opacity: 0; } }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.12); } 100% { transform: scale(1); opacity: 1; } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes slide-in-l { from { transform: translateX(-28%); opacity: 0; } }
@keyframes slide-in-r { from { transform: translateX(28%); opacity: 0; } }
@keyframes slide-out-l { to { transform: translateX(-18%); opacity: 0; } }
@keyframes slide-out-r { to { transform: translateX(18%); opacity: 0; } }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.enter { animation: rise .42s cubic-bezier(.2,.8,.25,1) both; }
.pop { animation: pop .36s cubic-bezier(.16, 1, .3, 1) both; }
button, .pcard, .crow, .oitem, .cat { transition: transform .12s ease, box-shadow .2s ease, background-color .2s ease; }
button:active:not(:disabled), .crow:active, .oitem:active { transform: scale(.965); }

/* RTL: going forward slides in from the left, back from the right */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .28s; animation-timing-function: cubic-bezier(.3,.7,.2,1); }
html[data-nav="fwd"]::view-transition-old(root) { animation-name: slide-out-r; }
html[data-nav="fwd"]::view-transition-new(root) { animation-name: slide-in-l; }
html[data-nav="back"]::view-transition-old(root) { animation-name: slide-out-l; }
html[data-nav="back"]::view-transition-new(root) { animation-name: slide-in-r; }
html[data-nav="tab"]::view-transition-old(root) { animation: .16s ease-out both fadeout; }
html[data-nav="tab"]::view-transition-new(root) { animation: .22s ease-out both fadein; }
@keyframes fadeout { to { opacity: 0; } }
.tabbar { view-transition-name: tabbar; }
.topbar { view-transition-name: topbar; }
::view-transition-old(tabbar), ::view-transition-new(tabbar), ::view-transition-old(topbar), ::view-transition-new(topbar) { animation: none; }

/* saved! */
.success { position: fixed; inset: 0; z-index: 95; display: grid; place-content: center; justify-items: center; gap: 6px; text-align: center;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(6px); animation: fadein .2s ease-out; }
.success.out { opacity: 0; transition: opacity .25s; }
.success .tick svg { width: 96px; height: 96px; }
.success .tick circle { fill: var(--ok); stroke: none; transform-origin: center; animation: pop .45s cubic-bezier(.16, 1, .3, 1) both; }
.success .tick path { fill: none; stroke: #fff; stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .4s .3s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.success b { font-size: 20px; margin-top: 10px; animation: rise .4s .35s both; }
.success span { color: var(--muted); animation: rise .4s .45s both; }

/* ---------- pictures ---------- */
.pic { position: relative; display: grid; place-items: center; overflow: hidden; background: #fff; }
.pic img { width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .35s ease, transform .35s ease; transform: scale(1.02); }
.pic.ready img { opacity: 1; transform: none; }
.pic.loading { background: linear-gradient(90deg, #f1f4f9 25%, #e3e9f3 37%, #f1f4f9 63%) 0 0 / 400% 100%; animation: shimmer 1.3s linear infinite; }
:root[data-scheme="dark"] .pic.loading { background: linear-gradient(90deg, #1b2438 25%, #24304a 37%, #1b2438 63%) 0 0 / 400% 100%; }
.pic.none { background: linear-gradient(140deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, 0) 65%), var(--tint, var(--brand)); color: #fff; }
.pic.none span { font-size: 26px; font-weight: 700; letter-spacing: 1px; opacity: .92; direction: ltr; }

/* ---------- catalog (new invoicing) ---------- */
.cathead { gap: 2px; }
.cathead .ttl { flex: 1; min-width: 0; text-align: center; display: grid; justify-items: center; gap: 4px; }
.cathead .ttl b { max-width: 100%; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cathead .ttl small { font-size: 13px; opacity: .85; }
.cathead .seg { display: inline-flex; padding: 3px; border-radius: 14px; background: rgba(255, 255, 255, .16); }
.cathead .seg button { border: 0; background: none; color: #fff; font-size: 13px; font-weight: 600; padding: 4px 12px; border-radius: 11px; cursor: pointer; opacity: .82; }
.cathead .seg button[aria-pressed="true"] { background: #fff; color: var(--brand-deep); opacity: 1; box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
main.catalog { padding-top: 0; padding-bottom: calc(120px + var(--safe-b)); }
.catbar { position: sticky; top: calc(64px + env(safe-area-inset-top, 0px)); z-index: 20; margin: 0 calc(-1 * var(--gut-r)) 10px calc(-1 * var(--gut-l));
  padding: 8px var(--gut-r) 0 var(--gut-l); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); }
.catbar .searchbar { margin-bottom: 4px; }
.rail { display: flex; gap: 10px; overflow-x: auto; padding: 6px 2px 12px; scrollbar-width: none; scroll-snap-type: x proximity; }
.rail::-webkit-scrollbar { display: none; }
.cat { flex-shrink: 0; scroll-snap-align: center; display: grid; justify-items: center; gap: 5px; width: 74px; border: 0; background: none; cursor: pointer; padding: 0; color: var(--muted); font-size: 12px; font-weight: 600; }
.cat > span:last-child { max-width: 78px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; text-align: center; overflow-wrap: anywhere; }
.cat .cic, .cat .pic.logo { width: 58px; height: 58px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; color: var(--brand-ink); position: relative; border: 2px solid transparent; }
.cat .pic.logo { padding: 6px; }
.cat .cic svg { width: 26px; height: 26px; }
.cat .cic.hot { background: linear-gradient(140deg, #FFB547, #F06A2A); color: #fff; }
.cat .n { position: absolute; top: -6px; inset-inline-end: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--brand); color: #fff; font-size: 11px; line-height: 20px; }
.cat[aria-pressed="true"] { color: var(--brand-ink); }
.cat[aria-pressed="true"] .cic, .cat[aria-pressed="true"] .pic.logo { border-color: var(--brand-2); box-shadow: 0 6px 18px rgba(var(--brand-rgb), .28); transform: translateY(-2px); }

.pgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 560px) { .pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pgrid > .empty, .pgrid > .more { grid-column: 1 / -1; }
.pgrid > .more { display: flex; justify-content: center; padding: 8px; }
.pcard { position: relative; display: flex; flex-direction: column; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; cursor: pointer; border: 2px solid transparent; min-width: 0; }
.pcard.in { border-color: rgba(var(--brand-rgb), .45); }
.pcard .media { position: relative; }
.pcard .media .pic { aspect-ratio: 1 / .82; padding: 8px; }
.ribbon { position: absolute; top: 8px; inset-inline-start: 8px; display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px 2px 7px; border-radius: 10px;
  background: linear-gradient(140deg, #FFB547, #F06A2A); color: #fff; font-size: 12px; font-weight: 700; box-shadow: 0 3px 10px rgba(240, 106, 42, .35); direction: ltr; }
.ribbon svg { width: 13px; height: 13px; fill: currentColor; }
.stock { position: absolute; bottom: 8px; inset-inline-end: 8px; padding: 0 8px; border-radius: 9px; background: rgba(15, 27, 51, .72); color: #fff; font-size: 11px; font-weight: 600; line-height: 20px; }
.stock.out { background: var(--danger); }
.pdel { position: absolute; bottom: 8px; inset-inline-start: 8px; width: 34px; height: 34px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: var(--surface); color: var(--danger); box-shadow: 0 1px 5px rgba(15, 27, 51, .3); cursor: pointer; }
.pdel svg { width: 17px; height: 17px; }
.stock.ok { background: var(--ok); }   /* «رؤية كمية الرصيد» off: «متوفر» in green, «غير متوفر» in red (.out) */
/* stock as a word instead of the number (perms.stockView) */
.avail { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; font-size: .95em; }
.avail::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.avail.yes { color: var(--ok); } .avail.no { color: var(--danger); }
.pcard .body { padding: 8px 10px 0; flex: 1; min-height: 0; }
.pcard .nm { font-weight: 700; font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; direction: ltr; text-align: left; }
.pcard .sn { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; direction: ltr; text-align: left; }
.pcard .foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 8px 10px 10px; }
.pcard .price { display: grid; line-height: 1.2; min-width: 0; }
.pcard .price b { font-size: 16px; color: var(--brand-ink); }
.free { color: var(--ok); font-size: 12px; font-weight: 700; }
.addbtn { width: 40px; height: 40px; border-radius: 14px; border: 0; background: linear-gradient(140deg, var(--brand-2), var(--brand)); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 6px 14px rgba(var(--brand-rgb), .3); flex-shrink: 0; }
.addbtn svg { width: 22px; height: 22px; }
.stepper { display: inline-flex; align-items: center; background: var(--brand-wash); border-radius: 14px; padding: 2px; flex-shrink: 0; direction: ltr; }
.stepper button { width: 34px; height: 36px; border: 0; background: none; color: var(--brand-ink); display: grid; place-items: center; cursor: pointer; border-radius: 12px; padding: 0; }
.stepper button svg { width: 18px; height: 18px; }
.stepper .q { width: auto; min-width: 30px; font-weight: 700; font-size: 15px; color: var(--ink); }
.stepper.sm button { width: 30px; height: 30px; }
.stepper.sm .q { min-width: 26px; text-align: center; font-weight: 700; }

.cartbar { position: fixed; inset-inline: 0; bottom: 0; z-index: 30; padding: 10px var(--gut-r) calc(10px + var(--safe-b)) var(--gut-l); pointer-events: none;
  transform: translateY(130%); transition: transform .38s cubic-bezier(.16, 1, .3, 1); }
.cartbar.show { transform: none; pointer-events: auto; }
.cartmain { width: 100%; max-width: 720px; margin: 0 auto; display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 10px 8px 16px; border: 0; border-radius: 20px; cursor: pointer;
  background: linear-gradient(120deg, var(--brand-deep), var(--brand)); color: #fff; box-shadow: 0 12px 30px rgba(var(--brand-rgb), .42); text-align: start; }
.cicon { position: relative; width: 46px; height: 46px; border-radius: 14px; background: rgba(255, 255, 255, .16); display: grid; place-items: center; flex-shrink: 0; }
.cicon svg { width: 26px; height: 26px; }
.cicon .badge { position: absolute; top: -6px; inset-inline-end: -6px; min-width: 22px; height: 22px; border-radius: 11px; background: #FFB547; color: #3a2400; font-size: 12px; font-weight: 700; line-height: 22px; text-align: center; padding: 0 5px; }
.cartmain .sum { flex: 1; display: grid; line-height: 1.25; }
.cartmain .sum b { font-size: 20px; }
.cartmain .sum small { opacity: .85; font-size: 12px; }
.cartmain .go { display: inline-flex; align-items: center; gap: 6px; background: #fff; color: var(--brand-deep); padding: 10px 14px; border-radius: 14px; font-weight: 700; }
.cartmain .go svg { width: 18px; height: 18px; }

/* product sheet */
.psheet { display: grid; gap: 12px; }
.psheet .hero { position: relative; border-radius: 18px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.psheet .hero .pic { aspect-ratio: 16 / 10; padding: 10px; }
.psheet h3 { margin: 0; text-align: start; font-size: 19px; direction: ltr; text-align: left; }
.psheet .meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; color: var(--muted); font-size: 13px; }
.psheet .prices { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; }
.psheet .prices > div { background: var(--bg); border-radius: 14px; padding: 8px 12px; display: grid; }
.psheet .prices > div.on { background: var(--brand-wash); box-shadow: inset 0 0 0 1.5px var(--brand-2); }
.psheet .prices small { color: var(--muted); font-size: 12px; }
.psheet .prices b { font-size: 17px; }
.psheet .prices small.held { color: var(--warn, #9a6200); font-size: 11.5px; }
.offerbox { border-radius: 16px; padding: 10px 12px; background: linear-gradient(140deg, #FFF4E2, #FFE6D3); color: #6b3505; display: grid; gap: 8px; }
:root[data-scheme="dark"] .offerbox { background: linear-gradient(140deg, #3b2a10, #43201b); color: #f6c690; }
.offerbox > div:first-child { display: flex; align-items: center; gap: 6px; }
.offerbox svg { width: 18px; height: 18px; }
.offerbox .tiers { display: flex; flex-wrap: wrap; gap: 6px; }
.offerbox .chip { background: rgba(255, 255, 255, .7); border-color: transparent; color: inherit; min-height: 30px; font-size: 13px; }
.offerhint { font-size: 13px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-height: 20px; }
.offerhint .free { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; }
.offerhint .free svg { width: 16px; height: 16px; }
.qtyrow { display: flex; align-items: center; justify-content: center; gap: 14px; }
.qtyrow input { width: 120px; height: 58px; border: 0; border-radius: 16px; background: var(--bg); text-align: center; font-size: 26px; font-weight: 700; color: var(--ink); }
.qtyrow input:focus { outline: 2px solid var(--brand-2); }
.round { width: 52px; height: 52px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; background: linear-gradient(140deg, var(--brand-2), var(--brand)); color: #fff; }
.round.light { background: var(--brand-wash); color: var(--brand-ink); }
.round svg { width: 24px; height: 24px; }
.psheet .quick { display: flex; justify-content: center; gap: 8px; }
.psheet .f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
/* the line's discount (% or amount) and Bayan's minimum price under the price fields */
.psheet .disbox { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 4px 12px; margin-top: 12px; }
.psheet .disbox .segbar { padding: 0 0 4px; }
.psheet .disbox .segbar button { min-height: 36px; padding: 0 12px; flex: 0 0 auto; }
.psheet .disnote { grid-column: 1 / -1; color: var(--muted); font-size: 12.5px; min-height: 1em; }
.psheet .floornote { display: block; margin-top: 6px; color: var(--warn); font-size: 12.5px; font-weight: 600; }
.psheet .floornote:empty, .psheet .disnote:empty { display: none; }
.sheetfoot { display: flex; align-items: center; gap: 10px; position: sticky; bottom: calc(-16px - var(--safe-b)); background: var(--surface); padding: 10px 0 4px; }
.sheetfoot > div { flex: 1; display: grid; }
.sheetfoot small { color: var(--muted); font-size: 12px; }
.sheetfoot b { font-size: 20px; }

/* review */
.review .chips { margin-bottom: 4px; }
.rlist { display: grid; gap: 10px; }
.rline { display: flex; gap: 10px; align-items: center; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 8px; transition: transform .24s ease, opacity .24s ease, max-height .24s ease; max-height: 300px; }
.rline.leaving { transform: translateX(-30%); opacity: 0; max-height: 0; padding-block: 0; margin-block: -5px; }
.rline .pic.thumb { width: 64px; height: 64px; border-radius: 12px; flex-shrink: 0; padding: 4px; box-shadow: inset 0 0 0 1px var(--line); }
.rline .mid { flex: 1; min-width: 0; display: grid; gap: 2px; justify-items: start; }
.rline .nm { font-weight: 700; font-size: 14px; line-height: 1.3; direction: ltr; text-align: left; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rline .calc { font-size: 13px; color: var(--muted); }
.rline .free { display: inline-flex; align-items: center; gap: 3px; border: 0; background: var(--ok-wash); border-radius: 10px; padding: 2px 8px; cursor: pointer; font-family: inherit; }
.rline .free.manual { background: var(--warn-wash); color: var(--warn); }
.rline .free.add { background: none; color: var(--faint); padding-inline: 0; }
.rline .free svg { width: 14px; height: 14px; }
.rline .req { font-size: 12px; color: var(--warn); }
/* discounts: on a line (حسم بنود) and on the total */
.rline .disl { display: inline-flex; align-items: center; gap: 3px; border: 0; background: var(--brand-wash); color: var(--brand); border-radius: 10px; padding: 2px 8px; cursor: pointer; font: inherit; font-size: 12.5px; }
.rline .disl.add { background: none; color: var(--faint); padding-inline: 0; }
.rline .disl svg { width: 14px; height: 14px; }
.rline .end .was { color: var(--faint); font-size: 12px; font-weight: 500; }
.dsum { display: grid; gap: 6px; margin: 10px 0 14px; }
.dsum:empty { display: none; }
.dsum > div, .dsum > .disd { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; }
.dsum > div span { color: var(--muted); font-weight: 600; }
.dsum .disd { border: 1px dashed var(--line); background: var(--surface); border-radius: 12px; padding: 8px 12px; font: inherit; color: var(--faint); cursor: pointer; text-align: start; }
.dsum .disd.on { border-style: solid; border-color: var(--brand-2); background: var(--brand-wash); color: var(--brand); }
.dsum .disd span { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.dsum .disd svg { width: 15px; height: 15px; }
.dsum .disd:disabled { cursor: default; }
.rline .end { display: grid; justify-items: end; gap: 6px; }
/* 1.15: a line goes in one tap — the badge on its picture's corner (its touch area larger than the badge) — and the
   quantity is typed: the number in the stepper, dotted, opens the box */
.rline { position: relative; }
.rline.leaving { overflow: hidden; }
.rline .rdel { position: absolute; top: 3px; inset-inline-start: 3px; z-index: 1; width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: var(--surface); color: var(--danger); box-shadow: 0 1px 4px rgba(15, 27, 51, .28); cursor: pointer; }
.rline .rdel::after { content: ''; position: absolute; inset: -7px; }
.rline .rdel svg { width: 15px; height: 15px; }
.stepper button.q { text-decoration: underline dotted; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.stepper.sm button.q { width: auto; min-width: 34px; padding: 0 4px; font-size: 15px; }
.qtybig { font-size: 26px; font-weight: 700; text-align: center; }
.qtyacts { display: flex; justify-content: center; gap: 10px; margin-top: 4px; }
.addmore { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 50px; margin: 12px 0; border: 1.5px dashed rgba(var(--brand-rgb), .4); border-radius: 16px; background: none; color: var(--brand-ink); font-weight: 600; cursor: pointer; }
.addmore svg { width: 20px; height: 20px; }
.savings { display: flex; align-items: center; gap: 12px; background: linear-gradient(140deg, var(--ok-wash), color-mix(in srgb, var(--ok-wash) 60%, var(--surface))); color: var(--ok); border-radius: 16px; padding: 12px 14px; margin-bottom: 14px; animation: rise .4s both; }
.savings > svg { width: 30px; height: 30px; flex-shrink: 0; }
.savings div { display: grid; }
.savings small { color: var(--muted); }

/* offers */
.offers { display: grid; gap: 14px; }
.offercard { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); padding: 14px; overflow: hidden; }
.ohead { display: flex; align-items: center; gap: 12px; }
.ohead > div { flex: 1; display: grid; }
.ohead small { color: var(--muted); font-size: 12px; }
.ohead .badge { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(140deg, #FFB547, #F06A2A); color: #fff; }
.ohead .badge svg { width: 24px; height: 24px; fill: currentColor; }
.ohead .chip.on { background: #FFF1E4; color: #A04A10; border-color: transparent; direction: ltr; font-weight: 700; }
.offercard .tiers { display: flex; gap: 8px; margin: 12px 0; flex-wrap: wrap; }
.tier { display: inline-flex; align-items: baseline; gap: 5px; background: var(--bg); border-radius: 12px; padding: 6px 10px; font-size: 13px; }
.tier b { font-size: 16px; }
.tier small { color: var(--faint); }
.ostrip { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 6px; scroll-snap-type: x proximity; }
.ostrip::-webkit-scrollbar { display: none; }
.oitem { position: relative; flex-shrink: 0; width: 118px; display: grid; gap: 4px; scroll-snap-align: start; border: 0; background: none; padding: 0; text-align: start; color: var(--ink); text-decoration: none; cursor: pointer; }
.oitem .pic { height: 100px; border-radius: 14px; padding: 6px; box-shadow: inset 0 0 0 1px var(--line); }
.oitem .nm { font-size: 12px; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; direction: ltr; text-align: left; }
.oitem .olabel { position: absolute; top: 6px; inset-inline-start: 6px; padding: 0 7px; border-radius: 9px; background: linear-gradient(140deg, #FFB547, #F06A2A); color: #fff; font-size: 11px; font-weight: 700; line-height: 20px; direction: ltr; }
.ostrip.home .oitem { width: 112px; }
.ostrip.home .oitem .pic { background: var(--surface); box-shadow: var(--shadow); }
.titlerow { display: flex; justify-content: space-between; align-items: center; }
.titlerow a { font-size: 13px; color: var(--brand-ink); text-decoration: none; font-weight: 600; }
.empty svg { width: 40px; height: 40px; opacity: .5; }

/* ---------- chat ---------- */
.tabhead { padding-inline: var(--gut-l) var(--gut-r); padding-bottom: 6px; }
.tabhead h2 { margin: 0; font-size: 24px; }
.avatar { position: relative; flex-shrink: 0; width: var(--s); height: var(--s); border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: calc(var(--s) * .36); }
.avatar svg { width: 55%; height: 55%; }
.avatar.online::after { content: ""; position: absolute; bottom: 1px; inset-inline-end: 1px; width: 11px; height: 11px; border-radius: 50%; background: #2BC46B; border: 2px solid var(--surface); }
.clist { margin-bottom: 14px; }
.crow { display: flex; align-items: center; gap: 12px; padding: 10px 14px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line); }
.crow:last-child { border-bottom: 0; }
.crow .main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.crow .top, .crow .bot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.crow .top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crow .top small { color: var(--faint); font-size: 12px; flex-shrink: 0; }
.crow .bot span:first-child { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crow.unread .bot span:first-child { color: var(--ink); font-weight: 600; }
.crow .typing { color: var(--ok) !important; }
.crow .count { min-width: 22px; height: 22px; border-radius: 11px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; line-height: 22px; text-align: center; padding: 0 6px; flex-shrink: 0; }

.chathead { gap: 8px; }
.chathead .ttl { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.chathead .ttl b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chathead .ttl small { font-size: 12px; opacity: .85; min-height: 16px; }
.dots { display: inline-flex; gap: 3px; vertical-align: middle; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: blink 1.1s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
main.thread { padding-bottom: calc(96px + var(--safe-b)); background:
  radial-gradient(50% 35% at 10% 15%, rgba(var(--brand-rgb), .07), transparent 70%), radial-gradient(45% 30% at 90% 70%, rgba(var(--brand-rgb), .06), transparent 70%); }
.bubbles { display: flex; flex-direction: column; gap: 4px; }
.day { align-self: center; margin: 12px 0 6px; }
.day span { font-size: 12px; color: var(--muted); background: var(--surface); padding: 3px 12px; border-radius: 10px; box-shadow: var(--shadow); }
.bub { max-width: 80%; padding: 7px 11px 5px; border-radius: 18px; position: relative; box-shadow: 0 1px 1.5px rgba(15, 27, 51, .08); word-wrap: break-word; white-space: pre-wrap; }
.bub.me { align-self: flex-start; background: linear-gradient(140deg, var(--brand-2), var(--brand)); color: #fff; border-start-start-radius: 6px; }
.bub.them { align-self: flex-end; background: var(--surface); border-start-end-radius: 6px; }
.bub.new { animation: pop .32s cubic-bezier(.16, 1, .3, 1) both; transform-origin: bottom; }
.bub.pending { opacity: .75; }
.bub .who { display: block; font-size: 12px; font-weight: 700; color: var(--brand-ink); margin-bottom: 1px; }
.bub .meta { display: flex; align-items: center; justify-content: flex-end; gap: 3px; font-size: 11px; opacity: .72; margin-top: 2px; direction: ltr; }
.bub .meta svg { width: 14px; height: 14px; }
.ticks { display: inline-flex; }
.ticks svg + svg { margin-inline-start: -9px; }
.ticks.read { color: #9FF0C4; opacity: 1; }
.custcard { display: flex; align-items: center; gap: 8px; border: 0; border-radius: 12px; padding: 6px 10px; background: rgba(255, 255, 255, .18); color: inherit; cursor: pointer; text-align: start; }
.bub.them .custcard { background: var(--brand-wash); color: var(--brand-ink); }
.custcard svg { width: 22px; height: 22px; }
.custcard span { display: grid; } .custcard small { opacity: .8; }
.composer { position: fixed; inset-inline: 0; bottom: 0; z-index: 30; display: flex; align-items: flex-end; gap: 6px; padding: 8px var(--gut-r) calc(8px + var(--safe-b)) var(--gut-l);
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); }
.composer .iconbtn { color: var(--muted); }
.composer textarea { flex: 1; min-width: 0; resize: none; border: 0; border-radius: 22px; padding: 11px 16px; background: var(--surface); box-shadow: var(--shadow); max-height: 120px; line-height: 1.4; }
.composer textarea:focus { outline: 2px solid var(--brand-2); }
.send { width: 46px; height: 46px; border-radius: 50%; border: 0; display: grid; place-items: center; background: linear-gradient(140deg, var(--brand-2), var(--brand)); color: #fff; cursor: pointer; flex-shrink: 0; box-shadow: 0 6px 14px rgba(var(--brand-rgb), .35); }
.send svg { width: 22px; height: 22px; transform: scaleX(-1); }
.menu .ic.ok { background: #FFF1E4; color: #D2631E; }

.ribbon.named { direction: rtl; }
.pcard.in .foot { flex-wrap: wrap; gap: 6px; }
.pcard.in .foot .price { flex-direction: row; display: flex; align-items: baseline; justify-content: space-between; width: 100%; gap: 6px; }
.pcard.in .foot .stepper { width: 100%; justify-content: space-between; }
.pcard.in .foot .stepper .q { flex: 1; }

/* ---------- route plan, photos, signature, approval ---------- */
.scrim.out { opacity: 0; transition: opacity .18s; }
.scrim.out .sheet { transform: translateY(12%); transition: transform .18s; }
.plancard { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); padding: 12px 14px; margin: 14px 0 4px; }
.planhead { display: flex; align-items: center; gap: 12px; }
.planhead .ic { width: 44px; height: 44px; border-radius: 14px; background: var(--brand-wash); color: var(--brand-ink); display: grid; place-items: center; flex-shrink: 0; }
.planhead .ic svg { width: 24px; height: 24px; }
.planhead > div { flex: 1; min-width: 0; display: grid; }
.planhead small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ring { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; font-size: 12px;
  background: conic-gradient(var(--ok) var(--p, 0%), var(--line) 0); position: relative; }
.ring::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--surface); }
.ring b { position: relative; }
.planlist { display: grid; margin-top: 10px; }
.planstop { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 4px 0; text-decoration: none; color: var(--ink); border-top: 1px solid var(--line); }
.planstop .n { width: 28px; height: 28px; border-radius: 50%; background: var(--brand-wash); color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.planstop .n svg { width: 16px; height: 16px; }
.planstop.done .n { background: var(--ok-wash); color: var(--ok); }
.planstop.done .nm { color: var(--muted); text-decoration: line-through; }
.planstop.now .n { background: var(--brand); color: #fff; }
.planstop .nm { flex: 1; min-width: 0; display: grid; font-weight: 600; font-size: 15px; overflow: hidden; }
.planstop .nm small { color: var(--muted); font-weight: 400; font-size: 12px; }
.planstop .chev { color: var(--faint); transform: scaleX(-1); } .planstop .chev svg { width: 18px; height: 18px; }
.photostrip { display: flex; gap: 8px; overflow-x: auto; margin-top: 12px; scrollbar-width: none; }
.photostrip img { width: 84px; height: 84px; object-fit: cover; border-radius: 12px; box-shadow: var(--shadow); flex-shrink: 0; opacity: .85; }
.photostrip img.sent { opacity: 1; }
.sigsheet { display: grid; gap: 12px; }
.sigbox { position: relative; height: 220px; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--line); overflow: hidden; touch-action: none; }
.sigpad { width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
.sighint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px; color: #8994AB; pointer-events: none; transition: opacity .2s; font-size: 15px; }
.sighint svg { width: 22px; height: 22px; }
.sigactions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.sigimg { display: block; max-width: 60%; max-height: 120px; margin: 6px auto 0; background: #fff; border-radius: 10px; padding: 6px; box-shadow: inset 0 0 0 1px var(--line); }
.approvalnote { display: flex; align-items: center; gap: 6px; color: var(--warn); font-weight: 600; }
.approvalnote svg { width: 18px; height: 18px; }
.minitiles button.alert { background: var(--danger-wash); color: var(--danger); }

/* ---- collection appointments & plan purposes (1.2) ---- */
.visitban.remind { background: var(--surface); border: 1.5px solid var(--brand); color: var(--ink); text-decoration: none; }
.visitban.remind .ic { background: var(--brand-soft, #e9effd); color: var(--brand-ink); }
.visitban.remind .main b { display: block; } .visitban.remind .main span { font-size: 13px; color: var(--muted); }
.planstop .purpose { display: inline-flex; gap: 4px; margin-inline-start: 6px; vertical-align: middle; } .planstop .purpose .tag { font-size: 11px; }
.planlist.appts .n.small { font-size: 12px; width: auto; min-width: 44px; padding: 0 4px; border-radius: 8px; }
.promisecard { border: 1.5px solid var(--brand); }
.segbar { display: flex; gap: 6px; justify-content: center; padding: 10px 0 4px; }
.segbar button { flex: 1; min-height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font: inherit; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; color: var(--muted); }
.segbar button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.segbar.mini { padding: 0; width: 120px; } .segbar.mini button { min-height: 36px; border-radius: 10px; }
.whenbox { display: grid; grid-template-columns: 1fr; gap: 6px; margin-top: 10px; }
.disbox { display: flex; gap: 10px; align-items: flex-end; margin-top: 12px; } .disbox .uline { flex: 1; }
.pickrow { display: flex; align-items: center; gap: 10px; cursor: pointer; } .pickrow input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--brand); margin: 0; }
.pickrow.on { border-color: var(--brand); }
.rowtools { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.segbar svg, .promisecard svg, .rowtools .chip svg, .chip svg { width: 20px; height: 20px; flex-shrink: 0; vertical-align: -4px; }
.promisecard > div:first-child svg { width: 22px; height: 22px; color: var(--brand-ink); }
.rowtools .chip { display: inline-flex; align-items: center; gap: 6px; }

/* photos attached to a document (receipt cash / cheque): tap to view full screen, tap again to close */
.photos img { display: block; cursor: zoom-in; }
.photos img.zoomed { position: fixed; inset: 0; width: 100vw; height: 100vh; max-width: none; object-fit: contain; background: #000; z-index: 60; border-radius: 0; margin: 0; cursor: zoom-out; }

/* a statement row that opens its invoice */
.row.tap { cursor: pointer; }
.row.tap:active { background: var(--line, #eee); }

/* receipt: invoice selection, per-invoice discount mode, 12-hour time picker */
.invhead { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin: 16px 4px 8px; }
.invtools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.invtools .chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.invtools .segbar.mini { width: 104px; }
.invrow.on { border-color: var(--brand); }
.selsum { display: flex; gap: 14px; flex-wrap: wrap; padding: 8px 12px; margin: 2px 0 8px; border-radius: var(--r); background: var(--surface-2, rgba(var(--brand-rgb), .07)); color: var(--muted); }
.selsum b { color: var(--ink); }
.timepick { display: flex; align-items: center; gap: 6px; height: 48px; justify-content: flex-end; }
.timepick select { height: 40px; min-width: 56px; border: 1.5px solid var(--faint); border-radius: 12px; background: var(--surface); font: inherit; font-size: 18px; font-weight: 600; text-align: center; padding: 0 6px; }
.timepick .colon { font-weight: 700; font-size: 18px; }
.timepick .segbar.mini { width: 96px; margin-inline-start: 4px; }

/* item details sheet + long press */
.lp { -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
.itemsheet .itemhead { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 6px; }
.itemsheet .pic.big { width: 120px; height: 120px; border-radius: 16px; flex-shrink: 0; border: 1px solid var(--line); }
.itemsheet .pic.big.none { font-size: 34px; font-weight: 700; color: var(--tint, var(--brand)); background: var(--brand-wash); }
.itemsheet .itemmeta { flex: 1; min-width: 0; display: grid; gap: 3px; }
.itemsheet .group-title { margin: 12px 4px 6px; }
.itemsheet .row { min-height: 42px; }
button.row.tap { border-bottom: 1px solid var(--line); font: inherit; cursor: pointer; }
.warnnote { margin: 2px 0 8px; padding: 8px 12px; border-radius: var(--r); background: #fff6e0; color: #8a5a00; }
:root[data-scheme="dark"] .warnnote { background: #3a2d10; color: #ffd27a; }

/* ---- visit forms (shelf checklists) ---- */
.vform .flist { display: flex; flex-direction: column; gap: 10px; }
.vform .frow { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 12px 14px; }
.vform .frow.ok { border-inline-start-color: var(--ok, #157a3b); }
.vform .frow.absent { border-inline-start-color: var(--danger); }
.vform .fhead { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.vform .fhead img, .vform .fhead .pic { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.vform .fhead .nm b { display: block; font-size: 15px; }
.vform .fhead .nm small { color: var(--muted); }
.vform .fq { display: grid; gap: 8px; }
.vform .fitem { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; }
.vform .fitem > span:first-child { font-size: 14px; font-weight: 600; color: var(--muted); flex: 1; }
.vform .fitem.visit { min-height: 48px; flex-wrap: wrap; }
.vform .yn { display: flex; gap: 6px; }
.vform .yn .chip { min-width: 58px; justify-content: center; display: inline-flex; align-items: center; }
.vform .yn .chip.yes[aria-pressed="true"] { background: var(--ok, #157a3b); border-color: var(--ok, #157a3b); color: #fff; }
.vform .yn .chip.no[aria-pressed="true"] { background: var(--danger); border-color: var(--danger); color: #fff; }
.vform .numin input, .vform .txtin input { width: 110px; height: 40px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 17px; font-weight: 600; text-align: center; padding: 0 8px; }
.vform .txtin { flex-basis: 100%; }
.vform .txtin input { width: 100%; text-align: start; font-weight: 500; font-size: 15px; }
.vform .numin input:focus, .vform .txtin input:focus { outline: 0; border-color: var(--brand-2); }
.vform .chips.wrap { flex-wrap: wrap; overflow: visible; padding: 0; }
.vform .fphoto { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.vform .fphoto img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; }
.vform .fvisit { display: grid; gap: 6px; }
.vform .chip { display: inline-flex; align-items: center; gap: 6px; }
.vform .chip svg { width: 18px; height: 18px; }
.minitiles button.done { background: var(--ok-wash); color: var(--ok); }

/* ---------- deliveries (driver) ---------- */
.row.dlv .n { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-wash); color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.row.dlv.out .n { background: var(--warn-wash); color: var(--warn); }
.row.dlv.delivered .n { background: var(--ok-wash); color: var(--ok); }
.row.dlv.partial .n { background: var(--warn-wash); color: var(--warn); }
.row.dlv.failed .n { background: var(--danger-wash); color: var(--danger); }
.row.dlv .end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.delivery .dhead .tag { white-space: nowrap; }
.delivery .tilelink { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 2px; border-radius: 16px; background: var(--brand-wash); color: var(--brand-ink); font-size: 12.5px; font-weight: 600; text-decoration: none; }
.delivery .tilelink svg { width: 26px; height: 26px; }
.delivery .dlist { display: flex; flex-direction: column; gap: 10px; }
.delivery .dline { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 10px 12px; }
.delivery .dline.short { border-inline-start-color: var(--danger); }
.delivery .dline.gift { border-inline-start-style: dashed; }
.delivery .dl1 { display: flex; align-items: center; gap: 10px; }
.delivery .dl1 .pic { width: 48px; height: 48px; border-radius: 10px; flex-shrink: 0; }
.delivery .dl1 .nm { flex: 1; min-width: 0; display: grid; gap: 2px; }
.delivery .dl1 .nm b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.delivery .dl1 .nm small { color: var(--muted); font-size: 12.5px; }
.delivery .qtybox { display: inline-flex; align-items: center; background: var(--brand-wash); border-radius: 14px; padding: 2px; flex-shrink: 0; direction: ltr; }
.delivery .qtybox button { width: 34px; height: 36px; border: 0; background: none; color: var(--brand-ink); display: grid; place-items: center; cursor: pointer; border-radius: 12px; padding: 0; }
.delivery .qtybox button svg { width: 18px; height: 18px; }
.delivery .qtybox input { width: 54px; height: 36px; border: 0; background: transparent; text-align: center; font-weight: 700; font-size: 16px; color: var(--ink); }
.delivery .dline.short .qtybox { background: var(--danger-wash); }
.delivery .dline.short .qtybox input, .delivery .dline.short .qtybox button { color: var(--danger); }
.delivery .dl2 { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); display: grid; gap: 8px; }
.delivery .chips.wrap { flex-wrap: wrap; overflow: visible; padding: 0; }
.delivery .chip { display: inline-flex; align-items: center; gap: 6px; }
.delivery .chip svg { width: 18px; height: 18px; }
.delivery .chip.on { background: var(--ok-wash); color: var(--ok); border-color: transparent; }
.delivery .thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line); }
.delivery .warnnote { background: var(--warn-wash); color: var(--warn); border-radius: 10px; padding: 8px 12px; font-size: 13.5px; font-weight: 600; }
.delivery .dactions { display: grid; gap: 10px; justify-items: center; margin: 18px 0 8px; }
.delivery .dactions .pill { width: min(100%, 360px); }

/* ---------- picking (warehouse) ---------- */
.delivery .pline.todo { border-inline-start-color: var(--line); }
.delivery .pline.ok { border-inline-start-color: var(--ok, #157a3b); }
.delivery .pline .tick { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); color: transparent; display: grid; place-items: center; flex-shrink: 0; cursor: pointer; padding: 0; }
.delivery .pline .tick svg { width: 22px; height: 22px; }
.delivery .pline .tick.on { background: var(--ok, #157a3b); border-color: var(--ok, #157a3b); color: #fff; }
.delivery .pline.short .tick { border-color: var(--danger); color: var(--danger); }
.delivery .dlist.ro .tick, .delivery .dlist.ro .qtybox { pointer-events: none; opacity: .55; }
.delivery .pline .nm small .num { color: var(--brand-ink); font-weight: 600; }
.row.dlv .n svg { width: 16px; height: 16px; }
.row.dlv.new .n, .row.dlv.picking .n { background: var(--brand-wash); color: var(--brand-ink); }
.row.dlv.picked .n { background: var(--ok-wash); color: var(--ok); }
.row.dlv.short .n { background: var(--warn-wash); color: var(--warn); }
.row .meta.warn { color: var(--warn); }

/* review: نقد / آجل */
.paybox { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 4px 0 12px; }
.shake { animation: shake .45s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .shake { animation: none; } }

/* units: carton / set beside the main unit */
.unitbar { margin: 4px auto 10px; display: flex; justify-content: center; flex-wrap: wrap; }
.unitbar small { opacity: .7; }
.stepper .q .unitb { display: block; font-size: 10px; line-height: 1; opacity: .75; font-weight: 600; }
.pcard .price .unitp { font-size: 11px; opacity: .7; margin-inline-start: 2px; }

/* statement: search inside the statement shown */
.stmtsearch { position: sticky; top: 0; z-index: 2; padding: 8px 0; background: var(--bg); }

/* appointment: «ذكّرني قبل» */
.whenbox .remindrow { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }

/* a return goes to Bayan frozen */
.frozennote { margin: 0 0 10px; padding: 8px 12px; border-radius: 12px; background: var(--warn-wash); color: var(--warn); text-align: center; }
/* سقف الدين (1.15): the document takes the customer over his ceiling — what he owes with it, the ceiling, what happens next */
.ceilwarn { display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 12px; padding: 10px 14px; border-radius: 14px; background: var(--warn-wash); color: var(--warn); }
.ceilwarn > svg { width: 22px; height: 22px; flex-shrink: 0; margin-top: 2px; }
.ceilwarn > div { display: grid; gap: 2px; min-width: 0; }
.ceilwarn small { font-size: 12.5px; color: var(--ink); opacity: .8; }

/* home widgets */
.widgetrow .iconbtn { min-width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line, #ddd); background: transparent; color: inherit; }
.widgetrow .iconbtn:disabled { opacity: .3; }
.pill.small { padding: 6px 14px; font-size: 13px; }

/* a line that mixes Arabic words and numbers reads right to left; only bare numbers are LTR runs (.num) */
.meta.num, .mixed { direction: rtl; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }


/* account picker with search (the phone's own select list has none) */
.acctfield .acctbtn { width: 100%; height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1.5px solid var(--brand-2); border-radius: 18px; background: var(--surface); padding: 0 18px; font: inherit; color: var(--ink); cursor: pointer; text-align: start; }
.acctfield .acctval { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.acctfield .caret { color: var(--muted); }
.acctsearch { position: sticky; top: 0; background: var(--surface, #fff); padding-bottom: 8px; z-index: 1; }
.acctlist { max-height: 60vh; overflow-y: auto; }
.acctlist .row.sel { background: var(--brand-wash); }
.acctlist .row { width: 100%; text-align: start; border: 0; font: inherit; color: inherit; background: none; }

/* due invoices: the age periods in colour (fresh → late) */
.buckets { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 2px; }
.buckets .bk { display: inline-flex; flex-direction: column; padding: 3px 9px; border-radius: 10px; line-height: 1.25; }
.buckets .bk small { font-size: 11px; font-weight: 600; opacity: .85; white-space: nowrap; }
.buckets .bk b { font-size: 13.5px; white-space: nowrap; }
.buckets.legend { margin: 0 0 10px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.buckets.legend .bk { min-width: 0; padding: 8px 12px; }
.buckets.legend .bk b { font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 620px) { .buckets.legend { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.bk.b0 { background: var(--ok-wash); color: var(--ok); }
.bk.b1 { background: #FFF4D1; color: #8A6100; }
.bk.b2 { background: #FFE6CF; color: #A84B00; }
.bk.b3 { background: var(--danger-wash); color: var(--danger); }
.money.age0 { color: var(--ok); } .money.age1 { color: #8A6100; } .money.age2 { color: #A84B00; } .money.age3 { color: var(--danger); }
:root[data-scheme="dark"] .bk.b1 { background: #3a3010; color: #F2C14E; } :root[data-scheme="dark"] .bk.b2 { background: #40260f; color: #F49A4B; }
@media (prefers-color-scheme: dark) { :root[data-scheme="auto"] .bk.b1 { background: #3a3010; color: #F2C14E; } :root[data-scheme="auto"] .bk.b2 { background: #40260f; color: #F49A4B; } }
:root[data-scheme="dark"] .money.age1 { color: #F2C14E; } :root[data-scheme="dark"] .money.age2 { color: #F49A4B; }
/* «كشف الفواتير المستحقة»: one customer's invoices as a table (1.15) — each invoice two lines: number, date and age,
   then value, returned (when the agent sends returns), paid and left under the columns' names; nothing scrolls sideways */
.duetable { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); margin: 10px 0 4px; overflow: hidden; }
.duetable .vals { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(min-content, 1fr)); gap: 4px 6px; text-align: end; }
.duetable .dt-h { padding: 8px 12px; font-size: 12px; font-weight: 700; color: var(--muted); background: var(--bg); border-bottom: 1px solid var(--line); }
.duetable .dt-r, .duetable .dt-f { display: grid; gap: 3px; width: 100%; padding: 9px 12px; text-align: start; }
.duetable .dt-r { border: 0; border-bottom: 1px solid var(--line); background: none; color: inherit; font: inherit; cursor: pointer; }
.duetable .dt-r:active { background: var(--brand-wash); }
.duetable .inv { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.duetable .inv b { font-size: 14px; }
.duetable .inv small { color: var(--muted); font-size: 12px; }
.duetable .vals .money { font-size: 13px; font-weight: 600; white-space: nowrap; }
.duetable .money.left { font-weight: 800; }
.duetable .dash { color: var(--muted); opacity: .6; }
.duetable .dt-f { background: var(--bg); gap: 6px; }
.duetable .dt-f .inv b { font-size: 13px; color: var(--muted); }
.duetable .tots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; }
.duetable .tots > span { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
.duetable .tots small { color: var(--muted); font-size: 12px; }
.duetable .tots .money { font-size: 14px; font-weight: 700; white-space: nowrap; }
.duetable .tots .money.left { font-size: 15.5px; font-weight: 800; }
/* the late view of the report (from «تحتاج متابعة» on the home screen): which customers these are, and back to all */
.lateban { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 2px; padding: 10px 14px; border-radius: 14px; background: var(--danger-wash); color: var(--danger); }
.lateban > span { display: grid; gap: 2px; min-width: 0; }
.lateban small { font-size: 12.5px; opacity: .9; }
/* 1.24.0: a receipt put back as the rep left it; the % / amount choice of its discounts */
.lateban.draftbar { background: var(--brand-wash); color: var(--brand-ink); margin-bottom: 8px; }
.segbar.dismode { padding: 4px 0 8px; }
.segbar.dismode button { min-height: 36px; font-size: 14px; }

/* language switch on the sign-in screen (i18n.js) */
.langswitch { background: none; border: 1px solid var(--line, #d6dae3); color: inherit; border-radius: 999px; padding: 6px 16px; font: inherit; font-size: 14px; cursor: pointer; }
.langswitch + .langswitch { margin-inline-start: 8px; }

/* English (left to right): arrows that point "back" or "forward" turn round; Arabic names from Bayan keep their own
   direction inside left-to-right rows (otherwise their start is cut by the ellipsis) */
[dir="ltr"] svg[data-i="back"], [dir="ltr"] svg[data-i="arrow"], [dir="ltr"] svg[data-i="chevleft"] { transform: scaleX(-1); }
[dir="ltr"] .title, [dir="ltr"] .name, [dir="ltr"] .custhero h1, [dir="ltr"] .row .main b, [dir="ltr"] td a, [dir="ltr"] .who b { unicode-bidi: plaintext; }


/* =====================================================================
   Design D «Route» (2026-11-10). The logo's world: a BayanIQ-blue road on navy, amber for "you are here" and for the
   day's main action. Light from the top corner, soft blue-tinted depth, icons on glossy tiles like the app icon.
   The signature is the road: the day's visits on the home screen, the plan as a route, a document's way to Bayan.
   ===================================================================== */
:root {
  --bg: #EEF2F8; --surface: #FFFFFF; --ink: #0B1B3A; --muted: #56637D; --faint: #8A95AB; --line: #E3E9F2; --tab-ink: #5A6680;
  --brand: #034EA1; --brand-deep: #0B2E63; --brand-2: #2F7BE5; --brand-wash: #E6EEFA; --brand-rgb: 3, 78, 161; --brand-ink: #034EA1;
  --hero: #0B2E63; --act: #FFB020; --act-deep: #E58A00; --act-ink: #2B1A00; --act-wash: #FFF3DA;
  --onhero: #C9D7F0; --onhero-2: rgba(255, 255, 255, .64);
  --r: 16px; --r-panel: 22px; --r-tile: 22px;
  --sh-1: 0 1px 2px rgba(11, 46, 99, .06), 0 4px 14px rgba(11, 46, 99, .06);
  --sh-2: 0 2px 6px rgba(11, 46, 99, .07), 0 14px 32px rgba(11, 46, 99, .13);
  --soft: var(--sh-1); --shadow: var(--sh-1);
  --grad-hero: radial-gradient(120% 85% at 92% -10%, rgba(73, 145, 245, .75) 0%, rgba(73, 145, 245, 0) 52%), linear-gradient(165deg, #0858B8 0%, #034EA1 30%, #0B2E63 78%, #082552 100%);
  /* the road in the header: one dashed curve, white at low opacity */
  --roadmark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -60 400 300'%3E%3Cdefs%3E%3ClinearGradient id='f'%3E%3Cstop offset='0' stop-color='%23fff' stop-opacity='0'/%3E%3Cstop offset='.2' stop-color='%23fff'/%3E%3Cstop offset='.8' stop-color='%23fff'/%3E%3Cstop offset='1' stop-color='%23fff' stop-opacity='0'/%3E%3C/linearGradient%3E%3Cmask id='m'%3E%3Crect x='0' y='-60' width='400' height='300' fill='url(%23f)'/%3E%3C/mask%3E%3C/defs%3E%3Cg mask='url(%23m)'%3E%3Cpath d='M-20 190 C 90 190 120 70 220 70 S 330 20 420 30' fill='none' stroke='%23fff' stroke-opacity='.10' stroke-width='34' stroke-linecap='round'/%3E%3Cpath d='M-20 190 C 90 190 120 70 220 70 S 330 20 420 30' fill='none' stroke='%23fff' stroke-opacity='.28' stroke-width='2.5' stroke-dasharray='10 11' stroke-linecap='round'/%3E%3C/g%3E%3C/svg%3E");
}
:root[data-scheme="dark"] { --bg: #070D1C; --surface: #111A2E; --ink: #E8EDF8; --muted: #9DAAC4; --faint: #6E7A95; --line: #212C45; --tab-ink: #93A0BA;
  --brand-wash: rgba(47, 123, 229, .18); --brand-ink: #7FB0F5; --act-wash: rgba(255, 176, 32, .16);
  --sh-1: 0 1px 2px rgba(0, 0, 0, .5), 0 6px 18px rgba(0, 0, 0, .35); --sh-2: 0 2px 6px rgba(0, 0, 0, .5), 0 16px 36px rgba(0, 0, 0, .45); }
@media (prefers-color-scheme: dark) { :root[data-scheme="auto"] { --bg: #070D1C; --surface: #111A2E; --ink: #E8EDF8; --muted: #9DAAC4; --faint: #6E7A95; --line: #212C45; --tab-ink: #93A0BA;
  --brand-wash: rgba(47, 123, 229, .18); --brand-ink: #7FB0F5; --act-wash: rgba(255, 176, 32, .16);
  --sh-1: 0 1px 2px rgba(0, 0, 0, .5), 0 6px 18px rgba(0, 0, 0, .35); --sh-2: 0 2px 6px rgba(0, 0, 0, .5), 0 16px 36px rgba(0, 0, 0, .45); } }

body { font-size: 16px; letter-spacing: 0; -webkit-font-smoothing: antialiased; }
::selection { background: rgba(47, 123, 229, .28); }
input, textarea { caret-color: var(--brand-2); }
.backdrop { background: var(--bg); }
body::before { background: #0858B8; }
.num, .money { font-feature-settings: "tnum" 1, "lnum" 1; }

/* ---------- glossy icon tiles: the app icon's material, coloured by what the icon is about ---------- */
.menu .ic, .quick3 button .ic, .scpanel .scring, .planhead .ic, .visitban .ic, .ohead .badge, .tile .ic {
  --t1: #3B8BF0; --t2: #034EA1;
  background: linear-gradient(150deg, var(--t1), var(--t2)) !important; color: #fff !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .38), inset 0 -1px 0 rgba(0, 0, 0, .12), 0 6px 14px -4px color-mix(in srgb, var(--t2) 60%, transparent);
}
:is(.menu .ic, .quick3 .ic, .scpanel .scring, .planhead .ic, .visitban .ic, .tile .ic):has(svg[data-i="cash"], svg[data-i="receipt"], svg[data-i="due"], svg[data-i="totals"]) { --t1: #FFC54D; --t2: #E58A00; }
:is(.menu .ic, .quick3 .ic, .scpanel .scring, .planhead .ic, .visitban .ic, .tile .ic):has(svg[data-i="people"], svg[data-i="walk"], svg[data-i="user"], svg[data-i="visit"]) { --t1: #2CC6B0; --t2: #0A8577; }
:is(.menu .ic, .quick3 .ic, .scpanel .scring, .planhead .ic, .visitban .ic, .tile .ic):has(svg[data-i="box"], svg[data-i="star"], svg[data-i="gift"], svg[data-i="layers"]) { --t1: #8E7CFF; --t2: #5B3FD9; }
:is(.menu .ic, .quick3 .ic, .scpanel .scring, .planhead .ic, .visitban .ic, .tile .ic):has(svg[data-i="ret"], svg[data-i="calendar"], svg[data-i="bell"]) { --t1: #FF8A73; --t2: #D9452E; }
:is(.menu .ic, .quick3 .ic, .scpanel .scring, .planhead .ic, .visitban .ic, .tile .ic):has(svg[data-i="bus"], svg[data-i="truck"], svg[data-i="route"], svg[data-i="pin"], svg[data-i="nav"], svg[data-i="map"]) { --t1: #3DD68C; --t2: #12945A; }
:is(.menu .ic, .quick3 .ic, .scpanel .scring, .planhead .ic, .visitban .ic, .tile .ic):has(svg[data-i="sync"], svg[data-i="more"], svg[data-i="shield"]) { --t1: #7D8CA8; --t2: #45536F; }
.menu .ic.err { --t1: #FF7A6B; --t2: #C8281C; }
.menu .ic svg, .quick3 .ic svg, .planhead .ic svg { stroke-width: 2; }

/* ---------- header (every inner screen): the hero gradient, the road mark, a rounded foot ---------- */
.topbar { background: var(--roadmark) var(--road-at, right -40px top -30px) / 360px auto no-repeat, var(--grad-hero); box-shadow: 0 10px 24px -12px rgba(11, 46, 99, .55);
  border-radius: 0 0 24px 24px; min-height: 64px; padding-bottom: 8px; margin-bottom: 4px; }
/* only the road mark moves in Arabic; listing positions here once shifted a gradient layer and left a seam behind the back button */
[dir="rtl"] .topbar { --road-at: left -40px top -30px; }
.topbar h1 { font-size: 18px; font-weight: 700; letter-spacing: 0; }
.topbar .sub { color: var(--onhero); opacity: 1; font-weight: 400; }
.iconbtn { border-radius: 14px; }
.topbar .iconbtn { background: rgba(255, 255, 255, .12); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); width: 42px; height: 42px; margin-inline: 4px; }
.topbar .iconbtn:active { background: rgba(255, 255, 255, .22); }
.searchbar, .docbar { top: calc(72px + env(safe-area-inset-top, 0px)); }
.catbar { top: calc(76px + env(safe-area-inset-top, 0px)); }
.searchbar { margin: -4px calc(-1 * var(--gut-r)) 10px calc(-1 * var(--gut-l)); padding: 8px var(--gut-r) 8px var(--gut-l); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border: 0; }
.searchbar { position: sticky; }
.searchbar > svg { position: absolute; inset-inline-start: calc(var(--gut-l) + 16px); pointer-events: none; color: var(--faint); }
.searchbar input { height: 50px; border: 0; border-radius: 16px; background: var(--surface); padding-inline: 46px 16px; box-shadow: var(--sh-1), inset 0 0 0 1px var(--line); font-size: 16px; }
.searchbar input:focus { outline: 0; box-shadow: var(--sh-1), inset 0 0 0 2px var(--brand-2); }
.docbar { background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(12px); border-bottom: 0; }
.docbar .cust { color: var(--ink); font-weight: 700; font-size: 20px; }

/* tab pages (بطاقات، كشوفات، الرسائل): a tall hero head, the title and one line about the page */
.pagetitle, .tabhead { position: relative; margin: 0 calc(-1 * var(--gut-r)) 18px calc(-1 * var(--gut-l)); padding: calc(26px + env(safe-area-inset-top, 0px)) var(--gut-r) 30px var(--gut-l);
  background: var(--roadmark) left -60px top -10px / 420px auto no-repeat, var(--grad-hero); color: #fff; border-radius: 0 0 30px 30px; box-shadow: 0 14px 28px -16px rgba(11, 46, 99, .6);
  font-size: 30px; font-weight: 700; line-height: 1.2; }
.pagetitle small, .tabhead small { display: block; margin-top: 6px; font-size: 14px; font-weight: 400; color: var(--onhero); }
.tabhead { display: block; margin: 0 0 4px; padding-inline: var(--gut-l) var(--gut-r); }
.tabhead h2 { margin: 0; font-size: 30px; font-weight: 700; }
.tabhead .spacer { display: none; }
body:has(.tabhead) main.screen { padding-top: 6px; }

/* bottom navigation: frosted white, the current place in a blue glossy pill */
.tabbar { background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-top: 0; box-shadow: 0 -1px 0 var(--line), 0 -10px 30px rgba(11, 46, 99, .08); height: calc(72px + var(--safe-b)); }
.tabbar a { gap: 3px; font-size: 12px; font-weight: 500; color: var(--tab-ink); }
.tabbar a svg { box-sizing: content-box; width: 24px; height: 24px; padding: 5px 16px; border-radius: 16px; transition: background-color .2s, color .2s, transform .2s cubic-bezier(.16, 1, .3, 1); }
.tabbar a[aria-current="page"] { color: var(--brand-ink); font-weight: 700; }
.tabbar a[aria-current="page"] svg { background: linear-gradient(150deg, #3B8BF0, #034EA1); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 6px 14px -4px rgba(3, 78, 161, .55); stroke-width: 2; }
.tabbar a:active svg { transform: scale(.92); }
.tabbar .badge { top: 2px; inset-inline-start: calc(50% + 10px); background: var(--act); color: var(--act-ink); font-weight: 700; box-shadow: 0 0 0 2px var(--surface); }

/* ---------- surfaces ---------- */
.list, .menu, .card, .plancard, .offercard { border-radius: var(--r-panel); box-shadow: var(--sh-1); background: var(--surface); }
.row { min-height: 64px; padding: 12px 16px; gap: 12px; border-bottom-color: var(--line); }
.row .title { font-weight: 500; font-size: 16px; }
.row .meta { font-size: 13px; }
.row .end .money, .row .end.money { font-size: 16px; font-weight: 700; }
button.row:active, a.row:active { background: var(--brand-wash); }
.group-title { font-size: 17px; font-weight: 700; color: var(--ink); margin: 26px 4px 10px; }
.titlerow a, .group-title a { font-weight: 500; color: var(--brand-ink); }
.menu button { min-height: 74px; gap: 14px; padding: 12px 16px; }
.menu .ic { width: 46px; height: 46px; border-radius: 14px; }
.menu .ic svg { width: 23px; height: 23px; }
.menu .t b { font-weight: 700; font-size: 16px; }
.menu .t span { font-size: 13px; color: var(--muted); line-height: 1.45; }
.menu .chev { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--bg); color: var(--muted); }
.menu .chev svg { width: 16px; height: 16px; }
.menu + .menu { margin-top: 16px; }
.empty { color: var(--muted); }
.chip { border-radius: 14px; border: 0; background: var(--surface); box-shadow: var(--sh-1), inset 0 0 0 1px var(--line); font-weight: 500; min-height: 38px; }
.chip[aria-pressed="true"] { background: var(--brand); color: #fff; box-shadow: 0 6px 14px -6px rgba(3, 78, 161, .6); }
.tag { border-radius: 8px; font-weight: 500; padding: 1px 8px; }

/* buttons: blue glossy pill; ghost = white with a hairline; amber is the day's action only */
.pill { border-radius: 16px; min-height: 52px; font-weight: 700; background: linear-gradient(160deg, #2F7BE5, #034EA1 60%, #0A3F87); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 8px 18px -8px rgba(3, 78, 161, .7); }
.pill.ghost { background: var(--surface); color: var(--brand-ink); border: 0; box-shadow: var(--sh-1), inset 0 0 0 1px var(--line); }
.pill.danger { border: 0; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--danger) 55%, transparent); }
.pill.act, .minitiles button.main, .vcard .vbtn.go { background: linear-gradient(170deg, #FFC54D, #FFB020 45%, #F09A0A); color: var(--act-ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 10px 20px -8px rgba(229, 138, 0, .75); }
.round, .addbtn, .send { background: linear-gradient(160deg, #3B8BF0, #034EA1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 6px 14px -6px rgba(3, 78, 161, .7); }
.addbtn { width: 42px; height: 42px; border-radius: 14px; }
.stepper { border-radius: 14px; background: var(--brand-wash); box-shadow: none; padding: 2px; }
.stepper button { width: 38px; height: 38px; border-radius: 12px; }
.stepper .q { font-weight: 700; }
.outlined select, .outlined input, .acctfield .acctbtn { border: 0; border-radius: 16px; box-shadow: var(--sh-1), inset 0 0 0 1px var(--line); }
.outlined select:focus, .outlined input:focus { outline: 0; box-shadow: var(--sh-1), inset 0 0 0 2px var(--brand-2); }
.outlined > span { background: transparent; top: -22px; inset-inline-start: 6px; padding: 0; }
.outlined { margin-top: 14px; }
.input { border: 0; border-radius: 14px; box-shadow: inset 0 0 0 1.5px var(--line); }
.input:focus { box-shadow: inset 0 0 0 2px var(--brand-2); }
.seg { background: color-mix(in srgb, var(--brand) 8%, var(--bg)); border-radius: 14px; }
.seg button[aria-pressed="true"] { box-shadow: var(--sh-1); color: var(--brand-ink); font-weight: 700; }
.segbar button { border: 0; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); font-weight: 500; }
.segbar button[aria-pressed="true"] { background: var(--brand); color: #fff; box-shadow: 0 6px 14px -6px rgba(3, 78, 161, .6); }

/* ---------- home ---------- */
.home-b { padding-left: 0 !important; padding-right: 0 !important; }
.home-b > :not(.hero):not(.scpanel) { margin-left: var(--gut-l); margin-right: var(--gut-r); }
section.hero { position: relative; overflow: hidden; color: #fff; padding: calc(14px + env(safe-area-inset-top, 0px)) var(--gut-r) 68px var(--gut-l);
  background: var(--roadmark) left -80px top 40px / 560px auto no-repeat, var(--grad-hero); border-radius: 0 0 34px 34px; }
.herotop { display: flex; align-items: center; gap: 12px; }
.herotop .me { width: 44px; height: 44px; border-radius: 14px; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 18px;
  background: linear-gradient(150deg, rgba(255, 255, 255, .3), rgba(255, 255, 255, .08)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.herotop .who { flex: 1; min-width: 0; line-height: 1.3; }
.herotop .who small { display: block; color: var(--onhero); font-size: 13px; }
.herotop .who b { display: block; font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.herotop .hbtn { position: relative; width: 42px; height: 42px; flex: none; display: grid; place-items: center; border: 0; border-radius: 14px; cursor: pointer; color: #fff;
  background: rgba(255, 255, 255, .12); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); }
.herotop .hbtn svg { width: 22px; height: 22px; }
.herotop .hbtn .dot { position: absolute; top: -5px; inset-inline-start: -5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--act); color: var(--act-ink); font-size: 11.5px; font-weight: 700; line-height: 20px; box-shadow: 0 0 0 2px #0B3E80; }
/* 1.16: the companies on this phone — the company's name opens their list (home), and the list itself (a sheet) */
.cosw { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; margin: -8px -6px; padding: 8px 6px; border: 0; border-radius: 10px; background: none; color: inherit; font: inherit; cursor: pointer; vertical-align: bottom; -webkit-tap-highlight-color: transparent; }
.cosw .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.cosw svg { width: 15px; height: 15px; flex: none; }
.cosw .codot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--act); box-shadow: 0 0 0 2px rgba(11, 46, 99, .55); }
.herotop .cosw:active { background: rgba(255, 255, 255, .14); }
.toprow .cosw:active { background: var(--line); }
.cos .row.co { padding: 0; gap: 0; }
.cos .row.co.on { padding: 10px 16px; gap: 12px; }
.cos .co-open { flex: 1; min-width: 0; min-height: 64px; display: flex; align-items: center; gap: 12px; padding: 10px 16px; border: 0; background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.cos .co-open:active { background: var(--line); }
.cos .co-ic { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--brand-wash); color: var(--brand-ink); }
.cos .co-ic svg { width: 20px; height: 20px; }
.cos .co-tags { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.cos .co-rm { width: 52px; align-self: stretch; flex: none; display: grid; place-items: center; border: 0; border-inline-start: 1px solid var(--line); background: none; color: var(--muted); cursor: pointer; }
.cos .co-rm svg { width: 20px; height: 20px; }
.cos .co-rm:active { color: var(--danger); background: var(--danger-wash); }
.cos-note { margin: 12px 4px 14px; line-height: 1.7; }
.hero .lbl { margin-top: 22px; font-size: 14px; color: var(--onhero); }
.hero .lbl .off { color: var(--act); font-weight: 700; }
.hero .bignum { display: flex; align-items: baseline; gap: 8px; margin-top: 2px; font-size: 46px; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; text-shadow: 0 2px 12px rgba(0, 20, 60, .25); }
.hero .bignum small { font-size: 16px; font-weight: 400; color: var(--onhero); letter-spacing: 0; }
.hero .prog { height: 8px; margin: 16px 0 6px; border-radius: 4px; background: rgba(255, 255, 255, .16); overflow: hidden; }
.hero .prog i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #FFC54D, #FFB020); }
.hero .pills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.hero .pills span { display: grid; gap: 2px; padding: 10px 12px; border-radius: 16px; text-align: start; font-size: 12.5px; color: var(--onhero);
  background: linear-gradient(160deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .06)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); backdrop-filter: blur(6px); }
.hero .pills b { font-size: 19px; font-weight: 700; color: #fff; }

/* the road: today's planned stops on a dashed line, travelled part solid, the amber pin where you are */
.road { position: relative; height: 34px; margin: 16px 4px 0; }
.road .track, .road .travelled { position: absolute; top: 20px; height: 6px; border-radius: 3px; inset-inline-start: 0; }
.road .track { inset-inline-end: 0; background: rgba(255, 255, 255, .16); }
.road .track::after { content: ""; position: absolute; inset: 2px 6px; border-top: 2px dashed rgba(255, 255, 255, .45); }
.road .travelled { width: var(--x); background: linear-gradient(90deg, #FFFFFF, #DCE8FB); box-shadow: 0 0 12px rgba(255, 255, 255, .45); }
[dir="rtl"] .road .travelled { background: linear-gradient(270deg, #FFFFFF, #DCE8FB); }
.road .stop { position: absolute; top: 17px; inset-inline-start: var(--x); width: 12px; height: 12px; margin-inline-start: -6px; border-radius: 50%; background: #0B3E80; box-shadow: inset 0 0 0 2.5px rgba(255, 255, 255, .7); }
.road .stop.done { background: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .25); }
.road .pin { position: absolute; top: -8px; inset-inline-start: var(--x); width: 24px; height: 30px; margin-inline-start: -12px; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .35)); animation: pinbob 2.4s ease-in-out infinite; }
.road .pin svg { width: 100%; height: 100%; display: block; }
@keyframes pinbob { 50% { transform: translateY(-3px); } }
.roadlbl { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; font-size: 13px; color: var(--onhero); }
.roadlbl b { color: #fff; font-weight: 700; }
.roadlbl .nx { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* the day's actions: a white card floating over the hero; the main one wide and amber */
.scpanel { position: relative; z-index: 2; margin: -50px var(--gut-r) 0 var(--gut-l); padding: 12px; border-radius: 26px; background: var(--surface); box-shadow: var(--sh-2);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px 4px; }
.scpanel .sc { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 6px 2px 4px; border: 0; background: none; cursor: pointer; color: var(--ink); font-size: 12.5px; font-weight: 500; text-align: center; line-height: 1.25; }
.scpanel .scring { width: 52px; height: 52px; border-radius: 17px; display: grid; place-items: center; }
.scpanel .scring svg { width: 25px; height: 25px; stroke-width: 2; }
.scpanel .sc:active .scring { transform: scale(.92); }
.scpanel .sc.hot { grid-column: 1 / -1; flex-direction: row; justify-content: center; gap: 10px; min-height: 58px; margin-bottom: 6px; border-radius: 18px; font-size: 18px; font-weight: 700; color: var(--act-ink);
  background: linear-gradient(170deg, #FFC54D, #FFB020 45%, #F09A0A); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 12px 22px -10px rgba(229, 138, 0, .85); }
.scpanel .sc.hot .scring { width: auto; height: auto; background: none !important; box-shadow: none !important; color: inherit !important; }
.scpanel .sc.hot .scring svg { width: 24px; height: 24px; }

/* next stop / running visit */
.vcard { display: flex; align-items: center; gap: 14px; margin-top: 16px; padding: 16px; border: 0; border-radius: var(--r-panel); background: var(--surface); box-shadow: var(--sh-1); color: var(--ink); text-align: start; font: inherit; cursor: default; position: relative; overflow: hidden; }
button.vcard { cursor: pointer; width: calc(100% - var(--gut-l) - var(--gut-r)); }
.vcard::before { content: ""; width: 44px; height: 44px; flex: none; border-radius: 14px; background: linear-gradient(150deg, #3DD68C, #12945A) center / cover;
  -webkit-mask: none; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 6px 14px -4px rgba(18, 148, 90, .6); }
.vcard::after { content: ""; position: absolute; inset-inline-start: 16px; top: 16px; width: 44px; height: 44px; background: no-repeat center / 24px
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s-7-6.2-7-11.5A7 7 0 0 1 19 9.5C19 14.8 12 21 12 21z'/%3E%3Ccircle cx='12' cy='9.5' r='2.5'/%3E%3C/svg%3E"); pointer-events: none; }
.vcard.on { background: var(--roadmark) left -60px top -20px / 300px auto no-repeat, var(--grad-hero); color: #fff; box-shadow: var(--sh-2); }
.vcard.on::before { background: linear-gradient(170deg, #FFC54D, #F09A0A); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5); }
.vcard .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; color: inherit; text-decoration: none; line-height: 1.35; }
.vcard .tx small { font-size: 13px; color: var(--muted); }
.vcard.on .tx small { color: var(--onhero); }
.vcard .tx b { margin: 2px 0; font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vcard .tx .owed { color: var(--danger); font-weight: 500; }
.vcard.on .tx .warn { color: var(--act); }
.vcard .vbtn { flex: none; min-height: 46px; padding: 0 18px; border: 0; border-radius: 14px; cursor: pointer; font: inherit; font-weight: 700; font-size: 15px; display: inline-flex; align-items: center;
  background: linear-gradient(160deg, #2F7BE5, #034EA1); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 8px 16px -8px rgba(3, 78, 161, .7); }
.vcard .vbtn.end { background: #fff; color: var(--danger); box-shadow: none; }
.vcard.idle .vbtn { background: var(--brand-wash); color: var(--brand-ink); box-shadow: none; }
.visitban.remind { margin-top: 16px; border: 0; border-radius: var(--r-panel); background: var(--surface); box-shadow: var(--sh-1); }
.visitban.remind .ic { border-radius: 14px; }

/* the plan: the same road, drawn down the card */
.plancard { padding: 16px; margin: 16px 0 4px; }
.planhead .ic { border-radius: 14px; }
.planhead b { font-size: 16px; font-weight: 700; }
.ring { background: conic-gradient(var(--brand-2) var(--p, 0%), var(--brand-wash) 0); width: 52px; height: 52px; }
.ring b { font-weight: 700; color: var(--brand-ink); }
.planlist { position: relative; margin-top: 12px; }
.planstop { position: relative; border-top: 0; min-height: 52px; padding: 6px 0; gap: 12px; }
.planstop::before { content: ""; position: absolute; inset-inline-start: 15px; top: -6px; bottom: -6px; width: 0; border-inline-start: 2.5px dashed color-mix(in srgb, var(--brand-2) 45%, transparent); z-index: 0; }
.planstop:first-child::before { top: 50%; } .planstop:last-child::before { bottom: 50%; }
.planstop.done::before { border-inline-start-style: solid; border-color: var(--brand-2); }
.planstop .n { position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%; background: var(--surface); color: var(--brand-ink); box-shadow: inset 0 0 0 2.5px color-mix(in srgb, var(--brand-2) 55%, transparent); font-size: 13px; font-weight: 700; }
.planstop.done .n { background: linear-gradient(150deg, #3B8BF0, #034EA1); color: #fff; box-shadow: 0 4px 10px -4px rgba(3, 78, 161, .6); }
.planstop.done .nm { color: var(--muted); text-decoration: none; }
.planstop.now .n { background: linear-gradient(170deg, #FFC54D, #F09A0A); color: var(--act-ink); box-shadow: 0 0 0 5px var(--act-wash); }
.planstop .nm { font-weight: 500; }
.planlist.appts .planstop::before { display: none; }

/* offers on the home screen */
.ostrip.home .oitem .pic { border-radius: 18px; box-shadow: var(--sh-1); }
.ribbon, .oitem .olabel { background: linear-gradient(160deg, #FF8A3D, #E8542A); box-shadow: 0 4px 10px -4px rgba(232, 84, 42, .7); border-radius: 8px; }
.ohead .badge { border-radius: 14px; --t1: #FF9A4D; --t2: #E8542A; }
.offerbox { background: linear-gradient(150deg, #FFF4E2, #FFE9DA); color: #7A3B0C; }
:root[data-scheme="dark"] .offerbox { background: linear-gradient(150deg, #3B2A10, #3E2016); color: #F6C690; }
.cat .cic.hot { background: linear-gradient(150deg, #FF9A4D, #E8542A); color: #fff; }

/* ---------- customer card: the hero head with the balance; actions as glossy tiles under it ---------- */
.cust-b { padding-top: 0 !important; }
body:has(main.cust-b) .topbar { border-radius: 0; box-shadow: none; margin-bottom: 0; background: transparent; position: absolute; inset-inline: 0; }
body:has(main.cust-b) main.cust-b { padding-top: 0; }
.cust-b .custhero { position: relative; margin: 0 calc(-1 * var(--gut-r)) 0 calc(-1 * var(--gut-l)); padding: calc(78px + env(safe-area-inset-top, 0px)) var(--gut-r) 70px var(--gut-l);
  background: var(--roadmark) left -70px top 60px / 520px auto no-repeat, var(--grad-hero); color: #fff; text-align: start; border-radius: 0 0 34px 34px; }
.cust-b .custhero h2 { margin: 0 0 4px; font-size: 24px; font-weight: 700; line-height: 1.3; }
.cust-b .custhero .addr { font-size: 14px; color: var(--onhero); }
.cust-b .custhero .bal { margin-top: 18px; font-size: 13px; color: var(--onhero); }
.cust-b .custhero .bal b { display: block; font-size: 40px; font-weight: 700; color: #fff; letter-spacing: -.02em; line-height: 1.15; }
[dir="rtl"] .cust-b .custhero .bal b { text-align: right; } [dir="ltr"] .cust-b .custhero .bal b { text-align: left; }
.cust-b .custhero .credit { position: relative; height: 8px; margin: 14px 0 22px; border-radius: 4px; background: rgba(255, 255, 255, .16); }
.cust-b .custhero .credit i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #FFFFFF, #DCE8FB); }
.cust-b .custhero .credit small { position: absolute; top: 12px; inset-inline-end: 0; font-size: 12px; color: var(--onhero); }
.cust-b .custhero .credit small.days { inset-inline-end: auto; inset-inline-start: 0; }
.cust-b .custhero small.days.over { color: #FFD9D3; font-weight: 700; }
.cust-b .custhero .creditdays { margin: 10px 0 4px; font-size: 12px; color: var(--onhero); }
.cust-b .custhero .tags { margin: 8px 0 0; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-start; }
.cust-b .custhero .tag { background: rgba(255, 255, 255, .16); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); }
.cust-b .custpanel { position: relative; z-index: 2; margin-top: -48px; padding: 12px; border-radius: 26px; box-shadow: var(--sh-2); background: var(--surface); }
.minitiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 4px; margin-top: 0; }
.minitiles button { display: flex; flex-direction: column; align-items: center; gap: 7px; min-height: 0; padding: 4px 2px; border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--ink); font-size: 12.5px; font-weight: 500; }
.minitiles button svg { box-sizing: content-box; width: 24px; height: 24px; padding: 13px; border-radius: 17px; color: #fff; stroke-width: 2;
  --t1: #3B8BF0; --t2: #034EA1; background: linear-gradient(150deg, var(--t1), var(--t2)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .38), 0 6px 14px -4px color-mix(in srgb, var(--t2) 60%, transparent); }
.minitiles button svg[data-i="cash"], .minitiles button svg[data-i="calendar"] { --t1: #FFC54D; --t2: #E58A00; }
.minitiles button svg[data-i="walk"], .minitiles button svg[data-i="phone"] { --t1: #2CC6B0; --t2: #0A8577; }
.minitiles button svg[data-i="ret"] { --t1: #FF8A73; --t2: #D9452E; }
.minitiles button svg[data-i="nav"], .minitiles button svg[data-i="pin"], .minitiles button svg[data-i="truck"] { --t1: #3DD68C; --t2: #12945A; }
.minitiles button.main { grid-column: 1 / -1; order: -1; flex-direction: row; justify-content: center; gap: 10px; min-height: 56px; margin-bottom: 4px; border-radius: 18px; font-size: 18px; font-weight: 700; }
.minitiles button.main svg { padding: 0; background: none; box-shadow: none; color: inherit; }
.minitiles button.alert svg { --t1: #FF7A6B; --t2: #C8281C; }
.minitiles button.alert { color: var(--danger); background: none; }
.minitiles button.done svg { --t1: #3DD68C; --t2: #12945A; }
.minitiles button:disabled { opacity: .4; }
.cust-b .custhero + .custpanel { margin-top: -48px; }

/* ---------- catalog: hero head with the customer, the rail, product cards ---------- */
.cathead { border-radius: 0 0 24px 24px; }
.cathead .seg { background: rgba(255, 255, 255, .14); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); }
.cathead .seg button[aria-pressed="true"] { color: var(--brand-deep); }
.catbar { background: color-mix(in srgb, var(--bg) 88%, transparent); }
.cat .cic, .cat .pic.logo { border-radius: 18px; box-shadow: var(--sh-1); border: 0; }
.cat[aria-pressed="true"] .cic, .cat[aria-pressed="true"] .pic.logo { box-shadow: 0 0 0 2.5px var(--brand-2), 0 8px 18px -6px rgba(3, 78, 161, .45); }
.cat[aria-pressed="true"] .cic { background: linear-gradient(150deg, #3B8BF0, #034EA1); color: #fff; }
.pcard { border-radius: 22px; box-shadow: var(--sh-1); border: 0; }
.pcard.in { box-shadow: 0 0 0 2px var(--brand-2), var(--sh-2); }
.pcard .media .pic:not(.none) { padding: 12px; background: linear-gradient(180deg, #FFFFFF, #F4F7FC); }   /* a photo sits on white; a lettered tile keeps its colour */
.pcard .nm { font-weight: 500; }
.pcard .price b { color: var(--ink); font-weight: 700; font-size: 17px; }
.stock { background: rgba(11, 27, 58, .74); backdrop-filter: blur(4px); border-radius: 8px; }
.cartmain { border-radius: 22px; padding: 8px 8px 8px 18px; min-height: 66px; color: var(--act-ink);
  background: linear-gradient(170deg, #FFC54D, #FFB020 45%, #F09A0A); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 16px 30px -10px rgba(229, 138, 0, .7); }
.cicon { width: 48px; height: 48px; border-radius: 16px; background: rgba(43, 26, 0, .9); color: #FFC54D; }
.cicon .badge { background: #fff; color: var(--act-ink); }
.cartmain .sum b { font-weight: 700; }
.cartmain .go { background: rgba(43, 26, 0, .9); color: #fff; border-radius: 14px; }

/* ---------- documents: lines, totals ---------- */
.lcard, .rline { border-radius: 18px; box-shadow: var(--sh-1); }
.docfoot { border-radius: 26px 26px 0 0; box-shadow: 0 -10px 30px rgba(11, 46, 99, .1); }
.docfoot .sum b { font-weight: 700; }

/* a document's way to Bayan: the road again, a stop per stage */
.docroad { display: grid; grid-template-columns: repeat(4, 1fr); margin: 4px 0 8px; position: relative; }
.docroad::before { content: ""; position: absolute; top: 13px; inset-inline: calc(50% / var(--n, 4)); border-top: 2.5px dashed color-mix(in srgb, var(--brand-2) 40%, transparent); }
.docroad .st { position: relative; display: grid; justify-items: center; gap: 6px; font-size: 12px; color: var(--muted); text-align: center; line-height: 1.3; }
.docroad .st i { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); box-shadow: inset 0 0 0 2.5px color-mix(in srgb, var(--brand-2) 40%, transparent); z-index: 1; }
.docroad .st i svg { width: 15px; height: 15px; stroke-width: 2.6; }
.docroad .st.done i { background: linear-gradient(150deg, #3B8BF0, #034EA1); color: #fff; box-shadow: 0 4px 10px -4px rgba(3, 78, 161, .6); }
.docroad .st.done { color: var(--ink); }
.docroad .st.now i { background: linear-gradient(170deg, #FFC54D, #F09A0A); color: var(--act-ink); box-shadow: 0 0 0 5px var(--act-wash); }
.docroad .st.now { color: var(--ink); font-weight: 700; }
.docroad .st.bad i { background: var(--danger); color: #fff; box-shadow: 0 0 0 5px var(--danger-wash); }
.docroad .st.bad { color: var(--danger); font-weight: 700; }

/* ---------- chat ---------- */
.clist { border-radius: var(--r-panel); }
.crow { padding: 12px 16px; min-height: 72px; }
.crow .top b { font-weight: 700; }
.crow .count { background: linear-gradient(150deg, #3B8BF0, #034EA1); }
.avatar { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 4px 10px -4px rgba(11, 46, 99, .5); background: linear-gradient(150deg, color-mix(in srgb, var(--c, #034EA1) 70%, white), var(--c, #034EA1)) !important; }
.avatar[style*="linear-gradient"] { background: linear-gradient(150deg, #3B8BF0, #0B2E63) !important; }
.bub.me { background: linear-gradient(160deg, #2F7BE5, #034EA1); }
.bub { border-radius: 20px; }
main.thread { background: var(--bg); }

/* ---------- sheets, toasts, login ---------- */
.sheet { border-radius: 30px 30px 0 0; box-shadow: 0 -20px 50px rgba(6, 20, 50, .25); }
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--faint) 50%, transparent); }
.sheet h3 { font-weight: 700; }
.toast { border-radius: 16px; background: #0B2E63; box-shadow: var(--sh-2); }
.login { position: relative; max-width: none; margin: 0; padding: 0; justify-content: flex-start; gap: 0; min-height: 100vh; background: var(--bg); }
.login .brandmark { margin: 0; padding: calc(48px + env(safe-area-inset-top, 0px)) 24px 86px; background: var(--roadmark) left -80px top 80px / 560px auto no-repeat, var(--grad-hero); border-radius: 0 0 40px 40px; }
.login .brandmark svg { height: 170px; max-width: 100%; }
.login .brandmark text { fill: #fff !important; }
.login .form { position: relative; z-index: 1; margin: -56px 20px 0; padding: 24px 20px 22px; background: var(--surface); border-radius: 28px; box-shadow: var(--sh-2); max-width: 440px; align-self: center; width: calc(100% - 40px); }
.login .uline input { border-bottom: 0; height: 52px; border-radius: 14px; padding: 0 14px; background: var(--bg); font-size: 18px; font-weight: 500; margin-top: 6px; }
.login .uline input:focus { box-shadow: inset 0 0 0 2px var(--brand-2); }
.login .uline > span { font-weight: 500; }
.login .form .pill { width: 100%; }
.login > .center, .login > p { align-self: center; }

/* drivers and pickers: the same hero, the next job in a glass card inside it */
section.hero.slim { padding-bottom: 60px; }
.hero.slim .mainaction { margin-top: 20px; min-height: 88px; border-radius: 22px; color: #fff; text-align: start;
  background: linear-gradient(160deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, .06)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); backdrop-filter: blur(8px); }
.hero.slim .mainaction .ic { width: 52px; height: 52px; border-radius: 16px; color: var(--act-ink); background: linear-gradient(170deg, #FFC54D, #F09A0A); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5); }
.hero.slim .mainaction b { font-size: 18px; font-weight: 700; line-height: 1.35; }
.hero.slim .mainaction span { color: var(--onhero); opacity: 1; }
.home-b > .quick3 { position: relative; z-index: 2; margin-top: -42px; padding: 12px; gap: 8px; border-radius: 26px; background: var(--surface); box-shadow: var(--sh-2); }
.quick3 button { border: 0; box-shadow: none; background: none; padding: 8px 4px; font-weight: 500; gap: 8px; position: relative; }
.quick3 button .ic { width: 52px; height: 52px; border-radius: 17px; }
.quick3 button .n { position: absolute; top: 0; inset-inline-end: calc(50% - 34px); background: var(--act); color: var(--act-ink); font-weight: 700; box-shadow: 0 0 0 2px var(--surface); }
.strip { border-radius: var(--r-panel); box-shadow: var(--sh-1); }
.strip b { font-weight: 700; }
.home-b > .card.row { margin-top: 12px; border-radius: var(--r-panel); width: auto; }

/* forms: filled fields, the label above */
.uline > span { font-weight: 500; margin-bottom: 6px; }
.uline input, .uline select { height: 54px; border: 0; border-radius: 16px; background: var(--surface); padding: 0 16px; box-shadow: var(--sh-1), inset 0 0 0 1px var(--line); font-size: 18px; font-weight: 500; }
.uline input:focus, .uline select:focus { outline: 0; box-shadow: var(--sh-1), inset 0 0 0 2px var(--brand-2); }
.form { gap: 20px; }
textarea.input { border-radius: 16px; box-shadow: var(--sh-1), inset 0 0 0 1px var(--line); background: var(--surface); }

/* chat rows: long previews stay inside the card */
.crow .bot span:first-child { flex: 1; min-width: 0; }
.crow .main { overflow: hidden; }

/* customer search: «زبون جديد» as the first card, new ones waiting for Bayan under it */
.newslot { display: grid; gap: 10px; margin-bottom: 12px; }
.newcustbtn { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 68px; padding: 12px 16px; border: 0; border-radius: var(--r-panel); cursor: pointer; text-align: start; font: inherit; color: var(--ink);
  background: var(--surface); box-shadow: var(--sh-1), inset 0 0 0 1.5px color-mix(in srgb, var(--brand-2) 35%, transparent); }
.newcustbtn .ic { width: 44px; height: 44px; flex: none; border-radius: 14px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(150deg, #2CC6B0, #0A8577); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .38), 0 6px 14px -4px rgba(10, 133, 119, .6); }
.newcustbtn .ic svg { width: 24px; height: 24px; stroke-width: 2.4; }
.newcustbtn .t { flex: 1; min-width: 0; display: grid; }
.newcustbtn .t b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.newcustbtn .t span { font-size: 13px; color: var(--muted); }
.pendingnew .row { opacity: .85; }
.newcust .pill { width: 100%; }

/* the document's store: a chip under the customer's name in the header, a list to choose from */
.storechip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; margin-top: 2px; padding: 3px 10px 3px 12px; border: 0; border-radius: 12px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 500; color: #fff;
  background: rgba(255, 255, 255, .14); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); }
.storechip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.storechip svg { width: 15px; height: 15px; flex: none; }
.storechip svg[data-i="back"] { transform: rotate(-90deg); opacity: .8; }
.storepick .menu button.on { background: var(--brand-wash); }
.storebar { display: grid; gap: 6px; }
.storebar > small { font-size: 13px; color: var(--muted); }
.storebar .segbar { padding: 0; flex-wrap: wrap; justify-content: flex-start; }
.storebar .segbar button { flex: 1 1 auto; min-height: 48px; flex-direction: column; gap: 0; line-height: 1.2; padding: 4px 10px; }
.storebar .segbar button small { font-size: 12px; opacity: .8; }
.fromstore { position: absolute; top: 8px; inset-inline-end: 8px; max-width: 70%; padding: 0 8px; border-radius: 8px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 500; line-height: 20px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* no coloured side stripes: a thin ring says ok / short / missing */
.vform .frow, .delivery .dline { border-inline-start: 0; }
.vform .frow.ok, .delivery .dline:not(.short):not(.todo) { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ok) 50%, transparent), var(--sh-1); }
.vform .frow.absent, .delivery .dline.short { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--danger) 55%, transparent), var(--sh-1); }
.delivery .pline.todo { box-shadow: var(--sh-1); }
.vform .frow, .delivery .dline { border-radius: 18px; }

/* كشف الفواتير اليومية: the three totals, then the sections */
.kpis3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 4px 0 10px; }
.kpis3 .kpi { padding: 12px 10px; display: grid; gap: 4px; text-align: center; }
.kpis3 .kpi small { color: var(--muted); font-size: 12px; }
.kpis3 .kpi b { font-size: 16px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.row .meta.exp { color: var(--ok, #0E8A5F); font-weight: 500; }
.row .meta.exp.neg { color: var(--danger); }
/* the new customer's shop photo */
.newcust .ncphoto { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.newcust .ncphoto > .small { flex-basis: 100%; }
/* 1.24.0: Bayan's descriptions, picked from its own values; a required field's mark */
.newcust .ncdnames { display: grid; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--bg); }
.newcust .ncdnames select { width: 100%; height: 46px; border: 0; border-bottom: 1.5px solid var(--faint); background: transparent; font-size: 17px; font-weight: 600; padding: 0 2px; }
.newcust .ncdnames select:focus { outline: 0; border-bottom-color: var(--brand-2); }
.newcust .reqmark { color: var(--danger); }
.newcust .ncphotos { display: contents; }
.docphotos { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 12px; }
.newcust .ncthumb, .docphotos .ncthumb { position: relative; width: 64px; height: 64px; border-radius: 14px; overflow: hidden; box-shadow: var(--sh-1); }
.newcust .ncthumb img, .docphotos .ncthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.newcust .ncthumb button, .docphotos .ncthumb button { position: absolute; inset-block-start: 3px; inset-inline-end: 3px; width: 24px; height: 24px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgb(0 0 0 / .55); color: #fff; padding: 0; }
.newcust .ncthumb button svg, .docphotos .ncthumb button svg { width: 14px; height: 14px; }
.newcust .ncshot { min-height: 44px; }

/* دليل الاستخدام */
.helpscreen .searchbar { margin-bottom: 10px; }
.helpcard { margin-bottom: 12px; padding: 14px 16px; }
.helpcard h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 17px; }
.helpcard h2 svg { width: 20px; height: 20px; color: var(--brand, #034EA1); }
.helprow { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.helpcard h2 + .helprow { border-top: 0; }
.helprow .ic { flex: none; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--brand, #034EA1) 12%, transparent); color: var(--brand, #034EA1); }
.helprow .ic svg { width: 17px; height: 17px; }
.helprow b { display: block; font-size: 15px; }
.helprow p { margin: 3px 0 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.helpoff summary { cursor: pointer; font-weight: 600; color: var(--muted); padding: 2px 0; min-height: 32px; display: flex; align-items: center; }
.helpoff .helprow b { color: var(--muted); }
.helplink { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; text-decoration: none; color: inherit; }
.helplink .ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--brand, #034EA1) 12%, transparent); color: var(--brand, #034EA1); }
.helplink .main { flex: 1; }

/* licence stopped: covers the app until the company renews */
.licstop { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(6px); }
.licstop .box { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 24px; max-width: 380px; text-align: center; box-shadow: var(--shadow); }
.licstop h2 { margin: 0 0 10px; font-size: 19px; } .licstop p { margin: 0 0 18px; color: var(--muted); line-height: 1.75; }
.licstop .pill { width: 100%; }

/* ---------- 1.9.31 ---------- */
[hidden] { display: none !important; }
/* the cart in the header (where the scanner was) with its count; pressed = the grid shows the cart */
.cathead .cartbtn { position: relative; }
.cathead .cartbtn .badge { position: absolute; top: -5px; inset-inline-end: -5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: #FFB547; color: #3a2400; font-size: 11.5px; font-weight: 700; line-height: 20px; text-align: center; box-shadow: 0 0 0 2px var(--brand-deep); }
.cathead .cartbtn .badge:empty { display: none; }
.cathead .cartbtn[aria-pressed="true"] { background: #fff; color: var(--brand-deep); box-shadow: none; }
/* the scanner inside the search bar */
.searchbar .scanbtn { flex: none; width: 42px; height: 42px; border: 0; border-radius: 13px; background: var(--brand-wash); color: var(--brand-ink); display: grid; place-items: center; cursor: pointer; }
.searchbar .scanbtn svg { width: 22px; height: 22px; color: inherit; }
.searchbar .scanbtn:active { transform: scale(.94); }
/* a product with no price in Bayan (the rep prices it) */
.pcard .price .noprice { font-size: 13px; font-weight: 700; color: var(--muted); }
/* the note on a product line (Bill.RemarkI in Bayan) */
.psheet .lnote-in { margin-top: 12px; }
.psheet .lnote-in input { font-size: 16px; font-weight: 500; }
.lnote { display: flex; align-items: center; gap: 5px; margin-top: 3px; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.lnote svg { width: 14px; height: 14px; flex: none; }
/* due invoices: the three age limits under one caption */
.agerow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
/* phone browsers without color-mix() (Chrome before 111) drop those declarations: plain colours for what must stay visible */
@supports not (color: color-mix(in srgb, red 50%, white)) {
  .catbar, .searchbar, .docbar, .licstop { background: var(--bg); }
  .tabbar { background: var(--surface); }
  .seg { background: var(--brand-wash); }
  :root[data-scheme="dark"] { --brand-2: #6E9BE0; --brand-ink: #8DB4EE; }
}

/* Bayan's note on an invoice, under it on the receipt screen */
.invnote { color: var(--muted); white-space: normal; overflow-wrap: anywhere; margin-top: 2px; }
.invnote b { font-weight: 600; }   /* «ملاحظة:» / «الشرح:» before Bayan's note and memo */

/* 1.14 — an invoice line's figures, each under its own label: count, price, discount, batch, expiry (and on a sales
   order what was executed); the same columns on every line so they read down the invoice */
.row.iline { flex-direction: column; align-items: stretch; gap: 0; }
.row.iline .ihead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.row.iline .ihead .title { min-width: 0; }
.row.iline .ihead .money { flex: none; font-weight: 700; }
.lcells { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 4px; margin-top: 6px; }
.lcells > span { display: flex; flex-direction: column; gap: 1px; min-width: 0; padding: 4px 5px; border-radius: 8px; background: var(--bg); line-height: 1.25; }
.lcells small { font-size: 10.5px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lcells b { font-size: 12.5px; font-weight: 600; letter-spacing: -.2px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lcells .ok b { color: var(--ok); }
.lcells .wait b { color: var(--warn); }
.lcells .neg b { color: var(--danger); }

/* 1.14 — home «هذا الشهر»: the hero's day readings summed since the 1st, each opening its list */
.monthcard { margin: 14px 0 4px; padding: 12px 12px 10px; background: var(--surface); border-radius: var(--r-tile); box-shadow: var(--shadow); }
.monthcard .mhead { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 4px 10px; }
.monthcard .mhead b { font-size: 15px; }
.monthcard .mhead span { font-size: 12px; color: var(--muted); }
.monthcard .mfigs { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 8px; }
.monthcard .mfig { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 10px; border-radius: 14px; background: var(--brand-wash); color: var(--ink); text-decoration: none; }
.monthcard .mfig small { font-size: 12px; font-weight: 600; color: var(--muted); }
.monthcard .mfig b { font-size: 16px; color: var(--brand-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.monthcard .mfig:active { transform: scale(.98); }

/* 1.14 — تفاصيل المواد as cards: the catalog's card, without the add button */
.pcard.info .foot { padding-top: 6px; }
.pcard.info .price small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard.info .price .alt { margin-top: 2px; }
.pcard.info:focus-visible { outline: 3px solid rgba(var(--brand-rgb), .45); outline-offset: 2px; }
.pcard.info .price > * { justify-self: start; }
.lcells.tight > span { padding: 4px 4px; }
.lcells.tight small { font-size: 9.5px; }

/* 1.18.0 «المشروع»: the project chips (a label, then «كل المشاريع» and each project) and an invoice's project beside its number */
.prochips > span { align-self: center; flex-shrink: 0; }
.prochips.wrap { flex-wrap: wrap; overflow: visible; row-gap: 8px; }
.protag { margin-inline-start: 6px; vertical-align: 1px; font-size: 11.5px; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duetable .inv small.pro { color: var(--brand-ink); font-weight: 500; }
/* 1.24.0 «الرصيد التراكمي»: at the end of the invoice's line, the sum owed up to it */
.duetable .inv small.cum { margin-inline-start: auto; color: var(--ink); white-space: nowrap; }
.duetable .inv small.cum b { font-size: 13px; font-weight: 800; }

/* 1.21.0 — picking with a scanner and several pickers; the gift of another item; the promoter's sales */
.scanbar { display: flex; gap: 8px; align-items: center; margin: 4px 0 12px; }
.scanbar .input { flex: 1; min-width: 0; }
.delivery .pline .pby { display: flex; align-items: center; gap: 8px; margin: 6px 4px 0; font-size: 13px; color: var(--ok); font-weight: 600; }
.delivery .pline .pby.part { color: var(--warn); }
.delivery .pline .pby svg { width: 14px; height: 14px; flex: none; }
.delivery .pline .pby span + span::before { content: '·'; margin-inline-end: 8px; color: var(--faint); font-weight: 400; }
.delivery .pline .pby .muted { font-weight: 400; }
.delivery .dline.pline.part:not(.short) { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--warn) 55%, transparent), var(--sh-1); }
.delivery .dline.flash { animation: pickflash .6s ease; }
@keyframes pickflash { 0% { background: var(--ok-wash); } 100% { background: var(--surface); } }
@media (prefers-reduced-motion: reduce) { .delivery .dline.flash { animation: none; } }
.tag.buy { margin-inline-start: 6px; background: var(--warn-wash); color: var(--warn); font-size: 11px; vertical-align: middle; }
.giftpick { display: grid; gap: 6px; margin: 12px 0 8px; }
.giftpick .chips { flex-wrap: wrap; }
.giftpick .chip svg { width: 14px; height: 14px; }
.rline.promo .pricebox { display: grid; gap: 2px; width: 100%; max-width: 180px; }
.rline.promo .pricebox .input { padding: 6px 10px; font-size: 15px; }
.rline.promo .end { display: grid; gap: 6px; justify-items: end; }
.linkbtn { border: 0; background: none; padding: 2px 0; font: inherit; cursor: pointer; text-decoration: underline; color: var(--brand-ink); }
.linkbtn.neg { color: var(--danger); }

/* المندوب العلمي — his doctors, the month's list, the call report, his samples, requests and coaching sheets */
.tag.plain { background: var(--bg); color: var(--muted); }
.okc { color: var(--ok); font-weight: 700; }
.row.off .title { text-decoration: line-through; color: var(--muted); }
.row .end .tag + .tag { margin-inline-start: 4px; }
.list.flat { background: none; box-shadow: none; border-radius: 0; }
.list.flat .row { padding-inline: 0; }
.list.flat .row:last-child { border-bottom: 0; }
.sheet .tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.sheetbtns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }
.sheetbtns:empty { display: none; }
.scigrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.scigrid label { display: grid; gap: 4px; min-width: 0; }
.searchbar.inpage { top: env(safe-area-inset-top, 0px); }   /* on a tab page: no header bar above it */
.scicallview .when { margin: 0; }
.row .scisaid { margin-top: 3px; font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }   /* what an approver wrote: read whole, never cut */
.scilines .ln { padding: 10px 0; border-bottom: 1px solid var(--line); }
.scilines .ln .nm { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.scicallview .kv { margin-top: 14px; }
.scicallview .kv dd { text-align: start; }
.sciwhen { margin: 0 4px 8px; }
.sciplace { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); font-size: 14.5px; font-weight: 500; }
.sciplace > svg { width: 22px; height: 22px; flex: none; }
.sciplace > span { flex: 1; min-width: 0; }
.sciplace.ok { color: var(--ok); }
.sciplace.warn { background: var(--warn-wash); color: var(--warn); box-shadow: none; }
.sciplace.info { background: var(--brand-wash); color: var(--brand-ink); box-shadow: none; }
.sciplace .linkbtn { color: inherit; font-size: 13px; flex: none; }
.scioff { display: grid; gap: 4px; margin: 12px 0 0; padding: 12px 14px; }
.scioff .uline { margin-top: 6px; }
.scioff .uline > span { color: inherit; }
.scioff .uline input { border-bottom-color: currentColor; }
.sciwith { display: grid; gap: 4px; margin-top: 10px; }
.scicall .titlerow .pill.small { min-height: 38px; }
.scilines.edit { display: grid; gap: 10px; }
.sciline { display: grid; gap: 8px; padding: 12px 14px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.sciline .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sciline .top b { font-size: 16px; min-width: 0; overflow-wrap: anywhere; }
.sciline .top .iconbtn { width: 36px; height: 36px; color: var(--muted); }
.sciline .top .iconbtn svg { width: 20px; height: 20px; }
.sciline .segbar { padding: 0; }
.sciline .lbl { margin-top: 2px; font-size: 13px; font-weight: 600; color: var(--muted); }
.scicall .chips.wrap { flex-wrap: wrap; overflow: visible; padding: 0; }
.sciline .msgs .chip { min-height: 36px; height: auto; padding: 7px 14px; border-radius: 14px; white-space: normal; text-align: start; line-height: 1.4; }
.sciline .samp { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.sciline .samp > span { display: grid; font-size: 14px; font-weight: 600; }
.sciline .samp small { font-weight: 400; color: var(--muted); }
.sciline .samp small.neg { color: var(--danger); }
.sciline .stepper button:disabled, .scilrow .stepper button:disabled { opacity: .35; }
.scitick { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand-wash); color: var(--brand-ink); }
.scitick.on { background: var(--ok); color: #fff; }
.scitick svg { width: 18px; height: 18px; }
.docfoot.sci .sum small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.docfoot.sci .sum b { display: block; font-size: 17px; }
.scilhead { display: grid; gap: 6px; }
.scilhead p { margin: 0; }
.scilhead .reply { padding: 8px 12px; border-radius: 10px; background: var(--bg); white-space: pre-wrap; }
.scilhead .pill { justify-self: start; min-height: 40px; }
.scilhead.returned { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--danger) 55%, transparent), var(--shadow); }
.scilhead.approved { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ok) 50%, transparent), var(--shadow); }
.scitools { display: grid; gap: 8px; margin: 12px 0 10px; }
.scitools .chips { padding-bottom: 0; }
.scitools .pill { justify-self: start; min-height: 40px; }
.row.scilrow.in { background: color-mix(in srgb, var(--ok-wash) 55%, transparent); }
.scilrow .title { white-space: normal; }
.sciadd { min-height: 38px; padding: 0 12px; gap: 4px; }
.sciadd svg { width: 16px; height: 16px; }
.scitimes { display: grid; justify-items: center; min-width: 44px; }
.scitimes b { font-size: 19px; line-height: 1.2; }
.scitimes small { font-size: 12px; }
.strip.pick > button[aria-pressed="true"] { background: var(--brand-wash); }
.sciqty { font-size: 20px; }
.sciqty.zero { color: var(--faint); }
.sciqty.neg { color: var(--danger); }
.sciwho { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.sciwho > span { flex: 1; min-width: 0; display: grid; }
.sciavg .big { display: flex; align-items: baseline; gap: 10px; }
.sciavg .big b { font-size: 40px; line-height: 1; }
.sciavg .big small { color: var(--muted); }
.sciavg .skills, .scisheet .skills { display: grid; gap: 8px; margin-top: 12px; }
.sciavg .sk, .scisheet .sk { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; font-size: 14px; }
.scisheet .sk { grid-template-columns: 1fr auto; }
.scibar { display: block; width: 96px; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.scibar i { display: block; height: 100%; border-radius: 4px; background: var(--brand-2); }
.scidots { display: inline-flex; gap: 5px; }
.scidots i { width: 11px; height: 11px; border-radius: 50%; background: var(--line); }
.scidots i.on { background: var(--brand-2); }
.scisheet .head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.scisheet .head b, .scisheet .head small { display: block; }
.scisheet .note { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--bg); white-space: pre-wrap; }

/* =====================================================================
   1.23.0 — older phones, tablets, switching company
   ===================================================================== */

/* the first paint: index.html draws this until the app's first screen replaces it, so a slow start (an older phone, a
   weak signal, the other company opening) shows the brand, not an empty page */
.splash { position: fixed; inset: 0; display: grid; place-items: center; background: var(--grad-hero); }
.splash img { width: 84px; height: 84px; border-radius: 24px; box-shadow: 0 12px 32px rgba(0, 0, 0, .28); }

/* «الشركات»: another company is opening — this page stays on the screen until the new one is in, covered meanwhile */
.co-opening { position: fixed; inset: 0; z-index: 97; display: grid; place-content: center; justify-items: center; gap: 10px;
  padding: 24px; text-align: center; color: #fff; background: var(--grad-hero); }
.co-opening .co-ic { width: 68px; height: 68px; border-radius: 22px; display: grid; place-items: center; margin-bottom: 6px;
  background: rgba(255, 255, 255, .14); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); }
.co-opening .co-ic svg { width: 34px; height: 34px; }
.co-opening b { font-size: 22px; font-weight: 700; line-height: 1.35; max-width: 20em; overflow-wrap: anywhere; }
.co-opening > span:not(.co-ic):not(.spin) { color: var(--onhero); }
.co-opening .spin { width: 30px; height: 30px; margin-top: 8px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .25); border-top-color: #fff; animation: cospin .8s linear infinite; }
@keyframes cospin { to { transform: rotate(360deg); } }
.co-opening .slow { display: grid; justify-items: center; gap: 12px; min-height: 24px; margin-top: 6px; font-size: 14px; color: var(--onhero); }
.co-opening .slow .pill { color: #fff; border-color: rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .1); }

/* الإعدادات ← المظهر: the lite mode */
.litepick { display: grid; gap: 8px; }
.litepick .title { font-weight: 700; }

/* «الوضع الخفيف» (boot.js decides, lite.js switches): what costs an older phone most is gone — no motion (every
   animation at its end state at once, so nothing waits on one), no frosted glass (backdrop blur on the tab bar, the
   sticky bars, each product's badge), one light shadow instead of two soft ones, solid bars */
:root.lite *, :root.lite *::before, :root.lite *::after {
  animation-duration: 1ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important;
  transition-duration: 0s !important; transition-delay: 0s !important; scroll-behavior: auto !important;
  backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
:root.lite .co-opening .spin { animation-duration: .8s !important; animation-iteration-count: infinite !important; }   /* the one motion kept: it says the app is working */
:root.lite { --shadow: 0 1px 3px rgba(11, 46, 99, .14); --sh-1: 0 1px 3px rgba(11, 46, 99, .12); --sh-2: 0 2px 6px rgba(11, 46, 99, .16); --soft: var(--sh-1); }
:root.lite[data-scheme="dark"] { --shadow: 0 1px 3px rgba(0, 0, 0, .5); --sh-1: 0 1px 3px rgba(0, 0, 0, .45); --sh-2: 0 2px 6px rgba(0, 0, 0, .5); }
@media (prefers-color-scheme: dark) { :root.lite[data-scheme="auto"] { --shadow: 0 1px 3px rgba(0, 0, 0, .5); --sh-1: 0 1px 3px rgba(0, 0, 0, .45); --sh-2: 0 2px 6px rgba(0, 0, 0, .5); } }
:root.lite .tabbar { background: var(--surface); box-shadow: 0 -1px 0 var(--line); }
:root.lite .catbar, :root.lite .searchbar, :root.lite .docbar, :root.lite .composer, :root.lite .success { background: var(--bg); }
:root.lite .stock { background: rgba(11, 27, 58, .86); }
:root.lite .topbar, :root.lite .docfoot, :root.lite .sheet { box-shadow: none; }
:root.lite .docfoot { border-top: 1px solid var(--line); }
:root.lite .tabbar a.centre .bub { box-shadow: 0 0 0 5px var(--surface); }
:root.lite .toprow .logo-sm, :root.lite .road .pin { filter: none; }

/* tablets: the screens keep their 720 px column (main.screen); what spans the screen — the header, the tab bar, the
   bars at the bottom — keeps its buttons over that column, and sheets and messages are not stretched across */
@media (min-width: 720px) {
  .topbar { padding-left: max(8px, env(safe-area-inset-left, 0px), calc(50% - 360px)); padding-right: max(8px, env(safe-area-inset-right, 0px), calc(50% - 360px)); }
  .tabbar, .composer { padding-left: max(var(--gut-l), calc(50% - 360px)); padding-right: max(var(--gut-r), calc(50% - 360px)); }
  .docfoot { inset-inline: max(0px, calc(50% - 360px)); }
  .scrim { justify-content: center; }
  .sheet { max-width: 640px; }
  .toast { max-width: 560px; margin-inline: auto; }
}
