/* MedWasteAfrica PRO — design system.
   One stylesheet, no framework: the app must load from a cold cache over a 2G
   link and render correctly on a 5-inch Android phone and a 27-inch desk monitor. */

:root {
  color-scheme: light dark;

  --brand: #0E6B5C;        /* clinical green — trustworthy, not alarming */
  --brand-700: #0A5447;
  --brand-300: #46A392;
  --brand-tint: #E6F2EF;

  --ink: #10201C;
  --ink-2: #41534E;
  --ink-3: #6B7F79;
  --line: #D7E2DE;
  --line-2: #EAF1EE;
  --bg: #F6F8F7;
  --surface: #FFFFFF;
  --surface-2: #FBFCFC;

  --crit: #B3261E;
  --crit-tint: #FCEBEA;
  --high: #C2600B;
  --high-tint: #FDF0E3;
  --med: #A1820B;
  --med-tint: #FBF5E0;
  --ok: #0E7A4F;
  --ok-tint: #E4F4EC;
  --info: #255C9C;
  --info-tint: #E8F0F9;

  --r-sm: 6px; --r: 10px; --r-lg: 14px; --r-xl: 20px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px;
  --shadow-1: 0 1px 2px rgba(16,32,28,.06), 0 1px 3px rgba(16,32,28,.04);
  --shadow-2: 0 4px 12px rgba(16,32,28,.08), 0 1px 3px rgba(16,32,28,.06);
  --shadow-3: 0 12px 32px rgba(16,32,28,.14);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --nav-w: 240px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #3FA38F; --brand-700: #2C8B78; --brand-300: #6FC3B1; --brand-tint: #16302B;
    --ink: #E8F0ED; --ink-2: #AFC2BC; --ink-3: #859993;
    --line: #273833; --line-2: #1E2D29;
    --bg: #0D1715; --surface: #14211E; --surface-2: #192824;
    --crit: #F2857C; --crit-tint: #351A18; --high: #E8A05A; --high-tint: #32220F;
    --med: #D9C166; --med-tint: #2C2711; --ok: #5CC28D; --ok-tint: #10291E;
    --info: #78AEE8; --info-tint: #121E2C;
    --shadow-1: 0 1px 2px rgba(0,0,0,.4); --shadow-2: 0 4px 14px rgba(0,0,0,.45);
    --shadow-3: 0 14px 36px rgba(0,0,0,.55);
  }
}
:root[data-theme="dark"] {
  --brand: #3FA38F; --brand-700: #2C8B78; --brand-300: #6FC3B1; --brand-tint: #16302B;
  --ink: #E8F0ED; --ink-2: #AFC2BC; --ink-3: #859993;
  --line: #273833; --line-2: #1E2D29;
  --bg: #0D1715; --surface: #14211E; --surface-2: #192824;
  --crit: #F2857C; --crit-tint: #351A18; --high: #E8A05A; --high-tint: #32220F;
  --med: #D9C166; --med-tint: #2C2711; --ok: #5CC28D; --ok-tint: #10291E;
  --info: #78AEE8; --info-tint: #121E2C;
}

* { box-sizing: border-box; }
/* `hidden` must beat any display we set on an element — the boot splash sets
   display:grid, which would otherwise keep it on screen after startup. */
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; line-height: 1.25; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
p { margin: 0 0 var(--sp-3); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
small { font-size: .8125rem; }
code, .mono { font-family: var(--mono); font-size: .9em; }
:focus-visible { outline: 2.5px solid var(--brand-300); outline-offset: 2px; border-radius: 4px; }

/* ── boot ───────────────────────────────────────────────────────────────── */
.boot { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: var(--sp-4); color: var(--brand); }
.boot p { color: var(--ink-3); font-size: .9rem; }
.boot__mark { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: .45; transform: scale(.97); } 50% { opacity: 1; transform: scale(1); } }

/* ── shell ──────────────────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--nav-w) 1fr; min-height: 100dvh; }
.nav {
  background: var(--surface); border-inline-end: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh;
}
.nav__brand { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-4); color: var(--brand); }
.nav__brand strong { color: var(--ink); font-size: .95rem; letter-spacing: -.02em; display: block; }
.nav__brand span { color: var(--ink-3); font-size: .7rem; letter-spacing: .09em; text-transform: uppercase; }
.nav__items { flex: 1; overflow-y: auto; padding: var(--sp-2); display: flex; flex-direction: column; gap: 2px; }
.nav__group { margin-top: var(--sp-2); padding: var(--sp-3) var(--sp-3) var(--sp-1); border-top: 1px solid var(--line); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); font-weight: 800; }
.nav__items > .nav__group:first-child { margin-top: 0; border-top: 0; }
.nav__item {
  display: flex; align-items: center; gap: var(--sp-3); padding: 9px var(--sp-3);
  border-radius: var(--r); color: var(--ink-2); font-weight: 500; font-size: .9rem;
  border: 0; background: none; width: 100%; cursor: pointer; text-align: left; font-family: inherit;
}
.nav__item:hover { background: var(--line-2); color: var(--ink); text-decoration: none; }
.nav__item[aria-current="page"] { background: var(--brand-tint); color: var(--brand-700); font-weight: 600; }
.nav__item svg { width: 19px; height: 19px; flex: none; }
.nav__item .pill { margin-inline-start: auto; }
.nav__foot { border-top: 1px solid var(--line); padding: var(--sp-3); display: grid; gap: var(--sp-2); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5); background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line);
}
.topbar h1 { flex: 1; font-size: 1.1rem; }
.accessbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3);
  padding: 6px var(--sp-5); font-size: .8rem; color: var(--ink-2);
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.accessbar:empty { display: none; }
.accessbar svg { width: 16px; height: 16px; flex: none; color: var(--brand); }
.accessbar__who, .accessbar__scope { min-width: 0; }
.accessbar__link { margin-inline-start: auto; font-weight: 600; white-space: nowrap; }
.demo-account { flex-direction: column; align-items: flex-start !important; text-align: start; gap: 2px; white-space: normal; height: auto; padding-block: 8px; }
.demo-account__role { font-weight: 600; }
.demo-account small { font-size: .74rem; font-weight: 400; }
.access-yes { color: var(--ok); font-weight: 700; }
.access-no { color: var(--ink-3, var(--ink-2)); }
.content { padding: var(--sp-5); max-width: 1320px; width: 100%; }
.content > * + * { margin-top: var(--sp-5); }

/* ── primitives ─────────────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.card__head { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-4) var(--sp-4) 0; }
.card__head h2, .card__head h3 { flex: 1; }
.card__body { padding: var(--sp-4); }
.card__body > * + * { margin-top: var(--sp-3); }
.card--flush .card__body { padding: 0; }

.grid { display: grid; gap: var(--sp-4); }
.grid--kpi { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.row { display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; }
.row--end { justify-content: flex-end; }
.spacer { flex: 1; }
.muted { color: var(--ink-3); }
.strong { font-weight: 650; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  padding: 9px 15px; border-radius: var(--r); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: 600 .875rem/1.2 var(--font);
  cursor: pointer; transition: background .12s, border-color .12s, transform .06s;
  min-height: 40px; white-space: nowrap;
}
.btn:hover { background: var(--line-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; }
.btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-700); border-color: var(--brand-700); }
.btn--danger { background: var(--crit); border-color: var(--crit); color: #fff; }
.btn--danger:hover { filter: brightness(.93); }
.btn--ghost { background: none; border-color: transparent; }
.btn--ghost:hover { background: var(--line-2); }
.btn--sm { min-height: 32px; padding: 5px 11px; font-size: .8125rem; }
.btn--lg { min-height: 48px; padding: 12px 22px; font-size: .95rem; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn[aria-pressed="true"] { background: var(--brand-tint); border-color: var(--brand-300); color: var(--brand-700); }

.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px;
  font-size: .72rem; font-weight: 650; letter-spacing: .02em; background: var(--line-2); color: var(--ink-2);
  border: 1px solid transparent; white-space: nowrap;
}
.pill--crit { background: var(--crit-tint); color: var(--crit); }
.pill--high { background: var(--high-tint); color: var(--high); }
.pill--med  { background: var(--med-tint);  color: var(--med); }
.pill--ok   { background: var(--ok-tint);   color: var(--ok); }
.pill--info { background: var(--info-tint); color: var(--info); }
.pill--brand{ background: var(--brand-tint);color: var(--brand-700); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }

label { display: block; font-size: .8125rem; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
label .req { color: var(--crit); }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); color: var(--ink); font: 15px/1.4 var(--font); min-height: 42px;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand-300); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-300) 24%, transparent); }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--crit); }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; min-height: 0; accent-color: var(--brand); }
textarea { min-height: 84px; resize: vertical; }
.field { margin-bottom: var(--sp-4); }
.field__hint { font-size: .78rem; color: var(--ink-3); margin-top: 5px; }
.field__err { font-size: .78rem; color: var(--crit); margin-top: 5px; font-weight: 500; }
.field--inline { display: flex; align-items: center; gap: var(--sp-3); }
.field--inline label { margin: 0; }
fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: var(--sp-4); margin: 0 0 var(--sp-4); }
legend { font-size: .8125rem; font-weight: 650; padding: 0 6px; color: var(--ink-2); }

table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th, td { padding: 11px var(--sp-4); text-align: start; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
th { font-size: .72rem; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); font-weight: 650; background: var(--surface-2); position: sticky; top: 0; }
tbody tr:hover { background: var(--surface-2); }
td.num, th.num { text-align: end; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); }

/* ── KPI tile ───────────────────────────────────────────────────────────── */
.kpi { padding: var(--sp-4); }
.kpi__label { font-size: .75rem; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); font-weight: 650; }
.kpi__value { font-size: 1.75rem; font-weight: 680; letter-spacing: -.02em; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.kpi__value span { font-size: .9rem; font-weight: 600; color: var(--ink-3); margin-inline-start: 3px; }
.kpi__delta { font-size: .78rem; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.kpi__delta--good { color: var(--ok); } .kpi__delta--bad { color: var(--crit); } .kpi__delta--flat { color: var(--ink-3); }
.meter { height: 6px; border-radius: 999px; background: var(--line-2); overflow: hidden; margin-top: var(--sp-3); }
.meter > i { display: block; height: 100%; border-radius: 999px; background: var(--brand); }

/* ── recommendations ────────────────────────────────────────────────────── */
.rec { display: flex; gap: var(--sp-3); padding: var(--sp-4); border-bottom: 1px solid var(--line-2); }
.rec:last-child { border-bottom: 0; }
.rec__sev { inline-size: 4px; border-radius: 999px; flex: none; background: var(--ink-3); }
.rec--CRITICAL .rec__sev { background: var(--crit); } .rec--HIGH .rec__sev { background: var(--high); }
.rec--MEDIUM .rec__sev { background: var(--med); } .rec--LOW .rec__sev { background: var(--info); }
.rec__body { flex: 1; min-width: 0; }
.rec__title { font-weight: 640; margin-bottom: 3px; }
.rec__detail { font-size: .86rem; color: var(--ink-2); }
.rec__meta { display: flex; gap: var(--sp-2); align-items: center; margin-top: var(--sp-3); flex-wrap: wrap; }

.banner { display: flex; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-radius: var(--r); font-size: .875rem; align-items: flex-start; border: 1px solid transparent; }
.banner svg { width: 19px; height: 19px; flex: none; margin-top: 1px; }
.banner--crit { background: var(--crit-tint); color: var(--crit); border-color: color-mix(in srgb, var(--crit) 25%, transparent); }
.banner--warn { background: var(--high-tint); color: var(--high); border-color: color-mix(in srgb, var(--high) 25%, transparent); }
.banner--ok   { background: var(--ok-tint);   color: var(--ok);   border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.banner--info { background: var(--info-tint); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.banner strong { display: block; }

/* ── category swatches ─────────────────────────────────────────────────── */
.swatch { width: 11px; height: 11px; border-radius: 3px; flex: none; border: 1px solid rgba(0,0,0,.18); }
.cat { display: inline-flex; align-items: center; gap: 7px; font-size: .84rem; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: var(--sp-2); }
.cat-btn {
  display: flex; align-items: center; gap: var(--sp-2); padding: 11px var(--sp-3);
  border: 1.5px solid var(--line); border-radius: var(--r); background: var(--surface);
  cursor: pointer; font: 600 .84rem/1.2 var(--font); color: var(--ink); text-align: left; min-height: 48px;
}
.cat-btn:hover { border-color: var(--brand-300); }
.cat-btn[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-tint); box-shadow: inset 0 0 0 1px var(--brand); }

/* ── charts ─────────────────────────────────────────────────────────────── */
.chart { width: 100%; display: block; overflow: visible; }
.chart text { font: 10px var(--font); fill: var(--ink-3); }
.chart .grid-line { stroke: var(--line-2); stroke-width: 1; }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.legend { display: flex; flex-wrap: wrap; gap: var(--sp-3); font-size: .8rem; color: var(--ink-2); }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }

/* ── sync / offline ────────────────────────────────────────────────────── */
.sync { display: inline-flex; align-items: center; gap: 7px; font-size: .78rem; font-weight: 600; color: var(--ink-3); padding: 5px 10px; border-radius: 999px; background: var(--line-2); }
.sync svg { width: 15px; height: 15px; }
.sync--offline { background: var(--high-tint); color: var(--high); }
.sync--error { background: var(--crit-tint); color: var(--crit); }
.sync--ok { background: var(--ok-tint); color: var(--ok); }

/* ── auth ──────────────────────────────────────────────────────────────── */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: var(--sp-5); background:
  radial-gradient(1100px 520px at 12% -10%, var(--brand-tint), transparent 60%), var(--bg); }
.auth__card { width: 100%; max-width: 400px; }
.auth__brand { display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-5); color: var(--brand); text-align: center; }
.auth__brand h1 { color: var(--ink); font-size: 1.3rem; }
.auth__brand p { color: var(--ink-3); font-size: .85rem; margin: 0; }
.demo-accounts { font-size: .8rem; }
.demo-accounts button { font-family: var(--mono); font-size: .76rem; }
.demo-accounts button.demo-account { font-family: inherit; font-size: .82rem; width: 100%; min-width: 0; }
.demo-account > * { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.demo-account small.mono { font-family: var(--mono); }

/* ── misc ───────────────────────────────────────────────────────────────── */
.empty { padding: var(--sp-7) var(--sp-4); text-align: center; color: var(--ink-3); }
.empty svg { width: 36px; height: 36px; opacity: .45; margin-bottom: var(--sp-3); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.toast-host { position: fixed; inset-block-end: var(--sp-5); inset-inline: 0; display: grid; justify-items: center; gap: var(--sp-2); z-index: 100; pointer-events: none; padding: 0 var(--sp-4); }
.toast { background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 999px; font-size: .86rem; font-weight: 550; box-shadow: var(--shadow-3); animation: rise .22s ease; max-width: 540px; }
.toast--err { background: var(--crit); color: #fff; }
.toast--ok { background: var(--ok); color: #fff; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
dialog { border: 0; border-radius: var(--r-lg); padding: 0; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-3); max-width: min(560px, 94vw); width: 100%; }
dialog::backdrop { background: rgba(10,22,19,.55); backdrop-filter: blur(2px); }
.dialog__head { padding: var(--sp-4); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: var(--sp-3); }
.dialog__head h2 { flex: 1; font-size: 1.05rem; }
.dialog__body { padding: var(--sp-4); max-height: 68dvh; overflow-y: auto; }
.dialog__foot { padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--line); display: flex; gap: var(--sp-2); justify-content: flex-end; background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.prose { font-size: .92rem; line-height: 1.65; }
.prose h2 { font-size: 1.05rem; margin: var(--sp-5) 0 var(--sp-2); }
.prose table { margin: var(--sp-3) 0; font-size: .85rem; }
.prose code { background: var(--line-2); padding: 1px 5px; border-radius: 4px; }
.prose strong { color: var(--ink); }
.prose ul, .prose ol { padding-inline-start: 1.3em; margin: 0 0 var(--sp-3); }
.prose li { margin-bottom: 5px; }
.tabs { display: flex; gap: var(--sp-1); border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button {
  border: 0; background: none; padding: 10px var(--sp-4); font: 600 .875rem var(--font); color: var(--ink-3);
  cursor: pointer; border-bottom: 2.5px solid transparent; white-space: nowrap;
}
.tabs button[aria-selected="true"] { color: var(--brand-700); border-bottom-color: var(--brand); }
.stepper { display: flex; gap: var(--sp-2); align-items: center; font-size: .78rem; color: var(--ink-3); flex-wrap: wrap; }
.stepper b { color: var(--ink); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: var(--sp-3); padding: var(--sp-3) 0; border-bottom: 1px solid var(--line-2); font-size: .86rem; }
.timeline li:last-child { border: 0; }
.timeline time { color: var(--ink-3); font-size: .78rem; min-width: 118px; flex: none; font-variant-numeric: tabular-nums; }

/* ── responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .nav {
    position: fixed; inset-block: 0; inset-inline-start: 0; width: 260px; z-index: 60;
    transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-3);
  }
  :root.rtl .nav {
    transform: translateX(100%);
  }
  .nav[data-open="true"] { transform: none; }
  .nav-scrim { position: fixed; inset: 0; background: rgba(10,22,19,.45); z-index: 50; }
  .content { padding: var(--sp-4) var(--sp-4) var(--sp-7); }
  .topbar { padding: var(--sp-3) var(--sp-4); flex-wrap: wrap; row-gap: var(--sp-2); }
  .accessbar { padding: 6px var(--sp-4); }
  .accessbar__link { margin-inline-start: 0; }
  .topbar h1 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar select { min-width: 0 !important; max-width: 100% !important; flex: 1 1 140px; }
  .content > * + * { margin-top: var(--sp-4); }
  th, td { padding: 10px var(--sp-3); }
}
@media (min-width: 901px) { .nav-toggle, .nav-scrim { display: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print {
  .nav, .topbar, .accessbar, .btn, .toast-host { display: none !important; }
  .shell { grid-template-columns: 1fr; }
  .card { break-inside: avoid; box-shadow: none; }
}

/* ── right-to-left ──────────────────────────────────────────────────────── */
/* Arabic is not a translated left-to-right layout. The document direction
   flips, the stylesheet above uses logical properties throughout, and the few
   things that must stay left-to-right are pinned here. */

:root.rtl {
  /* Arabic carries more detail per glyph, so it reads better a touch larger,
     and it needs a font stack that actually has Arabic glyphs. */
  --font: "SF Arabic", "Geeza Pro", "Noto Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
  font-size: 16px;
}
:root.rtl body { letter-spacing: 0; }
:root.rtl h1, :root.rtl h2, :root.rtl h3, :root.rtl h4 { letter-spacing: 0; }

/* Charts, code, identifiers and machine-readable values stay left-to-right:
   a barcode payload or an axis of numbers reads the same in every language. */
:root.rtl .chart,
:root.rtl code,
:root.rtl .mono,
:root.rtl .code,
:root.rtl input[type="number"],
:root.rtl input[type="email"],
:root.rtl input[type="datetime-local"],
:root.rtl input[type="time"],
:root.rtl input[type="date"] { direction: ltr; }

/* Numeric table cells align to the inline end in both directions, but their
   digits run left-to-right. */
:root.rtl td.num, :root.rtl th.num { direction: ltr; text-align: end; }

/* A plain `✕` and the back arrow are directional glyphs; mirror the arrow. */
:root.rtl .btn--ghost[aria-label="Close"] { transform: none; }

/* Keep the severity bar on the reading-start side of a recommendation. */
:root.rtl .rec { flex-direction: row; }

/* The signature pad and photo strip read start-to-end like everything else. */
:root.rtl .toast { direction: rtl; }
