/* Dzaico design tokens — D17.
 *
 * shadcn's token system, monochrome. Neutrals are Tailwind's `neutral` scale: no
 * hue bias, because there is no accent for a bias to relate to.
 *
 * THE RULE: colour means state. A hue anywhere else is a bug. Navigation,
 * selection, focus and buttons are black, white, or a neutral between them — which
 * leaves the whole hue budget to the merchant's own storefront, the thing
 * customers actually see. A dashboard with its own brand colour competes with
 * every shop rendered inside its preview iframe.
 */

:root {
  /* surfaces */
  --bg:         #FFFFFF;
  --surface:    #FFFFFF;   /* shadcn: card == background */
  --muted:      #F5F5F5;   /* neutral-100 */
  --border:     #E5E5E5;   /* neutral-200 */
  --border-firm:#D4D4D4;   /* neutral-300, for an input that must read as editable */

  /* text */
  --fg:         #0A0A0A;   /* neutral-950 */
  /* Both greys meet WCAG AA against --muted, not just against --bg — which is the
     threshold that matters, because faint text sits on cards and bands far more often
     than on the page's own background. Measured, not eyeballed: 6.4:1 and 4.9:1 on
     #F5F5F5.
     `--fg-faint` began as neutral-400 (#A3A3A3), which is 2.5:1. It read as "quieter"
     on a designer's screen and as unreadable to anybody whose eyes are older than the
     design, and the accessibility pass found it on every surface at once. Raising it to
     4.5:1 on WHITE was the first correction and still failed on a card — the same bug,
     one step smaller. */
  --fg-muted:   #595959;   /* 6.4:1 on --muted, 7.0:1 on --bg */
  --fg-faint:   #6B6B6B;   /* 4.9:1 on --muted — the AA floor with the surface allowed for */

  /* the primary action. Near-black, not a brand colour — the detail that
     defines this system. */
  --primary:    #171717;   /* neutral-900 */
  --on-primary: #FAFAFA;   /* neutral-50  */

  --ring:       #0A0A0A;

  /* State. The only hues in the product, and never the sole carrier of meaning:
     every pill carries a word and every flag a letter (doc 11 §5). */
  --success:      #16A34A;
  --success-soft: #F0FDF4;
  --warning:      #CA8A04;
  --warning-soft: #FEFCE8;
  --danger:       #DC2626;
  --danger-soft:  #FEF2F2;
  /* The INK variants, for text on the soft backgrounds. The bright colours are 3.2:1 and
     2.8:1 there, which is under the floor for the small text a badge carries — so they
     stay for borders and icons, where 3:1 is the threshold, and these are what words are
     written in. All three measured against their own background: 6.3, 6.2 and 5.9. */
  --success-ink:  #136B33;
  --warning-ink:  #7C5800;
  --danger-ink:   #B91C1C;

  /* shape and space */
  --r:        8px;   /* cards, panels */
  --r-ctl:    6px;   /* buttons, inputs, badges */
  --ctl-h:    36px;  /* shadcn h-9 */
  --row-h:    48px;
  --shadow:   0 1px 2px 0 rgb(0 0 0 / .05);   /* shadow-sm, on cards and nowhere else */

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;

  /* type. Inter for Latin, Noto Sans Arabic for Arabic — one 14px base. */
  --font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-ar: "Noto Sans Arabic", Inter, system-ui, sans-serif;
  /* No webfont: the mono sets order references and token readouts, a utility
     face rather than an identity one, so the system stack does it for nothing. */
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --text: 14px;

  color-scheme: light;
}

/* Dark is declared twice on purpose.
 *
 * The system preference, guarded so an explicit light choice still wins over a
 * dark OS setting; and the explicit attribute, so the toggle wins in the other
 * direction too. A token defined in only one of them applies in neither case that
 * matters, which is the classic unreadable-interface bug. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A0A0A; --surface: #0A0A0A; --muted: #262626;
    --border: #262626; --border-firm: #404040;
    /* Mirrored, and measured against --muted (#262626) for the same reason: 7.4:1 and
     5.0:1. The light mode's mistake was the same one in reverse — #737373 on #0A0A0A is
     4.2:1, under the floor. */
  --fg: #FAFAFA; --fg-muted: #C4C4C4; --fg-faint: #949494;
    --primary: #FAFAFA; --on-primary: #171717;
    --ring: #D4D4D4;
    --success: #22C55E; --success-soft: #0B2716;
    --warning: #EAB308; --warning-soft: #2A2106;
    --danger:  #EF4444; --danger-soft:  #2A1012;
    --shadow: 0 1px 2px 0 rgb(0 0 0 / .4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0A0A0A; --surface: #0A0A0A; --muted: #262626;
  --border: #262626; --border-firm: #404040;
  /* Mirrored, and measured against --muted (#262626) for the same reason: 7.4:1 and
     5.0:1. The light mode's mistake was the same one in reverse — #737373 on #0A0A0A is
     4.2:1, under the floor. */
  --fg: #FAFAFA; --fg-muted: #C4C4C4; --fg-faint: #949494;
  --primary: #FAFAFA; --on-primary: #171717;
  --ring: #D4D4D4;
  --success: #22C55E; --success-soft: #0B2716;
  --warning: #EAB308; --warning-soft: #2A2106;
  --danger:  #EF4444; --danger-soft:  #2A1012;
  /* On a dark soft background the BRIGHT colour is the readable one, so the ink variants
     invert: light text on a dark tint rather than dark on a light one. */
  --success-ink: #4ADE80; --warning-ink: #FACC15; --danger-ink: #F87171;
  --shadow: 0 1px 2px 0 rgb(0 0 0 / .4);
  color-scheme: dark;
}

/* Vendored by tools/fonts/fetch.py — do not edit. `make fonts` refreshes.
 *
 * Self-hosted because the CSP is `default-src 'self'` and because a second
 * origin costs a handshake in front of first paint. Only the subsets this
 * product renders are here: latin for Inter, arabic for Noto.
 *
 * unicode-range is what makes the weight per-reader rather than per-page: a
 * French page never fetches the Arabic file, and an Arabic page never fetches
 * Inter. Removing those descriptors would make every reader pay for both.
 */

/* Inter · latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/static/fonts/inter-latin.3100e775e861.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Noto Sans Arabic · arabic */
@font-face {
  font-family: 'Noto Sans Arabic';
  font-style: normal;
  font-weight: 400 700;
  font-stretch: 100%;
  font-display: swap;
  src: url('/static/fonts/noto-arabic-arabic.ce85091f0209.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-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;
}

/* Base styles and primitives.
 *
 * EVERY rule here uses logical properties. `margin-inline-start`, never
 * `margin-left`; `padding-block`, never `padding-top`. The Arabic layout is these
 * same templates mirrored by `dir="rtl"`, so a physical side is a bug that appears
 * in one locale only — the hardest kind to notice (invariant 8). A test scans this
 * file and fails on one.
 */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
[dir="rtl"] body, body[dir="rtl"] { font-family: var(--font-ar); }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.02em; text-wrap: balance; }
h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; letter-spacing: -.01em; }
p  { margin: 0; }

a { color: var(--fg); text-decoration: underline; text-underline-offset: 2px;
    text-decoration-color: var(--border-firm); }
a:hover { text-decoration-color: var(--fg); }

/* One visible focus state for everything, and it is never removed. A focus ring
 * that only shows on :focus-visible still has to be *visible* — a 1px outline in
 * a low-contrast neutral is a ring nobody can find. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: var(--r-ctl);
}

img, svg, video { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }

/* Anything with digits in a column. A merchant comparing two amounts should not
 * have to read them character by character. */
/* A figure is read left to right in Arabic too, and a CURRENCY beside it has to stay on its own
 * side of the number.
 *
 * Without the isolate, the browser's bidi algorithm reorders "68 €" into "€ 68" and "0 DA" into
 * "DA 0" inside an RTL paragraph — because the symbol is neutral and takes the paragraph's
 * direction. The digits were right and the money was wrong, which is the worst way for a number to
 * be wrong on a page about money. `isolate` fixes it wherever a figure appears rather than at each
 * of the places that print one. */
.nums, .stat-v, .tab-n, .n, code.mono { font-variant-numeric: tabular-nums; }
.nums, .stat-v, .tab-n, .n { unicode-bidi: isolate; }
/* A whole amount — figure and symbol — reads LTR whatever the page does. */
.money { direction: ltr; unicode-bidi: isolate; }
.mono { font-family: var(--font-mono); font-size: 12.5px; }

/* --- layout ------------------------------------------------------------- */

.stack   { display: flex; flex-direction: column; }
.row     { display: flex; align-items: center; }
.wrap    { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow    { flex: 1; min-width: 0; }
.gap-1 { gap: var(--s-1) } .gap-2 { gap: var(--s-2) } .gap-3 { gap: var(--s-3) }
.gap-4 { gap: var(--s-4) } .gap-5 { gap: var(--s-5) } .gap-6 { gap: var(--s-6) }

/* The side gutter is set once, and the vertical padding uses padding-block so a
 * shorthand can never zero the sides. */
.page { max-width: 1180px; margin-inline: auto; padding-inline: var(--s-4); padding-block: 0; }

/* --- text --------------------------------------------------------------- */

.muted { color: var(--fg-muted); }
.faint { color: var(--fg-faint); }
.small { font-size: 12.5px; }
.label { font-size: 12px; font-weight: 500; color: var(--fg-muted); }
.lede  { color: var(--fg-muted); font-size: 15px; line-height: 1.6; max-width: 62ch; }

/* --- card --------------------------------------------------------------- */

/* A card is PADDED. It was not, and `.card-pad` was how you asked for it — so a card only had
 * padding when somebody remembered a second class, and thirty-eight of a hundred and four did not.
 * Every one of those screens rendered text against the border and inputs running into it: the call
 * centre's queue weights, the work screen's pairing notice, the shop assistant's whole form, the
 * product assistant, the storefront settings. None of them wanted it; they were all written without
 * a class nobody can see is missing.
 *
 * An opt-IN for the thing every instance wants is a defect generator. The rare case — a card whose
 * child must reach its border, a picture or a table that bleeds — says so with `.card-flush`, and
 * that one is worth naming because somebody chose it. */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: var(--s-4);
}
/* The opt-out, for a child that must reach the border. */
.card-flush { padding: 0; }

/* --- button ------------------------------------------------------------- */

.btn {
  appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  height: var(--ctl-h); padding-inline: var(--s-4);
  border: 1px solid transparent; border-radius: var(--r-ctl);
  background: var(--primary); color: var(--on-primary);
  font: inherit; font-size: 13.5px; font-weight: 500;
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: opacity .12s ease;
}
.btn:hover { opacity: .9; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-outline { background: transparent; color: var(--fg); border-color: var(--border-firm); }
.btn-outline:hover { background: var(--muted); opacity: 1; }

.btn-ghost { background: transparent; color: var(--fg); border-color: transparent; }
.btn-ghost:hover { background: var(--muted); opacity: 1; }

/* The one coloured button in the system, and only for an action that destroys
 * something. */
.btn-danger { background: var(--danger); color: #FFFFFF; }

.btn-sm { height: 30px; padding-inline: var(--s-3); font-size: 12.5px; }

/* --- input -------------------------------------------------------------- */

.field { display: flex; flex-direction: column; gap: 6px; }
.input, .select {
  height: var(--ctl-h); width: 100%;
  padding-inline: var(--s-3);
  border: 1px solid var(--border-firm); border-radius: var(--r-ctl);
  background: var(--surface); color: var(--fg);
  font: inherit; font-size: 13.5px;
}
/* The short form, to match .btn-sm: a field beside a small button on a table row, and
   the sidebar's storefront picker. Without it the control is taller than the button
   next to it, which reads as a misalignment rather than as a size. */
.input-sm { height: 30px; font-size: 12.5px; }
.input::placeholder { color: var(--fg-faint); }
.input[aria-invalid="true"] { border-color: var(--danger); }
/* An error is associated with its field programmatically, not merely placed near
 * it, so a screen reader announces the two together (doc 11 §5). */
.field-error { font-size: 12.5px; color: var(--danger); }
.field-hint  { font-size: 12.5px; color: var(--fg-muted); }

/* --- badge -------------------------------------------------------------- */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: var(--r-ctl);
  font-size: 11.5px; font-weight: 500; white-space: nowrap;
  border: 1px solid var(--border); background: var(--muted); color: var(--fg-muted);
}
/* The dot is decoration; the WORD inside the badge is what carries the meaning.
 * Colour is never the only signal. */
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; flex: none; }
.badge-plain::before { display: none; }
/* The badge colours are the DARKER variants of the status colours, not the colours
   themselves: #16A34A on #F0FDF4 is 3.2:1 and #CA8A04 on #FEFCE8 is 2.8:1 — both under
   the 4.5:1 floor for the small text a badge carries. Measured, and the accessibility
   pass is what found them. The bright variants stay for borders and icons, where 3:1 is
   the threshold and they clear it. */
.badge-success { color: var(--success-ink); background: var(--success-soft); border-color: transparent; }
.badge-warning { color: var(--warning-ink); background: var(--warning-soft); border-color: transparent; }
.badge-danger  { color: var(--danger-ink);  background: var(--danger-soft);  border-color: transparent; }

/* --- table -------------------------------------------------------------- */

.table-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: start; padding: var(--s-2) var(--s-3);
  font-size: 12px; font-weight: 500; color: var(--fg-muted);
  border-block-end: 1px solid var(--border); white-space: nowrap;
}
table.data td {
  padding: 0 var(--s-3); height: var(--row-h);
  border-block-end: 1px solid var(--border); vertical-align: middle;
}
table.data tbody tr:hover td { background: var(--muted); }
table.data .end { text-align: end; }

/* --- utility ------------------------------------------------------------ */

.rule { border: 0; border-block-start: 1px solid var(--border); margin-block: var(--s-5); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* --- the marketing surface -------------------------------------------------
 *
 * Every rule logical. The Arabic layout is these same templates mirrored by
 * dir="rtl", so a physical side is a bug that appears in one locale only.
 */

.site-head {
  border-block-end: 1px solid var(--border);
  padding-block: var(--s-3);
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
}
.site-head .page { align-items: center; }
.brand { font-size: 16px; font-weight: 600; letter-spacing: -.02em; text-decoration: none; }

/* A switch is a link that changes one thing about the page. Monochrome: in this
 * system colour means state, and a language is not a state. */
.switch {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; min-height: 30px; padding-inline: var(--s-2);
  border-radius: var(--r-ctl); font-size: 13px;
  color: var(--fg-muted); text-decoration: none; white-space: nowrap;
}
.switch:hover { background: var(--muted); color: var(--fg); }
.switch.is-on { background: var(--muted); color: var(--fg); font-weight: 500; }

/* --- rhythm --- */

.sec  { padding-block: var(--s-8); }
.band { background: var(--muted); border-block: 1px solid var(--border); padding-block: var(--s-8); }
.sec-head { max-width: 62ch; margin-block-end: var(--s-6); }
.sec-head h2 { margin-block-end: var(--s-2); }

.hero { padding-block: var(--s-8) var(--s-7); }
.hero h1 {
  font-size: clamp(30px, 5.2vw, 50px); line-height: 1.05;
  max-width: 24ch; margin-block: var(--s-3);
}
.hero .lede { font-size: 16px; max-width: 58ch; }
.hero-cta { margin-block-start: var(--s-5); }
.hero-trust { margin-block-start: var(--s-4); }
.hero.narrow h1 { max-width: 20ch; }

/* --- the carrier strip ---
 *
 * Company names on plain cards. Nine marks in nine palettes would read as noise;
 * set in one typeface they read as one row, which is the point being made. */
.strip { padding-block: var(--s-7); }
.carriers {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: var(--s-2);
}
.carriers li {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-ctl); padding: 7px var(--s-3);
  font-size: 13px; font-weight: 500; white-space: nowrap;
}

/* --- the three realities ---
 *
 * Numbered because they ARE a sequence: an order arrives, it is confirmed, it is
 * delivered. A decorative 01/02/03 over unordered content is a device pretending
 * to be structure. */
.reality {
  list-style: none; margin: 0; padding: 0; counter-reset: r;
  display: grid; gap: var(--s-5);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}
.reality li { counter-increment: r; padding-block-start: var(--s-4); position: relative; }
.reality li::before {
  content: counter(r, decimal-leading-zero);
  position: absolute; inset-block-start: 0; inset-inline-start: 0;
  font-family: var(--font-mono); font-size: 12px; color: var(--fg-faint);
  font-variant-numeric: tabular-nums;
}

.cap-grid {
  display: grid; gap: var(--s-3);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}
.two-up {
  display: grid; gap: var(--s-6);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

/* --- the plans -----------------------------------------------------------
 *
 * Three cards, and the middle one marked. A row of three identical cards makes
 * somebody compare eleven lines before choosing, and most people want the
 * recommendation — so the featured card is raised rather than recoloured, because
 * a coloured card in a black-and-white design reads as an error state.
 */
.plan-grid {
  display: grid; gap: var(--s-3);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  align-items: start;
}
.plan { display: flex; flex-direction: column; gap: var(--s-3); }
.plan-featured { border-color: var(--fg); box-shadow: 0 0 0 1px var(--fg); }

/* The figure, big, with its unit beside it rather than under it: "19 € a month" is
   one fact and two lines would make it read as two. `isolate`, because a currency
   symbol is neutral and an RTL paragraph reorders "19 €" into "€ 19". */
.plan-price {
  display: flex; align-items: baseline; gap: var(--s-2); margin: 0;
  unicode-bidi: isolate;
}
.plan-price strong { font-size: 30px; line-height: 1; letter-spacing: -0.02em; }

.plan-lines { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--s-2); }
.plan-lines li {
  position: relative; padding-inline-start: var(--s-5);
  font-size: 13.5px; line-height: 1.5;
}
/* A tick and a cross drawn in CSS, not glyphs from a font that may not carry them —
   and the WORD is the content, so a screen reader reads the line rather than the
   mark. A line that is NOT included is still printed: a plan that silently omits
   what it lacks is a plan somebody discovers the ceiling of by being refused. */
.plan-lines li::before {
  position: absolute; inset-inline-start: 0; inset-block-start: 0;
  font-size: 13px; font-weight: 700;
}
.plan-lines li.yes::before { content: "✓"; color: var(--fg); }
.plan-lines li.no::before { content: "×"; color: var(--fg-faint); }
.plan-lines li.no { color: var(--fg-faint); }

/* --- a capability, in full --- */
.cap {
  display: grid; gap: var(--s-5) var(--s-7);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  align-items: start;
}
.cap-n { color: var(--fg-faint); font-size: 12px; letter-spacing: .08em; }
.cap-list { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--s-3); }
.cap-list li {
  position: relative; padding-inline-start: var(--s-5);
  font-size: 13.5px; color: var(--fg-muted); line-height: 1.55;
}
/* A rule rather than a bullet glyph: a dash or a dot reads as decoration, and a
 * short rule reads as a list. */
.cap-list li::before {
  content: ""; position: absolute;
  inset-inline-start: 0; inset-block-start: 10px;
  width: 12px; height: 1px; background: var(--border-firm);
}

/* --- questions ---
 *
 * <details> so the page needs no script and every answer is in the HTML for a
 * search engine and a screen reader. */
.faq { max-width: 74ch; border-block-start: 1px solid var(--border); }
.qa { border-block-end: 1px solid var(--border); }
.qa summary {
  cursor: pointer; padding-block: var(--s-4); padding-inline-end: var(--s-5);
  font-size: 14.5px; font-weight: 500; position: relative; list-style: none;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after {
  content: "+"; position: absolute; inset-inline-end: 0; inset-block-start: var(--s-4);
  font-family: var(--font-mono); color: var(--fg-faint);
}
.qa[open] summary::after { content: "\2212"; }
.qa p { padding-block-end: var(--s-4); max-width: 68ch; }

.cta-card { text-align: start; }
.cta-card h2 { font-size: 22px; }

/* --- footer --- */
.site-footer {
  border-block-start: 1px solid var(--border);
  padding-block: var(--s-7) var(--s-6);
  margin-block-start: var(--s-6);
}
.foot-grid {
  display: grid; gap: var(--s-5);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
}
.foot-h {
  font-size: 11px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--fg-faint);
}
.site-footer a { color: var(--fg-muted); text-decoration: none; }
.site-footer a:hover { color: var(--fg); text-decoration: underline; }

@media (max-width: 700px) {
  /* The header's own nav is the first thing to go: the brand, the switches and
   * one action are what must survive at 360px. */
  .head-nav { display: none; }
}

@media (max-width: 420px) {
  /* At 360px even the surviving four controls are 411px wide, which gives the WHOLE
   * PAGE 67px of sideways scroll — and that cuts the right-hand side off every line
   * on the page, not just off the header. The browser harness measures exactly this,
   * because it is invisible on a desktop and unmissable on a phone.
   *
   * The language switch goes rather than the theme switch: somebody who needs the
   * other language reaches the footer's own switch, and the theme is the one a
   * visitor notices immediately if it is wrong. The log-in link goes too — the
   * sign-up button is the point of this page, and somebody who already has an account
   * knows where to find it. */
  .site-head .head-locale { display: none; }
  .site-head .head-login { display: none; }
}

/* --- the authentication surface -------------------------------------------
 *
 * A single-purpose page. No nav, no switches: a login page with four things to do
 * on it has one thing that is the point and three that are not.
 */

.auth {
  min-height: 100svh;
  display: grid; place-items: center;
  padding-inline: var(--s-4); padding-block: var(--s-6);
}
.auth-card { width: 100%; max-width: 380px; }
.auth-h { font-size: 20px; }
.strong { font-weight: 600; }

/* A six-digit code, spaced so it can be read back from an app screen. */
.code-input {
  font-family: var(--font-mono); font-size: 20px;
  letter-spacing: .34em; text-align: center;
  height: 48px; padding-inline: 0;
}

/* A shop in the chooser is a whole row, so the target is the row and not a word
 * in it. 44px minimum, per doc 11 §5. */
.choose-row {
  width: 100%; height: auto; min-height: 44px;
  padding-block: var(--s-2);
  justify-content: space-between; gap: var(--s-3);
}

/* --- the dashboard shell -------------------------------------------------- */

.shell { display: grid; grid-template-columns: 216px 1fr; min-height: 100svh; }
/* The navigation column is a COLUMN, however few items are in it.
 *
 * `align-self: start` with `max-height` made it exactly as tall as its content — which looks like a
 * full-height column on the merchant dashboard, where there are twenty items, and like a small panel
 * floating on the page background in the staff back-office, where there are six. The sticky was there
 * so a LONG nav stays put while the content scrolls, and that is worth keeping: pinning it to the
 * viewport's height gives both, because a short nav then fills the screen and a long one scrolls
 * inside itself. */
.side {
  background: var(--muted); border-inline-end: 1px solid var(--border);
  padding: var(--s-4); display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: 0; block-size: 100svh; overflow-y: auto;
}
.side-store { padding-inline: var(--s-2); margin-block: var(--s-3) var(--s-4); }
/* A section heading has to be LOUDER than the things under it.
 *
 * It was 11px in the faintest colour on the page, heading items that are 13.5px in a firmer one — so
 * the only thing separating "GESTION" from "Produits" was the uppercase, and at that size and colour
 * nobody sees it without looking for it. Four navigation groups that read as one list of twenty items
 * is a sidebar somebody scans top to bottom every time.
 *
 * Three signals, because one is not enough at 11px: a RULE above the group, which is what actually
 * says "a new section starts here"; SPACE above it and little below, so the label binds to the items
 * it heads rather than floating between two groups; and a colour that is not the quietest thing in
 * the column. */
.side-group {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--fg-muted); padding-inline: var(--s-2);
  margin-block: var(--s-5) var(--s-2);
  padding-block-start: var(--s-4);
  border-block-start: 1px solid var(--border);
}
/* The first group heads the list rather than dividing it, so it gets no rule. */
.side-group:first-of-type {
  border-block-start: 0; padding-block-start: 0; margin-block-start: var(--s-3);
}
.side a {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-2);
  min-height: 32px; padding: var(--s-1) var(--s-2);
  border-radius: var(--r-ctl); color: var(--fg-muted);
  text-decoration: none; font-size: 13.5px;
}
.side a:hover { background: var(--surface); color: var(--fg); }
/* `[aria-current="page"]`, not `[aria-current]`.
 *
 * An attribute selector matches an EMPTY attribute too, and the staff nav renders
 * `aria-current=""` on every link that is not the current one — so every item in that sidebar was
 * drawn as the current page, which is the same as none of them being. ARIA reads an empty value as
 * false; only the CSS was wrong. */
.side a[aria-current="page"] { background: var(--surface); color: var(--fg); font-weight: 500; }
.side a .n { font-size: 11.5px; font-variant-numeric: tabular-nums; color: var(--fg-faint); }

.work { min-width: 0; display: flex; flex-direction: column; }
.work-top {
  border-block-end: 1px solid var(--border); padding: var(--s-4);
  display: flex; flex-wrap: wrap; gap: var(--s-3);
  align-items: center; justify-content: space-between;
}
.work-body { padding: var(--s-5) var(--s-4); }

/* A notice that the shop is not serving. Loud on purpose: a merchant whose
 * storefront is offline should not have to notice a subtle badge. */
.notice {
  border: 1px solid var(--danger); background: var(--danger-soft); color: var(--danger);
  border-radius: var(--r); padding: var(--s-3) var(--s-4); font-size: 13.5px;
}

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side {
    position: static; max-height: none; flex-direction: row; overflow-x: auto;
    border-inline-end: 0; border-block-end: 1px solid var(--border); align-items: center;
  }
  .side-store, .side-group { display: none; }
  .side a { white-space: nowrap; }
}

/* ===========================================================================
   The dashboard.
   ---------------------------------------------------------------------------
   Monochrome, because the hue budget belongs to the merchant's storefront: this
   chrome sits around a preview of a shop that may be any colour, and a blue
   dashboard fights every one of them (D17). Colour appears in exactly three
   places — a status that means money, one that means a cost, and one that means
   attention — and nowhere else.

   Logical properties throughout, like everything else here: the Arabic
   dashboard is this file mirrored, not a second file that falls behind.
   =========================================================================== */

/* The skip link. First in the tab order, visible only while focused: a
   dashboard whose every page starts with twenty sidebar links is a dashboard
   somebody using a keyboard has to tab through twenty times a screen. */
.skip {
  position: absolute;
  inset-block-start: -100%;
  inset-inline-start: var(--s-3);
  z-index: 50;
  padding: var(--s-2) var(--s-4);
  background: var(--surface);
  border: 1px solid var(--fg);
  border-radius: var(--r);
}
.skip:focus { inset-block-start: var(--s-3); }

.work-top {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  align-items: flex-start;
  justify-content: space-between;
  padding-block-end: var(--s-4);
  border-block-end: 1px solid var(--border);
}
.work-top-end { flex-wrap: wrap; justify-content: flex-end; }

.crumbs { display: flex; gap: var(--s-2); font-size: 13px; color: var(--fg-muted); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs a::after { content: " ›"; color: var(--fg-faint); }

/* The account menu, on <details> so it opens with no script at all. */
.whoami { position: relative; }
.whoami > summary {
  display: flex;
  gap: var(--s-2);
  align-items: center;
  cursor: pointer;
  list-style: none;
  padding: var(--s-1) var(--s-2);
  border-radius: var(--r);
}
.whoami > summary::-webkit-details-marker { display: none; }
.whoami > summary:hover { background: var(--muted); }
.whoami-menu {
  position: absolute;
  inset-inline-end: 0;
  inset-block-start: calc(100% + var(--s-1));
  z-index: 20;
  min-inline-size: 200px;
  padding: var(--s-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.10);
}

.flash {
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--border);
  border-inline-start: 3px solid var(--success);
  border-radius: var(--r);
  background: var(--muted);
  font-size: 14px;
}

.banner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  align-items: center;
  justify-content: space-between;
  padding: var(--s-4);
  border: 1px solid var(--fg);
  border-radius: var(--r);
  background: var(--muted);
}

/* --- tabs and filters --- */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1);
  border-block-end: 1px solid var(--border);
}
.tab {
  display: inline-flex;
  gap: var(--s-2);
  align-items: center;
  padding: var(--s-2) var(--s-3);
  font-size: 14px;
  text-decoration: none;
  color: var(--fg-muted);
  border-block-end: 2px solid transparent;
  margin-block-end: -1px;
}
.tab:hover { color: var(--fg); }
.tab[aria-current="page"] { color: var(--fg); font-weight: 600; border-block-end-color: var(--fg); }
.tab-n {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  padding-inline: 6px;
  border-radius: 999px;
  background: var(--muted);
  color: var(--fg-muted);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  align-items: flex-end;
}
.filters .field { margin: 0; }

/* --- tables --- */

.table { inline-size: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: start;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-faint);
  font-weight: 600;
  padding: var(--s-2) var(--s-2);
  border-block-end: 1px solid var(--border);
  white-space: nowrap;
}
.table td { padding: var(--s-3) var(--s-2); border-block-end: 1px solid var(--border); vertical-align: top; }
.table .end { text-align: end; }
.table tbody tr:hover { background: var(--muted); }
.table-tight td, .table-tight th { padding: var(--s-1) var(--s-2); }
.table .nums { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .tick { inline-size: 32px; }
.table .thumb { inline-size: 56px; }
.table .thumb img { inline-size: 56px; block-size: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 6px; }
.thumb-none {
  display: block;
  inline-size: 56px;
  aspect-ratio: 4 / 5;
  border-radius: 6px;
  background: var(--muted);
  border: 1px dashed var(--border);
}

.flags { display: flex; flex-wrap: wrap; gap: 4px; margin-block-start: 4px; }

.bulk {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  align-items: center;
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--fg);
  border-radius: var(--r);
  background: var(--muted);
}

.empty-state { padding-block: var(--s-7); text-align: center; }
.pager { display: flex; justify-content: center; padding-block-start: var(--s-4); }

/* --- the detail layout --- */

.detail {
  display: grid;
  gap: var(--s-4);
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  align-items: start;
}
@media (max-width: 900px) { .detail { grid-template-columns: 1fr; } }
.detail-main, .detail-side { min-inline-size: 0; }

.totals { display: grid; grid-template-columns: 1fr auto; gap: var(--s-1) var(--s-4); margin: 0; }
.totals dt { color: var(--fg-muted); }
.totals dd { margin: 0; text-align: end; font-variant-numeric: tabular-nums; }

.pairs { display: grid; grid-template-columns: auto 1fr; gap: var(--s-1) var(--s-4); margin: 0; }
.pairs dt { color: var(--fg-muted); }
.pairs dd { margin: 0; }

.history { margin: 0; padding-inline-start: var(--s-5); }
.history li { padding-block: var(--s-2); }
.body { white-space: pre-wrap; }
.break { overflow-wrap: anywhere; }
.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- home --- */

.tasks { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.task {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--r);
  text-decoration: none;
  background: var(--surface);
}
.task:hover { border-color: var(--fg); }
/* The one urgent thing gets a bar, not a colour fill: a merchant with four
   overdue queues should not be looking at a red screen. */
.task-urgent { border-inline-start: 3px solid var(--danger); }
.task-n { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.task-l { font-size: 13px; color: var(--fg-muted); }

.stats { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-l { font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--fg-faint); }
.stat-v { font-size: 22px; font-variant-numeric: tabular-nums; }

/* Fourteen bars in CSS. Fourteen numbers do not need a charting library, and a
   bar whose height is a percentage works in both reading directions and in a
   dark theme without a second implementation. */
.spark { display: flex; gap: 3px; align-items: flex-end; block-size: 64px; }
.spark-bar { flex: 1 1 0; min-block-size: 1px; background: var(--fg); border-radius: 2px 2px 0 0; opacity: 0.8; }
.spark-bar:hover { opacity: 1; }
/* Taller on the statistics screen, where the chart is the point of the card rather than a
   glance beside four numbers. Ninety bars at 64px is a flat line. */
.spark-tall { block-size: 140px; gap: 1px; }

/* --- cards, rows, gallery --- */

.cards { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.card-mark { border-inline-start: 3px solid var(--warning); }

.rows { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.row-link {
  display: flex;
  gap: var(--s-3);
  align-items: center;
  justify-content: space-between;
  padding: var(--s-3) var(--s-4);
  text-decoration: none;
  border-block-end: 1px solid var(--border);
}
.rows .row-link:last-child { border-block-end: 0; }
.row-link:hover { background: var(--muted); }
.row-unread { font-weight: 600; border-inline-start: 3px solid var(--fg); }

.gallery { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); }
.tile { margin: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.tile img { inline-size: 100%; block-size: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--r); background: var(--muted); }

.picks { display: grid; gap: var(--s-2); grid-template-columns: repeat(auto-fill, minmax(min(100%, 96px), 1fr)); }
.pick { position: relative; cursor: pointer; }
.pick img { inline-size: 100%; block-size: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 6px; opacity: 0.55; border: 2px solid transparent; }
.pick input { position: absolute; inset-block-start: 4px; inset-inline-start: 4px; z-index: 1; }
.pick input:checked + img { opacity: 1; border-color: var(--fg); }

/* --- forms --- */

/* .field, .label, .input and .two-up are already defined above, and this block must not
 * redefine them: it is appended, so a duplicate would win by order and silently change the
 * marketing pages. Only the modifiers the dashboard adds are here.
 *
 * `.input` is a fixed-height control, which is right for an input and wrong for a textarea —
 * a bundle file in a 36px box is unusable. */
textarea.input { height: auto; min-block-size: 80px; padding-block: var(--s-2); }
.input.tiny { inline-size: 9ch; }
/* A SELECT sizes to its longest option, whatever `.tiny` says.
 *
 * A fixed 9ch truncated the values themselves: the productivity period read "7 jour" and the
 * billing period read "Mens", which is a control whose current value cannot be read — the one thing
 * a select has to do. 9ch stays as the floor so a row of short ones still lines up. */
select.input.tiny { inline-size: auto; min-inline-size: 9ch; max-inline-size: 100%; }
.input.code {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  tab-size: 2;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
}

/* Three inputs side by side for a translatable field: a merchant writing a
   product name writes it in the languages they sell in, and a language tab
   hides the two they have not filled — which is how a shop ends up with an
   Arabic page showing French names. */
.tri { border: 0; margin: 0; padding: 0; display: grid; gap: var(--s-2); grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.tri legend { font-size: 13px; font-weight: 600; padding: 0; margin-block-end: var(--s-1); }

/* A checkbox with its label. Named `.check` rather than `.switch`, which upstream already
 * uses for the language and theme links. */
.check { display: flex; gap: var(--s-2); align-items: center; font-size: 14px; cursor: pointer; }
.choice {
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
  padding: var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  cursor: pointer;
}
.choice:has(input:checked) { border-color: var(--fg); background: var(--muted); }

.opt { border: 1px solid var(--border); border-radius: var(--r); padding: var(--s-3); display: grid; gap: var(--s-2); }
.opt legend { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--fg-faint); padding-inline: var(--s-2); }
.val { display: grid; gap: var(--s-2); grid-template-columns: repeat(auto-fit, minmax(min(100%, 120px), 1fr)); }

.contract { display: grid; grid-template-columns: auto 1fr; gap: var(--s-1) var(--s-4); margin: 0; }
.contract dt { font-size: 13px; }
.contract dd { margin: 0; color: var(--fg-muted); }

.findings { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--s-2); }
.finding { display: grid; gap: 2px; padding: var(--s-2); border-inline-start: 3px solid var(--border); background: var(--muted); border-radius: 0 var(--r) var(--r) 0; }
.finding-error { border-inline-start-color: var(--danger); }
.finding-warn { border-inline-start-color: var(--warning); }
.ok { color: var(--success); font-weight: 600; font-size: 14px; }

.plain { margin: 0; padding-inline-start: var(--s-5); }
.correct { border-block-start: 1px solid var(--border); padding-block-start: var(--s-3); }
.correct summary { cursor: pointer; }

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; }
  .work-top { flex-direction: column; }
}

/* --- the visual editor ---------------------------------------------------
 *
 * Three columns: pages and palette, canvas, inspector. The canvas is the widest
 * because it is the merchant's shop, and the panels are as narrow as their
 * controls allow.
 */

.editor {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 280px;
  gap: var(--s-3);
  align-items: start;
  /* The canvas fills the window rather than the page scrolling: an editor whose
     canvas moves when you scroll the panel is an editor you fight. */
  block-size: calc(100svh - 190px);
  min-block-size: 520px;
}
.editor-left, .editor-right {
  block-size: 100%;
  overflow-y: auto;
  padding-inline-end: var(--s-2);
}
.editor-canvas { block-size: 100%; display: flex; flex-direction: column; }
.editor-bar {
  display: flex;
  gap: var(--s-2);
  align-items: center;
  justify-content: space-between;
}
.editor-frame {
  flex: 1 1 auto;
  inline-size: 100%;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: #fff;
  /* The canvas is NARROWED for a phone, never zoomed: a shop at 390px has to be a
     shop at 390px, and a scaled desktop rendering hides every breakpoint. */
  transition: max-inline-size .15s ease;
}

.editor-page {
  display: block;
  padding: 6px var(--s-2);
  border-radius: var(--r-ctl);
  font-size: 13.5px;
  text-decoration: none;
  color: var(--fg-muted);
}
.editor-page:hover { background: var(--muted); color: var(--fg); }
.editor-page.is-on { background: var(--muted); color: var(--fg); font-weight: 500; }

.editor-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  inline-size: 100%;
  padding: var(--s-2);
  border: 1px solid var(--border);
  border-radius: var(--r-ctl);
  background: var(--surface);
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.editor-block:hover { border-color: var(--fg); }
.editor-block:disabled { opacity: .5; cursor: not-allowed; }

.picks-sm { grid-template-columns: repeat(auto-fill, minmax(min(100%, 72px), 1fr)); }
.picks-sm .pick img { opacity: 1; }

@media (max-width: 1100px) {
  .editor { grid-template-columns: 1fr; block-size: auto; }
  .editor-left, .editor-right { block-size: auto; overflow: visible; }
  .editor-frame { min-block-size: 70svh; }
}

/* --- the help panel ------------------------------------------------------- */
/* Fixed in the corner of every dashboard page. A `<details>`, so it opens and
   closes with no script at all — and `inset-inline-end`, not `right`, so it
   lands in the same corner of an Arabic dashboard that an Arabic reader looks
   in. */
.help {
  position: fixed;
  inset-block-end: var(--s-4);
  inset-inline-end: var(--s-4);
  z-index: 40;
}
.help-open {
  display: grid;
  place-items: center;
  inline-size: 2.75rem;
  block-size: 2.75rem;
  margin-inline-start: auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow);
  list-style: none;
}
.help-open::-webkit-details-marker { display: none; }
.help-open:hover { opacity: .9; }
.help[open] .help-open { background: var(--surface); color: var(--fg); }
.help-panel {
  position: absolute;
  inset-block-end: 3.25rem;
  inset-inline-end: 0;
  inline-size: min(24rem, calc(100vw - 2 * var(--s-4)));
  max-block-size: min(32rem, 70svh);
  overflow-y: auto;
  padding: var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.help-answer {
  padding: var(--s-2);
  border-inline-start: 2px solid var(--fg);
  background: var(--muted);
  border-radius: var(--r-ctl);
}
/* The busy line is hidden until htmx marks the form in flight, and it is
   `aria-live` by being inside the panel's own status region — a spinner nobody
   can hear is a page that appears to have done nothing. */
.dz-indicator { display: none; }
.htmx-request .dz-indicator,
.htmx-request.dz-indicator { display: inline; }

@media (max-width: 640px) {
  /* On a phone the panel is the width of the screen and sits above the bottom
     edge, because a 24rem card pinned to one corner is unreadable at 360px. */
  .help { inset-inline: var(--s-3); inset-block-end: var(--s-3); }
  .help-panel { inline-size: 100%; max-block-size: 60svh; }
}

/* --- htmx's indicators, in our own stylesheet ----------------------------- */
/* htmx ships these as a <style> element it injects at load, which `style-src
   'self'` blocks — a console error on every page. `includeIndicatorStyles` is
   switched off in the layout's meta tag and the two rules live here instead.
   They are htmx's own, unchanged: an indicator is hidden until a request is in
   flight, and `opacity` rather than `display` so the layout does not jump when
   one appears. */
.htmx-indicator { opacity: 0; transition: opacity 200ms ease-in; }
.htmx-request .htmx-indicator { opacity: 1; }
.htmx-request.htmx-indicator { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .htmx-indicator { transition: none; }
}

/* The two controls at the foot of a login card: the colour scheme and the languages.
 *
 * Quiet on purpose. The page has one thing to do on it and these are not it — but a reader who
 * cannot read the page cannot sign in, and this is the only page they can reach without a password,
 * so "not the point" is not the same as "not there". */
.auth-foot { justify-content: center; padding-block-start: var(--s-4); border-block-start: 1px solid var(--border); }
.auth-foot a { color: var(--fg-faint); text-decoration: none; }
.auth-foot a:hover, .auth-foot a:focus-visible { color: var(--fg); text-decoration: underline; }
/* The chrome's own row, so the theme switch and the sign-out sit level with the name menu. */
.whoami-row { align-items: center; }

/* The language control: all three, always visible, the current one marked and not a link.
 *
 * It was a single link that cycled, inside the menu behind the reader's own name — so English was
 * two clicks from French with an RTL flip in between, and somebody looking for it reported that the
 * language could not be changed. Three short labels, each written in its own language, so the Arabic
 * option is legible to the person most likely to be looking for it. */
.langs { display: flex; gap: 2px; align-items: center; }
.lang {
  display: inline-flex; align-items: center; justify-content: center;
  min-inline-size: 28px; padding: 3px 6px; border-radius: var(--r-ctl);
  font-size: 12px; line-height: 1.2; color: var(--fg-muted); text-decoration: none;
}
.lang:hover, .lang:focus-visible { background: var(--muted); color: var(--fg); }
.lang[aria-current] { background: var(--muted); color: var(--fg); font-weight: 600; }

/* --- the payment dialog ------------------------------------------------------
   A native <dialog> opened with showModal(), so focus is trapped, Escape closes it and the
   page behind it is inert without a line of script doing any of that. Logical properties
   throughout: the dialog is used in Arabic too, and a margin-left here would be the kind of
   bug that only appears there. */

.pay {
  inline-size: min(28rem, calc(100vw - 2rem));
  max-block-size: calc(100vh - 2rem);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-card, 12px);
  background: var(--surface);
  color: var(--fg);
  box-shadow: 0 24px 64px rgb(0 0 0 / 0.28);
}
.pay::backdrop { background: rgb(0 0 0 / 0.45); }
.pay-in { padding: var(--s-5, 24px); }
.pay h2 { font-size: 16px; }

.pay-sum {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3);
  padding-block: var(--s-3); border-block: 1px solid var(--border);
}
.pay-amount { font-size: 22px; }

/* The Payment Element sizes itself; it needs room, not styling. */
.pay-stripe { min-block-size: 220px; }

/* TEST MODE is said in a colour nobody mistakes for success. Used on the dialog, on the
   invoice, and as the banner on every screen that takes a payment while it is on. */
.pay-test {
  padding: var(--s-2, 8px) var(--s-3, 12px);
  border-radius: var(--r-ctl, 8px);
  border: 1px dashed var(--warning-ink);
  background: var(--warning-soft);
  color: var(--warning-ink);
  font-size: 12.5px;
}

[data-dz-pay-status].pay-bad { color: var(--danger); }
.pay .input[aria-invalid="true"] { border-color: var(--danger); }

/* --- the AI screen ---------------------------------------------------------
 *
 * The first question is a CHOICE between two ways to pay, so it is drawn as two options side
 * by side with the current one marked, rather than as a select a merchant has to open to learn
 * there is a second answer. Below it the tasks are a TABLE: ten features by the same five
 * questions is a grid, and a list of cards made every row's provider, model and payer sit in a
 * different place depending on how long its description was.
 */
.ai-modes {
  display: grid; gap: var(--s-3);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
}
.ai-mode {
  display: flex; flex-direction: column; gap: var(--s-2);
  padding: var(--s-4); border: 1px solid var(--border); border-radius: var(--r);
}
.ai-mode h3 { font-size: 15px; margin: 0; }
.ai-mode[data-on] { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.ai-mode form { margin-block-start: auto; }
.callout {
  padding: var(--s-3); border-radius: var(--r-ctl);
  background: var(--muted); border-inline-start: 3px solid var(--border-firm);
}
.block { display: block; }
.ai-table th[scope="row"] {
  font-weight: normal; text-align: start; white-space: normal;
  min-inline-size: 12rem; max-inline-size: 17rem;
}
.ai-table td, .ai-table th { vertical-align: top; }
/* Natural width: a select narrower than its longest option shows a value nobody can read, and
 * `make verify` measures exactly that. */
.ai-pick { min-inline-size: 16rem; }
.ai-pick select { display: block; inline-size: 100%; min-inline-size: max-content; }
.ai-pick select + select { margin-block-start: var(--s-1); }
.ai-reason { margin-block-start: var(--s-1); }
.ai-solo { max-inline-size: 36rem; }
.ai-reason { white-space: normal; display: inline-block; max-inline-size: 14rem; }

/* --- the product page --------------------------------------------------------------------
 *
 * Shopify's shape: one form, a main column of cards and a sidebar, a save bar that appears when
 * something changed. Logical properties throughout, so the Arabic dashboard mirrors with no second
 * stylesheet.
 */
.savebar {
  position: sticky; inset-block-start: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding: var(--s-2) var(--s-4); margin-block-end: var(--s-3);
  background: var(--primary); color: var(--on-primary); border-radius: var(--r);
}
.savebar[hidden] { display: none; }
.savebar .btn-outline { color: var(--on-primary); border-color: currentColor; background: transparent; }
.savebar .btn:not(.btn-outline) { background: var(--on-primary); color: var(--primary); }
.product-actions { align-items: center; margin-block-end: var(--s-3); }
.product-foot { justify-content: flex-end; margin-block-start: var(--s-4); }
.wrap { flex-wrap: wrap; }
.align-end { align-items: flex-end; }
.danger-text { color: var(--danger); }

/* A menu built on <details>: no script, closes with the summary. */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel {
  position: absolute; inset-inline-end: 0; inset-block-start: calc(100% + 4px); z-index: 30;
  min-inline-size: 16rem; padding: var(--s-3);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.12);
}

/* One language at a time once the script has chosen one; all three, labelled, without it. */
.lang-switch { align-items: center; margin-block-end: var(--s-3); }
.lang-switch[hidden] { display: none; }
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: var(--r-ctl); overflow: hidden; }
.seg { padding: var(--s-1) var(--s-3); background: transparent; border: 0; cursor: pointer; font: inherit; font-size: 13px; color: var(--fg); }
.seg + .seg { border-inline-start: 1px solid var(--border); }
.seg[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); }
.lang-missing { font-weight: 600; }
.seg[aria-pressed="true"] .lang-missing { color: inherit; }
.lang-field { position: relative; }
.lang-field + .lang-field { margin-block-start: var(--s-1); }
.lang-tag { display: block; margin-block-start: 2px; }
.product-form[data-lang] .lang-tag { display: none; }
.product-form[data-lang] .lang-field + .lang-field { margin-block-start: 0; }
.product-form[data-lang="fr"] .lang-field:not([data-lang="fr"]),
.product-form[data-lang="ar"] .lang-field:not([data-lang="ar"]),
.product-form[data-lang="en"] .lang-field:not([data-lang="en"]) { display: none; }

/* Money and weight with their unit in the box, as Shopify draws them. */
.input-unit { position: relative; display: flex; align-items: center; }
.input-unit > .input { padding-inline-end: 2.75rem; }
.input-unit > span:last-child:not(:first-child) {
  position: absolute; inset-inline-end: var(--s-3); font-size: 12.5px; color: var(--fg-faint); pointer-events: none;
}
.input-prefix > span:first-child {
  padding-inline: var(--s-2); align-self: stretch; display: flex; align-items: center;
  border: 1px solid var(--border-firm); border-inline-end: 0; border-start-start-radius: var(--r-ctl);
  border-end-start-radius: var(--r-ctl); background: var(--muted); font-size: 12.5px; color: var(--fg-faint);
}
.input-prefix > .input { padding-inline-end: var(--s-3); border-start-start-radius: 0; border-end-start-radius: 0; }
.three-up { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); }
.readout { display: block; padding-block: 8px; font-weight: 600; }

/* Pictures: the first one large, the rest in a grid, the add tile last. */
.media-grid {
  display: grid; gap: var(--s-2);
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
}
.media-tile {
  position: relative; margin: 0; display: flex; flex-direction: column; gap: 4px;
  border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; background: var(--surface);
  cursor: grab;
}
.media-tile:first-child { grid-column: span 2; grid-row: span 2; }
.media-tile img { inline-size: 100%; block-size: auto; aspect-ratio: 1; object-fit: cover; display: block; }
.media-tile.is-dragging { opacity: 0.4; }
.media-tile.media-pending { cursor: default; }
.media-tile figcaption { padding: 0 var(--s-2) var(--s-1); }
.media-tools { display: flex; align-items: center; gap: 4px; padding: 0 var(--s-1); font-size: 12px; }
.media-move { border: 1px solid var(--border); background: var(--surface); border-radius: 4px; padding: 0 6px; cursor: pointer; color: var(--fg); }
.media-remove { display: inline-flex; gap: 4px; align-items: center; margin-inline-start: auto; }
.media-alt { padding: 0 var(--s-2) var(--s-2); }
.media-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-block-size: 7.5rem; padding: var(--s-3); text-align: center; cursor: pointer;
  border: 1.5px dashed var(--border-firm); border-radius: var(--r);
}
.media-drop.is-over { border-color: var(--primary); background: var(--muted); }
.media-drop { position: relative; }
/* The whole tile is the file input: clicking anywhere chooses, and it stays a real, focusable
 * input for the keyboard and for a browser with no script. */
.media-file { position: absolute; inset: 0; opacity: 0; cursor: pointer; inline-size: 100%; block-size: 100%; }
.media-drop:focus-within { outline: 2px solid var(--ring); outline-offset: 2px; }
.media-library .picks { margin-block-start: var(--s-2); }

/* Options and the combinations they make. */
.option-block { border: 1px solid var(--border); border-radius: var(--r); padding: var(--s-3); margin: 0; }
.option-new > summary { list-style: none; cursor: pointer; }
.option-new > summary::-webkit-details-marker { display: none; }
.option-new[open] > summary { margin-block-end: var(--s-2); }
.link-btn { color: var(--fg); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.value-row { align-items: flex-start; }
.swatch-field { inline-size: 7rem; }
.variant-table input.input-sm { inline-size: 7rem; }
.variant-table input.mono { inline-size: 8rem; }
.offer-row .input-sm { inline-size: 6rem; }

/* What a search result would show. */
.seo-preview { display: flex; flex-direction: column; gap: 2px; padding: var(--s-3); border: 1px solid var(--border); border-radius: var(--r); }
.seo-url { color: var(--fg-faint); overflow-wrap: anywhere; }
.seo-title { color: var(--fg); font-size: 17px; font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
.seo-desc { color: var(--fg-faint); }

/* The product list: Shopify's index table, with a bar that appears once anything is ticked. */
.bulkbar { align-items: center; padding: var(--s-2) var(--s-3); border: 1px solid var(--border); border-radius: var(--r); background: var(--muted); }
.bulkbar[hidden] { display: none; }
.check-col { inline-size: 2.25rem; }
.product-table .thumb img { inline-size: 48px; block-size: 48px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
/* Earlier/later are directions in the reading order, so the arrows mirror in Arabic. */
[dir="rtl"] .media-move { transform: scaleX(-1); }

/* The category tree: children indented under their parent. */
.cat-child td:first-child { padding-inline-start: var(--s-6, 24px); }
.cat-edit[open] > summary { margin-block-end: var(--s-2); }
.cat-edit-panel { min-inline-size: min(36rem, 80vw); padding: var(--s-3); border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }

/* The stock matrix: sizes down, colours across, totals on both edges. */
.stock-matrix input.matrix-cell { inline-size: 5rem; text-align: end; }
.stock-matrix tbody tr:last-child th, .stock-matrix tbody tr:last-child td { border-block-start: 2px solid var(--border-firm); }
.btn-reset { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; text-align: start; }
.media-plus { font-size: 26px; line-height: 1; font-weight: 300; }
.media-too-big { border-color: var(--danger); }
.media-too-big .media-tools span { color: var(--danger); }
/* The help bubble sits in the corner the Save button would use: the foot leaves it room, on
 * whichever side the reading direction puts it. */
.product-foot { padding-inline-end: 4.5rem; }

/* The provider-per-feature table: menus at the width of what they say, feature names as text. */
.bo-tasks select { inline-size: auto; min-inline-size: max-content; }
.bo-tasks th[scope="row"] { text-transform: none; letter-spacing: normal; font-size: 14px; color: var(--fg); white-space: normal; }

/* The order's item editor: quantities stay short, menus take the room. */
.qty-input { inline-size: 5rem; text-align: end; }
details[data-dz-items-edit] > summary, details[data-dz-client-edit] > summary { list-style: none; cursor: pointer; inline-size: fit-content; }
details[data-dz-items-edit] > summary::-webkit-details-marker, details[data-dz-client-edit] > summary::-webkit-details-marker { display: none; }
details[data-dz-items-edit][open] > summary, details[data-dz-client-edit][open] > summary { margin-block-end: var(--s-2); }

/* --- the theme workspace ----------------------------------------------------
 *
 * Full-window, like Shopify's theme editor: a top bar, then three columns — the page's sections
 * and the assistant, the shop, and the selected element's settings. The panels scroll in their
 * own columns; the window never does, because an editor whose canvas moves when you scroll a
 * panel is an editor you fight (and a drag that scrolls the page drops in the wrong place).
 */
.ws {
  display: flex;
  flex-direction: column;
  block-size: 100svh;
  background: var(--muted);
}
.ws-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: var(--s-3);
  align-items: center;
  padding: var(--s-2) var(--s-3);
  background: var(--surface);
  border-block-end: 1px solid var(--border);
}
.ws-top-start, .ws-top-mid, .ws-top-end { display: flex; gap: var(--s-2); align-items: center; min-inline-size: 0; }
.ws-top-end { justify-content: flex-end; flex-wrap: wrap; }
.ws-top-mid { justify-content: center; flex-wrap: wrap; }
.ws-shop { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-inline-size: 16ch; }
.ws-status { min-inline-size: 8ch; }
.ws-flash, .ws-gate { margin: var(--s-2) var(--s-3) 0; }
.ws-gate > summary { cursor: pointer; font-weight: 600; }
.ws-gate .findings { margin-block-start: var(--s-2); }
.ws-body {
  flex: 1 1 auto;
  min-block-size: 0;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 320px;
}
.ws-left, .ws-right {
  min-block-size: 0;
  overflow-y: auto;
  background: var(--surface);
}
.ws-left { border-inline-end: 1px solid var(--border); }
.ws-right { border-inline-start: 1px solid var(--border); padding: var(--s-3); }
.ws-tabs {
  position: sticky;
  inset-block-start: 0;
  z-index: 2;
  display: flex;
  background: var(--surface);
  border-block-end: 1px solid var(--border);
}
.ws-tab {
  flex: 1 1 0;
  padding: var(--s-2) var(--s-1);
  text-align: center;
  font-size: 13px;
  color: var(--fg-muted);
  text-decoration: none;
  border-block-end: 2px solid transparent;
}
.ws-tab:hover { color: var(--fg); }
.ws-tab[aria-selected="true"] { color: var(--fg); font-weight: 600; border-block-end-color: var(--fg); }
.ws-panel { padding: var(--s-3); }
.ws-panel[hidden] { display: none; }
.ws-canvas { min-inline-size: 0; min-block-size: 0; display: flex; padding: var(--s-3); }
.ws-stage { flex: 1 1 auto; display: flex; justify-content: center; min-inline-size: 0; }
.ws-frame {
  inline-size: 100%;
  block-size: 100%;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / .08);
  transition: max-inline-size .15s ease;
}

/* The section tree. */
.ws-tree, .ws-tree ol { list-style: none; margin: 0; padding: 0; }
.ws-tree ol { padding-inline-start: var(--s-3); }
.ws-node-row {
  display: flex;
  align-items: center;
  gap: 2px;
  border-radius: var(--r-ctl);
}
.ws-node-row:hover { background: var(--muted); }
.ws-node-row.is-on { background: var(--muted); border-inline-start: 2px solid var(--fg); }
.ws-node-top > .ws-node-row { font-weight: 500; }
.ws-node-btn {
  flex: 1 1 auto;
  min-inline-size: 0;
  padding: 6px var(--s-1);
  background: none;
  border: 0;
  font: inherit;
  font-size: 13.5px;
  color: inherit;
  text-align: start;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.ws-caret, .ws-caret-pad { inline-size: 20px; flex: 0 0 20px; }
.ws-caret { padding: 0; background: none; border: 0; color: var(--fg-muted); cursor: pointer; font-size: 12px; }
.ws-grip { cursor: grab; color: var(--fg-faint); font-size: 12px; letter-spacing: -2px; padding-inline: 2px; }
.ws-node.is-dragging { opacity: .45; }
.ws-node.drop-before { box-shadow: 0 -2px 0 #2563EB; }
.ws-node.drop-after { box-shadow: 0 2px 0 #2563EB; }

/* The inspector. */
.ws-insp-head { padding-block-end: var(--s-2); border-block-end: 1px solid var(--border); }
.ws-actions { display: flex; flex-wrap: wrap; gap: var(--s-1); }
.ws-wrap { flex-wrap: wrap; }
.ws-fields { border: 0; padding: 0; margin: 0; min-inline-size: 0; }
.ws-group { border-block-end: 1px solid var(--border); padding-block: var(--s-2); }
.ws-group > summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  padding-block: var(--s-1);
  list-style-position: inside;
}
.ws-group[open] > summary { margin-block-end: var(--s-2); }
.ws-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); }
.ws-box { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-1); margin-block-end: var(--s-2); }
.ws-box .label { font-size: 11.5px; }
.ws-grid select.input, .ws-box .input { min-inline-size: 0; inline-size: 100%; }
.swatch { inline-size: 36px; block-size: 32px; padding: 2px; border: 1px solid var(--border); border-radius: var(--r-ctl); background: var(--surface); flex: 0 0 36px; }
.chip { padding: 2px 8px; border: 1px solid var(--border); border-radius: 999px; background: var(--muted); font-size: 12px; cursor: pointer; color: inherit; }
.w-full { inline-size: 100%; }
.spinner { display: inline-block; inline-size: 12px; block-size: 12px; border: 2px solid currentColor; border-inline-end-color: transparent; border-radius: 50%; animation: dz-spin .8s linear infinite; vertical-align: -2px; }
@keyframes dz-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

@media (max-width: 1100px) {
  .ws { block-size: auto; min-block-size: 100svh; }
  .ws-top { grid-template-columns: 1fr; }
  .ws-top-mid, .ws-top-end { justify-content: flex-start; }
  .ws-body { grid-template-columns: 1fr; }
  .ws-canvas { order: -1; }
  .ws-frame { min-block-size: 75svh; }
  .ws-left, .ws-right { overflow: visible; border: 0; border-block-start: 1px solid var(--border); }
}
.ws-tab { white-space: nowrap; font-size: 12.5px; }
.ws-right { padding-block-end: 96px; }
.ws-left .ws-panel { padding-block-end: 96px; }
.ws-example {
  display: block;
  inline-size: 100%;
  padding: var(--s-1) var(--s-2);
  border: 1px dashed var(--border);
  border-radius: var(--r-ctl);
  background: none;
  color: var(--fg-muted);
  font: inherit;
  font-size: 12.5px;
  text-align: start;
  cursor: pointer;
}
.ws-example:hover { color: var(--fg); border-color: var(--fg); }

/* While the order's lines are being edited, the editor IS the list: two tables of the same lines
   one above the other read as two orders. */
.order-items:has(details[data-dz-items-edit][open]) .items-read { display: none; }

