/* =========================================================================
   PostNL Quantum Readiness Assessment — design system: tokens, base, components
   Themes: <body data-theme="postnl"> (default) | <body data-theme="capgemini">
   PostNL values are taken from PostNL's live "Stamp" design system tokens
   (postnl.nl, .stamp-theme-light). See docs/DESIGN.md for sources.
   ========================================================================= */

/* ---------- 1. Tokens ---------- */
:root {
  /* Type */
  --font-sans: "Hanken Grotesk", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --font-display: var(--font-sans);
  --font-mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  --fs-xs: 0.75rem;    /* 12 */
  --fs-sm: 0.875rem;   /* 14 */
  --fs-md: 1rem;       /* 16 */
  --fs-lg: 1.1875rem;  /* 19 — Stamp body-l */
  --fs-xl: 1.5rem;     /* 24 */
  --fs-2xl: 2rem;      /* 32 */
  --fs-3xl: 2.5rem;    /* 40 */
  --fs-4xl: 3.375rem;  /* 54 */
  --lh-tight: 1.1;
  --lh-snug: 1.3;
  --lh-body: 1.5;
  --heading-weight: 800;
  --heading-tracking: -0.02em;

  /* Space (Stamp spacing scale) */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px;
  --sp-6: 32px; --sp-7: 40px; --sp-8: 56px; --sp-9: 72px; --sp-10: 88px;
  --gutter: 16px;

  /* Radius (Stamp radius scale) */
  --r-xs: 4px; --r-s: 6px; --r-m: 8px; --r-l: 16px; --r-xl: 24px; --r-pill: 999px;
  --btn-radius: var(--r-xs);
  --card-radius: var(--r-l);
  --control-radius: var(--r-xs);

  /* Neutrals (Stamp light) */
  --ink: #1f1e2f;          /* text-default */
  --ink-2: #424054;
  --ink-muted: #67687f;    /* text-subtle, 5.6:1 on white */
  --ink-disabled: #86889d;
  --line: #bec0cb;         /* border-default (decorative) */
  --line-soft: #e7e8eb;
  --line-strong: #67687f;  /* border-strong — form controls (≥3:1) */
  --surface: #ffffff;
  --surface-2: #f7f7f8;
  --surface-3: #f1f1f2;
  --page-bg: #f5f5f6;

  /* Status (Stamp light) */
  --success: #008005;  --success-icon: #00a347; --success-bg: #e5f6ed;
  --danger:  #d70036;  --danger-icon:  #ee3261; --danger-bg:  #fdeaef;
  --warning: #7a5a00;  --warning-icon: #c99700; --warning-bg: #fffbea; --warning-line: #fdd732;
  --info:    #00699b;  --info-icon:    #009ee3; --info-bg:    #e5f5fc;

  /* Risk bands — ordered, lightness-stepped, red→orange→yellow→blue (not red/green dependent).
     Always rendered together with a text label + 5-step meter glyph. */
  --risk-critical: #a50e2d; --risk-critical-bg: #fbe7eb; --risk-critical-ink: #8a0b25;
  --risk-high:     #e2620b; --risk-high-bg:     #fdeedf; --risk-high-ink:     #9c3c00;
  --risk-moderate: #f2b800; --risk-moderate-bg: #fff6d6; --risk-moderate-ink: #6e5100;
  --risk-managed:  #2e8bc9; --risk-managed-bg:  #e3f1fa; --risk-managed-ink:  #1b5f8c;
  --risk-low:      #1b2f80; --risk-low-bg:      #e6e9f6; --risk-low-ink:      #1b2f80;
  --risk-none:     #a2a4b4; --risk-none-bg:     #f1f1f2; --risk-none-ink:     #515165;

  /* Sequential scale for 0–5 values (heat cells, answer distribution) */
  --seq-0: #eef3f8; --seq-1: #c9dcec; --seq-2: #93bddb; --seq-3: #4f94c6; --seq-4: #1f6aa5; --seq-5: #0d3f6e;

  /* Elevation */
  --shadow-1: 0 1px 2px rgba(31, 30, 47, .06), 0 1px 3px rgba(31, 30, 47, .08);
  --shadow-2: 0 4px 12px rgba(31, 30, 47, .08), 0 1px 3px rgba(31, 30, 47, .06);
  --shadow-3: 0 16px 40px rgba(31, 30, 47, .16);

  --focus: #001a73;
  --focus-ring: 0 0 0 2px #fff, 0 0 0 4px var(--focus);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --header-h: 72px;
}

/* PostNL theme (public site, respondent questionnaire, PostNL admin) */
[data-theme="postnl"] {
  --brand: #f56900;          /* PostNL orange (logo, background-brand) */
  --brand-mid: #e75204;      /* border/icon/heading brand */
  --brand-strong: #d83d00;   /* text-brand — 4.6:1 on white, use for small orange text */
  --brand-deep: #c73c00;
  --brand-tint: #ffede0;
  --brand-tint-2: #fff6ef;
  --navy: #001a73;           /* PostNL dark blue */
  --navy-2: #081c67;
  --action: #4e4ee2;         /* Stamp blue (links / primary CTA), 6:1 with white */
  --action-hover: #4646a9;
  --action-active: #001a73;
  --action-tint: #ececff;
  --heading: #001a73;
  --selected: #e75204;       /* Stamp border-selected */
  --selected-bg: #fff4ec;
  --chart-1: #1f6aa5;
  --chart-2: #e75204;
}

/* Capgemini theme (Capgemini admin) */
[data-theme="capgemini"] {
  --font-sans: "Ubuntu", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --heading-weight: 500;
  --heading-tracking: -0.01em;
  --brand: #0070ad;          /* Capgemini Blue */
  --brand-mid: #0070ad;
  --brand-strong: #005d90;
  --brand-deep: #00446b;
  --brand-tint: #e5f1f8;
  --brand-tint-2: #f2f8fc;
  --vibrant: #12abdb;        /* Capgemini Vibrant Blue */
  --turquoise: #01d1d0;      /* Capgemini 2025 accent */
  --navy: #171a22;           /* capgemini.com dark surface */
  --navy-2: #15011d;
  --action: #0070ad;
  --action-hover: #005d90;
  --action-active: #00446b;
  --action-tint: #e5f1f8;
  --heading: #171a22;
  --selected: #0070ad;
  --selected-bg: #eef6fb;
  --btn-radius: var(--r-pill);
  --card-radius: var(--r-m);
  --focus: #0070ad;
  --page-bg: #f4f6f9;
  --chart-1: #0070ad;
  --chart-2: #e2620b;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 24px); }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  color: var(--ink);
  background: var(--page-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img, svg { max-width: 100%; }
img { height: auto; display: block; }
h1, h2, h3, h4, h5 {
  margin: 0 0 var(--sp-3);
  font-family: var(--font-display);
  font-weight: var(--heading-weight);
  letter-spacing: var(--heading-tracking);
  line-height: var(--lh-tight);
  color: var(--heading);
}
h1 { font-size: clamp(1.75rem, 1.3rem + 2vw, var(--fs-3xl)); }
h2 { font-size: clamp(1.375rem, 1.2rem + .8vw, var(--fs-2xl)); }
h3 { font-size: var(--fs-xl); line-height: var(--lh-snug); }
h4 { font-size: var(--fs-lg); line-height: var(--lh-snug); }
h5 { font-size: var(--fs-md); line-height: var(--lh-snug); }
p { margin: 0 0 var(--sp-4); }
p:last-child { margin-bottom: 0; }
a { color: var(--action); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { color: var(--action-hover); text-decoration-thickness: 2px; }
a:active { color: var(--action-active); }
strong, b { font-weight: 700; }
small { font-size: var(--fs-sm); }
hr { border: 0; border-top: 1px solid var(--line-soft); margin: var(--sp-5) 0; }
code, kbd { font-family: var(--font-mono); font-size: .92em; }
code { background: var(--surface-3); padding: .1em .35em; border-radius: var(--r-xs); }
ul, ol { margin: 0 0 var(--sp-4); padding-left: 1.25rem; }
::selection { background: var(--brand-tint); color: var(--ink); }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
[hidden] { display: none !important; }

/* ---------- 3. Utilities ---------- */
.visually-hidden, .sr-only {
  position: absolute !important; 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; left: var(--sp-4); top: -100px; z-index: 1000;
  background: var(--navy); color: #fff; padding: var(--sp-2) var(--sp-4); border-radius: var(--r-xs);
  font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: var(--sp-3); color: #fff; }

.container { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: 820px; }
.container--wide { max-width: 1600px; }
@media (min-width: 600px) { :root { --gutter: 24px; } }
@media (min-width: 1280px) { :root { --gutter: 32px; } }

.stack > * + * { margin-top: var(--stack, var(--sp-4)); }
.stack-s { --stack: var(--sp-2); } .stack-l { --stack: var(--sp-6); } .stack-xl { --stack: var(--sp-7); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--cluster-gap, var(--sp-3)); align-items: center; }
.cluster--end { justify-content: flex-end; }
.cluster--between { justify-content: space-between; }
.grid { display: grid; gap: var(--grid-gap, var(--sp-5)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); }
@media (max-width: 599.98px) { .grid--4 { --grid-gap: var(--sp-3); } .grid--4 > .stat { padding: var(--sp-4); } }
@media (min-width: 960px) {
  .grid--sidebar { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
  .grid--2-fixed { grid-template-columns: 1fr 1fr; }
}
.text-muted { color: var(--ink-muted); }
.text-sm { font-size: var(--fs-sm); }
.text-xs { font-size: var(--fs-xs); }
.text-lg { font-size: var(--fs-lg); }
.text-brand { color: var(--brand-strong); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.tabular { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); }
.lead { font-size: var(--fs-lg); color: var(--ink-2); line-height: 1.55; }
.eyebrow {
  display: inline-block; font-size: var(--fs-sm); font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--brand-strong); margin-bottom: var(--sp-2);
}
.mt-0 { margin-top: 0 !important; } .mb-0 { margin-bottom: 0 !important; }
.mt-4 { margin-top: var(--sp-4); } .mt-5 { margin-top: var(--sp-5); } .mt-6 { margin-top: var(--sp-6); }
.mb-4 { margin-bottom: var(--sp-4); } .mb-5 { margin-bottom: var(--sp-5); } .mb-6 { margin-bottom: var(--sp-6); }
.icon { display: inline-block; flex: none; vertical-align: middle; }
.divider { height: 1px; background: var(--line-soft); margin: var(--sp-5) 0; border: 0; }

/* ---------- 4. Buttons ---------- */
.btn {
  --btn-bg: var(--action); --btn-fg: #fff; --btn-border: var(--action);
  --btn-bg-hover: var(--action-hover); --btn-border-hover: var(--action-hover);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: 44px; padding: 8px 22px;
  font: inherit; font-weight: 700; font-size: var(--fs-md); line-height: 1.25; letter-spacing: 0;
  color: var(--btn-fg); background: var(--btn-bg);
  border: 2px solid var(--btn-border); border-radius: var(--btn-radius);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease);
  -webkit-user-select: none; user-select: none;
}
.btn:hover { background: var(--btn-bg-hover); border-color: var(--btn-border-hover); color: var(--btn-fg); text-decoration: none; }
.btn:active { background: var(--action-active); border-color: var(--action-active); }
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn[disabled], .btn[aria-disabled="true"] {
  --btn-bg: var(--surface-3); --btn-fg: var(--ink-disabled); --btn-border: var(--surface-3);
  --btn-bg-hover: var(--surface-3); --btn-border-hover: var(--surface-3);
  cursor: not-allowed; pointer-events: none;
}
.btn--secondary {
  --btn-bg: transparent; --btn-fg: var(--action); --btn-border: var(--action);
  --btn-bg-hover: var(--action-tint); --btn-border-hover: var(--action-hover);
}
.btn--secondary:hover { color: var(--action-hover); }
.btn--secondary:active { background: var(--action-tint); color: var(--action-active); }
.btn--ghost {
  --btn-bg: transparent; --btn-fg: var(--action); --btn-border: transparent;
  --btn-bg-hover: var(--action-tint); --btn-border-hover: transparent;
  padding-inline: 12px;
}
.btn--ghost:hover { color: var(--action-hover); }
.btn--ghost:active { background: var(--action-tint); border-color: transparent; color: var(--action-active); }
.btn--danger {
  --btn-bg: var(--danger); --btn-fg: #fff; --btn-border: var(--danger);
  --btn-bg-hover: #b0002c; --btn-border-hover: #b0002c;
}
.btn--danger:active { background: #8f0024; border-color: #8f0024; }
.btn--brand { --btn-bg: var(--brand-strong); --btn-border: var(--brand-strong); --btn-bg-hover: var(--brand-deep); --btn-border-hover: var(--brand-deep); }
.btn--on-dark { --btn-bg: #fff; --btn-fg: var(--navy); --btn-border: #fff; --btn-bg-hover: rgba(255,255,255,.88); --btn-border-hover: transparent; }
.btn--sm { min-height: 36px; padding: 4px 14px; font-size: var(--fs-sm); gap: 6px; }
.btn--lg { min-height: 52px; padding: 12px 28px; font-size: var(--fs-lg); }
.btn--block { display: flex; width: 100%; }
.btn--icon { padding: 0; width: 44px; min-width: 44px; }
.btn--icon.btn--sm { width: 36px; min-width: 36px; }
.btn .icon { width: 1.15em; height: 1.15em; }

/* Link-style button (for inline actions in text / tables) */
.link-btn {
  appearance: none; background: none; border: 0; padding: 0; font: inherit; color: var(--action);
  text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.link-btn:hover { color: var(--action-hover); text-decoration-thickness: 2px; }
.link-btn--danger { color: var(--danger); }

/* ---------- 5. Cards ---------- */
.card {
  background: var(--surface); border-radius: var(--card-radius);
  box-shadow: var(--shadow-1); border: 1px solid var(--line-soft);
  padding: var(--card-pad, var(--sp-5));
}
@media (min-width: 600px) { .card { --card-pad: var(--sp-6); } }
.card--compact { --card-pad: var(--sp-4); }
@media (min-width: 600px) { .card--compact { --card-pad: var(--sp-5); } }
.card--flat { box-shadow: none; }
.card--muted { background: var(--surface-2); box-shadow: none; }
.card--accent { border-top: 4px solid var(--brand); }
.card--brand { background: var(--brand-strong); color: #fff; border-color: transparent; }
.card--brand h2, .card--brand h3, .card--brand a { color: #fff; }
.card--navy { background: var(--navy); color: #fff; border-color: transparent; }
.card--navy h2, .card--navy h3, .card--navy a { color: #fff; }
.card--link { transition: box-shadow .2s var(--ease), transform .2s var(--ease); }
.card--link:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
.card__header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-4); flex-wrap: wrap; }
.card__title { font-size: var(--fs-lg); margin: 0; line-height: var(--lh-snug); }
.card__subtitle { color: var(--ink-muted); font-size: var(--fs-sm); margin: 2px 0 0; }
.card__footer { margin-top: var(--sp-5); padding-top: var(--sp-4); border-top: 1px solid var(--line-soft); display: flex; gap: var(--sp-3); flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.card__body > :last-child { margin-bottom: 0; }

/* ---------- 6. Page header ---------- */
.page-header { padding: var(--sp-6) 0 var(--sp-5); }
.page-header__inner { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); }
.page-header__text { min-width: 0; flex: 1 1 420px; }
.page-header__title { margin: 0; }
.page-header__lead { margin: var(--sp-3) 0 0; color: var(--ink-2); font-size: var(--fs-lg); max-width: 68ch; }
.page-header__actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.page-header .breadcrumb { margin-bottom: var(--sp-3); }

/* ---------- 7. Stat tile / KPI ---------- */
.stat {
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--card-radius);
  box-shadow: var(--shadow-1); padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-1);
  position: relative; overflow: hidden; min-width: 0;
}
.stat__top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.stat__label { font-size: var(--fs-sm); color: var(--ink-muted); font-weight: 600; }
.stat__icon { width: 40px; height: 40px; border-radius: var(--r-pill); display: grid; place-items: center; background: var(--brand-tint); color: var(--brand-strong); flex: none; }
.stat__icon .icon { width: 20px; height: 20px; }
.stat__value { font-family: var(--font-display); font-size: clamp(1.75rem, 1.4rem + 1vw, 2.25rem); font-weight: var(--heading-weight); color: var(--heading); line-height: 1.1; letter-spacing: var(--heading-tracking); font-variant-numeric: tabular-nums; }
.stat__unit { font-size: .55em; font-weight: 600; color: var(--ink-muted); margin-left: 2px; letter-spacing: 0; }
.stat__meta { font-size: var(--fs-sm); color: var(--ink-muted); }
.stat .progress { margin-top: var(--sp-2); }
.stat--brand .stat__icon { background: var(--brand); color: #fff; }
.stat--success .stat__icon { background: var(--success-bg); color: var(--success); }
.stat--warning .stat__icon { background: var(--warning-bg); color: var(--warning); }
.stat--info .stat__icon { background: var(--info-bg); color: var(--info); }
.stat--navy .stat__icon { background: var(--action-tint); color: var(--navy); }

/* ---------- 8. Badges, pills ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; min-height: 26px;
  border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: 600; line-height: 1.2;
  background: var(--surface-3); color: var(--ink-2); white-space: nowrap; border: 1px solid transparent;
}
.badge .icon { width: 14px; height: 14px; }
.badge--sm { min-height: 22px; padding: 1px 8px; font-size: var(--fs-xs); }
.badge--brand { background: var(--brand-tint); color: var(--brand-deep); }
.badge--action { background: var(--action-tint); color: var(--action-active); }
.badge--success { background: var(--success-bg); color: var(--success); }
.badge--danger { background: var(--danger-bg); color: var(--danger); }
.badge--warning { background: var(--warning-bg); color: var(--warning); border-color: #f7e7a1; }
.badge--info { background: var(--info-bg); color: var(--info); }
.badge--outline { background: transparent; border-color: var(--line); color: var(--ink-2); }
.badge--count { min-width: 24px; justify-content: center; padding-inline: 7px; background: var(--brand); color: #fff; }

/* Status pills — each has its own icon so status never depends on colour */
.pill--invited     { background: var(--info-bg);    color: var(--info); }
.pill--in_progress { background: var(--warning-bg); color: var(--warning); border-color: #f7e7a1; }
.pill--submitted   { background: var(--success-bg); color: var(--success); }
.pill--revoked     { background: var(--surface-3);  color: var(--ink-muted); border-color: var(--line); }
.pill--revoked .badge__text { text-decoration: line-through; text-decoration-thickness: 1px; }
.pill--active      { background: var(--success-bg); color: var(--success); }
.pill--inactive, .pill--archived { background: var(--surface-3); color: var(--ink-muted); }

/* Risk badge: tint + ink + 5-segment meter (severity) + label */
.risk-badge { background: var(--rb-bg); color: var(--rb-ink); border-color: color-mix(in srgb, var(--rb) 30%, transparent); }
.risk-badge--lg { font-size: var(--fs-md); min-height: 34px; padding: 5px 14px; }
.risk--critical { --rb: var(--risk-critical); --rb-bg: var(--risk-critical-bg); --rb-ink: var(--risk-critical-ink); }
.risk--high     { --rb: var(--risk-high);     --rb-bg: var(--risk-high-bg);     --rb-ink: var(--risk-high-ink); }
.risk--moderate { --rb: var(--risk-moderate); --rb-bg: var(--risk-moderate-bg); --rb-ink: var(--risk-moderate-ink); }
.risk--managed  { --rb: var(--risk-managed);  --rb-bg: var(--risk-managed-bg);  --rb-ink: var(--risk-managed-ink); }
.risk--low      { --rb: var(--risk-low);      --rb-bg: var(--risk-low-bg);      --rb-ink: var(--risk-low-ink); }
.risk--none     { --rb: var(--risk-none);     --rb-bg: var(--risk-none-bg);     --rb-ink: var(--risk-none-ink); }
.risk-meter { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.risk-meter i { display: block; width: 4px; border-radius: 1px; background: currentColor; opacity: .22; }
.risk-meter i:nth-child(1) { height: 4px; } .risk-meter i:nth-child(2) { height: 6px; }
.risk-meter i:nth-child(3) { height: 8px; } .risk-meter i:nth-child(4) { height: 10px; } .risk-meter i:nth-child(5) { height: 12px; }
.risk-meter i.on { opacity: 1; background: var(--rb); }
.risk-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--rb); flex: none; }

/* ---------- 9. Alerts / flashes ---------- */
.alert {
  --a-fg: var(--info); --a-bg: var(--info-bg); --a-icon: var(--info-icon);
  display: flex; gap: var(--sp-3); align-items: flex-start;
  padding: var(--sp-3) var(--sp-4); border-radius: var(--r-m);
  background: var(--a-bg); color: var(--ink); border-left: 4px solid var(--a-icon);
}
.alert__icon { color: var(--a-fg); flex: none; margin-top: 1px; }
.alert__icon .icon { width: 22px; height: 22px; }
.alert__body { flex: 1; min-width: 0; }
.alert__title { font-weight: 700; margin: 0 0 2px; color: var(--ink); font-size: var(--fs-md); letter-spacing: 0; line-height: 1.4; font-family: var(--font-sans); }
.alert__body p { margin: 0; }
.alert__close {
  flex: none; appearance: none; border: 0; background: transparent; color: var(--ink-muted);
  width: 32px; height: 32px; margin: -4px -8px -4px 0; border-radius: var(--r-pill); cursor: pointer;
  display: grid; place-items: center;
}
.alert__close:hover { background: rgba(31, 30, 47, .08); color: var(--ink); }
.alert--success { --a-fg: var(--success); --a-bg: var(--success-bg); --a-icon: var(--success-icon); }
.alert--error   { --a-fg: var(--danger);  --a-bg: var(--danger-bg);  --a-icon: var(--danger-icon); }
.alert--warning { --a-fg: var(--warning); --a-bg: var(--warning-bg); --a-icon: var(--warning-line); }
.alert--info    { --a-fg: var(--info);    --a-bg: var(--info-bg);    --a-icon: var(--info-icon); }
.flash-list { display: grid; gap: var(--sp-3); margin: var(--sp-5) 0 0; }
.alert.is-leaving { opacity: 0; transform: translateY(-4px); transition: opacity .2s, transform .2s; }

/* ---------- 10. Forms ---------- */
.form { display: grid; gap: var(--sp-5); }
.form-row { display: grid; gap: var(--sp-5); }
@media (min-width: 720px) { .form-row--2 { grid-template-columns: 1fr 1fr; } .form-row--3 { grid-template-columns: repeat(3, 1fr); } }
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field__label { font-weight: 700; font-size: var(--fs-md); line-height: 1.25; color: var(--ink); }
.field__optional { font-weight: 400; color: var(--ink-muted); font-size: var(--fs-sm); }
.field__required { color: var(--danger); margin-left: 2px; }
.field__hint { font-size: var(--fs-sm); color: var(--ink-muted); margin: 0; }
.field__error { display: flex; gap: 6px; align-items: flex-start; font-size: var(--fs-sm); font-weight: 700; color: var(--danger); margin: 0; }
.field__error .icon { width: 16px; height: 16px; margin-top: 2px; }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 10px 14px;
  font: inherit; font-size: var(--fs-md); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--control-radius);
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-muted); opacity: 1; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus), 0 0 0 4px color-mix(in srgb, var(--focus) 18%, transparent); }
.input[readonly] { background: var(--surface-2); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--surface-3); color: var(--ink-disabled); border-color: var(--line); cursor: not-allowed; }
.textarea { min-height: 112px; resize: vertical; line-height: 1.5; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 44px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%231f1e2f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 20px;
}
.input--code { font-family: var(--font-mono); font-size: 1.375rem; letter-spacing: .14em; text-transform: uppercase; text-align: center; font-weight: 600; }
.input--lg { min-height: 56px; font-size: var(--fs-lg); }
.field--invalid .input, .field--invalid .select, .field--invalid .textarea { border-color: var(--danger); border-width: 2px; padding: 9px 13px; }
.field--invalid .field__label { color: var(--ink); }
.input-group { display: flex; align-items: stretch; }
.input-group > .input { border-top-right-radius: 0; border-bottom-right-radius: 0; min-width: 0; flex: 1; }
.input-group > .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; min-height: 48px; }
.fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.fieldset > legend { padding: 0; margin-bottom: 6px; float: left; width: 100%; }
.fieldset > legend + * { clear: both; }
.choice-list { display: grid; gap: var(--sp-2); }
.choice-list--inline { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); }
.choice { display: flex; align-items: flex-start; gap: var(--sp-3); cursor: pointer; position: relative; padding: 4px 0; line-height: 1.4; }
.choice__input {
  appearance: none; -webkit-appearance: none; flex: none; margin: 0; width: 24px; height: 24px;
  border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; display: grid; place-content: center;
  transition: border-color .15s, background-color .15s;
}
.choice__input[type="checkbox"] { border-radius: var(--r-xs); }
.choice__input[type="radio"] { border-radius: 50%; }
.choice__input:hover { border-color: var(--ink); }
.choice__input:checked { background: var(--action); border-color: var(--action); }
.choice__input[type="checkbox"]:checked::before {
  content: ""; width: 14px; height: 14px; background: #fff;
  clip-path: polygon(14% 52%, 0 66%, 38% 100%, 100% 22%, 86% 8%, 38% 72%);
}
.choice__input[type="radio"]:checked { background: var(--surface); border: 7px solid var(--action); }
.choice__input:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.choice__input:disabled { background: var(--surface-3); border-color: var(--line); cursor: not-allowed; }
.choice__text { padding-top: 1px; }
.choice__hint { display: block; font-size: var(--fs-sm); color: var(--ink-muted); }
/* Checkbox "chips" — e.g. choose dimensions for an invitee */
.choice-cards { display: grid; gap: var(--sp-2); grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.choice-cards .choice { border: 1px solid var(--line); border-radius: var(--r-m); padding: 12px 14px; background: var(--surface); }
.choice-cards .choice:hover { border-color: var(--line-strong); }
.choice-cards .choice:has(.choice__input:checked) { border-color: var(--action); background: var(--action-tint); box-shadow: inset 0 0 0 1px var(--action); }
.switch { display: inline-flex; align-items: center; gap: var(--sp-3); cursor: pointer; }
.switch__input { appearance: none; -webkit-appearance: none; margin: 0; width: 44px; height: 26px; border-radius: 999px; background: var(--line-strong); position: relative; cursor: pointer; transition: background .2s; flex: none; }
.switch__input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch__input:checked { background: var(--success); }
.switch__input:checked::after { transform: translateX(18px); }
.switch__input:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.form-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }
.form-actions--end { justify-content: flex-end; }
.form-error-summary { margin-bottom: var(--sp-5); }

/* ---------- 11. Tables (stack on mobile with .table--stack) ---------- */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--card-radius); }
.card > .table-wrap { margin: 0 calc(var(--card-pad, 24px) * -1); width: calc(100% + var(--card-pad, 24px) * 2); border-radius: 0; }
.card:has(> .table-wrap) { overflow: hidden; }
.card > .table-wrap:first-child { margin-top: calc(var(--card-pad, 24px) * -1); }
.card > .table-wrap:last-child { margin-bottom: calc(var(--card-pad, 24px) * -1); border-radius: 0 0 var(--card-radius) var(--card-radius); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); background: var(--surface); }
.table caption { text-align: left; font-weight: 700; padding: 0 0 var(--sp-3); color: var(--heading); }
.table th, .table td { padding: 12px 16px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line-soft); }
.table thead th {
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink-muted); background: var(--surface-2); white-space: nowrap; border-bottom: 1px solid var(--line);
}
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table .cell-strong { font-weight: 700; color: var(--ink); font-size: var(--fs-md); }
.table .cell-sub { display: block; color: var(--ink-muted); font-size: var(--fs-xs); margin-top: 2px; }
.table .cell-actions { text-align: right; white-space: nowrap; }
.table .cell-actions .cluster { justify-content: flex-end; --cluster-gap: var(--sp-2); flex-wrap: nowrap; }
.table tr.is-muted td { color: var(--ink-muted); }
.table th a { color: inherit; }
.table--compact th, .table--compact td { padding: 8px 12px; }
@media (max-width: 759.98px) {
  .table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table--stack, .table--stack tbody, .table--stack tr, .table--stack td { display: block; width: 100%; }
  .table--stack tr { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
  .table--stack tbody tr:hover { background: transparent; }
  .table--stack td { border: 0; padding: 4px 0; display: grid; grid-template-columns: minmax(96px, 38%) 1fr; gap: var(--sp-3); text-align: left !important; }
  .table--stack td::before { content: attr(data-label); font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-muted); padding-top: 2px; }
  .table--stack td[data-label=""]::before, .table--stack td:not([data-label])::before { display: none; }
  .table--stack td:not([data-label]), .table--stack td[data-label=""] { grid-template-columns: 1fr; }
  .table--stack td[data-label]:not([data-label=""]) > * { grid-column: 2; justify-self: start; }
  .table--stack td > .cluster { justify-self: stretch; }
  .table--stack td.cell-actions { padding-top: var(--sp-2); }
  .table--stack td.cell-actions .cluster { justify-content: flex-start; flex-wrap: wrap; }
}

/* ---------- 12. Empty state ---------- */
.empty-state { text-align: center; padding: var(--sp-7) var(--sp-5); max-width: 520px; margin-inline: auto; }
.empty-state__icon { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto var(--sp-4); background: var(--brand-tint); color: var(--brand-strong); }
.empty-state__icon .icon { width: 32px; height: 32px; }
.empty-state__title { font-size: var(--fs-xl); margin-bottom: var(--sp-2); }
.empty-state__text { color: var(--ink-muted); margin-bottom: var(--sp-5); }

/* ---------- 13. Progress ---------- */
.progress { --p-color: var(--brand); height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; position: relative; }
.progress__bar { height: 100%; border-radius: inherit; background: var(--p-color); transition: width .4s var(--ease); min-width: 0; }
.progress--sm { height: 4px; }
.progress--lg { height: 12px; }
.progress--success { --p-color: var(--success-icon); }
.progress--action { --p-color: var(--action); }
.progress--navy { --p-color: var(--navy); }
.progress-label { display: flex; justify-content: space-between; gap: var(--sp-3); font-size: var(--fs-sm); color: var(--ink-muted); margin-bottom: 6px; }
.progress-label strong { color: var(--ink); }
.progress-ring { position: relative; display: inline-grid; place-items: center; flex: none; }
.progress-ring > svg { display: block; transform: rotate(-90deg); }
.progress-ring__track { stroke: var(--surface-3); }
.progress-ring__value { stroke: var(--brand); transition: stroke-dashoffset .5s var(--ease); }
.progress-ring--success .progress-ring__value { stroke: var(--success-icon); }
.progress-ring--action .progress-ring__value { stroke: var(--action); }
.progress-ring__label { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: var(--ring-fs, 0.875rem); color: var(--heading); font-variant-numeric: tabular-nums; line-height: 1; }
.progress-ring__label .icon { color: var(--success); }

/* ---------- 14. Tabs ---------- */
.tabs { display: flex; gap: var(--sp-1); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin; margin-bottom: var(--sp-5); }
.tabs__tab {
  appearance: none; background: none; border: 0; font: inherit; font-weight: 600; color: var(--ink-muted);
  padding: 12px 16px; border-bottom: 3px solid transparent; margin-bottom: -1px; cursor: pointer;
  white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; gap: var(--sp-2);
}
.tabs__tab:hover { color: var(--ink); text-decoration: none; background: var(--surface-2); }
.tabs__tab[aria-selected="true"], .tabs__tab[aria-current="page"] { color: var(--heading); border-bottom-color: var(--brand); }
.tabs__tab:focus-visible { outline-offset: -3px; }
.tab-panel:focus-visible { outline-offset: 4px; }

/* ---------- 15. Modal (<dialog>) ---------- */
.modal {
  border: 0; padding: 0; border-radius: var(--card-radius); box-shadow: var(--shadow-3);
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); color: var(--ink); background: var(--surface);
}
.modal--wide { width: min(860px, calc(100vw - 32px)); }
.modal::backdrop { background: rgba(31, 30, 47, .55); }
.modal[open] { animation: modal-in .18s var(--ease); }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.modal__header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-5) var(--sp-5) 0; }
.modal__title { margin: 0; font-size: var(--fs-xl); }
.modal__body { padding: var(--sp-4) var(--sp-5); overflow: auto; }
.modal__footer { display: flex; gap: var(--sp-3); justify-content: flex-end; flex-wrap: wrap; padding: var(--sp-4) var(--sp-5) var(--sp-5); }
.modal__close { flex: none; }

/* ---------- 16. Copy field ---------- */
.copy-field { display: flex; align-items: stretch; border: 1px solid var(--line-strong); border-radius: var(--control-radius); background: var(--surface-2); overflow: hidden; }
.copy-field__value {
  flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-family: var(--font-mono); font-size: var(--fs-sm);
  padding: 10px 14px; color: var(--ink); text-overflow: ellipsis;
}
.copy-field__value:focus { outline: none; }
.copy-field:focus-within { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
.copy-field--code .copy-field__value { font-size: 1.25rem; letter-spacing: .12em; font-weight: 700; text-align: center; }
.copy-field__btn {
  flex: none; appearance: none; border: 0; border-left: 1px solid var(--line); background: var(--surface); color: var(--action);
  font: inherit; font-weight: 700; font-size: var(--fs-sm); padding: 0 16px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; min-height: 46px;
}
.copy-field__btn:hover { background: var(--action-tint); }
.copy-field__btn:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--focus); }
.copy-field__btn .copy-idle { display: inline-flex; align-items: center; gap: 6px; }
.copy-field__btn .copy-done { display: none; }
.copy-field__btn.is-copied { color: var(--success); }
.copy-field__btn.is-copied .copy-idle { display: none; }
.copy-field__btn.is-copied .copy-done { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- 17. Breadcrumb, pagination ---------- */
.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: var(--fs-sm); color: var(--ink-muted); }
.breadcrumb li { display: inline-flex; align-items: center; gap: 4px; }
.breadcrumb li + li::before { content: ""; width: 14px; height: 14px; background: currentColor; opacity: .6;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E") center/contain no-repeat; }
.breadcrumb a { color: var(--ink-muted); }
.breadcrumb a:hover { color: var(--action); }
.breadcrumb [aria-current="page"] { color: var(--ink); font-weight: 600; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; margin-top: var(--sp-5); }
.pagination__info { font-size: var(--fs-sm); color: var(--ink-muted); }
.pagination__links { display: flex; gap: var(--sp-2); }

/* ---------- 18. Toasts ---------- */
.toast-region { position: fixed; z-index: 900; right: var(--sp-4); bottom: var(--sp-4); left: var(--sp-4); display: grid; gap: var(--sp-2); justify-items: end; pointer-events: none; }
@media (min-width: 600px) { .toast-region { left: auto; width: 400px; } }
.toast {
  pointer-events: auto; display: flex; gap: var(--sp-3); align-items: center; width: 100%;
  background: var(--navy); color: #fff; padding: 12px 12px 12px 16px; border-radius: var(--r-m); box-shadow: var(--shadow-3);
  animation: toast-in .22s var(--ease);
}
.toast__icon { flex: none; display: grid; place-items: center; }
.toast__icon .icon { width: 20px; height: 20px; }
.toast--success .toast__icon { color: #5fe39a; }
.toast--error .toast__icon { color: #ff8fa9; }
.toast--warning .toast__icon { color: var(--warning-line); }
.toast--info .toast__icon { color: #7fd3f7; }
.toast__msg { flex: 1; font-size: var(--fs-sm); font-weight: 500; }
.toast__close { appearance: none; border: 0; background: transparent; color: rgba(255,255,255,.75); width: 32px; height: 32px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; flex: none; }
.toast__close:hover { background: rgba(255,255,255,.12); color: #fff; }
.toast.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- 19. Language toggle, logos, misc ---------- */
.lang-toggle {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 12px; border-radius: var(--btn-radius);
  font-weight: 700; font-size: var(--fs-sm); color: var(--action); text-decoration: none; border: 1px solid transparent;
}
.lang-toggle:hover { background: var(--action-tint); text-decoration: none; }
.lang-toggle .icon { width: 18px; height: 18px; }
.lang-toggle__code { letter-spacing: .04em; }
.logo-postnl { width: var(--logo-size, 56px); height: var(--logo-size, 56px); }
.logo-capgemini { height: var(--logo-h, 22px); width: auto; }
.cobrand { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); color: var(--ink-muted); }
.cobrand .logo-capgemini { --logo-h: 18px; }
.kbd { display: inline-block; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: var(--r-xs); padding: 0 6px; font-size: var(--fs-xs); font-family: var(--font-mono); background: var(--surface); }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: var(--sp-2) var(--sp-5); margin: 0; font-size: var(--fs-sm); }
.dl dt { color: var(--ink-muted); }
.dl dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.list-plain { list-style: none; padding: 0; margin: 0; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: var(--fs-sm); background: var(--brand-tint); color: var(--brand-deep); flex: none; text-transform: uppercase; }
.spinner { width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; vertical-align: -0.15em; }
@keyframes spin { to { transform: rotate(360deg); } }
.collapsible__toggle[aria-expanded="true"] .icon--chevron { transform: rotate(180deg); }
.icon--chevron { transition: transform .2s var(--ease); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; margin: var(--sp-7) 0 var(--sp-4); }
.section-title h2 { margin: 0; font-size: var(--fs-xl); }

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

/* ---------- 20. Print helpers ---------- */
.print-only, .print-header { display: none; }
/* Theme scoping: a nested [data-theme] re-applies its font + ink (e.g. styleguide previews) */
[data-theme] { font-family: var(--font-sans); color: var(--ink); }
