/* ==========================================================================
   Privacy centre — public design system (data principal portal)
   Bootstrap 5.3 base + tokens. Calm and light: navy and one blue accent on neutral greys; mobile first; WCAG 2.2 AA.
   Shares the admin console's palette (src/Cms.Admin/wwwroot/css/site.css) and fonts, with larger type and touch targets.
   No inline styles anywhere (strict CSP): every visual lives here.
   ========================================================================== */
@font-face { font-family: "InterVar"; src: url("../lib/fonts/inter-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "NotoDeva"; src: url("../lib/fonts/noto-deva-400.woff2") format("woff2"); font-weight: 400 500; font-display: swap; }
@font-face { font-family: "NotoDeva"; src: url("../lib/fonts/noto-deva-600.woff2") format("woff2"); font-weight: 600 800; font-display: swap; }

:root {
  /* Palette: the admin console's navy and blue, WCAG AA. Ratios are against white unless stated. */
  --p-font: "InterVar", "Inter", "NotoDeva", system-ui, -apple-system, "Segoe UI", "Noto Sans", Roboto, sans-serif;
  --p-primary: #1d4ed8;              /* white on it 6.70; on --p-bg 6.24 */
  --p-primary-700: #1e40af;          /* links: 8.72; on primary-50 7.91 */
  --p-primary-800: #1e3a8a;          /* 10.36 */
  --p-primary-50: #eff4ff;
  --p-primary-100: #dbe6fe;
  --p-primary-200: #bfd3fe;
  --p-navy-900: #0b1f3a;             /* the brand tile; white on it 16.52 */
  --p-ink: #0f172a;                  /* headings, strong text */
  --p-text: #1e293b;                 /* body text: 14.63 */
  --p-text-2: #334155;               /* 10.35 */
  --p-muted: #475569;                /* 7.58; 7.06 on --p-bg */
  --p-text-on-dark: #e2e8f0;         /* on --p-ink 14.48 */
  --p-border: #e2e8f0;
  --p-border-mid: #cbd5e1;           /* light buttons, dashed boxes */
  --p-border-strong: #7c8799;        /* fields, checkboxes, switches: 3.63 */
  --p-bg: #f5f7fa;
  --p-surface: #ffffff;
  --p-surface-2: #f8fafc;
  --p-hover: #f1f5f9;
  /* Status: the base step for icons and fills, the -ink step for text on the -50 tints. */
  --p-success: #15803d;              /* 5.02 */
  --p-success-ink: #166534;          /* 6.81 on success-50 */
  --p-success-50: #f0fdf4;
  --p-success-200: #bbf7d0;
  --p-warning: #b45309;              /* 5.02 */
  --p-warning-ink: #92400e;          /* 6.84 on warning-50 */
  --p-warning-50: #fffbeb;
  --p-warning-200: #fde68a;
  --p-danger: #b91c1c;               /* 6.47 */
  --p-danger-ink: #991b1b;           /* 7.60 on danger-50 */
  --p-danger-50: #fef2f2;
  --p-danger-200: #fecaca;
  --p-info: #0369a1;                 /* 5.93 */
  --p-info-ink: #075985;             /* 7.09 on info-50 */
  --p-info-50: #f0f9ff;
  --p-info-200: #bae6fd;
  --p-radius: 14px;
  --p-radius-sm: 10px;
  --p-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 3px rgba(15, 23, 42, .06);
  --p-shadow-lg: 0 18px 40px -12px rgba(15, 23, 42, .2);
  /* Focus: a 3px outline (primary-700: 8.72 on white, 8.13 on --p-bg), or a white gap plus a 3px ring on buttons and
     fields; white on dark panels. */
  --p-focus-color: var(--p-primary-700);
  --p-focus-color-on-dark: #ffffff;
  --p-focus: 0 0 0 3px var(--p-surface), 0 0 0 6px var(--p-focus-color);
  --p-max: 1080px;

  --bs-primary: var(--p-primary);
  --bs-primary-rgb: 29, 78, 216;
  --bs-link-color: var(--p-primary-700);
  --bs-link-color-rgb: 30, 64, 175;
  --bs-link-hover-color: var(--p-primary-800);
  --bs-link-hover-color-rgb: 30, 58, 138;
  --bs-body-font-family: var(--p-font);
  --bs-body-color: var(--p-text);
  --bs-body-bg: var(--p-surface);     /* fields, menus and dialogs; the page itself is --p-bg (body) */
  --bs-border-color: var(--p-border);
  --bs-border-radius: var(--p-radius-sm);
  --bs-secondary-color: var(--p-muted);
  --bs-emphasis-color: var(--p-ink);
  --bs-heading-color: var(--p-ink);
  --bs-focus-ring-color: rgba(30, 64, 175, .35);
  --bs-success-rgb: 21, 128, 61;
  --bs-warning-rgb: 180, 83, 9;
  --bs-danger-rgb: 185, 28, 28;
  --bs-info-rgb: 3, 105, 161;
  --bs-primary-text-emphasis: var(--p-primary-700);
  --bs-primary-bg-subtle: var(--p-primary-50);
  --bs-primary-border-subtle: var(--p-primary-200);
  --bs-success-text-emphasis: var(--p-success-ink);
  --bs-success-bg-subtle: var(--p-success-50);
  --bs-success-border-subtle: var(--p-success-200);
  --bs-warning-text-emphasis: var(--p-warning-ink);
  --bs-warning-bg-subtle: var(--p-warning-50);
  --bs-warning-border-subtle: var(--p-warning-200);
  --bs-danger-text-emphasis: var(--p-danger-ink);
  --bs-danger-bg-subtle: var(--p-danger-50);
  --bs-danger-border-subtle: var(--p-danger-200);
  --bs-info-text-emphasis: var(--p-info-ink);
  --bs-info-bg-subtle: var(--p-info-50);
  --bs-info-border-subtle: var(--p-info-200);
}

html { font-size: 16px; scroll-padding-top: 1rem; }
body { font-family: var(--p-font); background: var(--p-bg); color: var(--p-text); line-height: 1.6; -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1 0 auto; outline: none; }
h1, h2, h3, h4 { color: var(--p-ink); letter-spacing: -.015em; line-height: 1.25; }
h1 { font-size: 1.75rem; font-weight: 750; }
h2 { font-size: 1.3rem; font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 650; }
h4 { font-size: 1rem; font-weight: 650; }
.h1, .h2, .h3, .h4, .h5, .h6 { font-weight: 700; color: var(--p-ink); letter-spacing: -.015em; }
@media (min-width: 768px) { h1 { font-size: 2.05rem; } h2 { font-size: 1.45rem; } }
a { color: var(--p-primary-700); text-underline-offset: .18em; }
a:hover { color: var(--p-primary-800); }
code, pre, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86em; }
.text-muted, .muted { color: var(--p-muted) !important; }
.small-caps { font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 650; color: var(--p-muted); }
.lead { font-size: 1.12rem; color: var(--p-text-2); }
.visually-hidden-focusable:not(:focus):not(:focus-within) { position: absolute !important; }
.container { max-width: var(--p-max); padding-inline: 1rem; }
@media (min-width: 768px) { .container { padding-inline: 1.5rem; } }
.prose { max-width: 70ch; }

/* ---------- Focus (WCAG 2.4.7 / 2.4.11) ---------- */
:focus-visible { outline: 3px solid var(--p-focus-color); outline-offset: 3px; border-radius: 4px; }
.btn:focus-visible, .form-control:focus, .form-select:focus, .form-check-input:focus, .switch:focus-visible { outline: none; box-shadow: var(--p-focus) !important; }
.form-control:focus, .form-select:focus { border-color: var(--p-focus-color); }

/* ---------- Skip link ---------- */
.skip-link { position: absolute; inset-inline-start: 1rem; top: -100px; z-index: 2000; background: var(--p-ink); color: #fff; padding: .75rem 1rem; border-radius: 0 0 10px 10px; font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 0; color: #fff; outline-color: var(--p-focus-color-on-dark); outline-offset: -5px; }

/* ---------- Buttons ---------- */
.btn { font-weight: 600; border-radius: var(--p-radius-sm); padding: .65rem 1.1rem; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; line-height: 1.2; }
.btn-sm { min-height: 36px; padding: .4rem .8rem; font-size: .9rem; }
.btn-lg { min-height: 52px; padding: .8rem 1.4rem; font-size: 1.05rem; }
.btn-primary { --bs-btn-bg: var(--p-primary); --bs-btn-border-color: var(--p-primary); --bs-btn-hover-bg: var(--p-primary-700); --bs-btn-hover-border-color: var(--p-primary-700); --bs-btn-active-bg: var(--p-primary-800); --bs-btn-active-border-color: var(--p-primary-800); --bs-btn-disabled-bg: var(--p-primary); --bs-btn-disabled-border-color: var(--p-primary); box-shadow: 0 1px 2px rgba(15, 23, 42, .12); }
.btn-outline-primary { --bs-btn-color: var(--p-primary-700); --bs-btn-border-color: var(--p-primary-200); --bs-btn-hover-bg: var(--p-primary-50); --bs-btn-hover-color: var(--p-primary-800); --bs-btn-hover-border-color: var(--p-primary-200); --bs-btn-active-bg: var(--p-primary-100); --bs-btn-active-color: var(--p-primary-800); --bs-btn-active-border-color: var(--p-primary-200); background: var(--p-surface); }
.btn-light { --bs-btn-bg: var(--p-surface); --bs-btn-border-color: var(--p-border-mid); --bs-btn-hover-bg: var(--p-hover); --bs-btn-hover-border-color: var(--p-border-strong); --bs-btn-color: var(--p-text-2); --bs-btn-hover-color: var(--p-ink); --bs-btn-active-bg: var(--p-hover); --bs-btn-active-border-color: var(--p-border-strong); }
.btn-danger { --bs-btn-bg: var(--p-danger); --bs-btn-border-color: var(--p-danger); --bs-btn-hover-bg: var(--p-danger-ink); --bs-btn-hover-border-color: var(--p-danger-ink); --bs-btn-active-bg: var(--p-danger-ink); --bs-btn-active-border-color: var(--p-danger-ink); --bs-btn-disabled-bg: var(--p-danger); --bs-btn-disabled-border-color: var(--p-danger); }
.btn-outline-danger { --bs-btn-color: var(--p-danger); --bs-btn-border-color: var(--p-danger-200); --bs-btn-hover-bg: var(--p-danger-50); --bs-btn-hover-color: var(--p-danger-ink); --bs-btn-hover-border-color: var(--p-danger-200); --bs-btn-active-bg: var(--p-danger-50); --bs-btn-active-color: var(--p-danger-ink); --bs-btn-active-border-color: var(--p-danger); background: var(--p-surface); }
.btn-link { font-weight: 600; min-height: 44px; padding-inline: .25rem; }
.btn-block-mobile { width: 100%; }
@media (min-width: 576px) { .btn-block-mobile { width: auto; } }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }

/* ---------- Header ---------- */
.site-header { background: rgba(255,255,255,.96); border-bottom: 1px solid var(--p-border); position: sticky; top: 0; z-index: 1000; backdrop-filter: saturate(180%) blur(8px); }
.header-bar { display: flex; align-items: center; gap: .75rem; min-height: 64px; }
.brand { display: flex; align-items: center; gap: .65rem; color: var(--p-ink); text-decoration: none; min-width: 0; }
.brand:hover { color: var(--p-ink); }
/* The brand mark: a flat navy tile with a white shield (the favicon's colours). */
.brand-mark { width: 38px; height: 38px; border-radius: 11px; background: var(--p-navy-900); color: #fff; display: grid; place-items: center; font-size: 1.15rem; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-name { font-weight: 750; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: .78rem; color: var(--p-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-actions { margin-inline-start: auto; display: flex; align-items: center; gap: .4rem; }
/* Header buttons keep their label on one line; the organisation name gives way (it ends in an ellipsis). */
.header-actions .btn { white-space: nowrap; flex-shrink: 0; }
@media (max-width: 420px) { .brand-sub { display: none; } }

/* Menus built on <details> (work without JavaScript) */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: .45rem .7rem; border-radius: var(--p-radius-sm); border: 1px solid transparent; font-weight: 600; color: var(--p-text-2); }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:hover { background: var(--p-hover); }
.menu[open] > summary { background: var(--p-primary-50); border-color: var(--p-primary-100); color: var(--p-primary-800); }
.menu-panel { position: absolute; inset-inline-end: 0; top: calc(100% + .35rem); min-width: 220px; background: var(--p-surface); border: 1px solid var(--p-border); border-radius: var(--p-radius); box-shadow: var(--p-shadow-lg); padding: .4rem; z-index: 1100; }
.menu-panel a, .menu-panel button { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .6rem .75rem; min-height: 44px; border-radius: 8px; color: var(--p-text); text-decoration: none; background: none; border: 0; font: inherit; text-align: start; }
.menu-panel a:hover, .menu-panel button:hover { background: var(--p-hover); }
.menu-panel a[aria-current="true"] { background: var(--p-primary-50); color: var(--p-primary-800); font-weight: 650; }
.menu-panel .menu-note { padding: .5rem .75rem; font-size: .85rem; color: var(--p-muted); border-bottom: 1px solid var(--p-border); margin-bottom: .3rem; }
.menu-panel hr { margin: .3rem 0; }
.lang-native { font-weight: 600; }
.lang-english { color: var(--p-muted); font-size: .85rem; margin-inline-start: auto; }
.lang-panel { min-width: 260px; }
.lang-list { max-height: min(70vh, 30rem); overflow-y: auto; overscroll-behavior: contain; }
@media (max-width: 575.98px) { .lang-panel { position: fixed; inset-inline: .75rem; top: 4.25rem; min-width: 0; } }
@media (max-width: 575.98px) { .menu .summary-label { display: none; } }

/* Signed-in navigation */
.app-nav { border-top: 1px solid var(--p-border); background: var(--p-surface); }
.app-nav ul { list-style: none; display: flex; gap: .25rem; margin: 0; padding: 0; overflow-x: auto; scrollbar-width: none; position: relative; overscroll-behavior-x: contain; }
.app-nav ul::-webkit-scrollbar { display: none; }
/* On narrow screens the tabs scroll sideways: the edge that hides more tabs fades out (classes set by portal.js),
   and the current tab is scrolled into view. */
.app-nav ul.more-end { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 3rem), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 3rem), transparent); }
.app-nav ul.more-start { -webkit-mask-image: linear-gradient(to right, transparent, #000 3rem); mask-image: linear-gradient(to right, transparent, #000 3rem); }
.app-nav ul.more-start.more-end { -webkit-mask-image: linear-gradient(to right, transparent, #000 3rem, #000 calc(100% - 3rem), transparent); mask-image: linear-gradient(to right, transparent, #000 3rem, #000 calc(100% - 3rem), transparent); }
[dir="rtl"] .app-nav ul.more-end { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 3rem), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 3rem), transparent); }
[dir="rtl"] .app-nav ul.more-start { -webkit-mask-image: linear-gradient(to left, transparent, #000 3rem); mask-image: linear-gradient(to left, transparent, #000 3rem); }
[dir="rtl"] .app-nav ul.more-start.more-end { -webkit-mask-image: linear-gradient(to left, transparent, #000 3rem, #000 calc(100% - 3rem), transparent); mask-image: linear-gradient(to left, transparent, #000 3rem, #000 calc(100% - 3rem), transparent); }
.app-nav a { display: inline-flex; align-items: center; gap: .45rem; padding: .7rem .85rem; min-height: 48px; color: var(--p-muted); font-weight: 600; text-decoration: none; white-space: nowrap; border-bottom: 3px solid transparent; }
.app-nav a:hover { color: var(--p-text); }
.app-nav a[aria-current="page"] { color: var(--p-primary-800); border-bottom-color: var(--p-primary); }

/* ---------- Footer ---------- */
.site-footer { margin-top: 3rem; background: var(--p-surface); border-top: 1px solid var(--p-border); padding: 2rem 0 2.5rem; font-size: .93rem; color: var(--p-muted); }
.site-footer h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--p-text-2); margin-bottom: .75rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .35rem; }
.site-footer a { color: var(--p-text-2); }
.footer-legal { border-top: 1px solid var(--p-border); margin-top: 1.5rem; padding-top: 1.25rem; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; }

/* ---------- Page structure ---------- */
.page { padding-top: 1.5rem; }
@media (min-width: 768px) { .page { padding-top: 2.25rem; } }
.page-header { margin-bottom: 1.5rem; }
.page-header .subtitle { color: var(--p-muted); font-size: 1.05rem; margin: .35rem 0 0; max-width: 72ch; }
.page-header-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; justify-content: space-between; }
.breadcrumbs { font-size: .9rem; margin-bottom: .75rem; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; padding: 0; margin: 0; }
.breadcrumbs li + li::before { content: "/"; color: var(--p-border-strong); margin-inline-end: .35rem; }
.breadcrumbs a { color: var(--p-muted); }
.section { margin-top: 2.25rem; }
.section-title { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.section-title .icon-chip { width: 36px; height: 36px; }

/* ---------- Cards ---------- */
.card { border: 1px solid var(--p-border); border-radius: var(--p-radius); box-shadow: var(--p-shadow); background: var(--p-surface); }
.card-body { padding: 1.15rem; }
@media (min-width: 768px) { .card-body { padding: 1.5rem; } }
.card + .card { margin-top: 1rem; }
/* Cards laid out by a grid are spaced by its gap; the stacking margin would push every later card down. */
.contact-grid > .card { margin-top: 0; }
.card-head { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-start; justify-content: space-between; }
.card-head h2, .card-head h3 { margin: 0; }
.card-footer-actions { border-top: 1px solid var(--p-border); padding: .9rem 1.15rem; display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; background: var(--p-surface-2); border-radius: 0 0 var(--p-radius) var(--p-radius); }
@media (min-width: 768px) { .card-footer-actions { padding: .9rem 1.5rem; } }
.icon-chip { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--p-primary-50); color: var(--p-primary-700); font-size: 1.25rem; flex-shrink: 0; }
.icon-chip.success { background: var(--p-success-50); color: var(--p-success); }
.icon-chip.danger { background: var(--p-danger-50); color: var(--p-danger); }
.icon-chip.warning { background: var(--p-warning-50); color: var(--p-warning); }

/* ---------- Status pills (icon + text, never colour alone) ---------- */
.pill { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .65rem; border-radius: 999px; font-size: .85rem; font-weight: 650; border: 1px solid transparent; white-space: nowrap; line-height: 1.5; }
.pill i { font-size: .85em; }
.pill-success { background: var(--p-success-50); color: var(--p-success-ink); border-color: var(--p-success-200); }
.pill-warning { background: var(--p-warning-50); color: var(--p-warning-ink); border-color: var(--p-warning-200); }
.pill-danger { background: var(--p-danger-50); color: var(--p-danger-ink); border-color: var(--p-danger-200); }
.pill-info { background: var(--p-info-50); color: var(--p-info-ink); border-color: var(--p-info-200); }
.pill-muted { background: var(--p-hover); color: var(--p-text-2); border-color: var(--p-border); }
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .6rem; border-radius: 999px; background: var(--p-hover); color: var(--p-text-2); font-size: .85rem; border: 1px solid var(--p-border); margin: 0; margin-inline-end: .3rem; margin-bottom: .35rem; }
.chip.muted { background: var(--p-surface); border-style: dashed; color: var(--p-muted); }
.chip.sensitive { background: var(--p-warning-50); border-color: var(--p-warning-200); color: var(--p-warning-ink); }

/* ---------- Alerts / flash ---------- */
.notice { display: flex; gap: .85rem; align-items: flex-start; padding: 1rem 1.1rem; border-radius: var(--p-radius); border: 1px solid var(--p-border); background: var(--p-surface); margin-bottom: 1.25rem; }
.notice > i { font-size: 1.3rem; line-height: 1.2; flex-shrink: 0; }
.notice p:last-child, .notice ul:last-child { margin-bottom: 0; }
.notice-title { font-weight: 700; margin-bottom: .15rem; }
.notice-success { background: var(--p-success-50); border-color: var(--p-success-200); }
.notice-success > i { color: var(--p-success); }
.notice-danger { background: var(--p-danger-50); border-color: var(--p-danger-200); }
.notice-danger > i { color: var(--p-danger); }
.notice-warning { background: var(--p-warning-50); border-color: var(--p-warning-200); }
.notice-warning > i { color: var(--p-warning); }
.notice-info { background: var(--p-primary-50); border-color: var(--p-primary-100); }
.notice-info > i { color: var(--p-primary-700); }
.notice .notice-close { margin-inline-start: auto; background: none; border: 0; color: inherit; min-width: 44px; min-height: 44px; margin-top: -.6rem; margin-inline-end: -.6rem; border-radius: 8px; }
.notice .notice-close:hover { background: rgba(15, 23, 42, .06); }
.toast-region { margin-top: 1rem; }
.toast-region .notice { box-shadow: var(--p-shadow-lg); }

/* Error summary (forms) */
.error-summary { border: 2px solid var(--p-danger); border-radius: var(--p-radius); padding: 1rem 1.15rem; background: var(--p-surface); margin-bottom: 1.5rem; }
.error-summary h2 { font-size: 1.1rem; color: var(--p-danger); margin-bottom: .5rem; }
.error-summary ul { margin: 0; padding-inline-start: 1.1rem; }
.error-summary a { color: var(--p-danger); font-weight: 600; }
.field-error { color: var(--p-danger); font-weight: 600; font-size: .92rem; display: block; margin-top: .35rem; }
.field-error:empty { display: none; }
.form-control.input-validation-error, .form-select.input-validation-error, .is-invalid { border-color: var(--p-danger) !important; border-width: 2px; }

/* ---------- Forms ---------- */
.form-label { font-weight: 650; margin-bottom: .35rem; color: var(--p-ink); }
.form-hint { color: var(--p-muted); font-size: .92rem; margin-top: -.15rem; margin-bottom: .5rem; }
.form-control, .form-select { min-height: 48px; border-radius: var(--p-radius-sm); border-color: var(--p-border-strong); font-size: 1rem; padding: .6rem .85rem; }
textarea.form-control { min-height: 120px; }
.form-check { min-height: 44px; display: flex; align-items: flex-start; gap: .65rem; padding-inline-start: 0; }
.form-check-input, .form-check .form-check-input { width: 1.4rem; height: 1.4rem; margin: .1rem 0 0 0; float: none; flex-shrink: 0; border-color: var(--p-border-strong); }
.form-check-input:checked { background-color: var(--p-primary); border-color: var(--p-primary); }
.form-check-label { cursor: pointer; }
.code-input { font-size: 1.6rem; letter-spacing: .5em; font-weight: 700; text-align: center; max-width: 16rem; font-variant-numeric: tabular-nums; }
fieldset legend { font-size: 1rem; font-weight: 650; }
.form-section + .form-section { margin-top: 1.5rem; }
.required-mark { color: var(--p-danger); }

/* ---------- Hero / landing ---------- */
.hero { background: radial-gradient(1200px 400px at 85% -10%, var(--p-primary-50) 0%, transparent 60%), linear-gradient(180deg, var(--p-surface) 0%, var(--p-bg) 100%); border-bottom: 1px solid var(--p-border); padding: 2.5rem 0 2.75rem; }
@media (min-width: 768px) { .hero { padding: 4rem 0 4.25rem; } }
.hero h1 { font-size: 2rem; font-weight: 800; letter-spacing: -.025em; }
@media (min-width: 768px) { .hero h1 { font-size: 2.75rem; } }
.hero .lead { max-width: 60ch; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .75rem; border-radius: 999px; background: var(--p-primary-50); color: var(--p-primary-800); font-weight: 650; font-size: .85rem; margin-bottom: 1rem; border: 1px solid var(--p-primary-100); }
.hero-panel { background: var(--p-surface); border: 1px solid var(--p-border); border-radius: 20px; box-shadow: var(--p-shadow-lg); padding: 1.25rem; }
.hero-panel .row-item { display: flex; gap: .8rem; align-items: center; padding: .75rem 0; border-bottom: 1px solid var(--p-border); }
.hero-panel .row-item:last-child { border-bottom: 0; }
.feature { height: 100%; }
.feature h3 { margin-top: .9rem; }
.feature p { color: var(--p-muted); margin-bottom: 0; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
@media (min-width: 768px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li { counter-increment: step; background: var(--p-surface); border: 1px solid var(--p-border); border-radius: var(--p-radius); padding: 1.15rem 1.15rem 1.15rem 3.6rem; position: relative; }
.steps li::before { content: counter(step); position: absolute; inset-inline-start: 1rem; top: 1.05rem; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--p-primary); color: #fff; font-weight: 750; display: grid; place-items: center; font-size: .95rem; }
.rights-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
@media (min-width: 768px) { .rights-list { grid-template-columns: repeat(2, 1fr); } }
.rights-list li { display: flex; gap: .8rem; background: var(--p-surface); border: 1px solid var(--p-border); border-radius: var(--p-radius); padding: 1rem; }
.rights-list li i { color: var(--p-primary-700); font-size: 1.3rem; }
.band { background: var(--p-surface); border: 1px solid var(--p-border); border-radius: 20px; padding: 1.5rem; }
@media (min-width: 768px) { .band { padding: 2rem 2.25rem; } }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
@media (min-width: 768px) { .stats { grid-template-columns: repeat(4, 1fr); gap: 1rem; } }
.stat { background: var(--p-surface); border: 1px solid var(--p-border); border-radius: var(--p-radius); padding: 1rem 1.1rem; box-shadow: var(--p-shadow); display: flex; flex-direction: column; gap: .15rem; }
.stat-value { font-size: 1.75rem; font-weight: 800; color: var(--p-ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--p-muted); font-weight: 600; font-size: .92rem; }
.stat i { color: var(--p-primary-700); font-size: 1.15rem; }
.stat.attention { border-color: var(--p-warning-200); background: var(--p-warning-50); }
.stat.attention i { color: var(--p-warning); }

/* ---------- Dashboard: fiduciary / application / purpose ---------- */
.fiduciary { margin-top: 2.5rem; }
.fiduciary-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; margin-bottom: .9rem; border-bottom: 2px solid var(--p-border); padding-bottom: .6rem; }
.fiduciary-head h2 { margin: 0; }
.fiduciary-head .dpo { font-size: .92rem; color: var(--p-muted); }
.app-card + .app-card { margin-top: 1.25rem; }
.app-title { display: flex; align-items: center; gap: .75rem; }
.app-title h3 { margin: 0; font-size: 1.2rem; }
.app-meta { display: flex; flex-wrap: wrap; gap: .35rem 1.25rem; color: var(--p-muted); font-size: .92rem; margin-top: .75rem; }
.app-meta span { display: inline-flex; align-items: center; gap: .35rem; }
.consent-block { border-top: 1px solid var(--p-border); }
.consent-block:first-of-type { border-top: 0; }
.purpose-list { list-style: none; margin: 1rem 0 0; padding: 0; border: 1px solid var(--p-border); border-radius: var(--p-radius-sm); }
.purpose { padding: .9rem 1rem; border-top: 1px solid var(--p-border); }
.purpose:first-child { border-top: 0; }
.purpose-row { display: flex; gap: 1rem; align-items: flex-start; justify-content: space-between; }
.purpose-name { font-weight: 650; font-size: 1.02rem; margin: 0; color: var(--p-ink); }
.purpose-desc { color: var(--p-muted); margin: .15rem 0 0; font-size: .95rem; }
/* A purpose code shown for reference (receipt check): small and muted under the name. */
.purpose-code { color: var(--p-muted); margin: .1rem 0 0; font-size: .82rem; }
.purpose-state { color: var(--p-muted); margin: .3rem 0 0; font-size: .85rem; font-weight: 600; }
.purpose-control { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: .2rem; }
.purpose details { margin-top: .5rem; }
.purpose details > summary, .disclosure > summary { cursor: pointer; color: var(--p-primary-700); font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; gap: .35rem; list-style: none; }
.purpose details > summary::-webkit-details-marker, .disclosure > summary::-webkit-details-marker { display: none; }
.purpose details > summary::before, .disclosure > summary::before { content: "\F285"; font-family: bootstrap-icons; font-size: .8rem; transition: transform .15s; }
.purpose details[open] > summary::before, .disclosure[open] > summary::before { transform: rotate(90deg); }
.purpose-facts { display: grid; gap: .9rem; padding: .75rem 0 .25rem; }
@media (min-width: 768px) { .purpose-facts { grid-template-columns: 1fr 1fr; } }
.fact-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 650; color: var(--p-muted); margin-bottom: .25rem; }
.recipients { list-style: none; margin: 0; padding: 0; }
.recipients li { display: flex; flex-wrap: wrap; gap: .25rem .5rem; align-items: center; padding: .2rem 0; }
.flag-cross { display: inline-flex; align-items: center; gap: .25rem; font-size: .8rem; font-weight: 650; color: var(--p-warning-ink); background: var(--p-warning-50); border: 1px solid var(--p-warning-200); border-radius: 999px; padding: 0 .5rem; }
.impact { background: var(--p-warning-50); border: 1px solid var(--p-warning-200); border-radius: var(--p-radius-sm); padding: .6rem .8rem; color: var(--p-warning-ink); }
.locked { display: inline-flex; align-items: center; gap: .35rem; font-size: .88rem; font-weight: 650; color: var(--p-text-2); background: var(--p-hover); border: 1px solid var(--p-border); border-radius: 999px; padding: .25rem .7rem; white-space: nowrap; }
.empty-state { text-align: center; padding: 2.5rem 1rem; }
.empty-state .icon-chip { margin: 0 auto 1rem; width: 56px; height: 56px; font-size: 1.6rem; }
.empty-state p { color: var(--p-muted); max-width: 52ch; margin-inline: auto; }

/* ---------- Toggle switch (button role="switch") ---------- */
.switch { display: inline-flex; align-items: center; gap: .55rem; background: none; border: 0; padding: .35rem .25rem; min-height: 44px; border-radius: 999px; cursor: pointer; color: var(--p-text-2); font-weight: 650; }
.switch-track { width: 52px; height: 30px; border-radius: 999px; background: var(--p-border-strong); position: relative; transition: background .15s; flex-shrink: 0; border: 2px solid transparent; }
.switch-thumb { position: absolute; top: 2px; inset-inline-start: 2px; width: 22px; height: 22px; border-radius: 50%; background: var(--p-surface); box-shadow: 0 1px 3px rgba(15, 23, 42, .3); transition: transform .15s; display: grid; place-items: center; font-size: .75rem; color: var(--p-muted); }
.switch[aria-checked="true"] .switch-track { background: var(--p-primary); }
.switch[aria-checked="true"] .switch-thumb { transform: translateX(22px); color: var(--p-primary); }
.switch:hover .switch-track { filter: brightness(.95); }
.switch-track.switch-demo-on { background: var(--p-primary); }
.switch-demo-on .switch-thumb { transform: translateX(22px); }
.switch-text { min-width: 2.2rem; text-align: start; }
[dir="rtl"] .switch[aria-checked="true"] .switch-thumb, [dir="rtl"] .switch-demo-on .switch-thumb { transform: translateX(-22px); }
.switch[disabled] { cursor: progress; opacity: .7; }
@media (prefers-reduced-motion: reduce) { .switch-track, .switch-thumb, .purpose details > summary::before { transition: none; } }
@media (forced-colors: active) { .switch-track { border-color: ButtonText; } .switch[aria-checked="true"] .switch-thumb { background: Highlight; } }

/* ---------- Key-value lists (two columns only when their card is wide enough) ---------- */
.card-body, .review-box { container-type: inline-size; }
.kv { display: grid; grid-template-columns: 1fr; gap: 0 1.25rem; margin: 0; }
.kv dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--p-muted); font-weight: 650; padding-top: .6rem; }
.kv dd { margin: 0; overflow-wrap: anywhere; padding-bottom: .6rem; border-bottom: 1px solid var(--p-border); }
.kv dd:last-of-type { border-bottom: 0; }
@container (min-width: 520px) {
  .kv { grid-template-columns: minmax(150px, 34%) 1fr; }
  .kv dt { padding: .55rem 0; border-bottom: 1px solid var(--p-border); }
  .kv dd { padding: .55rem 0; }
  .kv dt:last-of-type { border-bottom: 0; }
}
.hash { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; overflow-wrap: anywhere; color: var(--p-text-2); }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; inset-inline-start: 19px; top: 8px; bottom: 8px; width: 2px; background: var(--p-border); }
.timeline li { position: relative; padding: 0 0 1.25rem 3.25rem; }
.timeline li:last-child { padding-bottom: 0; }
.timeline .t-icon { position: absolute; inset-inline-start: 0; top: 0; width: 40px; height: 40px; border-radius: 50%; background: var(--p-surface); border: 2px solid var(--p-border); display: grid; place-items: center; color: var(--p-primary-700); font-size: 1.05rem; }
.timeline .t-title { font-weight: 650; color: var(--p-ink); }
.timeline .t-meta { font-size: .88rem; color: var(--p-muted); }
.timeline .t-body { margin-top: .35rem; white-space: pre-line; overflow-wrap: anywhere; }
.timeline .t-message { background: var(--p-surface-2); border: 1px solid var(--p-border); border-radius: var(--p-radius-sm); padding: .65rem .85rem; margin-top: .4rem; white-space: pre-line; overflow-wrap: anywhere; }
.timeline li.from-you .t-message { background: var(--p-primary-50); border-color: var(--p-primary-100); }

/* ---------- Requests ---------- */
.request-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .85rem; }
.request-item a.request-link { display: block; color: inherit; text-decoration: none; }
.request-item a.request-link:hover .request-subject { text-decoration: underline; color: var(--p-primary-800); }
.request-subject { font-weight: 650; font-size: 1.05rem; color: var(--p-ink); margin: .2rem 0; overflow-wrap: anywhere; }
.request-meta { display: flex; flex-wrap: wrap; gap: .25rem 1.1rem; font-size: .9rem; color: var(--p-muted); }
.progress { height: 8px; border-radius: 999px; background: var(--p-border); margin-top: .75rem; }
.progress-bar { background: var(--p-primary); border-radius: 999px; }
.p-15 { width: 15%; } .p-30 { width: 30%; } .p-55 { width: 55%; } .p-65 { width: 65%; } .p-100 { width: 100%; }
.type-grid { display: grid; gap: .85rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .type-grid { grid-template-columns: 1fr 1fr; } }
.type-card { display: flex; gap: .9rem; align-items: flex-start; padding: 1.1rem; background: var(--p-surface); border: 1px solid var(--p-border); border-radius: var(--p-radius); color: inherit; text-decoration: none; height: 100%; box-shadow: var(--p-shadow); transition: border-color .15s, box-shadow .15s; }
.type-card:hover { border-color: var(--p-primary-200); box-shadow: 0 6px 18px -8px rgba(15, 23, 42, .25); color: inherit; }
.type-card h2, .type-card h3 { font-size: 1.05rem; font-weight: 650; margin: 0 0 .25rem; color: var(--p-ink); }
.type-card p { margin: 0; color: var(--p-muted); font-size: .95rem; }
.type-card .law { font-size: .8rem; font-weight: 650; color: var(--p-primary-700); margin-top: .35rem; display: inline-block; }
.review-box { background: var(--p-surface-2); border: 1px dashed var(--p-border-mid); border-radius: var(--p-radius); padding: 1rem 1.15rem; }

/* ---------- Code / receipt ---------- */
.code-block { background: var(--p-ink); color: var(--p-text-on-dark); border-radius: var(--p-radius-sm); padding: 1rem; overflow-x: auto; font-size: .82rem; max-height: 420px; white-space: pre; }
.code-block:focus-visible { outline-color: var(--p-focus-color-on-dark); outline-offset: -5px; }
.receipt-input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; min-height: 160px; }
.verify-result { margin-top: 1.5rem; }

/* ---------- Notice (privacy notice text) ---------- */
.notice-text { font-size: 1.02rem; }
.notice-text h2 { font-size: 1.3rem; margin-top: 1.75rem; }
.notice-text h3 { font-size: 1.12rem; margin-top: 1.5rem; }
.notice-text h4 { font-size: 1rem; margin-top: 1.25rem; }
.notice-text li { margin-bottom: .5rem; }
.notice-text blockquote { border-inline-start: 4px solid var(--p-primary-200); padding-inline-start: 1rem; color: var(--p-text-2); }

/* ---------- Dialog (withdrawal confirmation, progressive enhancement) ---------- */
dialog.confirm-dialog { border: 0; border-radius: 18px; padding: 0; max-width: min(560px, calc(100vw - 2rem)); width: 100%; box-shadow: var(--p-shadow-lg); color: var(--p-text); }
dialog.confirm-dialog::backdrop { background: rgba(15, 23, 42, .55); }
.dialog-body { padding: 1.5rem; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: flex-end; padding: 1rem 1.5rem 1.5rem; }

/* ---------- Contact cards ---------- */
.contact-grid { display: grid; gap: 1rem; }
@media (min-width: 768px) { .contact-grid { grid-template-columns: 1fr 1fr; } }
.contact-line { display: flex; gap: .55rem; align-items: flex-start; margin-bottom: .4rem; overflow-wrap: anywhere; }
.contact-line i { color: var(--p-primary-700); margin-top: .2rem; }

/* ---------- Utilities ---------- */
.gap-list > * + * { margin-top: .75rem; }
.divider { border-top: 1px solid var(--p-border); margin: 1.5rem 0; }
.nowrap { white-space: nowrap; }
.min-w-0 { min-width: 0; }
.wrap-anywhere { overflow-wrap: anywhere; }
.auth-shell { max-width: 520px; margin: 0 auto; }
.narrow-shell { max-width: 780px; margin: 0 auto; }
.auth-card .card-body { padding: 1.5rem; }
@media (min-width: 768px) { .auth-card .card-body { padding: 2.25rem; } }
.countdown { font-variant-numeric: tabular-nums; }
.back-banner { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; background: var(--p-surface); border: 1px solid var(--p-primary-100); border-radius: var(--p-radius); padding: .75rem 1rem; margin-bottom: 1.25rem; }
/* Who is acting / what the session covers (nominee mode, deep-link scope) */
.session-banner { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; border-radius: var(--p-radius); padding: .85rem 1rem; margin-bottom: 1.25rem; border: 1px solid var(--p-primary-100); background: var(--p-primary-50); }
.session-banner > i { font-size: 1.4rem; color: var(--p-primary-700); }
.session-banner.acting { background: var(--p-warning-50); border-color: var(--p-warning-200); }
.session-banner.acting > i { color: var(--p-warning-ink); }
.session-banner .min-w-0 { flex: 1 1 16rem; }
.step-number { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--p-primary); color: #fff; font-size: .9rem; font-weight: 750; margin-inline-end: .35rem; }
/* Right-to-left scripts (Urdu, Kashmiri, Sindhi): mirror directional icons; keep codes, e-mails and numbers left to right */
[dir="rtl"] .bi-arrow-left, [dir="rtl"] .bi-arrow-right, [dir="rtl"] .bi-box-arrow-in-left, [dir="rtl"] .bi-box-arrow-right, [dir="rtl"] .bi-box-arrow-in-right, [dir="rtl"] .bi-box-arrow-up-right { display: inline-block; transform: scaleX(-1); }
[dir="rtl"] .hash, [dir="rtl"] .code-input, [dir="rtl"] .mono, [dir="rtl"] input[type="email"] { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] .code-input { text-align: center; }
/* Purpose names and descriptions come from the organisation and may be in a script other than the interface's:
   let each paragraph take its own direction so punctuation stays at the right end. */
.purpose-name, .purpose-desc { unicode-bidi: plaintext; }
.js-only { display: none; }
.js .js-only { display: initial; }
.js .no-js-only { display: none; }

@media print {
  .site-header, .site-footer, .skip-link, .actions, .card-footer-actions, .switch, form { display: none !important; }
  body { background: var(--p-surface); }
  .card { box-shadow: none; }
}
