@font-face{font-family:"IBM Plex Sans Arabic";font-style:normal;font-display:swap;font-weight:400;src:url("fonts/plex-arabic-arabic-400.woff2") format("woff2");unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0898-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC,U+102E0-102FB,U+10E60-10E7E,U+10EFD-10EFF,U+1EE00-1EE03,U+1EE05-1EE1F,U+1EE21-1EE22,U+1EE24,U+1EE27,U+1EE29-1EE32,U+1EE34-1EE37,U+1EE39,U+1EE3B,U+1EE42,U+1EE47,U+1EE49,U+1EE4B,U+1EE4D-1EE4F,U+1EE51-1EE52,U+1EE54,U+1EE57,U+1EE59,U+1EE5B,U+1EE5D,U+1EE5F,U+1EE61-1EE62,U+1EE64,U+1EE67-1EE6A,U+1EE6C-1EE72,U+1EE74-1EE77,U+1EE79-1EE7C,U+1EE7E,U+1EE80-1EE89,U+1EE8B-1EE9B,U+1EEA1-1EEA3,U+1EEA5-1EEA9,U+1EEAB-1EEBB,U+1EEF0-1EEF1}
@font-face{font-family:"IBM Plex Sans Arabic";font-style:normal;font-display:swap;font-weight:600;src:url("fonts/plex-arabic-arabic-600.woff2") format("woff2");unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0898-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC,U+102E0-102FB,U+10E60-10E7E,U+10EFD-10EFF,U+1EE00-1EE03,U+1EE05-1EE1F,U+1EE21-1EE22,U+1EE24,U+1EE27,U+1EE29-1EE32,U+1EE34-1EE37,U+1EE39,U+1EE3B,U+1EE42,U+1EE47,U+1EE49,U+1EE4B,U+1EE4D-1EE4F,U+1EE51-1EE52,U+1EE54,U+1EE57,U+1EE59,U+1EE5B,U+1EE5D,U+1EE5F,U+1EE61-1EE62,U+1EE64,U+1EE67-1EE6A,U+1EE6C-1EE72,U+1EE74-1EE77,U+1EE79-1EE7C,U+1EE7E,U+1EE80-1EE89,U+1EE8B-1EE9B,U+1EEA1-1EEA3,U+1EEA5-1EEA9,U+1EEAB-1EEBB,U+1EEF0-1EEF1}
@font-face{font-family:"IBM Plex Sans Arabic";font-style:normal;font-display:swap;font-weight:700;src:url("fonts/plex-arabic-arabic-700.woff2") format("woff2");unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0898-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC,U+102E0-102FB,U+10E60-10E7E,U+10EFD-10EFF,U+1EE00-1EE03,U+1EE05-1EE1F,U+1EE21-1EE22,U+1EE24,U+1EE27,U+1EE29-1EE32,U+1EE34-1EE37,U+1EE39,U+1EE3B,U+1EE42,U+1EE47,U+1EE49,U+1EE4B,U+1EE4D-1EE4F,U+1EE51-1EE52,U+1EE54,U+1EE57,U+1EE59,U+1EE5B,U+1EE5D,U+1EE5F,U+1EE61-1EE62,U+1EE64,U+1EE67-1EE6A,U+1EE6C-1EE72,U+1EE74-1EE77,U+1EE79-1EE7C,U+1EE7E,U+1EE80-1EE89,U+1EE8B-1EE9B,U+1EEA1-1EEA3,U+1EEA5-1EEA9,U+1EEAB-1EEBB,U+1EEF0-1EEF1}
@font-face{font-family:"IBM Plex Sans Arabic";font-style:normal;font-display:swap;font-weight:400;src:url("fonts/plex-arabic-latin-400.woff2") format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"IBM Plex Sans Arabic";font-style:normal;font-display:swap;font-weight:600;src:url("fonts/plex-arabic-latin-600.woff2") format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"IBM Plex Sans Arabic";font-style:normal;font-display:swap;font-weight:700;src:url("fonts/plex-arabic-latin-700.woff2") format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
/* L'Exigence Médicale — one stylesheet. Colours are tokens only (light, dark by system).
   Layout: navy header band (logo chip + title + language), tool row, page tabs by group, then the page. */
:root {
  --bg: #F3F4F7; --surface: #FFFFFF; --surface-2: #F8F9FB; --line: #DCE0E8;
  --fg: #1B2A4A; --muted: #5C6780; --navy: #1B2A4A; --on-navy: #FFFFFF;
  --gold: #A9822E; --gold-bright: #D4B064; --gold-soft: #F4ECDC; --focus: #7A5C18; --line-strong: #7A8499; /* focus ring and the edge of a box ≥ 3:1 on every surface (WCAG 1.4.11) */ --gold-ink: #7A5C18; /* gold for text: readable (5:1) */
  --good: #1F7A4D; --good-bg: #E3F3EA; --warn: #8A5E00; --warn-bg: #FBF0D6;
  --info: #2B5A9E; --info-bg: #E4ECF8; --bad: #A33A3A; --bad-bg: #F7E3E3;
  --badge: #C0392B; --on-badge: #FFFFFF; --primary: #1B2A4A; --on-primary: #FFFFFF; --overlay: rgba(10, 15, 30, .55); --shadow: 0 8px 24px rgba(16, 24, 40, .12);
  --f-ui: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --f-mono: ui-monospace, Menlo, Consolas, monospace;
  --fs-1: 12px; --fs-2: 13.5px; --fs-3: 15px; --fs-4: 17px; --fs-5: 20px;
  --r: 12px; --gap: 12px;
  color-scheme: light;
}
/* Arabic letters are smaller than Latin ones at the same size: the two small sizes a step bigger on an Arabic
   page (12 → 13, 13.5 → 14.5), so a chip, a hint or a date stays readable on a phone in the sun */
:root:lang(ar) { --fs-1: 13px; --fs-2: 14.5px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1524; --surface: #172036; --surface-2: #1C2741; --line: #2C3956; --fg: #E7EBF3; --muted: #9AA6BF;
    --navy: #0B1120; --on-navy: #FFFFFF; --gold: #D4B064; --gold-soft: #2E2A20; --focus: #D4B064; --line-strong: #7886A3; --gold-ink: #D4B064;
    --good: #6FD19F; --good-bg: #16382A; --warn: #F0C25A; --warn-bg: #3A2F12; --info: #8DB4F0; --info-bg: #1B2D4D;
    --bad: #F09A9A; --bad-bg: #3D1C1F; --badge: #B3261E; --primary: #D4B064; --on-primary: #10172A; --overlay: rgba(0, 0, 0, .6); --shadow: 0 8px 24px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 var(--fs-3)/1.6 var(--f-ui); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* on the navy band the ring is the bright gold (the dark gold is not seen there) */
header.top :focus-visible, .tip :focus-visible { outline-color: var(--gold-bright); }
/* (WCAG 2.4.1) «skip to the content»: the first stop of the keyboard, seen only when it has the focus */
.skip { position: absolute; z-index: 300; inset-inline-start: 8px; top: 8px; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 2px solid var(--gold-bright); background: var(--navy); color: var(--on-navy); font-weight: 700; cursor: pointer; transform: translateY(-200%); }
.skip:focus { transform: none; }
[hidden] { display: none !important; }
.wrap { max-width: 1120px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.muted { color: var(--muted); }
.ltr { direction: ltr; unicode-bidi: isolate; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- header band ---------- */
header.top { background: var(--navy); color: var(--on-navy); padding-top: env(safe-area-inset-top, 0px); }
header.top .wrap { display: flex; align-items: center; gap: 16px; min-height: 84px; padding-block: 10px; }
.brand { background: #FFFFFF; border-radius: 12px; padding: 6px 12px; display: flex; align-items: center; flex: 0 0 auto; }
.brand img { display: block; height: 52px; width: auto; }
.htitle { flex: 1 1 auto; min-width: 0; }
/* heard by screen readers, not seen */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.htitle h1 { margin: 0; font-size: var(--fs-5); font-weight: 700; line-height: 1.3; overflow-wrap: break-word; }
/* very small phones: the title a little smaller, so words are never cut in the middle */
@media (max-width: 359px) { .htitle h1 { font-size: calc(var(--fs-5) * 0.85); } .brand img { height: 42px; } }
.htitle .co { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; white-space: nowrap; color: var(--gold-bright); font-size: var(--fs-2); font-weight: 600; direction: ltr; unicode-bidi: isolate; text-align: start; }
.hside { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.hbtn { min-width: 44px; min-height: 44px; border-radius: 10px; border: 1.5px solid var(--gold-bright); background: transparent; color: var(--on-navy); font-weight: 700; padding: 0 12px; cursor: pointer; }
.scanvid { width: 100%; max-height: 50vh; border-radius: 12px; background: #000; object-fit: cover; }
.remember { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-size: var(--fs-2); }
.remember input { width: 20px; height: 20px; margin: 0; accent-color: var(--navy); flex: 0 0 auto; }
@media (max-width: 640px) {
  header.top .wrap { min-height: 64px; gap: 10px; }
  .brand { padding: 4px 8px; }
  .brand img { height: 38px; }
  .htitle h1 { font-size: var(--fs-3); }
  .htitle .co { font-size: var(--fs-1); }
}

/* language menu */
.langmenu { position: relative; }
.langlist { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); background: var(--surface); color: var(--fg); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 4px; z-index: 50; min-width: 150px; max-width: calc(100vw - 16px); }
.langlist button { display: block; width: 100%; text-align: start; border: 0; background: transparent; padding: 10px 12px; border-radius: 8px; cursor: pointer; min-height: 44px; }
.langlist button[aria-current="true"] { background: var(--gold-soft); font-weight: 700; }

/* ---------- tool row and page tabs ---------- */
.toolrow { display: flex; align-items: center; gap: 8px; padding-block: 12px 4px; flex-wrap: wrap; }
.toolrow .grow { flex: 1 1 auto; }
/* the search, under the tool row on every page: one line, full width on a phone */
.srch { display: flex; gap: 8px; padding-block: 4px; }
.srch input { flex: 1 1 auto; min-width: 0; min-height: 44px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 6px 12px; background: var(--surface); color: var(--fg); font: inherit; } /* like the other boxes, not the browser's bare one */
.srch .btn { flex: 0 0 auto; }
.srres h3 { margin: 0; font-size: var(--fs-2, 1rem); }
.who { font-weight: 600; color: var(--muted); font-size: var(--fs-2); }
.groups { display: flex; gap: 6px; flex-wrap: wrap; padding-block: 6px; }
.groups button { white-space: nowrap; flex: 0 0 auto; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 14px; min-height: 44px; cursor: pointer; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.groups button[aria-pressed="true"] { background: var(--navy); color: var(--on-navy); border-color: var(--navy); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .groups button[aria-pressed="true"] { outline: 1.5px solid var(--gold); } }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; padding-block: 4px 10px; border-bottom: 1px solid var(--line); }
.tabs button { white-space: nowrap; flex: 0 0 auto; border: 0; background: transparent; border-radius: 10px; padding: 8px 12px; min-height: 44px; cursor: pointer; font-weight: 600; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.tabs button[aria-current="page"] { background: var(--gold-soft); color: var(--fg); }
/* phone: groups and tabs wrap onto a second line (nothing hidden sideways) */

/* ---------- buttons ---------- */
.btn { -webkit-touch-callout: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; min-width: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); cursor: pointer; font-weight: 600; white-space: nowrap; }
.btn.icon { padding: 0; width: 44px; font-size: 18px; }
.btn.icon { position: relative; }
.btn > .lbl.sr { position: absolute; inset: 0; width: auto; height: auto; clip-path: none; opacity: 0; overflow: hidden; color: transparent; user-select: none; font-size: 1px; line-height: 1; }
.btn.primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.btn.danger { color: var(--bad); border-color: var(--bad); background: var(--surface); }
.btn[disabled] { opacity: .55; cursor: default; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tip { position: fixed; z-index: 200; background: var(--navy); color: var(--on-navy); padding: 6px 10px; border-radius: 8px; font-size: var(--fs-2); pointer-events: none; max-width: 260px; box-shadow: var(--shadow); }

/* ---------- red counts ---------- */
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--badge); color: var(--on-badge); font-size: var(--fs-1); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- page ---------- */
main.page { padding-block: 14px 64px; }
.page h2 { font-size: var(--fs-5); margin: 6px 0 12px; }
.lead { color: var(--muted); margin: -6px 0 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.stack { display: grid; gap: var(--gap); }
/* a grid column is never pushed wider than the screen by something wide inside (a table scrolls in its own box) */
.stack > *, .todaygrid > *, .list > * { min-width: 0; } /* a list's row too: a long choice in a row (Egypt's VAT kinds) never widens the list's one column past the phone */

/* folds: one arrow rule — ▾ open, ◂ closed (right-to-left) / ▸ closed (left-to-right) */
details.fold { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
details.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 12px 16px; min-height: 52px; font-weight: 700; }
details.fold > summary::-webkit-details-marker { display: none; }
/* any other opening line (search in all, the old ones, «show all»…) is a finger's height too */
details:not(.fold) > summary { padding-block: 10px; cursor: pointer; }
details.fold > summary .arr { color: var(--gold-ink); width: 1em; text-align: center; flex: 0 0 auto; }
details.fold > summary .end { margin-inline-start: auto; display: flex; flex-wrap: wrap; justify-content: flex-end; min-width: 0; gap: 6px; align-items: center; }
details.fold > .body { padding: 0 16px 14px; }
details.fold details.fold { border-color: var(--line); background: var(--surface-2); }

/* forms */
.form { display: grid; gap: 12px; }
.field { display: grid; gap: 4px; min-width: 0; }
.field label { font-weight: 600; font-size: var(--fs-2); }
.field .hint { color: var(--muted); font-size: var(--fs-1); overflow-wrap: anywhere; white-space: pre-line; } /* (an example printed in another language goes on its own line) */ /* a long address in a hint wraps inside its field, never widens the row */
.field input, .field select, .field textarea { width: 100%; min-height: 44px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface-2); padding: 8px 12px; }
.field textarea { min-height: 88px; }
.field[data-err] input, .field[data-err] select, .field[data-err] textarea { border-color: var(--bad); }
.field .err, .mini .err, .addbox .err { color: var(--bad); font-size: var(--fs-2); font-weight: 600; }
[aria-invalid="true"] { border-color: var(--bad) !important; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
/* a label and its value (a customer's file): the label in a column of its own, the value beside it, wrapping there */
.kv { display: grid; grid-template-columns: minmax(6.5em, 32%) minmax(0, 1fr); gap: 2px 12px; align-items: baseline; }
.kv > b { overflow-wrap: anywhere; justify-self: start; } /* (a number or an address typed left to right stays at the start of an Arabic line) */
.msg { border-radius: 10px; padding: 10px 12px; font-weight: 600; }
.msg.bad { background: var(--bad-bg); color: var(--bad); }
.msg.good { background: var(--good-bg); color: var(--good); }
.msg.info { background: var(--info-bg); color: var(--info); }
.msg.warn { background: var(--warn-bg); color: var(--warn); }
.secret { font-family: var(--f-mono); font-size: var(--fs-5); letter-spacing: 2px; background: var(--gold-soft); border: 1px dashed var(--gold); border-radius: 10px; padding: 10px 14px; direction: ltr; text-align: center; user-select: all; }

/* lists and rows */
.list { display: grid; gap: 8px; }
/* a customer's account opens right under his line («accounts»), marked on its side so it reads as his */
.accitem { gap: 8px; }
.accslot:empty { display: none; }
.accslot > .card { border-inline-start: 4px solid var(--gold); }
.row { min-width: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.row .main { flex: 1 1 220px; min-width: 0; }
.row .main b { display: block; overflow-wrap: anywhere; }
.row .sub { color: var(--muted); font-size: var(--fs-2); }
.row .main > .sub { display: block; } /* each line under a row's name on its own line, as in the shared list */
.row select { max-width: 100%; min-width: 0; } /* a long option (e.g. a VAT kind) never widens a row past the phone */
.chip { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 10px; font-size: var(--fs-1); font-weight: 700; background: var(--surface-2); border: 1px solid var(--line); }
.chip.good { background: var(--good-bg); color: var(--good); border-color: transparent; }
.chip.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.chip.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.chip.gold { background: var(--gold-soft); color: var(--gold-ink); border-color: transparent; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.search { position: relative; }
.search input { width: 100%; min-height: 48px; border: 2px solid var(--gold); border-radius: 999px; padding: 8px 18px; background: var(--surface); }
.empty { color: var(--muted); text-align: center; padding: 18px; }

/* table of permissions */
/* A long table scrolls inside its own box, at most one screen tall: a box that scrolls sideways also
   holds the sticky header, so the header (and the first column) stay in view only if the box scrolls
   down too. A short table is unchanged. */
.tblwrap { overflow: auto; max-height: calc(100vh - 140px); max-height: calc(100dvh - 140px); overscroll-behavior: contain; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
@media print { .tblwrap { overflow: visible; max-height: none; } }
table.grid { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: var(--fs-2); }
table.grid th, table.grid td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: center; white-space: nowrap; }
table.grid th:first-child, table.grid td:first-child { position: sticky; inset-inline-start: 0; background: var(--surface); text-align: start; z-index: 1; }
table.grid thead th { position: sticky; top: 0; background: var(--surface-2); z-index: 2; }

/* switches */
.switch { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.switch .txt { flex: 1 1 auto; min-width: 0; }
.switch .txt b { display: block; }
.switch .txt span { color: var(--muted); font-size: var(--fs-2); }
.tog { position: relative; width: 52px; height: 30px; flex: 0 0 auto; border-radius: 999px; border: 0; background: var(--line); cursor: pointer; }
.tog::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 24px; height: 24px; border-radius: 50%; background: #FFFFFF; transition: inset-inline-start .15s; }
.tog[aria-checked="true"] { background: var(--good); }
.tog[aria-checked="true"]::after { inset-inline-start: 25px; }

/* gold "go to" frame and its bar */
.goto { outline: 3px solid var(--gold); outline-offset: 2px; background: var(--gold-soft) !important; box-shadow: inset 6px 0 0 var(--gold); }
[dir="rtl"] .goto { box-shadow: inset -6px 0 0 var(--gold); }
/* the lines behind a red count, until each is opened */
.redframe { outline: 2px solid var(--gold); outline-offset: 1px; background: var(--gold-soft); }
.gobar { position: sticky; top: 0; z-index: 30; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--gold-soft); border: 1.5px solid var(--gold); border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; font-weight: 700; }
.gobar .grow { flex: 1 1 auto; }

/* modal and toast */
.overlay { position: fixed; inset: 0; background: var(--overlay); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--surface); color: var(--fg); border-radius: 16px; box-shadow: var(--shadow); width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 18px; }
.modal h3 { margin: 0 0 12px; font-size: var(--fs-4); }
.modalhead { display: flex; flex-wrap: nowrap; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.modalhead h3 { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.modalhead > .btn { flex: none; }
.toast { pointer-events: none; position: fixed; z-index: 150; inset-inline-start: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--navy); color: var(--on-navy); padding: 10px 18px; border-radius: 999px; font-weight: 700; box-shadow: var(--shadow); max-width: calc(100% - 32px); }
[dir="rtl"] .toast { transform: translateX(50%); }
/* a trouble with its reference (kit.js refBox): stays until closed, the reference can be selected and copied */
.refbox { position: fixed; z-index: 150; inset-inline: 16px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); max-width: 560px; margin-inline: auto; background: var(--navy); color: var(--on-navy); padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); display: grid; gap: 8px; }
.refbox code { user-select: all; font-weight: 700; font-size: 1.05rem; }

/* sign-in */
.signin { max-width: 440px; margin: 28px auto; }
.signin .card { padding: 20px; }

/* «more» menu */
.menuwrap { position: relative; }
/* a list near the bottom of the screen opens upwards (keepInScreen) */
.menu.up, .langlist.up { top: auto; bottom: calc(100% + 4px); }
.menu { position: absolute; inset-inline-end: 0; top: calc(100% + 4px); z-index: 40; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 4px; min-width: min(230px, calc(100vw - 16px)); max-width: calc(100vw - 16px); }
.menu button { display: flex; gap: 10px; align-items: center; width: 100%; text-align: start; border: 0; background: transparent; padding: 10px 12px; min-height: 44px; border-radius: 8px; cursor: pointer; font-weight: 600; }
.menu button:hover, .menu button:focus-visible { background: var(--gold-soft); }
.menu button.danger { color: var(--bad); }
/* the permissions: department → job → its pages, each with its level (a colour per level, the icon says it too) */
.lvbtn { min-width: 44px; min-height: 44px; font-size: 1.2em; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); cursor: pointer; }
.lvbtn[data-lv="view"] { background: var(--info-bg); }
.lvbtn[data-lv="edit"] { background: var(--warn-bg); }
.lvbtn[data-lv="approve"] { background: var(--good-bg); }
.permtitle { display: inline-grid; gap: 2px; }
.permtitle small { font-weight: 400; }
.permgroup h3 { margin: 4px 0; color: var(--muted); font-size: var(--fs-2); }
.lvpick { display: grid; gap: 8px; }
.lvpick button { min-height: 48px; justify-content: flex-start; }
.lvpick button[aria-current="true"] { outline: 2px solid var(--gold); }
.bellwrap { position: relative; display: inline-flex; }
/* how urgent: red (urgent), orange (important), grey (for information) — white text, readable in both themes */
.badge.warn { background: #A85600; }
.badge.info { background: #5C6780; }
.groups button.lv-bad { border-color: var(--badge); }
.groups button.lv-warn { border-color: #A85600; }
.lvhead { display: flex; align-items: center; gap: 8px; margin: 4px 0 0; }
.lvhead::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: #5C6780; flex: 0 0 auto; }
.lvhead.bad::before { background: var(--badge); }
.lvhead.warn::before { background: #A85600; }
.todaycard.info { border-inline-start: 4px solid #5C6780; }
.bellwrap .badge { position: absolute; top: -6px; inset-inline-end: -6px; pointer-events: none; }
#main h2:focus { outline: none; }
.row.click { cursor: pointer; }
.row.click:hover { background: var(--gold-soft); }
.row.click:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.row .go { font-size: 1.1em; color: var(--muted); display: inline-block; }
[dir="rtl"] .row .go { transform: scaleX(-1); } /* ↗ points the reading way: ↖ in Arabic */
.sub .iso { direction: ltr; unicode-bidi: isolate; } /* a code or a phone inside a line in any language */
.switch .who { font-size: var(--fs-2); color: var(--muted); }
.switch .who::before { content: "👤 "; }
.bellwrap[data-on] > .btn { background: var(--navy); color: var(--on-navy); }
.switch .txt > span { display: block; }
.switch .who { font-weight: 400; margin-top: 2px; }

/* ---------- pictures, public page, shop, papers ---------- */
.pic { position: relative; overflow: hidden; border-radius: 12px; background: var(--gold-soft); aspect-ratio: 4 / 3; width: 100%; max-width: 100%; }
.pic img { display: block; width: 100%; height: 100%; object-fit: contain; background: #FFFFFF; }
.pic.empty::after { content: "📦"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 28px; opacity: .45; }
.pic.xs { width: 48px; height: 48px; aspect-ratio: auto; flex: 0 0 auto; border-radius: 8px; }
.pic.xs.empty::after { font-size: 18px; }
.pic.sm { width: 96px; height: 96px; aspect-ratio: auto; flex: 0 0 auto; }
.picfield { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn.gold { background: var(--gold-bright); color: #1B2A4A; border-color: var(--gold-bright); }
.linkbtn { border: 0; background: none; padding: 4px 2px; color: var(--fg); font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--gold); cursor: pointer; min-height: 32px; }
.linkbtn:hover { color: var(--gold); }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-weight: 600; min-height: 44px; padding-block: 10px; } /* (the whole line is the finger's target, 44px) */
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--gold-ink); }
.days { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.trap { position: absolute !important; inset-inline-start: -9999px; width: 1px; height: 1px; opacity: 0; }
.dl { display: grid; grid-template-columns: minmax(110px, max-content) 1fr; gap: 6px 14px; margin: 0; }
.dl dt { color: var(--muted); font-weight: 600; }
.dl dd { margin: 0; overflow-wrap: anywhere; }
.prose p { margin: 0 0 10px; line-height: 1.75; }
.prose.box { max-height: 50vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--surface-2); }
.sel { user-select: all; }
.paperimg { display: block; max-width: 100%; height: auto; border-radius: 8px; }
.consent { max-width: 760px; margin: 18px auto; }

/* public page */
.store { padding-block: 6px 10px; }
.hero { position: relative; overflow: hidden; border-radius: 18px; padding: 28px 26px; color: #FFFFFF; background: linear-gradient(135deg, #1B2A4A 0%, #26395F 60%, #1B2A4A 100%); display: grid; gap: 10px; }
.hero::after { content: ""; position: absolute; width: 240px; height: 240px; border-radius: 50%; inset-inline-end: -60px; top: -80px; background: radial-gradient(circle, rgba(212,176,100,.35), transparent 70%); pointer-events: none; }
.hero .kicker { justify-self: start; color: #D4B064; background: rgba(212,176,100,.18); border: 1px solid rgba(212,176,100,.5); border-radius: 999px; padding: 3px 12px; font-weight: 700; font-size: var(--fs-2); }
.hero h2 { margin: 0; font-size: clamp(22px, 4vw, 30px); line-height: 1.35; text-wrap: balance; max-width: 30ch; }
.hero p { margin: 0; opacity: .92; line-height: 1.75; max-width: 62ch; }
/* the welcome band with its film (or picture) beside the words; on a phone the film goes above them */
.hero.split { grid-template-columns: 1.05fr 1fr; align-items: center; gap: 28px; }
.hero .txt { display: grid; gap: 10px; position: relative; z-index: 1; }
.film { position: relative; overflow: hidden; border-radius: 14px; background: var(--gold-soft); aspect-ratio: 16 / 10; }
.film .pic.fill, .film video { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; object-fit: cover; }
.film .pic.fill img { width: 100%; height: 100%; object-fit: cover; }
.film video { opacity: 0; transition: opacity .4s; background: #000; }
.film.playing video { opacity: 1; }
.film.loading::after { content: ""; position: absolute; inset-inline-end: 12px; top: 12px; width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255,255,255,.5); border-top-color: #D4B064; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .film.loading::after { animation: none; } .film video { transition: none; } }
.playbtn { position: absolute; inset: 0; margin: auto; width: 60px; height: 60px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); color: #1B2A4A; font-size: 22px; cursor: pointer; box-shadow: 0 6px 20px rgba(0,0,0,.3); }
.playbtn:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.heromedia { box-shadow: 0 12px 30px rgba(0,0,0,.3); min-height: 260px; z-index: 1; } /* (over the band's gold glow) */
.pausebtn { position: absolute; inset-inline-start: 10px; bottom: 10px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(15,21,36,.7); color: #FFFFFF; font-size: 16px; cursor: pointer; }
.pausebtn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
/* «inside our work»: three boxes; on a phone two side by side and the third under them */
.gal { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.gal figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: grid; align-content: start; }
.gal .im { border-radius: 0; aspect-ratio: 16 / 10; }
.gal .im img, .offer .pic img { object-fit: cover; }
.gal figcaption { padding: 10px 14px; display: grid; gap: 2px; }
.gal figcaption small { color: var(--muted); }
/* offers and news */
/* «auto-fit», so the offers share the whole row (with «auto-fill» one offer took
   one narrow column and the rest of the row stayed empty) — the public page and the customers' page alike (offersBox) */
.offlist { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 12px; }
.offer { background: var(--surface); border: 1px solid var(--gold); border-radius: 14px; overflow: hidden; display: grid; }
.offer .pic { border-radius: 0; aspect-ratio: 16 / 9; }
.offer .obody { padding: 12px 14px; display: grid; gap: 6px; justify-items: start; align-content: start; } /* (no chip stretched to the height of its neighbour) */
.offer .obody > b, .offer .obody > p { justify-self: stretch; } /* (a text in the other language aligned on its own side) */
.offer p { margin: 0; color: var(--muted); }
/* one offer with a picture: the picture beside the text (2 / 3), the text in the middle */
.offlist .offer:only-child:has(> .pic) { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: stretch; }
.offlist .offer:only-child > .pic { aspect-ratio: auto; height: 100%; min-height: 170px; }
.offlist .offer:only-child .obody { padding: 20px 24px; align-content: center; }
/* two or more: a shorter picture, so the text shows */
.offlist .offer:not(:only-child) > .pic { aspect-ratio: 21 / 9; }
/* one offer without a picture: a strip across the page — title, text and «until» on one line, a gold line beside */
.offlist .offer:only-child:not(:has(> .pic)) { border-inline-start: 6px solid var(--gold); }
.offlist .offer:only-child:not(:has(> .pic)) .obody { grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; padding: 16px 22px; }
.offlist .offer:only-child:not(:has(> .pic)) .obody b { font-size: 17px; }
/* the phone: one column, the picture above the text */
@media (max-width: 640px) {
  .offlist { grid-template-columns: 1fr; }
  .offlist .offer:only-child:has(> .pic) { grid-template-columns: 1fr; }
  .offlist .offer > .pic, .offlist .offer:only-child > .pic { aspect-ratio: 16 / 9; height: auto; min-height: 0; }
  .offlist .offer:only-child:not(:has(> .pic)) .obody { grid-template-columns: 1fr; }
}
/* the header of the public page: «sign in» and «ask for an account» */
.hauth { display: flex; gap: 8px; align-items: center; }
.hauth .hb { font: inherit; font-weight: 700; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1.5px solid rgba(255,255,255,.55); background: transparent; color: var(--on-navy); cursor: pointer; white-space: nowrap; }
.hauth .hb.gold { background: var(--gold-bright); border-color: var(--gold-bright); color: #1B2A4A; }
.hauth .hb:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.hauth .short { display: none; }
.mpick .pic { max-width: 220px; }
.mpick .vidok { display: grid; place-items: center; font-size: 28px; }
/* (pubtop) the four promises at the top of the public page; Egypt: its full logo between two and two */
.trusttop { margin-block: -9px -6px; }
.trust { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.trusttop.withlogo { display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: center; }
.trusttop.withlogo .tside { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tlogo { display: block; width: min(220px, 50vw); height: auto; margin-inline: auto; }
.tcard { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 52px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 0 12px; }
.tcard b { color: var(--gold); font-size: 20px; line-height: 1; flex: none; }
.tcard span { font-weight: 700; font-size: 15px; line-height: 1.6; white-space: nowrap; overflow: hidden; min-width: 0; flex: 1 1 auto; }
.tcard span.wrap { white-space: normal; overflow: visible; overflow-wrap: anywhere; }
.tcard .tsub { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.tcard { position: relative; }
@media (max-width: 719px) {
  .trust { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trusttop.withlogo { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .trusttop.withlogo .tlogo { order: -1; }
  .tcard { min-height: 46px; padding: 0 8px; gap: 8px; }
  .tcard b { font-size: 16px; }
  .tcard span { font-size: 13px; }
}
.catlist { display: grid; gap: 6px; }
.catrow { display: flex; gap: 10px; align-items: center; padding: 6px 4px; border: 0; border-bottom: 1px solid var(--line); background: transparent; width: 100%; text-align: start; font: inherit; color: inherit; cursor: pointer; min-height: 48px; border-radius: 8px; }
.catrow:hover, .catrow:focus-visible { background: var(--gold-soft); }
.catrow .chev { color: var(--muted); font-size: 20px; }
[dir="ltr"] .catrow .chev { transform: scaleX(-1); }
.pubprods { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.pubprod { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: var(--surface); }
.pubprod .pic { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.catrow:last-child { border-bottom: 0; }
.catrow b { flex: 1 1 auto; }
.msg.pro { border-inline-start: 4px solid var(--gold); }
.pubfoot { display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: center; align-items: center; color: var(--muted); font-size: var(--fs-2); padding-block: 18px 8px; border-top: 1px solid var(--line); margin-top: 8px; }
.pubfoot .linkbtn { color: var(--muted); font-size: var(--fs-2); min-height: 44px; padding-inline: 6px; } /* finger-sized on a phone */

/* shop */
.catchips { display: flex; gap: 6px; flex-wrap: wrap; }
.catchips button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 14px; min-height: 44px; cursor: pointer; font-weight: 600; color: var(--fg); }
.catchips button[aria-pressed="true"] { background: var(--navy); color: var(--on-navy); border-color: var(--navy); }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.pcard { display: grid; grid-template-rows: auto 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; min-width: 0; }
.pcard .pic { border-radius: 0; }
.pbody { display: grid; gap: 6px; padding: 12px 14px 14px; align-content: start; }
.pbody h3 { margin: 0; font-size: var(--fs-4); overflow-wrap: anywhere; }
.pbody p { margin: 0; font-size: var(--fs-2); }
.price b { font-size: var(--fs-4); font-variant-numeric: tabular-nums; }
.rules { display: flex; flex-wrap: wrap; gap: 4px; }
/* the ANSM mentions under a device in the shop (France; at least 9 points when printed) */
.mentions { font-size: 12px; line-height: 1.45; color: var(--muted, #555); margin: 4px 0; }
@media (max-width: 640px) {
  .hero { padding: 20px 18px; }
  .hero.split { grid-template-columns: 1fr; gap: 16px; padding: 16px; }
  .hero.split .heromedia { order: -1; min-height: 0; }
  .gal { grid-template-columns: 1fr 1fr; gap: 10px; }
  .gal figure:nth-child(3) { grid-column: span 2; }
  .gal figure:nth-child(3) .im { aspect-ratio: 16 / 8; }
  .gal figcaption { padding: 8px 10px; }
  /* (the public page: the logo says who we are and the buttons need the room; the title stays for screen readers) */
  header.top:has(.hauth) .htitle { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .hauth { gap: 6px; }
  .hauth .hb { padding: 0 10px; }
  .hauth .long { display: none; }
  .hauth .short { display: inline; }
  /* (French «Connexion» + «Nouveau compte» + the logo and the language are wider than a 390 px phone) the header's
     right part may shrink, a short label wraps on two lines */
  header.top:has(.hauth) .hside { flex: 0 1 auto; min-width: 0; }
  /* still too wide on a 360 px phone in French (the language button went off the side, the page scrolled
     sideways; 320 px in every language): when the buttons do not fit next to the logo they go on their own line
     under it, at the end side (measured at their narrowest — labels on two lines — so a header that fits stays one line) */
  header.top:has(.hauth) .wrap { flex-wrap: wrap; row-gap: 8px; }
  header.top:has(.hauth) .hside { flex: 1 0 auto; width: min-content; justify-content: flex-end; }
  .hauth .hb { white-space: normal; line-height: 1.15; text-align: center; }
  .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pbody { padding: 10px; }
  .dl { grid-template-columns: 1fr; }
  .dl dt { margin-top: 6px; }
}

/* fields in a row keep their own height; mixed Arabic/Latin lines read in the right order */
.grid2 { align-items: start; }
.row .sub, .row .main b, .msg, .dl dd, .hint { unicode-bidi: plaintext; }
[dir="rtl"] .row .sub, [dir="rtl"] .row .main b, [dir="rtl"] .dl dd { text-align: right; }
[dir="ltr"] .row .sub, [dir="ltr"] .row .main b, [dir="ltr"] .dl dd { text-align: left; }
.days .check { align-items: center; }
.days .check input { margin: 0; }
.paperimg { margin-inline: auto; }
table.grid.book td, table.grid.book th { text-align: start; }
/* «book» tables fit their box: long text wraps, amounts and dates stay on one line, a button at the end is never cut */
table.grid.book { width: 100%; }
table.grid.book td { white-space: normal; overflow-wrap: anywhere; }
table.grid.book td.num, table.grid.book td:first-child, table.grid.book td:last-child { white-space: nowrap; }
table.grid td.num, table.grid th.num, table.grid.book th.num { text-align: end; font-variant-numeric: tabular-nums; }
/* a total under a column of amounts: its label next to its amount */
table.grid tfoot th[colspan] { text-align: end; }
table.grid td input { width: 90px; min-height: 44px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 4px 8px; background: var(--surface-2); }
/* orders */
.addbox { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.addbox .err { flex-basis: 100%; order: 9; }
.mini .err { max-width: 14em; }
.addbox input { width: 72px; min-height: 44px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 6px 10px; background: var(--surface-2); text-align: center; }
.mini { display: grid; gap: 2px; font-size: var(--fs-1); color: var(--muted); font-weight: 600; }
.mini input { width: 86px; min-height: 44px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 4px 8px; background: var(--surface-2); color: var(--fg); }
.steps { margin: 0; padding-inline-start: 22px; display: grid; gap: 6px; }
.row.unread { border-color: var(--gold); font-weight: 700; }
button.row { width: 100%; text-align: start; font: inherit; color: var(--fg); }
table.grid tfoot th, table.grid tfoot td { background: var(--surface-2); font-weight: 700; }
b.num { font-variant-numeric: tabular-nums; }

/* today's work: cards with a big number, one per thing waiting */
.todaygrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 12px; align-items: stretch; } /* (an amount with its currency fits on one line) */
.todaycard { display: flex; flex-direction: column; gap: 4px; text-align: start; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font: inherit; cursor: pointer; min-height: 96px; }
.todaycard:hover, .todaycard:focus-visible { border-color: var(--gold); }
.todaycard b.num { font-size: clamp(20px, 6.5vw, 26px); line-height: 1.1; overflow-wrap: break-word; } /* (never «E / GP») */
.todaycard.warn { border-inline-start: 4px solid var(--warn); }
.todaycard.bad { border-inline-start: 4px solid var(--bad); }

/* phones: «book» tables become stacked cards (column name on the left of each value); totals stay visible */
@media (max-width: 640px) {
  table.grid.book { width: 100%; min-width: 0; }
  table.grid.book thead { display: none; }
  table.grid.book, table.grid.book tbody, table.grid.book tfoot, table.grid.book tr { display: block; }
  table.grid.book tbody tr { border-bottom: 1px solid var(--line); padding: 6px 0; }
  table.grid.book td, table.grid.book tfoot th { display: flex; justify-content: space-between; gap: 12px; white-space: normal; border: 0; padding: 4px 10px; text-align: end; position: static; overflow-wrap: anywhere; }
  /* (a long account name — the accountant may rename them — wraps here too: the first and last cells were kept on one line) */
  table.grid.book td:first-child, table.grid.book td:last-child { white-space: normal; }
  table.grid.book td::before { content: attr(data-l); color: var(--muted); font-weight: 600; text-align: start; flex: 0 0 auto; max-width: 45%; }
  table.grid.book td:first-child { font-weight: 700; }
  table.grid.book td:empty { display: none; } /* an empty cell would show its column name with nothing after it */
  table.grid.book tfoot tr { display: flex; justify-content: space-between; gap: 12px; padding: 6px 10px; }
  table.grid.book tfoot th, table.grid.book tfoot td { padding: 0; display: block; }
  /* phones: «book» tables become cards (nothing to scroll); any other table (e.g. the permissions grid) keeps
     scrolling inside its own box, never the page */
  .tblwrap:has(> table.grid.book) { overflow: visible; max-height: none; }
  .pgrid { grid-template-columns: 1fr; }
  .addbox { flex-wrap: wrap; }
  .addbox .btn { flex: 1 1 auto; }
  /* the message at the bottom, never over the page's first lines or the 📍 bar; the customer's tabs in one
     row that scrolls sideways */
  .toast { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); font-size: .92rem; padding: 8px 14px; }
  body:has(.modal) .toast { bottom: auto; top: calc(12px + env(safe-area-inset-top, 0px)); }
  .custtabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .custtabs::-webkit-scrollbar { display: none; }
  .custtabs > button { flex: 0 0 auto; }
}
.row.tickrow { cursor: pointer; }
.pcard h3, .pcard b { overflow-wrap: anywhere; }
/* Arabic screens: numbered lists count in Arabic digits */
:lang(ar) ol { list-style-type: arabic-indic; }
.toolrow .who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toolrow .bellwrap { flex: 0 0 auto; }

.mini select { min-height: 44px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 4px 8px; background: var(--surface-2); color: var(--fg); max-width: 180px; }
.mini input[type="month"] { width: auto; min-width: 11.5em; }
.mini input[type="date"] { width: auto; min-width: 9.5em; }
[aria-invalid="true"] { border-color: var(--bad) !important; outline: 2px solid var(--bad-bg); }

/* password box with its eye button (show / hide what was typed) */
.pwbox { position: relative; display: flex; align-items: stretch; }
.pwbox input { flex: 1 1 auto; min-width: 0; padding-inline-end: 52px; }
.pwbox .pweye { position: absolute; inset-inline-end: 2px; top: 50%; transform: translateY(-50%); min-width: 44px; min-height: 44px; border: 0; background: transparent; cursor: pointer; font-size: 18px; border-radius: 8px; }
.pwbox .pweye:focus-visible { outline: 2px solid var(--focus); }
.sub.pre { display: block; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- the phone: the pages fold into one «menu» button (the work shows at once) ---------- */
.menubtn { display: none; }
@media (max-width: 640px) {
  .menubtn { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; margin-block: 6px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--fg); font: inherit; font-weight: 700; cursor: pointer; text-align: start; }
  .menubtn .menucur { color: var(--muted); font-weight: 600; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .menubtn[aria-expanded="true"] { border-color: var(--navy); }
  .navpanel:not([data-open]) { display: none; }
  /* the tools stay on one line where they fit: the name gives way first (it is on «my page» too) */
  .toolrow .grow { display: none; }
  /* the initials in a small round mark that never shrinks to one letter */
  .toolrow .who { flex: 0 0 auto; min-width: 0; overflow: visible; white-space: nowrap; }
}

/* ---- long lists (src/client/ui/listview.js): summary, filters, table on a computer, compact on a phone ---- */
.lvsum { display: flex; flex-wrap: wrap; gap: 6px; }
.lvfilters { display: flex; flex-wrap: wrap; gap: 6px; }
.lvf { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: inherit; font: inherit; cursor: pointer; }
.lvf .n { font-weight: 700; font-size: var(--fs-1); background: var(--surface-2); border-radius: 999px; padding: 0 7px; }
.lvf[aria-pressed="true"] { border-color: var(--gold); background: var(--gold-soft); font-weight: 700; }
.lvf.bad .n { background: var(--bad-bg); color: var(--bad); } .lvf.warn .n { background: var(--warn-bg); color: var(--warn); } .lvf.good .n { background: var(--good-bg); color: var(--good); }
.lvsort { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; }
.lvsort select { min-width: 9em; max-width: min(100%, 22em); } /* the sort's name not cut on a phone */
.lv .lvrow { padding: 8px 12px; }
.lv .lvrow .main b { display: inline; }
.lv .lvrow .main .sub { display: block; }
.lvend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.lvend .chip { white-space: normal; overflow-wrap: normal; text-align: start; } /* a long chip wraps between its words */
.lvc { overflow-wrap: normal; word-break: normal; }
.lvc { font-variant-numeric: tabular-nums; }
.lvrow.warn { border-inline-start: 4px solid var(--warn); } .lvrow.bad { border-inline-start: 4px solid var(--bad); }
.lvmore { justify-self: center; }
@media (min-width: 900px) {
  /* the first column has a real minimum and every column is at least its longest word (min-content), so
     a long chip or button never squeezes the name to nothing (it was «minmax(max-content, …)» on the last column:
     one letter per line); the chips and buttons wrap inside their column; if the columns cannot fit, the table moves
     inside its own box, never over its neighbours */
  .lv.table { gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; }
  .lv.table .lvthead, .lv.table .lvrow { display: grid; grid-template-columns: minmax(10em, 3fr) repeat(var(--n), minmax(min-content, 1fr)) minmax(min-content, 1.6fr); align-items: center; column-gap: 16px; row-gap: 6px; }
  .lv.table .lvthead { padding: 6px 12px; background: var(--surface-2); color: var(--muted); font-size: var(--fs-1); font-weight: 700; }
  .lv.table .lvrow { border: 0; border-top: 1px solid var(--line); border-radius: 0; }
  .lv.table .lvend { justify-content: flex-end; }
}
@media (max-width: 899px) {
  .lv.table .lvthead { display: none; }
  .lv.table .lvc::before { content: attr(data-label) " "; color: var(--muted); font-size: var(--fs-1); }
  .lv.table .lvc { font-size: var(--fs-2); }
}
/* the address in parts: its small code (governorate EG-GZ / département 51) beside the city */
.adrcode { font-size: .78em; color: var(--muted, #666); unicode-bidi: isolate; direction: ltr; white-space: nowrap; }
.adrbox { display: grid; gap: 2px; }
/* «waiting to send (n)» — gold while it waits, red when the server refused something (it wraps on a phone) */
.outboxchip { border-color: var(--gold); background: var(--gold-soft); white-space: normal; text-align: start; max-width: 100%; }
.outboxchip.bad { border-color: var(--bad); background: var(--bad-bg); color: var(--bad); }

/* the receiver's signature pad on the driver's screen */
.signpad { width: 100%; max-width: 600px; height: auto; aspect-ratio: 600 / 220; border: 2px dashed var(--line, #c9cfdb); border-radius: 8px; background: #fff; touch-action: none; cursor: crosshair; }
.field .lbl { font-weight: 600; font-size: var(--fs-2); }
.podpic { max-width: 100%; max-height: 180px; border-radius: 6px; border: 1px solid var(--line, #c9cfdb); }

/* the type-to-search box beside a long list */
.picksel { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; }
.picksel .pickq { flex: 1 1 9em; min-width: 0; max-width: 100%; }
.picksel select { flex: 2 1 12em; min-width: 0; max-width: 100%; }
/* on a phone the search and its list are one under the other, each the whole width */
@media (max-width: 560px) { .picksel .pickq, .picksel select { flex: 1 1 100%; width: 100%; } }
.chlist { list-style: none; margin: 4px 0 0; padding: 0; font-size: var(--fs-2); color: var(--muted); overflow-wrap: anywhere; }
.chlist .old { text-decoration: line-through; }
/* the backup codes, shown once (two columns, wide enough for «XXXXX-XXXXX» on a phone) */
.bkgrid { list-style: decimal; display: grid; grid-template-columns: repeat(auto-fit, minmax(11em, 1fr)); gap: 6px 18px; padding-inline-start: 2em; margin: 0; }
.bkgrid code { font-family: var(--f-mono); font-size: var(--fs-4, 1.05rem); letter-spacing: 1px; user-select: all; }
/* the pinned pages, a row of their own under the tabs */
.tabs.pins { border-bottom: 1px dashed var(--line); }

/* «bigger text and clearer colours» — each person's own choice (switch «bigText»): larger type, darker
   secondary text and lines (WCAG AA 4.5:1 and more on every surface), a thicker focus ring; long words wrap. */
:root[data-big="1"] {
  --fs-1: 14px; --fs-2: 16px; --fs-3: 18px; --fs-4: 20px; --fs-5: 23px;
  --muted: #3A4458; --line: #9AA3B5; --line-strong: #5E6880; --fg: #0E1830; --warn: #6E4A00; --gold-ink: #5E4610; --bad: #8A2626; --good: #155C39; --info: #1E4680;
}
@media (prefers-color-scheme: dark) {
  :root[data-big="1"]:not([data-theme="light"]) { --fg: #FFFFFF; --muted: #C9D1E2; --line: #55627F; }
}
:root[data-big="1"] body { overflow-wrap: anywhere; }
:root[data-big="1"] :focus-visible { outline-width: 3px; }
/* an item's answer as buttons: the chosen one marked */
/* the name in the top bar: whole on a computer, the initials on a phone */
.toolrow .whoini { display: none; }
@media (max-width: 560px) { .toolrow .whofull { display: none; } .toolrow .whoini { display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--fg); font-size: var(--fs-2); } }

/* a phone: a button's long name goes on two lines instead of running out of its box */
@media (max-width: 640px) {
  .btn:not(.icon) { white-space: normal; max-width: 100%; text-align: start; line-height: 1.25; padding-block: 6px; }
}
/* a phone: a product with no picture keeps a small band, not a screen-high empty box */
@media (max-width: 640px) {
  .pic.empty:not(.xs):not(.sm) { aspect-ratio: auto; height: 64px; }
}

/* the settings page lists its parts; each opens as a page of its own */
.setparts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.setpart { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 64px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font: inherit; font-weight: 600; text-align: start; cursor: pointer; }
.setpart:hover, .setpart:focus-visible { border-color: var(--gold); }
.setpart .end { font-weight: 400; }

/* «who is this page given to», on top of the page, at the end of the line */
.pagewho { display: flex; justify-content: flex-end; }

/* in a window, the form's save row stays in sight at the bottom */
.modal form.form > .btnrow:last-child { position: sticky; bottom: 0; background: var(--surface); padding: 8px 0; z-index: 2; border-top: 1px solid var(--line); }
.modal form.form .field, .modal form.form [data-name], .modal form.form > .msg { scroll-margin-bottom: 90px; scroll-margin-top: 12px; }
/* the customer's order steps */
ol.track { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; padding: 0; margin: 4px 0; font-size: .85em; }
ol.track li { padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
ol.track li.done { color: var(--good); border-color: var(--good); }
ol.track li.now { color: var(--surface); background: var(--gold-ink, #7A5C18); border-color: transparent; font-weight: 600; }
/* on a touch screen: tick boxes and switches big enough for a finger */
@media (pointer: coarse) {
  input[type="checkbox"], input[type="radio"] { width: 24px; height: 24px; min-width: 24px; }
  .switch { min-height: 44px; }
  .switch input[type="checkbox"] { width: 44px; height: 28px; }
}
