/* Youth Foundation CareOS — component library (design prototype)
   Logical properties only (margin-inline, inset-inline…) so RTL works without overrides. */
/* tokens.css (inlined by ops/fingerprint.js) */
/* Youth Foundation CareOS — design tokens
   Calm, trauma-informed identity: warm off-white, deep navy text, teal/sage accents.
   Status colours are muted on purpose (no alarming reds). */

@font-face { font-family: "Inter"; src: url("/assets/h/fonts/inter-latin.f052ee44c3.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Plex Arabic"; src: url("/assets/h/fonts/plex-arabic-400.0c1dfc1a6f.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Arabic"; src: url("/assets/h/fonts/plex-arabic-500.d927fcbabc.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex Arabic"; src: url("/assets/h/fonts/plex-arabic-600.c0eed9cd05.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plex Arabic"; src: url("/assets/h/fonts/plex-arabic-700.a0cbcef8d9.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #faf7f2;
  --surface: #ffffff;
  --surface-2: #f3efe8;
  --surface-3: #ebe5db;
  --border: #e4ded4;
  --border-strong: #cfc6b8;
  --text: #1e2a3b;
  --text-2: #3f4b5c;
  --muted: #5f6b7a;
  --accent: #2f6f6a;
  --accent-strong: #235652;
  --accent-soft: #e2eeeb;
  --on-accent: #ffffff;
  --sage: #4a6b52; /* D-48: was #6f8f76 (3.1:1 as text on its badge) */
  --sage-soft: #e9efe6;
  --info: #35588a;
  --info-soft: #e6ecf5;
  --warn: #8a5a12;
  --warn-soft: #fbf0dc;
  --danger: #9b3b3b;
  --danger-soft: #f7e7e4;
  --success: #2f6b45;
  --success-soft: #e3f0e7;
  --sealed: #5b4a86;
  --sealed-soft: #ece8f5;
  --focus: #1d6fd6;
  --shadow-sm: 0 1px 2px rgba(30, 42, 59, .06);
  --shadow: 0 1px 2px rgba(30, 42, 59, .05), 0 4px 16px rgba(30, 42, 59, .06);
  --shadow-lg: 0 8px 32px rgba(30, 42, 59, .12);
  --chart-1: #2f6f6a; --chart-2: #6f8f76; --chart-3: #35588a; --chart-4: #b08a3e; --chart-5: #8a6f9e; --chart-6: #a9b8c6;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-ar: "Plex Arabic", "Segoe UI", Tahoma, sans-serif;
  --fs-xs: .75rem; --fs-sm: .875rem; --fs-base: 1rem; --fs-md: 1.125rem; --fs-lg: 1.375rem; --fs-xl: 1.75rem; --fs-2xl: 2.25rem; --fs-3xl: 3rem;
  --lh: 1.6;
  --r-sm: 8px; --r: 12px; --r-lg: 18px; --r-pill: 999px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
  --tap: 48px;
  --sidebar-w: 264px;
  --content-max: 1200px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #12161d; --surface: #1a202a; --surface-2: #212834; --surface-3: #29313e;
    --border: #2e3744; --border-strong: #3d4757;
    --text: #e8ecf1; --text-2: #c3ccd8; --muted: #98a3b3;
    --accent: #6fb5ac; --accent-strong: #8fcac2; --accent-soft: #1d3432; --on-accent: #0e1a19;
    --sage: #9bb8a1; --sage-soft: #1f2b22;
    --info: #9bb6e0; --info-soft: #1d2738; --warn: #e3b46a; --warn-soft: #33281a;
    --danger: #e59a92; --danger-soft: #3a2220; --success: #8fcaa2; --success-soft: #1b2e22;
    --sealed: #c0b2e6; --sealed-soft: #2a2438; --focus: #7fb2ff;
    --shadow-sm: none; --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 8px 32px rgba(0,0,0,.45);
    --chart-1: #6fb5ac; --chart-2: #9bb8a1; --chart-3: #9bb6e0; --chart-4: #d9b66f; --chart-5: #b9a2cc; --chart-6: #5d6b7b;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #12161d; --surface: #1a202a; --surface-2: #212834; --surface-3: #29313e;
  --border: #2e3744; --border-strong: #3d4757;
  --text: #e8ecf1; --text-2: #c3ccd8; --muted: #98a3b3;
  --accent: #6fb5ac; --accent-strong: #8fcac2; --accent-soft: #1d3432; --on-accent: #0e1a19;
  --sage: #9bb8a1; --sage-soft: #1f2b22;
  --info: #9bb6e0; --info-soft: #1d2738; --warn: #e3b46a; --warn-soft: #33281a;
  --danger: #e59a92; --danger-soft: #3a2220; --success: #8fcaa2; --success-soft: #1b2e22;
  --sealed: #c0b2e6; --sealed-soft: #2a2438; --focus: #7fb2ff;
  --shadow-sm: none; --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 8px 32px rgba(0,0,0,.45);
  --chart-1: #6fb5ac; --chart-2: #9bb8a1; --chart-3: #9bb6e0; --chart-4: #d9b66f; --chart-5: #b9a2cc; --chart-6: #5d6b7b;
}


*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: var(--fs-base); line-height: var(--lh); }
html[lang="ar"] body { font-family: var(--font-ar); }
img, svg { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 var(--s-3); color: var(--text); font-weight: 650; letter-spacing: -.01em; }
html[lang="ar"] :is(h1, h2, h3, h4) { letter-spacing: 0; font-weight: 700; }
h1 { font-size: var(--fs-2xl); } h2 { font-size: var(--fs-xl); } h3 { font-size: var(--fs-md); } h4 { font-size: var(--fs-base); }
p { margin: 0 0 var(--s-4); }
small, .small { font-size: var(--fs-sm); }
.muted { color: var(--muted); }
.lead { font-size: var(--fs-md); color: var(--text-2); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.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; }
.skip-link { position: absolute; inset-inline-start: 8px; top: -60px; background: var(--surface); padding: 8px 12px; border-radius: var(--r-sm); z-index: 100; }
.skip-link:focus { top: 8px; }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--s-5) 0; }
code, kbd { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
kbd { background: var(--surface-2); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; }

/* ---------- Layout helpers ---------- */
.container { width: 100%; max-width: var(--content-max); margin-inline: auto; padding-inline: 16px; }
@media (min-width: 720px) { .container { padding-inline: 24px; } }
.narrow { max-width: 720px; }
.stack > * + * { margin-block-start: var(--s-4); }
.stack-sm > * + * { margin-block-start: var(--s-2); }
.stack-lg > * + * { margin-block-start: var(--s-6); }
.row { display: flex; gap: var(--s-3); align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: var(--s-3); align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.grid { display: grid; gap: var(--s-4); }
.grid-2 { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-3 { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.grid-4 { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.split { display: grid; gap: var(--s-5); grid-template-columns: 1fr; }
@media (min-width: 1024px) { .split { grid-template-columns: minmax(0, 1fr) 340px; } .split-left { grid-template-columns: 300px minmax(0, 1fr); } }
/* the detail column grows with the screen so its label/value rows are not squeezed (Q-1d) */
@media (min-width: 1280px) { .split { grid-template-columns: minmax(0, 1fr) clamp(380px, 36%, 600px); } .split-left { grid-template-columns: clamp(300px, 26%, 420px) minmax(0, 1fr); } }
.section { padding-block: var(--s-7); }
.mt-0 { margin-top: 0 !important; } .mb-0 { margin-bottom: 0 !important; }
.text-center { text-align: center; }
@media (max-width: 719px) { .hide-mobile { display: none !important; } }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: var(--r-pill);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 550; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); color: var(--text); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); }
.btn-quiet { background: transparent; border-color: transparent; }
.btn-quiet:hover { background: var(--surface-2); }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: var(--fs-sm); }
.btn-lg { min-height: var(--tap); padding: 12px 24px; font-size: var(--fs-md); }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-pill); border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html[dir="rtl"] .flip-rtl { transform: scaleX(-1); }

/* ---------- Cards & surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s-5); box-shadow: var(--shadow-sm); }
.card-tight { padding: var(--s-4); }
.card-flush { padding: 0; overflow: hidden; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--border); }
.card-header h2, .card-header h3 { margin: 0; font-size: var(--fs-md); }
.card-body { padding: var(--s-5); }
.card-footer { padding: var(--s-3) var(--s-5); border-top: 1px solid var(--border); background: var(--surface-2); }
.card-link { display: block; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; }
.card-link:hover { border-color: var(--accent); box-shadow: var(--shadow); color: inherit; }
.panel { background: var(--surface-2); border-radius: var(--r); padding: var(--s-4); }
.divider-list > * + * { border-top: 1px solid var(--border); }

/* ---------- Stats / KPI ---------- */
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s-4) var(--s-5); }
.stat-label { font-size: var(--fs-sm); color: var(--muted); margin: 0; }
.stat-value { font-size: var(--fs-xl); font-weight: 650; margin: 2px 0; font-variant-numeric: tabular-nums; }
.stat-meta { font-size: var(--fs-xs); color: var(--muted); }
.trend-up { color: var(--success); } .trend-down { color: var(--warn); }

/* ---------- Badges, chips, classification ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 600; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.no-dot::before { display: none; }
.badge-accent { background: var(--accent-soft); color: var(--accent-strong); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-sealed { background: var(--sealed-soft); color: var(--sealed); }
.badge-sage { background: var(--sage-soft); color: var(--sage); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--surface); font-size: var(--fs-sm); color: var(--text-2); }
.chip[aria-pressed="true"], .chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }
/* Data classification label (VISION §4.1) */
.class-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; font-weight: 700; padding: 2px 8px; border-radius: 6px; border: 1px solid currentColor; }
html[lang="ar"] .class-tag { text-transform: none; letter-spacing: 0; }
.class-public { color: var(--sage); } .class-internal { color: var(--muted); } .class-personal { color: var(--info); }
.class-confidential { color: var(--warn); } .class-restricted { color: var(--danger); } .class-sealed { color: var(--sealed); }

/* ---------- Alerts & callouts ---------- */
.alert { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-4); border-radius: var(--r); background: var(--info-soft); color: var(--text); border-inline-start: 4px solid var(--info); }
.alert > .icon { color: var(--info); margin-top: 2px; }
.alert p:last-child { margin: 0; }
.alert-warn { background: var(--warn-soft); border-color: var(--warn); } .alert-warn > .icon { color: var(--warn); }
.alert-danger { background: var(--danger-soft); border-color: var(--danger); } .alert-danger > .icon { color: var(--danger); }
.alert-success { background: var(--success-soft); border-color: var(--success); } .alert-success > .icon { color: var(--success); }
.alert-calm { background: var(--accent-soft); border-color: var(--accent); } .alert-calm > .icon { color: var(--accent); }
/* test / development site notice shown instead of the help form (demo mode, RK-06): long button labels wrap at 360 px */
.test-site .btn { white-space: normal; text-align: center; }
.alert-sealed { background: var(--sealed-soft); border-color: var(--sealed); } .alert-sealed > .icon { color: var(--sealed); }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; align-content: start; }
.field + .field { margin-top: var(--s-4); }
.grid-2 > .field + .field, .grid-3 > .field + .field, .grid-4 > .field + .field, .row > .field + .field { margin-top: 0; } /* side by side: same top line */
label, .label { font-weight: 600; font-size: var(--fs-sm); color: var(--text); }
.hint { font-size: var(--fs-sm); color: var(--muted); margin: 0; }
/* P-01: the live character count under a box (over the limit: red and bold, the save stops); typed line breaks kept */
.field-count { text-align: end; }
.field-count.over { color: var(--danger); font-weight: 600; }
.pre-line { white-space: pre-line; }
/* P-01B: text people type keeps its own direction. Multi-line text: every line its own (a goal in English on an Arabic page reads
   "1. Women and girls gain … 150", not "… 150 .1"). Marked by the shell (app.js autoDir): headings, labels and cells keep the page's
   alignment so a column or a card does not jump from side to side; paragraphs and list items follow their own text. */
.pre-line, .mail-text, .u-text { unicode-bidi: plaintext; text-align: start; }
.u-text { white-space: pre-line; }
:is(#main, dialog, [role="dialog"]) [style*="white-space:pre-wrap"], :is(#main, dialog, [role="dialog"]) [style*="white-space: pre-wrap"] { unicode-bidi: plaintext; text-align: start; }
:is(h1, h2, h3, h4, h5, h6, th, td, dt, dd, label, legend, summary, button, .badge)[dir="auto"]:not(.num) { text-align: match-parent; }
.btn-link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 24px; }
.optional { font-weight: 400; color: var(--muted); }
.input, .select, .textarea { width: 100%; min-height: var(--tap); padding: 10px 14px; border-radius: var(--r); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; }
.textarea { min-height: 140px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: 3px solid color-mix(in srgb, var(--focus) 35%, transparent); border-color: var(--focus); }
.input-sm { min-height: 36px; padding: 6px 10px; font-size: var(--fs-sm); }
.field-error .input, .field-error .textarea { border-color: var(--warn); }
.error-text { color: var(--warn); font-size: var(--fs-sm); font-weight: 600; }
.search { position: relative; }
.search .icon { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search .input { padding-inline-start: 40px; min-height: 40px; border-radius: var(--r-pill); background: var(--surface-2); border-color: transparent; }
/* Big tappable choice cards (radio / checkbox) */
.choices { display: grid; gap: var(--s-2); }
.choices-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.choice { position: relative; display: flex; gap: var(--s-3); align-items: flex-start; padding: 14px 16px; min-height: var(--tap); border: 1px solid var(--border-strong); border-radius: var(--r); background: var(--surface); cursor: pointer; font-weight: 500; }
.choice input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.choice small { display: block; font-weight: 400; color: var(--muted); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); margin-top: 2px; flex: none; }
/* Toggle switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.switch input { appearance: none; width: 44px; height: 26px; border-radius: 13px; background: var(--border-strong); position: relative; cursor: pointer; transition: background .15s; flex: none; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: inset-inline-start .15s; box-shadow: var(--shadow-sm); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { inset-inline-start: 21px; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 650; font-size: var(--fs-md); margin-bottom: var(--s-2); padding: 0; }

/* ---------- Stepper / progress ---------- */
.progress { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 var(--s-5); }
.steps li { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-3); }
.steps li.done, .steps li.current { background: var(--accent); }
.steps li.current { background: color-mix(in srgb, var(--accent) 55%, var(--surface-3)); }
.step-label { font-size: var(--fs-sm); color: var(--muted); font-weight: 600; }
.milestones { list-style: none; padding: 0; margin: 0; position: relative; }
.milestones li { position: relative; padding-inline-start: 36px; padding-bottom: var(--s-5); }
.milestones li::before { content: ""; position: absolute; inset-inline-start: 11px; top: 26px; bottom: 0; width: 2px; background: var(--border); }
.milestones li:last-child::before { display: none; }
.milestones .dot { position: absolute; inset-inline-start: 0; top: 2px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--surface); display: grid; place-items: center; }
.milestones li.done .dot { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.milestones li.current .dot { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
/* Journey steps (guided work): a locked step is greyed, carries a lock and says what opens it; tokens only, so dark mode and RTL follow */
.milestones .dot { font-size: var(--fs-sm); font-weight: 600; line-height: 1; }
.milestones .dot .icon { width: 14px; height: 14px; }
.milestones li.locked .dot { background: var(--surface-3); border-color: var(--border); color: var(--muted); }
.milestones li.locked .step-title, .milestones li.locked .step-why { color: var(--muted); }
.journey-steps li { min-width: 0; }
.journey-steps .step-head { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.journey-steps .step-title { font-size: var(--fs-md); margin: 0; overflow-wrap: anywhere; }
.journey-steps .step-why { margin: 4px 0 0; overflow-wrap: anywhere; }
.journey-steps .step-lock { display: flex; gap: 6px; align-items: flex-start; margin: 6px 0 0; font-size: var(--fs-sm); color: var(--muted); }
.journey-steps .step-lock .icon { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.journey-steps .step-note { margin: 8px 0 0; overflow-wrap: anywhere; }
.journey-steps .step-act { margin-top: var(--s-3); padding: var(--s-4); border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); }
.journey-steps .step-act.row { flex-wrap: wrap; }
.journey-steps .step-missing { margin: 6px 0 12px; padding-inline-start: 20px; }
/* "My next steps" (guided work G-02): one ordered list, one action per item; a step that is not open yet is greyed, carries a lock and
   says what opens it. Tokens only, so dark mode and RTL follow; wraps at phone width (the action drops under the text). */
.next-steps .card-header { align-items: flex-start; }
.next-list, .next-locked { list-style: none; margin: 0; padding: 0; }
.next-item { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-4); align-items: center; padding: var(--s-4) var(--s-5); border-top: 1px solid var(--border); }
.next-item:first-child { border-top: 0; }
.next-num { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--text); color: var(--surface); font-size: var(--fs-sm); font-weight: 700; font-variant-numeric: tabular-nums; }
.next-item.is-urgent, .next-item.is-overdue { box-shadow: inset 4px 0 0 var(--danger); }
[dir=rtl] .next-item.is-urgent, [dir=rtl] .next-item.is-overdue { box-shadow: inset -4px 0 0 var(--danger); }
.next-item.is-urgent .next-num, .next-item.is-overdue .next-num { background: var(--danger); }
.next-main { flex: 1 1 260px; min-width: 0; }
.next-meta { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin: 0 0 4px; font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); }
.next-title { font-size: var(--fs-md); font-weight: 700; line-height: 1.35; margin: 0; overflow-wrap: anywhere; }
.next-title a { color: inherit; }
.next-why { margin: 4px 0 0; color: var(--text-2); overflow-wrap: anywhere; }
.next-act { display: flex; flex: none; max-width: 100%; }
.next-act .btn { min-height: 44px; white-space: normal; text-align: center; }
.next-note { margin: var(--s-4) var(--s-5) 0; flex-wrap: wrap; }
.next-clear { display: flex; gap: var(--s-4); align-items: center; padding: var(--s-5); }
.next-clear-ic { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--success-soft); color: var(--success); }
.next-after { margin: 0; padding: var(--s-4) var(--s-5) var(--s-2); border-top: 1px solid var(--border); font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }
.next-locked { display: grid; gap: var(--s-2); padding: 0 var(--s-5) var(--s-4); }
.next-locked-item { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-3) var(--s-4); border-radius: var(--r); background: var(--surface-2); }
.next-lock { flex: none; color: var(--muted); margin-top: 2px; }
.next-lock .icon { width: 20px; height: 20px; }
.next-locked-title { margin: 0; font-weight: 600; color: var(--text-2); overflow-wrap: anywhere; }
.next-lock-why { margin: 2px 0 0; font-size: var(--fs-sm); color: var(--muted); overflow-wrap: anywhere; }
.next-foot { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding: var(--s-3) var(--s-5); border-top: 1px solid var(--border); font-size: var(--fs-sm); color: var(--text-2); }
.next-foot a:last-child { margin-inline-start: auto; }
@media (max-width: 519px) {
  .next-item { padding: var(--s-4); align-items: flex-start; }
  .next-main { flex-basis: calc(100% - 48px); }
  .next-act { width: 100%; padding-inline-start: 44px; }
  .next-note, .next-clear { margin-inline: var(--s-4); } .next-clear { padding-inline: 0; }
  .next-after { padding-inline: var(--s-4); } .next-locked { padding-inline: var(--s-4); } .next-foot { padding-inline: var(--s-4); }
}

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
table.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th { text-align: start; font-weight: 600; color: var(--muted); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .04em; padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
html[lang="ar"] .table th { text-transform: none; letter-spacing: 0; font-size: var(--fs-sm); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.table .num { text-align: end; font-variant-numeric: tabular-nums; }
.ref { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; color: var(--text-2); }
.redacted { display: inline-block; min-width: 7em; height: 1em; vertical-align: middle; border-radius: 4px; background: repeating-linear-gradient(-45deg, var(--surface-3), var(--surface-3) 6px, var(--surface-2) 6px, var(--surface-2) 12px); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; margin-bottom: var(--s-5); }
.tabs [role="tab"], .tabs a { padding: 10px 14px; border: 0; background: none; font: inherit; font-weight: 550; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; text-decoration: none; }
.tabs [aria-selected="true"], .tabs a[aria-current="page"] { color: var(--accent-strong); border-bottom-color: var(--accent); }
[role="tabpanel"][hidden] { display: none; }
.segmented { display: inline-flex; padding: 3px; background: var(--surface-2); border-radius: var(--r-pill); gap: 2px; }
.segmented button { border: 0; background: none; padding: 6px 14px; border-radius: var(--r-pill); font: inherit; font-size: var(--fs-sm); font-weight: 550; color: var(--muted); cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---------- Timeline / activity ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 32px 1fr; gap: var(--s-3); padding-block: var(--s-3); position: relative; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: 15px; top: 44px; bottom: -4px; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline .t-icon { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); }
.timeline .t-icon .icon { width: 16px; height: 16px; }
.timeline time { font-size: var(--fs-xs); color: var(--muted); }

/* ---------- Avatars ---------- */
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--sage-soft); color: var(--sage); font-weight: 650; font-size: var(--fs-sm); flex: none; }
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-lg { width: 52px; height: 52px; font-size: var(--fs-md); }
.avatar-group { display: inline-flex; } .avatar-group .avatar { border: 2px solid var(--surface); margin-inline-start: -8px; } .avatar-group .avatar:first-child { margin-inline-start: 0; }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: var(--s-7) var(--s-5); color: var(--muted); }
.empty .icon { width: 40px; height: 40px; color: var(--sage); margin-bottom: var(--s-3); }

/* ---------- Charts (simple CSS / SVG) ---------- */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 180px; padding-top: 8px; }
.bars .bar { flex: 1; background: var(--chart-1); border-radius: 6px 6px 0 0; min-height: 4px; position: relative; }
.bars .bar.alt { background: var(--chart-2); }
.bar-labels { display: flex; gap: 8px; margin-top: 6px; } .bar-labels span { flex: 1; text-align: center; font-size: var(--fs-xs); color: var(--muted); }
.hbar { display: grid; grid-template-columns: minmax(90px, 160px) 1fr auto; gap: var(--s-3); align-items: center; font-size: var(--fs-sm); }
.hbar + .hbar { margin-top: var(--s-2); }
.hbar .track { height: 10px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.hbar .track > span { display: block; height: 100%; background: var(--chart-1); border-radius: 5px; }
.legend { display: flex; flex-wrap: wrap; gap: var(--s-4); font-size: var(--fs-sm); color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; vertical-align: middle; }

/* ---------- Messaging ---------- */
.thread { display: flex; flex-direction: column; gap: var(--s-3); }
.msg { max-width: min(80%, 520px); padding: 12px 16px; border-radius: 18px; background: var(--surface-2); }
.msg.me { align-self: flex-end; background: var(--accent); color: var(--on-accent); border-end-end-radius: 6px; }
.msg.them { align-self: flex-start; border-end-start-radius: 6px; }
.msg .meta { display: block; font-size: var(--fs-xs); opacity: .75; margin-top: 4px; }
.composer { display: flex; gap: var(--s-2); align-items: flex-end; padding: var(--s-3); border-top: 1px solid var(--border); background: var(--surface); }
.composer .textarea { min-height: 48px; }

/* ---------- Lists ---------- */
.list { list-style: none; padding: 0; margin: 0; }
.list-item { display: flex; gap: var(--s-3); align-items: center; padding: var(--s-3) var(--s-4); }
.list-item + .list-item { border-top: 1px solid var(--border); }
.list-item .title { font-weight: 600; margin: 0; }
.list-item .sub { font-size: var(--fs-sm); color: var(--muted); margin: 0; }
.kv { display: grid; grid-template-columns: minmax(7.5rem, 12.5rem) minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: var(--fs-sm); }
/* label/value rows: the value gets the remaining width; in a narrow box (a side panel, a phone) the label sits above its value (Q-1d) */
:where(*):has(> .kv) { container-type: inline-size; }
@container (max-width: 459px) { .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; } .kv dd { margin-bottom: 10px; } }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 500; }

/* ---------- Drawer / modal (static presentation) ---------- */
.modal-demo { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-lg); max-width: 560px; }
.modal-demo .card-header { border-bottom: 1px solid var(--border); }

/* ================= Shells ================= */

/* Prototype banner (always on top) */
.proto-banner { background: #2b3440; color: #f2efe9; font-size: var(--fs-xs); padding: 6px 16px; text-align: center; }
.proto-banner a { color: #fff; font-weight: 600; }
.proto-banner strong { color: #ffd98a; }
/* Top announcement banner (Q-2f): info = deep plum, urgent = dark red; both keep white text above 7:1 */
.yf-banner { background: #3a1a3d; color: #fff; font-size: var(--fs-sm); }
.yf-banner-urgent { background: #8a1c1c; }
.yf-banner-in { display: flex; align-items: center; gap: 12px; padding-block: 8px; }
.yf-banner p { margin: 0; flex: 1; line-height: 1.45; }
.yf-banner a.yf-banner-link { color: #fff; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.yf-banner a.yf-banner-link:focus-visible, .yf-banner-close:focus-visible { outline: 3px solid #ffd98a; outline-offset: 2px; }
.yf-banner-close { flex: none; display: inline-grid; place-items: center; min-width: var(--tap); min-height: var(--tap); border: 0; background: transparent; color: #fff; cursor: pointer; border-radius: 8px; }
.yf-banner-close:hover { background: rgba(255,255,255,.14); }
.yf-banner-close svg { width: 18px; height: 18px; }
/* the place a banner link scrolls to (/#spotlight, MCP-02) stops below the sticky header */
#spotlight { scroll-margin-top: calc(var(--yf-header-h, 76px) + 16px); }


/* Quick exit — fixed, always reachable */
.quick-exit { position: fixed; inset-inline-end: 16px; bottom: 16px; z-index: 60; display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap);
  padding: 12px 20px; border-radius: var(--r-pill); background: var(--text); color: var(--bg); border: 0; font: inherit; font-weight: 650; box-shadow: var(--shadow-lg); cursor: pointer; text-decoration: none; }
.quick-exit:hover { color: var(--bg); background: color-mix(in srgb, var(--text) 85%, var(--accent)); }
.quick-exit small { font-weight: 500; opacity: .75; font-size: 11px; }
@media (min-width: 720px) { .quick-exit { top: 88px; bottom: auto; } }

/* Public header: see "Public website shell" at the end */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; }
.brand:hover { color: var(--text); }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); display: grid; place-items: center; color: var(--on-accent); }
.brand small { display: block; font-weight: 500; font-size: 11px; color: var(--muted); }
.header-actions { display: flex; gap: var(--s-2); align-items: center; margin-inline-start: auto; }
@media (min-width: 1024px) { .header-actions { margin-inline-start: 0; } }
.lang-switch { display: inline-flex; border: 1px solid var(--border); border-radius: var(--r-pill); padding: 2px; }
.lang-switch button { border: 0; background: none; padding: 6px 12px; border-radius: var(--r-pill); font: inherit; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); cursor: pointer; min-height: 34px; }
.lang-switch button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-strong); }
.menu-btn { display: inline-grid; } @media (min-width: 1024px) { .menu-btn { display: none; } }

.feature-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: var(--s-3); }
.page-head { padding-block: var(--s-6) var(--s-4); }

/* Workspace shell (staff / admin / platform) */
.ws { display: grid; grid-template-columns: 1fr; min-height: 100vh; }
@media (min-width: 1024px) { .ws { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); } }
.ws-sidebar { display: none; background: var(--surface); border-inline-end: 1px solid var(--border); padding: var(--s-4) var(--s-3); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.ws-sidebar.open { display: block; position: fixed; inset-block: 0; inset-inline-start: 0; width: min(86vw, var(--sidebar-w)); z-index: 70; box-shadow: var(--shadow-lg); }
@media (min-width: 1024px) { .ws-sidebar { display: block; } .ws-sidebar.open { position: sticky; width: auto; box-shadow: none; } }
.ws-sidebar .brand { padding: 4px 8px 16px; }
/* Q-11: the department's title under the organisation's name — a long one wraps inside the sidebar (two lines at most), never widens it */
.ws-sidebar .brand { display: flex; max-width: 100%; }
.ws-sidebar .brand > span:last-child { min-width: 0; }
.ws-sidebar .brand small { overflow-wrap: anywhere; line-height: 1.35; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.ws-sidebar .brand-mark { flex: none; }
.dt-fields { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.dt-row .input { min-width: 0; width: 100%; }
.dt-now { overflow-wrap: anywhere; }
.dept-eyebrow { margin: 0 0 2px; font-size: var(--fs-xs, 12px); font-weight: 600; color: var(--muted); overflow-wrap: anywhere; }
.nav-group { margin-top: var(--s-4); }
.nav-group-title { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 0 12px 6px; }
html[lang="ar"] .nav-group-title { text-transform: none; letter-spacing: 0; font-size: var(--fs-xs); }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--r-sm); color: var(--text-2); text-decoration: none; font-size: var(--fs-sm); font-weight: 550; }
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link[aria-current="page"] { background: var(--accent-soft); color: var(--accent-strong); }
.nav-link .icon { width: 18px; height: 18px; }
.nav-link .count { margin-inline-start: auto; font-size: 11px; background: var(--surface-3); color: var(--text-2); padding: 1px 7px; border-radius: var(--r-pill); }
.nav-link .count.urgent { background: var(--warn-soft); color: var(--warn); }
.ws-main { min-width: 0; display: flex; flex-direction: column; }
.ws-topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: var(--s-3); padding: 10px 16px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
@media (min-width: 720px) { .ws-topbar { padding: 10px 24px; } }
.ws-topbar .search { flex: 1; max-width: 480px; }
.ws-content { padding: var(--s-5) 16px var(--s-7); width: 100%; max-width: 1760px; }   /* fluid: wide screens are used (Q-1d, owner 2026-11-09) */
@media (min-width: 720px) { .ws-content { padding: var(--s-6) 24px var(--s-8); } }
@media (min-width: 1440px) { .ws-content { padding-inline: 32px 40px; } }
.ws-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-5); }
.ws-head h1 { font-size: var(--fs-xl); margin: 0; }
.ws-head p { margin: 4px 0 0; color: var(--muted); }
.breadcrumb { font-size: var(--fs-sm); color: var(--muted); margin-bottom: 6px; }
.breadcrumb a { color: var(--muted); }
.role-switch { font-size: var(--fs-xs); }
.role-switch select { font: inherit; font-size: var(--fs-xs); padding: 4px 8px; border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.scrim { display: none; } .scrim.open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 65; }

/* Beneficiary portal shell */
.portal-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.portal-header .container { display: flex; align-items: center; gap: var(--s-3); min-height: 64px; }
.portal-nav { display: none; gap: 4px; margin-inline-start: auto; }
@media (min-width: 900px) { .portal-nav { display: flex; } }
.portal-nav a { padding: 8px 12px; border-radius: var(--r-pill); text-decoration: none; color: var(--text-2); font-size: var(--fs-sm); font-weight: 550; }
.portal-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-strong); }
.portal-main { padding-block: var(--s-6) 120px; }
.tabbar { position: fixed; inset-inline: 0; bottom: 0; z-index: 50; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { display: grid; justify-items: center; gap: 2px; padding: 8px 4px; font-size: 11px; color: var(--muted); text-decoration: none; font-weight: 600; }
.tabbar a[aria-current="page"] { color: var(--accent-strong); }
@media (min-width: 900px) { .tabbar { display: none; } }
.portal-page .quick-exit { bottom: 84px; } @media (min-width: 900px) { .portal-page .quick-exit { bottom: auto; } }

/* External (partner / funder) shell */
.ext-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.ext-header .container { display: flex; align-items: center; gap: var(--s-4); min-height: 64px; }
.ext-tag { font-size: var(--fs-xs); font-weight: 700; padding: 3px 10px; border-radius: var(--r-pill); background: var(--info-soft); color: var(--info); }

/* Design hub */
.hub-group { margin-top: var(--s-6); }
.hub-grid { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.hub-card { display: block; padding: var(--s-4); border-radius: var(--r); border: 1px solid var(--border); background: var(--surface); text-decoration: none; color: var(--text); }
.hub-card:hover { border-color: var(--accent); color: var(--text); box-shadow: var(--shadow); }
.hub-card strong { display: block; }
.hub-card span { font-size: var(--fs-sm); color: var(--muted); }

/* Example-content marker (DECISIONS R-4) */
.example-note { font-size: var(--fs-xs); color: var(--muted); display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; border: 1px dashed var(--border-strong); border-radius: var(--r-pill); }

@media print { .quick-exit, .proto-banner, .yf-banner, .ws-sidebar, .ws-topbar, .tabbar { display: none !important; } }
@media print { .no-print { display: none !important; } }   /* the claim page (G-13): buttons and the signing form stay off the paper */
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Small screens: compact quick exit (no keyboard hint) and brand */
@media (max-width: 719px) {
  .quick-exit { padding: 10px 16px; min-height: 44px; }
  .quick-exit small { display: none; }
  .brand { font-size: var(--fs-sm); line-height: 1.2; }
  .brand small { font-size: 10px; }
  .brand-mark { width: 30px; height: 30px; }
  .lang-switch button { padding: 4px 9px; }
}
.portal-header .container, .ext-header .container { min-width: 0; }
.portal-header .brand, .ext-header .brand { min-width: 0; flex: 0 1 auto; }
@media (max-width: 719px) { .header-actions { gap: 4px; } }

/* Grid/flex children may shrink so wide tables and tab rows scroll inside their own box */
.split > *, .grid > *, .grid-2 > *, .grid-3 > *, .grid-4 > *, .stack > *, .ws-content > *, .card, .card-body, .field { min-width: 0; }
.card-header { flex-wrap: wrap; }
.segmented { flex-wrap: wrap; max-width: 100%; }
.tabs { max-width: 100%; }
.kv dd, .kv dt { min-width: 0; overflow-wrap: break-word; word-break: normal; }   /* a word only breaks when it cannot fit a whole line (long links, codes) */
@media (max-width: 519px) { .kv { grid-template-columns: 1fr; gap: 2px; } .kv dd { margin-bottom: 8px; } }
.btn-block { white-space: normal; text-align: center; }
.table-wrap, .tabs, .card { position: relative; } /* contain .sr-only absolute children inside scrollers */
[tabindex="-1"]:focus { outline: none; }
[hidden] { display: none !important; }
.stat { min-width: 0; } .stat-value { overflow-wrap: anywhere; font-size: clamp(1.25rem, 5.5vw, var(--fs-xl)); }


/* =====================================================================================================
   Public website shell (owner decisions D-22…D-24, 2026-10-15): Youth Foundation logo + serif wordmark, plum + gold palette,
   slim utility bar (about links + safety numbers), main bar with two dropdowns and an always-visible gold Donate button,
   full-height drawer on small screens, donate band, deep-plum footer, floating quick exit. Classes are yf-* so the
   workspace / portal / partner shells keep their calm look (they only use the logo mark). Page-level styles live in site.css.
   Contrast (WCAG 2.2 AA, checked): white on plum #5b2a5e 10.9:1 · plum on #faf7f2 10.2:1 · plum on plum-soft #f4eaf3 9.2:1 ·
   ink #2e1430 on gold #e0bb5e 9.3:1 · gold #f1d98a on footer #2a1230 11:1 · #e9dbe8 on #2a1230 12.7:1 · gold text only on dark plum.
   ===================================================================================================== */
:root {
  --yf-plum: #5b2a5e; --yf-plum-strong: #451e48; --yf-plum-soft: #f4eaf3; --yf-plum-tint: #fbf6fa;
  /* plum used AS TEXT (on page and plum-soft/tint surfaces): lighter in dark mode. --yf-plum itself stays a background colour (white text on it). */
  --yf-plum-text: #5b2a5e;
  --yf-deep: #3a1a3d; --yf-ink: #2a1230; --yf-on-deep: #f7eef6; --yf-on-deep-2: #e9dbe8;
  --yf-gold: #c9a24a; --yf-gold-2: #f1d98a; --yf-gold-btn: #e0bb5e; --yf-gold-ink: #2e1430; --yf-warm: #f1d98a;
  --yf-serif: Georgia, "Times New Roman", "Noto Serif", serif;
  --yf-header-h: 76px;
}
body[data-shell="public"] {
  background: var(--bg);
  --accent: #5b2a5e; --accent-strong: #451e48; --accent-soft: #f4eaf3; --on-accent: #ffffff; --focus: #6b2f70;
  --sage-soft: #f6efe0;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body[data-shell="public"] { --accent: #dcb3df; --accent-strong: #ecd0ee; --accent-soft: #33203a; --on-accent: #2a1230; --focus: #f1d98a; --sage-soft: #2e2618;
    /* D-48: the brand surfaces and plum text follow the theme too — before, they stayed light while the text tokens turned light (invisible text) */
    --yf-plum-soft: #33203a; --yf-plum-tint: #241a2a; --yf-plum-text: #ecd0ee; }
}
:root[data-theme="dark"] body[data-shell="public"] { --accent: #dcb3df; --accent-strong: #ecd0ee; --accent-soft: #33203a; --on-accent: #2a1230; --focus: #f1d98a; --sage-soft: #2e2618;
  --yf-plum-soft: #33203a; --yf-plum-tint: #241a2a; --yf-plum-text: #ecd0ee; }
html.yf-locked, html.yf-locked body { overflow: hidden; }

/* logo mark in every shell (workspace, portal, partner, funder, platform keep their own colours) */
.brand-mark-logo { background: #3a1a3d; padding: 4px; overflow: hidden; }
.brand-mark-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* gold Donate button */
.btn-gold { background: linear-gradient(135deg, var(--yf-gold-btn) 0%, var(--yf-gold-2) 100%); border: 1px solid #c9a24a; color: var(--yf-gold-ink); font-weight: 750; }
.btn-gold:hover, .btn-gold[aria-current="page"] { background: linear-gradient(135deg, #d4ad4f 0%, #ecd27c 100%); color: var(--yf-gold-ink); border-color: #b18b36; }
.yf-heart { width: 1.1em; height: 1.1em; flex: none; }
.btn-gold:focus-visible { outline: 3px solid var(--yf-plum); outline-offset: 2px; }
.yf-on-dark .btn-gold:focus-visible, .yf-footer .btn-gold:focus-visible, .yf-donate-band .yf-heart { width: 1.1em; height: 1.1em; flex: none; }
.btn-gold:focus-visible { outline-color: #fff; }

/* utility bar */
.yf-util { background: var(--yf-deep); color: var(--yf-on-deep); font-size: .8125rem; line-height: 1.4; }
.yf-util-in { display: flex; align-items: center; justify-content: space-between; gap: 6px 20px; min-height: 36px; padding-block: 5px; flex-wrap: wrap; }
.yf-util-sos { margin: 0; display: inline-flex; align-items: center; flex-wrap: wrap; gap: 0 2px; }
.yf-util-sos .icon { width: 14px; height: 14px; margin-inline-end: 6px; color: var(--yf-gold-2); flex: none; }
.yf-util a { color: #fff; font-weight: 700; text-decoration-color: rgba(255, 255, 255, .45); }
.yf-util a:hover { color: var(--yf-gold-2); }
.yf-util a.yf-needhelp { color: var(--yf-gold-2); }
.yf-util :focus-visible, .yf-footer :focus-visible { outline-color: #fff; }
.yf-util-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 18px; }
.yf-util-nav a { font-weight: 550; text-decoration: none; color: var(--yf-on-deep-2); }
.yf-util-nav a:hover, .yf-util-nav a[aria-current="page"] { color: #fff; text-decoration: underline; }
.yf-dot { margin-inline: 8px; opacity: .6; }
.yf-util-short { display: none; }
@media (max-width: 899px) { .yf-util-long { display: none; } .yf-util-short { display: inline; } }
@media (max-width: 1099px) { .yf-util-nav { display: none; } .yf-util-in { justify-content: center; } }

/* SEO-06 (layout shift, audit 2026-11-20: CLS 0.12–0.29 on home, About and website pages): the utility bar and the header are drawn by
   app.js once it starts (up to 0.6 s on a first visit); until then their height is kept above <main>, so the page does not jump down
   when they arrive (body.shell-on is set in the same step as the header is drawn). Only while scripts run: without them, no empty band.
   SEO-07: the band is the body's padding, not <main>'s margin — a margin collapses through <body>, so <body> itself moved up by the
   band's height when the header arrived (Lighthouse: "body.shell-on", CLS 0.12 on every public page). */
@media (scripting: enabled) {
  body[data-shell="public"]:not(.shell-on) { padding-top: calc(36px + var(--yf-header-h, 76px) + 1px); }
}

/* header */
.yf-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--surface) 97%, transparent); border-bottom: 1px solid var(--border); backdrop-filter: saturate(1.4) blur(8px); }
.yf-header::after { content: ""; position: absolute; inset-inline: 0; bottom: -1px; height: 2px; background: linear-gradient(90deg, var(--yf-plum), var(--yf-gold) 60%, var(--yf-gold-2)); opacity: .9; }
.yf-bar { display: flex; align-items: center; gap: var(--s-5); min-height: var(--yf-header-h); }
.yf-brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); min-width: 0; flex: none; }
.yf-brand:hover { color: var(--text); }
.yf-brand-mark { width: 46px; height: 46px; border-radius: 50%; background: radial-gradient(circle at 50% 45%, #6b3570 0%, #3a1a3d 100%); display: grid; place-items: center; flex: none; box-shadow: 0 2px 10px rgba(58, 26, 61, .28); }
.yf-brand-mark .yf-logo { width: 34px; height: 34px; object-fit: contain; display: block; }
.yf-brand-text { display: grid; line-height: 1.1; min-width: 0; }
.yf-brand-text strong { font-family: var(--yf-serif); font-size: 1.125rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; color: var(--yf-plum); }
.yf-brand-text small { font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); font-weight: 600; white-space: nowrap; margin-top: 3px; }
html[lang="ar"] .yf-brand-text strong { font-family: var(--font-ar); letter-spacing: 0; text-transform: none; font-size: 1.1875rem; }
html[lang="ar"] .yf-brand-text small { letter-spacing: 0; text-transform: none; font-size: 12px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .yf-brand-text strong { color: var(--yf-gold-2); } }
:root[data-theme="dark"] .yf-brand-text strong { color: var(--yf-gold-2); }

.yf-nav { display: none; }
.yf-nav > ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 2px; }
.yf-nav li { position: relative; }
.yf-top { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 8px 12px; border: 0; background: none; border-radius: 10px; font: inherit; font-size: .9375rem; font-weight: 650; color: var(--text-2); text-decoration: none; cursor: pointer; white-space: nowrap; position: relative; }
.yf-top:hover, .yf-has-dd.is-open > .yf-top { color: var(--accent-strong); background: var(--accent-soft); }
.yf-top[aria-current="page"], .yf-has-dd.is-current > .yf-top { color: var(--accent-strong); }
.yf-top[aria-current="page"]::after, .yf-has-dd.is-current > .yf-top::after { content: ""; position: absolute; inset-inline: 12px; bottom: 3px; height: 2px; border-radius: 2px; background: var(--yf-gold); }
.yf-chev { width: 16px; height: 16px; transition: transform .18s ease; opacity: .7; }
[aria-expanded="true"] > .yf-chev { transform: rotate(180deg); }
.yf-dd { position: absolute; inset-inline-start: 0; top: 100%; padding-top: 10px; min-width: 248px; z-index: 60; }
.yf-dd ul { list-style: none; margin: 0; padding: 8px; background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--yf-gold); border-radius: 14px; box-shadow: 0 18px 48px rgba(42, 18, 48, .18); display: grid; gap: 2px; }
.yf-dd a { display: block; padding: 10px 14px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 550; font-size: .9375rem; }
.yf-dd a:hover, .yf-dd a:focus-visible { background: var(--accent-soft); color: var(--accent-strong); }
.yf-dd a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-strong); font-weight: 650; }

.yf-actions { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; flex: none; }
.yf-lang { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: var(--r-pill); padding: 3px; background: var(--surface); }
.yf-lang button { border: 0; background: none; min-width: 36px; min-height: 32px; padding: 0 8px; border-radius: var(--r-pill); font: inherit; font-size: .8125rem; font-weight: 700; color: var(--muted); cursor: pointer; line-height: 1; }
.yf-lang button[lang="ar"] { font-family: var(--font-ar); font-size: 1rem; }
.yf-lang button:hover { color: var(--accent-strong); }
.yf-lang button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-strong); }
.yf-lang-sep { width: 1px; height: 16px; background: var(--border); margin-inline: 1px; }
.yf-donate { min-height: 44px; padding: 10px 20px; white-space: nowrap; }
.yf-icon-link { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; text-decoration: none; padding: 0; flex: none; }
.yf-icon-link:hover { color: var(--accent-strong); border-color: var(--accent); background: var(--accent-soft); }
.yf-icon-link .icon { width: 20px; height: 20px; }
.yf-menu-btn { border-color: transparent; background: var(--surface-2); }
@media (min-width: 1100px) {
  .yf-nav { display: block; }
  .yf-menu-btn { display: none; }
}
@media (max-width: 1279px) { .yf-brand-text small { display: none; } }
@media (min-width: 1100px) and (max-width: 1279px) { .yf-bar { gap: var(--s-3); } .yf-top { padding-inline: 9px; } .yf-brand-text strong { letter-spacing: .08em; font-size: 1.0625rem; } }
@media (max-width: 719px) {
  :root { --yf-header-h: 64px; }
  .yf-bar { gap: var(--s-2); }
  .yf-brand { gap: 9px; }
  .yf-brand-mark { width: 38px; height: 38px; }
  .yf-brand-mark .yf-logo { width: 28px; height: 28px; }
  .yf-brand-text strong { font-size: .9375rem; letter-spacing: .07em; }
  .yf-signin, .yf-actions > .yf-lang { display: none; }
  .yf-actions { gap: 6px; }
  .yf-donate { padding: 8px 14px; min-height: 40px; font-size: var(--fs-sm); }
}
@media (max-width: 420px) { .yf-brand { gap: 7px; } .yf-brand-text strong { font-size: .8125rem; letter-spacing: .04em; } .yf-donate { padding: 8px 11px; gap: 5px; } .yf-actions { gap: 4px; } .yf-menu-btn { width: 42px; height: 42px; } }
@media (max-width: 360px) { .yf-brand-text strong { font-size: .75rem; letter-spacing: .02em; } .yf-brand-mark { width: 34px; height: 34px; } }

/* drawer (small screens) */
.yf-drawer { position: fixed; inset: 0; z-index: 90; background: var(--surface); overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; animation: yf-in .18s ease-out; }
@keyframes yf-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.yf-drawer[hidden] { display: none; }
.yf-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: 10px 16px; min-height: 64px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.yf-drawer nav { padding: 8px 8px 0; }
.yf-m-list, .yf-m-list ul { list-style: none; margin: 0; padding: 0; }
.yf-m-list > li { border-bottom: 1px solid var(--border); }
.yf-m-top { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 56px; padding: 8px 12px; border: 0; background: none; font: inherit; font-size: 1.125rem; font-weight: 650; color: var(--text); text-decoration: none; text-align: start; cursor: pointer; border-radius: 10px; }
.yf-m-top:hover { color: var(--accent-strong); }
.yf-m-top .yf-chev { width: 20px; height: 20px; }
.yf-m-top[aria-current="page"], .yf-m-group.is-current > .yf-m-top { color: var(--accent-strong); }
.yf-m-group ul { margin: 0 0 14px; margin-inline-start: 14px; padding-inline-end: 8px; display: grid; gap: 2px; border-inline-start: 2px solid var(--yf-gold); }
.yf-m-group ul a { display: block; padding: 11px 14px; border-radius: 10px; color: var(--text-2); text-decoration: none; font-weight: 550; margin-inline-start: 6px; }
.yf-m-group ul a:hover, .yf-m-group ul a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-strong); }
.yf-drawer-foot { margin-top: auto; padding: 20px 16px 96px; display: grid; gap: 12px; background: var(--surface-2); }
.yf-drawer-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.yf-drawer-row a { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text-2); text-decoration: none; min-height: 44px; }
.yf-drawer-row a .icon { width: 18px; height: 18px; }
.yf-drawer-sos { margin: 0; font-size: var(--fs-sm); color: var(--text-2); }
.yf-drawer-sos a { font-weight: 700; }

/* quick exit on the public website: a compact pill at the bottom end, above everything (also above the drawer) */
body[data-shell="public"] .quick-exit { top: auto; bottom: 20px; inset-inline-end: 20px; z-index: 100; min-height: 44px; padding: 10px 18px; font-size: var(--fs-sm); box-shadow: 0 10px 30px rgba(42, 18, 48, .3); background: #1e1a22; color: #fff; }
body[data-shell="public"] .quick-exit .icon { width: 18px; height: 18px; }
@media (max-width: 719px) { body[data-shell="public"] .quick-exit { bottom: 14px; inset-inline-end: 12px; padding: 9px 14px; } }

/* donate band (every public page except the donate page; section key "donate-band") */
.yf-donate-band { position: relative; overflow: hidden; background: linear-gradient(120deg, #4a2150 0%, #5b2a5e 55%, #6e3a72 100%); color: #fff; }
.yf-donate-band::before { content: ""; position: absolute; inset: 0; background: radial-gradient(50% 120% at 100% 0%, rgba(241, 217, 138, .22), transparent 60%); pointer-events: none; }
.yf-db-in { position: relative; display: grid; gap: 18px 32px; align-items: center; padding-block: clamp(32px, 5vw, 52px); grid-template-columns: auto minmax(0, 1fr); }
@media (min-width: 900px) { .yf-db-in { grid-template-columns: auto minmax(0, 1fr) auto; } }
.yf-db-mark { width: 72px; height: 72px; border-radius: 50%; background: rgba(255, 255, 255, .08); border: 1px solid rgba(241, 217, 138, .35); display: grid; place-items: center; }
.yf-db-mark img { width: 52px; height: 52px; object-fit: contain; }
.yf-db-copy h2 { color: #fff; margin: 0 0 6px; font-family: var(--yf-serif); font-size: clamp(1.375rem, 2.6vw, 1.875rem); line-height: 1.2; font-weight: 700; }
html[lang="ar"] .yf-db-copy h2 { font-family: var(--font-ar); }
.yf-db-copy p { margin: 0; color: var(--yf-on-deep-2); max-width: 60ch; }
.yf-db-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; grid-column: 1 / -1; }
@media (min-width: 900px) { .yf-db-actions { grid-column: auto; } }
.yf-db-more { color: var(--yf-gold-2); font-weight: 650; }
.yf-db-more:hover { color: #fff; }
.yf-donate-band :focus-visible { outline-color: #fff; }
@media (max-width: 519px) { .yf-db-mark { width: 52px; height: 52px; } .yf-db-mark img { width: 38px; height: 38px; } }

/* footer */
.yf-footer { background: var(--yf-ink); color: var(--yf-on-deep-2); font-size: .9375rem; padding-block: 64px 0; margin-top: 0; border-top: 3px solid var(--yf-gold); }
.yf-footer a { color: var(--yf-on-deep); text-decoration: none; }
.yf-footer a:hover { color: var(--yf-gold-2); text-decoration: underline; }
.yf-foot-grid { display: grid; gap: 36px 24px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.yf-foot-about { grid-column: 1 / -1; }
.yf-foot-help { grid-column: 1 / -1; }
@media (min-width: 720px) { .yf-foot-help { grid-column: auto; } }
@media (min-width: 1024px) { .yf-foot-grid { grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)); } .yf-foot-about, .yf-foot-help { grid-column: auto; } }
.yf-footer .yf-brand { color: #fff; }
.yf-footer .yf-brand-text strong { color: var(--yf-gold-2); }
.yf-footer .yf-brand-text small { color: var(--yf-on-deep-2); display: block; }
.yf-foot-about p { margin: 16px 0 18px; max-width: 40ch; line-height: 1.6; }
.yf-footer .yf-foot-donate, .yf-footer .yf-foot-donate:hover { color: var(--yf-gold-ink); text-decoration: none; }
.yf-foot-col h2 { font-size: .8125rem; text-transform: uppercase; letter-spacing: .08em; color: var(--yf-gold-2); margin: 4px 0 14px; font-weight: 700; }
html[lang="ar"] .yf-foot-col h2 { text-transform: none; letter-spacing: 0; font-size: .9375rem; }
.yf-foot-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.yf-foot-help li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.yf-foot-help strong { color: #fff; font-size: 1.0625rem; }
.yf-foot-help span { font-size: var(--fs-sm); }
/* social accounts (Q-2c3): footer icon row on every public page + icon buttons on /p/social-media; 44px targets, works in RTL (flex order follows dir) */
.yf-foot-social { margin-top: 22px; }
.yf-foot-social-h { margin: 0 0 8px; font-weight: 650; color: var(--yf-on-deep); }
.yf-social { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.yf-social-ico { width: 20px; height: 20px; fill: currentColor; flex: none; }
.yf-footer a.yf-social-link { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .28); color: var(--yf-on-deep); }
.yf-footer a.yf-social-link:hover { color: var(--yf-gold-2); border-color: var(--yf-gold-2); text-decoration: none; }
.pg-social { gap: 10px; margin-block: 8px 24px; }
.pg-social .yf-social-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding-inline: 16px; }
@media print { .yf-social-ico { display: none; } }
.yf-foot-bottom { margin-top: 56px; padding-block: 22px 92px; border-top: 1px solid rgba(255, 255, 255, .12); display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; font-size: var(--fs-sm); }
.yf-foot-bottom p { margin: 0; }
.yf-foot-bottom ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.yf-foot-bottom a { font-weight: 650; }
@media (min-width: 720px) { .yf-foot-bottom { padding-bottom: 28px; } }
/* SEO-02: the plain footer in the served HTML (profile links + registration line, written by the build); app.js replaces it with .yf-footer */
.yf-foot-static { background: var(--yf-ink); color: var(--yf-on-deep-2); font-size: var(--fs-sm); padding-block: 22px; border-top: 3px solid var(--yf-gold); }
.yf-foot-static a { color: var(--yf-on-deep); }
.yf-foot-static :focus-visible { outline-color: #fff; }
.yf-foot-static p { margin: 0 0 10px; }
.yf-foot-static ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
@media print { .yf-util, .yf-header, .yf-drawer, .yf-footer, .yf-foot-static, .yf-donate-band { display: none !important; } }

/* admin launch checklist (workspace overview + settings) */
.launch-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 2px; }
.launch-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 4px; border-top: 1px solid var(--border); }
.launch-item .grow { min-width: 0; flex: 1; }
.launch-ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--muted); }
.launch-ic .icon { width: 18px; height: 18px; }
.launch-done { background: var(--success-soft); color: var(--success); }
.launch-todo { background: var(--warn-soft); color: var(--warn); }
.launch-partial { background: var(--info-soft); color: var(--info); }
.launch-act { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 560px) { .launch-item { flex-wrap: wrap; } .launch-act { width: 100%; justify-content: flex-start; padding-inline-start: 44px; } }

/* Foolproof inputs (owner rule 2026-10-16): checks and suggestions shown right under the field */
.field-note { margin-top: 6px; font-size: var(--fs-sm); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.field-note p { margin: 0; flex-basis: 100%; }
.field-note.is-warn { background: var(--warn-soft); border-radius: var(--r); padding: 10px 12px; }
.field-note.is-error { color: var(--danger); font-weight: 600; }
.input[aria-invalid="true"], .select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.confirm-dialog { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); padding: var(--s-5, 24px); width: min(460px, calc(100vw - 32px)); }
.confirm-dialog::backdrop { background: rgba(10, 12, 16, .45); }
.confirm-dialog h2 { font-size: var(--fs-md); margin: 0 0 8px; }
.confirm-dialog .cd-body { margin: 0 0 20px; color: var(--muted); }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
/* dark theme: the danger colour is light (#e59a92) — white text on it is 2.2:1, so solid danger buttons use near-black text (≈ 9:1) */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-danger-solid { color: #1f0f0e; } }
:root[data-theme="dark"] .btn-danger-solid { color: #1f0f0e; }
.btn[aria-busy="true"] { opacity: .7; cursor: progress; }
.secret-box { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.secret-box code { font-size: 1.05rem; letter-spacing: .06em; padding: 8px 12px; background: var(--surface-2); border-radius: var(--r); user-select: all; word-break: break-all; }
.choice-cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.choice-card { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border); border-radius: var(--r); padding: 12px 14px; cursor: pointer; background: var(--surface); }
.choice-card:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-soft); }
.choice-card input { margin-top: 4px; }
.choice-card strong { display: block; }
.choice-card span { color: var(--muted); font-size: var(--fs-sm); }
/* Every field explains itself (owner 2026-10-16): what to put here + a realistic example, under the label */
.field-help { font-size: var(--fs-sm); color: var(--muted); margin: 0; line-height: 1.5; overflow-wrap: anywhere; }
/* grid items may shrink below their content (a long address or input must not push a card past its column) */
.grid-2 > *, .grid-3 > * { min-width: 0; }
.field-example { font-size: var(--fs-sm); color: var(--muted); margin: 0; line-height: 1.5; }
.field-example > b { font-weight: 600; color: var(--text); }
.field-error-text { color: var(--danger); font-size: var(--fs-sm); font-weight: 600; margin: 4px 0 0; }
.select-explain { background: var(--surface-2); border-radius: var(--r); padding: 8px 12px; }
.choice-cards input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Phones: platform / partner / funder pages get a sideways tab row; the header keeps its buttons tappable */
.ext-tabs { display: none; }
@media (max-width: 899px) {
  .ext-tabs { display: flex; gap: 4px; overflow-x: auto; padding: 6px 16px 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .ext-tabs::-webkit-scrollbar { display: none; }
  .ext-tabs a { flex: none; padding: 8px 14px; border-radius: var(--r-pill); text-decoration: none; color: var(--text-2); font-size: var(--fs-sm); font-weight: 550; background: var(--surface-2); min-height: 40px; display: inline-flex; align-items: center; }
  .ext-tabs a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-strong); }
}
.ext-header .icon-btn, .ext-header .avatar, .portal-header .icon-btn { flex: none; }
@media (max-width: 519px) {
  .ext-header .container { gap: 8px; }
  .ext-header .ext-tag { display: none; }
  .ext-header .brand > span:not(.brand-mark) { display: none; }
  .ext-header .lang-switch { margin-inline-start: auto; }
}
/* Phones: list rows wrap (text on its own line, buttons underneath) instead of being cut off */
@media (max-width: 519px) {
  .list-item { flex-wrap: wrap; }
  .list-item > .grow { flex-basis: calc(100% - 48px); }
  .list-item > .btn, .list-item > .row > .btn { flex: 1 1 auto; justify-content: center; }
}
/* Phones: wide tables marked .table-stack become one card per row, each value labelled with its column */
@media (max-width: 719px) {
  table.table-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.table-stack, table.table-stack tbody, table.table-stack tr, table.table-stack td { display: block; width: 100%; }
  table.table-stack tr { border-bottom: 1px solid var(--border); padding: 10px 14px; }
  table.table-stack td { padding: 4px 0; border: 0; display: flex; gap: 10px; justify-content: space-between; align-items: center; text-align: end; }
  table.table-stack td::before { content: attr(data-label); font-weight: 600; color: var(--muted); font-size: var(--fs-xs); text-align: start; flex: none; max-width: 45%; }
  table.table-stack td[data-label=""]::before { content: none; }
  table.table-stack td:empty { display: none; }
  table.table-stack .team-email { white-space: normal; overflow-wrap: anywhere; }
}
/* TEAM-01: a sign-in e-mail on the team list stays on one line on wide screens (no letter-by-letter wrapping) */
.team-email { white-space: nowrap; }
/* Placing the old website's records (D-33): Imported records, Website inbox, Applications, Safeguarding */
.pl-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pl-notes li { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-sm); line-height: 1.55; }
.pl-notes li > .icon { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--muted); }
.pl-notes li.is-warn > .icon { color: var(--warn); } .pl-notes li.is-ok > .icon { color: var(--success); }
.pl-progress-text { font-size: var(--fs-sm); margin: 6px 0 0; }
.flag-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.badge.badge-long { white-space: normal; line-height: 1.35; text-align: start; }
.reveal-section { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--border); }
.reveal-section > h3 { font-size: var(--fs-sm); margin: 0 0 4px; }
details.raw-copy > summary { cursor: pointer; font-weight: 600; font-size: var(--fs-sm); padding: 6px 0; }
.row-flash > td { animation: row-flash 2.4s ease-out 1; }
@keyframes row-flash { from { background: var(--accent-soft); } to { background: transparent; } }
td.detail-cell { background: var(--surface-2); }
/* long labels wrap instead of pushing a dialog (or the page) sideways on phones: one-tap answers in dialogs, the placement actions */
form[role="dialog"] .btn-sm { white-space: normal; text-align: start; }
@media (max-width: 519px) { #pl-actions .btn, #in-close .btn, #app-imported .btn { white-space: normal; text-align: center; } }
/* action cells of the placement tables wrap: a long button label never pushes the table sideways (1366 px) or off a phone screen */
#im-subs td .btn-sm, #held-rows td .btn-sm, #im-accts td .btn-sm, #im-ops td .btn-sm, #in-rows td .btn-sm, #urgent-body td .btn-sm, #pl-results td .btn-sm { white-space: normal; text-align: center; }
/* Safeguarding centre: the urgent queue and the incidents fit their cards at 1366 px (headers and status badges may wrap) */
#urgent-table th, #inc-table th { white-space: normal; }
#urgent-body .badge, #inc-table .badge { white-space: normal; }
#urgent-table .ref, #inc-table .ref { white-space: nowrap; }
@media (max-width: 719px) { table.table-stack td.detail-cell { display: block; text-align: start; } }

/* =====================================================================================================
   Shared helpers (simplicity pass D-30, 2026-10-18): design samples, search-and-pick, one-time codes, undo, money, reasons,
   calm load / role states, the avatar menu, the portal "More" sheet, larger text. Logical properties only (RTL works as is).
   ===================================================================================================== */
/* Design-prototype sample rows and figures (data-example) never show to real users: hidden from the first paint, shown again as
   soon as a page writes real content into them (app.js). Only the design prototype (<html class="design-prototype">) shows them. */
html:not(.design-prototype) [data-example] { display: none !important; }

/* Workspace top bar at 360 px: icon buttons keep their full size, the search box shrinks instead (test-dashboards-11) */
.ws-topbar .icon-btn, .ws-topbar .avatar, .ws-topbar .ws-me { flex: none; }
.ws-topbar .search { min-width: 0; }
.ls-short { display: none; }
@media (max-width: 519px) {
  .ws-topbar { gap: 6px; padding-inline: 10px; }
  .ws-topbar .ls-long { display: none; } .ws-topbar .ls-short { display: inline; }
  .ws-topbar .lang-switch button { padding: 4px 9px; min-width: 34px; }
  .ws-topbar .ws-signout { display: none; }   /* "Sign out" is in the avatar menu on phones */
}
.search-hint { position: absolute; inset-inline-start: 0; top: calc(100% + 6px); z-index: 40; margin: 0; padding: 8px 12px; border-radius: var(--r); background: var(--text); color: var(--bg); font-size: var(--fs-sm); box-shadow: var(--shadow-lg); max-width: min(90vw, 360px); }

/* avatar menu */
.ws-me { position: relative; }
.ws-me-btn { border: 0; cursor: pointer; font: inherit; font-size: 11px; font-weight: 650; padding: 0; }
.ws-me-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.ws-me-menu { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); z-index: 60; width: min(300px, calc(100vw - 24px)); background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 6px; }
.ws-me-who { margin: 0; padding: 10px 12px 8px; border-bottom: 1px solid var(--border); display: grid; gap: 2px; }
.ws-me-who span { font-size: var(--fs-xs); color: var(--muted); }
.ws-me-item { display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 10px 12px; min-height: 44px; border: 0; background: none; border-radius: var(--r-sm); color: var(--text); text-decoration: none; font: inherit; text-align: start; cursor: pointer; }
.ws-me-item:hover, .ws-me-item:focus-visible { background: var(--surface-2); color: var(--text); }
.ws-me-item .icon { margin-top: 2px; color: var(--muted); }
.ws-me-item span { display: grid; gap: 1px; } .ws-me-item small { color: var(--muted); font-size: var(--fs-xs); }
.ws-me-item[hidden] { display: none !important; }
/* FUND-02a: the bell's list — what waits for this person, opened in place from the top bar (app.js bindBell) */
.ws-bell { position: relative; flex: none; }
.ws-bell-menu { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); z-index: 60; width: min(400px, calc(100vw - 24px)); max-height: min(70vh, 560px); overflow-y: auto; overscroll-behavior: contain; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 6px; }
.ws-bell-head { margin: 0; padding: 10px 12px 8px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 8px; } .ws-bell-head span { color: var(--muted); font-size: var(--fs-sm); }
.ws-bell-list { list-style: none; margin: 0; padding: 0; }
.ws-bell-item { padding: 10px 12px; border-bottom: 1px solid var(--border); display: grid; gap: 4px; } .ws-bell-item.is-urgent { border-inline-start: 3px solid var(--danger, #b42318); }
.ws-bell-title { margin: 0; font-size: var(--fs-sm); font-weight: 600; overflow-wrap: anywhere; } .ws-bell-title a { color: var(--text); text-decoration: none; } .ws-bell-title a:hover, .ws-bell-title a:focus-visible { text-decoration: underline; }
.ws-bell-note { margin: 0; font-size: var(--fs-sm); color: var(--text); overflow-wrap: anywhere; }
.ws-bell-sub { margin: 0; font-size: var(--fs-xs); color: var(--muted); }
.ws-bell-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.ws-bell-empty { margin: 0; padding: 14px 12px; color: var(--muted); font-size: var(--fs-sm); }
.ws-bell-foot { margin: 0; padding: 10px 12px 6px; font-size: var(--fs-sm); }
@media (max-width: 719px) { .ws-bell { position: static; } .ws-bell-menu { inset-inline: 10px; width: auto; top: calc(100% + 6px); } }
/* Guided menu and locks (G-03): "My work" first, the rest folded under "More"; CareOS.lock = not open yet, with the reason. Tokens and logical properties only. */
button.nav-link { width: 100%; border: 0; background: none; font: inherit; font-size: var(--fs-sm); font-weight: 550; text-align: start; cursor: pointer; min-height: 40px; }
.nav-focus { margin-top: var(--s-4); }
.nav-focus .nav-group { margin-top: 0; }
.nav-more-wrap, .nav-choice-group { margin-top: var(--s-3); padding-top: var(--s-3); border-top: 1px solid color-mix(in srgb, var(--muted) 35%, transparent); }
.nav-more .nav-more-chev { transition: transform .15s ease; }
.nav-more[aria-expanded="true"] .nav-more-chev { transform: rotate(180deg); }
.nav-more-list > .nav-group:first-child { margin-top: var(--s-3); }
.nav-choice { margin-top: var(--s-3); color: var(--muted); font-weight: 500; }
.nav-link.nav-more:hover, .nav-link.nav-choice:hover { background: color-mix(in srgb, currentColor 10%, transparent); color: var(--text); }
.nav-choice span { white-space: normal; overflow-wrap: anywhere; }
.is-locked { cursor: not-allowed; }
.is-locked > .lock-ic, .lock-reason > .icon { width: 14px; height: 14px; flex: none; }
.tabs [role="tab"].is-locked { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.tabs [role="tab"].is-locked[aria-selected="true"] { border-bottom-color: transparent; }
.btn.is-locked > .lock-ic { margin-inline-end: 6px; }
.lock-reason { display: flex; align-items: flex-start; gap: 8px; margin: var(--s-2) 0 0; padding: 2px 6px; border-radius: var(--r-sm); font-size: var(--fs-sm); color: var(--text-2); overflow-wrap: anywhere; }
.lock-reason > .icon { margin-top: 4px; color: var(--muted); }
.lock-reason b { font-weight: 600; color: var(--text); }
.lock-notes { display: grid; gap: 2px; margin: calc(-1 * var(--s-3)) 0 var(--s-4); }
.lock-notes .lock-reason { margin: 0; }
.lock-flash { animation: lock-flash 1.8s ease-out; }
@keyframes lock-flash { 0%, 40% { background: var(--warn-soft); } 100% { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .nav-more .nav-more-chev { transition: none; } .lock-flash { animation: none; background: var(--warn-soft); } }
/* end guided menu and locks */

/* CareOS.picker — search and pick */
.picker { position: relative; }
.picker > .input { padding-left: 44px; padding-right: 44px; }   /* both sides: the box is dir=auto, so a Latin name in an Arabic page starts on the left, where the × sits */
.picker-clear { position: absolute; inset-inline-end: 4px; top: 4px; width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); border-radius: var(--r-pill); cursor: pointer; }
.picker-clear:hover { background: var(--surface-2); color: var(--text); }
/* P-01B: the "show all choices" button of a list picker; the × moves beside it. The box is dir=auto, so its padding is set by the PAGE's side. */
.picker-toggle { position: absolute; inset-inline-end: 4px; top: 4px; width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); border-radius: var(--r-pill); cursor: pointer; }
.picker-toggle:hover { background: var(--surface-2); color: var(--text); }
.picker.has-toggle .picker-clear { inset-inline-end: 42px; }
.picker.has-toggle > .input { padding-left: 12px; padding-right: 86px; }
[dir="rtl"] .picker.has-toggle > .input { padding-left: 86px; padding-right: 12px; }
.picker-list { position: absolute; inset-inline: 0; top: calc(var(--tap) + 4px); z-index: 70; margin: 0; padding: 4px; list-style: none; max-height: min(320px, 50vh); overflow-y: auto; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r); box-shadow: var(--shadow-lg); }
.picker-opt { display: grid; gap: 1px; padding: 9px 12px; min-height: 44px; border-radius: var(--r-sm); cursor: pointer; }
.picker-opt.is-active, .picker-opt:hover { background: var(--accent-soft); color: var(--accent-strong); }
.picker-opt[aria-selected="true"] .picker-label::after { content: " ✓"; }
.picker-opt[aria-disabled="true"] { cursor: not-allowed; }
.picker-opt[aria-disabled="true"] .picker-label { text-decoration: line-through; text-decoration-thickness: 1px; }
.picker-label { font-weight: 600; overflow-wrap: anywhere; } .picker-sub { font-size: var(--fs-sm); color: var(--muted); overflow-wrap: anywhere; }
.picker-note { padding: 10px 12px; color: var(--muted); font-size: var(--fs-sm); }

/* CareOS.secretCard — shown once */
.secret-card { border: 2px solid var(--accent); border-radius: var(--r-lg); background: var(--accent-soft); padding: var(--s-4) var(--s-5); display: grid; gap: 12px; margin-block: var(--s-4); }
.secret-head { display: flex; gap: 10px; align-items: center; } .secret-head .icon { color: var(--accent-strong); width: 22px; height: 22px; }
.secret-head h2 { font-size: var(--fs-md); margin: 0; }
.secret-note { margin: 0; color: var(--text-2); font-size: var(--fs-sm); }
.secret-item { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 10px 12px; }
.secret-label { flex-basis: 100%; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }
.secret-value { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.25rem; letter-spacing: .08em; overflow-wrap: anywhere; user-select: all; flex: 1 1 auto; min-width: 0; }
.secret-actions { justify-content: flex-end; }
@media (max-width: 519px) { .secret-card { padding: var(--s-4); } .secret-value { font-size: 1.1rem; } .secret-actions .btn { flex: 1 1 auto; white-space: normal; } }

/* CareOS.undoToast */
.undo-toast { position: fixed; inset-inline: 16px; bottom: 96px; z-index: 92; margin-inline: auto; max-width: 520px; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 12px 12px 14px; padding-inline-start: 18px; border-radius: 14px; background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); overflow: hidden; }
.undo-msg { flex: 1 1 120px; min-width: 0; font-size: var(--fs-sm); line-height: 1.45; }
.undo-btn { background: var(--bg); color: var(--text); border-color: var(--bg); font-weight: 700; }
.undo-btn:hover { background: var(--surface-2); color: var(--text); }
.undo-x { color: var(--bg); width: 40px; height: 40px; } .undo-x:hover { background: rgba(255, 255, 255, .12); }
.undo-bar { position: absolute; inset-inline-start: 0; bottom: 0; height: 3px; width: 100%; background: var(--accent); transform-origin: 0 50%; animation: undo-count linear forwards; }
html[dir="rtl"] .undo-bar { transform-origin: 100% 50%; }
.undo-toast.is-paused .undo-bar { animation-play-state: paused; }
@keyframes undo-count { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.portal-page .undo-toast { bottom: 140px; }

/* money: £ before the box */
.money-field { position: relative; display: block; }
.money-field > .money-sign { position: absolute; left: 14px; top: 0; height: var(--tap); display: flex; align-items: center; color: var(--muted); font-weight: 600; pointer-events: none; }
.money-field > .input { padding-left: 30px; }

/* CareOS.reasonField — one-tap reasons */
.reason-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.reason-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 14px; border: 1px solid var(--border-strong); border-radius: var(--r-pill); background: var(--surface); cursor: pointer; font-weight: 500; font-size: var(--fs-sm); }
.reason-chip input { accent-color: var(--accent); margin: 0; }
.reason-chip:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); box-shadow: inset 0 0 0 1px var(--accent); }
.reason-chip:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.reason-details { margin-top: var(--s-2); }

/* calm states */
.load-failed { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; padding: var(--s-4); border-radius: var(--r); background: var(--warn-soft); border-inline-start: 4px solid var(--warn); text-align: start; }
.load-failed > .icon { color: var(--warn); }
.load-failed-title { margin: 0; font-weight: 650; }
td.state-cell { padding: var(--s-3); } li.state-item { padding: var(--s-3); list-style: none; }
.not-for-role { max-width: 560px; margin-block: var(--s-5); text-align: center; display: grid; justify-items: center; gap: var(--s-2); }
.not-for-role h2 { font-size: var(--fs-lg); margin: 0; } .not-for-role p { margin: 0 0 var(--s-2); color: var(--text-2); }
.nfr-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--sealed-soft); color: var(--sealed); }
.nfr-icon .icon { width: 24px; height: 24px; }

/* long tab rows on phones become a "Section" list (casework-62) */
.tabs-select { display: none; margin-bottom: var(--s-4); }
@media (max-width: 599px) { .tabs-select { display: grid; } .tabs.tabs-many { display: none; } }

/* beneficiary portal: "More" tab and sheet (test-dashboards-10) */
.tabbar-more { display: grid; justify-items: center; gap: 2px; padding: 8px 4px; font: inherit; font-size: 11px; font-weight: 600; color: var(--muted); background: none; border: 0; cursor: pointer; }
.tabbar-more.is-current, .tabbar-more[aria-expanded="true"] { color: var(--accent-strong); }
.portal-more { position: fixed; inset: 0; z-index: 95; background: rgba(10, 12, 16, .45); display: flex; align-items: flex-end; }
.portal-more[hidden] { display: none !important; }
.portal-more-sheet { width: 100%; max-height: 85vh; overflow-y: auto; background: var(--surface); border-radius: 18px 18px 0 0; padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-lg); }
.portal-more-sheet h2 { font-size: var(--fs-md); margin: 0; }
.portal-more-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; }
.portal-more-list a { display: flex; gap: 12px; align-items: flex-start; padding: 12px; min-height: 48px; border-radius: var(--r); color: var(--text); text-decoration: none; }
.portal-more-list a:hover, .portal-more-list a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-strong); }
.portal-more-list a span { display: grid; gap: 2px; } .portal-more-list small { color: var(--muted); font-size: var(--fs-sm); }
.portal-more-sos { margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--border); font-size: var(--fs-sm); }
.portal-more-sos a { font-weight: 700; }
@media (min-width: 900px) { .portal-more { display: none !important; } }

/* "Larger text" (portal accessibility preference): everything sized in rem grows with it */
html.larger-text { font-size: 118.75%; }
html.larger-text .tabbar a, html.larger-text .tabbar-more { font-size: 12px; }
/* deep link target (app.js): where "Go there" landed */
.deep-target { outline: 3px solid var(--accent, #7a3b7d); outline-offset: 4px; border-radius: 8px; transition: outline-color .6s; }

/* each section of the workspace menu has its own colour (owner 2026-11-08): title, icons and the current page */
.nav-group[data-group="operations"] { --grp: #0f766e; }
.nav-group[data-group="programmes"] { --grp: #7c3aed; }
.nav-group[data-group="organisation"] { --grp: #1d4ed8; }
.nav-group[data-group="governance"] { --grp: #be123c; }
.nav-group[data-group="system"] { --grp: #b45309; }
.nav-group[data-group="funding"] { --grp: #166534; }
.nav-group[data-group="website"] { --grp: #a21caf; }
.nav-group[data-group] .nav-group-title { color: var(--grp); display: flex; align-items: center; gap: 8px; }
.nav-group[data-group] .nav-group-title::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--grp); flex: none; }
.nav-group[data-group] .nav-link .icon { color: var(--grp); }
.nav-group[data-group] .nav-link[aria-current="page"] { background: color-mix(in srgb, var(--grp) 13%, transparent); color: var(--grp); box-shadow: inset 3px 0 0 var(--grp); }
html[dir="rtl"] .nav-group[data-group] .nav-link[aria-current="page"] { box-shadow: inset -3px 0 0 var(--grp); }
.nav-group[data-group] .nav-link:hover { background: color-mix(in srgb, var(--grp) 8%, transparent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .nav-group[data-group] { --grp-l: color-mix(in srgb, var(--grp) 55%, white); } :root:not([data-theme="light"]) .nav-group[data-group] .nav-group-title, :root:not([data-theme="light"]) .nav-group[data-group] .nav-link .icon, :root:not([data-theme="light"]) .nav-group[data-group] .nav-link[aria-current="page"] { color: var(--grp-l); } }
:root[data-theme="dark"] .nav-group[data-group] .nav-group-title, :root[data-theme="dark"] .nav-group[data-group] .nav-link .icon, :root[data-theme="dark"] .nav-group[data-group] .nav-link[aria-current="page"] { color: color-mix(in srgb, var(--grp) 55%, white); }

/* ---- Dashboard styles (D-43, chosen in the Control centre): sidebar, main colour and each section's colour ----
   classic = the default look above. Dark sidebars set their own text colours; the main colour changes only in the light theme. */
html[data-ws-style="classic"] .nav-group[data-group="operations"] { --grp: #0f766e; }
html[data-ws-style="plum"] .ws-sidebar { background: linear-gradient(180deg, #3a1a3d 0%, #2b1230 100%); border-inline-end-color: transparent; --text: #ffffff; --text-2: #efdff0; --muted: #cdb4cf; }
html[data-ws-style="plum"] .nav-group[data-group="operations"] { --grp: #f1d98a; }
html[data-ws-style="plum"] .nav-group[data-group="programmes"] { --grp: #f0a8dc; }
html[data-ws-style="plum"] .nav-group[data-group="organisation"] { --grp: #a9d0ff; }
html[data-ws-style="plum"] .nav-group[data-group="governance"] { --grp: #ffb3b8; }
html[data-ws-style="plum"] .nav-group[data-group="system"] { --grp: #ffd08a; }
html[data-ws-style="plum"] .nav-group[data-group="funding"] { --grp: #a7f3a0; }
html[data-ws-style="plum"] .nav-group[data-group="website"] { --grp: #f5b3ff; }
html[data-ws-style="ocean"] .ws-sidebar { background: linear-gradient(180deg, #0d2b47 0%, #0a1f35 100%); border-inline-end-color: transparent; --text: #ffffff; --text-2: #dbe9f7; --muted: #a9c1da; }
html[data-ws-style="ocean"] .nav-group[data-group="operations"] { --grp: #67e8f9; }
html[data-ws-style="ocean"] .nav-group[data-group="programmes"] { --grp: #c4b5fd; }
html[data-ws-style="ocean"] .nav-group[data-group="organisation"] { --grp: #93c5fd; }
html[data-ws-style="ocean"] .nav-group[data-group="governance"] { --grp: #fda4af; }
html[data-ws-style="ocean"] .nav-group[data-group="system"] { --grp: #fcd34d; }
html[data-ws-style="ocean"] .nav-group[data-group="funding"] { --grp: #86efac; }
html[data-ws-style="ocean"] .nav-group[data-group="website"] { --grp: #f0abfc; }
html[data-ws-style="forest"] .ws-sidebar { background: #eef5ee; border-inline-end-color: #d6e6d6; }
html[data-ws-style="forest"] .nav-group[data-group="operations"] { --grp: #2f6b3a; }
html[data-ws-style="forest"] .nav-group[data-group="programmes"] { --grp: #8a5a00; }
html[data-ws-style="forest"] .nav-group[data-group="organisation"] { --grp: #1f6f78; }
html[data-ws-style="forest"] .nav-group[data-group="governance"] { --grp: #a33b3b; }
html[data-ws-style="forest"] .nav-group[data-group="system"] { --grp: #5b6b2f; }
html[data-ws-style="forest"] .nav-group[data-group="funding"] { --grp: #166534; }
html[data-ws-style="forest"] .nav-group[data-group="website"] { --grp: #86198f; }
html[data-ws-style="slate"] .ws-sidebar { background: #1f2430; border-inline-end-color: transparent; --text: #ffffff; --text-2: #e2e6ee; --muted: #a6aebd; }
html[data-ws-style="slate"] .nav-group[data-group="operations"] { --grp: #5eead4; }
html[data-ws-style="slate"] .nav-group[data-group="programmes"] { --grp: #a5b4fc; }
html[data-ws-style="slate"] .nav-group[data-group="organisation"] { --grp: #7dd3fc; }
html[data-ws-style="slate"] .nav-group[data-group="governance"] { --grp: #f9a8d4; }
html[data-ws-style="slate"] .nav-group[data-group="system"] { --grp: #fdba74; }
html[data-ws-style="slate"] .nav-group[data-group="funding"] { --grp: #86efac; }
html[data-ws-style="slate"] .nav-group[data-group="website"] { --grp: #f0abfc; }
/* dark sidebars: current page and hover stay readable */
html[data-ws-style="plum"] .nav-group[data-group] .nav-link[aria-current="page"], html[data-ws-style="ocean"] .nav-group[data-group] .nav-link[aria-current="page"],
html[data-ws-style="slate"] .nav-group[data-group] .nav-link[aria-current="page"] { background: color-mix(in srgb, var(--grp) 20%, transparent); color: #ffffff; }
html[data-ws-style="plum"] .nav-group[data-group] .nav-link:hover, html[data-ws-style="ocean"] .nav-group[data-group] .nav-link:hover,
html[data-ws-style="slate"] .nav-group[data-group] .nav-link:hover { background: rgba(255, 255, 255, .08); color: #ffffff; }
html[data-ws-style="plum"] .ws-sidebar .count, html[data-ws-style="ocean"] .ws-sidebar .count, html[data-ws-style="slate"] .ws-sidebar .count { background: rgba(255, 255, 255, .16); color: #ffffff; }
html[data-ws-style="plum"] .ws-sidebar :focus-visible, html[data-ws-style="ocean"] .ws-sidebar :focus-visible, html[data-ws-style="slate"] .ws-sidebar :focus-visible { outline-color: #ffffff; }
/* the dark-mode lightening of section colours is only for the light sidebars */
html[data-ws-style="plum"] .nav-group[data-group] .nav-group-title, html[data-ws-style="ocean"] .nav-group[data-group] .nav-group-title, html[data-ws-style="slate"] .nav-group[data-group] .nav-group-title,
html[data-ws-style="plum"] .nav-group[data-group] .nav-link .icon, html[data-ws-style="ocean"] .nav-group[data-group] .nav-link .icon, html[data-ws-style="slate"] .nav-group[data-group] .nav-link .icon { color: var(--grp); }
/* main colour (buttons, links, focus) — light theme only; the dark theme keeps its own */
@media not (prefers-color-scheme: dark) { :root[data-ws-style="plum"]:not([data-theme="dark"]) body[data-shell="workspace"] { --accent: #6b2f70; --accent-strong: #4e1f52; --accent-soft: #f4eaf3; --focus: #6b2f70; } }
@media not (prefers-color-scheme: dark) { :root[data-ws-style="ocean"]:not([data-theme="dark"]) body[data-shell="workspace"] { --accent: #1d5f99; --accent-strong: #154a78; --accent-soft: #e5eff9; --focus: #1d5f99; } }
@media not (prefers-color-scheme: dark) { :root[data-ws-style="forest"]:not([data-theme="dark"]) body[data-shell="workspace"] { --accent: #2f6b3a; --accent-strong: #23522c; --accent-soft: #e6f1e7; --focus: #2f6b3a; } }
@media not (prefers-color-scheme: dark) { :root[data-ws-style="slate"]:not([data-theme="dark"]) body[data-shell="workspace"] { --accent: #4f46e5; --accent-strong: #3d35b8; --accent-soft: #ecebfc; --focus: #4f46e5; } }
/* the Control centre's style picker */
.style-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.style-card { border: 2px solid var(--border); border-radius: 14px; padding: 10px; cursor: pointer; background: var(--surface); text-align: start; font: inherit; color: inherit; display: flex; flex-direction: column; gap: 8px; }
.style-card[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.style-prev { display: flex; height: 64px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.style-prev .sb { width: 38%; padding: 8px 6px; display: flex; flex-direction: column; gap: 6px; }
.style-prev .sb i { display: block; height: 6px; border-radius: 3px; }
.style-prev .mn { flex: 1; background: var(--bg); display: flex; align-items: flex-end; padding: 8px; }
.style-prev .mn b { display: block; width: 46px; height: 14px; border-radius: 7px; }

/* D-48: placeholders use the theme's muted text (4.5:1+ on the field background in light and dark); the browser default grey failed on dark fields */
input::placeholder, textarea::placeholder, .input::placeholder, .textarea::placeholder { color: var(--muted); opacity: 1; }

/* an added language written right to left (B-I18N-1): texts not translated yet are English — each line takes its own direction, so
   English punctuation stays at the end of the sentence instead of jumping to the wrong side */
html.lang-added[dir="rtl"] :is(.proto-banner, p, li, h1, h2, h3, h4, h5, h6, a, span, label, td, th, button, dd, dt, summary, legend, small, strong, b) { unicode-bidi: plaintext; }

/* In-app navigation between workspace sections (Q-1): the shell stays; only the content area fades, with a skeleton while a section loads */
.ws-content > * { transition: opacity .12s ease; }
.ws-content.nav-out > * { opacity: 0; }
.ws-content.nav-wait { position: relative; min-height: 70vh; }
.ws-content.nav-wait::before {
  content: ""; position: absolute; inset-block-start: var(--s-6); inset-inline: 24px; height: 320px; border-radius: var(--r-md, 12px);
  background:
    linear-gradient(var(--surface-3) 0 0) 0 0 / 34% 28px no-repeat,
    linear-gradient(var(--surface-2) 0 0) 0 44px / 58% 14px no-repeat,
    linear-gradient(var(--surface) 0 0) 0 88px / 100% 96px no-repeat,
    linear-gradient(var(--surface) 0 0) 0 200px / 49% 120px no-repeat,
    linear-gradient(var(--surface) 0 0) 100% 200px / 49% 120px no-repeat;
  animation: nav-pulse 1.1s ease-in-out infinite alternate;
}
html[dir="rtl"] .ws-content.nav-wait::before { transform: scaleX(-1); }
.ws-content.nav-wait::after { content: ""; position: absolute; inset-block-start: 0; inset-inline-start: 0; height: 3px; width: 40%; border-radius: 3px; background: var(--accent); animation: nav-bar 1s ease-in-out infinite; }
@keyframes nav-pulse { from { opacity: .55; } to { opacity: 1; } }
@keyframes nav-bar { from { inset-inline-start: 0; width: 10%; } 50% { width: 40%; } to { inset-inline-start: 90%; width: 10%; } }
@media (prefers-reduced-motion: reduce) { .ws-content > * { transition: none; } .ws-content.nav-wait::before, .ws-content.nav-wait::after { animation: none; } }
/* long addresses in code (e.g. the Google sign-in return address on Marketing) wrap instead of widening the page on phones */
.ws-content code { overflow-wrap: anywhere; }
/* Mail (Q-10/M-02, D-96): her own mailbox and her department's, read only — the Messages page's list + conversation layout */
.mail-tools { display: grid; gap: var(--s-3); }
.mail-tools-row { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: flex-end; }
.mail-box-field { margin: 0; flex: 1 1 260px; min-width: 0; }
.mail-box-field select { width: 100%; }
.mail-search { display: flex; gap: var(--s-2); flex: 1 1 260px; min-width: 0; }
.mail-search .search { flex: 1 1 auto; min-width: 0; }
.mail-reasons { border: 0; padding: 0; margin: 0 0 var(--s-3); display: grid; gap: var(--s-2); }
.mail-list { margin: 0; padding: 0; list-style: none; }
.mail-li + .mail-li, .mail-li + .mail-row, .mail-row + .mail-li { border-top: 1px solid var(--border); }
button.mail-row { width: 100%; border: 0; background: none; font: inherit; color: inherit; text-align: start; cursor: pointer; align-items: flex-start; }
button.mail-row:hover { background: var(--surface-2); }
button.mail-row[aria-current="true"] { background: var(--accent-soft); }
.mail-row .grow { display: grid; gap: 2px; min-width: 0; }
.mail-row .title, .mail-row .sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.mail-unread .mail-who, .mail-unread .mail-subject { font-weight: 700; color: var(--text); }
.mail-snippet { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mail-date { flex: none; font-size: var(--fs-sm); color: var(--muted); }
.mail-badges { margin-top: 4px; }
.mail-locked { color: var(--muted); }
.mail-locked .title { font-weight: 600; }
.mail-more { padding: var(--s-3) var(--s-4); margin: 0; border-top: 1px solid var(--border); }
.mail-th { font-size: var(--fs-lg); margin: 0 0 var(--s-3); overflow-wrap: anywhere; }
.mail-th:focus { outline: none; } .mail-th:focus-visible { outline: 2px solid var(--focus, var(--accent)); outline-offset: 2px; }
.mail-class, .mail-notice { margin-bottom: var(--s-4); }
.mail-why { margin: 6px 0 0; padding-inline-start: 18px; }
/* M-08: the reading assistant's summary (Mail) and "Mail today" (Overview) */
.mail-sum { margin-bottom: var(--s-4); padding: var(--s-3) var(--s-4); border: 1px solid var(--border); border-inline-start: 3px solid var(--accent); border-radius: var(--radius, 8px); background: var(--surface-2, transparent); min-width: 0; }
.mail-sum-h { font-size: var(--fs-sm); margin: 0 0 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mail-sum-text { margin: 0 0 6px; overflow-wrap: anywhere; line-height: 1.5; }
.mail-sum-why { font-size: var(--fs-sm); }
.mail-sum-why summary { cursor: pointer; width: fit-content; max-width: 100%; padding: 4px 0; min-height: 28px; }
.mail-sum-why ul { margin: 6px 0; padding-inline-start: 18px; }
.mail-digest h2 { font-size: var(--fs-md); margin: 0 0 4px; }
.mail-digest-list { list-style: none; margin: var(--s-3) 0 0; padding: 0; display: grid; gap: var(--s-3); }
.mail-digest-list li { min-width: 0; padding-top: var(--s-3); border-top: 1px solid var(--border); }
.mail-digest-acts { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: var(--s-3) 0 0; }
.mail-links { margin-top: var(--s-2); display: flex; flex-wrap: wrap; gap: var(--s-2); }
.mail-msg { padding: var(--s-4) 0; border-top: 1px solid var(--border); }
.mail-msg-head { display: grid; gap: 2px; margin-bottom: var(--s-3); overflow-wrap: anywhere; }
.mail-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.mail-files { list-style: none; margin: var(--s-3) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-2); }
.mail-files li { min-width: 0; max-width: 100%; }
.mail-files .btn { max-width: 100%; overflow: hidden; } .mail-files .btn span[dir] { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-foot { margin-top: var(--s-3); }
@media (min-width: 1024px) { .mail-split .back-to-list { display: none; } }
/* Mail M-03 (D-99): the composer, the send countdown */
.mail-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-3); }
.mail-msg-draft { background: var(--surface-2); padding-inline: var(--s-3); border-radius: var(--r); }
.mail-compose .mail-c-fields { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: var(--s-3); }
.mail-compose .field { margin: 0; min-width: 0; }
.mail-compose .input { width: 100%; max-width: 100%; box-sizing: border-box; }
.mail-c-text { min-height: 12rem; resize: vertical; line-height: 1.55; }
/* M-04 mail and records: filing under a conversation; a record's mail panel */
.mail-filing { margin-top: var(--s-4); padding-top: var(--s-3); border-top: 1px solid var(--border); display: grid; gap: var(--s-2); min-width: 0; }
.mail-filing-h, .mail-rec-sub { font-size: var(--fs-md); margin: 0; }
.mail-filed { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.mail-filed li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); min-width: 0; }
.mail-filed .grow, .mail-rec-head .grow { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.mail-picker { padding: var(--s-3); background: var(--surface-2); border-radius: var(--r); min-width: 0; }
.mail-picker-row { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: flex-end; }
.mail-picker-row .field { margin: 0; min-width: 0; flex: 1 1 160px; } .mail-picker-row .input { width: 100%; box-sizing: border-box; }
.mail-save { display: grid; gap: var(--s-2); }
.mail-rec-wrap { margin-top: var(--s-5, 24px); min-width: 0; }
.mail-rec-h { font-size: var(--fs-md); margin: 0 0 var(--s-2); display: flex; align-items: center; gap: var(--s-2); }
.mail-rec-list { list-style: none; margin: 0; padding: 0; }
.mail-rec-row { padding: var(--s-3) 0; border-top: 1px solid var(--border); min-width: 0; }
.mail-rec-head { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: flex-start; }
.mail-rec-head .mail-actions { margin-top: 0; }
.mail-rec-thread { margin-top: var(--s-2); padding-inline: var(--s-3); background: var(--surface-2); border-radius: var(--r); min-width: 0; }
.mail-rec-sub { margin-top: var(--s-4); }

.mail-c-attach { display: grid; gap: var(--s-2); }
.mail-c-files, .mail-c-doclist { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.mail-c-files li, .mail-c-doclist li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); min-width: 0; overflow-wrap: anywhere; }
.mail-c-fname { min-width: 0; overflow-wrap: anywhere; }
.mail-c-attach-btns { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.mail-c-case { padding: var(--s-3); border: 1px solid var(--border); border-radius: var(--r); }
.mail-c-ref { display: flex; gap: var(--s-2); } .mail-c-ref .input { flex: 1 1 auto; min-width: 0; max-width: 12rem; }
.mail-c-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-4); }
.mail-wait { margin-top: var(--s-3); }
.mail-wait .btn { margin-inline-start: var(--s-2); }
/* M-07: "Waiting to send" and "Simple answers" on the Mail page */
.mail-q-h { font-size: var(--fs-md); margin: 0 0 4px; display: flex; align-items: center; gap: var(--s-2); }
.mail-q-list, .mail-a-list { list-style: none; margin: 0; padding: 0; }
.mail-q-item { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); padding: var(--s-2) 0; border-block-start: 1px solid var(--border); }
.mail-q-item:first-child { border-block-start: 0; }
.mail-q-item .grow { flex: 1 1 14rem; min-width: 0; overflow-wrap: anywhere; }
.mail-a-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2); }
.mail-a-modes { border: 0; margin: 0; padding: 0; display: grid; gap: var(--s-2); min-width: 0; }
.mail-a-modes legend { font-weight: 600; margin-bottom: var(--s-2); padding: 0; }
.mail-a-row { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: flex-end; }
.mail-a-h3 { font-size: var(--fs-md); margin: var(--s-3) 0 4px; }
.mail-a-list li { padding: 2px 0; overflow-wrap: anywhere; }
.mr-answer { padding: var(--s-3) 0; border-block-start: 1px solid var(--border); }
.mr-answer:first-child { border-block-start: 0; }
.mr-answer-head { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.mr-answer-head strong { flex: 1 1 12rem; min-width: 0; overflow-wrap: anywhere; }
.mr-people { width: 100%; border-collapse: collapse; } .mr-people th, .mr-people td { text-align: start; padding: var(--s-2); border-block-start: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }

/* ACC-02: the "Manage account" panel (Team page) and the Department page */
.acc-panel { width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; overflow-x: hidden; }
.acc-panel .acc-head { gap: 8px; flex-wrap: nowrap; align-items: flex-start; }
.acc-panel .acc-head h2 { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.acc-panel .acc-meta { margin: 8px 0; overflow-wrap: anywhere; }
.acc-panel bdi, .dp-page bdi { overflow-wrap: anywhere; }
.acc-proof { border: 1px solid var(--border); border-radius: var(--r-sm); padding: 12px; margin: 12px 0; min-width: 0; }
.acc-fieldset { border: 0; padding: 0; margin: 12px 0; min-width: 0; }
.acc-google { border: 1px solid var(--border); border-radius: var(--r-sm); padding: 12px; }
.acc-sec { border-block-start: 1px solid var(--border); }
.acc-sec > summary { cursor: pointer; font-weight: 600; padding: 10px 0; min-height: 40px; display: flex; align-items: center; gap: 8px; }
.acc-sec .acc-body { padding: 0 0 16px; min-width: 0; }
.acc-sec .acc-body .btn { margin-block-start: 8px; }
.acc-h3 { font-size: var(--fs-sm); margin: 12px 0 4px; }
.acc-list { margin: 0; padding-inline-start: 18px; }
.acc-effects { padding-inline-start: 18px; }
.acc-foot { margin-top: 16px; gap: 8px; flex-wrap: wrap; border-block-start: 1px solid var(--border); padding-block-start: 12px; }
.dp-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.dp-card { min-width: 0; }
.dp-card h3 { font-size: var(--fs-md); margin: 0 0 6px; overflow-wrap: anywhere; }
.dp-perms { display: flex; flex-wrap: wrap; gap: 4px; }
.dp-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.acc-sec > summary::-webkit-details-marker { display: none; }
.acc-sec > summary::before { content: ""; flex: none; width: 8px; height: 8px; border-inline-end: 2px solid currentColor; border-block-end: 2px solid currentColor; transform: rotate(-45deg); margin-inline-end: 4px; }
[dir="rtl"] .acc-sec > summary::before { transform: rotate(45deg); }
.acc-sec[open] > summary::before { transform: rotate(45deg); }
/* ---------- Sign-offs page (SIGN-01, workspace/sign-offs.html): gates, document cards, numbered steps, the Read / Sign dialog ---------- */
.so-page .so-h2 { font-size: var(--fs-md); margin: 0 0 4px; }
.so-page section, .so-page details.so-history { margin-block-start: var(--s-5); scroll-margin-block-start: 72px; }
.so-item { scroll-margin-block-start: 72px; }
.so-gates { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.so-gates > .so-gate { margin-block-start: 0; }
.so-gate { border-inline-start: 6px solid var(--border-strong); min-width: 0; }
.so-gate[data-state="closed"] { border-inline-start-color: var(--warn); }
.so-gate[data-state="signed"] { border-inline-start-color: var(--info); }
.so-gate[data-state="open"] { border-inline-start-color: var(--success); }
.so-gate-title { font-size: var(--fs-sm); margin: 0; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.so-gate-state { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-lg); font-weight: 700; line-height: 1.3; margin: 6px 0 4px; overflow-wrap: anywhere; }
.so-gate-state > .icon { width: 26px; height: 26px; margin-block-start: 2px; }
.so-gate[data-state="closed"] .so-gate-state > .icon { color: var(--warn); }
.so-gate[data-state="signed"] .so-gate-state > .icon { color: var(--info); }
.so-gate[data-state="open"] .so-gate-state > .icon { color: var(--success); }
.so-gate-steps { list-style: none; margin: var(--s-3) 0 0; padding: 0; counter-reset: so-g; }
.so-gate-steps > li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-block-start: 1px solid var(--border); }
.so-step-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.so-step-state { display: inline-flex; gap: 6px; align-items: center; font-size: var(--fs-sm); color: var(--muted); font-weight: 600; }
.so-gate-steps .so-step-state { flex: none; max-width: 40%; text-align: end; }
.so-mark { flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong); margin-block-start: 1px; }
.so-mark[data-done="yes"] { background: var(--success); border-color: var(--success); color: var(--surface); }
.so-mark[data-done="unknown"] { border-style: dashed; }
.so-mark > .icon { width: 14px; height: 14px; stroke-width: 3; }
.so-group { font-size: var(--fs-base); margin: var(--s-5) 0 var(--s-2); }
.so-items { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.so-item { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.so-item > * { margin: 0; }
.so-item-head { display: flex; gap: var(--s-3); justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.so-item-title { font-size: var(--fs-md); margin: 0; min-width: 0; overflow-wrap: anywhere; }
.so-item-id { display: inline-block; font-size: var(--fs-sm); font-weight: 700; padding: 1px 8px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); }
.so-caps, .so-d-sigs, .so-history-list { list-style: none; margin: 0; padding: 0; }
.so-caps > li { display: flex; gap: 8px; align-items: flex-start; padding: 4px 0; overflow-wrap: anywhere; }
.so-signed, .so-outdated { display: flex; gap: 8px; align-items: flex-start; overflow-wrap: anywhere; }
.so-signed > .icon { color: var(--success); } .so-outdated > .icon { color: var(--warn); }
.so-outdated { font-weight: 600; }
.so-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-block-start: auto; padding-block-start: 8px; }
.so-steps { margin: var(--s-3) 0 0; padding-inline-start: 26px; }
.so-steps > .so-step { padding: 10px 0; padding-inline-start: 4px; border-block-start: 1px solid var(--border); overflow-wrap: anywhere; }
.so-steps > .so-step::marker { font-weight: 700; }
.so-step-title { margin: 0; font-weight: 600; }
.so-step-foot { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-block-start: 8px; }
.so-copies { display: grid; gap: 8px; margin-block-start: 8px; }
.so-copy { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; background: var(--surface-2); border-radius: var(--r-sm); padding: 8px 10px; min-width: 0; }
.so-copy-label { font-size: var(--fs-sm); font-weight: 600; flex-basis: 100%; }
.so-copy-value { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; word-break: break-all; text-align: start; }
.so-media-row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
.so-media-status { display: flex; gap: 8px; align-items: flex-start; font-weight: 700; margin: 8px 0 4px; overflow-wrap: anywhere; }
.so-page .alert { margin-block-start: var(--s-3); }
.so-page p.alert > span, .so-dialog p.alert > span { min-width: 0; overflow-wrap: anywhere; }
.so-history > summary { cursor: pointer; min-height: 40px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.so-history > summary .so-h2 { margin: 0; font-weight: 700; }
.so-history-list > li { padding: 10px 0; border-block-start: 1px solid var(--border); overflow-wrap: anywhere; }
.so-history-list p { margin: 0; }
.so-dialog { width: min(860px, calc(100vw - 32px)); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; overflow-x: hidden; padding-block-start: 0; }
.so-d-head { position: sticky; inset-block-start: 0; z-index: 1; display: flex; gap: 8px; justify-content: space-between; align-items: flex-start; background: var(--surface); padding-block: var(--s-4) var(--s-2); border-block-end: 1px solid var(--border); }
.so-d-head h2 { margin: 4px 0 0; min-width: 0; overflow-wrap: anywhere; }
.so-d-bar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; margin-block: var(--s-3); }
.so-lang { display: flex; flex-wrap: wrap; gap: 6px; }
.so-d-meta { overflow-wrap: anywhere; }
.so-doc { border: 1px solid var(--border); border-radius: var(--r); padding: var(--s-4); background: var(--bg); min-width: 0; overflow-wrap: anywhere; line-height: 1.7; }
.so-doc > :first-child { margin-block-start: 0; } .so-doc > :last-child { margin-block-end: 0; }
.so-doc .so-doc-h1 { font-size: var(--fs-lg); margin: 0 0 var(--s-3); }
.so-doc .so-doc-h2 { font-size: var(--fs-md); margin: var(--s-5) 0 var(--s-2); }
.so-doc .so-doc-h3 { font-size: var(--fs-base); margin: var(--s-4) 0 var(--s-2); }
.so-doc ul, .so-doc ol { padding-inline-start: 22px; }
.so-doc li + li { margin-block-start: 4px; }
.so-doc .so-doc-table { margin-block: var(--s-3); }
.so-doc .so-doc-table .table th { white-space: normal; text-transform: none; letter-spacing: 0; font-size: var(--fs-sm); }
.so-doc .so-doc-table .table td { vertical-align: top; min-width: 120px; }
.so-d-h3 { font-size: var(--fs-md); margin: var(--s-5) 0 var(--s-2); }
.so-d-sigs > li { padding: 6px 0; border-block-start: 1px solid var(--border); overflow-wrap: anywhere; }
.so-sign-form { border-block-start: 2px solid var(--border); margin-block-start: var(--s-5); }
.so-sign-form > * + * { margin-block-start: var(--s-3); }
.so-sign-form .acc-fieldset > * + * { margin-block-start: 8px; }
.so-dialog #so-d-result:empty { display: none; }
.so-dialog #so-d-result { margin-block: var(--s-3) 0; }
.so-sign-form .so-read { margin-block: var(--s-3); padding: 12px; border-radius: var(--r-sm); background: var(--accent-soft); }
.so-sign-form .check + .check { margin-block-start: 8px; }
.so-withdraw { width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; }
.so-withdraw h2 { overflow-wrap: anywhere; }

/* ---------- Spotlight Hero outreach (SPOT-01a, D-139): the people list and one person's record (prefix shr-) ---------- */
.shr-h2 { font-size: var(--fs-md); margin: 0; overflow-wrap: anywhere; }
.shr-h2:focus-visible { outline: 3px solid color-mix(in srgb, var(--focus) 45%, transparent); outline-offset: 4px; border-radius: var(--r-sm); }
.shr-h3 { font-size: var(--fs-sm); margin: var(--s-3) 0 0; color: var(--text-2); }
.shr-top { margin-block-end: var(--s-5); }
.shr-top > .alert { margin-block: 0; }
.shr-gate-need { margin: var(--s-3) 0 0; font-weight: 600; }
.shr-gate-link { margin: var(--s-3) 0 0; }
.shr-switch-row { margin-block-start: var(--s-4); }
.shr-form { margin-block-end: var(--s-5); }
.shr-reason { min-height: 96px; }
.shr-filters { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-5); align-items: flex-end; justify-content: space-between; margin-block-end: var(--s-4); }
.shr-chips { gap: var(--s-2); min-width: 0; }
.shr-chips .chip { cursor: pointer; min-height: 36px; font: inherit; font-size: var(--fs-sm); }
.shr-chips .chip[aria-pressed="true"] { font-weight: 650; box-shadow: inset 0 0 0 1px var(--accent); }
.shr-n { font-variant-numeric: tabular-nums; color: var(--muted); }
.shr-chips .chip[aria-pressed="true"] .shr-n { color: inherit; }
.shr-bucket-field { flex: 0 1 240px; min-width: min(100%, 200px); }
.shr-row { align-items: flex-start; }
.shr-row-main, .shr-item-main { min-width: 0; display: grid; gap: 6px; }
.shr-row .title, .shr-item .title { overflow-wrap: anywhere; }
.shr-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.shr-badges .badge > .icon, .shr-sub .badge > .icon { width: 12px; height: 12px; }
.shr-sub { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
/* a stage and its state: always the words, with an icon of its own shape — never colour alone */
.shr-stages { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.shr-stage { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border: 1px solid var(--border); border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); background: var(--surface); max-width: 100%; }
.shr-stage > .icon { width: 14px; height: 14px; stroke-width: 2.4; color: var(--muted); }
.shr-stage[data-state="succeeded"] { border-color: color-mix(in srgb, var(--success) 45%, var(--border)); } .shr-stage[data-state="succeeded"] > .icon { color: var(--success); }
.shr-stage[data-state="failed"] { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); } .shr-stage[data-state="failed"] > .icon { color: var(--danger); }
.shr-stage[data-state="in_progress"] > .icon { color: var(--info); }
.shr-stage[data-state="not_started"] { border-style: dashed; font-weight: 500; color: var(--muted); }
/* the record */
.shr-record > .shr-card { margin-block-start: var(--s-4); }
.shr-card { min-width: 0; }
.shr-narrow { max-width: 360px; }
.shr-stop { border-inline-start: 6px solid var(--border-strong); }
.shr-stop.is-stopped { border-inline-start-color: var(--danger); background: var(--danger-soft); }
.shr-stop-state { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-lg); line-height: 1.3; margin: 0; }
.shr-stop-state > .icon { width: 24px; height: 24px; color: var(--danger); margin-block-start: 2px; }
.shr-need { margin: var(--s-3) 0 0; font-weight: 600; }
.shr-ready { margin-block-start: var(--s-2); }
.shr-actions { margin-block-start: var(--s-3); gap: var(--s-2); }
.shr-approval { display: flex; gap: 8px; align-items: flex-start; margin: var(--s-3) 0 0; overflow-wrap: anywhere; }
.shr-approval > .icon { margin-block-start: 2px; color: var(--muted); }
.shr-approval[data-state="approved"] > .icon { color: var(--success); }
.shr-approval[data-state="changed"] > .icon { color: var(--warn); }
.shr-plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.shr-plain > li { display: flex; gap: 8px; align-items: flex-start; min-width: 0; overflow-wrap: anywhere; }
.shr-plain > li > .icon { width: 16px; height: 16px; margin-block-start: 4px; color: var(--success); }
.shr-reason-text { margin: 0; overflow-wrap: anywhere; }
.shr-url { overflow-wrap: anywhere; unicode-bidi: isolate; }
.shr-list > .list-item { padding-inline: 0; align-items: flex-start; flex-wrap: wrap; }
.shr-item:focus-visible { outline: 3px solid color-mix(in srgb, var(--focus) 45%, transparent); outline-offset: 2px; border-radius: var(--r-sm); }
.shr-bits { display: flex; flex-wrap: wrap; gap: 2px 14px; margin: 0; }
.shr-hint, .shr-value-text { background: var(--surface-2); border-radius: var(--r-sm); padding: 1px 6px; overflow-wrap: anywhere; unicode-bidi: isolate; }
.shr-value { margin: 0; padding: 8px 12px; border-radius: var(--r); background: var(--sealed-soft); overflow-wrap: anywhere; }
.shr-value-text { background: transparent; font-weight: 600; padding: 0; }
.shr-sub-form { margin-block-start: var(--s-4); padding-block-start: var(--s-4); border-block-start: 1px solid var(--border); }
.shr-sub-form > .shr-h3 { margin-block-start: 0; font-size: var(--fs-base); color: var(--text); }
.shr-fieldset > legend { font-size: var(--fs-sm); font-weight: 600; }
.shr-checks { gap: var(--s-2) var(--s-5); }
.shr-crit-picks { gap: var(--s-3); }
.shr-crit-picks > .shr-crit-pick { display: grid; gap: 6px; }
.shr-crit-pick > .select { max-width: 520px; }
.shr-t-label { margin: 0; font-weight: 550; overflow-wrap: anywhere; }
.shr-missing { max-width: 560px; }
/* settings: the criteria editor */
.shr-crit { list-style: none; margin: var(--s-3) 0; padding: 0; display: grid; gap: var(--s-3); }
.shr-crit-row { display: grid; gap: var(--s-2) var(--s-3); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; padding-block-end: var(--s-3); border-block-end: 1px solid var(--border); }
.shr-crit-row > .field + .field { margin-top: 0; }
@media (max-width: 719px) { .shr-crit-row { grid-template-columns: minmax(0, 1fr); } .shr-crit-row > .btn { justify-self: start; } }
.shr-num { max-width: 160px; }
.shr-history { margin-block-start: var(--s-3); }
.shr-history > summary { cursor: pointer; font-weight: 600; font-size: var(--fs-sm); padding: 6px 0; }
.shr-hist-item { padding-inline: 0; flex-wrap: wrap; }

/* ---------- Funding hub (SUP-G2: SUP-NEJOLUU, SUP-WCGHONW) ----------
   One tab row on every funding page (pages/workspace-funding-hub.js), plain-language word explanations ((i) buttons and the
   "What do these words mean?" list), the getting-started guide and the funding lists on Overview (pages/workspace-funding-summary.js).
   Nothing here moves: no transition or animation, so reduced motion needs no exception. */
.fund-hub { min-height: 43px; margin-bottom: var(--s-3); }
.fund-hub a[role="tab"] { display: inline-block; }
@media (max-width: 599px) { .tabs.fund-hub { flex-wrap: wrap; overflow: visible; gap: 0 4px; } .tabs.fund-hub [role="tab"] { padding: 9px 10px; } }
.fund-help { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; margin-bottom: var(--s-4); }
.fund-help .btn { min-height: 36px; }
.fund-words { margin-bottom: var(--s-5); }
.fund-words h2 { font-size: var(--fs-md); margin: 0 0 var(--s-3); }
.fund-words dl { margin: 0; display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.fund-words dt { font-weight: 650; }
.fund-words dd { margin: 2px 0 0; font-size: var(--fs-sm); color: var(--text-2); }
.term-tip { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; margin-inline-start: 4px; vertical-align: middle; border: 0; border-radius: 50%; background: none; color: var(--accent-strong); cursor: pointer; flex: none; }
.term-tip .icon { width: 16px; height: 16px; }
.term-tip:hover, .term-tip[aria-expanded="true"] { background: var(--accent-soft); }
.term-note { position: fixed; z-index: 60; width: max-content; max-width: min(320px, calc(100vw - 16px)); padding: var(--s-3) var(--s-4); border-radius: var(--r); background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); font-size: var(--fs-sm); font-weight: 400; line-height: 1.5; text-align: start; white-space: normal; text-transform: none; letter-spacing: 0; }
.term-note strong { display: block; margin-bottom: 2px; }
.term-note p { margin: 0; }
.fund-next { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-4); align-items: center; justify-content: space-between; margin-bottom: var(--s-5); border-inline-start: 4px solid var(--accent); }
.fund-next.is-late { border-inline-start-color: var(--danger); }
.fund-next .fund-next-label { font-size: var(--fs-sm); color: var(--muted); margin: 0; }
.fund-next .fund-next-what { font-size: var(--fs-md); font-weight: 650; margin: 2px 0 0; }
.fund-next .fund-next-why { margin: 2px 0 0; color: var(--text-2); font-size: var(--fs-sm); }
.fund-late { display: inline-flex; align-items: center; gap: 4px; color: var(--danger); font-weight: 650; }
.fund-late .icon { width: 16px; height: 16px; }
.fund-list .list-item { align-items: flex-start; flex-wrap: wrap; }
.fund-list .list-item .grow { min-width: min(100%, 180px); }
.fund-when { font-size: var(--fs-sm); color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.fund-stages { list-style: none; margin: 0; padding: 0; }
.fund-stages li { display: flex; gap: var(--s-3); align-items: baseline; justify-content: space-between; padding: 10px var(--s-4); }
.fund-stages li + li { border-top: 1px solid var(--border); }
.fund-stages .fund-n { font-weight: 650; font-variant-numeric: tabular-nums; min-width: 2ch; text-align: end; }
.fund-stages .is-zero { color: var(--muted); }
.fund-guide { margin-bottom: var(--s-5); }
.fund-guide ol { list-style: none; margin: 0; padding: 0; counter-reset: fg; }
.fund-guide li { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-3) var(--s-5); counter-increment: fg; }
.fund-guide li + li { border-top: 1px solid var(--border); }
.fund-guide .fund-step-mark { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border-strong); font-size: var(--fs-sm); font-weight: 650; color: var(--text-2); }
.fund-guide .fund-step-mark::before { content: counter(fg); }
.fund-guide li.is-done .fund-step-mark { border-color: var(--success); background: var(--success-soft); color: var(--success); }
.fund-guide li.is-done .fund-step-mark::before { content: none; }
.fund-guide li.is-done .fund-step-mark .icon { width: 16px; height: 16px; }
.fund-guide li:not(.is-done) .fund-step-mark .icon { display: none; }
.fund-home-grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); margin-bottom: var(--s-5); align-items: start; }
.fund-next .fund-next-label { font-weight: 600; }
.fund-next.is-late .fund-next-what .icon { color: var(--danger); vertical-align: -3px; }
.fund-list .list-item > .icon { color: var(--success); flex: none; }
.fund-list .badge .icon { width: 14px; height: 14px; }
.fund-list .list-item .badge { flex: none; max-width: 100%; }
@media (max-width: 479px) { .fund-next .btn { width: 100%; } .fund-stages li { flex-wrap: wrap; } }

/* XFER-01 (D-143) — transfer a task between departments: the decision banner on every workspace page, the one recipient picker
   (assets/recipients.js: Department / Team member tabs, chips), the transfer dialog, and the task's transfer trail. Logical
   properties throughout (right to left), 400 px wide, nothing said by colour alone. */
.xfer-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 16px; background: var(--accent-soft); color: var(--text); border-block-end: 1px solid var(--accent); border-inline-start: 4px solid var(--accent); font-size: var(--fs-sm); line-height: 1.45; }
.xfer-banner > .icon { flex: none; color: var(--accent-strong); }
.xfer-banner-text { flex: 1 1 260px; min-width: 0; margin: 0; overflow-wrap: anywhere; }
.xfer-banner-what { color: var(--text); }
.xfer-banner-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.xfer-banner .btn { min-height: 40px; }
@media (min-width: 1024px) {
  .xfer-banner { position: sticky; top: 0; z-index: 60; }
  .ws-sidebar { top: var(--xfer-h, 0px); height: calc(100vh - var(--xfer-h, 0px)); }
  .ws-topbar { top: var(--xfer-h, 0px); }
}
@media (max-width: 519px) { .xfer-banner-acts { width: 100%; } .xfer-banner-acts .btn { flex: 1 1 auto; } }
@media print { .xfer-banner { display: none !important; } }
/* STRICT-01 (D-156): build/testing mode notice for the super admin — one line, wraps at 360 px */
.build-banner { padding: 8px 16px; background: var(--warn-soft); color: var(--text); border-block-end: 1px solid var(--warn); border-inline-start: 4px solid var(--warn); font-size: var(--fs-sm); line-height: 1.45; }
.build-banner-text { margin: 0; overflow-wrap: anywhere; }
@media print { .build-banner { display: none !important; } }

.rcp { display: grid; gap: 6px; min-width: 0; }
.rcp-tabs { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: var(--surface-2); border-radius: var(--r-pill); justify-self: start; max-width: 100%; }
.rcp-tabs[hidden], .rcp-tabs [role="tab"][hidden] { display: none; }
.rcp-tabs [role="tab"] { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 14px; border: 0; border-radius: var(--r-pill); background: none; font: inherit; font-size: var(--fs-sm); font-weight: 550; color: var(--text-2); cursor: pointer; }
.rcp-tabs [role="tab"][aria-selected="true"] { background: var(--surface); color: var(--text); font-weight: 650; box-shadow: var(--shadow-sm), inset 0 -2px 0 var(--accent); }
.rcp-tabs [role="tab"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rcp-tabs .icon { width: 16px; height: 16px; }
.rcp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.rcp-chips[hidden] { display: none; }
.rcp-chip { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; padding-block: 2px; padding-inline: 12px 2px; border: 1px solid var(--border-strong); border-radius: var(--r-pill); background: var(--surface); font-size: var(--fs-sm); }
.rcp-chip[data-kind="external"] { border-style: dashed; }
.rcp-chip-name { font-weight: 600; overflow-wrap: anywhere; }
.rcp-chip-addr { min-width: 0; color: var(--text-2); overflow-wrap: anywhere; }
.rcp-chip-tag, .picker-tag { font-size: var(--fs-xs); font-weight: 500; color: var(--text-2); border: 1px solid var(--border-strong); border-radius: var(--r-pill); padding: 0 8px; white-space: nowrap; }
.picker-tag { margin-inline-start: 4px; }
.rcp-chip-x { flex: none; display: inline-grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: var(--r-pill); background: none; color: var(--text-2); cursor: pointer; }
.rcp-chip-x:hover { background: var(--surface-2); color: var(--text); }
.rcp-chip-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.rcp-chip-x .icon { width: 14px; height: 14px; }

.xfer-dialog { padding: 0; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); color: var(--text); width: min(520px, calc(100vw - 32px)); max-height: 90vh; box-shadow: var(--shadow-lg); }
.xfer-dialog.xfer-wide { width: min(680px, calc(100vw - 32px)); }
.xfer-dialog[open] { display: flex; flex-direction: column; }
.xfer-dialog::backdrop { background: rgba(10, 12, 16, .45); }
.xfer-form { display: flex; flex-direction: column; flex: 1; min-height: 0; margin: 0; }
.xfer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 8px; }
.xfer-head h2 { font-size: var(--fs-md); margin: 0; min-width: 0; overflow-wrap: anywhere; }
.xfer-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 20px 16px; }
.xfer-wide .xfer-body { min-height: min(540px, 68vh); }   /* room for the picker's list under its box, and one height for all five steps */
.xfer-err { margin: 0; padding: 0 20px 8px; }
.xfer-err[hidden] { display: none; }
.xfer-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; border-block-start: 1px solid var(--border); }
.xfer-what { margin: 0 0 12px; font-weight: 600; overflow-wrap: anywhere; }
.xfer-steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; padding: 0; list-style: none; font-size: var(--fs-sm); color: var(--text-2); }
.xfer-steps li { display: inline-flex; align-items: center; gap: 6px; padding-block: 2px; padding-inline: 2px 10px; border: 1px solid var(--border); border-radius: var(--r-pill); }
.xfer-step-n { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); font-size: var(--fs-xs); font-weight: 650; }
.xfer-steps li[aria-current="step"] { border-color: var(--accent); border-width: 2px; color: var(--text); font-weight: 650; }
.xfer-steps li[aria-current="step"] .xfer-step-n { background: var(--accent); color: var(--on-accent, #fff); }
.xfer-steps li.is-done { border-style: dashed; }
.xfer-h { font-size: var(--fs-md); margin: 0 0 12px; }
.xfer-items, .xfer-more, .xfer-presets { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
.xfer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.xfer-list .xfer-list { margin-block-start: 8px; }
.xfer-list .icon { width: 16px; height: 16px; vertical-align: -3px; color: var(--text-2); }
.xfer-list .check > span { min-width: 0; overflow-wrap: anywhere; }
.xfer-parts { padding-inline-start: 30px; }
.xfer-msgs { margin-block-start: 6px; padding-inline-start: 30px; }
.xfer-msgs summary { cursor: pointer; min-height: 32px; color: var(--accent-strong); font-size: var(--fs-sm); font-weight: 550; }
.xfer-msgs summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.xfer-more-btns { gap: 8px; flex-wrap: wrap; margin-block: 8px; }
.xfer-uploads li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.xfer-uploads:empty { display: none; }
.xfer-lib { margin-block-start: 8px; padding: 12px; border: 1px solid var(--border); border-radius: var(--r); max-height: 220px; overflow-y: auto; }
.xfer-total { margin: 0; color: var(--text-2); }
.xfer-keep { grid-template-columns: 1fr; }
.xfer-decider { margin: 8px 0 12px; color: var(--text-2); }
.xfer-decider:empty { display: none; }
.xfer-note { white-space: pre-wrap; overflow-wrap: anywhere; }
.xfer-sum .xfer-list { gap: 4px; }
@media (max-width: 599px) {
  .xfer-dialog, .xfer-dialog.xfer-wide { width: 100vw; max-width: 100vw; height: 100vh; height: 100dvh; max-height: 100vh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .xfer-head, .xfer-body, .xfer-foot, .xfer-err { padding-inline: 16px; }
  .xfer-steps li:not([aria-current]) .xfer-step-l { display: none; }
  .xfer-steps li:not([aria-current]) { padding-inline: 2px; }
  .xfer-foot .btn { flex: 1 1 auto; }
}

.xfer-sec { margin-block-start: 20px; }
.xfer-sec > h3 { font-size: var(--fs-sm); margin: 0 0 8px; }
.xfer-trail { list-style: none; margin: 0; padding: 0; padding-inline-start: 16px; display: grid; gap: 12px; border-inline-start: 2px solid var(--border); font-size: var(--fs-sm); }
.xfer-trail li { position: relative; min-width: 0; overflow-wrap: anywhere; }
.xfer-trail li::before { content: ""; position: absolute; inset-inline-start: -22px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.xfer-when { display: block; color: var(--text-2); font-size: var(--fs-xs); }
.xfer-reason { margin: 4px 0 0; padding-inline-start: 10px; border-inline-start: 3px solid var(--border-strong); color: var(--text-2); }
.xfer-pack li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.xfer-pack .btn { max-width: 100%; }
.xfer-thread-box { flex: 1 1 100%; min-width: 0; }
.xfer-thread-box[hidden] { display: none; }
.xfer-decide { display: flex; flex-wrap: wrap; gap: 8px; margin-block-start: 8px; }
.xfer-comment-text { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.xfer-rule { margin-block: 16px 0; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r); }
.xfer-rule legend { padding-inline: 6px; }

/* ---------- Assistant (AI-01, D-144): the floating button and chat panel on every workspace page (aia-); its settings page (ais-) ----------
   Layers: the button 64 (under the menu's scrim 65, the sidebar 70 and drawers 90), the panel 88. Logical properties only, so the corner
   and the bubbles mirror in Arabic. Meaning is never colour alone: every state has an icon and words. */
.aia-fab { position: fixed; inset-inline-end: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 64; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: var(--tap); min-height: var(--tap); padding-block: 0; padding-inline: 14px 18px; border-radius: var(--r-pill); border: 1px solid var(--accent-strong); background: var(--accent); color: var(--on-accent);
  font: inherit; font-weight: 600; cursor: pointer; box-shadow: var(--shadow-lg); }
.aia-fab:hover { background: var(--accent-strong); }
.aia-fab[aria-expanded="true"] { background: var(--surface); color: var(--accent-strong); border-color: var(--accent); }
.aia-fab[aria-busy="true"] { cursor: progress; }
.aia-fab .icon { width: 22px; height: 22px; }
body.aia-on .ws-content { padding-block-end: calc(var(--tap) + 48px); }   /* the last line of a page can always be scrolled clear of the button */
.aia-panel { position: fixed; inset-inline-end: 16px; bottom: calc(28px + var(--tap) + env(safe-area-inset-bottom, 0px)); z-index: 88; width: min(400px, calc(100vw - 32px)); height: min(640px, 80vh); max-height: calc(100vh - var(--tap) - 44px);
  display: flex; flex-direction: column; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.aia-panel[hidden] { display: none; }
.aia-head { display: flex; align-items: center; gap: 4px; padding-block: 8px; padding-inline: 16px 8px; border-block-end: 1px solid var(--border); }
.aia-title { flex: 1 1 auto; min-width: 0; margin: 0; font-size: var(--fs-md); }
.aia-close { flex: none; width: 44px; height: 44px; }
.aia-fresh { flex: none; min-height: 44px; }
.aia-privacy { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 8px 16px; font-size: var(--fs-sm); color: var(--text-2); background: var(--surface-2); border-block-end: 1px solid var(--border); }
.aia-privacy .icon { width: 16px; height: 16px; margin-block-start: 3px; color: var(--accent); }
.aia-banner { display: flex; gap: 10px; align-items: flex-start; padding: 10px 16px; font-size: var(--fs-sm); background: var(--warn-soft); border-block-end: 1px solid var(--border); border-inline-start: 4px solid var(--warn); }
.aia-banner[hidden] { display: none; }
.aia-banner p { margin: 0 0 6px; } .aia-banner p:last-child { margin: 0; }
.aia-banner > .icon { color: var(--warn); margin-block-start: 2px; }
.aia-banner[data-kind="cap"] { background: var(--danger-soft); border-inline-start-color: var(--danger); } .aia-banner[data-kind="cap"] > .icon { color: var(--danger); }
.aia-log { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.aia-log:focus-visible { outline-offset: -3px; }
.aia-intro { margin-block: auto; color: var(--text-2); font-size: var(--fs-sm); }
.aia-intro p { margin: 0 0 8px; }
.aia-intro-lead { display: flex; gap: 8px; align-items: center; font-size: var(--fs-md); font-weight: 650; color: var(--text); }
.aia-intro-lead .icon { color: var(--accent); }
.aia-site { font-weight: 650; color: var(--text); }
.aia-msg { max-width: 92%; padding: 10px 14px; border-radius: var(--r); font-size: var(--fs-sm); line-height: 1.55; overflow-wrap: anywhere; }
.aia-msg p { margin: 0 0 6px; } .aia-msg p:last-child { margin: 0; }
.aia-msg > .icon { margin-block-start: 2px; }
.aia-text { display: block; white-space: pre-wrap; text-align: start; }
.aia-user { align-self: flex-end; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-end-end-radius: 4px; }
.aia-bot { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-end-start-radius: 4px; }
.aia-notfound, .aia-refused, .aia-error { display: flex; gap: 10px; align-items: flex-start; border-inline-start-width: 4px; }
.aia-notfound { background: var(--warn-soft); border-color: var(--warn); border-style: dashed; border-inline-start-style: solid; }
.aia-notfound > .icon { color: var(--warn); }
.aia-nf-h { font-weight: 650; }
.aia-refused { border-color: var(--border-strong); }
.aia-error { background: var(--danger-soft); border-color: var(--danger); }
.aia-error > .icon { color: var(--danger); }
.aia-retry { margin-block-start: 4px; }
.aia-src-h { margin-block-start: 10px !important; font-size: var(--fs-xs); font-weight: 650; color: var(--text-2); }
.aia-sources { margin: 0; padding-inline-start: 18px; }
.aia-sources a { display: inline-block; padding-block: 3px; }
.aia-used { display: flex; gap: 6px; align-items: center; margin-block-start: 8px !important; font-size: var(--fs-xs); color: var(--text-2); }
.aia-used .icon { width: 14px; height: 14px; }
.aia-card { align-self: stretch; max-width: none; background: var(--surface); border: 1px solid var(--border-strong); border-inline-start: 4px solid var(--info); box-shadow: var(--shadow-sm); }
.aia-card[data-state="done"] { border-inline-start-color: var(--success); }
.aia-card[data-state="failed"], .aia-card[data-state="unknown"] { border-inline-start-color: var(--danger); }
.aia-card[data-state="cancelled"], .aia-card[data-state="expired"] { border-inline-start-color: var(--border-strong); }
.aia-kicker { display: flex; gap: 6px; align-items: center; font-size: var(--fs-xs); font-weight: 650; color: var(--info); }
.aia-kicker .icon { width: 16px; height: 16px; }
.aia-card-title { margin: 0 0 8px; font-size: var(--fs-base); }
.aia-danger { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: var(--r-sm); background: var(--danger-soft); font-weight: 600; }
.aia-danger .icon { color: var(--danger); width: 18px; height: 18px; margin-block-start: 2px; }
.aia-fields { margin: 0 0 10px; }
.aia-fields dt { margin-block-start: 8px; font-size: var(--fs-xs); color: var(--muted); }
.aia-fields dd { margin: 0; font-weight: 500; }
.aia-val { white-space: pre-wrap; }
.aia-tag { font-size: var(--fs-xs); font-weight: 650; color: var(--text-2); }
.aia-before .aia-val { color: var(--text-2); }
.aia-long > summary { cursor: pointer; }
.aia-long[open] > summary > .aia-val { display: none; }
.aia-more { color: var(--accent); text-decoration: underline; white-space: nowrap; }
.aia-expiry { font-size: var(--fs-xs); color: var(--muted); }
.aia-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.aia-actions .btn { flex: 1 1 120px; }
.aia-result { display: flex; gap: 8px; align-items: flex-start; margin-block-start: 10px !important; font-weight: 600; }
.aia-result[hidden] { display: none; }
.aia-result .icon { margin-block-start: 1px; }
.aia-card[data-state="done"] .aia-result .icon { color: var(--success); }
.aia-card[data-state="failed"] .aia-result .icon, .aia-card[data-state="unknown"] .aia-result .icon { color: var(--danger); }
.aia-status { margin: 0; padding-inline: 16px; font-size: var(--fs-sm); color: var(--text-2); }
.aia-status:not(:empty) { padding-block: 6px; }
.aia-status:not(:empty)::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-inline-end: 8px; border-radius: 50%; background: var(--accent); }
@media (prefers-reduced-motion: no-preference) { .aia-status:not(:empty)::before { animation: aia-pulse .9s ease-in-out infinite alternate; } @keyframes aia-pulse { from { opacity: .3; } to { opacity: 1; } } }
.aia-form { display: grid; gap: 8px; padding: 10px 12px 12px; border-block-start: 1px solid var(--border); background: var(--surface); }
.aia-input { min-height: 56px; max-height: 160px; resize: none; padding: 10px 12px; }
.aia-input:disabled { background: var(--surface-2); cursor: not-allowed; }
.aia-form-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.aia-hint { margin: 0; font-size: var(--fs-xs); color: var(--muted); }
@media (max-width: 639.98px) {
  .aia-fab { padding: 0; width: var(--tap); }
  .aia-fab-text { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .aia-panel { inset: 0; width: auto; height: auto; max-height: none; border: 0; border-radius: 0; }   /* phones: the whole screen, like a drawer */
  html.aia-lock, html.aia-lock body { overflow: hidden; }
}
@media print { .aia-root { display: none !important; } }
.ais-root { display: grid; gap: var(--s-5); max-width: 980px; }
.ais-card > * + * { margin-block-start: var(--s-3); }
.ais-card > p { margin-block-end: 0; }
.ais-h { font-size: var(--fs-lg); margin: 0; }
.ais-need-h { font-weight: 600; font-size: var(--fs-sm); }
.ais-switch-row { margin-block-start: var(--s-4); }
.ais-plain { margin: 0; padding-inline-start: 20px; }
.ais-plain li { margin-block: 4px; }
.ais-plist, .ais-roles, .ais-switches, .ais-hist { list-style: none; margin: 0; padding: 0; }
.ais-prov { padding-block: var(--s-4); border-block-start: 1px solid var(--border); }
.ais-prov:first-child { border-block-start: 0; padding-block-start: 0; }
.ais-prov > * { margin-block: 0 6px; }
.ais-prov-name { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: var(--fs-md); }
.ais-prov-meta { color: var(--text-2); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.ais-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; overflow-wrap: anywhere; }
.ais-prov .small > .icon { width: 16px; height: 16px; vertical-align: -3px; }
.ais-warn { color: var(--warn); font-weight: 600; }
.ais-test { display: flex; gap: 8px; align-items: flex-start; font-size: var(--fs-sm); font-weight: 600; }
.ais-test[data-ok="yes"] .icon { color: var(--success); } .ais-test[data-ok="no"] .icon { color: var(--warn); }
.ais-facts, .ais-tools { border: 1px solid var(--border); border-radius: var(--r); padding: 8px 12px; background: var(--surface-2); font-size: var(--fs-sm); }
.ais-facts > summary, .ais-tools > summary, .ais-history > summary { cursor: pointer; font-weight: 600; padding-block: 4px; }
.ais-facts[open] > summary, .ais-tools[open] > summary, .ais-history[open] > summary { margin-block-end: 8px; }
.ais-facts > * + * { margin-block-start: 8px; } .ais-facts p { margin-block-end: 0; }
.ais-prov-actions { margin-block-start: 10px; }
.ais-pform { margin-block-start: var(--s-4); padding: var(--s-4); border: 1px solid var(--border-strong); border-radius: var(--r); }
.ais-pform h3 { margin: 0; }
.ais-fieldset { margin-block-start: var(--s-4); min-width: 0; }
.ais-fieldset > legend { font-size: var(--fs-base); font-weight: 650; }
.ais-fieldset > * + * { margin-block-start: 8px; }
.ais-two { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.ais-two > .field + .field, .ais-tool-grid > .field + .field { margin-top: 0; }
.ais-narrow { max-width: 220px; }
.ais-usage { margin-block-start: var(--s-4); }
.ais-usage h3 { font-size: var(--fs-base); margin: 0 0 8px; }
.ais-usage-line { margin: 8px 0 4px; font-variant-numeric: tabular-nums; }
.ais-level { display: flex; gap: 6px; align-items: center; margin: 0 0 12px; font-size: var(--fs-sm); font-weight: 600; }
.ais-level .icon { width: 18px; height: 18px; color: var(--success); }
.ais-usage[data-level="warn"] .ais-level .icon { color: var(--warn); } .ais-usage[data-level="cap"] .ais-level .icon { color: var(--danger); }
.ais-usage[data-level="warn"] .ais-bar > span { background: var(--warn); } .ais-usage[data-level="cap"] .ais-bar > span { background: var(--danger); }
.ais-use { margin-block-start: 12px; }
.ais-switches { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.ais-role { padding-block: var(--s-3); border-block-start: 1px solid var(--border); }
.ais-role-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; margin-block-end: 8px; }
.ais-role-name { margin: 0; font-size: var(--fs-base); }
.ais-tool-grid { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.ais-tool-name { font-weight: 600; font-size: var(--fs-sm); }
.ais-hist li { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: space-between; padding-block: 8px; border-block-start: 1px solid var(--border); font-size: var(--fs-sm); }
.ais-history > summary { font-size: var(--fs-md); }

/* FUND-02c — the Pack: every document an application needs, in one place (workspace-funding-pack.js). One row per document:
   its name, where it stands in words and an icon (never colour alone), its file, and one plain next step. Logical properties only. */
.pack-card h2 { font-size: var(--fs-md); margin: 0; }
.pack-head { padding: var(--s-5); display: grid; gap: var(--s-3); }
.pack-count { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.pack-count .icon { width: 18px; height: 18px; flex: none; color: var(--success); }
.pack-say { color: var(--text-2); }
.pack-actions { gap: 8px; }
.pack-rows, .pack-locked, .pack-uses { list-style: none; margin: 0; padding: 0; }
.pack-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-3) var(--s-4); align-items: start; padding: var(--s-4) var(--s-5); border-block-start: 1px solid var(--border); }
.pack-row:focus-visible { outline-offset: -3px; }
.pack-row-main { min-width: 0; display: grid; gap: 6px; justify-items: start; }
.pack-row-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.pack-row-name { margin: 0; font-size: var(--fs-base); font-weight: 600; letter-spacing: 0; overflow-wrap: anywhere; }
.pack-state .icon { width: 14px; height: 14px; flex: none; }
.pack-why { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pack-file { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; max-width: 100%; }
.pack-file-name { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; font-size: var(--fs-sm); }
.pack-file-name .icon { width: 16px; height: 16px; flex: none; color: var(--muted); }
.pack-file-links { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.pack-note { color: var(--text-2); }
.pack-newer { display: flex; gap: 6px; align-items: flex-start; }
.pack-newer .icon { width: 16px; height: 16px; flex: none; margin-block-start: 2px; color: var(--info); }
.pack-row-act { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 300px; }
.pack-foot { padding: var(--s-4) var(--s-5); border-block-start: 1px solid var(--border); background: var(--surface-2); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.pack-foot .hint { flex: 1 1 220px; }
.pack-funder { display: grid; gap: var(--s-2); }
.pack-more > summary { cursor: pointer; font-weight: 600; font-size: var(--fs-sm); padding-block: 6px; min-height: 32px; width: fit-content; max-width: 100%; }
.pack-more .pack-row { padding-inline: 0; }
.pack-locked, .pack-uses { display: grid; gap: 6px; font-size: var(--fs-sm); }
.pack-locked li, .pack-uses li { display: flex; gap: 8px; align-items: flex-start; min-width: 0; overflow-wrap: anywhere; }
.pack-locked .icon, .pack-uses .icon { width: 16px; height: 16px; flex: none; margin-block-start: 3px; color: var(--muted); }
.pack-uses-box { margin-block-start: 8px; padding: 8px 12px; border-radius: var(--r); background: var(--surface-2); }
.pack-mail-no { display: flex; gap: 10px; align-items: flex-start; }
.pack-mail-no .icon { width: 20px; height: 20px; flex: none; margin-block-start: 2px; color: var(--muted); }
.hint.pack-over { color: var(--danger); font-weight: 600; }
@media (max-width: 640px) {
  .pack-head, .pack-row, .pack-foot { padding-inline: var(--s-4); }
  .pack-row { grid-template-columns: minmax(0, 1fr); }
  .pack-row-act { justify-content: flex-start; max-width: none; }
}

/* FUND-02d — funder memory: one card for "Our history with this funder" (workspace-funding-memory.js), the same on the funder's
   page, above an opportunity's tabs and inside the Add / Start dialogs. Calm by default: facts on one line, then what to do. Each
   level has its word and icon (never colour alone). Logical properties only; everything wraps at 400 px. */
.memory-card { display: grid; gap: var(--s-3); min-width: 0; overflow-wrap: anywhere; }
.memory-card > * { min-width: 0; }
.field.memory-zone { gap: var(--s-3); }   /* in a dialog: the card, then the stop for a second application */
.memory-zone > :empty { display: none; }
.memory-full, .memory-dialog { padding: var(--s-4); border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); }
.memory-title { margin: 0; font-size: var(--fs-md); letter-spacing: 0; }
.memory-full .memory-title, .memory-dialog .memory-title { font-size: var(--fs-base); }
.memory-h { margin: 0; font-size: var(--fs-sm); font-weight: 650; color: var(--text-2); letter-spacing: 0; }
.memory-part { display: grid; gap: var(--s-2); min-width: 0; }
.memory-facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: var(--fs-sm); color: var(--text-2); }
.memory-facts strong { color: var(--text); font-variant-numeric: tabular-nums; }
.memory-line { margin: 0; font-size: var(--fs-sm); }
.memory-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.memory-rec, .memory-ok { display: flex; gap: 10px; align-items: flex-start; min-width: 0; font-size: var(--fs-sm); }
.memory-rec { padding: 8px 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); border-inline-start-width: 4px; }
.memory-rec > .icon, .memory-ok > .icon { width: 18px; height: 18px; flex: none; margin-block-start: 2px; color: var(--success); }
.memory-rec-body { min-width: 0; display: grid; gap: 2px; }
.memory-rec p { margin: 0; }
.memory-stop { background: var(--danger-soft); border-color: var(--danger); } .memory-stop > .icon { color: var(--danger); }
.memory-warn { background: var(--warn-soft); border-color: var(--warn); } .memory-warn > .icon { color: var(--warn); }
.memory-cites { font-size: var(--fs-xs); }
.memory-card a .ref, [data-memory-dup] a .ref { color: inherit; }
.memory-apps > summary { cursor: pointer; font-weight: 600; font-size: var(--fs-sm); padding-block: 6px; min-height: 32px; width: fit-content; max-width: 100%; }
.memory-badge .icon { width: 14px; height: 14px; flex: none; }
.memory-chip { cursor: pointer; min-height: 36px; text-align: start; border-radius: var(--r); }
.memory-chip input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--accent); }
.memory-chip:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); font-weight: 600; }
.memory-chip:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.hint.memory-over { color: var(--danger); font-weight: 600; }

/* ---------- TR-01a (D-149): text typed in Arabic, shown in English to English readers (assets/h/translated.4e3e0c7ab9.js). INTERNAL pages only —
   the funder and partner pages never use these. The state is always said in words ("Translated automatically", "Not translated
   yet"), never by colour; the note is --muted on the card (AA in both themes); the buttons are at least 24 px tall. ---------- */
.tr { unicode-bidi: isolate; }
.tr-block { display: block; }
.tr-en, .tr-orig { unicode-bidi: isolate; }
.tr-en[hidden], .tr-orig[hidden] { display: none; }
.tr-block > .tr-en, .tr-block > .tr-orig { display: block; white-space: pre-line; overflow-wrap: anywhere; }
.tr-note { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin-inline-start: 8px; font-size: var(--fs-xs); font-weight: 400; font-style: normal; line-height: 1.4; color: var(--muted); white-space: normal; text-transform: none; letter-spacing: 0; }
.tr-block > .tr-note { display: flex; margin: 4px 0 0; }
.tr-compact > .tr-note { margin-inline-start: 6px; }
.tr-toggle { font-size: inherit; font-weight: 600; min-height: 24px; line-height: 1.4; }
.tr-toggle:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.tr-dialog { width: min(560px, calc(100vw - 32px)); }
.tr-dialog form > * + * { margin-block-start: var(--s-3); }
.tr-dialog-h { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); margin-block-end: 4px; }
.tr-dialog-src { margin: 0; padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); white-space: pre-line; overflow-wrap: anywhere; }
.tr-dialog textarea { text-align: left; min-height: 120px; }
.tr-dialog-foot { margin-block-start: var(--s-4); }

/* The English check (assets/h/pages/english-check.c70fdc4b5e.js): what leaves for an outside party, in English, confirmed by a person first.
   Two columns on a wide screen (the Arabic original, staff only | the English that goes out), one on a phone; the dialog fills a
   phone's screen. A refusal is a sentence with its places and an icon — never colour alone. */
.ec-dialog { padding: 0; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); color: var(--text); width: min(880px, calc(100vw - 32px)); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); box-shadow: var(--shadow-lg); }
.ec-dialog[open] { display: flex; flex-direction: column; }
.ec-dialog::backdrop { background: rgba(10, 12, 16, .45); }
.ec-form { display: flex; flex-direction: column; flex: 1; min-height: 0; margin: 0; }
.ec-head { padding: 16px 20px 8px; }
.ec-head h2 { font-size: var(--fs-md); margin: 0; overflow-wrap: anywhere; }
.ec-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 20px 16px; }
.ec-body > * + *, .ec-body [data-ec-content] > * + * { margin-block-start: var(--s-3); }
.ec-body p { margin-block-end: 0; }
.ec-intro { margin: 0; }
.ec-items, .ec-filelist { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); }
.ec-item, .ec-file { border: 1px solid var(--border); border-radius: var(--r); padding: 12px; background: var(--surface); min-width: 0; }
.ec-item-stop { border-color: var(--danger); border-inline-start-width: 4px; }
.ec-label { font-size: var(--fs-sm); margin: 0 0 8px; overflow-wrap: anywhere; }
.ec-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-3); align-items: start; }
.ec-cap { display: block; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); margin: 0 0 4px; }
.ec-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); }   /* no scroller of its own: the dialog's body scrolls (keyboard) */
.ec-out, .ec-box { text-align: left; }
.ec-box { min-height: 104px; }
.ec-tools, .ec-all { margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ec-stop { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0 0; color: var(--danger); font-weight: 600; font-size: var(--fs-sm); }
.ec-stop .icon { width: 18px; height: 18px; flex: none; margin-block-start: 2px; }
.ec-files { border: 0; padding: 0; margin-inline: 0; min-width: 0; }
.ec-files > legend { font-weight: 600; padding: 0; margin-block-end: 8px; }
.ec-fname { margin: 0; font-weight: 600; overflow-wrap: anywhere; display: flex; gap: 6px; align-items: flex-start; }
.ec-fname .icon { width: 18px; height: 18px; flex: none; margin-block-start: 3px; }
.ec-fstate { margin: 4px 0 0; font-size: var(--fs-sm); color: var(--muted); }
.ec-fstate.ec-stop { color: var(--danger); }
.ec-elsewhere { border: 1px solid var(--danger); border-inline-start-width: 4px; border-radius: var(--r); padding: 12px; background: var(--surface); min-width: 0; }
.ec-elsewhere .ec-stop { margin: 0; }
.ec-places { margin: 8px 0 0; padding-inline-start: 22px; overflow-wrap: anywhere; }
.ec-tick { display: flex; gap: 10px; align-items: flex-start; margin-block-start: 8px; padding-block: 8px; min-height: var(--tap); cursor: pointer; font-weight: 500; }
.ec-tick input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.ec-refusal > div { min-width: 0; }
.ec-refusal p { margin: 0; overflow-wrap: anywhere; }
.ec-refusal:focus-visible, .ec-head h2:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.ec-foot { padding: 12px 20px 16px; border-block-start: 1px solid var(--border); }
.ec-foot > * + * { margin-block-start: 8px; }
.ec-status:empty { display: none; }
@media (max-width: 599px) {
  .ec-dialog { width: 100vw; max-width: 100vw; height: 100vh; height: 100dvh; max-height: 100vh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .ec-head, .ec-body, .ec-foot { padding-inline: 16px; }
  .ec-pair { grid-template-columns: minmax(0, 1fr); }
  .ec-foot .btn { flex: 1 1 140px; }
}

/* Translation settings (assets/pages/workspace-translation.js, on the Assistant settings page; super admins only) */
.trs-root { display: grid; gap: var(--s-5); max-width: 980px; margin-block-start: var(--s-5); }
.trs-root:empty { display: none; }
.trs-card > * + * { margin-block-start: var(--s-3); }
.trs-card > p { margin-block-end: 0; }
.trs-state { display: flex; gap: 8px; align-items: flex-start; font-weight: 600; margin: 0; }
.trs-state .icon { width: 18px; height: 18px; flex: none; margin-block-start: 3px; color: var(--muted); }
.trs-state[data-on="yes"] .icon { color: var(--success); }
.trs-state[data-on="wait"] .icon { color: var(--warn); }
.trs-fieldset { border: 1px solid var(--border); border-radius: var(--r); padding: 12px 14px; margin-inline: 0; min-width: 0; }
.trs-fieldset > legend { font-weight: 650; padding-inline: 6px; }
.trs-fieldset > * + * { margin-block-start: 10px; }
.trs-sections { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.trs-sections .switch { min-height: var(--tap); width: 100%; }
.trs-narrow { max-width: 260px; }
.trs-table { width: 100%; }
.trs-table caption { text-align: start; font-weight: 600; padding-block-end: 6px; }
.trs-plain { margin: 0; padding-inline-start: 20px; }
.trs-plain li { margin-block: 4px; overflow-wrap: anywhere; }
.trs-history > summary { cursor: pointer; font-weight: 600; padding-block: 4px; min-height: 32px; }
.trs-unsaved { font-weight: 600; color: var(--warn); }
