/* ============================================================
   Moneybird Concept Studio — iOS 9 design language
   Grouped-table layout, hairline separators, SF system font,
   thin weights, translucent blurred bars, flat surfaces,
   Import4You orange as the tint color.
   ============================================================ */
:root {
  /* iOS 9 grouped-table palette */
  --bg: #efeff4;              /* classic iOS grouped background */
  --bg-2: #e4e4ea;
  --cell: #ffffff;            /* table cells */
  --cell-press: #d9d9de;      /* highlight on tap */
  --ink: #000000;
  --ink-soft: #3c3c43;
  --muted: #8e8e93;           /* iOS secondary gray */
  --faint: #c7c7cc;           /* iOS separators / placeholders */
  --line: #c8c7cc;            /* hairline separator */
  --line-soft: #e5e5ea;

  /* Tint — Import4You orange (replaces iOS system blue) */
  --tint: #ff7a00;
  --tint-press: #d96400;
  --tint-wash: #fff2e6;

  /* Status */
  --green: #4cd964;           /* iOS 9 green */
  --green-ink: #2a9d3f;
  --blue: #007aff;
  --amber: #ff9500;           /* iOS 9 orange */
  --red: #ff3b30;             /* iOS 9 red */
  --green-bg: #e9f9ec; --green-line: #bde9c4;
  --blue-bg: #e6f0ff;  --blue-line: #bcd8ff;
  --amber-bg: #fff2e0; --amber-line: #ffd9a6;
  --red-bg: #ffe9e7;   --red-line: #ffc4bf;

  /* iOS radii */
  --r-xs: 6px; --r-sm: 8px; --r-md: 10px; --r-lg: 12px; --r-xl: 14px; --r-pill: 999px;

  --sh-none: none;
  --sh-nav: 0 0.5px 0 rgba(0,0,0,0.10), 0 8px 24px -18px rgba(0,0,0,0.25);
  /* soft, layered depth for a premium feel while staying clean */
  --sh-card: 0 1px 2px rgba(17,20,24,0.04), 0 8px 24px -14px rgba(17,20,24,0.16);
  --sh-card-hover: 0 2px 4px rgba(17,20,24,0.05), 0 18px 40px -18px rgba(17,20,24,0.22);
  --sh-pop: 0 12px 40px -12px rgba(17,20,24,0.28);
  --tint-grad: linear-gradient(150deg, #ff9836 0%, #ff7a00 55%, #f26a00 100%);

  /* SF-like system stack + thin weights */
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Helvetica Neue", "Inter", "Segoe UI", Roboto, sans-serif;
  --display: var(--sans);
  --mono: ui-monospace, "SF Mono", "SFMono-Regular", Menlo, Consolas, monospace;

  /* Eén hoogte voor elk invoerveld, zodat een tekstveld, een keuzelijst en een
     datumveld naast elkaar precies even groot zijn. */
  --ctl-h: 44px;

  --dur: 200ms;
  --ease: cubic-bezier(0.4, 0.0, 0.2, 1);
  --focus: 0 0 0 3px rgba(255,122,0,0.30);

  /* Dark blue gradient used on login / error pages */
  --auth-gradient: linear-gradient(135deg, #0a0e27 0%, #1a1a3e 50%, #0f1c2e 100%);
  /* De achtergrond van het inlogscherm, vast: ook op pagina's met de soft-stijl (bento.css zet
     --auth-gradient daar op de gewone achtergrond). Voor het update-scherm en de foutpagina's. */
  --inlog-achtergrond: linear-gradient(135deg, #0a0e27 0%, #1a1a3e 50%, #0f1c2e 100%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-2: #0a0a0a;
    --cell: #1c1c1e;
    --cell-press: #2c2c2e;
    --ink: #ffffff;
    --ink-soft: #ebebf0;
    --muted: #8e8e93;
    --faint: #48484a;
    --line: #38383a;
    --line-soft: #2c2c2e;
    --tint-wash: #2a1a08;
    --green-bg: #12291a; --green-line: #24492f;
    --blue-bg: #0f2036; --blue-line: #244067;
    --amber-bg: #2c2008; --amber-line: #54401a;
    --red-bg: #2e1310; --red-line: #57241f;
    --sh-nav: 0 0.5px 0 rgba(255,255,255,0.08), 0 10px 30px -20px rgba(0,0,0,0.8);
    --sh-card: 0 1px 2px rgba(0,0,0,0.4), 0 10px 30px -18px rgba(0,0,0,0.7);
    --sh-card-hover: 0 2px 6px rgba(0,0,0,0.5), 0 22px 48px -20px rgba(0,0,0,0.85);
    --sh-pop: 0 16px 48px -14px rgba(0,0,0,0.85);
  }
}

/* Donker is de standaard van de app (26 november 2026): dezelfde donkere tokens als hierboven, maar nu op de
   keuze van de app in plaats van op de instelling van het apparaat. */
:root[data-theme="dark"] {
  --bg: #000000;
  --bg-2: #0a0a0a;
  --cell: #1c1c1e;
  --cell-press: #2c2c2e;
  --ink: #ffffff;
  --ink-soft: #ebebf0;
  --muted: #8e8e93;
  --faint: #48484a;
  --line: #38383a;
  --line-soft: #2c2c2e;
  --tint-wash: #2a1a08;
  --green-bg: #12291a; --green-line: #24492f;
  --blue-bg: #0f2036; --blue-line: #244067;
  --amber-bg: #2c2008; --amber-line: #54401a;
  --red-bg: #2e1310; --red-line: #57241f;
  --sh-nav: 0 0.5px 0 rgba(255,255,255,0.08), 0 10px 30px -20px rgba(0,0,0,0.8);
  --sh-card: 0 1px 2px rgba(0,0,0,0.4), 0 10px 30px -18px rgba(0,0,0,0.7);
  --sh-card-hover: 0 2px 6px rgba(0,0,0,0.5), 0 22px 48px -20px rgba(0,0,0,0.85);
  --sh-pop: 0 16px 48px -14px rgba(0,0,0,0.85);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;             /* iOS base text size */
  line-height: 1.4;
  color: var(--ink);
  background-color: var(--bg);
  /* barely-there warm wash so the surface feels crafted, not flat grey */
  background-image:
    radial-gradient(1200px 620px at 100% -8%, color-mix(in srgb, var(--tint) 9%, transparent), transparent 60%),
    radial-gradient(900px 520px at -8% 0%, color-mix(in srgb, #3a7bff 6%, transparent), transparent 58%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  letter-spacing: -0.01em;
}

h1, h2, h3, h4 { margin: 0; font-family: var(--display); font-weight: 600; line-height: 1.2; letter-spacing: -0.02em; }

.muted { color: var(--muted); }
.error { color: var(--red); font-weight: 500; font-size: 14px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
svg { display: block; }

/* Aurora neutralised */
.aurora, .aurora__blob, .aurora__grid { display: none !important; }

/* ---------- Reveal (subtle iOS fade) ---------- */
.reveal { opacity: 0; transform: translateY(8px); }
.reveal.in { opacity: 1; transform: none; transition: opacity 0.4s var(--ease), transform 0.4s var(--ease); }

/* ---------- Buttons (iOS tint text / filled) ---------- */
/* The `hidden` attribute must always win, even over class rules like .btn that
   set an explicit `display` (a class beats the browser's default [hidden] rule,
   so without this an <a class="btn" hidden> would stay visible). */
[hidden] { display: none !important; }

/* Account card on the hub (password + 2FA), left-aligned and width-constrained. */
.hub-account { max-width: 620px; margin: 0 auto; text-align: left; }

/* Settings modal (holds the account card). Scrolls so the QR/backup codes are
   always fully reachable, whatever the screen height. */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(0, 0, 0, 0.55);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 5vh 16px; overflow-y: auto;
}
.modal-overlay[hidden] { display: none; }
.modal { position: relative; width: 100%; max-width: 640px; margin: auto; }
.modal__close {
  position: absolute; top: -10px; right: -10px; z-index: 2;
  width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--cell); color: var(--ink); font-size: 24px; line-height: 1;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.modal__close:hover { filter: brightness(0.95); }

/* MFA QR: always fully visible on a solid white tile, never clipped. */
.acc-qr {
  display: block; width: 200px; height: 200px; max-width: 100%;
  background: #fff; padding: 8px; border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

/* Prominent "in aanbouw" / notice card. */
.notice { display: flex; gap: 14px; align-items: flex-start; }
.notice--wip {
  border-left: 4px solid var(--tint);
  background: var(--tint-wash);
}
.notice__ico {
  flex: none; width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--tint-grad); color: #fff;
}
.notice__ico svg { width: 22px; height: 22px; }
.notice__title { margin: 2px 0 4px; font-size: 16px; }
.notice__text { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
@media (prefers-color-scheme: dark) {
  .notice--wip { background: rgba(255, 122, 0, 0.12); }
}

.btn {
  --bg: var(--tint-grad);
  --fg: #fff;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 18px;
  border: none;
  border-radius: var(--r-md);
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px; font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer; white-space: nowrap;
  box-shadow: 0 2px 6px -1px color-mix(in srgb, var(--tint) 45%, transparent), inset 0 1px 0 rgba(255,255,255,0.25);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), opacity var(--dur) var(--ease), filter var(--dur) var(--ease);
}
.btn svg { width: 17px; height: 17px; }
.btn:hover { transform: translateY(-1px); filter: saturate(1.05); box-shadow: 0 6px 16px -3px color-mix(in srgb, var(--tint) 50%, transparent), inset 0 1px 0 rgba(255,255,255,0.25); }
.btn:active { transform: translateY(0); opacity: 0.9; }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
/* D104: de zichtbare reden onder een grijze knop (knop-reden.js). In een flex-rij op een eigen regel. */
.btn-reden { display: block; flex-basis: 100%; margin-top: 4px; font-size: .86em; color: var(--muted); line-height: 1.35; }
.btn-reden::before { content: "Knop staat uit: "; font-weight: 600; color: var(--tint, #D4500F); }

/* ghost = tinted text on light fill (iOS "bordered" style) */
.btn--ghost {
  --bg: var(--cell); --fg: var(--tint);
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(17,20,24,0.04);
}
.btn--ghost:hover { background: var(--tint-wash); opacity: 1; transform: translateY(-1px); box-shadow: 0 4px 10px -3px rgba(17,20,24,0.12); }
.btn--ghost:active { background: var(--cell-press); transform: translateY(0); }

/* subtle = plain tinted text, no fill (iOS nav button) */
.btn--subtle {
  --bg: transparent; --fg: var(--tint);
  padding: 9px 10px;
  box-shadow: none;
}
.btn--subtle:hover { background: transparent; opacity: 0.6; transform: none; box-shadow: none; }

.btn--sm { padding: 8px 13px; font-size: 15px; }
.btn.is-active { color: var(--tint); background: var(--tint-wash); }

/* danger = destructive actions (e.g. resetting someone's MFA) */
.btn--danger {
  --bg: var(--red); --fg: #fff;
  box-shadow: 0 2px 6px -1px rgba(255,59,48,0.45), inset 0 1px 0 rgba(255,255,255,0.25);
}
.btn--danger:hover { filter: saturate(1.05) brightness(1.05); box-shadow: 0 6px 16px -3px rgba(255,59,48,0.5), inset 0 1px 0 rgba(255,255,255,0.25); }

.btn .spinner { display: none; }
.btn.is-loading .spinner { display: inline-block; }
.btn.is-loading .btn__label { opacity: 0.85; }

.spinner {
  width: 15px; height: 15px;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Nav bar (translucent, blurred, hairline) ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px clamp(14px, 4vw, 24px);
  min-height: 44px;            /* iOS nav bar height */
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: var(--sh-nav);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand__mark {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: var(--tint-grad); color: #fff;
  border-radius: 9px;          /* iOS app-icon-ish squircle */
  box-shadow: 0 2px 6px -1px color-mix(in srgb, var(--tint) 55%, transparent), inset 0 1px 0 rgba(255,255,255,0.4);
}
.brand__mark svg { width: 18px; height: 18px; }
.brand__mark::before, .brand__mark::after { content: none; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__title { font-weight: 600; font-size: 16px; letter-spacing: -0.02em; }
.brand__sub { font-size: 12px; color: var(--muted); font-weight: 400; }

/* Version badge — right side of topbar */
.topbar__right { display: flex; align-items: center; gap: 12px; }
.version-badge {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 4px 9px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.05em;
  color: var(--muted);
  background: color-mix(in srgb, var(--tint) 8%, transparent);
  border: 0.5px solid var(--line);
  border-radius: var(--r-pill);
  text-transform: uppercase;
  font-family: var(--mono);
  transition: all var(--dur) var(--ease);
}
.version-badge:hover {
  color: var(--tint);
  background: color-mix(in srgb, var(--tint) 12%, transparent);
  border-color: var(--tint);
}

/* ---------- Layout ---------- */
.container {
  max-width: 740px;
  margin: 0 auto 72px;
  padding: 0 clamp(12px, 3vw, 18px);
  display: flex; flex-direction: column; gap: 26px;
}

/* Wide & ultra-wide screens: use the extra horizontal space instead of a single
   narrow centred column. Cards flow into a masonry-style multi-column layout
   whose column count grows automatically with the viewport (column-width based),
   so 1440p, 4K and ultra-wide (5120px+) monitors all get filled. The hero and
   full-width banner span across all columns. */
@media (min-width: 1180px) {
  .container {
    display: block;
    /* Grow with the viewport but stay centred. The cap keeps columns readable
       and the block balanced instead of stretching content to a screen edge. */
    max-width: min(92vw, 2400px);
    column-width: 440px;
    column-gap: 26px;
  }
  .container > * {
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    margin-bottom: 26px;
  }
  .container > .hero {
    column-span: all;
    -webkit-column-span: all;
  }
  .hero__title { max-width: 22ch; }

  /* WVD-PDF upload must stay the first action block on every screen size, so
     it also needs column-span: all like .hero — otherwise it gets confined to
     a single narrow column fragment and visually drops below Setup & Status
     (which IS column-span:all), even though it comes first in the DOM. */
  .container > #upload-card,
  .container > #afas-profile-card,
  .container > #afas-mailbox-card,
  .container > #afas-receipt-card,
  .container > #afas-upload-card {
    column-span: all;
    -webkit-column-span: all;
  }

  /* Setup & Status side-by-side from the very first wide breakpoint onward
     (not just 5120px+ — most "ultra-wide" monitors, e.g. 3440px UWQHD, are
     well below 5120px and were still getting the single-column, stacked
     layout without this). Must escape .container's multi-column flow via
     column-span: all, otherwise this row is confined to a single narrow
     column fragment and looks stacked even with display: grid applied. */
  .container > .setup-status-row {
    column-span: all;
    -webkit-column-span: all;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 26px;
    align-items: start;
  }
}

/* Ultra-wide (1440p, 4K, 5120px+): widen the centred block a bit more and give
   the many columns extra breathing room, while still keeping balanced side
   margins so the content stays centred and readable rather than edge-to-edge. */
@media (min-width: 2600px) {
  .container { max-width: min(88vw, 3200px); column-width: 480px; column-gap: 30px; }
}

/* Extreme-wide (5120px+): use full screen space with larger columns */
@media (min-width: 5120px) {
  .container { max-width: 95vw; column-width: 580px; column-gap: 36px; }
  .hero__title { font-size: clamp(50px, 9vw, 72px); }
  .hero__lead { font-size: clamp(17px, 2.5vw, 20px); }
  .card__head h2 { font-size: 19px; }
  .card__hint { font-size: 15px; }
  h1 { font-size: 22px; }
  .detail-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

  /* Setup & Status stretches to full viewport width with equal margins left/right.
     Uses a negative margin trick based on viewport vs container width to always
     maintain perfectly symmetrical spacing, regardless of screen size. The row
     breaks out of the .container's padded box and expands to fill the viewport.
     Uses the --vw custom property (set in app.js from clientWidth) instead of
     the 100vw unit, because 100vw includes the vertical scrollbar's width while
     the row's own % width does not — on Windows/Linux, where scrollbars are
     visible, plain 100vw made the two sides differ by the scrollbar width.
     Falls back to 100vw if JS hasn't run yet (e.g. very first paint). */
  .container > .setup-status-row {
    width: var(--vw, 100vw);
    margin-left: calc((var(--vw, 100vw) - 100%) / -2);
    margin-right: calc((var(--vw, 100vw) - 100%) / -2);
    gap: 36px;
  }
}

/* Hero = large iOS title area */
.hero {
  padding: clamp(26px, 5vw, 46px) clamp(16px, 4vw, 20px) 6px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
}
/* Compact hero (e.g. beheerpagina): trim the oversized top whitespace so the
   header sits close under the topbar instead of leaving a big empty band. */
.hero--compact {
  padding-top: clamp(14px, 2vw, 20px);
  gap: 8px;
}
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 13px;
  background: color-mix(in srgb, var(--cell) 80%, transparent);
  border: 0.5px solid var(--line);
  border-radius: var(--r-pill);
  font-size: 12px; font-weight: 600; color: var(--ink-soft);
  letter-spacing: 0.04em; text-transform: uppercase;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 1px 2px rgba(17,20,24,0.05);
}
.hero__pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(76,217,100,0.5);
  animation: pulse 2.1s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(76,217,100,0.5); }
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.hero__title {
  font-family: var(--display);
  font-size: clamp(32px, 7.5vw, 50px);
  font-weight: 700;            /* SF bold title */
  letter-spacing: -0.035em;
  line-height: 1.03;
  max-width: 16ch;
}
.hero__grad {
  white-space: nowrap;
  background: var(--tint-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero__grad::after { content: none; }
.hero__lead {
  margin: 0; color: var(--muted);
  font-size: clamp(15px, 2vw, 17px); line-height: 1.45; max-width: 60ch; font-weight: 400;
}

/* ---------- Cards = grouped sections, gently elevated ---------- */
/* Setup & Status wrapper */
.setup-status-row {
  display: flex; flex-direction: column; gap: 26px;
}

.card {
  position: relative;
  background: var(--cell);
  border: 0.5px solid color-mix(in srgb, var(--line) 60%, transparent);
  border-radius: var(--r-xl);
  padding: 2px 18px;
  box-shadow: var(--sh-card);
  overflow: hidden;
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.card::before, .card::after { content: none; }
.card:hover { transform: translateY(-1px); box-shadow: var(--sh-card-hover); }

.card__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 0 12px;
  border-bottom: 0.5px solid var(--line);
}
.card__head h2 {
  font-family: var(--display); font-size: 17px; font-weight: 600;
  display: flex; align-items: center; gap: 9px; letter-spacing: -0.02em;
}
.card__head h2 .ico {
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--tint-grad); color: #fff;
  box-shadow: 0 2px 5px -1px color-mix(in srgb, var(--tint) 50%, transparent), inset 0 1px 0 rgba(255,255,255,0.35);
}
.card__head h2 .ico svg { width: 16px; height: 16px; }
.card__hint { margin: 12px 0 16px; color: var(--muted); font-size: 14px; max-width: 64ch; line-height: 1.4; }

/* ---------- Collapsible cards (collapsed by default) ---------- */
/* A card marked data-collapsible shows only its head until opened; clicking
   the head toggles .is-open. Nothing below the head is rendered while closed. */
.card[data-collapsible] > .card__head { cursor: pointer; user-select: none; }
.card[data-collapsible] > .card__head::after {
  content: ""; width: 9px; height: 9px; flex: none;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg); opacity: .45; transition: transform .15s ease;
}
.card[data-collapsible].is-open > .card__head::after { transform: rotate(45deg); }
.card[data-collapsible]:not(.is-open) > :not(.card__head) { display: none !important; }
.card[data-collapsible]:not(.is-open) > .card__head { border-bottom: 0; padding-bottom: 14px; }

/* ---------- Form controls ---------- */
label { font-weight: 400; font-size: 13px; color: var(--muted); letter-spacing: -0.01em; }
.field { display: flex; flex-direction: column; gap: 6px; padding: 4px 0; }

/* Elk veld waar je in typt of uit kiest, krijgt exact dezelfde maat. Eerder stond
   hier alleen text/number/password/select; een `type="search"`, `type="email"` of
   `type="date"` viel er dus buiten en kreeg de standaardopmaak van de browser. Die
   velden waren daardoor kleiner en platter dan de keuzelijst ernaast, wat vooral
   opviel in een rij met filters. De lijst is nu volledig, en `--ctl-h` legt de
   hoogte vast zodat het ook echt dezelfde maat is en niet alleen dezelfde padding. */
input[type="text"],
input[type="search"],
input[type="email"],
input[type="number"],
input[type="password"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="time"],
input[type="month"],
input[type="datetime-local"],
input:not([type]),
select {
  min-height: var(--ctl-h);
  padding: 11px 12px;
  border: 0.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--cell);
  color: var(--ink);
  font: inherit; font-size: 16px;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
/* Meerregelige velden krijgen dezelfde opmaak, maar geen vaste hoogte: daar bepaalt
   het aantal regels hoe hoog het veld is. */
textarea {
  padding: 11px 12px;
  border: 0.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--cell);
  color: var(--ink);
  font: inherit; font-size: 16px;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
/* Zoekbalk met een eigen schil: daar zit het veld ín een omhulsel dat de hoogte al
   bepaalt, dus dit veld hoort juist niet mee te groeien. */
.search-bar input { min-height: 0; }
select { cursor: pointer; -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%238e8e93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='2 4 6 8 10 4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px;
}
select:disabled { cursor: not-allowed; color: var(--muted); background-color: var(--bg-2); opacity: 0.8; }
/* Safari/Chrome geven een zoekveld een eigen uiterlijk (afwijkende hoogte, een
   kruisje, soms een ovale rand). Uitzetten, anders wijkt juist dat veld weer af. */
input[type="search"] { -webkit-appearance: none; appearance: none; }
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
input::placeholder { color: var(--faint); }
input:focus-visible, select:focus-visible { outline: none; border-color: var(--tint); box-shadow: var(--focus); }

.row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; padding: 4px 0 14px; }
.row.wrap { align-items: center; }
.grow { flex: 1; }

/* ---------- Status grid = inset grouped rows ---------- */
.status-grid { display: flex; flex-direction: column; gap: 0; padding: 4px 0 14px; }
.status-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 2px;
  border-bottom: 0.5px solid var(--line-soft);
  background: transparent;
}
.status-item:last-child { border-bottom: none; }
.status-item:hover { transform: none; box-shadow: none; }
.status-item__label {
  display: flex; align-items: center; gap: 11px;
  font-size: 16px; font-weight: 400; min-width: 0; flex: 1; overflow-wrap: anywhere;
}
.status-item__dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; background: var(--faint); }
.status-item.ok .status-item__dot { background: var(--green); }
.status-item.no .status-item__dot { background: var(--amber); }

.pill {
  display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0;
  font-size: 13px; font-weight: 500;
  padding: 3px 10px; border-radius: var(--r-pill);
  white-space: nowrap;
}
.pill svg { width: 13px; height: 13px; }
.pill.ok { color: var(--green-ink); background: var(--green-bg); }
.pill.no { color: var(--amber); background: var(--amber-bg); }
/* geboekt maar nog niet geverifieerd: kalm blauw (geen alarmerend oranje).
   Wordt groen (.ok) zodra "Verifieer in AFAS" de boeking in Profit bevestigt. */
.pill.booked { color: #35507A; background: #E8EEF6; }
/* nog bezig (intentie/boeken, wachtrij): neutraal grijs. */
.pill.pending { color: var(--ink-soft); background: var(--line-soft); }

/* skeleton */
.skeleton {
  position: relative; overflow: hidden;
  background: var(--bg-2);
  border-radius: var(--r-sm);
  min-height: 46px; margin: 6px 0;
}
.skeleton::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

/* ---------- Bulk upload dropzone ---------- */
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; text-align: center;
  padding: 28px 20px; margin: 8px 0 4px;
  border: 1.5px dashed var(--line); border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--tint) 3%, var(--cell));
  color: var(--muted); cursor: pointer;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.dropzone:hover, .dropzone:focus-visible { outline: none; border-color: var(--tint); background: var(--tint-wash); }
.dropzone.dragover { border-color: var(--tint); background: var(--tint-wash); transform: scale(1.005); }
.dropzone svg { width: 30px; height: 30px; color: var(--tint); }
.dropzone__title { font-size: 15px; font-weight: 600; color: var(--ink); }
.dropzone__hint { font-size: 12.5px; color: var(--muted); }

.file-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.file-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 2px; font-size: 14px;
  border-bottom: 0.5px solid var(--line-soft);
}
.file-list li:last-child { border-bottom: none; }
.file-list .file-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-list .file-size { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.file-list .file-remove {
  border: none; background: transparent; color: var(--muted); cursor: pointer;
  font-size: 18px; line-height: 1; padding: 2px 6px; border-radius: var(--r-xs);
}
.file-list .file-remove:hover { color: var(--red); background: var(--red-bg); }

/* ---------- Mode banner ---------- */
.banner {
  display: flex; align-items: center; gap: 10px;
  margin: 4px 0 16px; padding: 12px 13px;
  border-radius: var(--r-md);
  font-weight: 400; font-size: 14px;
}
.banner__icon { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; flex-shrink: 0; }
.banner__icon svg { width: 15px; height: 15px; }
.banner.live { background: var(--amber-bg); color: var(--amber); }
.banner.live .banner__icon { background: var(--amber); color: #fff; }

/* ---------- Summary chips ---------- */
.summary { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 0; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: var(--r-pill);
  font-size: 13px; font-weight: 500; color: var(--ink-soft);
  background: var(--bg); border: 0.5px solid var(--line);
}
.chip b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.chip .count-dot { width: 8px; height: 8px; border-radius: 50%; }
.chip.created .count-dot { background: var(--green); }
.chip.skipped .count-dot { background: var(--amber); }
.chip.errors .count-dot { background: var(--red); }
.chip.total .count-dot { background: var(--muted); }

/* ---------- Result rows ---------- */
#results { display: flex; flex-direction: column; gap: 0; padding-bottom: 12px; }
.result {
  border: none; border-radius: 0; overflow: hidden;
  background: transparent;
  border-bottom: 0.5px solid var(--line-soft);
  animation: rise var(--dur) var(--ease) both;
}
.result:last-child { border-bottom: none; }
.result:hover { transform: none; box-shadow: none; }
.result.open { background: var(--bg); border-radius: var(--r-md); }
@keyframes rise { from { opacity: 0; } to { opacity: 1; } }

.result__top { display: flex; align-items: center; gap: 12px; padding: 13px 2px; cursor: pointer; user-select: none; }
.result.open .result__top { padding: 13px 12px; }
.result__top:hover { background: transparent; }
.result__top:active { background: var(--cell-press); }

.result__status {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600;
  padding: 3px 9px; border-radius: var(--r-pill);
}
.result__status svg { width: 12px; height: 12px; }
.result.created .result__status { color: var(--green-ink); background: var(--green-bg); }
.result.preview .result__status { color: var(--blue); background: var(--blue-bg); }
.result.skipped .result__status, .result.duplicate .result__status { color: var(--amber); background: var(--amber-bg); }
.result.error .result__status { color: var(--red); background: var(--red-bg); }

.result__title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.result__subject { display: block; font-weight: 500; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result__message { display: block; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result__ref {
  font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--muted);
  background: var(--bg); border: 0.5px solid var(--line);
  padding: 2px 8px; border-radius: var(--r-xs); white-space: nowrap;
}
.result__chevron { flex-shrink: 0; color: var(--faint); transition: transform var(--dur) var(--ease); }
.result__chevron svg { width: 18px; height: 18px; }
.result.open .result__chevron { transform: rotate(90deg); color: var(--tint); }

.result__body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--dur) var(--ease); }
.result__body > .result__inner { overflow: hidden; }
.result.open .result__body { grid-template-rows: 1fr; }
.result__inner { padding: 0 12px; }
.result.open .result__inner { padding: 2px 12px 16px; }

.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; margin: 8px 0; background: var(--cell); border-radius: var(--r-md); overflow: hidden; border: 0.5px solid var(--line); }
.detail { padding: 11px 13px; border-bottom: 0.5px solid var(--line-soft); background: var(--cell); }
.detail dt { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.detail dd { margin: 0; font-weight: 500; font-size: 16px; font-variant-numeric: tabular-nums; }

table.lines { width: 100%; border-collapse: collapse; font-size: 15px; margin-top: 6px; background: var(--cell); border-radius: var(--r-md); overflow: hidden; }
table.lines th, table.lines td { text-align: left; padding: 11px 13px; border-bottom: 0.5px solid var(--line-soft); }
table.lines th { color: var(--muted); font-weight: 400; font-size: 12px; text-transform: uppercase; letter-spacing: 0.02em; }
table.lines td { font-weight: 400; }
table.lines td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
table.lines tbody tr:last-child td { border-bottom: none; }
table.lines tbody tr:last-child { font-weight: 600; }

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 500;
  padding: 4px 10px; border-radius: var(--r-pill);
  background: var(--bg); border: 0.5px solid var(--line); color: var(--ink-soft);
}
.tag svg { width: 12px; height: 12px; }
.tag.ocr { color: var(--amber); background: var(--amber-bg); border-color: transparent; }
.tag.claude { color: var(--tint); background: var(--tint-wash); border-color: transparent; }

.warn {
  margin-top: 12px; padding: 11px 13px;
  background: var(--amber-bg); border-radius: var(--r-md);
  color: var(--amber); font-size: 13px; font-weight: 400;
}
.empty-note {
  margin-top: 12px; padding: 13px;
  background: var(--bg); border-radius: var(--r-md);
  color: var(--muted); font-size: 14px;
}

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-state__icon {
  width: 56px; height: 56px; margin: 0 auto 14px;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--bg); color: var(--faint);
}
.empty-state__icon svg { width: 26px; height: 26px; }
.empty-state h3 { margin: 0 0 4px; color: var(--ink); font-size: 17px; font-weight: 600; }

/* ---------- Lookup output ---------- */
.lookup {
  margin: 12px 0 14px;
  background: #1c1c1e; color: #e5e5ea;
  padding: 14px 16px; border-radius: var(--r-md);
  overflow: auto; max-height: 360px;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.6;
}

/* ---------- Setup wizard ---------- */
.setup-wizard { }
.wizard-badge {
  font-size: 13px; font-weight: 500;
  padding: 4px 11px; border-radius: var(--r-pill);
  display: inline-flex; align-items: center; gap: 6px;
}
.wizard-badge.ready { color: var(--green-ink); background: var(--green-bg); }
.wizard-badge.pending { color: var(--amber); background: var(--amber-bg); }

.wizard-steps { list-style: none; margin: 0; padding: 6px 0 14px; display: flex; flex-direction: column; gap: 0; }
.wizard-steps li.skeleton { min-height: 44px; }
.wizard-step {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 2px; border-bottom: 0.5px solid var(--line-soft);
  background: transparent;
}
.wizard-step:last-child { border-bottom: none; }
.wizard-step:hover { transform: none; }
.wizard-step__check {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  border: 1.5px solid var(--faint); color: transparent; background: transparent;
  transition: all var(--dur) var(--ease);
}
.wizard-step.done .wizard-step__check { background: var(--green); border-color: var(--green); color: #fff; }
.wizard-step__check svg { width: 14px; height: 14px; }
.wizard-step__label { flex: 1; font-weight: 400; font-size: 16px; }
.wizard-step__num { font-size: 13px; font-weight: 500; color: var(--muted); }
.wizard-step__tag {
  font-size: 12px; font-weight: 500; padding: 2px 9px; border-radius: var(--r-pill);
  background: var(--bg); color: var(--muted);
}

/* ---------- Settings form ---------- */
.settings-group, .help-group {
  border: none; border-radius: var(--r-lg);
  padding: 0 14px 10px; margin: 0 0 12px;
  background: var(--cell);
  box-shadow: inset 0 0.5px 0 var(--line), inset 0 -0.5px 0 var(--line);
}
.settings-group summary, .help-group summary {
  list-style: none; cursor: pointer; user-select: none;
  padding: 12px 0; font-size: 15px; font-weight: 600; color: var(--ink);
  display: flex; align-items: center; justify-content: space-between;
}
.settings-group summary::-webkit-details-marker, .help-group summary::-webkit-details-marker { display: none; }
.settings-group summary::after, .help-group summary::after {
  content: ">"; font-size: 14px; color: var(--muted); transform: rotate(90deg); transition: transform var(--dur) var(--ease);
}
.settings-group[open] summary::after, .help-group[open] summary::after { transform: rotate(270deg); color: var(--tint); }

/* Handleiding lijst */
.help-list { list-style: none; margin: 0 0 6px; padding: 4px 0 8px; display: flex; flex-direction: column; gap: 0; }
.help-list li {
  padding: 10px 2px; font-size: 15px; line-height: 1.45; color: var(--ink-soft);
  border-bottom: 0.5px solid var(--line-soft);
}
.help-list li:last-child { border-bottom: none; }
.help-list b { color: var(--ink); font-weight: 600; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; padding-top: 2px; }
.settings-subhead { font-size: 13px; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.04em; margin: 18px 0 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.settings-subhead:first-of-type { border-top: 0; padding-top: 0; margin-top: 4px; }
.settings-subhead .settings-subhead__hint { display: block; font-size: 12px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--muted); margin-top: 3px; }
.field-hint { font-size: 12px; color: var(--muted); line-height: 1.35; margin-top: 1px; }
.field-badge { font-size: 11px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.field-badge.set { color: var(--green-ink); }
.field-badge.set::before { content: "● ingesteld"; }
.field-badge.unset::before { content: "○ leeg"; }

.field--switch { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 0.5px solid var(--line-soft); }
.field--switch label:first-child { font-weight: 400; font-size: 16px; color: var(--ink); }

/* iOS switch */
.switch { position: relative; display: inline-flex; flex-shrink: 0; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch__track {
  width: 51px; height: 31px; border-radius: var(--r-pill);
  background: var(--faint);
  transition: background var(--dur) var(--ease); position: relative;
}
.switch__track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.25), 0 2px 6px rgba(0,0,0,0.1);
  transition: transform var(--dur) var(--ease);
}
.switch input:checked + .switch__track { background: var(--green); }
.switch input:checked + .switch__track::after { transform: translateX(20px); }
.switch input:focus-visible + .switch__track { box-shadow: var(--focus); }

.settings-actions { padding: 10px 0 4px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.settings-status { font-size: 13px; font-weight: 400; }
.settings-status.ok { color: var(--green-ink); }
.settings-status.err { color: var(--red); }
.settings-status.busy { color: var(--muted); display: inline-flex; align-items: center; gap: 7px; }
.settings-status.busy::before {
  content: ""; width: 13px; height: 13px; flex: none;
  border: 2px solid var(--line); border-top-color: var(--tint);
  border-radius: 50%; animation: spin .7s linear infinite;
}

.settings-advanced { margin-top: 6px; }
.settings-advanced summary {
  cursor: pointer; font-size: 15px; font-weight: 400; color: var(--tint);
  padding: 10px 0; user-select: none;
}
.settings-advanced summary:hover { opacity: 0.7; }

/* ---------- Log ---------- */
.log-search { position: relative; margin: 4px 0 12px; }
.log-search__ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.log-search input { width: 100%; padding-left: 38px; border-radius: var(--r-md); background: var(--bg); }

.log-list { display: flex; flex-direction: column; gap: 0; padding-bottom: 12px; }
.log-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 2px;
  border: none; border-bottom: 0.5px solid var(--line-soft); border-radius: 0;
  background: transparent; cursor: pointer;
  transition: background var(--dur) var(--ease);
}
.log-row:last-child { border-bottom: none; }
.log-row:hover { transform: none; box-shadow: none; }
.log-row:active { background: var(--cell-press); }
.log-row__id {
  flex-shrink: 0; font-family: var(--mono); font-size: 12px; font-weight: 500;
  color: var(--muted); background: var(--bg);
  border: 0.5px solid var(--line); padding: 3px 8px; border-radius: var(--r-xs);
}
.log-row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.log-row__subject { font-weight: 500; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log-row__meta { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log-row__time { font-size: 11px; color: var(--muted); opacity: .75; }
/* Beheer-gebruikerslijst: de naamkolom mag niet worden platgedrukt/afgekapt door
   de rol-select + knoppen op dezelfde flexregel. Alleen hier (niet het logboek). */
#users-list .log-row__main { flex: 1 1 200px; min-width: 170px; }
#users-list .log-row__subject, #users-list .log-row__meta { white-space: normal; overflow: visible; text-overflow: clip; }
/* Run-summary stat chips (mailbox status, both sides) */
/* "You have to wait" line under a run button: cooldown timer, active run, heavy
   task or full disk. Clear amber pill so the reason is never a mystery. */
.run-wait {
  margin: 10px 0 0; padding: 9px 13px; border-radius: 12px;
  background: var(--tint-wash); border: 1px solid #ffd9b0;
  color: var(--ink-soft); font-size: 13.5px; line-height: 1.4;
}
.run-wait b { font-variant-numeric: tabular-nums; color: var(--tint-press); }

/* AFAS omgevingsprofiel-balk + badges. Groen = PRODUCTIE, oranje = TEST. */
.afas-profile-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.profile-badge {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  font-size: 13px; font-weight: 700; letter-spacing: 0.03em;
  padding: 5px 12px; border-radius: var(--r-pill); border: 1px solid transparent;
}
.profile-badge--prod { color: #1b5e20; background: #E7F5EA; border-color: #b6e0c0; }
.profile-badge--test { color: #8a4b00; background: #FDF0E2; border-color: #f2c98f; }
/* Kleine PROD/TEST-badge per logregel. */
.log-prof { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 6px; }
.log-prof--prod { color: #1b5e20; background: #E7F5EA; }
.log-prof--test { color: #8a4b00; background: #FDF0E2; }

/* Bulk-actiebalk boven de AFAS-uitzonderingenwachtrij. */
.queue-bulkbar {
  gap: 8px; align-items: center; margin-bottom: 12px;
  padding: 8px 12px; background: var(--line-soft); border-radius: 12px;
}
.queue-selall { display: flex; align-items: center; gap: 6px; font-size: 13.5px; }
.queue-del { color: var(--red); }
.queue-del:hover:not(:disabled) { background: #fbe9e9; }

.run-summary { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.run-summary__head { font-size: 13px; color: var(--muted); }
.run-stats { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.run-stat { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 12px;
  border-radius: var(--r-pill); background: var(--cell); border: 1px solid var(--line); }
.run-stat b { font-size: 17px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.run-stat__label { font-size: 12.5px; color: var(--muted); }
.run-stat--ok b { color: var(--green-ink); }
.run-stat--warn b { color: var(--amber); }
.run-stat--err b { color: var(--red); }
.run-stat--busy { border-style: dashed; }
.log-row__status {
  flex-shrink: 0; font-size: 12px; font-weight: 600;
  padding: 3px 9px; border-radius: var(--r-pill);
  display: inline-flex; align-items: center; gap: 4px;
}
.log-row.created .log-row__status { color: var(--green-ink); background: var(--green-bg); }
.log-row.preview .log-row__status { color: var(--blue); background: var(--blue-bg); }
.log-row.skipped .log-row__status, .log-row.duplicate .log-row__status { color: var(--amber); background: var(--amber-bg); }
.log-row.error .log-row__status { color: var(--red); background: var(--red-bg); }
.log-row__ai {
  flex-shrink: 0; font-size: 11px; font-weight: 500; padding: 3px 8px; border-radius: var(--r-pill);
  color: var(--muted); background: var(--bg);
}
.log-row__ai.claude { color: var(--tint); background: var(--tint-wash); }
/* Right-hand badge cluster (route/OCR/verification/status): wraps within a bounded
   width so extra badges never push the status label off the row. */
.log-row__tags {
  flex-shrink: 0; display: flex; flex-wrap: wrap; gap: 6px;
  align-items: center; justify-content: flex-end; max-width: 56%;
}

/* ---------- Drawer (iOS modal sheet from right) ---------- */
.drawer-overlay {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(0,0,0,0.4);
  animation: fade-in var(--dur) var(--ease);
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.drawer {
  position: fixed; top: 0; right: 0; z-index: 90;
  width: min(480px, 94vw); height: 100vh;
  background: var(--bg); border-left: none;
  display: flex; flex-direction: column;
  box-shadow: -8px 0 30px -12px rgba(0,0,0,0.3);
  animation: slide-in var(--dur) var(--ease);
}
@keyframes slide-in { from { transform: translateX(100%); } to { transform: none; } }
.drawer[hidden], .drawer-overlay[hidden] { display: none; }
.drawer__head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 16px 18px 14px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: var(--sh-nav);
}
.drawer__id { font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--muted); }
.drawer__title { margin: 6px 0 0; font-size: 18px; font-weight: 600; }
.drawer__body { padding: 18px; overflow-y: auto; flex: 1; }

.drawer__section { margin-bottom: 24px; }
.drawer__section h4 {
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.02em;
  color: var(--muted); font-weight: 400; margin: 0 0 8px; padding-left: 2px;
}
.reasoning {
  padding: 14px 15px; border-radius: var(--r-md);
  background: var(--tint-wash); color: var(--ink); font-size: 15px; line-height: 1.5;
}
.reasoning.regex { background: var(--cell); color: var(--ink-soft); box-shadow: inset 0 0 0 0.5px var(--line); }

.timeline { display: flex; flex-direction: column; gap: 0; background: var(--cell); border-radius: var(--r-md); padding: 4px 14px; box-shadow: inset 0 0 0 0.5px var(--line); }
.tl-item { display: flex; gap: 12px; }
.tl-marker { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }
.tl-dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 14px; background: var(--faint); }
.tl-item.ok .tl-dot { background: var(--green); }
.tl-item.warn .tl-dot { background: var(--amber); }
.tl-item.error .tl-dot { background: var(--red); }
.tl-line { width: 1.5px; flex: 1; background: var(--line); margin: 2px 0; }
.tl-item:last-child .tl-line { display: none; }
.tl-content { padding: 12px 0; flex: 1; min-width: 0; border-bottom: 0.5px solid var(--line-soft); }
.tl-item:last-child .tl-content { border-bottom: none; }
.tl-label { font-weight: 500; font-size: 15px; }
.tl-detail { font-size: 13px; color: var(--muted); margin-top: 2px; word-break: break-word; }
.drawer .detail-grid { margin: 0; }

/* ---------- Toasts ---------- */
.toast-stack { position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 70; max-width: 420px; width: calc(100% - 32px); }
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 15px; border-radius: var(--r-lg);
  background: color-mix(in srgb, #1c1c1e 92%, transparent); color: #fff;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 8px 30px -8px rgba(0,0,0,0.4);
  font-size: 15px; font-weight: 400;
  animation: toast-in var(--dur) var(--ease) both;
}
.toast.out { animation: toast-out var(--dur) var(--ease) both; }
.toast__icon { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; }
.toast__icon svg { width: 14px; height: 14px; }
.toast.ok .toast__icon { background: var(--green); color: #fff; }
.toast.info .toast__icon { background: var(--blue); color: #fff; }
.toast.warn .toast__icon { background: var(--amber); color: #fff; }
.toast.err .toast__icon { background: var(--red); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes toast-out { to { opacity: 0; transform: translate(-50%, 16px); } }

/* ---------- New-version banner ---------- */
.update-toast {
  position: fixed; left: 50%; top: 16px; transform: translate(-50%, -140%);
  z-index: 90; display: flex; align-items: center; gap: 12px;
  padding: 12px 14px 12px 16px; border-radius: var(--r-pill);
  background: var(--tint-grad); color: #fff;
  box-shadow: 0 10px 34px -10px rgba(242,106,0,0.55), inset 0 1px 0 rgba(255,255,255,0.3);
  font-size: 15px; font-weight: 500; max-width: calc(100% - 32px);
  transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
  opacity: 0;
}
.update-toast.in { transform: translate(-50%, 0); opacity: 1; }
.update-toast__icon { display: grid; place-items: center; width: 22px; height: 22px; flex-shrink: 0; }
.update-toast__icon svg { width: 16px; height: 16px; }
.update-toast__text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.update-toast__btn {
  flex-shrink: 0; cursor: pointer;
  padding: 7px 14px; border-radius: var(--r-pill);
  border: 0; background: rgba(255,255,255,0.95); color: var(--tint-press);
  font: inherit; font-size: 14px; font-weight: 600;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.update-toast__btn:hover { background: #fff; }
.update-toast__btn:active { transform: scale(0.96); }
@media (max-width: 560px) {
  .update-toast { top: 10px; font-size: 14px; padding: 10px 12px; }
  .update-toast__text { white-space: normal; }
}

/* ---------- Login ---------- */
.login-body { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 20px; background: var(--auth-gradient); position: relative; overflow: hidden; }
.login-version-badge { position: fixed; top: 16px; right: 16px; z-index: 3; }
/* Foutpagina's (502/500): dezelfde blauwe achtergrond als het inlogscherm, ook als de soft-stijl
   (bento.css) de body op de gewone achtergrond zet. */
body.login-body.fout-pagina { background: var(--inlog-achtergrond) !important; }
body.login-body.fout-pagina .error-card { position: relative; z-index: 2; }

/* ---------- Hub (login-style landing with square tiles) ---------- */
.hub-topright { position: fixed; top: 16px; left: 18px; display: flex; gap: 10px; z-index: 3; }
/* Glassy pill buttons that suit the dark hub background instead of solid
   white boxes with orange text. */
.hub-topright .btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(245, 246, 251, 0.92);
  border-radius: 999px;
  padding: 8px 15px;
  font-weight: 600;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 14px -6px rgba(0, 0, 0, 0.55);
  transition: background .16s ease, border-color .16s ease, transform .12s ease, box-shadow .16s ease;
}
.hub-topright .btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.6);
}
.hub-topright .btn:active { transform: translateY(0); }
/* The admin/logout icons/text inherit the light colour cleanly. */
.hub-topright .btn svg { opacity: .9; }
.hub-wrap { position: relative; z-index: 2; width: 100%; max-width: 1240px; margin: 0 auto; padding: 24px; text-align: center; display: flex; flex-direction: column; align-items: center; }
/* The hub sits on the fixed dark auth gradient, so its text is light (not the
   dark --ink used inside the white login card). */
.hub-title { font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: -0.02em; margin: 14px 0 6px; color: #f4f5fb; }
.hub-lead { color: rgba(226, 230, 245, 0.75); font-size: 14.5px; line-height: 1.5; max-width: 52ch; margin: 0 auto; }
.hub-grid { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; margin: 28px auto 0; max-width: 1180px; }
.hub-tile {
  width: 210px; height: 210px; padding: 22px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  text-align: center; transition: transform .15s ease, box-shadow .2s ease;
}
.hub-tile.is-clickable { cursor: pointer; }
.hub-tile.is-clickable:hover { transform: translateY(-4px); box-shadow: 0 16px 40px -18px color-mix(in srgb, var(--tint) 55%, transparent); }
.hub-tile.is-disabled { opacity: .55; }
.hub-tile__icon { width: 54px; height: 54px; border-radius: 15px; display: grid; place-items: center; background: var(--tint-grad); color: #fff; box-shadow: 0 3px 8px -2px color-mix(in srgb, var(--tint) 50%, transparent); }
.hub-tile__icon svg { width: 27px; height: 27px; }
/* Foto als icoon: vult het hele vlak, geen gekleurde achtergrond of padding (werkt ook in de donkere modus). */
.hub-tile__icon--foto { padding: 0; overflow: hidden; background: var(--cell, #ddd); display: block; }
.hub-tile__icon--foto img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; border-radius: inherit; display: block; }
.hub-tile__title { font-family: var(--display); font-size: 18px; font-weight: 600; }
.hub-tile__badge { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 3px 11px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.hub-tile__badge.is-open { color: #2e7d32; border-color: color-mix(in srgb, #2e7d32 40%, transparent); }
.hub-tile__badge.is-locked { color: #b26a00; border-color: color-mix(in srgb, #b26a00 40%, transparent); }
/* D104: een tegel zonder toegang of met een kant die uit staat zegt dat zichtbaar in de tegel. */
.hub-tile.is-disabled { height: auto; min-height: 210px; }
.hub-tile__reden { display: block; margin-top: -4px; font-size: 12.5px; line-height: 1.35; color: var(--muted); max-width: 22ch; }
@media (max-width: 520px) { .hub-tile { width: 100%; max-width: 320px; height: 170px; } .hub-tile.is-disabled { min-height: 170px; } }

/* ---------- Search bar (rounded input + attached button) ---------- */
.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--cell); border: 0.5px solid var(--line);
  border-radius: 14px; padding: 5px 6px 5px 13px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search-bar:focus-within {
  border-color: var(--tint);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tint) 18%, transparent);
}
.search-bar > svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.search-bar input {
  flex: 1; min-width: 120px; border: 0; background: transparent; outline: none;
  font: inherit; color: var(--ink); padding: 9px 0;
}
.search-bar .btn { flex: none; border-radius: 10px; }

/* ---------- Inline HS Agent chat (Telegram-style bubbles) ---------- */
.chat-panel { display: flex; flex-direction: column; }
.chat-log {
  flex: 1; min-height: 220px; max-height: 420px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px; padding: 8px 2px; margin-top: 4px;
}
.chat-log:empty::before {
  content: "Nog geen berichten. Stel je vraag hieronder."; color: var(--muted);
  font-size: 13px; margin: auto; text-align: center;
}
.chat-msg {
  max-width: 82%; padding: 9px 13px; border-radius: 16px; font-size: 14px;
  line-height: 1.45; white-space: pre-wrap; word-wrap: break-word;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.chat-msg--user { align-self: flex-end; background: var(--tint-grad); color: #fff; border-bottom-right-radius: 5px; }
.chat-msg--bot { align-self: flex-start; background: var(--cell); color: var(--ink); border-bottom-left-radius: 5px; }
.chat-msg--bot strong { font-weight: 650; }
.chat-ul { margin: 4px 0 2px; padding-left: 18px; }
.chat-ul li { margin: 1px 0; }
/* Subtle source footer inside a bot bubble. */
.chat-src {
  margin-top: 8px; padding-top: 6px; border-top: 0.5px solid var(--line);
  font-size: 11px; line-height: 1.4; color: var(--muted);
}
.chat-src__path { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; opacity: .85; word-break: break-all; }
.chat-inputbar {
  display: flex; align-items: flex-end; gap: 8px; margin-top: 10px;
  background: var(--cell); border: 0.5px solid var(--line);
  border-radius: 22px; padding: 6px 6px 6px 15px;
}
.chat-inputbar textarea {
  flex: 1; border: 0; background: transparent; resize: none; outline: none;
  font: inherit; color: var(--ink); max-height: 120px; padding: 7px 0; line-height: 1.4;
}
.chat-send-btn {
  flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--tint-grad); color: #fff; display: grid; place-items: center;
  transition: transform .12s ease, opacity .12s ease;
}
.chat-send-btn:hover { transform: scale(1.06); }
.chat-send-btn:disabled { opacity: .5; cursor: default; transform: none; }
.chat-send-ico { width: 18px; height: 18px; }
.chat-send-btn.is-loading .chat-send-ico { animation: hs-spin .8s linear infinite; }
@keyframes hs-spin { to { transform: rotate(360deg); } }

/* Telegram-style "typing" bubble shown while an answer is loading. */
.chat-msg--typing { display: inline-flex; align-items: center; gap: 5px; padding: 12px 15px; min-height: 0; }
.chat-msg--typing span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--muted);
  display: inline-block; animation: chat-bounce 1.3s ease-in-out infinite;
}
.chat-msg--typing span:nth-child(2) { animation-delay: .18s; }
.chat-msg--typing span:nth-child(3) { animation-delay: .36s; }
@keyframes chat-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .35; }
  40% { transform: translateY(-4px); opacity: 1; }
}

/* Reusable inline "bezig" indicator for status lines (spinner + text),
   styled to match the app instead of a bare "Bezig…" string. */
.busy-inline {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--muted);
}
.busy-inline::before {
  content: ""; width: 13px; height: 13px; flex: none;
  border: 2px solid var(--line); border-top-color: var(--tint);
  border-radius: 50%; animation: spin .7s linear infinite;
}
.login-card {
  width: 360px; max-width: 100%;
  display: flex; flex-direction: column; gap: 14px;
  padding: 30px 26px;
  background: var(--cell);
  border-radius: var(--r-xl);
  box-shadow: 0 10px 40px -16px rgba(0,0,0,0.25);
  position: relative; z-index: 2;
  animation: login-rise 0.6s var(--ease) both;
}
.login-card::before, .login-card::after { content: none; }
.login-card .brand { justify-content: center; margin-bottom: 4px; }
.login-card .brand__mark { width: 60px; height: 60px; border-radius: 14px; }
.login-card .brand__mark svg { width: 30px; height: 30px; }

/* Animated lock icon (replaces static brand mark on the login card) */
.login-icon-ring {
  width: 64px; height: 64px; margin: 0 auto 6px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--tint-grad); color: #fff;
  position: relative;
  box-shadow: 0 8px 24px -8px color-mix(in srgb, var(--tint) 55%, transparent);
  animation: login-glow 2.4s ease-in-out infinite;
}
.login-icon-ring::before {
  content: ""; position: absolute; inset: -7px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--tint) 45%, transparent);
  animation: login-ripple 2.4s ease-out infinite;
}
.login-icon-ring svg { width: 28px; height: 28px; }
.login-card h1 { font-size: 22px; text-align: center; font-weight: 700; }
.login-card .muted { text-align: center; margin: 0 0 6px; font-size: 14px; }
.login-card input { width: 100%; text-align: center; }
/* Safari (iPhone) gaf het vinkje "Onthoud dit apparaat" door width:100% de volle breedte en duwde de tekst het blok uit. */
.login-card input[type="checkbox"] { width: auto; }
#remember-device-row > span { flex: 1 1 0; min-width: 0; }
.login-card .btn { width: 100%; }
.login-foot { text-align: center; font-size: 12px; color: var(--faint); margin: 2px 0 0; }
/* Het eigen 3D figuur rechtsonder in het inlogblok (14 oktober 2026). Klikken gaan erdoorheen.
   De voeten staan altijd op de onderrand van dit vak (figuur.js), en het vak staat vast ten
   opzichte van de onderkant van het blok (bottom: 0, de voeten op de onderrand van het blok
   zelf): een foutmelding erboven verschuift het niet. Het vak
   is breder dan het figuur: na 60 seconden niets doen ijsbeert het naar links en terug; zijn
   thuisplek is de rechterkant (40 px van de rand, zie figuur.js). */
.login-figuur {
  position: absolute; right: 16px; bottom: 0;
  width: 150px; height: 124px;
  pointer-events: none; z-index: 3;
}
.login-figuur[hidden] { display: none; }
/* Smal scherm: het figuur kleiner en het blok krijgt onderin ruimte, zodat het niet over de voettekst en de knop staat. */
@media (max-width: 480px) {
  .login-card:has(> .login-figuur:not([hidden])) { padding-bottom: 78px; }
  .login-figuur { right: 10px; width: 110px; height: 90px; }
}

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

@media (max-width: 560px) {
  .topbar { padding: 10px 14px; }
  .result__ref { display: none; }
  .brand__sub { display: none; }
  .container { padding: 0 12px; gap: 20px; }
  .hero { padding-left: 6px; padding-right: 6px; }
}

/* ---------- Deploy Overlay (Render 502 during deployment) ---------- */
.deploy-overlay {
  position: fixed; inset: 0; z-index: 999;
  background: var(--inlog-achtergrond); /* zelfde blauw als het inlogscherm, ook met de soft-stijl */
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.deploy-overlay[hidden] { display: none; }

.deploy-container {
  position: relative; z-index: 2;
  text-align: center; max-width: 500px; padding: 20px;
}

.deploy-logo {
  width: 80px; height: 80px; margin: 0 auto 30px;
  background: var(--tint-grad); border-radius: 50%;
  display: grid; place-items: center;
  animation: deploy-pulse 2s ease-in-out infinite;
}
.deploy-logo svg { width: 40px; height: 40px; color: #fff; }

.deploy-title {
  font-size: clamp(28px, 6vw, 48px); font-weight: 700;
  color: #fff; margin: 0 0 12px;
  letter-spacing: -0.5px;
  animation: deploy-fade-in 0.6s ease-out;
}

.deploy-message {
  font-size: clamp(15px, 3vw, 18px); color: rgba(255, 255, 255, 0.8);
  margin: 0 0 28px; line-height: 1.5;
  animation: deploy-fade-in 0.8s ease-out;
}

.deploy-progress {
  display: flex; gap: 8px; justify-content: center; margin-bottom: 20px;
}
.deploy-bar {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--tint); opacity: 0.3;
  animation: deploy-bounce 1.2s ease-in-out infinite;
}
.deploy-bar:nth-child(1) { animation-delay: 0s; }
.deploy-bar:nth-child(2) { animation-delay: 0.2s; }
.deploy-bar:nth-child(3) { animation-delay: 0.4s; }

.deploy-hint {
  font-size: 13px; color: rgba(255, 255, 255, 0.6);
  margin: 0; letter-spacing: 0.3px;
  animation: deploy-fade-in 1s ease-out;
}

.deploy-timer {
  font-size: 12px; color: rgba(255, 255, 255, 0.4);
  margin: 12px 0 0; font-family: var(--mono);
  animation: deploy-fade-in 1.2s ease-out;
}

/* Particles background animation */
.deploy-particles {
  position: absolute; inset: 0; z-index: 1;
  overflow: hidden;
}
.deploy-particles span {
  position: absolute; width: 2px; height: 2px;
  background: rgba(255, 122, 0, 0.4); border-radius: 50%;
  animation: deploy-float 8s linear infinite;
}
.deploy-particles span:nth-child(1) { width: 3px; height: 3px; left: 10%; top: 20%; animation-delay: 0s; animation-duration: 10s; }
.deploy-particles span:nth-child(2) { left: 80%; top: 10%; animation-delay: 2s; animation-duration: 8s; }
.deploy-particles span:nth-child(3) { width: 2px; height: 2px; left: 50%; top: 70%; animation-delay: 4s; animation-duration: 12s; }
.deploy-particles span:nth-child(4) { left: 20%; top: 50%; animation-delay: 1s; animation-duration: 9s; }
.deploy-particles span:nth-child(5) { left: 90%; top: 60%; animation-delay: 3s; animation-duration: 11s; }

@keyframes deploy-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); box-shadow: 0 0 30px rgba(255, 122, 0, 0.4); } }
@keyframes deploy-bounce { 0%, 100% { transform: translateY(0); opacity: 0.3; } 50% { transform: translateY(-12px); opacity: 1; } }
@keyframes deploy-fade-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes deploy-float { 0% { transform: translateY(0) translateX(0); opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { transform: translateY(-100vh) translateX(100px); opacity: 0; } }
@keyframes particle-float-wide { 0% { transform: translateY(0) translateX(0); opacity: 0; } 10% { opacity: 0.8; } 90% { opacity: 0.8; } 100% { transform: translateY(-120vh) translateX(var(--tx, 150px)); opacity: 0; } }

/* ---------- Shared floating-particle background (login / 502 / deploy) ---------- */
.bg-particles {
  position: absolute; inset: 0; z-index: 1;
  overflow: hidden; pointer-events: none;
}
.bg-particles span {
  position: absolute; width: 4px; height: 4px;
  background: rgba(255, 122, 0, 0.35); border-radius: 50%;
  animation: particle-float-wide linear infinite;
}
.bg-particles span:nth-child(1) { width: 5px; height: 5px; left: 5%; top: 15%; animation-delay: 0s; animation-duration: 12s; --tx: 80px; }
.bg-particles span:nth-child(2) { width: 6px; height: 6px; left: 15%; top: 25%; animation-delay: 1s; animation-duration: 13s; --tx: 120px; }
.bg-particles span:nth-child(3) { width: 4px; height: 4px; left: 25%; top: 35%; animation-delay: 2s; animation-duration: 14s; --tx: -60px; }
.bg-particles span:nth-child(4) { width: 7px; height: 7px; left: 35%; top: 20%; animation-delay: 0.5s; animation-duration: 15s; --tx: 140px; }
.bg-particles span:nth-child(5) { width: 5px; height: 5px; left: 45%; top: 40%; animation-delay: 1.5s; animation-duration: 13s; --tx: -80px; }
.bg-particles span:nth-child(6) { width: 6px; height: 6px; left: 55%; top: 30%; animation-delay: 2.5s; animation-duration: 16s; --tx: 100px; }
.bg-particles span:nth-child(7) { width: 4px; height: 4px; left: 65%; top: 45%; animation-delay: 3s; animation-duration: 14s; --tx: -100px; }
.bg-particles span:nth-child(8) { width: 8px; height: 8px; left: 75%; top: 25%; animation-delay: 0.8s; animation-duration: 15s; --tx: 110px; }
.bg-particles span:nth-child(9) { width: 5px; height: 5px; left: 85%; top: 35%; animation-delay: 2s; animation-duration: 13s; --tx: -120px; }
.bg-particles span:nth-child(10) { width: 6px; height: 6px; left: 10%; top: 50%; animation-delay: 3.5s; animation-duration: 14s; --tx: 90px; }
.bg-particles span:nth-child(11) { width: 5px; height: 5px; left: 50%; top: 60%; animation-delay: 1.2s; animation-duration: 15s; --tx: 70px; }
.bg-particles span:nth-child(12) { width: 7px; height: 7px; left: 30%; top: 70%; animation-delay: 2.8s; animation-duration: 16s; --tx: 130px; }
.bg-particles span:nth-child(13) { width: 4px; height: 4px; left: 70%; top: 55%; animation-delay: 0.3s; animation-duration: 13s; --tx: -70px; }
.bg-particles span:nth-child(14) { width: 6px; height: 6px; left: 90%; top: 45%; animation-delay: 1.8s; animation-duration: 14s; --tx: 95px; }
.bg-particles span:nth-child(15) { width: 5px; height: 5px; left: 20%; top: 80%; animation-delay: 2.2s; animation-duration: 15s; --tx: -90px; }

/* ---------- Login page: rise-in card + pulsing lock icon ---------- */
@keyframes login-rise { from { opacity: 0; transform: translateY(18px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes login-glow {
  0%, 100% { box-shadow: 0 8px 24px -8px color-mix(in srgb, var(--tint) 55%, transparent); }
  50% { box-shadow: 0 8px 32px -2px color-mix(in srgb, var(--tint) 75%, transparent); }
}
@keyframes login-ripple {
  0% { transform: scale(0.9); opacity: 0.9; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* ---------- 502 page: radar-style "reconnecting" icon ---------- */
.error-icon-radar {
  width: 72px; height: 72px; margin: 0 auto 14px;
  position: relative; display: grid; place-items: center;
}
.error-icon-radar .radar-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--tint) 50%, transparent);
  animation: radar-ping 2.4s ease-out infinite;
}
.error-icon-radar .radar-ring:nth-child(2) { animation-delay: 0.8s; }
.error-icon-radar .radar-ring:nth-child(3) { animation-delay: 1.6s; }
.error-icon-radar .radar-core {
  position: relative; z-index: 1;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--tint-grad); color: #fff;
  display: grid; place-items: center;
  animation: deploy-pulse 2s ease-in-out infinite;
}
.error-icon-radar .radar-core svg { width: 22px; height: 22px; }
@keyframes radar-ping {
  0% { transform: scale(0.55); opacity: 0.9; }
  100% { transform: scale(1.7); opacity: 0; }
}

.error-status {
  font-size: 13px; color: var(--muted); margin: -14px 0 20px;
  display: flex; align-items: center; justify-content: center; gap: 2px;
}
.error-status .dot-typing span {
  animation: dot-typing 1.4s ease-in-out infinite;
  opacity: 0.2;
}
.error-status .dot-typing span:nth-child(2) { animation-delay: 0.2s; }
.error-status .dot-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot-typing { 0%, 100% { opacity: 0.2; } 50% { opacity: 1; } }

/* Profielfoto (2 oktober 2026): rond, 128 bij 128 op de schijf, hier verkleind getoond. */
.avatar { display:inline-flex; align-items:center; justify-content:center; width:40px; height:40px;
  border-radius:50%; overflow:hidden; background:var(--bg, #f1f1f1); border:1px solid var(--border, #ddd);
  font-weight:700; color:var(--muted, #666); flex:0 0 auto; vertical-align:middle; }
.avatar img { width:100%; height:100%; object-fit:cover; display:block; }
.avatar--lg { width:72px; height:72px; font-size:1.4rem; }
.avatar--sm { width:22px; height:22px; margin-right:6px; border:0; }
.avatar img[hidden] { display:none; }

/* De melding onder een grijze runknop: groot, oranje rand links en een vetgedrukte kop, zodat
   iedereen ziet waarom de knop grijs is (6 oktober 2026). */
.run-wait:not([hidden]) {
  display: block; margin: 12px 0 0; padding: 14px 18px; border-left: 5px solid var(--warn, #e0862f);
  font-size: 15px; line-height: 1.45; font-weight: 500;
}
.run-wait__kop { display: block; margin-bottom: 2px; font-size: 16px; font-weight: 700; }

/* Make-scenario aan of uit: een gekleurd label met een lampje (9 oktober 2026). */
.scen-status { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px 4px 9px;
  border-radius: 999px; font-size: 13px; font-weight: 700; line-height: 1.2; }
.scen-status__lamp { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.scen-status--aan { background: #E7F5EA; color: #1E6B34; }
.scen-status--aan .scen-status__lamp { background: #2E9E4F; box-shadow: 0 0 0 3px rgba(46, 158, 79, .22); }
.scen-status--uit { background: #EEEEF0; color: #555A63; }
.scen-status--uit .scen-status__lamp { background: #9AA0A8; }
.scen-status--onbekend { background: #FFF1DE; color: #8A5300; }
.scen-status--onbekend .scen-status__lamp { background: #E0862F; }
[data-theme="dark"] .scen-status--aan { background: rgba(46, 158, 79, .18); color: #7FD69A; }
[data-theme="dark"] .scen-status--uit { background: rgba(255, 255, 255, .08); color: #B9BEC6; }
[data-theme="dark"] .scen-status--onbekend { background: rgba(224, 134, 47, .18); color: #F2B26E; }
