/* ===========================================================
   MALMAL — v2 editorial theme (design_handoff_malmal_v2):
   warm paper, ink sidebar, brand red as large color blocks,
   green reserved for verified / paid / delivered.
   Legacy var names (teal/gold/ivory/tint/grad…) are kept as ALIASES
   mapped onto the v2 tokens so existing markup/JS keeps working.
   =========================================================== */
:root {
  /* ---- v2 design tokens (light) ---- */
  --brand: #B3261E;        /* primary buttons, active marks, big red panels */
  --brand-deep: #7A1712;   /* text on blush, gradient end */
  --blush: #F6E4DF;        /* warning / held / overdue tiles */
  --green: #0F8A5F;        /* verified, success, progress */
  --green-deep: #0A6B49;   /* green text, green panels */
  --mint: #E3F3EA;         /* success tiles and pills */
  --amber: #A86A12;        /* pending / quoting / in review (text) */
  --amber-bg: #F8EBD3;     /* pending tiles and pills */
  --amber-deep: #6E4709;   /* deep amber text on --amber-bg ("below your request") */
  --ink: #17110F;          /* text, sidebar, dark cards, secondary buttons */
  --ink-2: #4F4541;        /* body text */
  --ink-3: #857A75;        /* muted text, mono labels */
  --paper: #F7F3EE;        /* page background */
  --card: #FFFDFB;         /* cards */
  --line: rgba(23, 17, 15, .10);
  --line-2: rgba(23, 17, 15, .16);
  --on-dark-green: #6FE0B0; /* accents inside ink cards */
  --on-dark-pink: #FFB4AE;
  --on-dark-amber: #E4AE57; /* a pending accent inside ink cards / bars (the toast's "!", the confirm bar's notes) */
  --on-ink: #FFFFFF;        /* text on ink / brand surfaces */
  --on-ink-soft: rgba(255, 255, 255, .72);
  --ink-fill: #17110F;      /* ink SURFACE under white text — stays dark in both modes (unlike --ink, which flips) */
  /* Brand red used as TEXT or a mark (mode-aware — brightened on dark). --brand / --brand-deep
     stay fixed because they also fill surfaces (buttons, bands, panels) under white text. */
  --brand-text: #B3261E;
  --brand-text-deep: #7A1712;   /* deep accent text; red text on blush tiles */
  /* App shell surfaces */
  --side-bg: #17110F;                  /* ink sidebar — dark in BOTH modes */
  --side-line: rgba(255, 255, 255, .09);
  --hdr-bg: rgba(247, 243, 238, .9);   /* translucent paper header */

  /* Type */
  --font-display: 'Bricolage Grotesque', 'Noto Naskh Arabic', system-ui, sans-serif;
  --font-ui: 'Geist', 'Noto Naskh Arabic', system-ui, -apple-system, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, 'Noto Naskh Arabic', monospace; /* Arabic in mono labels joins properly */

  /* Radii */
  --r-card: 22px;
  --r-hero: 24px;
  --r-control: 12px;
  --r-chip: 9px;

  /* Shadows — mostly flat with 1px borders */
  --shadow: 0 1px 0 rgba(23, 17, 15, .04);
  --shadow-brand: 0 12px 24px -14px rgba(179, 38, 30, .9);   /* primary button */
  --shadow-lift: 0 24px 44px -26px rgba(23, 17, 15, .6);     /* selected cards */

  /* ---- Legacy aliases → v2 (keep old markup working) ---- */
  /* red / teal families were the brand accent (titles, links, borders): text-role red */
  --red-900: var(--brand-text-deep);
  --red-700: var(--brand-text);
  --red-500: var(--brand-text);
  --red-300: #D86A63;
  --teal-900: var(--brand-text-deep);
  --teal-700: var(--brand-text);
  --teal-500: var(--brand-text);
  --teal-400: #D86A63;
  /* orange was the "active accent" (underlines, pills, gradient text): text-role red.
     Its two filled surfaces (.btn-gold, .roletab.auto.active) use the fixed brand reds. */
  --orange-700: var(--brand-text-deep);
  --orange-500: var(--brand-text);
  --orange-300: #D86A63;
  --orange-100: var(--blush);
  /* gold was labels / ornament / dividers: now muted ink + hairlines */
  --gold-900: var(--ink-3);    /* uppercase labels, table headers */
  --gold-700: var(--ink-3);    /* ornament glyph */
  --gold-600: var(--brand-text);
  --gold-500: var(--line-2);   /* ornament rules, flourishes, borders */
  --gold-300: var(--on-dark-pink); /* accent numbers on dark surfaces */
  /* silver → neutral hairlines */
  --silver-700: var(--ink-3);
  --silver-500: var(--line-2);
  --silver-300: var(--line);
  --silver-100: var(--paper);
  /* success */
  --ok-700: var(--green-deep);
  --ok-500: var(--green);
  /* paper surfaces (legacy ivory names) */
  --ivory-50: var(--card);
  --ivory-100: var(--paper);
  --ivory-200: #F1EBE4;
  --ivory-300: #EAE2DA;
  /* states */
  --warn-900: var(--amber);
  --warn-600: var(--amber);
  --danger-600: var(--brand-text-deep);  /* held / anomaly: red text on blush */
  --danger-900: #5A100D;
  /* primary-action gradient (fixed in both modes) */
  --maroon-900: var(--brand-deep);
  --maroon-700: #96201A;
  --maroon-500: var(--brand);

  --ink-soft: var(--ink-2);

  /* mode-aware surfaces & tints */
  --surface: var(--card);
  --tint-red: var(--blush);
  --tint-orange: var(--amber-bg);
  --tint-silver: var(--paper);
  --tint-teal: var(--mint);          /* legacy name: the VERIFIED/positive tint */
  --tint-teal-deep: #CDE9DA;
  --tint-warn: var(--amber-bg);
  --tint-danger: var(--blush);
  --tint-danger-deep: #EFCFC8;
  /* brand gradients — fixed in BOTH modes */
  --grad-teal-a: var(--brand-deep);
  --grad-teal-b: var(--brand);
  --grad-teal-c: #D86A63;
  --on-brand: #FFFFFF;
  --on-brand-soft: rgba(255, 255, 255, .78);
}

/* ===================== DARK MODE =====================
   The v2 prototype is light-only; these are the dark values for every v2
   token. Surfaces invert to warm charcoal; text-facing accents are
   brightened so brand / green / amber text stays readable (AA) on them. */
html[data-theme="dark"] {
  /* v2 tokens (dark). --brand / --brand-deep are NOT overridden: they fill surfaces that carry
     white text (buttons, bands, red panels) and must stay the deep red in both modes. */
  --brand-text: #EC6E64;        /* red as text / marks, brightened for dark cards */
  --brand-text-deep: #FFB4AE;   /* deep accent text; red text on the dark blush tile */
  --blush: #3B1C19;
  --green: #3FCF9A;
  --green-deep: #6FE0B0;
  --mint: #10302A;
  --amber: #E4AE57;
  --amber-bg: #3A2A12;
  --amber-deep: #F2C47C;   /* light amber text on the dark amber tile */
  --on-dark-amber: #E4AE57; /* the same in both modes: it sits on --ink-fill, which stays dark */
  --ink: #F3EDE7;          /* text */
  --ink-2: #D4CAC3;
  --ink-3: #A0948D;
  --paper: #15100E;        /* page */
  --card: #221B18;         /* cards */
  --line: rgba(255, 255, 255, .10);
  --line-2: rgba(255, 255, 255, .18);
  --on-ink: #FFFFFF;
  --on-ink-soft: rgba(255, 255, 255, .72);
  --side-bg: #251D1A;                  /* lifted above the dark page so the panel edge still reads */
  --ink-fill: #2A2320;      /* lifted off the dark paper so ink cards still read as cards */
  --side-line: rgba(255, 255, 255, .12);
  --hdr-bg: rgba(21, 16, 14, .9);
  --shadow: 0 1px 0 rgba(0, 0, 0, .35);
  --shadow-lift: 0 24px 44px -26px rgba(0, 0, 0, .8);

  /* legacy aliases that carried fixed hex (re-point for dark) */
  --red-300: #F08F89;
  --teal-400: #F08F89;
  --orange-300: #F08F89;
  --ivory-200: #2A2220;
  --ivory-300: #332A27;
  --danger-900: #FFC9C4;
  --tint-teal-deep: #164438;
  --tint-danger-deep: #4A2420;
  --on-brand-soft: rgba(255, 255, 255, .78);
}
html[data-theme="dark"] body {
  background: var(--paper);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font-ui);
  font-size: 14.5px; line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
/* Editorial display type (Bricolage): big grotesque headlines, tight tracking */
.display, h1, h2, h3 { font-family: var(--font-display); letter-spacing: -.03em; line-height: 1.05; }
h1 { font-weight: 800; }
h2, h3 { font-weight: 700; }

/* ---- Layout ---- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 18px; }
.app-main { padding: 26px 0 60px; }

/* (The old red topbar + role tabs were replaced by the v2 app shell — see "App shell" below.) */

/* ---- Sub tabs ---- */
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; border-bottom: 1.5px solid var(--line); }
.subtab {
  border: none; background: none; padding: 10px 14px; font-weight: 600; font-size: 13.5px;
  color: var(--ink-soft); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1.5px;
}
.subtab:hover { color: var(--teal-700); }
.subtab.active { color: var(--teal-900); border-bottom-color: var(--orange-500); }

/* ---- Cards ---- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 22px; box-shadow: none; position: relative; overflow: hidden;
}
.card.flush { padding: 0; }
.card-title { font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: -.03em; line-height: 1.1; color: var(--ink); display: flex; align-items: center; gap: 8px; margin: 0; }
.card-sub { font-size: 13.5px; color: var(--ink-3); margin-top: 3px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 860px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } .grid-4 { grid-template-columns: 1fr 1fr; } }

/* ---- Gold ornament ---- */
.ornament { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--gold-700); margin: 6px 0 14px; }
.ornament::before, .ornament::after {
  content: ''; height: 1.5px; flex: 1; max-width: 120px;
  background: linear-gradient(90deg, transparent, var(--gold-500));
}
.ornament::after { background: linear-gradient(90deg, var(--gold-500), transparent); }
.ornament-glyph { font-size: 14px; letter-spacing: 6px; }
.corner-flourish { position: absolute; width: 60px; height: 60px; opacity: .5; pointer-events: none; }
.corner-flourish.tl { top: 8px; left: 8px; }
.corner-flourish.br { bottom: 8px; right: 8px; transform: rotate(180deg); }

/* ---- Buttons ---- */
.btn { border: none; border-radius: var(--r-control); padding: 11px 18px; font-weight: 600; font-size: 14px; cursor: pointer; transition: .18s cubic-bezier(.2,.7,.3,1); display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; font-family: inherit; line-height: 1.2; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary, .btn-brand, .btn-gold { background: var(--brand); color: #fff; box-shadow: var(--shadow-brand); }
.btn-primary:hover:not(:disabled), .btn-brand:hover:not(:disabled), .btn-gold:hover:not(:disabled) { background: var(--brand-deep); transform: translateY(-1px); }
.btn-teal { background: var(--green); color: #fff; }
.btn-teal:hover:not(:disabled) { background: var(--green-deep); transform: translateY(-1px); }
.btn-ghost { background: transparent; border: 1px solid var(--line-2); color: var(--ink); }
.btn-ghost:hover:not(:disabled) { background: var(--paper); border-color: var(--ink-3); }
.btn-ink { background: var(--ink-fill); color: #fff; }
.btn-ink:hover:not(:disabled) { filter: brightness(1.18); }
.btn-white { background: #fff; color: #17110F; }
.btn-white:hover:not(:disabled) { background: #F7F3EE; }
.btn-outline-white { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.35); }
.btn-outline-white:hover:not(:disabled) { border-color: #fff; }
.btn-lg { padding: 16px 22px; font-size: 15.5px; border-radius: 14px; }
.btn-sm { padding: 8px 13px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; justify-content: center; }

/* ---- Forms ---- */
label.fl, .fl { display: block; font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; color: var(--ink-3); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .02em; }
.inp, select.inp, textarea.inp {
  width: 100%; padding: 11px 13px; border-radius: var(--r-control); border: 1px solid var(--line-2);
  background: var(--card); font-size: 14px; color: var(--ink); font-family: inherit; box-sizing: border-box;
}
.inp:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(23,17,15,.08); }
textarea.inp { resize: vertical; min-height: 92px; }
.field + .field { margin-top: 12px; }

/* ---- Pills / badges ---- */
/* v2 pills: Geist Mono, 8px radius. Legacy variants map onto the v2 palette; .pv-* are the v2 names. */
.pill, .pv { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 8px; font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; line-height: 1.2; white-space: nowrap; flex: none; }
.pill-teal, .pv-mint { background: var(--mint); color: var(--green-deep); }
.pill-gold, .pv-outline { border: 1px solid var(--line-2); color: var(--ink-2); background: transparent; }
.pill-red, .pill-danger, .pv-blush { background: var(--blush); color: var(--brand-text-deep); }
.pill-orange, .pill-warn, .pv-amber { background: var(--amber-bg); color: var(--amber); }
.pill-silver, .pill-ghost, .pv-paper { background: var(--paper); color: var(--ink-3); border: 1px solid var(--line); }
.pv-ink { background: var(--ink-fill); color: #fff; }
.badge-verified, .ok { color: var(--green-deep); }
.pink { color: var(--brand-text-deep); }
.small { font-size: 12.5px; }

/* ---- Stat tiles ---- */
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px 22px; }
.stat-value { font-family: var(--font-display); font-size: clamp(26px, 2.6vw, 34px); font-weight: 800; letter-spacing: -.04em; line-height: 1; color: var(--ink); }
.stat-label { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); margin-top: 8px; }

/* ---- Tables ---- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: start; font-family: var(--font-mono); font-weight: 500; color: var(--ink-3); font-size: 11.5px; text-transform: uppercase; letter-spacing: .02em; padding: 8px; border-bottom: 1px solid var(--line-2); }
.tbl td { padding: 10px 8px; border-bottom: 1px solid var(--line); }
.tbl tr:last-child td { border-bottom: none; }

/* ---- Option tiles (Cheapest / Best Value / Simplest) ---- */

/* ---- Per-drug winner rows ---- */
.drugrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.drugrow + .drugrow { margin-top: 8px; }
.drugrow.anomaly { border-color: var(--brand); background: var(--blush); }
.drug-name { font-weight: 700; }
.drug-meta { font-size: 12px; color: var(--ink-soft); }

/* ---- Animations ---- */
.fade-in { animation: fadeIn .45s cubic-bezier(.2, .7, .3, 1) both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.spin { display: inline-block; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- "New version — reload" bar (public/js/version.js): floats at the top, centred, above everything.
   Centred with margins (not a transform): the fade-in animation sets transform itself. ---- */
.update-bar {
  position: fixed; top: calc(12px + env(safe-area-inset-top, 0px)); left: 0; right: 0; margin: 0 auto; z-index: 95;
  width: fit-content; max-width: min(calc(100vw - 32px), 560px);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 12px;
  padding: 10px 12px; padding-inline-start: 18px; border-radius: 16px; background: var(--ink-fill); color: #fff;
  font-size: 14px; font-weight: 500; line-height: 1.35; box-shadow: 0 20px 40px -20px rgba(23, 17, 15, .7);
  animation: fadeIn .3s cubic-bezier(.2, .7, .3, 1) both;
}
.update-bar[hidden] { display: none; }
/* The moment between showing and filling: still in the page (so screen readers know the region), but invisible. */
.update-bar:empty { padding: 0; background: none; box-shadow: none; animation: none; }
.update-text { flex: 1 1 220px; min-width: 0; }
.update-later { padding: 6px 8px; border: 0; background: none; color: rgba(255, 255, 255, .78); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.update-later:hover { color: #fff; }
.update-bar .btn:focus-visible, .update-later:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .update-bar { animation: none; } }
/* "Updated · Show latest · Later" (public/js/live.js): the version bar's look and place (class update-bar), as compact as
   its short text. Never both at once: while the version bar shows, this one waits (its Reload shows the latest too). */
.live-bar .update-text { flex: 0 1 auto; }
.update-bar:not([hidden]) ~ .live-bar { display: none; }

/* ---- Toast ---- */
.toast-wrap { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 90; }
.toast { display: inline-flex; align-items: center; gap: 10px; padding: 13px 18px; border-radius: 14px; font-weight: 500; font-size: 14.5px; color: #fff; background: var(--ink-fill); box-shadow: 0 20px 40px -20px rgba(23,17,15,.7); max-width: min(92vw, 540px); animation: fadeIn .3s cubic-bezier(.2,.7,.3,1) both; }
.toast::before { font-weight: 700; flex: none; }
.toast.success::before { content: '✓'; color: var(--on-dark-green); }
.toast.error::before { content: '!'; color: var(--on-dark-pink); }
.toast.warn::before { content: '!'; color: var(--on-dark-amber); }

/* ---- Sign in / Create account (v2 — the website Sign-in page) ----
   Red brand panel (fixed --brand surface, 44px grid) + a card with Sign in / Create account tabs. */
.auth-wrap { max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); gap: 14px; }
.auth-hero {
  border-radius: 30px; background: var(--brand); color: #fff; padding: clamp(28px, 4vw, 52px); min-height: 520px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px), radial-gradient(90% 80% at 0% 100%, #7A1712, transparent 60%);
  background-size: 44px 44px, 44px 44px, 100% 100%;
}
html[dir=rtl] .auth-hero { background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px), radial-gradient(90% 80% at 100% 100%, #7A1712, transparent 60%); }
.auth-kicker { font-family: var(--font-mono); font-size: 12.5px; opacity: .85; text-transform: uppercase; }
.auth-hero-title { margin: 0; font-family: var(--font-display); font-size: clamp(44px, 6vw, 84px); line-height: .9; letter-spacing: -.05em; font-weight: 800; color: #fff; }
.auth-hero-sub { margin: 20px 0 0; font-size: 17px; line-height: 1.6; opacity: .85; max-width: 400px; }
.auth-points { list-style: none; margin: 22px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-family: var(--font-mono); font-size: 12.5px; }
.auth-points li::before { content: '✓  '; color: #FFB4AE; }
.auth-panel { border-radius: 30px; background: var(--card); border: 1px solid var(--line); padding: clamp(24px, 4vw, 48px); display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.seg { display: flex; background: var(--paper); border-radius: 14px; padding: 4px; border: 1px solid var(--line); }
.seg button { flex: 1; text-align: center; padding: 11px; border-radius: 11px; font-weight: 600; font-size: 14.5px; cursor: pointer; border: none; background: transparent; color: var(--ink-3); font-family: inherit; transition: .15s; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 4px 14px -8px rgba(23,17,15,.4); }
.auth-title { margin: 28px 0 0; font-family: var(--font-display); font-size: 38px; letter-spacing: -.04em; font-weight: 800; line-height: 1.05; color: var(--ink); }
.auth-sub { margin: 8px 0 0; font-size: 14px; color: var(--ink-3); }
.auth-form { display: flex; flex-direction: column; margin-top: 6px; }
.auth-label { display: block; margin-top: 18px; margin-bottom: 8px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.inp-lg { padding: 14px 15px; font-size: 15.5px; border-radius: 13px; }
.auth-cta { margin-top: 24px; }
.rep-backup { margin-bottom: 18px; }
.rep-backup .mono { margin-top: 4px; }
.bk-off { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.bk-off-h { margin: 0; font-family: var(--font-display); font-size: 16px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
/* Password field + show/hide (eye) button */
.pw-wrap { position: relative; display: block; }
.pw-wrap > .inp { width: 100%; padding-right: 50px; }
.pw-eye { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--ink-3); cursor: pointer; }
.pw-eye:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.pw-eye:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.pw-eye[aria-pressed="true"] { color: var(--ink); }
html[dir=rtl] .pw-wrap > .inp { padding-right: 15px; padding-left: 50px; }
html[dir=rtl] .pw-eye { right: auto; left: 6px; }
.code-step { margin-top: 4px; }
.code-sent { margin-top: 18px; font-size: 13.5px; font-weight: 600; color: var(--green-deep); }
/* Log in: why the page signed out, or why this login is refused (turned off, suspended) — stays until the next login. */
.auth-notice { margin-top: 16px; padding: 11px 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--amber) 35%, transparent); background: var(--amber-bg); color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
.code-step .auth-label { margin-top: 8px; }
.otp-inp { font-family: var(--font-mono); font-size: 22px; letter-spacing: .4em; text-align: center; border: 1.5px solid var(--green); background: var(--mint); color: var(--ink); }
.otp-inp:focus { border-color: var(--green-deep); box-shadow: 0 0 0 3px rgba(15,138,95,.15); }
.auth-hint { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; line-height: 1.45; }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 26px 0 4px; font-size: 12.5px; color: var(--ink-3); text-align: center; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--line-2); }
.auth-link { margin-top: 18px; font-size: 13px; color: var(--ink-3); text-align: center; text-decoration: underline; text-underline-offset: 3px; }
.auth-link:hover { color: var(--ink); }
.auth-link[hidden] { display: none; }
.auth-link-quiet { margin-top: 10px; text-decoration: none; }
/* Password label + "Forgot password?" on one line (wraps on narrow screens; RTL follows the flow). */
.auth-label-row { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; margin-top: 18px; margin-bottom: 8px; }
.auth-label-row .auth-label { margin: 0; }
.auth-link-sm { font-size: 12.5px; font-weight: 600; color: var(--brand-text); text-decoration: underline; text-underline-offset: 3px; }
.auth-link-sm:hover { color: var(--brand-text-deep); }
.auth-resend { align-self: flex-start; margin-top: 10px; color: var(--ink-3); }
.auth-note { margin: 14px 0 0; font-size: 13.5px; color: var(--ink-3); text-align: center; line-height: 1.5; }
.role-tiles { margin-top: 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-tile { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 16px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--card); cursor: pointer; transition: .15s; }
.role-tile b { font-weight: 600; font-size: 15px; color: var(--ink); }
.role-tile span { font-size: 13px; color: var(--ink-3); }
.role-tile input, .chip-radio input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.role-tile:hover { border-color: var(--ink-3); }
.role-tile:has(input:checked) { border: 2px solid var(--ink); padding: 15px; box-shadow: var(--shadow-lift); }
.role-tile:has(input:focus-visible), .chip-radio:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(23,17,15,.18); }
.chip-radio { position: relative; }
.chip-radio:has(input:checked) { background: var(--ink-fill); color: #fff; border-color: var(--ink-fill); }
html[data-theme="dark"] .chip-radio:has(input:checked) { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.check-line { margin-top: 18px; display: flex; align-items: flex-start; gap: 9px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 13px; background: var(--card); color: var(--ink-2); font-size: 13.5px; font-weight: 500; cursor: pointer; }
.check-line input { accent-color: var(--ink); width: 16px; height: 16px; margin: 1px 0 0; flex: 0 0 auto; }
.check-line:has(input:checked) { border-color: var(--ink); background: var(--paper); color: var(--ink); }
@media (max-width: 560px) {
  .auth-hero { min-height: 0; border-radius: 24px; gap: 18px; }
  .auth-points { display: none; }            /* keep the form near the top on phones */
  .auth-hero-sub { margin-top: 12px; font-size: 15px; }
  .auth-panel { border-radius: 24px; }
  .auth-title { font-size: 30px; }
  .role-tiles { grid-template-columns: 1fr; }
}

/* ---- Forgot password in 3 steps (the reference design, in MALMAL red) ----
   One card: a red band (back arrow · step name · 3 step marks) with a wave edge, then a centred heading,
   outlined fields with the label on the border, 6 code boxes and one wide red button. */
.fp-wrap { max-width: 460px; margin: 0 auto; padding: 4px 0 24px; }
.fp-card { background: var(--card); border: 1px solid var(--line); border-radius: 28px; overflow: hidden; box-shadow: 0 30px 60px -42px rgba(23, 17, 15, .6); }
.fp-band {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 22px 22px 74px; background: var(--brand); color: #fff;
  background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px), radial-gradient(90% 140% at 100% 0%, #7A1712, transparent 62%);
  background-size: 44px 44px, 44px 44px, 100% 100%;
}
.fp-back { flex: 0 0 auto; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 12px; background: rgba(255,255,255,.14); color: #fff; cursor: pointer; transition: background .15s; }
.fp-back:hover { background: rgba(255,255,255,.26); }
.fp-back:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
html[dir=rtl] .fp-back svg { transform: scaleX(-1); }
.fp-band-title { flex: 1; min-width: 0; font-family: var(--font-display); font-size: 21px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.fp-steps { display: flex; gap: 5px; flex: 0 0 auto; }
.fp-steps i { width: 16px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.3); }
.fp-steps i.on { background: #fff; }
.fp-wave { position: absolute; left: 0; bottom: -1px; width: 100%; height: 60px; display: block; fill: var(--card); }
html[dir=rtl] .fp-wave { transform: scaleX(-1); }
.fp-body { padding: 4px clamp(20px, 6vw, 40px) 28px; text-align: center; display: flex; flex-direction: column; }
.fp-h { margin: 0; font-family: var(--font-display); font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; color: var(--brand-text); }
.fp-sub { margin: 8px auto 0; max-width: 340px; font-size: 14px; line-height: 1.55; color: var(--ink-3); overflow-wrap: anywhere; }
.fp-form { display: flex; flex-direction: column; gap: 22px; margin-top: 28px; text-align: start; }
.fp-field { position: relative; display: flex; align-items: center; gap: 10px; padding-inline: 14px 6px; border: 1.5px solid var(--line-2); border-radius: 13px; background: var(--card); transition: border-color .15s, box-shadow .15s; }
.fp-field:focus-within { border-color: var(--brand-text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent); }
.fp-legend { position: absolute; top: 0; inset-inline-start: 11px; transform: translateY(-55%); padding: 0 5px; background: var(--card); font-size: 12px; font-weight: 600; line-height: 1.2; color: var(--ink-2); }
.fp-field:focus-within .fp-legend, .fp-field:focus-within .fp-ico { color: var(--brand-text); }
.fp-ico { flex: 0 0 auto; display: inline-flex; color: var(--ink-3); }
.fp-inp { flex: 1; min-width: 0; padding: 15px 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 16px; }
.fp-inp::placeholder { color: var(--ink-3); opacity: .7; }
.fp-field .pw-eye { position: static; transform: none; flex: 0 0 auto; }
.fp-login { align-self: center; margin-top: 22px; }
/* The code: 6 painted boxes; one transparent input lies over them and takes the typing. */
.otp-boxes { position: relative; direction: ltr; display: grid; grid-template-columns: repeat(6, 1fr); gap: clamp(6px, 2vw, 10px); width: 100%; max-width: 340px; margin: 0 auto; }
.otp-box { aspect-ratio: 5 / 6; display: flex; align-items: center; justify-content: center; border: 1.5px solid var(--line-2); border-radius: 12px; background: var(--paper); font-family: var(--font-mono); font-size: 24px; font-weight: 600; color: var(--ink); transition: border-color .12s, background .12s, box-shadow .12s; }
.otp-box.filled { background: var(--blush); border-color: color-mix(in srgb, var(--brand-text) 45%, transparent); color: var(--brand-text-deep); }
.otp-box.cur { border-color: var(--brand-text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent); }
.otp-box.cur:empty::after { content: ''; width: 2px; height: 40%; background: var(--brand-text); animation: otp-blink 1s steps(1) infinite; }
/* Not opacity:0 — iPhones hide the long-press "Paste" menu on fully transparent fields; only its text is invisible. */
.otp-hidden { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; outline: none; background: transparent; color: transparent; -webkit-text-fill-color: transparent; caret-color: transparent; font-size: 16px; cursor: text; }
.otp-hidden::selection { background: transparent; }
.otp-hidden:-webkit-autofill { -webkit-box-shadow: 0 0 0 100px transparent inset; -webkit-text-fill-color: transparent; }
.otp-hidden:autofill { box-shadow: 0 0 0 100px transparent inset; -webkit-text-fill-color: transparent; }
.otp-boxes.shake { animation: otp-shake .35s; }
@keyframes otp-blink { 50% { opacity: 0; } }
@keyframes otp-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .otp-boxes.shake, .otp-box.cur:empty::after { animation: none; } }
.fp-resend { margin-top: -8px; text-align: center; font-size: 13px; color: var(--ink-3); }
.fp-resend .linkbtn { font-size: 13px; font-weight: 600; color: var(--brand-text); opacity: 1; }
.fp-resend .linkbtn:disabled { color: var(--ink-3); cursor: default; text-decoration: none; }
.fp-hint { margin-top: -8px; text-align: center; }
@media (max-width: 560px) {
  .fp-wrap { padding-top: 0; }
  .fp-card { border-radius: 24px; }
  .fp-band { padding: 18px 16px 66px; }
  .fp-band-title { font-size: 19px; }
  .fp-h { font-size: 23px; }
}

.muted { color: var(--ink-soft); }
.hidden { display: none !important; }
.sparkline { width: 100%; height: 60px; }
.spark-dot { fill: var(--orange-500); }

/* ---- URGENT priority toggle (§4) ---- */
.prio-toggle { display: flex; gap: 8px; }
.prio { flex: 1; padding: 11px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); font-weight: 800; font-size: 13.5px; cursor: pointer; text-align: center; transition: .15s; color: var(--ink-soft); }
.prio.std.active { border-color: var(--ink); background: var(--paper); color: var(--ink); }
.prio.urg.active { border-color: var(--brand); background: var(--blush); color: var(--brand-text-deep); }
.prio small { display: block; font-weight: 500; font-size: 11px; margin-top: 2px; }
.card.urgent-border { border-color: var(--red-500); box-shadow: 0 10px 30px -12px rgba(225,27,34,.3); }

/* ---- Expiry threshold pills ---- */
.expiry-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.expill { padding: 9px 13px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--card); font-weight: 500; font-size: 14px; cursor: pointer; color: var(--ink-2); transition: .15s; font-family: inherit; white-space: nowrap; }
.expill.active { border-color: var(--ink-fill); background: var(--ink-fill); color: #fff; }

/* ---- 5-stage order status tracker (§4 My Orders) ---- */
.tracker { display: flex; align-items: flex-start; margin: 12px 0 4px; }
.tstage { flex: 1; text-align: center; position: relative; }
.tstage .dot { width: 16px; height: 16px; border-radius: 50%; margin: 0 auto; background: var(--paper); border: 2px solid var(--line-2); position: relative; z-index: 2; box-sizing: border-box; }
.tstage.done .dot { background: var(--ink-fill); border-color: var(--ink-fill); }
.tstage .tlabel { font-size: 10.5px; font-weight: 700; color: var(--ink-faint, #8a988f); margin-top: 5px; }
.tstage.done .tlabel { color: var(--ink); }
.tstage::before { content: ''; position: absolute; top: 7px; left: -50%; width: 100%; height: 2px; background: var(--line-2); z-index: 1; }
.tstage:first-child::before { display: none; }
.tstage.done::before { background: var(--ink); }

/* ---- Verification doc chips (§6 Verify queue) ---- */

/* ---- Clickable analytics stats (§6) ---- */
.statbtn { cursor: pointer; text-align: left; width: 100%; font-family: inherit; transition: .15s; position: relative; }
.statbtn:hover { transform: translateY(-2px); border-color: var(--ink-3); box-shadow: var(--shadow-lift); }
.statbtn::after { content: '›'; position: absolute; inset-inline-end: 13px; top: 12px; color: var(--ink-3); font-size: 18px; font-weight: 800; opacity: 0; transition: .15s; }
.statbtn:hover::after { opacity: 1; }

/* ---- Maroon report header (§6 Reports) ---- */
.report-head { background: linear-gradient(120deg, var(--maroon-900), var(--maroon-500)); color: var(--on-brand); border-radius: 16px; padding: 18px 20px; }
.report-head .rh-hash { font-family: var(--font-mono); font-size: 11px; opacity: .85; word-break: break-all; }
.badgegrid { display: flex; gap: 8px; flex-wrap: wrap; }
.compbadge { padding: 6px 13px; border-radius: 999px; border: 1.5px solid var(--gold-300); background: var(--ivory-200); color: var(--gold-900); font-weight: 700; font-size: 12px; }

/* ---- Supplier profile band (§5) ---- */

/* ---- Components previously unstyled (option grid, confirmed banner, auto hero) ---- */
/* v2 option cards: selected = 2px border + lift + filled radio. The Quotes' Best Match · Budget · Premium cards (and a
   group buy's) add .lb-* (below, "Best Match · Budget · Premium"). */
.opts { margin-top: 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 14px; }
.opt { cursor: pointer; border-radius: var(--r-hero); padding: 24px; text-align: start; font-family: inherit; border: 2px solid transparent; min-width: 0; transition: transform .2s cubic-bezier(.2,.7,.3,1), box-shadow .2s; }
.opt.sel { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.opt-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.opt-tag { font-family: var(--font-mono); font-size: 12px; }
.opt-radio { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-2); flex: none; box-sizing: border-box; }
.opt.sel .opt-radio { background: #fff; border-width: 6px; border-color: var(--ink); }
.opt-fig { font-family: var(--font-display); font-size: clamp(36px, 3.6vw, 50px); font-weight: 800; letter-spacing: -.045em; line-height: 1; margin-top: 22px; }
.opt-sub { font-size: 14px; margin-top: 10px; opacity: .72; }
.auto-hero { background: linear-gradient(120deg, var(--grad-teal-a), var(--grad-teal-b) 60%, var(--gold-600)); color: var(--on-brand); border-radius: 20px; padding: 26px; box-shadow: var(--shadow); }
.confirmed-banner { background: var(--mint); color: var(--green-deep); border-radius: 16px; padding: 18px 20px; display: flex; align-items: center; gap: 14px; }
.confirmed-banner .check { width: 42px; height: 42px; border-radius: 50%; background: var(--green-deep); color: #fff; display: grid; place-items: center; font-size: 22px; font-weight: 800; flex: none; }
.order-line { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.order-line:last-child { border-bottom: none; }
.sms-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--green-deep); font-weight: 600; }
.photo-verify { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); background: var(--paper); border: 1px solid var(--line); padding: 4px 10px; border-radius: 8px; }

/* ---- Theme toggle (sun/moon) ---- */
.theme-toggle {
  width: 36px; height: 36px; border-radius: 11px; border: 1.5px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.12); color: var(--on-brand); font-size: 16px; cursor: pointer;
  display: grid; place-items: center; transition: .15s;
}
.theme-toggle:hover { background: rgba(255,255,255,.22); transform: translateY(-1px); }

/* ---- Grouped order box / credit statements ---- */
.group-box { border: 1px solid var(--line); border-radius: 16px; background: var(--card); padding: 16px; margin-bottom: 12px; }
.group-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.group-lines { margin-top: 9px; border-top: 1px dashed var(--line); }
.group-line { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.group-line:last-child { border-bottom: none; }

/* ---- Clickable watch cards ---- */
.watch-card { cursor: pointer; }
.watch-card:hover { border-color: var(--gold-500); }
.watch-detail { margin-top: 10px; border-top: 1.5px dashed var(--line); padding-top: 10px; }

/* ---- Professional empty state (Broadcast status panel) ---- */
.estate { max-width: 560px; margin: 0 auto; text-align: center; padding: 26px 18px 18px; }
.estate-accent { position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--maroon-900), var(--maroon-500) 55%, var(--gold-500)); }
.estate-badge {
  width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 14px;
  display: grid; place-items: center; color: var(--orange-700);
  background: var(--tint-orange); border: 1.5px solid var(--orange-300);
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--tint-orange) 55%, transparent);
}
.estate-badge svg { width: 34px; height: 34px; }
.estate h3 { margin: 0 0 6px; font-size: 17px; font-weight: 800; color: var(--ink); }
.estate p { margin: 0 auto; font-size: 13px; color: var(--ink-soft); line-height: 1.65; max-width: 400px; }
.estate .btn { margin-top: 16px; }
.estate-steps { display: flex; align-items: flex-start; justify-content: center; gap: 6px;
  margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--line); }
.estate-step { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 86px; }
.estate-step .num {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11.5px; font-weight: 800; font-family: var(--font-mono);
  background: var(--tint-orange); color: var(--orange-700); border: 1.5px solid var(--orange-300);
}
.estate-step .cap { font-size: 11px; font-weight: 600; color: var(--ink-soft); line-height: 1.3; }
.estate-arrow { color: var(--gold-500); font-size: 13px; margin-top: 5px; }

/* ---- Notification bell (Part 1) ---- */
.bell-wrap { position: relative; display: inline-block; }
.bell-badge { position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--red-500); color: #fff; font-size: 10px; font-weight: 800;
  display: grid; place-items: center; font-family: var(--font-mono); }
.bell-badge[hidden] { display: none; } /* no "0" badge on an empty account */
.bell-panel { position: absolute; right: 0; top: 44px; width: 340px; max-height: 60vh; overflow-y: auto;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); z-index: 80; padding: 6px; }
.bell-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; color: var(--ink); }
.bell-link { background: none; border: none; color: var(--orange-700); font-weight: 700; font-size: 12px; cursor: pointer; }
.bell-item { padding: 9px 10px; border-radius: 10px; border-bottom: 1px solid var(--line); }
.bell-item:last-child { border-bottom: none; }
.bell-item.unread { background: var(--tint-orange); }
.bell-title { font-weight: 700; font-size: 13px; color: var(--ink); }
.bell-body { font-size: 12px; color: var(--ink-soft); margin-top: 2px; line-height: 1.4; }
.bell-time { font-size: 10.5px; color: var(--ink-soft); opacity: .7; margin-top: 3px; font-family: var(--font-mono); }
.bell-empty { padding: 18px; text-align: center; color: var(--ink-soft); font-size: 13px; }

/* ---- Part 4.1: Arabic RTL (additive overrides — never edit the base LTR rules) ---- */
/* Arabic: Noto Naskh leads so Arabic text, digits and punctuation share one metric; Latin glyphs
   still fall through to Geist / Bricolage. */
html[dir=rtl] body { font-family: 'Noto Naskh Arabic', var(--font-ui); }
html[dir=rtl] .display, html[dir=rtl] h1, html[dir=rtl] h2, html[dir=rtl] h3 { font-family: 'Noto Naskh Arabic', var(--font-display); letter-spacing: 0; }
html[dir=rtl] .tbl th, html[dir=rtl] .tbl td { text-align: right; }
html[dir=rtl] .bell-panel { right: auto; left: 0; }
html[dir=rtl] .bell-badge { right: auto; left: -4px; }
html[dir=rtl] .statbtn::after { content: '‹'; right: auto; left: 13px; }
html[dir=rtl] .corner-flourish.br { right: auto; left: 10px; transform: scaleX(-1); }
html[dir=rtl] .estate-arrow { transform: scaleX(-1); }

/* ---- Part 3: finance — line chart, currency toggle ---- */
.line-chart { display: block; margin: 4px 0; border-radius: 10px; }
#currency-toggle { font-family: var(--font-mono); letter-spacing: .3px; }

/* ---- Part 2: cold-chain toggle, substitute chips, shipment trail ---- */
.cc-toggle {
  border: 1px solid var(--line-2); background: var(--card); border-radius: 10px;
  font-size: 15px; line-height: 1; cursor: pointer; color: var(--ink-3);
  display: grid; place-items: center; height: 36px; width: 36px; flex: none; transition: .12s;
}
.cc-toggle:hover { border-color: var(--ink); color: var(--ink); }
.cc-toggle.on { background: var(--mint); border-color: var(--green); color: var(--green-deep); }
.sub-chip {
  background: var(--paper); border: 1px solid var(--line-2); color: var(--ink-2); font-family: inherit;
  border-radius: 8px; padding: 3px 9px; font-size: 11.5px; font-weight: 500; cursor: pointer;
}
.sub-chip:hover { border-color: var(--ink); color: var(--ink); }
.ship-trail-box { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--paper); }
.ship-step { display: flex; align-items: center; gap: 9px; padding: 5px 0; font-size: 12.5px; color: var(--ink-soft); }
.ship-step .ship-text { flex: 1; }
.ship-step .ship-dot { width: 10px; height: 10px; border-radius: 999px; background: var(--line-2); flex: none; }
.ship-step.now .ship-dot { background: var(--brand); box-shadow: 0 0 0 3px var(--blush); }
.ship-step.now { color: var(--ink); font-weight: 600; }

/* ---- Quote validity / star rating bits (Part 1) ---- */
.pill-expired { background: var(--paper); color: var(--ink-3); border: 1px solid var(--line); }
.stars-input { display: inline-flex; gap: 3px; font-size: 22px; cursor: pointer; }
.stars-input .st { color: var(--line-2); transition: .1s; }
.stars-input .st.on { color: var(--amber); }
.review-row { padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.review-row:last-child { border-bottom: none; }

/* ===========================================================
   v2 APP SHELL — ink sidebar (role-based nav) + breadcrumb header
   Sidebar is dark in both modes. ☰ (Gmail-style): desktop = full ↔ icon rail (remembered); tablet =
   rail + a drawer over the page; phone = no rail, drawer only. Classes on <html> drive it (app.js +
   theme-init.js): .nav-rail · .nav-tab · .nav-off · .nav-open — see "☰ MENU" below.
   =========================================================== */
.shell { display: flex; min-height: 100vh; }
.side {
  flex: none; width: 252px; min-width: 0; background: var(--side-bg); color: #fff; border-inline-end: 1px solid var(--side-line);
  padding: 20px 14px 16px; display: flex; flex-direction: column; gap: 6px;
  position: sticky; top: 0; height: 100vh; overflow-x: hidden; overflow-y: auto;
  transition: width .2s cubic-bezier(.2, .7, .3, 1);
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent;
}
.side-top { display: flex; align-items: flex-start; gap: 8px; }
.side-top .side-logo { flex: 1; min-width: 0; }
.side-logo { display: flex; align-items: center; gap: 10px; padding: 6px 8px 22px; cursor: pointer; }
.side-logo-mark {
  width: 32px; height: 32px; border-radius: 9px; background: var(--brand); color: #fff; flex: none;
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 17px;
}
.side-wordmark { font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: -.5px; color: #fff; }
.side-nav { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; } /* long nav scrolls; footer stays anchored */
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 12px; margin: 2px 0; border: none; border-radius: 12px; background: transparent;
  color: rgba(255,255,255,.62); font: inherit; font-size: 14.5px; font-weight: 500; text-align: start;
  cursor: pointer; white-space: nowrap; transition: background .2s, color .2s;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-item.active { color: #fff; background: rgba(255,255,255,.09); }
.nav-item.active::before {
  content: ''; position: absolute; inset-inline-start: 0; top: 10px; bottom: 10px;
  width: 3px; border-radius: 3px; background: var(--brand);
}
.nav-ico { width: 18px; height: 18px; flex: none; }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav-badge { font-family: var(--font-mono); font-size: 11px; padding: 2px 7px; border-radius: 7px; background: var(--brand); color: #fff; }
.nav-divider { height: 1px; background: var(--side-line); margin: 10px 8px; }
/* Grouped nav (v3): small mono group labels (BUY · MONEY · ORGANISATION …). */
.nav-group { padding-top: 6px; }
.nav-group:first-child { padding-top: 0; }
.nav-group-label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .6px; text-transform: uppercase; color: rgba(255,255,255,.34); padding: 10px 12px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-group:first-child .nav-group-label { padding-top: 2px; }
.nav-group .nav-item { padding: 9px 12px; margin: 1px 0; border-radius: 11px; font-size: 14px; }
html[dir="rtl"] .nav-group-label { letter-spacing: 0; } /* spacing would break Arabic letter joins */

.side-org { margin: 8px 4px 10px; padding: 14px; border-radius: 16px; background: rgba(255,255,255,.06); border: 1px solid var(--side-line); }
.side-org-row { display: flex; align-items: center; gap: 10px; }
.side-org-mark { width: 34px; height: 34px; border-radius: 10px; color: #fff; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.side-org-text { min-width: 0; line-height: 1.25; }
.side-org-name { font-weight: 600; font-size: 13.5px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-org-sub { font-size: 12px; color: rgba(255,255,255,.55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-org-verified { margin-top: 11px; display: flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .3px; color: var(--on-dark-green); }
.side-org-verified.pending { color: #E4AE57; }

.side-foot { display: flex; flex-direction: column; gap: 8px; padding: 4px 4px 0; }
.side-tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.side-note { font-size: 12px; color: rgba(255,255,255,.55); padding: 2px 6px; }
.side-logout {
  width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--side-line);
  background: rgba(255,255,255,.08); color: #fff; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: .15s;
}
.side-logout:hover { background: rgba(255,255,255,.14); }

.shell-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hdr {
  flex: none; position: sticky; top: 0; z-index: 40;
  padding: 18px clamp(16px, 3vw, 36px); display: flex; align-items: center; gap: 16px;
  border-bottom: 1px solid var(--line); background: var(--hdr-bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.hdr-titles { flex: 1; min-width: 0; }
.hdr-crumb { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); letter-spacing: .3px; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hdr-title {
  font-family: var(--font-display); font-size: clamp(24px, 2.4vw, 32px); letter-spacing: -.04em; font-weight: 800; line-height: 1.05;
  margin: 2px 0 0; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hdr-search {
  display: flex; align-items: center; gap: 9px; width: 240px; flex: none; color: var(--ink-3);
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0 13px; transition: .15s;
}
.hdr-search input { flex: 1; min-width: 0; border: none; background: transparent; font: inherit; font-size: 14px; color: var(--ink); padding: 10px 0; outline: none; }
.hdr-search input::placeholder { color: var(--ink-3); }
.hdr-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(179,38,30,.12); }
.hdr-ico {
  position: relative; width: 42px; height: 42px; flex: none; border-radius: 12px; padding: 0;
  background: var(--card); border: 1px solid var(--line); color: var(--ink-2); font: inherit; font-size: 17px;
  display: grid; place-items: center; cursor: pointer; transition: .15s;
}
.hdr-ico:hover { border-color: var(--line-2); transform: translateY(-1px); }
.hdr-ico .bell-badge { top: 6px; right: 6px; }
html[dir=rtl] .hdr-ico .bell-badge { right: auto; left: 6px; }
.btn-new {
  display: inline-flex; align-items: center; gap: 8px; flex: none; white-space: nowrap;
  background: var(--brand); color: #fff; font: inherit; font-size: 14.5px; font-weight: 600;
  padding: 11px 16px; border: none; border-radius: 12px; cursor: pointer; box-shadow: var(--shadow-brand); transition: .15s;
}
.btn-new:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-new b { font-size: 17px; line-height: 1; font-weight: 600; }

/* Content: 1320px max, page padding; the enter animation is .fade-in (0.45s rise/fade). */
.app-main { width: 100%; max-width: 1320px; margin: 0 auto; padding: clamp(16px, 3vw, 36px); box-sizing: border-box; }
/* Navigation now lives in the sidebar. The portals' sub-tab buttons stay in the DOM (hidden) so
   their state, click handlers and deep-links keep working; the sidebar mirrors them. */
.subtabs { display: none; }

@media (max-width: 979px) {
  .hdr-search { display: none; }
}
@media (min-width: 980px) and (max-width: 1099.98px) {
  /* room for ☰ + the page title on narrow desktops: a shorter search box, "+" without its label (as on phones) */
  .hdr-search { width: 170px; }
  .btn-new { padding: 11px 14px; }
  .btn-new-label { display: none; }
}

/* ===========================================================
   ☰ MENU — full sidebar · icon rail · drawer
   .nav-rail  the sidebar shows as the 76px icon rail (desktop by choice, tablets by default)
   .nav-tab   tablet: the sidebar floats (fixed) over a 76px gap, so the drawer opens OVER the page
   .nav-off   phone: no rail — the sidebar is an off-canvas drawer
   .nav-open  the drawer is open (tablet/phone): full sidebar, dim backdrop, page behind locked
   =========================================================== */
/* footer switches: text in the full sidebar, an icon in the rail */
.theme-toggle.tool-btn { width: auto; padding: 0 9px; font-size: 12px; font-weight: 800; }
.tool-ico { display: none; }
.side-logout.tool-btn { display: flex; align-items: center; justify-content: center; gap: 8px; }

/* ☰ in the header (first item: left in LTR, right in RTL) and ✕ inside the drawer */
.nav-toggle { color: var(--ink); }
.nav-toggle svg, .nav-close svg { display: block; }
.nav-close {
  display: none; flex: none; width: 40px; height: 40px; margin-top: 2px; padding: 0; border-radius: 12px;
  border: 1px solid var(--side-line); background: rgba(255,255,255,.08); color: #fff; cursor: pointer;
  place-items: center; transition: background .15s;
}
.nav-close:hover { background: rgba(255,255,255,.16); }
.nav-open .nav-close { display: grid; }
.nav-toggle:focus-visible, .nav-close:focus-visible, .side .nav-item:focus-visible, .side-tools .theme-toggle:focus-visible, .side-logout:focus-visible {
  outline: 2px solid var(--on-dark-green); outline-offset: 2px;
}
.nav-toggle:focus-visible { outline-color: var(--brand-text); } /* #B3261E light · #EC6E64 dark (≥3:1 on the header) */
.side .nav-item:focus-visible { outline-offset: -2px; } /* inside the item: .side-nav's scroll box clips outside rings */

/* the icon rail */
.nav-rail .side { width: 76px; padding: 18px 10px 12px; }
.nav-rail .side-top { justify-content: center; }
.nav-rail .side-logo { justify-content: center; padding: 4px 0 18px; }
.nav-rail .side-wordmark, .nav-rail .nav-label, .nav-rail .nav-divider, .nav-rail .side-org-text,
.nav-rail .side-org-verified, .nav-rail .side-note, .nav-rail .nav-group-label, .nav-rail .side .tool-txt { display: none; }
.nav-rail .nav-item { justify-content: center; padding: 12px; }
.nav-rail .nav-group .nav-item { justify-content: center; padding: 11px; }
.nav-rail .nav-group + .nav-group { border-top: 1px solid var(--side-line); margin-top: 6px; padding-top: 6px; }
/* a count badge becomes a small red dot on the icon (the count is in the tooltip + the button's name) */
.nav-rail .nav-badge {
  position: absolute; top: 8px; inset-inline-end: 13px; width: 9px; height: 9px; padding: 0; border-radius: 50%;
  font-size: 0; line-height: 0; overflow: hidden; box-shadow: 0 0 0 2px var(--side-bg);
}
.nav-rail .side-org { padding: 10px 0; display: grid; place-items: center; margin: 8px 0; }
.nav-rail .side-tools { flex-direction: column; align-items: center; }
.nav-rail .side-tools .theme-toggle { width: 40px; height: 40px; padding: 0; }
.nav-rail .side .tool-ico { display: block; }
.nav-rail .side .tool-glyph { font-size: 14px; font-weight: 800; line-height: 1; }
.nav-rail .side-logout { width: 40px; height: 40px; padding: 0; align-self: center; }

/* tablet: the sidebar floats over a fixed 76px gap → opening/closing never moves the page */
.nav-tab .side {
  position: fixed; top: 0; bottom: 0; inset-inline-start: 0; height: auto; z-index: 30;
  transition: width .2s cubic-bezier(.2, .7, .3, 1), z-index 0s linear .2s;
}
.nav-tab.nav-open .side { z-index: 70; transition: width .2s cubic-bezier(.2, .7, .3, 1), z-index 0s; }
.nav-tab body:not(.logged-out) .shell-main { margin-inline-start: 76px; }

/* phone: no rail — an off-canvas drawer from the start side (left in LTR, right in RTL) */
.side { --side-away: -100%; }
html[dir="rtl"] .side { --side-away: 100%; }
.nav-off .side {
  position: fixed; top: 0; bottom: 0; inset-inline-start: 0; height: auto; z-index: 70;
  width: min(85vw, 300px); transform: translateX(var(--side-away)); visibility: hidden;
  transition: transform .25s cubic-bezier(.2, .7, .3, 1), visibility 0s linear .25s;
}

/* the open drawer: the full sidebar over the page (tablet: its usual 252px; phone: ~85% of the width, max 300px) */
.nav-open .side { box-shadow: 0 0 48px rgba(0,0,0,.4); overscroll-behavior: contain; }
.nav-off.nav-open .side { transform: none; visibility: visible; transition: transform .25s cubic-bezier(.2, .7, .3, 1), visibility 0s; }
.nav-backdrop { display: none; position: fixed; inset: 0; z-index: 65; background: rgba(20, 8, 8, .5); }
.nav-open .nav-backdrop { display: block; animation: nav-fade .2s ease; }
@keyframes nav-fade { from { opacity: 0; } }
html.nav-open { overflow: hidden; } /* the page behind doesn't scroll (root only — on <body> it would break the sticky header) */
html.nav-open.nav-gutter { scrollbar-gutter: stable; } /* …and doesn't shift: the scrollbar's room is kept */

/* short screens (e.g. a phone in landscape = the tablet band): the menu keeps its items' height and the
   whole sidebar scrolls, instead of the menu list being squeezed to nothing between the logo and the footer */
@media (max-height: 600px) {
  .side-nav { flex: 1 0 auto; overflow: visible; }
}

/* touch: targets of at least 44px */
@media (pointer: coarse) {
  .nav-toggle, .nav-close { width: 44px; height: 44px; }
  .side .nav-item, .nav-group .nav-item { min-height: 44px; }
  .side-tools .theme-toggle { min-width: 44px; height: 44px; }
  .nav-rail .side-tools .theme-toggle, .nav-rail .side-logout { width: 44px; height: 44px; }
  .side-logout { min-height: 44px; }
}
.nav-open .side .nav-item { min-height: 44px; }

/* rail tooltip (one fixed element on <body> — the sidebar's scroll box would clip it) */
.nav-tip {
  position: fixed; z-index: 95; top: 0; transform: translateY(-50%); max-width: 260px;
  padding: 6px 10px; border-radius: 8px; background: #17110F; color: #fff; font-size: 12.5px; font-weight: 500; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; opacity: 0; transition: opacity .12s;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
}
.nav-tip.on { opacity: 1; }
html[data-theme="dark"] .nav-tip { background: #3A302C; box-shadow: 0 0 0 1px rgba(255,255,255,.14), 0 6px 18px rgba(0,0,0,.4); }

/* "reduce motion": no slide / width / fade animations */
@media (prefers-reduced-motion: reduce) {
  .side, .nav-off .side, .nav-off.nav-open .side, .nav-tab .side, .nav-tab.nav-open .side, .nav-tip { transition: none; }
  .nav-open .nav-backdrop { animation: none; }
}
/* phones: the header keeps title + icons + an icon-only New request inside the viewport */
@media (max-width: 560px) {
  .hdr { gap: 8px; }
  .hdr-titles { flex: 1 1 auto; min-width: 0; }
  .hdr-title { font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hdr-crumb { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hdr-crumb-tab { display: none; }
  .btn-new { padding: 0 12px; }
  .btn-new-label { display: none; }
}

/* ===========================================================
   v2 SCREENS — editorial components (step 3)
   Dashboard · New request · Quotes · Orders · Credit. Logical
   properties throughout so RTL mirrors for free; colours come
   from the tokens above (incl. --ink-fill for dark ink surfaces).
   =========================================================== */
.notice { border-radius: 14px; padding: 12px 16px; font-size: 13.5px; margin-bottom: 16px; }
.notice-amber { background: var(--amber-bg); color: var(--amber); }
.notice-mint { background: var(--mint); color: var(--green-deep); }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* tiles (KPI cards) */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 14px; }
.tile { border-radius: var(--r-card); background: var(--card); border: 1px solid var(--line); padding: 22px; text-align: start; font-family: inherit; color: var(--ink); min-width: 0; }
.tile-k { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .02em; }
.tile-v { font-family: var(--font-display); font-size: clamp(30px, 3.2vw, 40px); font-weight: 800; letter-spacing: -.04em; line-height: 1; margin-top: 10px; }
.tile-s { font-size: 13px; color: var(--ink-3); margin-top: 8px; }
.tile-blush { background: var(--blush); border-color: transparent; }
.tile-blush .tile-k, .tile-blush .tile-v { color: var(--brand-text-deep); }
.tile-blush .tile-s { color: var(--brand-text); }
.tile-mint { background: var(--mint); border-color: transparent; }
.tile-mint .tile-k, .tile-mint .tile-v, .tile-mint .tile-s { color: var(--green-deep); }
.tile-ink { background: var(--ink-fill); color: #fff; border-color: transparent; }
.tile-ink .tile-k { color: var(--on-dark-green); } .tile-ink .tile-s { color: rgba(255,255,255,.7); }
button.tile { cursor: pointer; transition: transform .2s cubic-bezier(.2,.7,.3,1), box-shadow .2s; }
button.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }

/* dashboard */
.ov-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ov-greet { font-family: var(--font-display); font-size: clamp(34px, 4vw, 54px); line-height: .95; letter-spacing: -.05em; font-weight: 800; margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.ov-meta { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; text-align: end; }
.ov-date { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }
.ov-chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ov-row1 { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 14px; }
.hero-saved {
  flex: 2 1 440px; min-width: 0; border-radius: var(--r-hero); background: var(--brand); color: #fff; padding: 28px; cursor: pointer; border: none; text-align: start; font-family: inherit;
  container-type: inline-size; /* .hero-fig is capped to this card width */
  display: flex; gap: 24px; flex-wrap: wrap; justify-content: space-between; align-items: flex-end;
  background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px); background-size: 40px 40px;
  transition: transform .2s cubic-bezier(.2,.7,.3,1), box-shadow .2s;
}
.hero-saved:hover { transform: translateY(-2px); box-shadow: var(--shadow-brand); }
.hero-k { font-family: var(--font-mono); font-size: 12px; opacity: .8; text-transform: uppercase; }
.hero-fig { font-family: var(--font-display); --big: clamp(56px, 6vw, 84px); font-size: min(var(--big), calc(180cqi / var(--n, 6))); font-weight: 800; letter-spacing: -.05em; line-height: .9; margin-top: 14px; }
.hero-sub { margin-top: 10px; font-size: 14.5px; opacity: .85; max-width: 420px; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 110px; }
.bar-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.bar { width: 22px; border-radius: 6px; background: rgba(255,255,255,.28); }
.bar.now { background: #fff; }
.bar-m { font-family: var(--font-mono); font-size: 10.5px; opacity: .7; }
.live-card { flex: 1 1 260px; min-width: 0; border-radius: var(--r-hero); background: var(--ink-fill); color: #fff; padding: 24px; display: flex; flex-direction: column; }
.live-k { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12px; color: var(--on-dark-green); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--on-dark-green); animation: blink 1.6s infinite; flex: none; }
.live-title { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -.03em; line-height: 1.05; margin-top: 14px; }
.live-sub { font-size: 13.5px; color: rgba(255,255,255,.7); margin-top: 8px; }
.live-card .spacer { flex: 1; min-height: 16px; }
.live-card .btn { align-self: flex-start; margin-top: 18px; }
.prog { height: 6px; border-radius: 6px; background: rgba(255,255,255,.12); overflow: hidden; margin-top: 14px; }
.prog > i { display: block; height: 100%; background: var(--on-dark-green); border-radius: 6px; transition: width .4s cubic-bezier(.2,.7,.3,1); }
.ov-tiles { margin-top: 14px; }
.ov-row3 { margin-top: 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 14px; align-items: start; }

/* list cards (flush rows under a display heading) */
.card-list { padding: 0; }
.list-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 20px 22px 12px; flex-wrap: wrap; }
.list-head h3 { margin: 0; font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: -.03em; color: var(--ink); }
.list-head.col { flex-direction: column; align-items: flex-start; gap: 3px; }
.list-head p { margin: 0; font-size: 13.5px; }
.lrow { display: flex; align-items: center; gap: 14px; padding: 14px 22px; border: none; border-top: 1px solid var(--line); width: 100%; background: none; font-family: inherit; color: inherit; text-align: start; }
button.lrow { cursor: pointer; } button.lrow:hover { background: var(--paper); }
.lrow-id { font-family: var(--font-mono); font-size: 13px; color: var(--ink-3); width: 64px; flex: none; }
.lrow-main { flex: 1; min-width: 0; }
.lrow-title { font-weight: 600; font-size: 14.5px; }
.lrow-sub { font-size: 12.5px; color: var(--ink-3); overflow-wrap: anywhere; }
.lrow-amt { font-family: var(--font-mono); font-weight: 600; font-size: 14px; }
.linkbtn { background: none; border: none; padding: 0; color: inherit; font: inherit; font-size: 12.5px; cursor: pointer; opacity: .8; text-decoration: underline; text-underline-offset: 3px; }
.linkbtn:hover { opacity: 1; }
.linkbtn.pink { color: var(--brand-text); opacity: 1; font-weight: 600; text-decoration: none; }
.linkbtn.pink:hover { text-decoration: underline; }
.attn { padding: 20px 22px; }
.attn-list { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.attn-item { display: flex; gap: 12px; padding: 14px; border-radius: 14px; background: var(--paper); border: none; width: 100%; text-align: start; font-family: inherit; color: var(--ink); align-items: flex-start; }
button.attn-item { cursor: pointer; }
.attn-item.blush { background: var(--blush); } .attn-item.mint { background: var(--mint); }
.attn-ico { width: 28px; height: 28px; border-radius: 8px; background: var(--ink-fill); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; flex: none; }
.attn-item.blush .attn-ico { background: var(--brand); } .attn-item.mint .attn-ico { background: var(--green-deep); }
.attn-t { font-weight: 600; font-size: 14.5px; } .attn-s { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }
.attn-item.blush .attn-t { color: var(--brand-text-deep); } .attn-item.mint .attn-t { color: var(--green-deep); }

/* new request */
.stepchips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.stepchip { white-space: nowrap; font-family: var(--font-mono); font-size: 12px; padding: 7px 11px; border-radius: 8px; border: 1px solid var(--line-2); color: var(--ink-3); text-transform: uppercase; }
.stepchip.on { background: var(--ink-fill); color: #fff; border-color: var(--ink-fill); }
.req-layout { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.req-main { flex: 3 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.req-side { flex: 1 1 300px; min-width: 0; position: sticky; top: 78px; }
.drugline { display: flex; align-items: center; gap: 10px; padding: 10px 22px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.row-n { font-size: 12.5px; color: var(--ink-3); width: 22px; flex: none; }
.row-main { flex: 1 1 180px; min-width: 0; }
.inp-flat { border-color: transparent; background: transparent; padding: 8px 10px; }
.inp-flat:hover { border-color: var(--line); } .inp-flat:focus { background: var(--card); }
.drugline .drug { font-weight: 600; font-size: 15px; }
.drugline .country { width: auto; flex: 0 0 auto; font-size: 13px; color: var(--ink-2); }
/* Country boxes: "Other country…" swaps the select for a box with the world list as suggestions (ui.js wireCountry) */
select.inp[hidden], input.inp[hidden] { display: none; } /* a class display would beat the UA [hidden] rule */
.drugline .country-other { width: 180px; max-width: 100%; flex: 0 1 auto; font-size: 13px; border-color: var(--line-2); background: var(--card); } /* clearly a box to type in */
.country-other[aria-invalid="true"] { border-color: var(--danger-600); box-shadow: 0 0 0 3px rgba(200, 30, 40, .10); }
.chips .chip-input { width: 200px; max-width: 100%; padding: 8px 12px; font-size: 14px; border-radius: 10px; }
.chip-other { border-style: dashed; }
.rfq-hint { font-size: 12.5px; margin: 0 10px 2px; display: none; gap: 6px; flex-wrap: wrap; align-items: center; }
.rfq-hint.show { display: flex; }
.hint-fix { color: var(--green-deep); } .hint-warn { color: var(--amber); }
.stepper { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; flex: none; }
.stepper button { width: 30px; padding: 6px 0; border: none; background: none; color: var(--ink-2); cursor: pointer; font-size: 15px; font-family: inherit; }
.stepper button:hover { background: var(--paper); }
.stepper .qty { width: 64px; text-align: center; border: none; border-radius: 0; padding: 6px 2px; font-family: var(--font-mono); font-size: 13.5px; background: transparent; color: var(--ink); -moz-appearance: textfield; appearance: textfield; }
.stepper .qty:focus { outline: none; background: var(--paper); box-shadow: none; }
.stepper .qty::-webkit-outer-spin-button, .stepper .qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.row-rm { width: 30px; height: 30px; border-radius: 9px; border: none; background: none; color: var(--ink-3); cursor: pointer; flex: none; font-size: 14px; }
.row-rm:hover { background: var(--blush); color: var(--brand-text-deep); }
.add-row { display: flex; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); }
.add-row .inp { flex: 1; min-width: 0; }
.upload-row { display: flex; align-items: center; gap: 12px; padding: 15px 22px; border-top: 1px solid var(--line); background: var(--paper); flex-wrap: wrap; }
.upload-tile { width: 36px; height: 36px; border-radius: 10px; border: 1.5px dashed var(--line-2); background: none; color: var(--ink-3); cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; flex: none; }
.upload-tile:hover { border-color: var(--ink); color: var(--ink); }
.upload-text { flex: 1; min-width: 160px; } .upload-title { font-weight: 600; font-size: 14px; cursor: pointer; }
.parse-summary:not(:empty), .template-picker:not(:empty) { padding: 10px 22px 14px; border-top: 1px solid var(--line); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12.5px; }
.req-label { margin-top: 18px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.chips { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 9px 13px; font-size: 14px; font-weight: 500; border-radius: 10px; cursor: pointer; white-space: nowrap; background: var(--card); color: var(--ink-2); border: 1px solid var(--line-2); font-family: inherit; transition: .15s; }
.chip:hover { border-color: var(--ink-3); }
.chip.on { background: var(--ink-fill); color: #fff; border-color: var(--ink-fill); }
.urgent-row { margin-top: 22px; display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); width: 100%; cursor: pointer; text-align: start; font-family: inherit; color: var(--ink); transition: .2s; }
.urgent-row.on { background: var(--blush); border-color: var(--brand); }
.urgent-text { display: flex; flex-direction: column; gap: 1px; } .urgent-text b { font-weight: 600; font-size: 14.5px; }
.switch { width: 42px; height: 24px; border-radius: 12px; background: var(--line-2); position: relative; flex: none; transition: .2s; }
.switch .knob { position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .2s cubic-bezier(.2,.7,.3,1); }
.urgent-row.on .switch { background: var(--brand); }
.urgent-row.on .switch .knob { inset-inline-start: 21px; }
.summary-card { background: var(--ink-fill); color: #fff; border-radius: var(--r-hero); padding: 26px; font-family: var(--font-mono); }
.sum-k { font-size: 12px; opacity: .55; text-transform: uppercase; }
.sum-sent { opacity: 1; color: var(--on-dark-green); text-transform: none; font-size: 13px; }
.sum-rows { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; font-size: 13.5px; }
.sum-rows > div { display: flex; justify-content: space-between; gap: 12px; }
.sum-rows > div > span:first-child { opacity: .6; }
.sent-rows > div { flex-wrap: wrap; row-gap: 3px; }
.sent-rows > div > span:nth-child(2) { opacity: .7; font-size: 12.5px; }
.sent-rows .sent-n, .sent-rows .sent-none { flex-basis: 100%; font-family: var(--font-ui); font-size: 12.5px; }
.sent-rows .sent-n { color: var(--on-dark-green); }
.sent-rows .sent-none { color: var(--on-dark-pink); }
.sum-divider { margin-top: 20px; padding-top: 18px; border-top: 1.5px dashed rgba(255,255,255,.22); font-family: var(--font-ui); }
.sum-goes { font-size: 13px; opacity: .6; }
.sum-big { font-family: var(--font-display); font-size: 46px; font-weight: 800; letter-spacing: -.04em; line-height: 1; margin-top: 6px; }
.sum-big.small { font-size: 26px; letter-spacing: -.03em; line-height: 1.1; }
.sum-green { font-size: 13px; color: var(--on-dark-green); margin-top: 6px; }
.summary-card .pink-dark { color: var(--on-dark-pink); }
.summary-card .btn-block { margin-top: 22px; }
.sum-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.sum-actions .btn-block { margin-top: 0; }
.sum-links { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 14px; }
.sum-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.sum-form .inp { flex: 1; min-width: 140px; }
.sum-hint { font-size: 11.5px; opacity: .5; margin-top: 12px; line-height: 1.5; }
/* Waiting for REAL supplier quotes (no simulated responses). */
.sum-wait { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; font-size: 13px; line-height: 1.5; opacity: .88; }
.sum-wait .recv-dot { margin-top: 6px; }
.summary-card .inp { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.22); color: #fff; }
.summary-card .inp::placeholder { color: rgba(255,255,255,.45); }
.summary-card .inp:focus { border-color: #fff; box-shadow: none; }
.summary-card select.inp option { color: #17110F; }

/* quotes */
.results { margin-top: 16px; }
.results:empty { margin: 0; }
.recv-banner { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 16px; background: var(--amber-bg); color: var(--amber); flex-wrap: wrap; }
.recv-banner.done { background: var(--mint); color: var(--green-deep); }
.recv-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--amber); flex: none; animation: blink 1.2s infinite; }
.recv-banner.done .recv-dot { background: var(--green); animation: none; }
.recv-text { flex: 1; min-width: 160px; font-weight: 600; font-size: 14.5px; }
.recv-banner .prog { width: min(240px, 30vw); margin: 0; background: rgba(23,17,15,.1); }
.recv-banner .prog > i { background: var(--amber); } .recv-banner.done .prog > i { background: var(--green); }
.qline { display: flex; align-items: center; gap: 16px; padding: 14px 22px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.qline.held { background: var(--blush); }
.qline.held .ql-supname, .qline.held .ql-unit, .qline.held .vs-text { color: var(--brand-text-deep); }
.ql-drug, .ql-sup { flex: 1 1 200px; min-width: 0; }
.ql-name { font-weight: 600; font-size: 15px; } .ql-supname { font-weight: 600; font-size: 14px; }
.ql-vs { flex: 1 1 120px; max-width: 170px; }
.vsbar { height: 5px; border-radius: 5px; background: rgba(23,17,15,.08); overflow: hidden; }
html[data-theme="dark"] .vsbar { background: rgba(255,255,255,.12); }
.vsbar > i { display: block; height: 100%; border-radius: 5px; background: var(--green); }
.qline.held .vsbar > i { background: var(--brand); }
.vs-text { color: var(--green-deep); margin-top: 5px; font-size: 11.5px; }
.ql-price { text-align: end; flex: none; min-width: 84px; margin-inline-start: auto; } /* stays at the row end when the row wraps */
.ql-unit { font-weight: 600; font-size: 15.5px; }
.ql-price .linkbtn { color: var(--brand-text); opacity: .85; font-size: 11.5px; text-decoration: none; margin-top: 2px; }
.qline.unfilled { opacity: .8; }
.deliver-row { padding: 16px 22px 20px; border-top: 1px solid var(--line); max-width: 520px; }
.confirm-bar { position: sticky; bottom: 12px; margin-top: 14px; background: var(--ink-fill); color: #fff; border-radius: 20px; padding: 16px 16px 16px 24px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; box-shadow: 0 20px 40px -20px rgba(23,17,15,.7); z-index: 5; }
html[dir=rtl] .confirm-bar { padding: 16px 24px 16px 16px; }
.cb-main { flex: 1; min-width: 200px; }
.cb-k { font-size: 11.5px; opacity: .55; }
.cb-total { font-family: var(--font-display); font-size: 30px; font-weight: 800; letter-spacing: -.04em; line-height: 1.05; margin-top: 2px; }
.cb-note { font-size: 13.5px; color: var(--on-dark-green); } .cb-note.pink { color: var(--on-dark-pink); }
/* Payment on the confirm bar: Cash / Credit (Cash every time), and what Credit means for each supplier chosen. */
.cb-pay { flex-basis: 100%; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid rgba(255, 255, 255, .14); }
.cb-pay-l { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .02em; color: var(--on-ink-soft); }
.cb-seg { flex: none; padding: 3px; background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .16); }
.cb-seg button { flex: none; padding: 7px 16px; font-size: 13.5px; border-radius: 9px; color: var(--on-ink-soft); }
.cb-seg button.on { background: #fff; color: var(--ink-fill); }
.cb-seg button:disabled { opacity: .45; cursor: not-allowed; }
.cb-pay-note { flex: 1 1 220px; min-width: 0; line-height: 1.4; }
.cb-pay-note.muted { color: var(--on-ink-soft); }
.cb-pay-note.amber { color: #F5C77A; }
/* Phones and short screens: with the payment row the bar would cover about half the screen — it stays in the page,
   after the list. */
@media (max-width: 560px), (max-height: 600px) { .confirm-bar { position: static; } }
.cf-form { border: 1px solid var(--brand); border-radius: 14px; padding: 12px 14px; margin: 0 22px 12px; background: var(--blush); }
.cf-form .cf-title { font-weight: 600; color: var(--brand-text-deep); font-size: 13.5px; margin-bottom: 8px; }

/* orders */
.orders-layout { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); gap: 14px; align-items: start; }
.chips-head { margin: 0; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.orow { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border: none; border-top: 1px solid var(--line); border-inline-start: 3px solid transparent; width: 100%; background: none; cursor: pointer; text-align: start; font-family: inherit; color: var(--ink); transition: background .15s; }
.chips-head + .orow { border-top: none; }
.orow:hover { background: var(--paper); }
.orow.sel { background: var(--paper); border-inline-start-color: var(--brand); }
.orow-main { flex: 1; min-width: 0; }
.orow-top { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.orow-top .mono { font-size: 13px; }
.orow-title { font-weight: 600; font-size: 15px; }
.orow-right { text-align: end; flex: none; }
.orow-total { font-weight: 600; font-size: 14.5px; }
.orow-right > div + div { margin-top: 5px; }
.od-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.od-head h3 { margin: 2px 0 0; font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -.03em; color: var(--ink); }
.od-pills { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.vtrack { margin-top: 24px; }
.vt { display: flex; gap: 16px; }
.vt-rail { display: flex; flex-direction: column; align-items: center; flex: none; }
.vt-dot { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #fff; background: var(--ink-fill); box-sizing: border-box; flex: none; }
.vt-dot.cur { background: var(--brand); box-shadow: 0 0 0 5px var(--blush); }
.vt-dot.up { background: transparent; border: 1.5px solid var(--line-2); }
.vt-line { width: 2px; flex: 1; min-height: 22px; background: var(--line-2); }
.vt-line.done { background: var(--ink); }
.vt:last-child .vt-line { display: none; }
.vt-body { padding-bottom: 20px; min-width: 0; flex: 1; }
.vt-t { font-weight: 600; font-size: 15px; color: var(--ink); } .vt.up .vt-t { color: var(--ink-3); }
.vt-n { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.checkin { margin-top: 4px; padding: 18px; border-radius: 16px; background: var(--paper); border: 1px solid var(--line); }
.checkin-t { font-weight: 600; font-size: 15px; } .checkin-s { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.checkin .chips { margin-top: 12px; gap: 8px; }
.checkin-n { margin-top: 8px; font-size: 12px; color: var(--ink-3); }
.ship-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ship-form .inp { flex: 1 1 160px; max-width: 240px; padding: 6px 9px; }
.ship-done { font-size: 12.5px; font-weight: 600; color: var(--green-deep); }
.od-lines { margin-top: 16px; border-top: 1px solid var(--line); }
.od-line { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; flex-wrap: wrap; align-items: center; }
.od-line:last-child { border-bottom: none; }
.od-foot { margin-top: 16px; padding-top: 16px; border-top: 1.5px dashed var(--line-2); display: flex; justify-content: space-between; gap: 12px; font-family: var(--font-mono); font-size: 13.5px; flex-wrap: wrap; }
.od-foot .total { font-weight: 600; font-size: 16px; }
.od-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.od-panel { margin-top: 10px; }
.od-panel .inp + .inp, .od-panel .btn { margin-top: 6px; }

/* credit */
.rel-card { margin-top: 14px; display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; align-items: center; }
.rel-card .card-title { font-size: 17px; }
.chips-inline { display: flex; gap: 6px; flex-wrap: wrap; }
.ledger-item { border-top: 1px solid var(--line); }
.ledger-row { display: flex; align-items: center; gap: 14px; padding: 15px 22px; flex-wrap: wrap; }
.ledger-id { font-size: 13px; width: 72px; flex: none; }
.ledger-main { flex: 1 1 200px; min-width: 0; }
.ledger-who { font-weight: 600; font-size: 14.5px; }
.ledger-amt { font-weight: 600; font-size: 15px; }
.ledger-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ledger-lines { padding: 0 22px 12px; }
.ledger-line { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px dashed var(--line); font-size: 13px; flex-wrap: wrap; }
.ledger-item.overdue .ledger-row { background: color-mix(in srgb, var(--blush) 45%, transparent); }

/* billing (v2): ink plan card · invoices list · plan ladder */
.bill-layout { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); gap: 14px; align-items: start; }
.plan-card { border-radius: var(--r-hero); background: var(--ink-fill); color: #fff; padding: 28px; min-width: 0; }
.plan-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.plan-k { font-family: var(--font-mono); font-size: 12px; opacity: .55; text-transform: uppercase; }
.plan-status { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; }
.plan-status.ok { color: var(--on-dark-green); } .plan-status.amber { color: #E4AE57; } .plan-status.pink { color: var(--on-dark-pink); } .plan-status.dim { opacity: .6; }
.plan-head { display: flex; align-items: baseline; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.plan-name { font-family: var(--font-display); font-size: clamp(36px, 11vw, 56px); font-weight: 800; letter-spacing: -.05em; line-height: 1; overflow-wrap: anywhere; }
.plan-price { font-family: var(--font-mono); font-size: 20px; } .plan-price .per { opacity: .5; font-size: 14px; }
.plan-sub { margin-top: 6px; font-size: 14px; opacity: .7; }
.plan-cycle { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.chip-dark { font-family: var(--font-mono); font-size: 12px; padding: 7px 11px; border-radius: 8px; border: 1px solid rgba(255,255,255,.3); background: transparent; color: #fff; cursor: pointer; white-space: nowrap; transition: .15s; }
.chip-dark:hover { border-color: #fff; }
.chip-dark.on { background: #fff; color: #17110F; border-color: #fff; }
.plan-vol-k { margin-top: 26px; font-size: 13px; opacity: .7; }
.plan-vol { display: flex; justify-content: space-between; align-items: baseline; margin-top: 6px; gap: 12px; flex-wrap: wrap; }
.plan-vol-fig { font-family: var(--font-display); font-size: 32px; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.plan-band { font-family: var(--font-mono); font-size: 12.5px; opacity: .6; text-transform: uppercase; }
.plan-prog { margin-top: 10px; height: 8px; border-radius: 8px; background: rgba(255,255,255,.12); position: relative; overflow: hidden; }
.plan-prog > i { position: absolute; inset-inline-start: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #6FE0B0, #0F8A5F); border-radius: 8px; transition: width .4s cubic-bezier(.2,.7,.3,1); }
html[dir=rtl] .plan-prog > i { background: linear-gradient(270deg, #6FE0B0, #0F8A5F); }
.plan-note { margin-top: 10px; font-size: 13px; opacity: .65; }
.plan-next { margin-top: 4px; font-size: 13px; color: var(--on-dark-green); }
.compare { margin-top: 24px; padding: 16px; border-radius: 14px; background: rgba(111,224,176,.1); border: 1px solid rgba(111,224,176,.25); }
.compare-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; font-size: 13.5px; }
.compare-fig { font-family: var(--font-mono); font-weight: 600; font-size: 18px; }
.compare-flat { margin-top: 6px; font-size: 13px; color: var(--on-dark-green); }
.plan-foot { margin-top: 16px; font-size: 12px; opacity: .5; line-height: 1.5; }
.inv-row { flex-wrap: wrap; }
.inv-row .lrow-main { flex: 1 1 160px; }
.inv-row .btn { margin-inline-start: auto; }
.inv-row .lrow-title { font-size: 15px; }
.pay-form { margin: 8px 22px 20px; padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--paper); }
.pay-title { font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.pay-grid { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.pay-grid label { display: block; } .pay-grid .grow { flex: 1; min-width: 180px; }
.plan-tiles { margin-top: 14px; }
.tile.cur { border: 2px solid var(--ink); }
.tile-v .per { font-family: var(--font-mono); font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--ink-3); margin-inline-start: 3px; }
.tile-k .pv { margin-inline-start: 6px; vertical-align: middle; text-transform: none; }

/* app-wide loading / empty-state text (used by every screen; previously unstyled) */
.loading, .empty { color: var(--ink-3); font-size: 13.5px; }

/* supplier (v2): stat tiles · pre-filled quote card · open requests · verification panel + documents */
.sup-tiles { margin-bottom: 14px; }
.tiles-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 120px), 1fr)); } /* four compact stat tiles stay on one row */
.sup-layout { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 14px; align-items: start; }
.list-sub { padding: 0 22px 12px; font-size: 13.5px; color: var(--ink-3); }
.quote-head { padding: 20px 22px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.quote-title { margin: 4px 0 0; font-family: var(--font-display); font-size: 26px; font-weight: 800; letter-spacing: -.04em; color: var(--ink); }
.quote-sub { margin: 4px 0 0; font-size: 13.5px; color: var(--ink-2); }
.countdown { font-family: var(--font-mono); font-size: 12.5px; color: var(--brand-text); background: var(--blush); padding: 7px 10px; border-radius: 9px; white-space: nowrap; flex: none; }
.pa-line { border-top: none; }
.pa-line + .pa-line { border-top: 1px solid var(--line); }
.stock-toggle { cursor: pointer; border: none; }
.pa-line.out .ql-drug, .pa-line.out .pa-price { opacity: .6; } .pa-line.out .pa-price { text-decoration: line-through; }
.pa-edit-form { flex-basis: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-top: 4px; }
.pa-edit-form[hidden] { display: none; } /* the class display beats the UA [hidden] rule otherwise */
.quote-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.quote-total { font-size: 13.5px; margin-inline-start: auto; color: var(--ink-2); } .quote-total b { color: var(--ink); font-weight: 600; }
.btn-green { background: #0A6B49; color: #fff; }             /* fixed green surface — --green-deep flips to a light text colour in dark mode */
.btn-green:hover:not(:disabled) { background: #0F8A5F; transform: translateY(-1px); }
.btn-sent, .btn-sent:disabled { background: var(--mint); color: var(--green-deep); opacity: 1; }
.req-row { border-top: 1px solid var(--line); } .req-row .lrow { border-top: none; }
.req-row .lrow, .doc-row { flex-wrap: wrap; }
.req-row .lrow-main, .doc-row .lrow-main { flex: 1 1 160px; }
.req-right { text-align: end; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.req-left { white-space: nowrap; }
.qform { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; padding: 0 22px 16px; }
.qform .btn { align-self: end; }
@media (max-width: 560px) { .req-right { flex: 0 0 100%; max-width: 100%; flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: center; row-gap: 4px; } }
.docs-wrap { max-width: 760px; }
.verify-panel { border-radius: var(--r-hero); background: #0A6B49; color: #fff; padding: 28px; background-image: radial-gradient(70% 90% at 100% 0%, #14A06F, transparent 60%); }
.verify-panel.pending { background: var(--ink-fill); background-image: none; }
.vp-k { font-family: var(--font-mono); font-size: 12px; opacity: .9; text-transform: uppercase; }
html[dir=rtl] .verify-panel { background-image: radial-gradient(70% 90% at 0% 0%, #14A06F, transparent 60%); }
.verify-panel.pending .vp-k { color: #E4AE57; opacity: 1; }
.vp-title { font-family: var(--font-display); font-size: clamp(30px, 5vw, 40px); font-weight: 800; letter-spacing: -.04em; line-height: 1; margin-top: 12px; overflow-wrap: anywhere; }
.vp-sub { font-size: 14.5px; opacity: .85; margin-top: 8px; }
.vp-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.pv-onink { background: rgba(255,255,255,.14); color: #fff; }
.doc-ico { width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 15px; flex: none; }
.doc-ico.ok { background: var(--mint); color: var(--green-deep); } .doc-ico.wait { background: var(--amber-bg); color: var(--amber); }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 13.5px; border-bottom: 1px dashed var(--line); flex-wrap: wrap; }
.kv:last-of-type { border-bottom: none; }
.rv-row { padding: 12px 22px; border-top: 1px solid var(--line); font-size: 13.5px; }
.rv-stars { color: var(--amber); }

/* admin (v2): review queue · held quotes · counterfeit reports */
.cf-row { border-top: 1px solid var(--line); }
.cf-row .lrow { border-top: none; flex-wrap: wrap; }
.cf-row .lrow-main, .held-row .lrow-main { flex: 1 1 180px; }
.held-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.held-row { flex-wrap: wrap; }
.held-right { text-align: end; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.held-price { font-weight: 600; font-size: 15.5px; }
.held-actions { margin-top: 6px; }
.cf-ico { background: var(--blush); color: var(--brand-text-deep); }
.cf-photo { display: block; max-width: 220px; border-radius: 10px; border: 1px solid var(--line); margin: 0 22px 12px; margin-inline-start: 72px; }
.cf-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 0 22px 16px; padding-inline-start: 72px; }
.cf-actions .inp { flex: 1 1 200px; max-width: 320px; padding: 7px 10px; }
@media (max-width: 560px) {
  .doc-chips, .cf-actions { padding-inline-start: 22px; }
  .cf-photo { margin-inline-start: 22px; }
  .held-right { flex-basis: 100%; align-items: flex-start; text-align: start; }
  .held-actions { justify-content: flex-start; }
}

/* dark mode: "selected = ink fill" would vanish against dark cards, so small selected controls invert
   (light fill, dark text); the large ink surfaces keep --ink-fill. */
html[data-theme="dark"] .chip.on, html[data-theme="dark"] .expill.active, html[data-theme="dark"] .stepchip.on,
html[data-theme="dark"] .btn-ink, html[data-theme="dark"] .pv-ink { background: var(--ink); color: var(--paper); border-color: var(--ink); }
html[data-theme="dark"] .btn-ink:hover:not(:disabled) { filter: brightness(.92); }

@media (max-width: 760px) {
  .req-side { position: static; }
  .confirm-bar { bottom: 8px; }
  .ql-vs { flex-basis: 100%; }
}

/* ===== v3 shared patterns (MORE_SCREENS): tiles, chips with counts, empty state, list + detail ===== */
.tile-amber { background: var(--amber-bg); border-color: transparent; }
.tile-amber .tile-k, .tile-amber .tile-v { color: var(--amber); }
.tile-amber .tile-s { color: var(--ink-2); }
.pv-red { background: var(--brand); color: #fff; }
.chip-n { font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; padding: 1px 6px; border-radius: 6px; background: var(--paper); color: var(--ink-3); margin-inline-start: 7px; }
.chip.on .chip-n { background: rgba(255,255,255,.18); color: #fff; }
html[data-theme="dark"] .chip.on .chip-n { background: rgba(0,0,0,.1); color: var(--paper); }
.empty-v3 { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: 18px; background: var(--mint); }
.empty-v3-ico { width: 34px; height: 34px; border-radius: 10px; background: #0A6B49; color: #fff; display: grid; place-items: center; font-size: 15px; font-weight: 700; flex: none; }
.empty-v3-title { font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: -.03em; line-height: 1.15; color: var(--green-deep); }
.empty-v3-line { font-size: 13.5px; color: var(--ink-2); margin-top: 3px; line-height: 1.5; }
.card-list > .empty-v3 { margin: 4px 22px 22px; }
.split-v3 { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.split-list { flex: 1 1 300px; min-width: 0; }
.split-detail { flex: 2 1 460px; min-width: 0; }
@media (max-width: 760px) { .split-list, .split-detail { flex-basis: 100%; } }
.lrow.sel { background: var(--paper); box-shadow: inset 3px 0 0 var(--brand); }
html[dir="rtl"] .lrow.sel { box-shadow: inset -3px 0 0 var(--brand); }
.xn { font-family: var(--font-mono); font-size: 11px; padding: 2px 7px; border-radius: 6px; background: var(--ink-fill); color: #fff; white-space: nowrap; }
.chev { display: inline-block; transition: transform .2s; }
html[dir="rtl"] .chev { transform: scaleX(-1); }
[aria-expanded="true"] .chev { transform: rotate(90deg); }
html[dir="rtl"] [aria-expanded="true"] .chev { transform: rotate(90deg); }
.mono-k { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .02em; }
.panel-ink { border-radius: var(--r-card); background: var(--ink-fill); color: #fff; padding: 22px; }
.panel-ink .mono-k { color: rgba(255,255,255,.6); }
.row-v3 { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; margin-top: 14px; }
.sec-v3 { margin-top: 14px; }
.h3-v3 { margin: 0; font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: -.03em; color: var(--ink); white-space: nowrap; }
.scroll-x { overflow-x: auto; }

/* ===== Inventory (v3) ===== */
.inv-approvals { flex: 3 1 460px; min-width: 0; margin: 0; }
.inv-runway { flex: 2 1 320px; min-width: 0; }
.draft-row { display: flex; align-items: center; gap: 12px; padding: 13px 22px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.draft-main { flex: 1 1 240px; min-width: 0; }
.draft-meta { margin-top: 3px; font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); text-transform: uppercase; overflow-wrap: anywhere; }
.runway-check { border: none; background: none; padding: 0; cursor: pointer; font-family: var(--font-mono); font-size: 11.5px; color: #6FE0B0; white-space: nowrap; }
.runway-check:hover { text-decoration: underline; text-underline-offset: 3px; }
.runway-head { font-family: var(--font-display); font-size: 24px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; margin-top: 10px; }
.runway-row { margin-top: 14px; }
.runway-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.runway-top .mono { font-size: 12.5px; white-space: nowrap; }
.runway-drug { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.runway-bar { margin-top: 6px; height: 8px; border-radius: 6px; background: rgba(255,255,255,.1); overflow: hidden; }
.runway-bar > i { display: block; height: 100%; border-radius: 6px; }
.runway-scale { margin-top: 10px; display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 10.5px; color: rgba(255,255,255,.38); text-transform: uppercase; }
.runway-note { margin: 16px 0 0; font-size: 12.5px; color: rgba(255,255,255,.55); line-height: 1.5; }
/* One column grid for the stock table; header and rows (and the inline edit / add forms) are subgrids, so the status
   and button columns fit their widest cell in every language (Somali labels run long) and rows stay aligned.
   Narrow screens scroll it sideways. */
.stock-grid { display: grid; grid-template-columns: minmax(150px, 1.6fr) minmax(120px, 1.3fr) 76px 76px 80px minmax(110px, 1fr) fit-content(96px) max-content; column-gap: 12px; min-width: min-content; }
.stock-row { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: center; padding: 12px 22px; border-top: 1px solid var(--line); margin: 0; }
.stock-row > .mono { font-size: 13.5px; }
.stock-head { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); text-transform: uppercase; padding-top: 9px; padding-bottom: 9px; }
.stock-row.editing { background: var(--paper); }
.stock-bar { position: relative; flex: 1; max-width: 96px; height: 6px; border-radius: 4px; background: var(--paper); border: 1px solid var(--line); }
.stock-bar > i { position: absolute; inset-inline-start: 0; top: 0; bottom: 0; border-radius: 4px; }
.stock-bar::after { content: ''; position: absolute; inset-inline-start: 50%; top: -4px; bottom: -4px; width: 1.5px; background: var(--ink-3); } /* the tick = reorder point */
.inp-cell { width: 100%; min-width: 0; padding: 7px 9px; font-size: 13px; border-radius: 9px; }

/* ===== Savings (v3) ===== */
.sav-note { display: flex; justify-content: flex-end; }
.sav-hero { flex: 2 1 440px; min-width: 0; border-radius: 26px; padding: 28px; container-type: inline-size; }
.sav-hero.pos { background: var(--mint); color: var(--green-deep); }
.sav-hero.neg { background: var(--blush); color: var(--brand-text-deep); }
.sav-hero .mono-k { color: inherit; opacity: .85; }
/* Hero totals: the design size (--big), capped so a long total still fits its card on one line — at these sizes the
   face runs up to ~.52em per character (it widens as it gets smaller), and --n is the character count (fitLen in ui.js). */
.sav-big { font-family: var(--font-display); --big: clamp(52px, 6vw, 80px); font-size: min(var(--big), calc(180cqi / var(--n, 6))); font-weight: 800; letter-spacing: -.05em; line-height: .9; margin-top: 14px; overflow-wrap: anywhere; }
.sav-hero.pos .sav-big { color: var(--green-deep); }
.sav-hero.neg .sav-big { color: var(--brand-text); }
.sav-cap { margin: 12px 0 0; font-size: 15px; max-width: 460px; line-height: 1.5; color: inherit; }
.sav-stats { margin-top: 22px; display: flex; gap: 28px; flex-wrap: wrap; }
.sav-stat-v { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -.03em; margin-top: 3px; }
.sav-months { flex: 1 1 300px; min-width: 0; margin: 0; container-type: inline-size; }
.mchart { margin-top: 14px; height: 168px; display: flex; gap: 10px; position: relative; }
.mchart::before { content: ''; position: absolute; inset-inline: 0; top: 84px; height: 1px; background: var(--line-2); }
.mcol { flex: 1; min-width: 0; }
.mcol-up, .mcol-down { height: 84px; display: flex; justify-content: center; }
.mcol-up { align-items: flex-end; }
.mcol-down { align-items: flex-start; }
.mbar-up { width: 26px; max-width: 100%; border-radius: 6px 6px 0 0; background: var(--green); }
.mbar-down { width: 26px; max-width: 100%; border-radius: 0 0 6px 6px; background: var(--brand); }
.mdot { width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); margin-bottom: -3px; }
.mlabels { display: flex; gap: 10px; margin-top: 10px; }
.mlabel { flex: 1; min-width: 0; text-align: center; }
.mlabel-m { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); text-transform: uppercase; }
.mlabel-v { font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; margin-top: 2px; white-space: nowrap; }
/* A narrow chart card (a phone, or squeezed beside the hero) tightens the six columns and drops the currency sign
   from the month labels; the hero above already shows the currency. */
@container (max-width: 400px) { .mchart, .mlabels { gap: 4px; } .mlabel-v { font-size: 10px; letter-spacing: -.02em; } .mlabel-cur { display: none; } }
.sav-grid { min-width: 700px; }
.sav-row { display: grid; grid-template-columns: minmax(180px, 1.4fr) 70px 104px minmax(220px, 1.6fr) 104px; gap: 14px; align-items: center; padding: 12px 22px; border-top: 1px solid var(--line); }
.sav-row .num { text-align: end; }
.sav-row > .mono { font-size: 13px; color: var(--ink-2); }
.sav-head { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); text-transform: uppercase; padding-top: 8px; padding-bottom: 8px; }
.dv-head { display: flex; justify-content: space-between; gap: 8px; }
.dv { display: flex; align-items: center; height: 18px; }
.dv-side { flex: 1; display: flex; }
.dv-neg { justify-content: flex-end; }
.dv-pos { justify-content: flex-start; }
.dv-axis { width: 1.5px; height: 18px; background: var(--line-2); flex: none; }
.dv-neg > i { display: block; height: 10px; border-start-start-radius: 5px; border-end-start-radius: 5px; background: var(--brand); }
.dv-pos > i { display: block; height: 10px; border-start-end-radius: 5px; border-end-end-radius: 5px; background: var(--green); }
.sav-tile-drug { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -.03em; margin-top: 8px; color: var(--ink); }
.sav-formula { margin: 14px 0 0; font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); line-height: 1.6; text-transform: uppercase; }

/* ===== Audit trail (v3) ===== */
.aud-banner { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 16px; background: var(--mint); flex-wrap: wrap; }
.aud-banner b { font-weight: 600; font-size: 14.5px; color: var(--green-deep); }
.aud-check { width: 26px; height: 26px; border-radius: 8px; background: #0A6B49; color: #fff; display: grid; place-items: center; font-size: 13px; flex: none; }
.aud-banner-text { font-size: 14px; color: var(--ink-2); flex: 1 1 300px; }
.aud-rfq { display: block; text-align: start; cursor: pointer; }
.aud-rfq:hover { background: var(--paper); }
.aud-rfq-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.aud-detail { margin: 0; padding: 24px; }
.aud-title { margin: 6px 0 0; font-family: var(--font-display); font-size: clamp(24px, 2.4vw, 30px); font-weight: 800; letter-spacing: -.04em; line-height: 1.05; color: var(--ink); }
.aud-tags { margin-top: 10px; display: flex; gap: 7px; flex-wrap: wrap; }
.aud-tag { font-family: var(--font-mono); font-size: 11.5px; padding: 5px 9px; border-radius: 8px; background: var(--paper); border: 1px solid var(--line-2); color: var(--ink-2); white-space: nowrap; text-transform: uppercase; }
.tl { list-style: none; margin: 22px 0 0; padding: 0; }
.tl-item { display: flex; gap: 14px; }
.tl-rail { display: flex; flex-direction: column; align-items: center; flex: none; width: 16px; padding-top: 4px; }
.tl-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--ink-3); }
.tl-dot.ink { background: var(--ink); }
.tl-dot.muted { background: var(--ink-3); }
.tl-dot.amber { background: var(--amber); }
.tl-dot.green { background: var(--green); }
.tl-dot.red { background: var(--brand-text); }
.tl-dot.ring { background: var(--card); border: 2.5px solid var(--ink); }
.tl-dot.next { background: var(--card); border: 2px dashed var(--ink-3); }
.tl-line { width: 2px; flex: 1; min-height: 22px; margin-top: 4px; background: var(--line-2); }
.tl-body { flex: 1; min-width: 0; padding-bottom: 20px; }
.tl-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-code { font-family: var(--font-mono); font-size: 11px; padding: 3px 7px; border-radius: 6px; background: var(--paper); border: 1px solid var(--line); color: var(--ink-2); }
.tl-title { margin-top: 5px; font-weight: 600; font-size: 14.5px; color: var(--ink); }
.tl-item.next .tl-title { color: var(--ink-3); }
.tl-text { margin-top: 2px; font-size: 13.5px; color: var(--ink-2); line-height: 1.5; overflow-wrap: anywhere; }
.aud-toggle { margin-top: 8px; border: none; background: none; padding: 0; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; color: var(--brand-text); white-space: nowrap; }
.aud-toggle:hover { text-decoration: underline; text-underline-offset: 3px; }
.aud-quotes { margin-top: 10px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--paper); }
.aud-q { display: flex; align-items: center; gap: 12px; padding: 10px 14px; flex-wrap: wrap; background: var(--card); }
.aud-q + .aud-q { border-top: 1px solid var(--line); }
.aud-q.held { background: var(--blush); }
.aud-q.chosen { background: var(--paper); }
.aud-q-who { flex: 1 1 150px; min-width: 0; font-size: 13.5px; font-weight: 500; overflow-wrap: anywhere; }
.aud-q > .pv { margin-inline-start: auto; }
.aud-q.held > .pv { background: var(--card); }

/* ===== Expandable row (v3 shared): toggle + chevron, line items in a --paper inset ===== */
.xrow { border-top: 1px solid var(--line); }
.xrow-head { display: flex; align-items: center; gap: 12px; padding: 14px 22px; flex-wrap: wrap; }
.xrow-toggle { display: flex; align-items: center; gap: 14px; flex: 1 1 300px; min-width: 0; border: 0; background: none; padding: 0; margin: 0; cursor: pointer; font: inherit; color: inherit; text-align: start; }
.xrow-chev { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; flex: none; font-size: 16px; line-height: 1; color: var(--ink-3); background: var(--paper); }
.xrow-toggle:hover .xrow-chev { color: var(--ink); }
.xrow-body { padding: 0 22px 16px; padding-inline-start: clamp(22px, 7vw, 106px); }
.xrow-inset { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--paper); }
.xline { display: flex; align-items: center; gap: 14px; padding: 11px 14px; flex-wrap: wrap; }
.xline + .xline { border-top: 1px solid var(--line); }
.xline-main { flex: 1 1 180px; min-width: 0; font-size: 14px; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.xline-amt { font-size: 13.5px; font-weight: 600; }

/* ===== Supplier notifications (v3) ===== */
.ntoolbar { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.ntoolbar .chips { flex: 1 1 auto; }
.ntoolbar .linkbtn { font-size: 13.5px; white-space: nowrap; }
.nday { margin-top: 22px; }
.nday-k { margin: 0; padding: 0 4px 8px; font-weight: 400; }
.nlist { display: flex; flex-direction: column; gap: 10px; }
.ncard { display: flex; gap: 14px; padding: 18px; border-radius: 18px; background: color-mix(in srgb, var(--card) 55%, transparent); border: 1px solid var(--line); }
.ncard.unread { background: var(--card); border-color: var(--line-2); box-shadow: inset 3px 0 0 var(--brand); cursor: pointer; }
html[dir="rtl"] .ncard.unread { box-shadow: inset -3px 0 0 var(--brand); }
.nico { width: 36px; height: 36px; border-radius: 10px; flex: none; display: grid; place-items: center; font-size: 15px; font-weight: 700; }
.nico.amber { background: var(--amber-bg); color: var(--amber); }
.nico.mint { background: var(--mint); color: var(--green-deep); }
.nico.red { background: var(--brand); color: #fff; }
.nico.ink { background: var(--ink-fill); color: #fff; }
.nico.blush { background: var(--blush); color: var(--brand-text); }
.nico.muted { background: var(--paper); color: var(--ink-3); border: 1px solid var(--line); }
/* dark: small ink tiles would vanish on dark cards, so they invert like the selected controls */
html[data-theme="dark"] .nico.ink, html[data-theme="dark"] .lim-i { background: var(--ink); color: var(--paper); }
.nmain { flex: 1; min-width: 0; }
.ntop { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ntitle { font-weight: 600; font-size: 15px; color: var(--ink); overflow-wrap: anywhere; }
.ndot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex: none; }
.nmeta { margin-inline-start: auto; font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); white-space: nowrap; text-transform: uppercase; }
.nbody { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); line-height: 1.5; overflow-wrap: anywhere; }
.nquote { margin-top: 12px; display: flex; align-items: center; gap: 12px 22px; flex-wrap: wrap; padding: 12px 14px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); }
.nq-v { font-family: var(--font-mono); font-size: 16px; font-weight: 600; margin-top: 2px; color: var(--ink); white-space: nowrap; }
.nq-s { font-size: 14px; font-weight: 500; margin-top: 3px; color: var(--ink); }
.nedit { margin-top: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ninp { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 10px; background: var(--card); padding: 0 10px; }
.ninp:focus-within { border-color: var(--ink-3); }
.ninp > span { font-family: var(--font-mono); color: var(--ink-3); }
.ninp input { width: 84px; border: 0; outline: none; padding: 9px 6px; background: transparent; font-family: var(--font-mono); font-size: 14px; color: var(--ink); }
.nexplain { margin-top: 12px; width: 100%; min-height: 64px; resize: vertical; }
.nacts { margin-top: 12px; display: flex; gap: 8px 10px; flex-wrap: wrap; align-items: center; }
.nacts .linkbtn { font-size: 13px; }
.ndone { margin-top: 12px; }
/* grouped RFQ notification: one card per drug list, one row per line it holds */
.nlines { margin-top: 12px; display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.nline { padding: 14px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.nline:last-child { border-bottom: 0; padding-bottom: 2px; }
.nline .ntitle { font-size: 14.5px; }
.nmain .pv { white-space: normal; max-width: 100%; } /* a long status (Somali) wraps inside a narrow card instead of running out of it */
.nmore { margin-top: 16px; display: flex; justify-content: center; }

/* ===== Supplier credit · receivables (v3) ===== */
.rcv-row { margin-top: 0; }
.rcv-hero { flex: 2 1 440px; min-width: 0; border-radius: 26px; padding: 28px; container-type: inline-size; }
.rcv-big { font-family: var(--font-display); --big: clamp(52px, 6vw, 80px); font-size: min(var(--big), calc(180cqi / var(--n, 6))); font-weight: 800; letter-spacing: -.05em; line-height: .9; margin-top: 14px; overflow-wrap: anywhere; }
.rcv-sub { margin: 10px 0 0; font-size: 14.5px; color: rgba(255,255,255,.72); overflow-wrap: anywhere; }
.rcv-tl { margin-top: 28px; }
.rcv-scale { display: flex; justify-content: space-between; gap: 10px; font-family: var(--font-mono); font-size: 11px; color: rgba(255,255,255,.45); text-transform: uppercase; }
.rcv-track { margin-top: 8px; height: 46px; position: relative; border-top: 1px solid rgba(255,255,255,.2); }
.rcv-mark { position: absolute; top: 0; display: flex; flex-direction: column; align-items: flex-start; }
.rcv-mark > i { width: 2px; height: 14px; background: #6FE0B0; }
.rcv-mark.late > i { background: #FF8A84; }
.rcv-mark > span { margin-top: 5px; font-family: var(--font-mono); font-size: 11.5px; white-space: nowrap; text-transform: uppercase; }
.rcv-mark.late > span { color: #FFB4AE; }
.rcv-mark.flip { align-items: flex-end; transform: translateX(calc(-100% + 2px)); }
html[dir="rtl"] .rcv-mark.flip { transform: translateX(calc(100% - 2px)); }
.rcv-note { margin: 12px 0 0; font-size: 12.5px; color: rgba(255,255,255,.55); }
.rcv-side { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 14px; align-self: stretch; }
.rcv-side > .tile { flex: 1; }
.st-id { font-family: var(--font-mono); font-size: 13px; color: var(--ink-3); flex: none; }
.st-main { min-width: 0; }
.st-who { display: block; font-weight: 600; font-size: 14.5px; color: var(--ink); overflow-wrap: anywhere; }
.st-meta { display: block; margin-top: 2px; font-size: 12.5px; color: var(--ink-3); }
.st-amt { font-family: var(--font-mono); font-size: 15px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.st-amt.late { color: var(--brand-text); }
.st-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.st-settle { display: flex; gap: 8px 10px; flex-wrap: wrap; align-items: center; padding: 0 22px 16px; padding-inline-start: clamp(22px, 7vw, 106px); }
.st-settle .inp { width: auto; max-width: 230px; padding: 7px 10px; font-size: 13.5px; }
.sc-disclaimer { margin: 14px 0 0; font-size: 13px; color: var(--ink-3); line-height: 1.5; }
/* phones: big hero figures shrink instead of breaking mid-number; the timeline keeps its two end labels */
@media (max-width: 560px) {
  .rcv-hero, .sav-hero { padding: 22px; }
  .rcv-big, .sav-big { --big: clamp(34px, 11vw, 52px); }
  .rcv-mid { display: none; }
  .rcv-scale > span { white-space: nowrap; }
}

/* ===== Supplier credit limits (v3) ===== */
.lim-info { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.lim-i { width: 28px; height: 28px; border-radius: 8px; background: var(--ink-fill); color: #fff; display: grid; place-items: center; font-family: var(--font-mono); font-size: 13px; flex: none; }
.lim-info p { flex: 1; min-width: 0; margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.55; }
.lim-info b { color: var(--ink); font-weight: 600; }
.lim-grid { margin-top: 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 14px; align-items: start; }
.lim-card { min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 24px; }
.lim-head { display: flex; align-items: center; gap: 12px; }
.lim-init { width: 44px; height: 44px; border-radius: 12px; background: var(--paper); border: 1px solid var(--line); display: grid; place-items: center; flex: none; font-family: var(--font-display); font-weight: 800; font-size: 19px; color: var(--ink); }
.lim-who { flex: 1; min-width: 0; }
.lim-name { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; color: var(--ink); overflow-wrap: anywhere; }
.lim-who .mono-k { margin-top: 3px; font-size: 11.5px; }
.lim-rel { margin-top: 20px; display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; }
.lim-pct { margin-top: 6px; font-family: var(--font-display); font-size: 48px; font-weight: 800; letter-spacing: -.04em; line-height: 1; color: var(--green-deep); }
.lim-pct.new { color: var(--ink-3); }
.lim-pct.poor { color: var(--brand-text); }
.lim-strip { flex: 1; min-width: 180px; }
.lim-sq { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.lim-sq > i { width: 14px; height: 14px; border-radius: 4px; }
.lim-sq > i.ok { background: var(--green); }
.lim-sq > i.late { background: var(--brand); opacity: .85; }
.lim-sq > i.open { box-shadow: inset 0 0 0 2px var(--brand); }
.lim-sq > b { font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: var(--ink-3); }
.lim-hist { margin-top: 8px; font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-2); text-transform: uppercase; }
.lim-hist-note { margin-top: 2px; font-size: 12px; color: var(--ink-3); }
.lim-box { margin-top: 20px; padding: 16px; border-radius: 16px; background: var(--paper); }
.lim-box-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.lim-ceil { text-align: end; }
.lim-box-v { margin-top: 3px; font-family: var(--font-mono); font-size: 17px; font-weight: 600; color: var(--ink); }
.lim-box-v.over { color: var(--brand-text); }
.lim-bar { margin-top: 12px; height: 8px; border-radius: 6px; background: var(--line); overflow: hidden; }
.lim-bar > i { display: block; height: 100%; border-radius: 6px; background: var(--ink); transition: width .3s; }
.lim-bar.over > i { background: var(--brand); }
.lim-note { margin: 10px 0 0; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.lim-note.over { color: var(--brand-text-deep); }
.lim-set { margin-top: 16px; }
.lim-set-row { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.lim-set-row .chip { font-size: 13.5px; padding: 8px 12px; }
.lim-set-row .ninp input { width: 76px; }
.lim-ro { margin: 16px 0 0; }

/* ===== v3 shared: toolbar row, avatar tile, two-step confirm panel ===== */
.toolbar-v3 { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.toolbar-v3 > .chips { flex: 1 1 auto; }
.toolbar-v3 > .mono-k { font-size: 11.5px; }
.av { width: 38px; height: 38px; border-radius: 11px; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 15px; background: var(--paper); color: var(--ink-2); border: 1px solid var(--line); }
.av.on { background: var(--ink-fill); color: #fff; border-color: transparent; }
html[data-theme="dark"] .av.on { background: var(--ink); color: var(--paper); }
.confirm-v3 { margin-top: 14px; padding: 16px; border-radius: 16px; background: var(--blush); }
.confirm-v3 > .mono-k { color: var(--brand-text-deep); font-size: 11.5px; }
.confirm-v3-text { margin: 8px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--ink); }
.confirm-v3-acts { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.empty-pad { padding: 28px 22px; text-align: center; font-size: 14px; color: var(--ink-3); }

/* ===== Admin · Facility KYC (v3) ===== */
.kyc-row { cursor: pointer; }
.kyc-row:hover { background: var(--paper); }
.kyc-name-s { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kyc-sub { display: block; margin-top: 2px; font-size: 11.5px; }
.kyc-detail { margin: 0; padding: 26px; }
.kyc-head { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.kyc-id { flex: 1; min-width: 0; }
.kyc-name { margin: 6px 0 0; font-family: var(--font-display); font-size: clamp(26px, 2.6vw, 34px); font-weight: 800; letter-spacing: -.04em; line-height: 1.05; color: var(--ink); overflow-wrap: anywhere; }
.kyc-contact { margin-top: 6px; font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.kyc-type { margin-top: 16px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.kyc-type .inp { width: auto; padding: 7px 10px; font-size: 13.5px; }
.kyc-note { margin: 18px 0 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.55; }
.kyc-acts { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.kyc-rej { color: var(--brand-text); }
.kyc-hint { font-size: 13px; color: var(--ink-3); }
.kyc-hint.warn { color: var(--amber); }
.kyc-result { margin-top: 18px; padding: 14px 16px; border-radius: 14px; font-weight: 600; font-size: 14.5px; }
.kyc-result.verified { background: var(--mint); color: var(--green-deep); }
.kyc-result.rejected { background: var(--blush); color: var(--brand-text-deep); }

/* ===== Admin · Analytics (v3) ===== */
.an-hero { flex: 2 1 460px; min-width: 0; border-radius: 26px; padding: 28px; container-type: inline-size; color: #fff; background-color: var(--brand);
  background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px), radial-gradient(90% 90% at 100% 0%, #D8473C, transparent 60%);
  background-size: 40px 40px, 40px 40px, 100% 100%; }
html[dir="rtl"] .an-hero { background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px), radial-gradient(90% 90% at 0% 0%, #D8473C, transparent 60%); }
.an-hero .mono-k { color: rgba(255,255,255,.8); }
.an-big { margin-top: 14px; font-family: var(--font-display); --big: clamp(56px, 6vw, 84px); font-size: min(var(--big), calc(180cqi / var(--n, 6))); font-weight: 800; letter-spacing: -.05em; line-height: .9; overflow-wrap: anywhere; }
.an-sub { margin: 10px 0 0; font-size: 14.5px; opacity: .85; }
.an-funnel { margin-top: 24px; display: flex; flex-direction: column; gap: 4px; }
.an-frow { display: flex; align-items: center; gap: 12px; padding: 4px 6px; margin-inline: -6px; border: 0; border-radius: 8px; background: none; color: inherit; font: inherit; cursor: pointer; text-align: start; }
.an-frow:hover { background: rgba(255,255,255,.08); }
.an-fk { width: 64px; flex: none; font-family: var(--font-mono); font-size: 11.5px; opacity: .8; text-transform: uppercase; }
.an-fbar { flex: 1; min-width: 60px; height: 10px; border-radius: 6px; background: rgba(255,255,255,.14); overflow: hidden; }
.an-fbar > i { display: block; height: 100%; border-radius: 6px; background: #fff; }
.an-fv { width: 44px; flex: none; text-align: end; font-family: var(--font-mono); font-size: 13px; font-weight: 600; }
.an-fn { width: 120px; flex: none; font-family: var(--font-mono); font-size: 11px; opacity: .75; text-transform: uppercase; }
.an-tiles { flex: 1 1 280px; min-width: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tile-btn { cursor: pointer; transition: transform .15s, box-shadow .15s; }
.tile-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.an-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.an-head .mono-k { font-size: 11px; }
.an-p { margin: 6px 0 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
.an-fac { flex: 1 1 340px; min-width: 0; margin: 0; padding: 22px; }
.an-share { margin-top: 16px; display: flex; gap: 2px; height: 14px; border-radius: 7px; overflow: hidden; background: var(--paper); }
.an-share > i { flex-basis: 0; min-width: 4px; }
.an-types { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.an-type { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; border: 1px solid transparent; background: none; font: inherit; color: inherit; cursor: pointer; text-align: start; }
.an-type:hover { background: var(--paper); }
.an-type.on { background: var(--paper); border-color: var(--line-2); }
.an-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.an-type-main { flex: 1; min-width: 0; }
.an-type-l { display: block; font-weight: 600; font-size: 14.5px; color: var(--ink); }
.an-type-main .mono-k { display: block; margin-top: 1px; font-size: 11.5px; }
.an-type-v { font-family: var(--font-mono); font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.an-faclist { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.an-faclist-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.an-fac-row { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; font-size: 14px; border-bottom: 1px dashed var(--line); }
.an-fac-name { min-width: 0; overflow-wrap: anywhere; color: var(--ink); }
.an-more { padding-top: 8px; }
.an-anom { flex: 2 1 460px; min-width: 0; margin: 0; }
.an-anom-head { padding: 20px 22px 12px; }
.an-l4 { font-family: var(--font-mono); font-size: 11.5px; padding: 4px 8px; border-radius: 7px; background: var(--brand); color: #fff; }
.an-anom-head .an-head { justify-content: flex-start; align-items: center; }
.an-group { border-top: 1px solid var(--line); padding: 16px 22px; }
.an-ghead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.an-av { background: var(--blush); color: var(--brand-text); border-color: transparent; }
.an-gmain { flex: 1; min-width: 0; }
.an-gname { font-weight: 600; font-size: 15px; color: var(--ink); }
.an-gmain .mono-k { margin-top: 1px; font-size: 11.5px; }
.an-quotes { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.an-q { padding: 12px 14px; border-radius: 14px; background: var(--paper); }
.an-q.frozen { background: color-mix(in srgb, var(--blush) 60%, transparent); }
.an-q-row { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.an-q-main { flex: 1 1 190px; min-width: 0; }
.an-q-drug { font-weight: 600; font-size: 14px; color: var(--ink); }
.an-q-main .mono-k { margin-top: 1px; font-size: 11.5px; }
.an-q-bar { flex: 1 1 150px; min-width: 130px; }
.an-q-track { position: relative; height: 8px; border-radius: 5px; background: var(--line); }
.an-q-track > i { position: absolute; inset-inline-start: 0; top: 0; bottom: 0; border-radius: 5px; background: var(--brand); }
.an-q-track > b { position: absolute; inset-inline-end: 0; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }
.an-q-scale { display: flex; justify-content: space-between; margin-top: 5px; font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); text-transform: uppercase; }
.an-q-why { margin-top: 8px; font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
.an-q-hist { margin-top: 8px; font-size: 12.5px; }
.an-hist { margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.an-hist-facts { display: flex; gap: 14px; flex-wrap: wrap; color: var(--ink-2); margin-bottom: 6px; }
.an-ev { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0; border-top: 1px dashed var(--line); font-size: 12.5px; }
.an-ev-d { flex: 1 1 200px; min-width: 0; color: var(--ink-2); overflow-wrap: anywhere; }
.an-pad { padding: 4px 22px 22px; }
.an-all { margin-top: 10px; font-size: 13px; }
.an-hb .list-head p { margin-top: 2px; }
.hb-addrs { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-addr { padding: 12px 14px; }
.hb-addr + .hb-addr { border-top: 1px solid var(--line); }
.hb-addr-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; }
.hb-addr-top b { overflow-wrap: anywhere; }
.hb-ord { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 13px; border-bottom: 1px dashed var(--line); }
.hb-acts { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 14px; border-top: 1px solid var(--line); }
.drill-back { font-size: 13.5px; }
.drill-tbl { min-width: 720px; }
.drill-type { width: auto; padding: 4px 8px; font-size: 12px; }
@media (max-width: 560px) {
  .an-hero { padding: 22px; }
  .an-big { --big: clamp(38px, 12vw, 56px); }
  .an-fn { display: none; }
  .an-tiles { grid-template-columns: 1fr; }
}

/* ===== Admin · Reports (v3) ===== */
.rep-card { flex: 3 1 480px; min-width: 0; margin: 0; padding: 24px; }
.rep-step { margin-top: 22px; font-size: 11.5px; }
.rep-insts { margin-top: 10px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 10px; }
.rep-inst { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink); font: inherit; text-align: start; cursor: pointer; transition: background .15s, border-color .15s; }
.rep-inst:hover { border-color: var(--ink-3); }
.rep-inst.on { background: var(--ink-fill); border-color: var(--ink-fill); color: #fff; }
.rep-inst-k { font-family: var(--font-mono); font-size: 12px; font-weight: 600; padding: 5px 9px; border-radius: 8px; background: var(--paper); color: var(--ink); }
.rep-inst.on .rep-inst-k { background: var(--brand); color: #fff; }
.rep-inst-d { font-size: 12.5px; line-height: 1.45; color: var(--ink-3); }
.rep-inst.on .rep-inst-d { color: rgba(255,255,255,.7); }
.rep-period { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.rep-range { color: var(--ink-2); margin-inline-start: 4px; }
.rep-custom { margin-top: 10px; display: flex; gap: 8px 10px; flex-wrap: wrap; align-items: center; }
.rep-custom .inp { width: auto; padding: 7px 10px; font-size: 13.5px; }
.rep-go { margin-top: 24px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.rep-result { margin-top: 20px; border-radius: 18px; background: var(--ink-fill); color: #fff; padding: 20px; }
.rep-result-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.rep-file-wrap { min-width: 0; }
.rep-ok { font-family: var(--font-mono); font-size: 11.5px; color: #6FE0B0; text-transform: uppercase; }
.rep-file { margin-top: 6px; font-family: var(--font-display); font-size: 21px; font-weight: 700; letter-spacing: -.03em; word-break: break-all; }
.rep-dl { display: flex; gap: 8px; flex-wrap: wrap; }
.rep-dl-pdf { background: #fff; color: #17110F; }
.rep-dl-csv { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.25); }
.rep-metrics { margin-top: 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr)); gap: 10px; }
.rep-m { padding: 12px; border-radius: 12px; background: rgba(255,255,255,.07); min-width: 0; }
.rep-m-v { font-family: var(--font-display); font-size: 22px; font-weight: 800; letter-spacing: -.03em; }
.rep-m-k { margin-top: 2px; font-family: var(--font-mono); font-size: 10.5px; color: rgba(255,255,255,.6); text-transform: uppercase; }
.rep-m-s { margin-top: 4px; font-size: 11.5px; color: rgba(255,255,255,.7); }
.rep-hash { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.07); font-family: var(--font-mono); font-size: 12px; line-height: 1.6; word-break: break-all; color: rgba(255,255,255,.78); text-align: start; }
.rep-hash-note { margin-top: 8px; font-family: var(--font-mono); font-size: 11px; color: rgba(255,255,255,.5); text-transform: uppercase; }
.rep-badges { margin-top: 14px; display: flex; gap: 6px; flex-wrap: wrap; }
.rep-badge { font-size: 12px; padding: 5px 10px; border-radius: 999px; border: 1px solid rgba(255,255,255,.22); color: rgba(255,255,255,.88); }
.rep-badge-note { margin-top: 8px; font-size: 11.5px; color: rgba(255,255,255,.5); }
.rep-mail { flex: 2 1 340px; min-width: 0; margin: 0; }
.rep-mail-head { padding: 20px 22px 12px; }
.rep-mail-head .chips { margin-top: 12px; }
.rep-mail-head .an-head { align-items: center; }
/* "Emails today: N / limit" (admin dashboard + Email log) */
.an-mail { padding: 14px 18px; }
.an-mail-top { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.an-mail-v { font-family: var(--font-mono); font-size: 14px; color: var(--ink); }
.an-mail-top .linkbtn { margin-inline-start: auto; font-size: 13px; }
.an-mail-bar { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; margin-top: 10px; }
.an-mail-bar > i { display: block; height: 100%; background: var(--green); border-radius: 6px; }
.an-mail.warn .an-mail-bar > i { background: var(--amber); }
.an-mail.over .an-mail-bar > i { background: var(--brand); }
.an-mail-note { margin: 8px 0 0; font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.rep-mail-today { margin-top: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 14px; }
.rep-warn { margin: 8px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--amber-bg); color: var(--amber); font-size: 13px; }
.rep-mail-stats { margin-top: 8px; }
.rep-msgs { max-height: 560px; overflow: auto; }
.rep-msg { padding: 13px 22px; border-top: 1px solid var(--line); }
.rep-msg-top { display: flex; justify-content: space-between; gap: 10px; }
.rep-to { font-weight: 600; font-size: 13.5px; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.rep-bubble { margin-top: 6px; padding: 10px 12px; border-radius: 4px 14px 14px 14px; background: var(--paper); font-size: 13px; line-height: 1.5; color: var(--ink-2); overflow-wrap: anywhere; }
html[dir="rtl"] .rep-bubble { border-radius: 14px 4px 14px 14px; }
.rep-msg-foot { margin-top: 6px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rep-msg-foot .mono-k { font-size: 10.5px; }
.rep-reason { margin-top: 4px; }

/* ===== Admin · Credit ledger (v3) ===== */
.led-aging { margin-top: 24px; display: flex; gap: 2px; height: 12px; border-radius: 6px; overflow: hidden; background: rgba(255,255,255,.08); }
.led-aging > i { flex-basis: 0; min-width: 4px; }
.led-legend { margin-top: 12px; display: flex; gap: 12px 22px; flex-wrap: wrap; }
.led-lk { display: flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 11px; color: rgba(255,255,255,.6); text-transform: uppercase; }
.led-lk > span { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.led-lv { margin-top: 4px; font-family: var(--font-mono); font-size: 14px; font-weight: 600; }
.led-over { flex: 1 1 260px; min-width: 0; border-radius: 26px; background: var(--blush); padding: 24px; display: flex; flex-direction: column; align-self: stretch; }
.led-over .mono-k { color: var(--brand-text-deep); }
.led-over-n { margin-top: 12px; font-family: var(--font-display); font-size: 56px; font-weight: 800; letter-spacing: -.05em; line-height: 1; color: var(--brand-text); }
.led-over-t { margin-top: 6px; font-size: 14.5px; color: var(--brand-text-deep); }
.led-fill { flex: 1; min-height: 14px; }
.led-over p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--brand-text-deep); }
.led-head { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; padding: 20px 22px 14px; }
.led-head .h3-v3 { flex: 1 1 200px; }
/* One column grid for the whole table; header and rows are subgrids of it, so each column takes the width of its
   widest cell (a long status in Somali, say) and every row stays aligned. Narrow screens scroll it sideways. */
.led-table { display: grid; grid-template-columns: max-content minmax(170px, 1.6fr) minmax(130px, 1fr) max-content max-content max-content; column-gap: 12px; min-width: min-content; }
.led-grid { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; gap: 12px; align-items: center; padding: 13px 22px; }
.led-th { padding-top: 9px; padding-bottom: 9px; font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); text-transform: uppercase; border-top: 1px solid var(--line); }
.led-row { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; border-top: 1px solid var(--line); }
.led-id { border: 0; background: none; padding: 0; font: inherit; font-family: var(--font-mono); font-size: 13px; color: var(--ink-2); cursor: pointer; white-space: nowrap; text-align: start; }
.led-id .chev { color: var(--ink-3); }
.led-who { min-width: 0; font-size: 14px; color: var(--ink); overflow-wrap: anywhere; }
.led-who b { font-weight: 600; }
.led-arrow { color: var(--ink-3); }
html[dir="rtl"] .led-arrow { display: inline-block; transform: scaleX(-1); }
.led-meta { font-size: 13px; color: var(--ink-2); }
.led-amt { font-family: var(--font-mono); font-size: 14px; font-weight: 600; text-align: end; color: var(--ink); }
.led-acts { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.led-lines { grid-column: 2 / -1; padding: 0 0 14px; padding-inline-end: 22px; } /* lines start under the parties column */

/* ===== Admin · Finance (v3) + market price index ===== */
.fx-card { flex: 1 1 340px; min-width: 0; border-radius: 26px; padding: 28px; }
.fx-now { display: flex; align-items: baseline; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.fx-big { font-family: var(--font-display); font-size: clamp(52px, 5.4vw, 76px); font-weight: 800; letter-spacing: -.05em; line-height: .9; }
.fx-set { margin-top: 10px; font-size: 11.5px; color: rgba(255,255,255,.5); text-transform: uppercase; }
.fx-box { margin-top: 22px; padding: 16px; border-radius: 16px; background: rgba(255,255,255,.07); }
.fx-box .mono-k { font-size: 11px; color: rgba(255,255,255,.55); }
.fx-row { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.fx-inp { flex: 1; min-width: 120px; border: 1px solid rgba(255,255,255,.2); border-radius: 10px; padding: 10px 12px; background: rgba(255,255,255,.06); color: #fff; font-family: var(--font-mono); font-size: 15px; }
.fx-inp:focus { outline: 2px solid rgba(255,255,255,.35); outline-offset: 1px; }
.fx-prev { margin-top: 10px; font-family: var(--font-mono); font-size: 11.5px; line-height: 1.6; color: rgba(255,255,255,.65); text-transform: uppercase; }
.fx-prev.big { color: #FF8A84; }
.fx-note { margin: 16px 0 0; font-size: 12.5px; line-height: 1.55; color: rgba(255,255,255,.55); }
.fin-index { flex: 2 1 520px; min-width: 0; }
.fin-index > .card { margin: 0; }
.mi-head { padding: 20px 22px 14px; display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.mi-head-main { flex: 1 1 280px; min-width: 0; }
.mi-back { display: inline-block; margin-bottom: 8px; font-size: 13.5px; }
.mi-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.mi-tag { font-family: var(--font-mono); font-size: 11px; padding: 5px 9px; border-radius: 8px; background: var(--paper); border: 1px solid var(--line-2); color: var(--ink-2); white-space: nowrap; text-transform: uppercase; }
.mi-tag.mint { background: var(--mint); border-color: transparent; color: var(--green-deep); }
/* One column grid for the table; header and rows are subgrids, so the average and quote-count columns take the width
   of their longest value (shilling prices run long) and every row stays aligned. Narrow screens scroll it sideways.
   The row padding (22px) lands inside the first and last columns, so the trend column is the line width + 22px. */
.mi-table { display: grid; grid-template-columns: minmax(160px, 1fr) max-content max-content 144px; column-gap: 12px; min-width: min-content; }
.mi-table > .mi-thin, .mi-table > .an-pad { grid-column: 1 / -1; }
.mi-grid { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: center; padding: 12px 22px; border-top: 1px solid var(--line); }
.mi-th { padding-top: 9px; padding-bottom: 9px; font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); text-transform: uppercase; }
.mi-drug { font-weight: 600; font-size: 14px; color: var(--ink); overflow-wrap: anywhere; }
.mi-avgv { font-family: var(--font-mono); font-size: 14px; font-weight: 600; text-align: end; color: var(--ink); }
.mi-n { font-family: var(--font-mono); font-size: 13px; color: var(--ink-2); text-align: end; }
.mi-th .mi-avgv, .mi-th .mi-n { font-size: 11px; font-weight: 400; color: var(--ink-3); }
.mi-row.thin .mi-n { color: var(--amber); }
.mi-trend { display: block; }
html[dir="rtl"] .mi-trend { transform: scaleX(-1); }
.mi-none { font-size: 11px; }
.mi-thin { display: block; width: 100%; padding: 13px 22px; border: 0; border-top: 1px solid var(--line); background: var(--paper); color: var(--brand-text); font: inherit; font-size: 13.5px; font-weight: 600; text-align: start; cursor: pointer; }
.mi-thin:hover { text-decoration: underline; text-underline-offset: 3px; }
.mi-foot { margin: 0; padding: 14px 22px 18px; font-size: 12px; line-height: 1.5; color: var(--ink-3); border-top: 1px solid var(--line); }
/* Beside the FX card (Finance) or on a phone the index card is narrow: tighter columns and a smaller trend line,
   so all five columns show without scrolling at desktop widths. */
.mi-card { container-type: inline-size; }
@container (max-width: 650px) {
  .mi-table { grid-template-columns: minmax(120px, 1fr) max-content max-content 106px; column-gap: 10px; }
  .mi-trend { width: 84px; height: auto; }
}

/* ===== Admin · Disputes (v3) ===== */
.ds-row { display: block; cursor: pointer; }
.ds-row:hover { background: var(--paper); }
.ds-row-title { display: block; margin-top: 5px; }
.ds-row .lrow-sub { display: block; margin-top: 2px; }
.ds-detail { margin: 0; padding: 24px; }
.ds-thread { margin-top: 20px; display: flex; flex-direction: column; gap: 12px; }
.ds-msg { display: flex; }
.ds-msg.right { justify-content: flex-end; }
.ds-bubble { max-width: min(82%, 520px); padding: 12px 14px; border-radius: 4px 16px 16px 16px; background: var(--paper); border: 1px solid var(--line); color: var(--ink); }
.ds-msg.right .ds-bubble { border-radius: 16px 4px 16px 16px; background: var(--ink-fill); border-color: transparent; color: #fff; }
html[dir="rtl"] .ds-bubble { border-radius: 16px 4px 16px 16px; }
html[dir="rtl"] .ds-msg.right .ds-bubble { border-radius: 4px 16px 16px 16px; }
.ds-meta { display: flex; justify-content: space-between; gap: 14px; font-family: var(--font-mono); font-size: 11px; opacity: .7; }
.ds-text { margin-top: 6px; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.ds-photo { display: block; margin-top: 10px; max-width: 220px; max-height: 160px; border-radius: 10px; object-fit: cover; }
.ds-note { margin: 10px 0 0; }
.ds-send { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.ds-send .inp { flex: 1 1 260px; min-width: 0; }
.ds-acts { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line-2); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ds-fill { flex: 1; }
.ds-resolve .inp { margin-top: 8px; width: 100%; }
/* Complaints: one conversation for the facility (in My Orders), the supplier (Complaints) and MALMAL. */
.ds-msg.mal .ds-bubble { background: var(--amber-bg); border-color: transparent; }
.ds-text { white-space: pre-wrap; }
.cp-box { margin-top: 14px; padding: 16px; border: 1px solid var(--line-2); border-radius: 16px; background: var(--card); }
.cp-old { margin-top: 10px; }
.cp-old > summary { cursor: pointer; font-size: 13px; color: var(--ink-2); padding: 6px 2px; }
.cp-old > .cp-box { margin-top: 6px; }
.cp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.cp-head-main { min-width: 0; }
.cp-title { margin-top: 4px; font-weight: 700; font-size: 15px; overflow-wrap: anywhere; }
.cp-thread { margin-top: 14px; }
.cp-decision { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--mint); }
.cp-decision .mono-k { color: var(--green-deep); }
.cp-decision p { margin: 6px 0 0; font-size: 14px; line-height: 1.5; color: var(--ink); overflow-wrap: anywhere; white-space: pre-wrap; }
.cp-closed { margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--green-deep); }
.cp-reply { margin-top: 14px; display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.cp-reply .inp { flex: 1 1 260px; min-width: 0; resize: vertical; }
.cp-note { margin: 8px 0 0; }
.cp-intro { margin: 0 0 12px; }
.cp-form { display: grid; gap: 10px; }
.cp-form-t { font-weight: 700; font-size: 15px; }
.cp-field { display: grid; gap: 4px; font-size: 12.5px; color: var(--ink-2); }
.cp-field .inp { width: 100%; }
.cp-form-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.cp-form p { margin: 0; }
.tab-badge { background: var(--danger-600); color: #fff; border-radius: 999px; padding: 1px 7px; font-size: 10.5px; font-weight: 800; margin-inline-start: 3px; }
.ds-empty { border-radius: 26px; background: var(--mint); padding: clamp(26px, 4vw, 48px); display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.ds-empty-ico { width: 64px; height: 64px; border-radius: 18px; background: #0A6B49; color: #fff; display: grid; place-items: center; font-size: 28px; flex: none; }
.ds-empty-main { flex: 1 1 300px; min-width: 0; }
.ds-empty-title { font-family: var(--font-display); font-size: clamp(28px, 3vw, 40px); font-weight: 800; letter-spacing: -.04em; line-height: 1; color: var(--green-deep); }
.ds-empty-main p { margin: 8px 0 0; font-size: 15px; color: var(--ink-2); line-height: 1.5; }
.ds-empty-stats { display: flex; gap: 26px; flex-wrap: wrap; }
.ds-empty-stats .mono-k { color: var(--green-deep); font-size: 11.5px; }
.ds-empty-n { margin-top: 4px; font-family: var(--font-display); font-size: 34px; font-weight: 800; letter-spacing: -.04em; color: var(--ink); }

/* ===== Admin · Recalls (v3) ===== */
.rc-list { flex: 3 1 480px; min-width: 0; }
.rc-cards { margin-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.rc-card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 20px; box-shadow: inset 4px 0 0 var(--line-2); }
html[dir="rtl"] .rc-card { box-shadow: inset -4px 0 0 var(--line-2); }
.rc-card.sev-high { box-shadow: inset 4px 0 0 var(--brand); }
.rc-card.sev-medium { box-shadow: inset 4px 0 0 var(--amber); }
html[dir="rtl"] .rc-card.sev-high { box-shadow: inset -4px 0 0 var(--brand); }
html[dir="rtl"] .rc-card.sev-medium { box-shadow: inset -4px 0 0 var(--amber); }
.rc-card.closed { background: color-mix(in srgb, var(--card) 55%, transparent); }
.rc-top { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.rc-main { flex: 1 1 260px; min-width: 0; }
.rc-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rc-meta .mono-k { font-size: 11.5px; }
.rc-drug { margin-top: 8px; font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -.03em; color: var(--ink); overflow-wrap: anywhere; }
.rc-line { margin-top: 8px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.rc-batch { font-family: var(--font-mono); font-size: 12.5px; padding: 5px 9px; border-radius: 8px; background: var(--ink-fill); color: #fff; white-space: nowrap; text-transform: uppercase; }
html[data-theme="dark"] .rc-batch { background: var(--ink); color: var(--paper); }
.rc-reason { font-size: 13.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.rc-sup { margin-top: 6px; }
.rc-proof { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: var(--paper); display: flex; gap: 8px 14px; flex-wrap: wrap; align-items: center; }
.rc-proof-main { flex: 1 1 220px; min-width: 0; }
.rc-proof-main .mono-k { font-size: 11px; }
.rc-proof-n { margin-top: 3px; font-weight: 600; font-size: 14px; color: var(--ink); }
.rc-proof > .mono-k { font-size: 11.5px; white-space: nowrap; }
.rc-ok { color: var(--green-deep); }
.rc-form { flex: 2 1 320px; min-width: 0; border-radius: 22px; background: var(--ink-fill); color: #fff; padding: 22px; display: flex; flex-direction: column; align-self: flex-start; }
.rc-form h3 { margin: 0; font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -.03em; }
.rc-form-sub { margin: 4px 0 0; font-size: 13px; line-height: 1.5; color: rgba(255,255,255,.6); }
.rc-form .mono-k { margin-top: 16px; font-size: 11px; color: rgba(255,255,255,.55); }
.rc-inp { width: 100%; margin-top: 7px; border: 1px solid rgba(255,255,255,.18); border-radius: 10px; padding: 10px 12px; background: rgba(255,255,255,.06); color: #fff; font: inherit; font-size: 14px; resize: vertical; }
.rc-inp.mono { font-family: var(--font-mono); }
.rc-inp::placeholder { color: rgba(255,255,255,.4); }
.rc-inp:focus { outline: 2px solid rgba(255,255,255,.35); outline-offset: 1px; }
.rc-seg { margin-top: 7px; display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(255,255,255,.07); }
.rc-seg-b { flex: 1; padding: 8px 4px; border: 0; border-radius: 9px; background: transparent; color: rgba(255,255,255,.6); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.rc-seg-b.on { background: #fff; color: #17110F; }
.rc-seg-b.on.high { background: var(--brand); color: #fff; }
.rc-sev-note { margin-top: 8px; font-family: var(--font-mono); font-size: 11.5px; line-height: 1.5; text-transform: uppercase; color: rgba(255,255,255,.6); }
.rc-sev-note.sev-medium { color: #F2C27B; }
.rc-sev-note.sev-high { color: #FF8A84; }
.rc-go { margin-top: 18px; width: 100%; justify-content: center; }
.rc-match { margin-top: 10px; text-align: center; color: rgba(255,255,255,.45) !important; }

/* ===== Admin · Account sharing (v3) ===== */
.sh-wrap .lim-info .mono-k { display: block; margin-top: 4px; font-size: 11.5px; }
.sh-top { display: block; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-detail { margin: 0; padding: 24px; }
.sh-signals { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.sh-sig { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 10px; background: var(--amber-bg); color: var(--amber); }
.sh-sig.hot { background: var(--blush); color: var(--brand-text-deep); }
.sh-sig .xn { font-weight: 500; }
.sh-facts { margin-top: 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 10px; }
.sh-facts .tile { padding: 16px; }
.sh-facts .tile-v { font-size: 26px; }
.sh-facts .tile-s { overflow-wrap: anywhere; }
.sh-k { margin-top: 18px; font-size: 11.5px; }
.sh-jump { display: flex; align-items: center; gap: 8px 12px; padding: 11px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.sh-ids { width: 96px; flex: none; }
.sh-cities { font-weight: 600; font-size: 14px; color: var(--ink); flex: 1 1 160px; min-width: 0; }
html[dir="rtl"] .sh-cities { unicode-bidi: plaintext; }
.sh-none, .sh-basis { margin-top: 8px; }
.sh-dev { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.sh-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); flex: none; }
.sh-dot.on { background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 25%, transparent); }
.sh-dev-name { font-weight: 600; font-size: 14px; flex: 1 1 140px; min-width: 0; color: var(--ink); }
.sh-dev-city { font-size: 13px; color: var(--ink-2); }
.sh-map { font-size: 12px; color: var(--brand-text); text-decoration: underline; text-underline-offset: 2px; margin-inline-start: 4px; white-space: nowrap; }
.sh-dev-ip { font-size: 12px; color: var(--ink-3); }
.sh-dev .mono-k { font-size: 11px; }
.sh-reason { margin-top: 10px; width: 100%; }
.sh-ro { margin: 16px 0 0; }

/* ===== Admin · Suspend (v3) ===== */
.su-list { flex: 3 1 460px; min-width: 0; margin: 0; }
.su-intro { margin: 0; padding: 0 22px 16px; font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
.su-row { display: flex; align-items: center; gap: 14px; padding: 16px 22px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.su-main { flex: 1 1 240px; min-width: 0; }
.su-name { font-weight: 600; font-size: 14.5px; color: var(--ink); }
.su-meta { margin-top: 2px; font-size: 11.5px; overflow-wrap: anywhere; text-transform: none; }
.su-reason { margin-top: 6px; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); overflow-wrap: anywhere; }
.su-side { flex: 2 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.su-form { flex: none; }
.su-select { background: #2A221F; }
.su-effects { margin-top: 14px; padding: 14px; border-radius: 14px; background: rgba(255,255,255,.06); }
.su-effects .mono-k { margin-top: 0; }
.su-eff { display: flex; gap: 10px; align-items: flex-start; margin-top: 9px; font-size: 13.5px; line-height: 1.45; color: rgba(255,255,255,.85); }
.su-eff-m { font-family: var(--font-mono); flex: none; width: 14px; text-align: center; color: rgba(255,255,255,.6); }
.su-eff-m.bad { color: #FF8A84; }
.su-eff-m.ok { color: #6FE0B0; }
.su-confirm { margin-top: 16px; padding: 14px; border-radius: 14px; border: 1px solid #FF8A84; background: rgba(179,38,30,.2); }
.su-confirm-t { font-weight: 600; font-size: 14.5px; }
.su-confirm-s { margin-top: 4px; font-size: 13px; color: rgba(255,255,255,.7); }
.su-cancel { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.3); }
.su-temp { margin: 0; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.su-temp .an-p { margin: 0; }
.su-temp .inp { width: 100%; }
.su-check { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--ink-2); }
.su-tp { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--paper); }
.su-tp-pw { font-size: 17px; letter-spacing: 1px; color: var(--ink); overflow-wrap: anywhere; }
.su-tp .btn { align-self: flex-start; }

/* ===== Admin · Admins & roles (v3) ===== */
/* Team table: one column grid; header and rows are subgrids, so role / 2FA / status / actions take the width of
   their widest cell in every language and name + email share the rest. Narrow screens scroll it sideways. */
.at-table { display: grid; grid-template-columns: minmax(170px, 1.4fr) minmax(170px, 1.2fr) max-content max-content max-content max-content; column-gap: 12px; min-width: min-content; }
.at-grid { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: center; padding: 13px 22px; }
.at-th { padding-top: 9px; padding-bottom: 9px; font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); text-transform: uppercase; border-top: 1px solid var(--line); }
.at-row { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; border-top: 1px solid var(--line); }
.at-row.off { background: color-mix(in srgb, var(--paper) 60%, transparent); }
.at-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.at-name { font-weight: 600; font-size: 14px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.at-you { font-size: 10.5px; }
.at-email { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.at-role { width: 100%; padding: 7px 9px; font-size: 13.5px; }
.at-acts { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.at-rm { width: 34px; padding-inline: 0; justify-content: center; color: var(--brand-text); }
.at-ask { grid-column: 1 / -1; padding: 0 22px 14px; }
.at-ask .confirm-v3 { margin-top: 0; }
.at-add { border-top: 1px solid var(--line); padding: 16px 22px 18px; background: var(--paper); }
.at-add .mono-k { font-size: 11.5px; }
.at-add-row { margin-top: 10px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 8px; align-items: center; }
.at-add-row .inp { width: 100%; min-width: 0; }
.at-added { margin-top: 12px; }
.at-perms { flex: 3 1 480px; min-width: 0; margin: 0; }
/* Permission matrix: same idea, so a long role name (Somali, Arabic) widens its own column only. */
.at-ptable { display: grid; grid-template-columns: minmax(150px, 1fr) repeat(3, minmax(64px, max-content)); column-gap: 10px; min-width: min-content; }
.at-pgrid { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: center; padding: 11px 22px; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink); }
.at-c { text-align: center; }
.at-c.yes { color: var(--green-deep); font-weight: 700; }
.at-c.no { color: var(--ink-3); }
.at-flags { flex: 2 1 320px; min-width: 0; margin: 0; }
.at-flag { display: flex; align-items: center; gap: 12px; padding: 12px 22px; border-top: 1px solid var(--line); }
.at-flag-main { flex: 1; min-width: 0; }
.at-flag-name { font-weight: 600; font-size: 14px; color: var(--ink); }
.at-flag .mono-k { margin-top: 2px; font-size: 11px; text-transform: none; }
/* Supplier Team page: the admin team's layout without the 2FA column, then what each role can do. */
.tm-table { display: grid; grid-template-columns: minmax(180px, 1fr) max-content max-content max-content; column-gap: 12px; min-width: min-content; }
.tm-id { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tm-badges { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 2px; }
.tm-badges .mono-k { font-size: 10.5px; }
.tm-table .at-email { white-space: normal; overflow-wrap: anywhere; } /* the whole login email, never cut (also in Arabic) */
/* A narrow Team card (a phone, a tablet, the sidebar open): each member's row stacks (who · role · status · actions)
   instead of scrolling sideways. */
.tm-wrap .scroll-x { container-type: inline-size; }
@container (max-width: 720px) {
  .tm-table { grid-template-columns: minmax(0, 1fr); min-width: 0; }
  .tm-table .at-th { display: none; }
  .tm-table .at-grid { row-gap: 10px; }
  .tm-table .at-role { max-width: 280px; }
  .tm-table .at-acts { justify-content: flex-start; }
}
.tm-roles { margin-top: 14px; }
.tm-roles .at-flag-main .small { margin-top: 2px; line-height: 1.45; }

/* ===== Admin · WhatsApp bot (v3) ===== */
.bt-console { flex: 1 1 360px; min-width: 0; max-width: 540px; border-radius: 24px; background: var(--ink-fill); overflow: hidden; display: flex; flex-direction: column; height: 640px; max-height: calc(100dvh - 170px); min-height: 460px; }
.bt-head { padding: 16px 18px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid rgba(255,255,255,.08); }
.bt-logo { width: 38px; height: 38px; border-radius: 12px; background: var(--brand); color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 18px; display: grid; place-items: center; flex: none; }
.bt-head-main { flex: 1; min-width: 0; }
.bt-name { color: #fff; font-weight: 600; font-size: 15px; }
.bt-live { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-family: var(--font-mono); font-size: 11px; color: #6FE0B0; text-transform: uppercase; }
.bt-dot { width: 7px; height: 7px; border-radius: 50%; background: #6FE0B0; }
.bt-scroll { flex: 1; min-height: 0; overflow: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.bt-msg { display: flex; }
.bt-msg.me { justify-content: flex-end; }
.bt-bubble { max-width: 86%; padding: 10px 12px; border-radius: 4px 14px 14px 14px; background: rgba(255,255,255,.08); color: rgba(255,255,255,.88); }
.bt-msg.me .bt-bubble { border-radius: 14px 4px 14px 14px; background: var(--brand); color: #fff; }
html[dir="rtl"] .bt-bubble { border-radius: 14px 4px 14px 14px; }
html[dir="rtl"] .bt-msg.me .bt-bubble { border-radius: 4px 14px 14px 14px; }
.bt-text { white-space: pre-wrap; font-size: 13.5px; line-height: 1.55; overflow-wrap: anywhere; font-family: var(--font-mono); }
.bt-msg.me .bt-text { font-family: var(--font-ui); }
.bt-time { margin-top: 4px; font-family: var(--font-mono); font-size: 10.5px; opacity: .55; text-align: end; }
.bt-foot { padding: 12px 14px 14px; border-top: 1px solid rgba(255,255,255,.08); }
.bt-quick { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.bt-chip { font-family: var(--font-mono); font-size: 12px; padding: 6px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.18); background: transparent; color: rgba(255,255,255,.82); cursor: pointer; }
.bt-chip:hover { border-color: #fff; color: #fff; }
.bt-input { display: flex; gap: 8px; }
.bt-inp { flex: 1; min-width: 0; border: 1px solid rgba(255,255,255,.18); border-radius: 12px; padding: 11px 13px; background: rgba(255,255,255,.06); color: #fff; font-family: var(--font-mono); font-size: 14px; }
.bt-inp::placeholder { color: rgba(255,255,255,.4); }
.bt-inp:focus { outline: 2px solid rgba(255,255,255,.35); outline-offset: 1px; }
.bt-outbox { flex: 2 1 440px; min-width: 0; margin: 0; }
.bt-out { display: grid; grid-template-columns: 52px 1fr; gap: 12px; padding: 12px 22px; border-top: 1px solid var(--line); }
.bt-when { display: flex; flex-direction: column; gap: 1px; font-size: 11px; color: var(--ink-3); padding-top: 2px; }
.bt-when b { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.bt-out-main { min-width: 0; }
.bt-to { font-weight: 600; font-size: 13.5px; color: var(--ink); overflow-wrap: anywhere; }
.bt-out-text { margin-top: 3px; font-size: 13px; line-height: 1.5; color: var(--ink-2); overflow-wrap: anywhere; }
.bt-out .mono-k { margin-top: 4px; font-size: 10.5px; }

/* ===== Admin · Audit trail (v3) ===== */
.au-hero { flex: 2 1 460px; min-width: 0; border-radius: 26px; padding: 26px; overflow: hidden; }
.au-hero-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.au-status { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12px; color: #6FE0B0; text-transform: uppercase; }
.au-status.bad { color: #FF8A84; }
.au-sdot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 25%, transparent); }
.au-verify { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.25); }
.au-verify:hover:not(:disabled) { border-color: #fff; }
.au-big { margin-top: 14px; font-family: var(--font-display); font-size: clamp(44px, 5vw, 64px); font-weight: 800; letter-spacing: -.05em; line-height: .95; }
.au-text { margin: 8px 0 0; max-width: 520px; font-size: 14px; line-height: 1.5; color: rgba(255,255,255,.7); }
.au-chain { margin-top: 20px; display: flex; align-items: center; overflow: hidden; }
/* Each block + link is 66px. When the hero is too narrow for all eight, drop the OLDEST whole blocks so the
   newest (highlighted) one always shows and no block is cut in half. */
.au-hero { container-type: inline-size; }
@container (max-width: 513px) { .au-block-wrap:nth-last-child(n+8) { display: none; } }
@container (max-width: 447px) { .au-block-wrap:nth-last-child(n+7) { display: none; } }
@container (max-width: 381px) { .au-block-wrap:nth-last-child(n+6) { display: none; } }
@container (max-width: 315px) { .au-block-wrap:nth-last-child(n+5) { display: none; } }
@container (max-width: 249px) { .au-block-wrap:nth-last-child(n+4) { display: none; } }
@container (max-width: 183px) { .au-block-wrap:nth-last-child(n+3) { display: none; } }
.au-block-wrap { display: flex; align-items: center; flex: none; }
.au-block { width: 52px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-family: var(--font-mono); font-size: 11.5px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); color: rgba(255,255,255,.85); }
.au-block-wrap:last-child .au-block { background: rgba(111,224,176,.16); border-color: #6FE0B0; color: #6FE0B0; }
.au-link { width: 14px; height: 2px; background: rgba(255,255,255,.25); }
.au-note { margin-top: 10px; font-size: 11px; color: rgba(255,255,255,.45); text-transform: uppercase; }
.au-export-row { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.au-row { border-top: 1px solid var(--line); }
.au-line { display: flex; align-items: center; gap: 8px 12px; padding: 12px 22px; width: 100%; flex-wrap: wrap; border: 0; background: none; font: inherit; color: inherit; text-align: start; }
.au-line.multi { cursor: pointer; }
.au-line.multi:hover { background: var(--paper); }
.au-when { width: 66px; flex: none; display: flex; flex-direction: column; gap: 1px; font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.au-when b { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.au-code { font-family: var(--font-mono); font-size: 11.5px; padding: 3px 8px; border-radius: 7px; white-space: nowrap; flex: none; background: var(--paper); color: var(--ink); border: 1px solid var(--line); }
.au-code.security { background: var(--blush); color: var(--brand-text-deep); border-color: transparent; }
.au-code.credit { background: var(--mint); color: var(--green-deep); border-color: transparent; }
.au-code.suppliers { background: var(--amber-bg); color: var(--amber); border-color: transparent; }
.au-code.admin { background: var(--ink-fill); color: #fff; border-color: transparent; }
html[data-theme="dark"] .au-code.admin { background: var(--ink); color: var(--paper); }
.au-detail { flex: 1 1 240px; min-width: 0; font-size: 13.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.au-actor { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.au-hash { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); white-space: nowrap; }
.au-items { padding: 0 22px 12px; padding-inline-start: clamp(22px, 8vw, 100px); }
.au-item { display: flex; gap: 8px 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13px; flex-wrap: wrap; align-items: baseline; }
.au-limit { margin: 0; padding: 12px 22px 16px; border-top: 1px solid var(--line); }

/* ===== One login (logged out): no sidebar — the header carries the brand, "Log in" and the switches ===== */
.logged-out .side { display: none; }
.hdr-brand { display: flex; align-items: center; gap: 9px; flex: none; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; color: var(--ink); }
.hdr-brand .side-logo-mark { width: 34px; height: 34px; }
.hdr-wordmark { font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: -.5px; color: var(--ink); }
.logged-out .hdr-titles { padding-inline-start: 16px; border-inline-start: 1px solid var(--line); }
.hdr-tools { display: flex; gap: 6px; align-items: center; flex: none; }
.hdr-tools .theme-toggle { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.hdr-tools .theme-toggle:hover { background: var(--paper); border-color: var(--line-2); }
@media (max-width: 560px) { .hdr-wordmark { display: none; } .logged-out .hdr-titles { padding-inline-start: 10px; } }

/* ===== Confirm your email (accounts made before confirmed sign-up) ===== */
.confirm-banner { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 16px; padding: 12px 16px; border-radius: 14px; background: var(--amber-bg); color: var(--amber); }
.ce-ico { font-size: 18px; flex: none; }
.ce-text { flex: 1 1 260px; min-width: 0; font-size: 13.5px; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
.ce-form { display: flex; gap: 8px; align-items: center; flex: none; }
.ce-code { width: 140px; padding: 8px 10px; font-size: 16px; letter-spacing: 4px; }
.ce-code::placeholder { font-size: 13px; letter-spacing: 0; } /* "6-digit code" fits the narrow box */
.confirm-banner .linkbtn { color: inherit; font-weight: 600; }

/* ===== Related company (same owner): the group-buy pool's reason form, read-only links card ===== */
.rel-form { padding: 12px 22px 16px; border-top: 1px dashed var(--line); background: var(--paper); }
.rel-form textarea { width: 100%; margin-top: 6px; }
.rel-form-acts { margin-top: 8px; display: flex; gap: 8px; }
.links-card { margin-top: 14px; }
.rel-row { display: flex; align-items: center; gap: 10px 14px; padding: 13px 22px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.rel-main { flex: 1 1 220px; min-width: 0; }
.rel-who { font-weight: 600; font-size: 14.5px; color: var(--ink); overflow-wrap: anywhere; }
.req-row.focus { box-shadow: inset 3px 0 0 var(--brand); background: color-mix(in srgb, var(--blush) 35%, transparent); }
html[dir="rtl"] .req-row.focus { box-shadow: inset -3px 0 0 var(--brand); }

/* ===== Admin · Related accounts ===== */
.ra-top { align-items: flex-start; }
.ra-list { flex: 3 1 460px; min-width: 0; margin: 0; }
.ra-sub { margin: 0; padding: 0 22px 14px; }
.ra-row { border-top: 1px solid var(--line); }
.ra-line { display: flex; align-items: center; gap: 10px 14px; padding: 14px 22px; flex-wrap: wrap; }
.ra-main { flex: 1 1 240px; min-width: 0; }
.ra-who { font-size: 14.5px; color: var(--ink); overflow-wrap: anywhere; }
.ra-who b { font-weight: 600; }
.ra-arrow { color: var(--ink-3); margin: 0 2px; }
.ra-main .mono-k { margin-top: 3px; text-transform: none; font-size: 11.5px; overflow-wrap: anywhere; }
.ra-note { margin-top: 6px; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); overflow-wrap: anywhere; }
.ra-acts { display: flex; gap: 6px; align-items: center; flex: none; }
.ra-rm { width: 34px; padding-inline: 0; justify-content: center; color: var(--brand-text); }
.ra-reasons { display: flex; gap: 6px; flex-wrap: wrap; }
.ra-edit { padding: 0 22px 16px; }
.ra-edit textarea { width: 100%; margin-top: 6px; }
.ra-edit .confirm-v3-acts { margin-top: 10px; }
.ra-seg button { padding: 8px; font-size: 13.5px; }
.ra-rule-text { margin: 6px 0 10px; font-size: 12.5px; color: var(--ink-3); line-height: 1.45; }
.ra-ask { padding: 0 22px 14px; }
.ra-ask .confirm-v3 { margin-top: 0; }
.ra-form .rc-seg-b { font-size: 12.5px; padding: 8px 6px; }

/* ===== Verification documents: the Shati Dowlada Hoose at sign-up · upload fields · banner · Documents page ·
   viewer · admin review. Files are fetched with the login token and shown as blobs (never public links). ===== */
.notice-blush { background: var(--blush); color: var(--brand-text-deep); }
.doc-banner { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.doc-banner-text { flex: 1 1 260px; min-width: 0; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
.doc-ico.bad { background: var(--blush); color: var(--brand-text-deep); }

/* the required license section (Create account · "upload to continue") */
.shati-box { margin: 20px 0 0; padding: 12px 16px 16px; border: 1.5px solid var(--ink); border-radius: 16px; background: var(--paper); min-width: 0; }
.shati-legend { padding: 0 6px; font-size: 13.5px; font-weight: 700; color: var(--ink); }
.shati-hint { margin-top: 2px; }
.auth-form .docf .inp { padding: 13px 14px; font-size: 15px; border-radius: 13px; }

/* upload fields: one picked file (thumbnail or PDF badge) + number + expiry */
.docf { margin-top: 12px; min-width: 0; }
.docf-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; } /* reached through its label */
.docf-drop { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1.5px dashed var(--line-2); border-radius: 13px; background: var(--card); cursor: pointer; transition: border-color .12s; }
.docf-drop:hover, .docf-input:focus-visible + .docf-drop { border-color: var(--ink); }
.docf-input:focus-visible + .docf-drop { outline: 2px solid var(--ink); outline-offset: 2px; }
.docf-drop.busy { opacity: .6; pointer-events: none; }
.docf-drop[hidden], .docf-picked[hidden] { display: none; } /* display:flex would beat the [hidden] attribute */
.docf-ico { width: 38px; height: 38px; border-radius: 11px; background: var(--ink-fill); color: #fff; display: grid; place-items: center; font-size: 18px; flex: none; }
.docf-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.docf-t { font-weight: 600; font-size: 14px; color: var(--ink); }
.docf-s { font-size: 12px; color: var(--ink-3); }
.docf-picked { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--card); min-width: 0; }
.docf-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 9px; border: 1px solid var(--line); background: #fff; flex: none; }
.docf-pdf { width: 56px; height: 56px; border-radius: 9px; background: var(--blush); color: var(--brand-text-deep); display: grid; place-items: center; font-family: var(--font-mono); font-weight: 700; font-size: 12px; flex: none; }
.docf-meta { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.docf-name { font-weight: 600; font-size: 13.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.docf-change { flex: none; cursor: pointer; }
.docf-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 0 12px; }
.docf-field { min-width: 0; }
.docf-field .auth-label { margin-top: 14px; }
.docf-field .inp { width: 100%; }

/* Documents page (Supplier → Documents · Facility → Organisation → Documents) */
.dz-sub { line-height: 1.5; }
.dz-row .lrow { flex-wrap: wrap; }
.dz-row .lrow-main { flex: 1 1 150px; } /* keeps the status icon beside the title on phones */
.dz-note { margin-top: 3px; }
.dz-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-inline-start: auto; }
.dz-form { margin: 0 22px 16px; padding: 4px 16px 16px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); }
.dz-form-acts { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.dz-ro { padding-top: 12px; border-top: 1px solid var(--line); margin-bottom: 0; }

/* in-place viewer ("View my file") */
.docv-overlay { position: fixed; inset: 0; z-index: 400; background: rgba(20, 8, 8, .62); display: grid; place-items: center; padding: 16px; }
.docv { width: min(920px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--card); color: var(--ink); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-lift); }
.docv-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.docv-name { flex: 1 1 auto; min-width: 0; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.docv-acts { flex: none; font-size: 13px; }
.docv-x { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink); cursor: pointer; flex: none; font-size: 14px; }
.docv-body { flex: 1 1 auto; overflow: auto; background: var(--paper); display: grid; place-items: center; min-height: 240px; }
.docv-img { display: block; max-width: 100%; max-height: calc(100vh - 120px); object-fit: contain; background: #fff; }
.docv-pdf { display: block; width: 100%; height: calc(100vh - 120px); border: 0; background: #fff; }

/* admin review (Verify · Facility KYC): one card per document type, each upload with its file in place */
.rv-docs { margin-top: 14px; }
.drt-list { margin-top: 18px; display: flex; flex-direction: column; gap: 14px; container-type: inline-size; }
.drt { border: 1px solid var(--line); border-radius: 16px; padding: 14px; background: var(--card); min-width: 0; }
.drt-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.drt-label { font-weight: 700; font-size: 14.5px; color: var(--ink); }
.drt-none { margin-top: 8px; }
.drd { margin-top: 12px; display: grid; grid-template-columns: minmax(0, 230px) minmax(0, 1fr); gap: 14px; align-items: start; }
.drd + .drd { padding-top: 12px; border-top: 1px dashed var(--line-2); }
@container (max-width: 520px) { .drd { grid-template-columns: minmax(0, 1fr); } }
.drd-prev { border-radius: 12px; background: var(--paper); border: 1px solid var(--line); min-height: 140px; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.drd-show { appearance: none; border: 0; background: none; font: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 140px; width: 100%; color: var(--ink-3); font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; }
.drd-show:hover { color: var(--ink); }
.drd-show:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.drd-imglink { display: block; }
.drd-img { display: block; width: 100%; max-height: 320px; object-fit: contain; background: #fff; }
.drd-pdf { display: block; width: 100%; height: 300px; border: 0; background: #fff; }
.drd-tab { display: block; padding: 7px 10px; font-size: 12px; text-align: center; border-top: 1px solid var(--line); }
.drd-loading { padding: 24px 12px; text-align: center; }
.drd-meta { min-width: 0; }
.drd-top { display: flex; gap: 6px; flex-wrap: wrap; }
.drd-line { margin-top: 7px; font-size: 13px; color: var(--ink-2); line-height: 1.45; overflow-wrap: anywhere; }
.drd-file { margin-top: 4px; overflow-wrap: anywhere; }
.drd-acts { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.drd-reject { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.drd-reject textarea { width: 100%; }
.dr-hist { margin-top: 16px; font-size: 13px; color: var(--ink-2); }
.dr-hist summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.dr-hist-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }

/* ===========================================================
   CREDIT DUE-DATE CALENDAR (facility + supplier Credit screens) — ui.js mountDueCalendar
   =========================================================== */
.dcal { padding-bottom: 18px; }
.dcal-head { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.dcal-head h3 { margin-inline-end: auto; }
.dcal-nav { display: flex; align-items: center; gap: 6px; }
.dcal-arrow {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font-size: 20px; line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0;
}
.dcal-arrow:hover { border-color: var(--line-2); }
.dcal-arrow svg { display: block; }
html[dir="rtl"] .dcal-arrow svg { transform: scaleX(-1); } /* the chevrons point the reading way */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.dcal-month { min-width: 140px; text-align: center; font-weight: 600; color: var(--ink); }
.dcal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; padding: 4px 22px 0; }
.dcal-wd { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); text-transform: uppercase; text-align: center; padding: 4px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html[dir="rtl"] .dcal-wd { text-transform: none; }
.dcal-day {
  position: relative; min-height: 64px; min-width: 0; padding: 6px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font: inherit; text-align: start; cursor: pointer;
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px; transition: border-color .15s, background .15s;
}
.dcal-day:hover { border-color: var(--line-2); }
.dcal-day.other { opacity: .45; }
.dcal-day.today .dcal-n { background: var(--ink-fill); color: #fff; border-radius: 999px; padding: 0 6px; }
html[data-theme="dark"] .dcal-day.today .dcal-n { background: var(--ink); color: var(--paper); }
.dcal-day.sel { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink) inset; }
.dcal-day.has.overdue { background: var(--blush); border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.dcal-day.has.soon { background: var(--amber-bg); }
/* Due later and settled too: a gentle tint in the legend's colour (overdue and within 3 days above). */
.dcal-day.has.due { background: color-mix(in srgb, var(--ink-2) 10%, var(--card)); border-color: color-mix(in srgb, var(--ink-2) 24%, var(--line)); }
.dcal-day.has.paid { background: color-mix(in srgb, var(--green) 13%, var(--card)); border-color: color-mix(in srgb, var(--green) 30%, var(--line)); }
/* My Profile: the account's documents under the profile. */
.me-docs { margin-top: 18px; scroll-margin-top: 80px; }
.me-docs:focus { outline: none; }
.dcal-day:focus-visible { outline: 2px solid var(--brand-text); outline-offset: 1px; }
.dcal-n { font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; line-height: 1.6; }
.dcal-dots { display: flex; gap: 3px; }
.dcal-dots i, .dcal-legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--ink-2); }
.dcal-dots i.overdue, .dcal-legend i.overdue { background: var(--brand); }
.dcal-dots i.soon, .dcal-legend i.soon { background: var(--amber); }
.dcal-dots i.due, .dcal-legend i.due { background: var(--ink-2); }
.dcal-dots i.paid, .dcal-legend i.paid { background: var(--green); }
.dcal-amt { font-family: var(--font-mono); font-size: 11px; color: var(--ink-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dcal-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 12px 22px 0; font-size: 12px; color: var(--ink-3); }
.dcal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dcal-list { margin: 14px 22px 0; border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.dcal-list-k { margin-bottom: 2px; }
.dcal-item { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; }
.dcal-who { flex: 1 1 180px; min-width: 0; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.dcal-amt2 { font-weight: 600; }
.dcal-none { margin: 0; }
.dcal-hint { margin: 12px 22px 0; }
@media (max-width: 560px) {
  .dcal-grid { gap: 3px; padding: 4px 12px 0; }
  .dcal-day { min-height: 46px; padding: 4px; align-items: center; }
  .dcal-amt { display: none; } /* phones: the dots say it; the list below has the amounts */
  .dcal-legend, .dcal-hint { padding-inline: 12px; margin-inline: 0; }
  .dcal-hint { padding: 0 12px; }
  .dcal-list { margin-inline: 12px; }
  .dcal-month { min-width: 0; }
  .dcal-add-l { display: none; }
}

/* ---- Professional catalog form (generic name · description · dosage form · origin · shelf life · price · MOQ) ---- */
.cat-form { border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px 12px; background: var(--paper); transition: border-color .15s; }
.cat-form.editing { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(179, 38, 30, .08); }
.cat-form-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.cat-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 10px 12px; }
.cat-f { display: block; min-width: 0; margin: 0; }
.cat-span-3 { grid-column: span 3; } .cat-span-4 { grid-column: span 4; } .cat-span-5 { grid-column: span 5; }
.cat-l { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.cat-req { color: var(--brand-text); font-weight: 700; }
.cat-f .inp { width: 100%; background: var(--card); }
.cat-form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 12px; }
.cat-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.cat-photo { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3); min-width: 0; }
.cat-photo input { max-width: 230px; font-size: 12px; }
.cat-photo-prev { display: inline-flex; align-items: center; }
.cat-photo-prev img { width: 44px; height: 44px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line-2); }
.cat-nophoto-note { margin-top: 12px; }
/* Product photos: a small thumbnail (a tap opens it large, over the page). */
.ph-thumb { flex: none; display: inline-block; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: var(--paper); cursor: zoom-in; vertical-align: middle; }
.ph-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ph-thumb:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ql-sup > .ph-thumb { float: inline-start; margin-inline-end: 10px; margin-bottom: 4px; }
.od-line .ph-thumb { width: 36px; height: 36px; margin-inline-end: 8px; }
/* The picture large: the page behind doesn't scroll; picture + Close always fit the visible screen (short and
   landscape phones too) — and if not, the overlay scrolls instead of cutting the button off. */
html.ph-open { overflow: hidden; }
.ph-lightbox { position: fixed; inset: 0; z-index: 1000; display: flex; overflow: auto; overscroll-behavior: contain; padding: 16px; background: rgba(15, 12, 10, .82); }
.ph-fig { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 100%; }
.ph-fig img { max-width: min(92vw, 900px); max-height: calc(100vh - 100px); max-height: calc(100svh - 100px); object-fit: contain; border-radius: 12px; background: #fff; }
.cat-form-foot .btn-primary { margin-inline-start: auto; }
.cat-note { font-size: 11.5px; margin-top: 6px; }
.cat-product { min-width: 180px; }
.cat-name { font-weight: 600; color: var(--ink); }
.cat-desc { font-size: 12px; color: var(--ink-3); margin-top: 2px; overflow-wrap: anywhere; }
.cat-noform, .cat-nophoto { cursor: pointer; border: none; font-family: inherit; }
.cat-acts { white-space: nowrap; }
.cat-acts .btn { padding: 4px 9px; }
@media (max-width: 860px) { .cat-span-5, .cat-span-4 { grid-column: span 12; } .cat-span-3 { grid-column: span 6; } }
@media (max-width: 480px) { .cat-span-3 { grid-column: span 12; } .cat-form-foot .btn-primary { width: 100%; margin-inline-start: 0; } }

/* ---- Request lines: specification under the name, dosage form beside it ---- */
.drugline .spec { font-size: 12.5px; color: var(--ink-2); padding-top: 2px; padding-bottom: 4px; }
.drugline .spec::placeholder { color: var(--ink-3); }
.drugline .dform { width: auto; flex: 0 0 auto; font-size: 13px; color: var(--ink-2); max-width: 150px; }
.lrow-spec { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; overflow-wrap: anywhere; }
.ql-offer { color: var(--ink-2); margin-top: 2px; overflow-wrap: anywhere; }
.drugline .row-main { flex-basis: 240px; }
.row-ctl { display: flex; align-items: center; gap: 10px; flex: 0 1 auto; flex-wrap: wrap; margin-inline-start: auto; min-width: 0; }
.cat-tbl td.mono { white-space: nowrap; }
/* Wide tables (the catalog: product · form · origin · shelf life · price · MOQ · stock · actions) scroll sideways
   inside their card on phones, tablets and small laptops, so every button stays reachable. */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.lrow-offer { color: var(--ink-3); }

/* ---- New request: the drug list as line items — one row per medicine (hospital.js renderNew) ---- */
.li-card { container: lic / inline-size; } /* the table folds by the card's own width (sidebar and summary take room) */
.li-top { align-items: center; }
.li-top h3 .li-count { font-family: var(--font-ui); font-size: 13px; font-weight: 500; letter-spacing: 0; }
.li-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.li-expall { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); }
.li-expall .inp { width: auto; padding: 6px 8px; font-size: 13px; }
.li-head, .li-row { display: grid; grid-template-columns: 22px minmax(200px, 1fr) minmax(104px, .38fr) 92px 78px 34px 26px; gap: 6px; align-items: start; padding: 0 18px; }
.li-head { font-size: 11.5px; color: var(--ink-3); padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.li-head span:nth-child(5) { text-align: end; }
.li-head span:nth-child(6) { text-align: center; }
.li-row { padding-top: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.li-row .row-n { padding-top: 10px; font-size: 12px; color: var(--ink-3); width: auto; }
.li-med { display: grid; gap: 6px; min-width: 0; }
.li-med .drug { font-weight: 600; }
.li-sub { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 6px; }
.li-row .inp { padding: 8px 9px; font-size: 13px; }
.li-row select.inp { padding-inline-end: 4px; }
.li-row .ctry, .li-sub .country-other { font-size: 13px; }
.li-brand { display: flex; align-items: center; gap: 4px; min-width: 0; border: 1px solid var(--line-2); border-radius: var(--r-control); background: var(--card); padding-inline-end: 4px; }
.li-brand:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(23, 17, 15, .08); }
.li-brand .brand { flex: 1; min-width: 0; border: 0; background: transparent; padding: 8px 10px; font: inherit; font-size: 13.5px; color: var(--ink); outline: none; }
.li-brand .brand:disabled { color: var(--ink-3); }
.li-brand .brand::placeholder { color: var(--ink-3); }
.li-brand.any { background: var(--paper); }
.li-brand.any .brand { display: none; }
.li-brand.any .any-brand { flex: 1; text-align: start; margin: 3px; padding: 5px 9px; }
.li-h-cc { text-align: center; }
.any-brand { flex: none; font: inherit; font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 8px; border: 1px solid var(--line-2); background: transparent; color: var(--ink-2); cursor: pointer; }
.any-brand:hover { border-color: var(--ink-3); }
.any-brand[aria-pressed="true"] { background: var(--ink-fill); border-color: var(--ink-fill); color: #fff; }
.li-c { display: block; min-width: 0; margin: 0; }
.li-c .inp { width: 100%; }
.li-c .qty { text-align: end; font-family: var(--font-mono); }
.li-cc { display: flex; justify-content: center; padding-top: 10px; margin: 0; }
.li-cc input { width: 18px; height: 18px; accent-color: var(--ink-fill); cursor: pointer; }
.li-row .row-rm { margin-top: 4px; }
.li-row .inp[aria-invalid="true"], .li-brand:has(.brand[aria-invalid="true"]) { border-color: var(--danger-600); box-shadow: 0 0 0 3px rgba(200, 30, 40, .10); }
.li-msg { margin: 10px 22px 0; font-size: 13px; color: var(--ink-2); }
.li-msg.bad { color: var(--brand-text-deep); }
.li-msg[hidden] { display: none; }
.li-msg .linkbtn { font-size: 13px; }
.li-foot { padding: 12px 22px 18px; display: grid; gap: 8px; }
.li-foot .urgent-row { margin-top: 6px; } /* the whole request: under the list */
.li-add { height: 38px; border: 1px dashed var(--line-2); border-radius: var(--r-control); background: transparent; color: var(--ink-2); font: inherit; font-size: 13.5px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; }
.li-add:hover { border-color: var(--ink-3); color: var(--ink); }
.shelf-n { width: 100%; }
@container lic (max-width: 620px) {
  .li-head { display: none; }
  .li-row { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 14px 16px; gap: 8px 10px; position: relative; }
  .li-row .row-n { position: absolute; top: 15px; inset-inline-start: 16px; padding: 0; }
  .li-med { grid-column: 1 / -1; padding-inline: 26px 30px; }
  .li-row .row-rm { position: absolute; top: 10px; inset-inline-end: 10px; margin: 0; }
  .li-c::before { content: attr(data-l); display: block; font-size: 11px; color: var(--ink-3); margin-bottom: 4px; }
  .li-cc { grid-column: 1 / -1; justify-content: flex-start; align-items: center; gap: 8px; padding-top: 0; }
  .li-cc::after { content: attr(data-l); font-size: 12px; color: var(--ink-2); direction: ltr; unicode-bidi: isolate; }
  .li-msg { margin-inline: 16px; }
  .li-foot { padding-inline: 16px; }
}
@container lic (max-width: 460px) { .li-sub { grid-template-columns: 1fr; } }
/* Catalog: the brand under the generic name; rows from before brands ask for one */
.cat-span-12 { grid-column: span 12; }
.cat-brand { font-size: 12.5px; font-weight: 500; color: var(--ink-2); margin-top: 1px; }
.cat-nobrand { cursor: pointer; border: none; font-family: inherit; margin-top: 3px; }
/* Quotes: "Same brand" next to what a supplier offers */
.ql-same { margin-inline-start: 6px; font-size: 11px; }
/* Stock reorder drafts: the brand to ask for (or "Any brand") before approving */
.draft-brand { margin-top: 8px; max-width: 340px; }
.draft-brand .brand[aria-invalid="true"] { color: var(--brand-text-deep); }
.draft-brand:has(.brand[aria-invalid="true"]) { border-color: var(--danger-600); }
/* Supplier quote forms: a shelf life below the facility's minimum */
.qf-below { color: var(--amber); flex-basis: 100%; }
/* Orders won: where to deliver, whom to call (2026-11-10). The ready-quote card's request groups. */
.ship-reach { margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--paper, #f6f1e7); color: var(--ink-2); }
.ship-reach a { color: inherit; font-weight: 700; }
.pa-group { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 22px 4px; border-top: 1px dashed var(--line, #e5ddd0); }
/* Expiry (2026-11-10): the box date's problem line and the short-date tick (supplier); a short minimum shelf life (facility). */
.qf-exp-msg { color: var(--danger-600); flex-basis: 100%; }
.qf-exp-msg[hidden], .qf-short[hidden] { display: none; }
.qf-short { display: flex; gap: 6px; align-items: flex-start; color: var(--amber); flex-basis: 100%; font-weight: 600; cursor: pointer; }
.req-row .qf-exp-msg, .req-row .qf-short { padding: 0 22px 10px; }
.cat-exp-notes, .ob-exp-notes { display: flex; flex-direction: column; gap: 4px; }
.cat-exp-notes:empty { display: none; }
.cat-short ul { margin: 6px 0; padding-inline-start: 18px; }
select.shelf-short { border-color: var(--amber); background-color: var(--amber-bg); }
.short-shelf { margin: 8px 0 10px; padding: 8px 10px; border-radius: 10px; background: var(--amber-bg); color: var(--amber); font-size: 12.5px; display: grid; gap: 6px; }
.short-shelf[hidden] { display: none; }
.short-shelf-tick { display: flex; gap: 6px; align-items: flex-start; font-weight: 600; cursor: pointer; }
.qf-below[hidden] { display: none; }
.req-row .qf-below { padding: 0 22px 14px; margin-top: -6px; }
.pa-line .qf-below { margin-top: 4px; }
.cb-note.amber { color: var(--on-dark-amber); } /* on the dark confirm bar: a tick or a reason still to give */
.group-line > span:first-child { min-width: 0; }
.group-line .pv { white-space: normal; } /* "9 mo · asked 12" wraps on a phone instead of pushing the amount out */
/* Supplier quote forms: "Also save to My Catalog" (ticked by default) */
.qf-sync { display: flex; align-items: center; gap: 6px; font-size: 12.5px; line-height: 1.3; color: var(--ink-2); align-self: center; cursor: pointer; }
.qf-sync input { width: 16px; height: 16px; margin: 0; accent-color: var(--green); flex: none; }
/* Supplier quote forms: a quote can be changed once, then it is locked */
.qf-once { color: var(--ink-3); }
.qf-locked { padding: 0 22px 16px; color: var(--ink-2); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.qf-sync-hint { color: var(--ink-3); }
/* The quote form's notes, under the form (not in its grid) */
.qf-notes { display: grid; gap: 4px; padding: 0 22px; margin: -8px 0 14px; }
.qf-notes .qf-below { padding: 0; margin: 0; }
.pa-notes { flex-basis: 100%; margin-top: 4px; }
.pa-notes[hidden] { display: none; } /* what "Also save to My Catalog" does, visibly */
/* Cash orders: the payment line (facility: My Orders; supplier: Orders won) — record only, MALMAL moves no money */
.od-pay { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.od-pay-row, .pay-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.od-pay-k { font-weight: 700; font-size: 13px; }
.od-pay-note, .pay-note { flex: 1 1 200px; min-width: 0; font-size: 12.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.od-pay-form, .pay-confirm { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.od-pay-form[hidden], .pay-confirm[hidden] { display: none; }
.od-pay-row .btn[hidden], .pay-row .btn[hidden] { display: none; } /* the opener hides while its confirm form is open (.btn's display would win) */
.od-pay-form .inp, .pay-confirm .inp { flex: 1 1 160px; min-width: 0; }
.orow-pay { margin-top: 4px; }
.pay-box { margin-top: 10px; display: grid; gap: 8px; }
.pay-item { padding: 10px 12px; border: 1px dashed var(--line); border-radius: 12px; }
.pay-q { flex-basis: 100%; font-weight: 600; font-size: 13px; }

/* ---- facility-credit ---- */
/* ======================================================================
   CREDIT REQUESTS — facility (hospital.js). Append to public/css/theme.css.
   Tokens only (light + dark); logical properties (RTL); everything wraps at 375px.
   ====================================================================== */

/* The credit days box on the dark confirm bar (payBar): shown only while Credit is chosen. */
.cb-days { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--on-ink-soft); flex: none; }
.cb-days[hidden] { display: none; } /* a class display would beat the UA [hidden] rule */
.cb-days .inp { width: 84px; padding: 7px 10px; font-size: 14px; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.22); color: #fff; }
.cb-days .inp:focus { border-color: #fff; box-shadow: none; }
.cb-days .inp[aria-invalid="true"] { border-color: var(--on-dark-pink); }
.cb-days .inp:disabled { opacity: .6; }

/* A pill that opens a credit request's card (a Quotes line, the sent list): a button that looks like its pill.
   Long supplier names wrap instead of pushing the row wider than a phone. */
button.cr-go { cursor: pointer; border: 0; white-space: normal; text-align: start; max-width: 100%; }
button.cr-go.pv-outline { border: 1px solid var(--line-2); }
button.cr-go.pv-paper { border: 1px solid var(--line); }
button.cr-go:hover { filter: brightness(.96); }
button.cr-go:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.summary-card button.cr-go:focus-visible { outline-color: #fff; }

/* Quotes: a line already ordered, or waiting on a credit answer — its state only, not choosable. */
.qline.cr-done { background: color-mix(in srgb, var(--paper) 70%, transparent); }
.qline.cr-done .ql-name { color: var(--ink-2); }
.ql-state { flex: 1 1 220px; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }

/* The sent list (dark summary card): the state sits on its own row under the line. */
.sent-rows .sent-cr { flex-basis: 100%; font-family: var(--font-ui); }

/* Dashboard: "N credit requests need your answer" (amber, like the card's state). */
.attn-item.amber { background: var(--amber-bg); }
.attn-item.amber .attn-ico { background: var(--amber); color: var(--card); }
.attn-item.amber .attn-t { color: var(--amber); }

/* ---- The Credit requests section (first on the Credit tab) ---- */
.crq-sec { margin-bottom: 14px; }
.crq-asked { margin: 0 22px 14px; }
.crq-none { margin: 0 22px 16px; }
.crq-list { display: flex; flex-direction: column; }
.crq-card { border-top: 1px solid var(--line); padding: 16px 22px 18px; }
.crq-card, .crq-row { scroll-margin-top: 96px; } /* an email link brings it under the sticky header, not behind it */
.crq-card.mine { background: color-mix(in srgb, var(--amber-bg) 40%, transparent); } /* this login's answer is needed */
.crq-card:focus, .crq-row:focus { outline: none; }
.crq-card:focus-visible, .crq-row:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.crq-card.flash, .crq-row.flash { animation: crq-flash 1.8s ease-out 1; } /* opened from an email link */
@keyframes crq-flash { from { box-shadow: inset 0 0 0 2px var(--amber); } to { box-shadow: inset 0 0 0 2px transparent; } }
@media (prefers-reduced-motion: reduce) { .crq-card.flash, .crq-row.flash { animation: none; box-shadow: inset 0 0 0 2px var(--amber); } }
.crq-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px 12px; flex-wrap: wrap; }
.crq-main { flex: 1 1 200px; min-width: 0; }
.crq-who { margin: 3px 0 2px; font-size: 16px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.crq-head .pv, .crq-row .xrow-head .pv { white-space: normal; max-width: 100%; }

.crq-lines { margin-top: 12px; border-top: 1px dashed var(--line); }
.crq-line { display: flex; justify-content: space-between; align-items: center; gap: 4px 10px; flex-wrap: wrap; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.crq-line > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.crq-line > span:last-child { margin-inline-start: auto; } /* a wrapped amount stays at the row's end */
.crq-line.off > span:first-child { color: var(--ink-3); }

/* The back and forth, oldest first: a dot per step (the supplier's amber, MALMAL's own red). */
.crq-hist { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.crq-hist li { position: relative; display: flex; justify-content: space-between; gap: 2px 10px; flex-wrap: wrap; padding-inline-start: 14px; font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.crq-hist li::before { content: ''; position: absolute; inset-inline-start: 1px; top: .5em; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); }
.crq-hist li.by-supplier::before { background: var(--amber); }
.crq-hist li.by-system::before { background: var(--brand-text); }
.crq-hist li > span:first-child { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }

/* The standing terms: the days (or each payment of a plan) the facility answers. */
.crq-terms { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); }
.crq-terms-v { margin-top: 4px; font-family: var(--font-display); font-size: 22px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; color: var(--ink); }
.crq-plan { list-style: none; margin: 8px 0 0; padding: 0; }
.crq-plan li { display: flex; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; padding: 5px 0; border-top: 1px dashed var(--line); font-size: 13.5px; }
.crq-plan li > span:first-child { flex: 1 1 auto; white-space: nowrap; } /* "Payment 2" stays on one line; "after N days" wraps below */
.crq-terms-foot { margin-top: 8px; }

.crq-note { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--paper); font-size: 13.5px; line-height: 1.5; color: var(--ink-2); overflow-wrap: anywhere; }
.crq-note.blush { background: var(--blush); color: var(--brand-text-deep); }
/* No answer within 2 hours: the note, and where each medicine would go (src/creditNudges.js). */
.crq-next { margin-top: 10px; padding: 10px 12px; border-radius: 12px; border: 1px dashed var(--line-2); }
.crq-next ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.crq-next li { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; font-size: 13.5px; }
.crq-next li > span:first-child { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.crq-next-diff { flex-basis: 100%; font-size: 12.5px; color: var(--ink-2); }
.crq-next-none { margin: 8px 0 0; }
.creq-late { padding: 8px 10px; border-radius: 10px; background: var(--amber-bg); color: var(--ink); }
.creq-late.over { background: var(--blush); color: var(--brand-text-deep); font-weight: 600; }
.crq-note.amber { background: var(--amber-bg); color: var(--ink); } /* readable on amber (4.5:1+) */
.crq-ro { margin: 10px 0 0; }

.crq-acts { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crq-acts .btn, .crq-row-acts .btn, .crq-confirm .btn { white-space: normal; text-align: center; max-width: 100%; } /* long names wrap on a phone */
.crq-acts.quiet .btn { font-weight: 500; } /* the supplier's turn: cash / cancel stay quiet */

/* "Ask for other days": a 1–180 box and Send, inside the card. */
.crq-form { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--card); }
.crq-days { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); }
.crq-days .inp { width: 96px; }
.crq-days .inp[aria-invalid="true"] { border-color: var(--danger-600); box-shadow: 0 0 0 3px rgba(200, 30, 40, .10); }
.crq-form-note { flex-basis: 100%; }

/* Order on cash / Cancel are confirmed in the card first (cancel blush, cash calm). */
.crq-confirm { margin-top: 12px; padding: 14px 16px; border-radius: 16px; }
.crq-confirm.blush { background: var(--blush); }
.crq-confirm.blush > .mono-k { color: var(--brand-text-deep); }
.crq-confirm.calm { background: var(--paper); border: 1px solid var(--line-2); }

/* Recently closed: compact rows (ui.js expandRow) with their way on beside them. */
.crq-closed { border-top: 1px solid var(--line); }
.crq-closed-k { padding: 16px 22px 4px; }
.crq-closed-k + .crq-row .xrow { border-top: none; }
.crq-row-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-width: 0; }
.crq-row-main b { font-weight: 600; overflow-wrap: anywhere; }
.crq-row-acts { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.crq-row-acts:empty { display: none; }
.crq-row .xrow-inset { padding: 2px 14px 12px; }

/* ---- A payment plan inside a facility statement (statementBox): each payment, then the balance ---- */
.ledger-plan { margin: 0 22px 10px; padding: 6px 14px; border-radius: 12px; background: var(--paper); border: 1px solid var(--line); }
.ledger-plan .ledger-line:first-child { border-top: none; }
.ledger-inst > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.ledger-plan .ledger-line > span:last-child { margin-inline-start: auto; } /* a wrapped amount stays at the row's end */
.ledger-inst.late > span:first-child { color: var(--brand-text-deep); }
.ledger-bal { font-weight: 600; }

@media (max-width: 560px) {
  .crq-card { padding: 14px 16px 16px; }
  .crq-asked, .crq-none { margin-inline: 16px; }
  .crq-closed-k { padding-inline: 16px; }
  .ledger-plan { margin-inline: 16px; }
  .ql-state { justify-content: flex-start; }
}

/* ---- supplier-credit ---- */
/* ===== Supplier credit requests (Credit page, before the receivables hero) ===== */
/* one card per request a facility sent: who asks, what, the back and forth, the terms on the table, the answers */
.creq-sec { margin-bottom: 14px; }
.creq { border-top: 1px solid var(--line); padding: 18px 22px; }
.creq.focus, .creq-row.focus { box-shadow: inset 3px 0 0 var(--brand); background: color-mix(in srgb, var(--blush) 35%, transparent); }
html[dir="rtl"] .creq.focus, html[dir="rtl"] .creq-row.focus { box-shadow: inset -3px 0 0 var(--brand); }
.creq-head { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; }
.creq-who { flex: 1 1 160px; min-width: 0; }
.creq-name { font-weight: 600; font-size: 15.5px; color: var(--ink); overflow-wrap: anywhere; }
.creq-meta { margin-top: 2px; font-size: 12.5px; color: var(--ink-3); overflow-wrap: anywhere; }
.creq-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.creq .pv { white-space: normal; max-width: 100%; } /* a long state (Somali) wraps inside a phone-wide card */
.creq-terms { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
.creq-limit { margin: 10px 0 0; font-size: 13px; line-height: 1.5; color: var(--ink-2); overflow-wrap: anywhere; }
.creq-limit .pv { margin-inline-end: 6px; vertical-align: middle; }
.creq-lines { margin-top: 12px; }
.creq-state { margin: 12px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
/* the history: oldest first, the newest step marked */
.creq-hist { margin-top: 12px; font-size: 13px; color: var(--ink-2); }
.creq-hist ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.creq-hist li { position: relative; padding-inline-start: 14px; overflow-wrap: anywhere; }
.creq-hist li::before { content: ''; position: absolute; inset-inline-start: 2px; top: .55em; width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); }
.creq-hist > ul > li:last-child::before { background: var(--ink-3); }
.creq-hist details { margin-bottom: 4px; }
.creq-hist summary { cursor: pointer; color: var(--ink-3); }
.creq-hist details > ul { margin: 4px 0 2px; }
/* "Propose other days": a narrow days box; the plan builder's days boxes too */
.creq-days .ninp input, .creq-pdays input { width: 52px; }
.creq-plan { margin-top: 14px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--card); }
.creq-plan-top { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.creq-plan-top > .mono-k { flex: 1 1 auto; }
.creq-plan-n { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); }
.creq-plan-n select.inp { width: auto; padding: 7px 10px; font-size: 13.5px; }
.creq-plan-rows { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.creq-prow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.creq-pk { min-width: 84px; color: var(--ink-3); }
.creq-note { margin: 10px 0 0; }
.creq-plan-foot { margin-top: 12px; display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; }
.creq-ptotal { flex: 1 1 220px; min-width: 0; color: var(--brand-text-deep); overflow-wrap: anywhere; }
.creq-ptotal.ok { color: var(--green-deep); }
/* recently closed: one line each, wrapping under the name on a phone */
.creq-closed { border-top: 1px solid var(--line); padding-top: 14px; }
.creq-closed-k { padding: 0 22px 4px; }
.creq-row, .acr-row { flex-wrap: wrap; }
.creq-row .lrow-main, .acr-row .lrow-main { flex: 1 1 200px; }
@media (max-width: 560px) {
  .creq { padding: 16px; }
  .creq-pk { flex-basis: 100%; } /* "Payment 1" above its two boxes */
}
/* Orders won: the shipment a credit request's "See order" opened */
.group-box.focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(179, 38, 30, .08); }
/* Group buy: Cash, or Credit with the days wanted — the create form and each Join; the member's own share */
.gb-form { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr); gap: 8px; align-items: center; margin-top: 10px; }
.gb-form > .inp { min-width: 0; }
.gb-form-pay { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
/* The Branches tab (public/js/hospital.js): branch cards and their logins. */
.org-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.org-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; align-items: center; }
.org-form > .fl, .org-form > .confirm-v3-acts, .org-form .org-wide { grid-column: 1 / -1; }
.org-form > .inp { min-width: 0; }
.org-points { margin: 8px 0 0; padding-inline-start: 18px; font-size: 13px; color: var(--ink-2); display: grid; gap: 4px; }
.org-branches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.org-branch { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 8px; align-content: start; }
.org-branch-head { display: flex; justify-content: space-between; align-items: start; gap: 8px; }
.org-branch-name { font-weight: 800; }
.org-stats { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.org-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.org-logins { display: grid; gap: 6px; }
.org-login { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.org-login-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.org-login-main { flex: 1 1 180px; min-width: 0; overflow-wrap: anywhere; }
.org-login-row > select.inp { width: auto; min-width: 150px; flex: 0 0 auto; }
.org-login-acts { display: inline-flex; gap: 8px; align-items: center; }
.org-login .confirm-v3 { margin-top: 8px; }
.org-added { margin-top: 8px; }
.org-note { margin-top: 12px; }
@media (max-width: 760px) { .org-branches, .org-form { grid-template-columns: minmax(0, 1fr); } }
/* The group buy's dosage form and specification (a second row). */
.gb-form-form { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 8px; }
.gb-form-form > .inp { min-width: 0; }
.gb-formwarn { grid-column: 1 / -1; margin: 0; }
.gb-formwarn .btn { margin-inline-start: 6px; }
.gb-form-pay .gb-pay { flex: 1 1 320px; }
.gb-until { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.gb-until .inp { width: auto; padding: 6px 9px; }
.gb-pay { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; min-width: 0; }
.gb-pay-l { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .02em; color: var(--ink-3); }
.gb-seg { flex: none; padding: 3px; }
.gb-seg button { flex: none; padding: 6px 14px; font-size: 13.5px; border-radius: 9px; }
.gb-days { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); flex: none; }
.gb-days[hidden] { display: none; } /* a class display would beat the UA [hidden] rule */
.gb-days .inp { width: 84px; padding: 6px 9px; }
.gb-days .inp[aria-invalid="true"] { border-color: var(--danger-600); box-shadow: 0 0 0 3px rgba(200, 30, 40, .10); }
.gb-pay-note { flex: 1 1 220px; min-width: 0; line-height: 1.4; }
.gb-bar { height: 8px; background: var(--ivory-200); border-radius: 99px; overflow: hidden; margin: 8px 0; }
.gb-bar > div { height: 100%; }
.gb-mine { display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; margin: 0 0 8px; color: var(--ink-2); }
.gb-mine .pv { white-space: normal; max-width: 100%; } /* a long state wraps on a phone instead of running out of the card */
.gb-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.gb-join { display: flex; gap: 8px 10px; flex-wrap: wrap; align-items: center; width: 100%; }
.gb-join .gb-qty { max-width: 120px; padding: 6px 9px; }
.gb-join .gb-pay { flex: 1 1 300px; }
.crq-pool, .creq-pool { margin-top: 2px; color: var(--ink-2); overflow-wrap: anywhere; }
.gb-note { margin: 0 0 8px; }
@media (max-width: 720px) {
  .gb-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .gb-form .gb-drug, .gb-form select, .gb-form .country-other { grid-column: 1 / -1; }
}
/* Professional profiles (public/js/profile.js): the header (logo or initials, name, type · place · member since, badges),
   then About, key numbers, contact, verification and reviews — over the page in a dialog, or on the account's own page */
.pf { display: flex; flex-direction: column; gap: 18px; }
.pf-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.pf-logo { width: 76px; height: 76px; flex: none; border-radius: 18px; display: grid; place-items: center; overflow: hidden; background: var(--ink-fill); color: var(--on-ink); font-weight: 800; font-size: 26px; letter-spacing: .02em; border: 1px solid var(--line); }
.pf-logo.has-img { background: #fff; }
.pf-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pf-logo-sm { width: 56px; height: 56px; border-radius: 14px; font-size: 19px; }
.pf-id { flex: 1 1 220px; min-width: 0; }
.pf-name { margin: 0; font-size: 22px; line-height: 1.2; overflow-wrap: anywhere; }
.pf-meta { margin-top: 4px; color: var(--ink-3); font-size: 13.5px; overflow-wrap: anywhere; }
.pf-badges { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.pf-badges .pv { white-space: normal; max-width: 100%; }
.pf-sec { border-top: 1px solid var(--line); padding-top: 14px; }
.pf-sec-k { margin: 0 0 8px; font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .02em; color: var(--ink-3); font-weight: 600; }
.pf-about { margin: 0; white-space: pre-line; line-height: 1.55; overflow-wrap: anywhere; }
.pf-empty { margin: 0; }
.pf-nums { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.pf-num { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--paper); min-width: 0; }
.pf-num.wide { grid-column: span 2; }
.pf-num-k { font-size: 12px; color: var(--ink-3); }
.pf-num-v { margin-top: 4px; font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }
.pf-num-v .pv { font-size: 12.5px; }
.pf-num-list { font-size: 14px; font-weight: 600; }
.pf-num-sub { margin-top: 2px; font-size: 12px; color: var(--ink-3); }
.pf-dl { margin: 0; display: grid; gap: 6px; }
.pf-kv { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; }
.pf-kv dt { color: var(--ink-3); font-size: 13px; }
.pf-kv dd { margin: 0; overflow-wrap: anywhere; }
.pf-docs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pf-docs li { display: flex; gap: 8px; align-items: baseline; }
.pf-doc-ok { color: var(--green-deep); font-weight: 800; }
.pf-note { margin: 8px 0 0; }
.pf-rv-sum { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.pf-stars { color: var(--amber); letter-spacing: 1px; white-space: nowrap; }
.pf-stars-off { color: var(--line-2); }
.pf-rvs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pf-rv { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.pf-rv-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pf-rv-text { margin: 6px 0 0; overflow-wrap: anywhere; white-space: pre-line; }
.pf-only-you { color: var(--ink-3); font-style: italic; overflow-wrap: anywhere; }
/* a name that opens its profile */
.pf-link { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer; text-align: inherit; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; overflow-wrap: anywhere; }
.pf-link:hover { text-decoration-color: currentColor; }
.pf-link:focus-visible { outline: 2px solid var(--brand-text); outline-offset: 2px; border-radius: 4px; }
/* the dialog */
html.pf-open { overflow: hidden; }
.pf-dialog { position: fixed; inset: 0; z-index: 1000; display: flex; justify-content: center; align-items: flex-start; overflow: auto; overscroll-behavior: contain; padding: 24px 16px; background: rgba(15, 12, 10, .55); }
.pf-sheet { width: 100%; max-width: 720px; background: var(--card); color: var(--ink); border-radius: 20px; padding: 18px 20px 22px; box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .45); }
.pf-sheet:focus { outline: none; }
.pf-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
/* the account's own page */
.pf-page { display: flex; flex-direction: column; gap: 14px; }
.pf-edit-k { margin: 0 0 4px; font-size: 18px; }
.pf-logo-row { display: flex; align-items: center; gap: 14px; margin: 12px 0 14px; flex-wrap: wrap; }
.pf-logo-acts { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.pf-edit textarea { width: 100%; }
.pf-left { margin-top: 4px; }
.pf-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 12px; margin-top: 12px; }
.pf-grid .pf-wide { grid-column: 1 / -1; }
.pf-grid .inp { width: 100%; }
.pf-actions { margin-top: 14px; display: flex; justify-content: flex-end; }
.pf-preview-k { margin: 4px 2px -6px; }
.pf-card { padding: 20px; }
.pf-ro { margin: 0; }
.pf-moh { margin: 4px 2px 0; }
/* rate a facility (Orders won) */
.pf-rate { margin-top: 10px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--card); }
.pf-rate-k { font-weight: 600; margin-bottom: 6px; overflow-wrap: anywhere; }
.pf-star-pick { display: inline-flex; gap: 2px; margin-bottom: 8px; }
.pf-star-pick .st { background: none; border: 0; padding: 0 3px; font-size: 26px; line-height: 1; color: var(--line-2); cursor: pointer; }
.pf-star-pick .st.on { color: var(--amber); }
.pf-star-pick .st:focus-visible { outline: 2px solid var(--brand-text); outline-offset: 2px; border-radius: 6px; }
.pf-rate textarea { width: 100%; }
.pf-rate-acts { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
@media (max-width: 560px) {
  .pf-dialog { padding: 0; align-items: stretch; }
  .pf-sheet { border-radius: 0; min-height: 100%; padding: 14px 16px 22px; }
  .pf-num.wide { grid-column: auto; }
  .pf-kv { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .pf-grid { grid-template-columns: minmax(0, 1fr); }
  .pf-card { padding: 16px; }
}

/* ---------------- Records (the facility's audit trail, redesigned 2026-11-09 — public/js/records.js) ---------------- */
.rec { --rfq-bg: rgba(179, 38, 30, .08); display: grid; gap: 12px; }
html[data-theme="dark"] .rec { --rfq-bg: rgba(236, 110, 100, .14); }
.rec .cat-rfq { --c: var(--brand-text); --cb: var(--rfq-bg); }
.rec .cat-quote { --c: var(--amber); --cb: var(--amber-bg); }
.rec .cat-flag { --c: var(--brand-text-deep); --cb: var(--blush); }
.rec .cat-order { --c: var(--green-deep); --cb: var(--mint); }
.rec .cat-credit { --c: var(--ink); --cb: var(--ivory-200); }
.rec .cat-team { --c: var(--ink-3); --cb: var(--ivory-200); }
.rec-toolbar { padding: 16px 18px; display: grid; gap: 12px; position: relative; }
.rec-tb-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.rec-tb-title { display: flex; gap: 11px; align-items: flex-start; }
.rec-lk { width: 36px; height: 36px; border-radius: 11px; background: var(--blush); display: grid; place-items: center; font-size: 16px; flex: none; }
.rec-tb-title b { font-family: var(--font-display); font-size: 16px; }
.rec-tb-title p { margin: 2px 0 0; color: var(--ink-3); font-size: 12.5px; }
.rec-tb-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rec-chain { display: inline-flex; align-items: center; gap: 7px; background: var(--mint); color: var(--green-deep); border-radius: 999px; padding: 7px 12px; font: inherit; font-size: 12px; font-weight: 600; border: 0; cursor: pointer; }
.rec-chain.bad { background: var(--blush); color: var(--brand-text-deep); }
.rec-chain.wait { background: var(--ivory-200); color: var(--ink-3); cursor: default; }
.rec-menu-wrap { position: relative; }
.rec-menu { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); background: var(--card); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow-lift); padding: 6px; min-width: 240px; z-index: 30; }
.rec-menu[hidden] { display: none; }
.rec-menu button { display: block; width: 100%; text-align: start; background: none; border: 0; padding: 9px 10px; border-radius: 9px; font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; }
.rec-menu button:hover, .rec-menu button:focus-visible { background: var(--paper); }
.rec-menu small { display: block; color: var(--ink-3); font-size: 11.5px; margin-top: 1px; }
.rec-filters { display: grid; grid-template-columns: minmax(0, 1.7fr) repeat(3, minmax(0, 1fr)); gap: 8px; }
.rec-filters.no-branch { grid-template-columns: minmax(0, 1.7fr) repeat(2, minmax(0, 1fr)); }
.rec-search { display: block; margin: 0; }
.rec-search .inp { width: 100%; }
.rec-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.rec-chipb { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink-2); border-radius: 999px; padding: 6px 11px; font: inherit; font-size: 12.5px; cursor: pointer; }
.rec-chipb .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.rec-chipb .n { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.rec-chipb[aria-pressed="true"] { background: var(--cb); border-color: transparent; color: var(--c); font-weight: 600; }
.rec-chipb[aria-pressed="true"] .n { color: inherit; }
.rec-chipb.all[aria-pressed="true"] { background: var(--ink-fill); color: #fff; }
.rec-trunc { margin: 0; font-size: 12px; color: var(--amber); }
.rec-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.rec-tile { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 13px 14px; text-align: start; cursor: pointer; color: var(--ink); font: inherit; display: grid; gap: 1px; transition: transform .15s, box-shadow .15s; }
.rec-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.rec-tile .v { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -.02em; color: var(--c); }
.rec-tile.cat-credit .v { color: var(--ink); }
.rec-tile .k { font-size: 12.5px; font-weight: 600; }
.rec-tile .s { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.rec-tile.on { outline: 2px solid var(--c); outline-offset: -2px; }
.rec-viewbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.rec-seg { display: inline-flex; background: var(--ivory-200); border-radius: 14px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.rec-seg button { border: 0; background: transparent; color: var(--ink-2); padding: 8px 14px; border-radius: 10px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; gap: 7px; align-items: center; }
.rec-seg button[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.rec-rec { font-family: var(--font-mono); font-size: 9px; letter-spacing: .06em; background: var(--brand); color: #fff; padding: 2px 6px; border-radius: 6px; text-transform: uppercase; }
.rec-count { font-size: 12.5px; color: var(--ink-3); }
/* By request */
.rec-case { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; box-shadow: var(--shadow); }
.rec-case + .rec-case, .rec-case + .rec-more, .rec-more + .rec-case { margin-top: 12px; }
.rec-case-hd { all: unset; box-sizing: border-box; width: 100%; display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; padding: 16px 18px 12px; cursor: pointer; }
.rec-case-hd.static { cursor: default; }
.rec-case-hd:focus-visible { outline: 2px solid var(--brand-text); outline-offset: -2px; border-radius: var(--r-card); }
.rec-no, .rec-chip { font-family: var(--font-mono); font-size: 11.5px; background: var(--rfq-bg); color: var(--brand-text); padding: 5px 8px; border-radius: 8px; white-space: nowrap; }
.rec-chip { font-size: 10.5px; padding: 2px 7px; border-radius: 6px; }
.rec-no.gray { background: var(--ivory-200); color: var(--ink-3); }
.rec-case-title { flex: 1 1 260px; min-width: 0; }
.rec-case-title b { font-family: var(--font-display); font-size: 16px; display: block; letter-spacing: -.01em; color: var(--ink); }
.rec-meta { font-size: 12px; color: var(--ink-3); display: block; margin-top: 2px; }
.rec-chev { color: var(--ink-3); transition: transform .2s; font-size: 14px; }
.rec-case.open .rec-chev { transform: rotate(180deg); }
.rec-steps { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); padding: 2px 18px 16px; margin: 0; list-style: none; }
.rec-step { position: relative; text-align: center; font-size: 11.5px; color: var(--ink-3); display: grid; justify-items: center; gap: 1px; min-width: 0; }
.rec-step::before { content: ''; position: absolute; top: 10px; inset-inline-end: 50%; width: 100%; height: 2px; background: var(--line-2); }
.rec-step:first-child::before { display: none; }
.rec-step.done::before, .rec-step.current::before, .rec-step.blocked::before { background: var(--brand); }
.rec-step .b { position: relative; z-index: 1; width: 22px; height: 22px; border-radius: 50%; margin-bottom: 4px; display: grid; place-items: center; background: var(--card); border: 2px solid var(--line-2); font-size: 11px; font-weight: 700; }
.rec-step.done .b { background: var(--brand); border-color: var(--brand); color: #fff; }
.rec-step.current .b { border-color: var(--amber); background: var(--amber-bg); color: var(--amber); }
.rec-step.blocked .b { border-color: var(--brand-text-deep); background: var(--blush); color: var(--brand-text-deep); }
.rec-step .l { font-weight: 650; color: var(--ink-2); }
.rec-step.todo .l { color: var(--ink-3); font-weight: 500; }
.rec-step .t { font-size: 10.5px; color: var(--ink-3); font-family: var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.rec-step.current .t { color: var(--amber); }
.rec-step.blocked .t { color: var(--brand-text-deep); }
.rec-case-body { border-top: 1px solid var(--line); padding: 14px 18px 16px; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; }
.rec-case-body.single { grid-template-columns: minmax(0, 1fr); }
.rec-ev { display: grid; grid-template-columns: 64px 22px minmax(0, 1fr); gap: 10px; padding: 7px 0; position: relative; }
.rec-ev::before { content: ''; position: absolute; inset-inline-start: 84px; top: 26px; bottom: -7px; width: 2px; background: var(--line); }
.rec-ev:last-child::before { display: none; }
.rec-time { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); padding-top: 3px; text-align: end; line-height: 1.3; overflow-wrap: anywhere; }
.rec-time .d { display: block; white-space: nowrap; }
.rec-ico { position: relative; z-index: 1; display: grid; place-items: center; padding-top: 3px; align-self: start; }
.rec-ico .tl-dot { box-shadow: 0 0 0 3px var(--card); }
.rec-label { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--c, var(--ink-2)); }
.rec-label .muted { font-weight: 500; letter-spacing: 0; text-transform: none; }
.rec-text { font-size: 13.5px; color: var(--ink); margin-top: 2px; line-height: 1.45; overflow-wrap: anywhere; }
.rec-ev.is-flag .rec-text, .rec-tl-row.is-flag .rec-text { color: var(--brand-text-deep); }
.rec-foot { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.rec-by { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-3); flex-wrap: wrap; min-width: 0; }
.rec-sep { opacity: .5; }
.rec-av { width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 8.5px; font-weight: 700; background: var(--ivory-300); color: var(--ink-2); flex: none; }
.rec-av.sys { background: var(--brand); color: #fff; }
.rec-av.adm { background: var(--ink-fill); color: #fff; }
.rec-av.sup { background: var(--amber-bg); color: var(--amber); }
.rec-code { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); background: var(--ivory-200); padding: 1px 6px; border-radius: 5px; white-space: nowrap; }
.rec-toggle { border: 1px solid var(--line-2); background: transparent; border-radius: 8px; font: inherit; font-size: 11.5px; padding: 2px 8px; color: var(--ink-2); cursor: pointer; }
.rec-burst-list { margin-top: 8px; border-inline-start: 2px solid var(--line-2); padding-inline-start: 10px; }
.rec-burst-list div { font-size: 12.5px; color: var(--ink-2); padding: 3px 0; display: flex; gap: 10px; }
.rec-burst-list .mono { color: var(--ink-3); font-size: 11px; min-width: 38px; padding-top: 1px; }
.rec-ev.next { --c: var(--amber); }
.rec-ev.next.green { --c: var(--green-deep); }
.rec-ev.next.ink { --c: var(--ink); }
.rec-ev.next .rec-time { color: var(--c); font-weight: 700; }
.rec-ev.next .rec-ico { color: var(--c); font-size: 15px; padding-top: 0; }
.rec-ev.next .btn { margin-top: 8px; }
.rec-qbox { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 12px 12px 10px; align-self: start; min-width: 0; }
.rec-qbox h4 { margin: 2px 2px 8px; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-family: var(--font-mono); font-weight: 500; }
.rec-qt-wrap { overflow-x: auto; }
.rec-qt { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.rec-qt th { font-size: 10px; color: var(--ink-3); font-weight: 500; text-align: start; padding: 5px 6px; border-bottom: 1px solid var(--line); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .05em; }
.rec-qt td { padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink); }
.rec-qt .num { text-align: end; font-family: var(--font-mono); white-space: nowrap; }
.rec-qt tr.flag td { background: var(--blush); color: var(--brand-text-deep); }
.rec-qt tr.win td { background: var(--mint); color: var(--green-deep); }
.rec-qt .qnote { display: block; font-size: 11px; margin-top: 2px; font-weight: 500; }
.rec-qfoot { font-size: 11.5px; color: var(--ink-3); margin: 9px 2px 0; }
/* Records: cancel a request from its card (follow-up 2026-11-22) */
.rec-case-ft .rec-cancel { margin-inline-start: auto; }
.rec-case-ft .rec-cancel-ask { flex-basis: 100%; margin-top: 8px; }
.rec-qfoot b { color: var(--ink); }
.rec-case-ft { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 18px; border-top: 1px solid var(--line); background: var(--paper); flex-wrap: wrap; }
/* A request of several medicines (one RFQ number): their names under the title; closed, each with its state; open, each
   its own section — steps, entries, what happens next, quote comparison. */
.rec-case-title .rec-meds { display: block; font-size: 13px; color: var(--ink-2); margin-top: 3px; overflow-wrap: anywhere; }
.rec-lines { list-style: none; margin: 0; padding: 0 18px 14px; display: grid; gap: 6px; }
.rec-lines li { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); min-width: 0; }
.rec-lines li > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.rec-line { border-top: 1px solid var(--line); }
.rec-line-hd { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 14px 18px 10px; }
.rec-line-t { font-weight: 600; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.rec-line-hd .rec-meta { display: inline; margin: 0; flex: 1 1 auto; }
.rec-line .rec-case-body { border-top: 0; padding-top: 2px; }
.rec-req-evs { border-top: 1px solid var(--line); }
.rec-hash { font-family: var(--font-mono); font-size: 11px; color: var(--green-deep); }
.rec-more { text-align: center; }
.rec-empty { text-align: center; padding: 40px 20px; color: var(--ink-3); background: var(--card); border: 1.5px dashed var(--line-2); border-radius: var(--r-card); }
.rec-empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }
.rec-empty p { margin: 0 0 14px; }
/* Timeline */
.rec-day + .rec-day { margin-top: 18px; }
.rec-day-h { display: flex; align-items: baseline; gap: 10px; margin: 2px 4px 8px; }
.rec-day-h b { font-family: var(--font-display); font-size: 15.5px; }
.rec-day-h span { font-size: 12px; color: var(--ink-3); }
.rec-tl { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: 4px 16px; box-shadow: var(--shadow); }
.rec-tl-row { display: grid; grid-template-columns: 92px 22px minmax(0, 1fr) auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: start; }
.rec-tl-row:last-child { border-bottom: 0; }
.rec-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rec-code-side { margin-top: 2px; }
/* Table */
.rec-tw { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); overflow: auto; max-height: 660px; box-shadow: var(--shadow); }
.rec-at { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; min-width: 960px; }
.rec-at th { position: sticky; top: 0; background: var(--card); text-align: start; font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: 11px 12px; border-bottom: 1px solid var(--line-2); z-index: 1; }
.rec-at td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink); }
.rec-at tbody tr:hover td { background: var(--paper); }
.rec-at td.txt { min-width: 300px; color: var(--ink-2); overflow-wrap: anywhere; }
.rec-evcell { display: flex; gap: 8px; align-items: flex-start; }
.rec-evcell .tl-dot { margin-top: 3px; width: 9px; height: 9px; }
.rec-evcell .lab { font-weight: 650; color: var(--c, var(--ink)); margin-bottom: 3px; }
.rec-at .rec-hash { color: var(--green-deep); }
.rec-at .nowrap { white-space: nowrap; }
.rec-tfoot { display: flex; justify-content: space-between; align-items: center; padding: 12px 4px; font-size: 12px; color: var(--ink-3); flex-wrap: wrap; gap: 8px; }
.rec-pager { display: flex; gap: 6px; }
/* Print / save as PDF: only the records sheet */
#rec-print { display: none; }
@media print {
  /* light colours whatever the page theme: dark text on white paper */
  #rec-print { --ink: #17110F; --ink-2: #4F4541; --ink-3: #6B605B; --card: #fff; --paper: #fff; --green-deep: #0A6B49; --ivory-200: #F1EBE4; --ivory-300: #EAE2DA;
    --line: rgba(23, 17, 15, .14); --line-2: rgba(23, 17, 15, .22); --brand-text: #B3261E; --amber: #A86A12; --amber-bg: #F8EBD3; background: #fff; }
  body.rec-printing > *:not(#rec-print) { display: none !important; }
  body.rec-printing #rec-print { display: block; padding: 0; color: #000; }
  #rec-print h1 { font-size: 18px; margin: 0 0 4px; }
  #rec-print p { font-size: 11px; margin: 0 0 10px; }
  #rec-print .rec-at { min-width: 0; font-size: 9.5px; }
  #rec-print .rec-at th { position: static; }
  #rec-print .rec-at td, #rec-print .rec-at th { padding: 4px 6px; }
  #rec-print .rec-at td.txt { min-width: 0; }
  #rec-print tr { break-inside: avoid; }
}
@media (max-width: 1100px) { .rec-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .rec-menu-wrap { position: static; } .rec-menu { inset-inline: 12px; top: auto; min-width: 0; } }
@media (max-width: 860px) {
  .rec-filters, .rec-filters.no-branch { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rec-filters .rec-search { grid-column: 1 / -1; }
  .rec-case-body { grid-template-columns: minmax(0, 1fr); }
  .rec-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rec-tl-row { grid-template-columns: 70px 22px minmax(0, 1fr); }
  .rec-code-side { display: none; }
}
@media (max-width: 640px) {
  .rec-steps { padding: 2px 8px 14px; }
  .rec-step .t { display: none; }
  .rec-step .l { font-size: 10px; }
  .rec-ev { grid-template-columns: 48px 22px minmax(0, 1fr); }
  .rec-ev::before { inset-inline-start: 68px; }
  .rec-tile .v { font-size: 22px; }
}

/* Telling real companies from fakes (2026-11-09): "New on MALMAL" and the city by a name, a facility's standing on a
   credit request, the admin's warnings and approval checks, Credit locked until verified, "Report this company". */
.pf-new { margin-inline-start: 4px; vertical-align: middle; white-space: nowrap; font-family: var(--font-ui); }
.pf-city { font-weight: 400; font-family: var(--font-ui); }
.creq-standing { margin-top: 4px; color: var(--ink-2); line-height: 1.5; }
.dr-warn { margin: 12px 0 0; }
.dr-warn ul { margin: 6px 0; padding-inline-start: 18px; }
.dr-warn-acc { margin: 2px 0; }
.dr-warn-mark { color: var(--amber); }
.drd-approve { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.drd-approve textarea { width: 100%; }
.drd-checks, .pf-rep-why { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.drd-checks legend, .pf-rep-why legend { margin-bottom: 4px; padding: 0; }
.seg button:disabled { opacity: .45; cursor: not-allowed; }
.pf-report { margin-top: 18px; border-top: 1px dashed var(--line); padding-top: 12px; }
.pf-rep-form { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.pf-rep-form[hidden] { display: none; }
.pf-rep-err { margin: 0; }
.creq-standing .amber { color: var(--amber); font-weight: 600; }
.pf-rep-form textarea { width: 100%; }
.pf-rep-done { margin: 0; }

/* ===== Best Match · Budget · Premium (Nov 2026): the Quotes' three list cards, every offer with its fit against the
   request and its label, what a choice needs (the Budget's "I checked" tick, a written reason, the owner's approval),
   lines waiting for the owner. Tokens only (light + dark), logical properties (RTL), everything wraps at 375px. ===== */
/* The cards (the prototype's option cards): Best Match on mint; Budget on the plain card with a line (amber means pending,
   so only its "below your request" words are amber); Premium on the ink fill (dark in both modes) with the on-dark pink tag
   and the brand-red selected state. A short mono tag (the label), the figure, then the sub lines. */
.opt.lb-card { display: flex; flex-direction: column; gap: 4px; }
.opt.lb-best { background: var(--mint); color: var(--green-deep); }
.opt.lb-budget { background: var(--card); color: var(--ink); border-color: var(--line); }
.opt.lb-premium { background: var(--ink-fill); color: var(--on-ink); }
html[data-theme="dark"] .opt.lb-premium:not(.sel) { border-color: var(--line-2); } /* the ink fill is close to a dark card */
.opt.lb-card .opt-top { align-items: flex-start; }
.opt.lb-card .opt-tag { text-transform: uppercase; letter-spacing: .02em; }
.opt.lb-best .opt-tag { color: var(--green-deep); }
.opt.lb-budget .opt-tag { color: var(--ink-3); }
.opt.lb-premium .opt-tag { color: var(--on-dark-pink); }
.opt.lb-card .opt-sub { margin-top: 2px; font-size: 13px; }
.opt.lb-card .opt-sub.lb-what { margin-top: 10px; font-size: 14px; }
.lb-diff { margin-top: 6px; font-size: 13px; font-weight: 600; }
.opt.lb-budget .lb-diff { color: var(--amber-deep); }
.lb-mix, .lb-none { margin-top: 2px; font-size: 12.5px; opacity: .85; }
/* The owner's Premium limit: a status pill (within · above), then its words. */
.lb-limit { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 6px; font-size: 12.5px; }
.lb-limit-t { min-width: 0; overflow-wrap: anywhere; }
.opt.lb-premium .lb-limit .pv.ok { background: color-mix(in srgb, var(--on-dark-green) 16%, transparent); color: var(--on-dark-green); }
.opt.lb-premium .lb-limit .pv.need { background: color-mix(in srgb, var(--on-dark-pink) 16%, transparent); color: var(--on-dark-pink); }
.opt.lb-premium .opt-radio { border-color: color-mix(in srgb, var(--on-ink) 40%, transparent); }
.opt.lb-best.sel, .opt.lb-best.sel .opt-radio { border-color: var(--green-deep); }
.opt.lb-budget.sel, .opt.lb-budget.sel .opt-radio { border-color: var(--ink); }
.opt.lb-premium.sel, .opt.lb-premium.sel .opt-radio { border-color: var(--brand); }
.opt.lb-card:focus-visible { outline: 3px solid var(--brand-text); outline-offset: 2px; }
html[dir="rtl"] .opt.lb-card .opt-tag { letter-spacing: 0; } /* spacing would break Arabic letter joins */

/* The drug-by-drug list: each line's head (what was asked, the owner's last answer, "no offer meets everything"), then
   every offer — the one the line uses marked by a brand bar at its start. */
.qline.lb-lhead { padding-bottom: 10px; }
.qline.lb-lhead .ql-drug { flex: 1 1 260px; }
.lb-asked { margin-top: 2px; color: var(--ink-3); }
.lb-nobest { margin-top: 6px; color: var(--amber-deep); font-weight: 600; }
.notice.lb-decision { margin: 6px 0 0; overflow-wrap: anywhere; }
.qline.lb-off { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: start; padding: 12px 22px;
  border-top: 1px dashed var(--line); border-inline-start: 3px solid transparent; }
.qline.lb-off.lb-used { background: var(--paper); border-inline-start-color: var(--brand); } /* the system's selected row (.lrow.sel) */
.qline.lb-off.held.lb-used { background: var(--blush); }
.lb-fit { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.lb-acts { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lb-acts .cf-report { color: var(--brand-text); opacity: .85; font-size: 11.5px; text-decoration: none; }
.lb-choose { white-space: nowrap; }
/* A label as a pill before the supplier's name (Best Match mint · Budget amber · Premium ink): a spacing hook only. */
.lb-badge { margin-inline-end: 6px; vertical-align: 1px; }
/* An offer's fit against the request: a status pill (meets mint · below amber · better ink · 30%+ under the market blush),
   the detail beside it (.lb-delta). */
.qline.held .pv-blush, .gb-off.held .pv-blush { background: var(--card); } /* on the flagged row's own blush */
.lb-delta { font-size: 12px; color: var(--ink-2); min-width: 0; overflow-wrap: anywhere; }
.lb-delta.saves { color: var(--green-deep); }

/* Under the offer a line uses: what choosing it needs — the tick, or the reason (and who approves) — a pending to-do (amber
   bar) — or that a Premium is within the owner's limit. */
.lb-need { padding: 10px 22px 14px; border-top: 1px dashed var(--line); border-inline-start: 3px solid var(--amber); background: color-mix(in srgb, var(--amber-bg) 45%, transparent); }
.lb-need.ok { padding-block: 8px 10px; border-inline-start-color: var(--brand); background: color-mix(in srgb, var(--mint) 45%, transparent); }
.lb-need .lb-limit { margin-top: 0; }
.lb-tick { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; font-weight: 600; color: var(--amber-deep); cursor: pointer; }
.lb-tick input { width: 17px; height: 17px; margin: 2px 0 0; flex: none; accent-color: var(--amber); }
.lb-tick span { min-width: 0; overflow-wrap: anywhere; }
.lb-need-k { margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); overflow-wrap: anywhere; }
.lb-why.owner .lb-need-k { color: var(--brand-text-deep); }
.lb-why textarea { width: 100%; min-height: 64px; margin-top: 4px; }
.lb-why textarea[aria-invalid="true"] { border-color: var(--brand-text); }
.lb-need-n { margin-top: 6px; color: var(--ink-3); }
.lb-why.owner .lb-need-n { color: var(--amber-deep); font-weight: 600; }

/* A line waiting for the owner's approval (its state only): the offer, the reason given, "Take back". */
.qline.lb-wait { background: color-mix(in srgb, var(--amber-bg) 45%, transparent); }
.lb-wait-why { margin-top: 4px; color: var(--ink-2); overflow-wrap: anywhere; }
/* The pill says "◷ Waiting" (it never wraps); who it waits for is said beside it. */
.sent-rows .sent-own { margin-inline-start: 6px; font-size: 12.5px; opacity: .75; overflow-wrap: anywhere; }

/* The confirm bar's notes (what is left to do), wrapping together. */
.cb-notes { display: flex; flex-wrap: wrap; gap: 4px 14px; flex: 1 1 220px; min-width: 0; }

@media (max-width: 760px) {
  .qline.lb-off, .lb-need { padding-inline: 16px; }
}
@media (max-width: 560px) {
  .qline.lb-off { gap: 6px 10px; }
  .lb-acts { width: 100%; margin-inline-start: 0; justify-content: space-between; }
}

/* ===== Best Match · Budget · Premium, part 2 (Nov 2026): the Approvals tab (a staff member's choice waiting for the
   owner), the Buying rules card (My Profile), a group buy's labelled offers, the admin's stricter-standard countries.
   Tokens only (light + dark), logical properties (RTL), everything wraps at 375px. ===== */
/* Approvals: one card per request — who chose, the offer against the Best Match, why, the reason given, the decision. */
.ap-sec { margin-bottom: 14px; }
/* The stat row above Approvals, My equipment and the supplier's Service list (MORE_SCREENS: a row of tiles on every screen). */
.ap-stats, .eq-stats, .sv-stats { margin-bottom: 14px; }
.ap-none { margin: 0 22px 16px; }
.ap-list { display: flex; flex-direction: column; }
.ap-item { display: flex; flex-direction: column; gap: 8px; padding: 16px 22px 18px; border-top: 1px solid var(--line); scroll-margin-top: 96px; }
.ap-item.mine { background: color-mix(in srgb, var(--amber-bg) 40%, transparent); } /* the owner's decision is needed */
.ap-item:focus { outline: none; }
.ap-item:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.ap-item.flash { animation: crq-flash 1.8s ease-out 1; } /* opened from a link or a line's pill */
@media (prefers-reduced-motion: reduce) { .ap-item.flash { animation: none; box-shadow: inset 0 0 0 2px var(--amber); } }
.ap-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px 12px; flex-wrap: wrap; }
.ap-main { flex: 1 1 220px; min-width: 0; }
.ap-who { overflow-wrap: anywhere; }
.ap-title { margin: 3px 0 0; font-size: 16px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.ap-qty { font-size: 14px; font-weight: 500; }
.ap-offer { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 10px 12px; border-radius: 12px; background: var(--paper); border: 1px solid var(--line); }
.ap-sup { flex: 1 1 220px; min-width: 0; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.ap-sup .muted { font-weight: 500; }
.ap-hand { margin-inline-end: 6px; }
/* The price in parts ("$0.060 per glove · 200 for $12.00 · $1,200.00"): each part whole, the parts wrap on a phone. */
.ap-price { margin-inline-start: auto; display: flex; flex-wrap: wrap; gap: 0 8px; max-width: 100%; min-width: 0; font-weight: 700; color: var(--ink); }
.ap-pp { white-space: nowrap; }
.ap-vs { color: var(--ink-2); overflow-wrap: anywhere; }
.ap-vs .more { color: var(--brand-text); }
.ap-vs .saves { color: var(--green-deep); }
.ap-why { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--ink); }
.ap-diffs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.ap-reason { margin: 0; padding: 8px 12px; border-inline-start: 3px solid var(--line-2); border-radius: 10px; border-start-start-radius: 0; border-end-start-radius: 0;
  background: var(--paper); font-size: 13.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.ap-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--ink-2); }
.ap-meta > span { min-width: 0; overflow-wrap: anywhere; }
.notice.ap-warn { margin: 0; overflow-wrap: anywhere; }
.notice.ap-done { margin: 0; }
.notice.notice-paper { background: var(--paper); color: var(--ink-2); border: 1px solid var(--line); }
.ap-out { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 13.5px; color: var(--ink-2); }
.ap-out > span { min-width: 0; overflow-wrap: anywhere; }
.ap-out.ok > span { color: var(--green-deep); font-weight: 600; }
.ap-out.no > span { color: var(--brand-text-deep); font-weight: 600; }
.ap-note-shown { margin: 0; color: var(--ink-2); overflow-wrap: anywhere; }
.ap-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ap-ask .confirm-v3 { margin-top: 2px; }
.ap-note-k { display: block; margin-top: 10px; }
.ap-note { width: 100%; min-height: 60px; margin-top: 4px; }

/* My Profile → Buying rules: the owner's Premium limit (choice chips — the chosen one ink-filled), read-only for the other logins. */
.br-k { margin-top: 12px; font-size: 14px; font-weight: 700; color: var(--ink); }
.br-sub { margin: 4px 0 10px; max-width: 64ch; }
.chips.br-chips { margin-top: 0; }
.br-chips .chip:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.br-chips .chip:disabled { opacity: .6; cursor: default; }
.br-ro { margin: 2px 0 0; color: var(--ink); }

/* A group buy's offers: the three labels as information tiles (Best Match mint · Budget the plain tile · Premium ink with
   its on-dark pink label) — Allocate is on each offer, never a choice of the tile itself — then every other offer with its fit. */
.tiles.gb-tiles { gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.tile.gb-lb { display: flex; flex-direction: column; gap: 2px; padding: 16px; }
.gb-lb .tile-v { margin-top: 8px; font-size: clamp(22px, 2.4vw, 28px); letter-spacing: -.03em; overflow-wrap: anywhere; }
.gb-lb .tile-s { margin-top: 2px; }
.gb-lb.tile-ink .tile-k { color: var(--on-dark-pink); }
.gb-lb.lb-budget .lb-diff { color: var(--amber-deep); } /* the Budget's "below your request" signal, as on the Quotes */
.gb-lb.tile-ink .tile-s, .gb-lb.tile-ink .muted { color: var(--on-ink-soft); }
html[data-theme="dark"] .gb-lb.tile-ink { border-color: var(--line-2); } /* the ink fill is close to a dark card */
.gb-help { margin-top: 4px; overflow-wrap: anywhere; }
.lb-list { margin: 6px 0 0; padding-inline-start: 18px; font-size: 12.5px; }
.lb-list li { margin: 2px 0; overflow-wrap: anywhere; }
.opt.lb-card .lb-delta, .gb-lb .lb-delta { color: inherit; font-size: 12.5px; font-weight: 600; } /* on the card's own colour */
.gb-act { margin-top: 10px; }
.pv.gb-min { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.tile-ink .pv.gb-min { background: color-mix(in srgb, var(--on-ink) 10%, transparent); color: var(--on-dark-pink); }
.gb-relonly { margin-top: 8px; }
.gb-others { margin-top: 12px; border-top: 1px solid var(--line); }
.gb-others-k { margin: 10px 0 2px; }
.gb-off { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.gb-off.held { padding-inline: 10px; border-radius: 10px; background: var(--blush); }
.gb-off-main { flex: 1 1 260px; min-width: 0; }
.gb-off-who { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.gb-off-who .muted { font-weight: 500; }
.gb-off-fit { margin-top: 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.gb-off-side { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-inline-start: auto; }
.gb-off-price { font-weight: 700; white-space: nowrap; color: var(--ink); }
.gb-off .rel-form { flex-basis: 100%; }
.gb-foot { margin-top: 6px; font-size: 11.5px; }

/* Admin → Admins: the stricter-standard countries (chips with remove, a dashed "+ Add country" that becomes a box). */
.at-strict { flex: 2 1 320px; min-width: 0; margin: 0; }
.sc-body { padding: 0 22px 18px; }
.sc-chips { margin-top: 0; align-items: center; }
.chip.sc-chip { display: inline-flex; align-items: center; gap: 4px; cursor: default; padding-inline-end: 5px; white-space: nowrap; max-width: 100%; }
.chip.sc-chip > bdi { min-width: 0; overflow: hidden; text-overflow: ellipsis; } /* a long name: cut with "…", whole in its title */
.sc-x { border: 0; background: transparent; color: var(--ink-3); cursor: pointer; font: inherit; font-size: 12px; line-height: 1; padding: 5px 6px; border-radius: 6px; }
.sc-x:hover, .sc-x:focus-visible { background: var(--blush); color: var(--brand-text-deep); outline: none; }
.chip.sc-chip.on .sc-x { color: inherit; }
.sc-chips .chip-input { width: 220px; }
.sc-meta, .sc-empty { margin: 10px 0 0; }

@media (max-width: 560px) {
  .ap-item { padding-inline: 16px; }
  .ap-none { margin-inline: 16px; }
  .ap-price { margin-inline-start: 0; }
  .ap-acts .btn { flex: 1 1 auto; }
  .tile.gb-lb { padding: 14px; }
  .gb-off-side { width: 100%; margin-inline-start: 0; justify-content: space-between; }
  .sc-body { padding-inline: 16px; }
  .sc-chips .chip-input { width: 100%; }
}
/* ---- Supplies (Part 1) ---- */
/* A line's type select and its item box share the first row of the line (medicine lines too, while supplies are on). */
.sp-head { display: flex; gap: 6px; align-items: stretch; min-width: 0; }
.sp-head .drug { flex: 1 1 auto; min-width: 0; }
.sp-type { flex: 0 0 auto; width: auto; max-width: 9.5rem; padding-inline: 8px 4px; }
.li-row .sp-type.inp { padding-block: 8px; padding-inline: 8px 4px; }
/* A supplies line: its must-match specifications on a full-width row under the line. */
.sp-row .sp-specs { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: flex-end; }
.sp-row .sp-specbox { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: flex-end; min-width: 0; }
.sp-row .sp-specs:empty, .sp-row .sp-specbox:empty, .sp-row .sp-plus:empty { display: none; }
.sp-row .sp-plus { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 4px; }
.sp-f { display: inline-flex; flex-direction: column; gap: 3px; min-width: 0; }
.sp-f .inp { min-width: 6.5rem; }
/* One field-label style (the system's .fl): the spec labels, the section heads over chips, a machine's requirement names. */
.sp-l, .sp-k, .mc-reqk, .mc-req-l { font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; text-transform: uppercase; letter-spacing: .02em; color: var(--ink-3); }
html[dir="rtl"] .sp-l, html[dir="rtl"] .sp-k, html[dir="rtl"] .mc-reqk, html[dir="rtl"] .mc-req-l { letter-spacing: 0; }
.sp-spec[aria-invalid="true"], .sp-ol[aria-invalid="true"], .sp-ov[aria-invalid="true"], .sp-oname[aria-invalid="true"] { border-color: var(--danger-600); box-shadow: 0 0 0 3px rgba(200, 30, 40, .10); }
.sp-fixed .sp-chip { align-self: flex-start; }
.sp-unit { display: block; padding-top: 9px; color: var(--ink-3); font-size: 12.5px; }
.sp-unitc .inp { width: 100%; }
.sp-oname { margin-top: 0; }
.li-c.sp-off { visibility: hidden; }
.li-cc.sp-ccoff { visibility: hidden; }
.sp-row [hidden], .sp-cat-form [hidden], .sp-qform [hidden], .sp-qnotes [hidden], .pa-notes [hidden] { display: none !important; }
/* An Other item's free specifications (label · value · must-match tick · remove). */
.sp-orows { display: flex; flex-direction: column; gap: 6px; flex: 1 1 100%; }
.sp-orow { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sp-orow .sp-ol, .sp-orow .sp-ov { flex: 1 1 8rem; min-width: 0; }
.sp-om { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; white-space: nowrap; color: var(--ink-2); }
/* A spec row's own ✕ (not .row-rm: a narrow card pins .row-rm to the line's corner, over the line's own ✕) — in the row's flow. */
.sp-orm { position: static; width: 30px; height: 30px; margin: 0; margin-inline-start: auto; border-radius: 9px; border: none; background: none; color: var(--ink-3); cursor: pointer; flex: none; font-size: 14px; }
.sp-orm:hover { background: var(--blush); color: var(--brand-text-deep); }
.sp-oadd { font-size: 12.5px; }
/* Words of a supplies line: its short spec line, the chips the results head shows, units and live per-unit prices. */
.sp-line { color: var(--ink-3); margin-top: 2px; }
/* Chips never wrap: a long value is cut with "…" (whole in its title). */
.sp-chip, .sp-cert-chip { max-width: 100%; }
.sp-chip > bdi, .sp-cert-chip > bdi { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sp-asked { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: baseline; margin-top: 6px; }
.sp-k { margin-inline-end: 4px; }
.sp-kn { min-width: 0; overflow-wrap: anywhere; } /* what the short head means ("offers that fail are not shown") */
.sp-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.sp-asked > .sp-chips { flex-basis: 100%; min-width: 0; }
.sp-certs { display: inline-flex; flex-wrap: wrap; gap: 4px; vertical-align: middle; }
.sp-live { color: var(--green-deep); font-family: var(--font-mono); }
.sp-pack { white-space: nowrap; }
.opt-unit { font-family: var(--font-mono); font-size: 12px; margin-top: 2px; opacity: .85; }
.sp-sent > span:first-child { display: flex; flex-wrap: wrap; gap: 2px 6px; align-items: center; }
.sp-sent .sp-line { flex-basis: 100%; }
/* Certificates the supplier states: toggle chips (pressed = ink fill, dark in both modes). */
.sp-cert { font-size: 12px; padding: 4px 10px; }
.sp-cert[aria-pressed="true"] { background: var(--ink-fill); color: #fff; border-color: var(--ink-fill); }
.sp-cert:disabled { opacity: .45; cursor: not-allowed; }
.sp-certs-pick { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.sp-certrow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sp-certrow .muted { flex-basis: 100%; }
/* My Catalog: the type chooser, the supplies form (spec controls as grid items), the import's type, the files. */
.sp-cattype { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 12px; }
.sp-cattype .cat-l { margin-inline-end: 6px; }
.sp-specgrid { display: contents; }
.sp-cat-form .sp-f.cat-f { display: block; }
.sp-cat-form .sp-f .sp-l { display: block; margin-bottom: 4px; }
.sp-cat-form .sp-live { display: block; margin-top: 4px; min-height: 1em; }
.sp-noexp { display: inline-flex; gap: 6px; align-items: center; }
.sp-importas { display: inline-flex; gap: 6px; align-items: center; }
.sp-importas .inp { width: auto; padding: 6px 8px; font-size: 13px; }
.sp-files { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; }
.sp-tblwrap { margin-top: 14px; }
.sp-tbl .sp-certs { margin-top: 3px; }
/* My Catalog's rows and form without inline styles: a row not offered (out of stock, expired) faded, the price per unit bold,
   the day it was updated in mono, the form's title flush, the file box and the read-only export row spaced. */
tr.cat-off { opacity: .55; }
.sp-tbl td.cat-pu { font-weight: 700; }
td.cat-upd { font-family: var(--font-mono); font-size: 11.5px; }
.cat-form-head .fl { margin: 0; }
.cat-file-in { max-width: 320px; }
.cat-export-ro { margin-top: 8px; }
.cat-tblwrap { margin-top: 14px; }
.sp-miss { cursor: pointer; border: none; font-family: inherit; margin-top: 3px; }
/* Requests (supplier): a supplies line's quote form and notes. */
.sp-qform { align-items: end; }
.sp-qform .sp-f { min-width: 6.5rem; }
.sp-qform .sp-rowpick { flex: 2 1 14rem; }
.sp-mustline { color: var(--ink-2); }
.sp-alsoline { color: var(--ink-3); }
.sp-qnotes .sp-certrow { margin-top: 6px; }
.sp-confirm { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.sp-ctick { display: inline-flex; gap: 6px; align-items: flex-start; }
.sp-gline .sp-line, .sp-xline .sp-line { flex-basis: 100%; }
/* Admin: the supplies list and the item editor. */
.sa-tools { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; padding: 0 22px 12px; }
.sa-list { display: grid; }
.sa-list > .empty-v3 { margin: 4px 22px 22px; }
.sa-item { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 12px 22px; border-top: 1px solid var(--line); }
.sa-item.off { opacity: .6; }
.sa-item-main { min-width: 0; display: grid; gap: 3px; }
.sa-item-name { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-weight: 600; }
.sa-item-acts { display: flex; gap: 6px; flex-wrap: wrap; flex: none; }
.sa-editor { margin: 10px 22px 16px; display: grid; gap: 12px; background: var(--paper); border: 1px solid var(--line); } /* an inset, not a second card */
.sa-row { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: flex-end; }
.sa-row > .mono-k { flex-basis: 100%; }
.sa-words .inp { flex: 1 1 10rem; min-width: 0; }
.sa-f { display: inline-flex; flex-direction: column; gap: 3px; min-width: 0; }
.sa-f .inp { min-width: 6rem; }
.sa-check { display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
.sa-spec { border: 1px solid var(--line); border-radius: var(--r-control); padding: 10px 12px; display: grid; gap: 8px; margin: 0; min-width: 0; }
.sa-spec legend { padding: 0 4px; }
.sa-vals { display: grid; gap: 6px; }
.sa-opt .sa-v { flex: 0 1 7rem; min-width: 0; }
.sa-opt .inp { flex: 1 1 7rem; min-width: 0; }
.an-bytype { margin-top: 14px; }
.an-bytype .tbl-wrap { padding: 0 22px 16px; }
/* Values with units or temperatures keep their order in Arabic ("2–8 °C", "10×10 cm", "200 for $12.00"). */
.sp-chip bdi, .sp-line bdi, .sp-cert-chip bdi { unicode-bidi: isolate; }
html[dir="rtl"] .sp-pack, html[dir="rtl"] .opt-unit bdi { unicode-bidi: isolate; }
@container lic (max-width: 620px) {
  .sp-row .sp-specs { grid-column: 1 / -1; padding-inline: 26px 0; }
  .li-cc.sp-ccoff { display: none; }
  .sp-head { flex-wrap: wrap; }
  .sp-type { max-width: none; }
}
@container lic (max-width: 460px) {
  .sp-row .sp-specs { padding-inline: 0; }
  .sp-row .sp-specbox { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .sp-f .inp { min-width: 0; width: 100%; }
}
@media (max-width: 560px) {
  .sp-qform .sp-f, .sp-qform .sp-rowpick { flex: 1 1 100%; }
  .sa-item { flex-direction: column; padding: 12px 16px; }
  .sa-tools { padding-inline: 16px; }
  .sa-list > .empty-v3 { margin-inline: 16px; }
  .sa-editor { margin-inline: 12px; }
  .sa-words .inp, .sa-opt .inp { flex-basis: 100%; }
  .sp-cattype .chip { flex: 1 1 auto; }
  .sp-files { flex-direction: column; }
}
/* ---- Supplies (Part 2) ---- */
/* A request line's preferences (condition, warranty, material weight, tests a day, choices): beside its specs. The specs row
   stays out of the line's grid while nothing in it shows (its Part 2 parts are there, hidden, on every supplies line). */
.sp-row .sp-specs:not(:has(> :not([hidden]):not(:empty))) { display: none; }
.sp-row .sp-prefbox { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: flex-end; min-width: 0; }
.sp-pref[aria-invalid="true"], .sp-opref[aria-invalid="true"], .sp-sn[aria-invalid="true"], .sp-sizeq .inp[aria-invalid="true"] { border-color: var(--danger-600); box-shadow: 0 0 0 3px rgba(200, 30, 40, .10); }
.sp-pf .sp-hint { max-width: 16rem; line-height: 1.35; }
.sp-pf input[type="number"].sp-pref { max-width: 8rem; }
/* "Add sizes" (textiles): a quantity per size, four to a row (two on a narrow line), then Add lines · Cancel. */
.sp-addsizes { font-size: 12.5px; align-self: center; }
.sp-row .sp-sizes { flex-basis: 100%; }
/* The inset boxes inside a card (the system's check-in box / .xrow-inset): paper, a 1px line, 14px radius. */
.sp-row .sp-sizes, .sp-snbox, .eq-report { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.sp-snbox { padding: 16px; }
.sp-sizes-in { display: grid; gap: 8px; }
.sp-sizegrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px 10px; }
.sp-sizeq { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 12px; color: var(--ink-2); }
.sp-sizeq .inp { width: 100%; min-width: 0; }
.sp-sizes-foot { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.sp-sizesn { color: var(--ink-3); margin-inline-end: auto; }
/* The supplier's offer fields: grid items of the catalog form (like the spec controls), read-only text on a quote. */
#sup-oprefs { display: contents; }
.sp-cat-form .sp-of { display: block; }
.sp-of .sp-ro { display: block; padding-top: 8px; font-size: 13px; color: var(--ink-2); }
.sp-qform .sp-of-ro { display: inline-flex; flex-direction: column; gap: 3px; }
/* A cost-basis offer (the glucometer): its 1-year cost first, the meter and strips under it; the cheap-meter note. */
.notice.sp-costnote { margin: 8px 0 0; }
/* What an offer states and the warranty of an order line. */
.sp-ometa, .sp-warranty, .sp-sncoming { flex-basis: 100%; }
.sp-warranty { color: var(--ink-2); }
.sp-prefline { color: var(--ink-2); }
/* Serial numbers: the panel before dispatch (a box per line, the live count), the folded list, the correction. */
.sp-snbox { margin-top: 10px; display: grid; gap: 10px; }
.sp-snbox[hidden], .sp-snfix[hidden] { display: none !important; }
.sp-sn-t { font-weight: 700; }
.sp-snline { display: grid; gap: 4px; }
.sp-snl { color: var(--ink-2); }
.sp-sn { min-height: 6rem; width: 100%; resize: vertical; font-family: var(--font-mono); font-size: 12.5px; direction: ltr; text-align: left; unicode-bidi: plaintext; }
.pv.sp-sncount { justify-self: start; display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; } /* paper · mint (all there) · amber (a problem) */
.sp-snnone { line-height: 1.4; }
.sp-snacts { display: flex; flex-wrap: wrap; gap: 6px; }
.sp-snfix { display: grid; gap: 6px; margin-top: 6px; }
.sp-serials { flex-basis: 100%; margin-top: 4px; font-size: 12.5px; }
.sp-serials > summary { cursor: pointer; color: var(--brand-text); font-weight: 600; width: fit-content; }
.sp-serials > summary:focus-visible { outline: 2px solid var(--brand-text); outline-offset: 2px; border-radius: 4px; }
.sp-serials ol { margin: 6px 0 0; padding-inline-start: 2.2em; font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); }
.sp-serials li bdi, .sp-sn-of bdi { unicode-bidi: isolate; }
@media (min-width: 620px) { .sp-serials ol { columns: 2; column-gap: 24px; } }
.cp-field[hidden] { display: none; }
.sp-checkin { margin: 6px 0 0; color: var(--ink-2); }
/* My equipment: one block per order line (its item, model, supplier, delivery, order) and a row per unit. */
.eq-card { display: grid; gap: 10px; container: eq / inline-size; } /* the unit rows follow the card's own width */
.eq-note { margin: 0 22px; }
.eq-card > .chips { padding: 0 22px; }
.eq-list { display: grid; }
.eq-list > .empty-v3 { margin: 4px 22px 22px; }
.eq-line { padding: 12px 22px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.eq-head { display: grid; gap: 2px; min-width: 0; }
.eq-name { font-weight: 700; }
.eq-meta { display: flex; flex-wrap: wrap; gap: 2px 4px; align-items: center; }
.eq-meta .linkbtn { padding: 0; }
.eq-unit-wrap { display: grid; gap: 8px; }
/* A unit's row: two columns by default (serial · Report; the warranty words; the pills) — four only once the card is wide
   enough for them all (the pills and the button never shrink below their words: the button is never cut off). */
.eq-unit { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 6px 0; border-top: 1px dashed var(--line); }
.eq-w, .eq-pills { grid-column: 1 / -1; }
.eq-act { grid-column: 2; grid-row: 1; justify-self: end; }
@container eq (min-width: 760px) {
  /* the serial and warranty columns give way first (they wrap), so the pills and Report always keep their words */
  .eq-unit { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto auto; }
  .eq-w, .eq-pills, .eq-act { grid-column: auto; grid-row: auto; }
}
.eq-pills .pv { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; } /* never wider than the row */
.eq-sn { display: inline-flex; gap: 6px; align-items: center; background: none; border: none; padding: 0; color: var(--ink); cursor: pointer; font: inherit; text-align: start; min-width: 0; }
.eq-sn .mono { overflow-wrap: anywhere; }
.eq-sn .xrow-chev { display: inline-grid; place-items: center; width: 18px; }
.eq-pills { display: inline-flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; min-width: 0; }
.eq-cp { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.eq-tiles { grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 8px; }
.eq-tiles .tile { padding: 16px; }
.eq-tile-v { margin-top: 6px; font-family: var(--font-display); font-size: 19px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; overflow-wrap: anywhere; }
.eq-tile-v.mono { font-family: var(--font-mono); font-size: 15px; font-weight: 500; letter-spacing: 0; } /* the serial number */
html[dir="rtl"] .eq-tile-v { letter-spacing: 0; }
.eq-tile-v bdi { unicode-bidi: isolate; }
/* Admin: a textile item's choices (material, colour…) — fieldsets like the must-match specs'. */
.sa-choice { border: 1px solid var(--line); border-radius: var(--r-control); padding: 10px 12px; display: grid; gap: 8px; margin: 0; min-width: 0; }
.sa-choice legend { padding: 0 4px; }
.sa-copt .sa-v { flex: 0 1 7rem; min-width: 0; }
.sa-copt .inp { flex: 1 1 7rem; min-width: 0; }
.sa-p2 .sa-cost { min-width: 10rem; }
.sa-foot { padding: 12px 22px 16px; border-top: 1px solid var(--line); }
.eq-sn-of { color: var(--ink-2); }
@media (max-width: 560px) {
  .eq-line { padding: 12px 16px; }
  .eq-card > .list-head { padding-inline: 16px; }
  .eq-card > .empty-v3, .eq-list > .empty-v3 { margin-inline: 16px; }
  .eq-note, .eq-card > .chips { margin-inline: 0; padding-inline: 16px; }
}
@container lic (max-width: 460px) {
  .sp-sizegrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sp-row .sp-prefbox { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .sp-pf input[type="number"].sp-pref { max-width: none; }
}
/* ---- Supplies (Part 3) ---- */
/* Big machines: the request's requirement box, the results (state words, the use bar, the label cards, the sticker note,
   the side-by-side table — its row names stay while it scrolls sideways on a phone), the questions, the confirm cards, the
   payments by step, the supplier's machine form and quote, the admin's requirement editor and Letters. Card tokens only (no
   --ink background: dark mode), logical properties (Arabic). */
.mc-go::after { content: ' →'; }
[dir="rtl"] .mc-go::after { content: ' ←'; }
.sp-row .sp-reqbox { flex-basis: 100%; min-width: 0; }
.sp-row .sp-reqbox[hidden], .mc-why[hidden], .mc-win[hidden] { display: none; }
/* The inset boxes inside a card (the system's check-in box / .xrow-inset): paper, a 1px line, 14px radius. */
.mc-reqs, .mc-pays, .mc-answers, .mp-card { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.mc-reqs { display: grid; gap: 8px; }
.mc-reqn { margin-top: -6px; } /* what "Must have" / "Preferences" mean, under the head */
.mc-reqgrid { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: flex-end; }
.mc-req { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 12.5px; color: var(--ink-2); }
.mc-req-yes { flex-direction: row; align-items: center; gap: 4px; }
.mc-req-in { display: inline-flex; align-items: center; gap: 6px; }
.mc-req-in .inp { max-width: 7rem; }
.mc-own { display: grid; gap: 6px; }
.mc-ownrows { display: grid; gap: 6px; }
.mc-ownrow { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.mc-ownrow .mc-ownl { flex: 1 1 14rem; min-width: 0; }
.mc-ownm { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; }
.mc-always { line-height: 1.4; }
.mc-win { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 12.5px; }
.mc-win .inp { width: auto; }
.mc-why .note { margin: 6px 0 0; font-size: 13px; line-height: 1.45; }
.mc-line { display: grid; gap: 12px; margin-top: 14px; }
.mc-head { display: grid; gap: 4px; }
.mc-head .rfq { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); }
.mc-state .mc-btns, .mc-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.mc-usebar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 12px 16px; }
.mc-usebar .chips { margin-top: 0; }
.mc-usebar .mc-useother { display: inline-flex; gap: 6px; align-items: center; }
.mc-usebar .mc-useother[hidden] { display: none; }
.mc-usebar .mc-useother .inp { width: 6rem; }
.mc-labs { margin: 0; }
div.opt.mc-lab { cursor: default; } /* a login that can't choose: the cards inform only */
.mc-sticker { margin: 0; }
.mc-side .mc-scroll { margin-top: 10px; }
.mc-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* The side-by-side table on the system table (.tbl): mono row names; the chosen column on paper with the brand bar on top
   (green is for verified / paid / delivered only); a greyed column only faded. */
.mc-cmp { border-collapse: separate; border-spacing: 0; font-size: 12.5px; min-width: 100%; }
.mc-cmp th, .mc-cmp td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; white-space: nowrap; }
.mc-cmp th.col { min-width: 9rem; font-family: var(--font-ui); font-size: 12.5px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--ink-3); white-space: normal; }
.mc-cmp th.lbl, .mc-cmp td.lbl { position: sticky; inset-inline-start: 0; background: var(--card); z-index: 1; }
.mc-cmp td.lbl { font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; text-transform: uppercase; letter-spacing: .02em; color: var(--ink-3); white-space: normal; min-width: 8rem; max-width: 12rem; }
html[dir="rtl"] .mc-cmp td.lbl { letter-spacing: 0; }
.mc-cmp tr.sum td { font-size: 13.5px; border-top: 2px solid var(--line-2); }
.mc-cmp .excol { opacity: .55; background: transparent; }
.mc-cmp .selcol { background: var(--paper); }
.mc-cmp th.selcol { box-shadow: inset 0 3px 0 var(--brand); }
.mc-cmp td .no, .mc-cmp .no { color: var(--brand-text-deep); }
.mc-cmp .soft, .mc-split.short { color: var(--amber); }
.mc-cmp .excol .small { white-space: normal; display: block; max-width: 12rem; }
.mc-cmp bdi { unicode-bidi: isolate; }
.mc-greypill { margin-bottom: 2px; }
.mc-legend { margin: 8px 0 0; }
.qa { border-top: 1px solid var(--line); padding: 10px 0; font-size: 13px; }
.qa:first-child { border-top: 0; }
.qa .q { font-weight: 600; }
.qa .a { color: var(--ink-2); margin-top: 3px; padding-inline-start: 10px; border-inline-start: 2px solid var(--line-2); }
.ask { display: flex; gap: 8px; margin-top: 10px; }
.ask .inp { flex: 1; min-width: 0; }
.mc-ext { display: grid; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.mc-ext-row { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: flex-end; }
.mc-ext-row .inp { width: auto; flex: 1 1 12rem; min-width: 0; }
.mc-ext-row select.inp { flex: 0 0 auto; }
.mc-ext-row .sa-f.wide { flex: 1 1 14rem; }
.mc-ext-row .sa-f .fl { margin-bottom: 0; }
.mc-confirm { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 12px; }
.mc-confirm .card { margin: 0; }
.mc-confirm .card-sub { margin: 3px 0 4px; }
.mc-pick { margin-top: 10px; overflow-wrap: anywhere; }
/* "Your choice": the system's tiles (a mono key over a Bricolage figure) on paper. */
.mc-reg { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); gap: 8px; margin: 10px 0; }
.mc-reg .tile { padding: 14px 16px; border-radius: 16px; background: var(--paper); }
.mc-reg .tile-v { font-size: 24px; margin-top: 6px; overflow-wrap: anywhere; }
.mc-plan { margin: 6px 0 0; padding-inline-start: 0; list-style: none; line-height: 1.6; } /* the row text says its own number */
.mc-tick { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0; font-size: 13px; }
.mc-confirm .fl { margin-top: 12px; }
.mc-pays { display: grid; gap: 6px; margin-top: 10px; }
.mc-pays-k { font-weight: 700; font-size: 12.5px; }
.mc-pay { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 12.5px; }
.mc-pay .mc-pay-t { flex: 1 1 16rem; min-width: 0; }
.mc-pay-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mc-pay-form[hidden] { display: none; }
.mc-pay-form .inp { width: auto; flex: 1 1 10rem; min-width: 0; }
/* The supplier's machine form, its table and the quote form. */
.mc-cat-form .mc-files { display: grid; gap: 8px; grid-column: 1 / -1; }
.mc-file { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 12.5px; }
.mc-file .mc-fstate { color: var(--ink-3); }
.mc-file .mc-fstate.bad { color: var(--brand-text-deep); }
.mc-answers { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: flex-end; }
.mc-answers .mc-reqk { flex-basis: 100%; }
.mc-qform { display: grid; gap: 8px; margin-top: 8px; }
.mc-qrow { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: flex-end; }
.mc-qrow .inp { width: auto; max-width: 9rem; }
.mc-ro { font-size: 12.5px; color: var(--ink-2); }
.mc-splitrows { display: grid; gap: 6px; }
.mc-splitrow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mc-splitrow .inp { width: auto; }
.mc-splitsum.bad { color: var(--brand-text-deep); font-weight: 600; }
.mc-splitrow .inp.mcs-pct { width: 5.5rem; }
.notice.mc-fails { margin: 6px 0 0; }
.mc-left { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); }
.mc-extended { margin-top: 6px; color: var(--amber); font-size: 12.5px; font-weight: 600; }
.mc-qrules { font-size: 12.5px; color: var(--ink-3); }
.mc-cat-form [hidden] { display: none !important; } /* a class display (.cat-f, .mc-answers) would beat the UA [hidden] rule */
/* The admin's requirement editor and Letters. */
.sa-basics { display: contents; }
.sa-basics[hidden] { display: none; }
.sa3-reqs { display: grid; gap: 8px; }
.sa3-req { border: 1px solid var(--line); border-radius: var(--r-control); padding: 10px 12px; display: grid; gap: 8px; margin: 0; min-width: 0; }
.sa3-row { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: flex-end; }
.sa3-row .inp { flex: 1 1 8rem; min-width: 0; width: auto; }
.sa3-letters { display: grid; gap: 0; }
.sa3-letter { display: grid; gap: 4px; padding: 12px 22px; border-top: 1px solid var(--line); }
.sa3-letter .sa3-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sa3-replaces { color: var(--amber); font-weight: 600; }
.sa3-letters > .empty-v3 { margin: 4px 22px 22px; }
@media (max-width: 560px) {
  .sa3-letters > .empty-v3 { margin-inline: 16px; }
  .mc-cmp th.col { min-width: 8rem; }
  .mc-cmp td.lbl { min-width: 6.5rem; max-width: 8rem; }
  .sa3-letter { padding: 12px 16px; }
}
/* Wave 2 (after the order): the delivery project (both sides), the service record cell, the reagents link, My equipment's machine
   unit (its breakdown and service visits), the supplier's Service list, the admin's machine figures. */
.mp-box { margin-top: 12px; }
.mp-card { padding: 16px; } /* the inset box (paper, line, 14px radius — with .mc-reqs above) */
.mp-card .mp-title { font-family: var(--font-display); font-size: 18px; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; margin: 0; color: var(--ink); }
html[dir="rtl"] .mp-card .mp-title { letter-spacing: 0; }
.mp-card .card-sub { margin: 2px 0 8px; }
/* The six steps on the order tracker's own markup and colours (.vt: done = ink ✓, current = red with the blush halo, next = outline). */
.mp-steps { margin-top: 12px; }
.mp-when, .mp-marked, .mp-files { margin-top: 4px; }
.mp-when { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
/* A payment at its step: its amount, then its state as a pill (waits · due · sent · received). */
.mp-pay { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 4px; font-size: 12.5px; color: var(--ink-2); }
.mp-act { margin-top: 6px; }
.mp-act .mp-panel[hidden] { display: none; }
.mp-count { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; margin-top: 6px; }
.mp-count .inp { width: 6rem; }
.mp-late { margin: 0 0 8px; font-size: 12.5px; }
.mp-done { margin: 10px 0 8px; }
.mp-brief { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mp-sup { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 10px; }
.mp-spanel { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; flex-basis: 100%; }
.mp-spanel[hidden] { display: none; }
.mp-spanel .inp { flex: 1 1 12rem; min-width: 0; width: auto; }
.mp-file { position: relative; overflow: hidden; cursor: pointer; }
.mp-file .mp-file-in { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.mc-cmp .mc-service { white-space: normal; display: block; max-width: 14rem; }
.mc-forunit { color: var(--ink-2); }
.sp-forunitf .inp { max-width: 100%; }
.notice.eq-break { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin: 4px 0 6px; }
.eq-break .eq-break-t { flex: 1 1 16rem; min-width: 0; }
.eq-visits { display: grid; gap: 6px; margin: 8px 0; }
.eq-visits-t { font-size: 12.5px; font-weight: 700; }
.eq-visit { border-top: 1px solid var(--line); padding-top: 6px; display: grid; gap: 3px; }
.eq-visit-row { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; font-size: 12.5px; }
.eq-visit-t { flex: 1 1 14rem; min-width: 0; }
.eq-vacts { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.eq-vnote { color: var(--ink-2); }
.sv-list { display: grid; }
.sv-unit { display: grid; gap: 4px; padding: 12px 22px; border-top: 1px solid var(--line); min-width: 0; }
.sv-head { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.sv-facts { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; color: var(--ink-2); }
.sv-break { margin: 2px 0; }
.sv-wait { color: var(--amber); font-weight: 600; }
.sv-unit > .btn { justify-self: start; }
.sv-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 8px 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-control); background: var(--paper); }
.sv-form[hidden] { display: none; }
.sv-f { display: grid; gap: 3px; font-size: 12.5px; min-width: 0; }
.sv-f .fl { margin-bottom: 0; }
.sv-f .inp { width: 100%; min-width: 0; }
.sv-wide, .sv-tick, .sv-acts { grid-column: 1 / -1; }
.sv-tick { display: flex; gap: 6px; align-items: center; font-size: 12.5px; }
.sv-acts { display: flex; flex-wrap: wrap; gap: 6px; }
/* The admin's "Big machines" card: stat tiles (Bricolage figures), then the suppliers as a table. */
.an-machines .an-mtiles { padding: 0 22px 14px; }
.an-machines .an-mtiles .tile { padding: 16px; }
.an-machines .an-mtiles .tile-v { font-size: 26px; }
.an-machines .tbl-wrap { padding: 0 22px 16px; }
@media (max-width: 560px) {
  .sv-unit { padding: 12px 16px; }
  .an-machines .an-mtiles, .an-machines .tbl-wrap { padding-inline: 16px; }
  .mp-card { padding: 14px; }
}
