/* Waazn. One stylesheet for the public site, the personal app (/me), the business portal (/portal)
   and the staff console (/staff). Same family as the Kenja sign-in console: grey canvas, white cards,
   black sidebar, black pill buttons. Waazn adds a deep green accent and Arabic (right to left).
   Logical properties (inline/block) are used everywhere so [dir="rtl"] needs almost no overrides. */

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/static/fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
}
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("/static/fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E, U+2010-2011, U+204F, U+2E41; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("/static/fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E, U+2010-2011, U+204F, U+2E41; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("/static/fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E, U+2010-2011, U+204F, U+2E41; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("/static/fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2") format("woff2"); font-weight: 700 800; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E, U+2010-2011, U+204F, U+2E41; }

:root {
  --bg: #f2f2f2;
  --surface: #ffffff;
  --surface-2: #f6f7f8;
  --ink: #0b0d12;
  --ink-2: #3d4350;
  --ink-3: #5b6270;
  --line: #e6e8ec;
  --line-strong: #d5d9e0;
  --black: #050608;
  --on-black: rgba(255, 255, 255, 0.72);
  --edge-on-black: rgba(255, 255, 255, 0.22);
  --accent: #0a7a55;
  --accent-deep: #075c40;
  --accent-soft: #e2f4ec;
  --accent-text: #075c40;
  --on-accent: #ffffff;
  --amber-soft: #fdf2dc;
  --amber-text: #6b4600;
  --red: #d92d20;
  --red-soft: #fdecea;
  --red-text: #a3200f;
  --blue-soft: #e6efff;
  --blue-text: #0b5ee6;
  --focus: #0e68fd;
  --bar: #c9e9db;
  --font: "Plus Jakarta Sans", "IBM Plex Sans Arabic", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --sidebar: 256px;
  --radius: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d12; --surface: #15181f; --surface-2: #1b1f27; --ink: #f2f3f5; --ink-2: #c9cdd5; --ink-3: #a3a9b5;
    --line: #262a33; --line-strong: #353a45; --black: #000000;
    --accent: #2fb784; --accent-deep: #57cf9f; --accent-soft: #123327; --accent-text: #7fe0b8; --on-accent: #04140d;
    --amber-soft: #3a2c0c; --amber-text: #f3c86a; --red-soft: #3b1512; --red-text: #ff9b8f;
    --blue-soft: #10223f; --blue-text: #8fb8ff; --bar: #1f5e45; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0d12; --surface: #15181f; --surface-2: #1b1f27; --ink: #f2f3f5; --ink-2: #c9cdd5; --ink-3: #a3a9b5;
  --line: #262a33; --line-strong: #353a45; --black: #000000;
  --accent: #2fb784; --accent-deep: #57cf9f; --accent-soft: #123327; --accent-text: #7fe0b8; --on-accent: #04140d;
  --amber-soft: #3a2c0c; --amber-text: #f3c86a; --red-soft: #3b1512; --red-text: #ff9b8f;
  --blue-soft: #10223f; --blue-text: #8fb8ff; --bar: #1f5e45; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
html[lang="ar"] body { line-height: 1.7; }
body:has(.backdrop) { overflow: hidden; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p a, .prose a, .link { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 750; letter-spacing: -0.02em; line-height: 1.18; text-wrap: balance; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 { letter-spacing: 0; line-height: 1.35; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--ink-3); }
.small { font-size: 0.84rem; }
.tiny { font-size: 0.76rem; }
.mono { font-family: var(--mono); font-size: 0.84rem; overflow-wrap: anywhere; }
.num, .amount, td.n, th.n { font-variant-numeric: tabular-nums; }
.nw { white-space: nowrap; }
.strong { font-weight: 700; }
[dir="rtl"] .flip { transform: scaleX(-1); }
.ltr { direction: ltr; unicode-bidi: isolate; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-lg { display: flex; flex-direction: column; gap: 20px; }
.cluster { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.split { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 14px; }
@media (min-width: 1000px) { .grid-4 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }
.grid-4 > .kpi { container-type: inline-size; }
.grid-4 > .kpi .kpi-value { font-size: clamp(1.1rem, 13cqi, 1.6rem); }

/* Icons: icon(name) prints <svg class="i"><use href="/static/icons.svg#i-name"></use></svg>. */
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i-sm svg.i, svg.i.sm { width: 16px; height: 16px; }
[dir="rtl"] svg.i:has(use[href*="#i-chevron-right"]), [dir="rtl"] svg.i:has(use[href*="#i-chevron-left"]),
[dir="rtl"] svg.i:has(use[href*="#i-arrow-right"]), [dir="rtl"] svg.i:has(use[href*="#i-arrow-left"]),
[dir="rtl"] svg.i:has(use[href*="#i-arrow-up-right"]), [dir="rtl"] svg.i:has(use[href*="#i-signout"]) { transform: scaleX(-1); }

/* A thin bar for a page that takes more than a moment. */
.loading-bar {
  position: fixed; inset-block-start: 0; inset-inline: 0; z-index: 300; height: 2px; background: var(--accent);
  transform-origin: left; transform: scaleX(0); opacity: 0; pointer-events: none;
}
[dir="rtl"] .loading-bar { transform-origin: right; }
body.is-loading .loading-bar { opacity: 1; animation: load 0.9s var(--ease-out) forwards; }
@keyframes load { to { transform: scaleX(0.9); } }

/* ---------- Brand ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; letter-spacing: -0.01em; }
.logo-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--on-accent); flex: none; }
.logo-mark svg { width: 24px; height: auto; }
.logo-ar { font-weight: 600; color: var(--ink-3); font-size: 1rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px;
  border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font-size: 0.92rem; font-weight: 650; white-space: nowrap; cursor: pointer; text-decoration: none;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease), opacity 0.15s;
}
.btn:hover { border-color: var(--ink-3); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-accent:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn-danger { background: var(--red-soft); border-color: transparent; color: var(--red-text); }
.btn-danger:hover { border-color: var(--red-text); }
.btn-quiet { border-color: transparent; background: transparent; }
.btn-quiet:hover { background: var(--surface-2); border-color: transparent; }
.btn-sm { min-height: 34px; padding: 0 14px; font-size: 0.82rem; }
.btn-lg { min-height: 54px; padding: 0 26px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }
form[data-sending] .btn[type="submit"] { opacity: 0.6; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); cursor: pointer; flex: none;
}
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- Pills, chips, badges ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 0.76rem; font-weight: 700;
  background: var(--surface-2); color: var(--ink-2); white-space: nowrap;
}
.pill.ok { background: var(--accent-soft); color: var(--accent-text); }
.pill.warn { background: var(--amber-soft); color: var(--amber-text); }
.pill.bad { background: var(--red-soft); color: var(--red-text); }
.pill.info { background: var(--blue-soft); color: var(--blue-text); }
.pill.solid { background: var(--accent); color: var(--on-accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-size: 0.86rem; font-weight: 600; cursor: pointer;
}
.chip[aria-pressed="true"], .chip[aria-current="page"], .chip.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--accent); color: var(--on-accent); font-size: 0.7rem; font-weight: 800; font-variant-numeric: tabular-nums;
}
.avatar {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--surface);
  border: 1px solid var(--line); color: var(--ink); font-size: 0.82rem; font-weight: 800;
}

/* ---------- Cards and panels ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.card-lg { padding: 24px; }
.card h2, .card-title { font-size: 1rem; font-weight: 750; letter-spacing: -0.01em; }
.card-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; margin-block-end: 12px; }
.card-dark { background: var(--black); color: #fff; border-radius: 24px; padding: 20px; border: 1px solid var(--black); }
.card-dark .muted, .card-dark .sub { color: var(--on-black); }
.card-flat { background: var(--surface-2); border-radius: 16px; padding: 16px; }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }
.kv { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 8px 18px; margin: 0; }
.kv dt { color: var(--ink-3); font-size: 0.86rem; }
.kv dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }

/* Notices */
.flash, .notice {
  display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap;
  padding: 12px 16px; border-radius: 14px; font-size: 0.92rem; background: var(--accent-soft); color: var(--accent-text);
}
.flash.error, .notice.bad { background: var(--red-soft); color: var(--red-text); }
.notice.warn { background: var(--amber-soft); color: var(--amber-text); }
.notice.info { background: var(--blue-soft); color: var(--blue-text); }
.notice a { color: inherit; font-weight: 700; text-decoration: underline; }
.empty { display: flex; flex-direction: column; gap: 8px; align-items: center; text-align: center; padding: 36px 16px; color: var(--ink-3); }
.empty strong { color: var(--ink); font-size: 1rem; }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 0.86rem; font-weight: 650; color: var(--ink); }
.hint { font-size: 0.8rem; color: var(--ink-3); }
.error-text { font-size: 0.82rem; color: var(--red-text); font-weight: 600; }
.input, .select, .textarea, .field input:not([type="checkbox"]):not([type="radio"]), .field select, .field textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font-size: 0.95rem; outline: none;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
/* One height for every one-line control, so a date field (taller inner box in Chrome) lines up with the rest. */
.input, .select, .field input:not([type="checkbox"]):not([type="radio"]), .field select { height: 46px; }
.field textarea, .textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.field [aria-invalid="true"] { border-color: var(--red-text); }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 12px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 0.92rem; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.code-input { font-family: var(--mono); font-size: 1.4rem !important; letter-spacing: 0.4em; text-align: center; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.search { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-3); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 0.95rem; min-height: 44px; }
.search svg { width: 18px; height: 18px; flex: none; }
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); flex-wrap: wrap; }
.seg a, .seg button { min-height: 36px; padding: 0 16px; border-radius: 999px; border: 0; background: transparent; font-size: 0.84rem; font-weight: 650; color: var(--ink-2); display: inline-flex; align-items: center; cursor: pointer; }
.seg [aria-current="page"], .seg [aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* ---------- Lists (payments, bills, people) ---------- */
.list { display: flex; flex-direction: column; }
.list-head { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0 6px; font-size: 0.78rem; font-weight: 700; color: var(--ink-3); }
.list-head + .row { border-block-start: 0; }
.row {
  display: flex; align-items: center; gap: 12px; min-height: 60px; padding-block: 8px; border-block-start: 1px solid var(--line);
  color: var(--ink); min-width: 0;
}
a.row:hover .row-title { text-decoration: underline; text-underline-offset: 3px; }
.row:first-child { border-block-start: 0; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-title { font-size: 0.92rem; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { font-size: 0.78rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-end { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
.tile {
  width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center;
  font-size: 0.8rem; font-weight: 800; color: var(--ink);
}
.tile.warn { background: var(--amber-soft); color: var(--amber-text); }
.tile.ok { background: var(--accent-soft); color: var(--accent-text); }
.tile svg { width: 20px; height: 20px; }
.amount { font-weight: 750; white-space: nowrap; }
.amount.in { color: var(--accent-text); }
.amount.big { font-size: 1.15rem; }

/* Meters and charts. Geometry comes from views/charts.py as SVG attributes (no inline styles). */
svg.meter { width: 100%; height: 8px; border-radius: 999px; overflow: hidden; }
svg.meter .track { fill: var(--surface-2); }
svg.meter .fill { fill: var(--accent); }
svg.meter.warn .fill { fill: #d18b00; }
svg.meter.bad .fill { fill: var(--red); }
.card-dark svg.meter .track { fill: rgba(255, 255, 255, 0.16); }
.card-dark svg.meter .fill { fill: #2fb784; }
svg.chart { width: 100%; height: 180px; overflow: visible; }
svg.chart.short { height: 120px; }
svg.chart .bar { fill: var(--bar); }
svg.chart .bar.hi { fill: var(--accent); }
svg.chart .bar:hover { fill: var(--accent-deep); }
svg.chart .base { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
svg.chart .grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; vector-effect: non-scaling-stroke; }
svg.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
svg.chart .line.ghost { stroke: var(--ink-3); stroke-dasharray: 4 5; stroke-width: 2; }
svg.chart .dot { fill: var(--accent); }
svg.chart text { fill: var(--ink-3); font-size: 11px; font-family: var(--font); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.8rem; color: var(--ink-3); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; vertical-align: -1px; background: var(--accent); }
.legend i.ghost { background: transparent; border: 2px dashed var(--ink-3); }
.bar-axis { display: flex; justify-content: space-between; font-size: 0.74rem; color: var(--ink-3); }
.share { display: flex; flex-direction: column; gap: 5px; }
.share-top { display: flex; justify-content: space-between; gap: 10px; font-size: 0.9rem; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.table th { text-align: start; font-size: 0.74rem; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); padding: 12px 14px; border-block-end: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
html[lang="ar"] .table th { letter-spacing: 0; text-transform: none; font-size: 0.8rem; }
.table td { padding: 12px 14px; border-block-start: 1px solid var(--line); vertical-align: middle; }
.table tr:first-child td { border-block-start: 0; }
.table td.n, .table th.n { text-align: end; }
.table .cell-sub { display: block; margin-block-start: 2px; font-size: 0.8rem; color: var(--ink-3); }
.table tbody tr:hover td { background: var(--surface-2); }

/* KPI tiles */
.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi-label { font-size: 0.82rem; font-weight: 650; color: var(--ink-3); }
.kpi-value { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi-note { font-size: 0.78rem; font-weight: 600; color: var(--ink-3); }
.kpi-note.ok { color: var(--accent-text); }
.kpi-note.bad { color: var(--red-text); }

/* Code */
.code { margin: 0; padding: 14px 16px; border-radius: 14px; background: var(--black); color: #e8eaee; font-family: var(--mono); font-size: 0.8rem; line-height: 1.6; overflow-x: auto; white-space: pre; direction: ltr; text-align: left; }
.secret { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px dashed var(--line-strong); }
.secret code { font-family: var(--mono); font-size: 0.86rem; overflow-wrap: anywhere; flex: 1; min-width: 0; direction: ltr; }

/* Confirm dialog (a page with ?confirm=... renders one; Escape or Cancel goes back) */
.backdrop { position: fixed; inset: 0; z-index: 200; background: rgba(5, 6, 8, 0.48); display: grid; place-items: center; padding: 16px; }
.confirm { width: min(460px, 100%); background: var(--surface); border-radius: 22px; padding: 22px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3); }
.confirm h2 { font-size: 1.15rem; }

/* ---------- Kenja staff sign-in block (exact spec from the Kenja sign-in kit) ---------- */
.staff-door { display: flex; flex-direction: column; gap: 10px; }
.staff-door h2 { font-size: 14px; font-weight: 600; letter-spacing: 0; }
.staff-door p { font-size: 13px; color: var(--ink-3); text-align: center; }
.google-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 48px; padding: 0 20px;
  border-radius: 999px; background: #fff; border: 1px solid #d5d9e0; color: #0b0d12; font-size: 15px; font-weight: 600;
  text-decoration: none; transition: background-color .2s, border-color .2s;
}
.google-btn:hover { background: #f2f2f2; border-color: #b9bfca; }
.google-btn svg { width: 20px; height: 20px; flex: none; }

/* ---------- Auth pages (sign in, code, sign up) ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: min(440px, 100%); display: flex; flex-direction: column; gap: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 28px; }
.auth-card h1 { font-size: 1.6rem; }
.or { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 0.8rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* =====================================================================
   Shell 1: public site
   ===================================================================== */
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px)); }
@media (min-width: 700px) { .wrap { padding-inline: 24px; } }
.site-head { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-block-end: 1px solid var(--line); }
.site-head .wrap { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; padding-block: 12px; }
.site-nav { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; font-size: 0.9rem; font-weight: 600; }
.site-nav a:not(.btn) { padding: 10px 12px; border-radius: 10px; }
.site-nav a:not(.btn):hover, .site-nav a[aria-current="page"] { background: var(--surface-2); }
.site-menu { display: none; }
@media (max-width: 760px) {
  .site-nav { display: none; width: 100%; flex-direction: column; align-items: stretch; padding-block-end: 8px; }
  .site-head.open .site-nav { display: flex; }
  .site-nav .btn { margin-block-start: 6px; }
  .site-menu { display: inline-grid; }
}
.hero { padding-block: 56px 40px; display: flex; flex-wrap: wrap; gap: 40px; align-items: center; }
.hero-copy { flex: 1 1 460px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.hero-copy h1 { font-size: clamp(2.1rem, 1.4rem + 3vw, 3.4rem); letter-spacing: -0.03em; line-height: 1.06; }
html[lang="ar"] .hero-copy h1 { letter-spacing: 0; line-height: 1.3; }
.hero-copy .lead { font-size: 1.1rem; color: var(--ink-2); max-width: 36rem; }
.hero-art { flex: 1 1 320px; display: flex; justify-content: center; min-width: 0; }
.eyebrow { align-self: flex-start; font-size: 0.8rem; font-weight: 750; padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); }
.band { padding-block: 56px; }
.band-white { background: var(--surface); border-block: 1px solid var(--line); }
.band-dark { background: var(--black); color: #fff; }
.band-dark .muted { color: var(--on-black); }
.section-head { display: flex; flex-direction: column; gap: 10px; max-width: 46rem; margin-block-end: 22px; }
.section-head h2 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem); }
.section-head p { font-size: 1.02rem; color: var(--ink-2); }
.band-dark .section-head p { color: var(--on-black); }
.feature { display: flex; flex-direction: column; gap: 6px; }
.feature strong { font-size: 1rem; }
.feature p { font-size: 0.9rem; color: var(--ink-2); }
.flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.flow-step { border-radius: 20px; padding: 18px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.flow-step .where { font-size: 0.76rem; font-weight: 750; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.05em; }
html[lang="ar"] .flow-step .where { text-transform: none; letter-spacing: 0; }
.flow-step.server { background: var(--black); color: #fff; border-color: var(--black); }
.flow-step.server .where, .flow-step.server p { color: var(--on-black); }
.flow-arrow { display: flex; align-items: center; gap: 10px; font-size: 0.86rem; font-weight: 650; color: var(--accent-text); padding: 10px 2px; }
.plan { border-radius: 22px; padding: 24px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--line); }
.plan.dark { background: var(--black); color: #fff; border-color: var(--black); }
.plan .price { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.02em; }
.plan p { color: var(--ink-2); font-size: 0.92rem; }
.plan.dark p { color: var(--on-black); }
.site-foot { background: var(--black); color: var(--on-black); padding-block: 36px; margin-block-start: 0; }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 18px; justify-content: space-between; font-size: 0.9rem; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.site-foot a { color: #fff; }
.prose { max-width: 46rem; display: flex; flex-direction: column; gap: 14px; font-size: 1rem; }
.prose h1 { font-size: clamp(1.8rem, 1.4rem + 1.4vw, 2.4rem); }
.prose h2 { font-size: 1.3rem; margin-block-start: 14px; }
.prose h3 { font-size: 1.05rem; margin-block-start: 6px; }
.prose ul, .prose ol { margin: 0; padding-inline-start: 22px; display: flex; flex-direction: column; gap: 6px; }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
.prose th, .prose td { text-align: start; padding: 10px 12px; border: 1px solid var(--line); vertical-align: top; }

/* Docs (/developers) */
.docs { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px; padding-block: 36px 64px; }
.docs-nav { position: sticky; top: 80px; align-self: start; display: flex; flex-direction: column; gap: 2px; font-size: 0.88rem; }
.docs-nav a { padding: 8px 10px; border-radius: 10px; color: var(--ink-2); }
.docs-nav a:hover { background: var(--surface); color: var(--ink); }
.endpoint { display: flex; flex-direction: column; gap: 10px; padding-block: 18px; border-block-start: 1px solid var(--line); }
.method { font-family: var(--mono); font-size: 0.74rem; font-weight: 800; padding: 3px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-text); }
.method.post { background: var(--blue-soft); color: var(--blue-text); }
.method.delete { background: var(--red-soft); color: var(--red-text); }
@media (max-width: 860px) { .docs { grid-template-columns: minmax(0, 1fr); } .docs-nav { position: static; flex-direction: row; flex-wrap: wrap; } }
.prose td code { overflow-wrap: anywhere; }

/* =====================================================================
   Shell 2: personal app (/me). Phone first: bottom tab bar on phones,
   a side list of sections on wider screens.
   ===================================================================== */
.me { min-height: 100vh; display: flex; }
.me-side { display: none; }
.me-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.me-top {
  position: sticky; top: 0; z-index: 40; background: var(--bg);
  padding-block: 14px 10px; padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
}
.me-top-in { max-width: 600px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.me-top h1 { font-size: 1.35rem; font-weight: 800; }
.me-greet { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.me-greet .date { font-size: 0.8rem; color: var(--ink-3); }
.me-greet .hello { font-size: 1.2rem; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-main {
  width: 100%; max-width: 600px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px;
  padding-block: 6px calc(110px + env(safe-area-inset-bottom, 0px));
  padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
}
.me-main:focus { outline: none; }
.tabbar {
  position: fixed; inset-inline: 0; inset-block-end: 0; z-index: 60; background: var(--surface); border-block-start: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 54px;
  font-size: 0.74rem; font-weight: 650; color: var(--ink-3); border-radius: 12px;
}
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a[aria-current="page"] { color: var(--ink); font-weight: 800; }
.tabbar a[aria-current="page"] svg { color: var(--accent); }
.in-app .tabbar { display: grid; }
@media (min-width: 900px) {
  .me-side {
    display: flex; flex-direction: column; gap: 6px; width: 248px; flex: none; position: sticky; top: 0; height: 100vh;
    padding: 22px 14px; border-inline-end: 1px solid var(--line); background: var(--surface); overflow-y: auto;
  }
  .me-side .logo { padding: 0 10px 14px; }
  .me-side nav { display: flex; flex-direction: column; gap: 2px; }
  .me-side nav a { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: 12px; font-size: 0.9rem; font-weight: 600; color: var(--ink-2); }
  .me-side nav a svg { width: 19px; height: 19px; flex: none; }
  .me-side nav a:hover { background: var(--surface-2); color: var(--ink); }
  .me-side nav a[aria-current="page"] { background: var(--ink); color: var(--bg); }
  .me-side .nav-label { margin: 14px 12px 4px; font-size: 0.7rem; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
  html[lang="ar"] .me-side .nav-label { letter-spacing: 0; text-transform: none; font-size: 0.78rem; }
  .me-side .side-foot { margin-block-start: auto; display: flex; flex-direction: column; gap: 6px; padding-block-start: 14px; border-block-start: 1px solid var(--line); }
  .tabbar { display: none; }
  .me-main { padding-block-end: 64px; max-width: 680px; }
  .me-top-in { max-width: 680px; }
}

/* Home */
.safe { display: flex; flex-direction: column; gap: 10px; }
.safe-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.safe-label { font-size: 0.9rem; font-weight: 650; color: var(--on-black); }
.safe-figure { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.safe-figure .cur { font-size: 1.1rem; font-weight: 650; color: var(--on-black); }
.safe-figure .val { font-size: clamp(2.6rem, 2rem + 3vw, 3.2rem); font-weight: 800; letter-spacing: -0.025em; line-height: 1; font-variant-numeric: tabular-nums; }
.safe p { font-size: 0.86rem; line-height: 1.5; color: var(--on-black); }
.safe .tip { display: flex; gap: 10px; align-items: flex-start; background: rgba(255, 255, 255, 0.08); border-radius: 14px; padding: 10px 12px; color: #fff; font-size: 0.86rem; }
.safe .tip svg.i { width: 18px; height: 18px; margin-block-start: 1px; color: #7fe0b8; }
.safe-foot { display: flex; justify-content: space-between; font-size: 0.76rem; color: var(--on-black); }
.figures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.figure { display: flex; flex-direction: column; gap: 2px; }
.figure .k { font-size: 0.78rem; color: var(--ink-3); }
.figure .v { font-size: 1.12rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.look-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 50px; padding: 0 16px; border-radius: 16px; background: var(--amber-soft); color: var(--amber-text); font-size: 0.92rem; font-weight: 650; }
.look-link svg { width: 20px; height: 20px; flex: none; }
.look-link span { display: flex; align-items: center; gap: 10px; }

/* Ask */
.ask-thread { display: flex; flex-direction: column; gap: 12px; }
.bubble { max-width: 88%; padding: 12px 16px; font-size: 0.92rem; line-height: 1.55; }
.bubble.me { align-self: flex-end; background: var(--ink); color: var(--bg); border-radius: 20px 20px 6px 20px; }
[dir="rtl"] .bubble.me { border-radius: 20px 20px 20px 6px; }
.bubble.waazn { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 20px 20px 20px 6px; display: flex; flex-direction: column; gap: 10px; }
[dir="rtl"] .bubble.waazn { border-radius: 20px 20px 6px 20px; }
.ask-form { display: flex; gap: 8px; align-items: center; position: sticky; inset-block-end: calc(84px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 900px) { .ask-form { inset-block-end: 16px; } }
.ask-form .search { flex: 1; border-radius: 999px; min-height: 50px; background: var(--surface); }
.send { width: 50px; height: 50px; border-radius: 999px; border: 0; background: var(--ink); color: var(--bg); display: grid; place-items: center; cursor: pointer; flex: none; }
.send svg { width: 20px; height: 20px; }

/* =====================================================================
   Shell 3: business portal and staff console (black sidebar)
   ===================================================================== */
.app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 8px; padding: 22px 14px 16px;
  background: var(--black); color: #fff; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 14px; color: #fff; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-weight: 800; font-size: 1rem; }
.brand-tag { font-size: 0.74rem; color: var(--on-black); }
.nav { display: grid; gap: 2px; }
.nav-label { margin: 14px 12px 6px; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: rgba(255, 255, 255, 0.42); }
html[lang="ar"] .nav-label { letter-spacing: 0; text-transform: none; font-size: 0.76rem; }
.nav a {
  display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 12px; border-radius: 12px; font-size: 0.9rem; font-weight: 500;
  color: var(--on-black); transition: background-color 0.12s var(--ease), color 0.12s var(--ease);
}
.nav a svg { width: 18px; height: 18px; flex: none; opacity: 0.9; }
.nav a:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.nav a[aria-current="page"] { background: #fff; color: #0b0d12; font-weight: 650; }
.nav a .badge { margin-inline-start: auto; background: #fff; color: #050608; }
.nav a[aria-current="page"] .badge { background: var(--accent); color: var(--on-accent); }
.sidebar-foot { margin-block-start: auto; display: grid; gap: 8px; padding-block-start: 14px; border-block-start: 1px solid var(--edge-on-black); }
.sidebar-foot form { margin: 0; }
.me-card { display: flex; align-items: center; gap: 10px; padding: 8px; }
.me-card .avatar { width: 34px; height: 34px; background: var(--accent); border: 0; color: var(--on-accent); font-size: 0.74rem; }
.me-text { min-width: 0; flex: 1; display: grid; line-height: 1.3; }
.me-name { font-size: 0.86rem; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-role { font-size: 0.74rem; color: rgba(255, 255, 255, 0.55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.signout {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 0 12px; border: 0; border-radius: 12px; background: none;
  color: rgba(255, 255, 255, 0.62); cursor: pointer; font-size: 0.86rem;
}
.signout:hover { color: #fff; background: rgba(255, 255, 255, 0.07); }
.signout svg { width: 17px; height: 17px; }
.app-main { min-width: 0; display: flex; flex-direction: column; }
@media (min-width: 901px) {
  html:has(.app), html:has(.app) body { overscroll-behavior: none; }
  .app { height: 100vh; min-height: 0; grid-template-rows: minmax(0, 1fr); overflow: hidden; }
  .sidebar { height: 100%; overscroll-behavior: none; }
  .app-main { height: 100%; overflow-y: auto; overscroll-behavior-y: contain; }
  body:has(.backdrop) .app-main { overflow: hidden; }
}
.topbar { display: none; }
.scrim { display: none; }
.content { width: 100%; max-width: 1240px; padding: 34px 36px 120px; display: flex; flex-direction: column; gap: 18px; }
.content:focus { outline: none; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px 28px; flex-wrap: wrap; }
.head h1 { font-size: clamp(1.6rem, 1.3rem + 1vw, 2.1rem); letter-spacing: -0.03em; }
html[lang="ar"] .head h1 { letter-spacing: 0; }
.head p { margin-block-start: 6px; color: var(--ink-3); max-width: 44rem; }
.crumb { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; font-size: 0.86rem; font-weight: 650; color: var(--ink-3); }
.crumb:hover { color: var(--ink); }
.crumb svg { width: 16px; height: 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filters .field { min-width: 150px; flex: 1 1 150px; max-width: 240px; }
.filters > .form-actions { flex: 0 0 auto; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; font-size: 0.86rem; color: var(--ink-3); }
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 120; width: min(300px, 86vw); height: 100%;
    transform: translateX(-104%); transition: transform 0.24s var(--ease-out);
  }
  [dir="rtl"] .sidebar { transform: translateX(104%); }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 110; background: rgba(5, 6, 8, 0.45); }
  .topbar {
    display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 90; min-height: 58px; background: var(--black); color: #fff;
    padding-inline: max(12px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
  }
  .menu-toggle { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: #fff; cursor: pointer; }
  .menu-toggle svg { width: 22px; height: 22px; }
  .content { padding: 22px max(16px, env(safe-area-inset-right, 0px)) 96px max(16px, env(safe-area-inset-left, 0px)); }
}


/* ---------- Helpers used by the templates ---------- */
.skip { position: absolute; inset-inline-start: 12px; inset-block-start: -60px; z-index: 400; padding: 10px 16px; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 700; }
.skip:focus { inset-block-start: 12px; }
.h-lg { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.7rem); }
.mt { margin-block-start: 10px; }
.center { text-align: center; }
.self-start { align-self: flex-start; }
.self-end { align-self: flex-end; }
.grow { flex: 1 1 160px; }
.span-2 { grid-column: 1 / -1; }
.cluster.tight { gap: 6px; flex-wrap: nowrap; }
.cluster.tight svg.i { width: 18px; height: 18px; color: var(--ink-3); }
.big-line { font-size: 1.15rem; font-weight: 700; }
.total-line { padding-block-start: 12px; border-block-start: 1px solid var(--line); }
.amount.neg { color: var(--red-text); }
.card-dark .amount.neg { color: #ff9b8f; }
a.card-link { display: flex; color: inherit; transition: border-color 0.15s var(--ease); }
a.card-link:hover { border-color: var(--line-strong); }
a.notice, a.look-link { flex-wrap: nowrap; align-items: center; gap: 12px; }
a.notice svg.i { flex: none; }
.notice svg.i, .flash svg.i { vertical-align: -4px; }
.prompt { border-style: dashed; border-color: var(--line-strong); background: transparent; }
.lang-form { margin: 0; }
/* Section links on long pages: one row that scrolls sideways, pinned under the page title with a solid backdrop
   so nothing shows through. It bleeds to the screen edges on phones. */
.toc {
  position: sticky; inset-block-start: var(--top-h, 52px); z-index: 30; flex-wrap: nowrap; overflow-x: auto;
  scrollbar-width: none; overscroll-behavior-x: contain; margin-inline: -16px; padding: 6px 16px 10px;
  background: var(--bg);
}
.toc::-webkit-scrollbar { display: none; }
.toc > .chip { flex: none; }
.me-side .side-foot .btn { justify-content: flex-start; }
.figures.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.figures.on-dark .k { color: var(--on-black); }
@media (max-width: 420px) { .figures.three { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.safe-figure .cur { font-size: 1.05rem; font-weight: 650; color: var(--on-black); }
.safe .safe-figure .val { color: #fff; }
.tile.big { width: 56px; height: 56px; border-radius: 16px; }
.tile.big svg.i { width: 26px; height: 26px; }
.avatar.big { width: 56px; height: 56px; font-size: 1rem; }
.txn-head { align-items: flex-start; }
.txn-amount .amount { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; }
.row-actions { padding-block: 0 10px; padding-inline-start: 52px; gap: 6px; }
.row-actions + .row, .row + .row-actions { border-block-start: 0; }
.budget .split strong { font-size: 0.95rem; }
.chart-fig { margin: 0; }
.filters-box { display: flex; flex-direction: column; gap: 12px; }
.filters-box > summary { list-style: none; align-self: flex-start; }
.filters-box > summary::-webkit-details-marker { display: none; }
.filters-box[open] > summary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
details > summary.link { cursor: pointer; }
progress.share-bar { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 8px; border: 0; border-radius: 999px; background: var(--surface-2); overflow: hidden; color: var(--accent); }
progress.share-bar::-webkit-progress-bar { background: var(--surface-2); border-radius: 999px; }
progress.share-bar::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
progress.share-bar::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
a.share { color: inherit; }
a.share:hover .share-top span { text-decoration: underline; text-underline-offset: 3px; }
.steps { margin: 0; padding-inline-start: 22px; display: flex; flex-direction: column; gap: 8px; font-size: 0.92rem; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.timeline li { display: flex; gap: 12px; align-items: flex-start; }
.timeline .dot { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); color: var(--ink-2); font-size: 0.8rem; font-weight: 800; }
.timeline .dot svg.i { width: 16px; height: 16px; }
.timeline li.approved .dot { background: var(--accent-soft); color: var(--accent-text); }
.timeline li.rejected .dot { background: var(--red-soft); color: var(--red-text); }
.timeline li.waiting .dot, .timeline li.pending .dot { background: var(--blue-soft); color: var(--blue-text); }
img.receipt { max-height: 420px; width: auto; border-radius: 14px; border: 1px solid var(--line); }
.switch { padding: 0 4px 6px; }
.switch select { width: 100%; min-height: 40px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--edge-on-black); background: rgba(255, 255, 255, 0.06); color: #fff; font-size: 0.86rem; }
.switch select option { color: #0b0d12; }
.sidebar-foot .lang-form .signout span, .sidebar-foot a.signout span { flex: 1; text-align: start; }
.topbar .brand { padding: 0; }
.topbar .brand-name { font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .logo-mark { width: 30px; height: 30px; border-radius: 9px; }
.topbar .logo-mark svg { width: 21px; }
.sidebar .logo-mark { background: var(--accent); }


/* ---------- Public page pieces ---------- */
.h-xl { font-size: clamp(2rem, 1.4rem + 2.4vw, 2.9rem); letter-spacing: -0.03em; }
.mb { margin-block-end: 14px; }
.mt-lg { margin-block-start: 22px; }
.pad-top { padding-block-start: 16px; }
.feature svg.i { width: 26px; height: 26px; color: var(--accent); margin-block-end: 6px; }
.band-dark .btn-on-dark { background: transparent; color: #fff; border-color: var(--edge-on-black); }
.band-dark .btn-on-dark:hover { border-color: #fff; }
.ticks { list-style: none; margin: 4px 0 8px; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 0.9rem; }
.ticks li { display: flex; gap: 8px; align-items: flex-start; }
.ticks svg.i { width: 18px; height: 18px; color: var(--accent); margin-block-start: 2px; }
.plan.dark .ticks svg.i { color: #7fe0b8; }
.prose.wide { max-width: 860px; }
.prose code { font-family: var(--mono); font-size: 0.86em; background: var(--surface-2); padding: 1px 5px; border-radius: 6px; }
.prose .code { white-space: pre-wrap; overflow-wrap: anywhere; }
.flow-arrow svg.i { width: 18px; height: 18px; }
.phone-art { width: min(340px, 100%); border-radius: 44px; background: var(--black); padding: 12px; box-shadow: 0 30px 60px rgba(5, 6, 8, 0.18); }
.phone-screen { border-radius: 34px; background: var(--bg); padding: 18px 14px; display: flex; flex-direction: column; gap: 10px; }
.phone-screen .safe { padding: 18px; }
.phone-screen .safe-figure .val { font-size: 2.6rem; }
.art-row { display: flex; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); font-size: 0.86rem; }
.art-row.amber { background: var(--amber-soft); color: var(--amber-text); border-color: transparent; font-weight: 650; }
.portal-art { width: min(440px, 100%); border-radius: 24px; background: var(--surface); border: 1px solid var(--line); padding: 18px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 30px 60px rgba(5, 6, 8, 0.12); }
.art-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.art-kpis div { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 14px; background: var(--surface-2); }
.art-kpis span { font-size: 0.76rem; color: var(--ink-3); }
.art-kpis strong { font-size: 1.15rem; }
.art-alert { padding: 10px 12px; border-radius: 12px; background: var(--red-soft); color: var(--red-text); font-size: 0.84rem; font-weight: 650; }
.auth-card.wide { width: min(560px, 100%); }
.consent-box { max-height: 300px; overflow-y: auto; }
.in-app .auth { min-height: auto; padding-block: 16px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* Portal setup strip: four numbered steps in one row on desktop, two per row on phones. */
.setup { display: flex; flex-direction: column; gap: 12px; }
.setup-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 8px; }
.setup-step { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 12px; border-radius: 14px; border: 1px solid var(--line); color: var(--ink); font-size: 0.88rem; font-weight: 650; text-decoration: none; }
.setup-step:hover { border-color: var(--ink-3); }
.setup-step.done { color: var(--ink-3); background: var(--surface-2); border-color: transparent; }
.setup-mark { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 0.8rem; font-weight: 800; }
.setup-step.done .setup-mark { background: var(--accent-soft); color: var(--accent-text); }
.setup-mark svg.i { width: 16px; height: 16px; }

/* Portal and staff helpers */
.row-title.multi, .row-meta.multi { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
.align-start { align-items: start; }
.quote { margin: 0; padding: 12px 16px; border-inline-start: 3px solid var(--accent); border-radius: 4px 12px 12px 4px; background: var(--surface-2); font-size: 0.95rem; }
.link-plain { color: inherit; text-decoration: none; }
.link-plain:hover { text-decoration: underline; text-underline-offset: 3px; }
a.card-link-plain { color: inherit; text-decoration: none; transition: border-color 0.12s var(--ease); }
a.card-link-plain:hover { border-color: var(--ink-3); }
.bad-text { color: var(--red-text); }
.warn-text { color: var(--amber-text); }
hr.rule { border: 0; border-block-start: 1px solid var(--line); margin: 4px 0; }
.limit { gap: 10px; }
.inline-edit > summary { list-style: none; cursor: pointer; }
.inline-edit > summary::-webkit-details-marker { display: none; }
.inline-edit[open] > summary { background: var(--surface-2); }
.inline-edit > form { margin-block-start: 10px; padding: 14px; border-radius: 14px; background: var(--surface-2); }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
fieldset.card-flat { padding: 14px; }
legend { padding: 0; margin-block-end: 8px; }
.card-dark .secret { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.14); }
.card-dark .secret code { color: #fff; }
.notice > svg.i:first-child { flex: none; margin-block-start: 2px; }
.notice > svg.i:first-child + span { flex: 1; min-width: 0; }
.card-dark .field > label { color: #fff; }
.card-dark .hint { color: var(--on-black); }
.card-dark .field input:not([type="checkbox"]):not([type="radio"]), .card-dark .field select, .card-dark .field textarea {
  background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.18); color: #fff;
}
.card-dark .field textarea { min-height: 76px; }
.chips:has(> .check) { gap: 10px 22px; }
.kv dd.muted { font-weight: 500; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.92rem; line-height: 1.6; padding: 14px 16px; border-radius: 14px; background: var(--surface-2); }
.select-sm, .field select.select-sm { height: 34px; min-height: 34px; padding: 4px 10px; font-size: 0.84rem; width: auto; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); }
.row-actions-inline { flex-wrap: wrap; justify-content: flex-end; }
details.card > summary { list-style: none; cursor: pointer; }
details.card > summary::-webkit-details-marker { display: none; }
.table-wrap { position: relative; }
.table .mono { overflow-wrap: normal; word-break: normal; }
/* Phones: the period switcher scrolls inside itself; number cards become compact rows. */
.seg { max-width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg > * { flex: none; white-space: nowrap; }
@media (max-width: 600px) {
  .grid-4 { gap: 8px; }
  .grid-4 > .kpi { flex-direction: row; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; padding: 14px 16px; border-radius: 16px; }
  .grid-4 > .kpi .kpi-value { font-size: 1.3rem; }
  .grid-4 > .kpi .kpi-note { flex-basis: 100%; }
  .head .seg { width: 100%; }
}

/* WhatsApp linking inside the coach card, and cards waiting for the holder's answer on Home */
.wa-link { padding-block-start: 16px; border-block-start: 1px solid var(--line); }
.wa-link h3 { margin: 0; font-size: 1rem; }
.wa-link .secret code { font-size: 1.05rem; letter-spacing: 0.04em; }
.pending-cards > .cluster { flex-wrap: nowrap; }
.pending-cards > .cluster h2 { margin: 0; min-width: 0; }
.pending-cards .list .row form { flex: none; }
