/* SIP / Etil — gedeelde branding, gebruikt door de loginpoort en de topbar
   in index.html en beheer.html. Kleuren/typografie overgenomen uit
   sip-login-export/login.html zodat inlog en app er als één geheel uitzien. */
/* Lettertypen (Plus Jakarta Sans 400..700 + Ubuntu voor het woordmerk) laden per pagina via <link> met preconnect. */

/* Geen standaard browser-marge/opvulling rond html/body — anders blijft er een witte
   rand rondom de topbar staan (topbar was 100% breed t.o.v. body, maar body zelf had nog
   de standaard 8px marge van de browser). */
html, body { min-height: 100%; margin: 0; padding: 0; }
/* <html> donker (zelfde als de topbar): op een gsm kleurt de browser de strook boven de topbar
   (statusbalk/notch) en het doortrekken bovenaan met deze kleur. Vroeger lichtgrijs = witte strook
   boven de zwarte topbar. De pagina zelf (body) blijft lichtgrijs. */
html { background: #121212; }
/* Body minstens schermhoog (ook op korte pagina's zoals Profiel), anders zou het donkere
   <html> onderaan zichtbaar worden. border-box: de ruimte voor de gsm-tabbalk telt mee. */
body { background: #F6F7F9; min-height: 100vh; min-height: 100dvh; box-sizing: border-box; }
/* ---- Schuifbalk: zwevend, neemt geen ruimte in, fadet in/uit ----
   Een gewone schuifbalk eist altijd ruimte op: óf vast gereserveerd (lege strook op korte pagina's),
   óf alles schuift op zodra hij verschijnt. Daarom de gewone verborgen en een eigen dunne balk
   (.sip-scrollbar, getekend door sip-auth.js) die óver de pagina zweeft: onzichtbaar als er niets
   te scrollen valt, fadet in zodra het wel kan. Scrollen met wiel/touchpad/toetsen/aanraken blijft
   gewoon het normale scrollen van de browser; het blokje is ook versleepbaar. */
html { scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }
.sip-scrollbar {
  position: fixed; top: 0; right: 0; bottom: 0; width: 12px; z-index: 900;
  opacity: 0; pointer-events: none; transition: opacity .3s ease;
}
.sip-scrollbar.show { opacity: 1; pointer-events: auto; }
.sip-scrollbar-thumb {
  position: absolute; right: 3px; width: 6px; min-height: 32px; border-radius: 3px;
  background: rgba(28, 34, 43, .28); transform-origin: right; transition: transform .15s ease, background .15s ease;
}
.sip-scrollbar:hover .sip-scrollbar-thumb, .sip-scrollbar.dragging .sip-scrollbar-thumb { transform: scaleX(1.33); background: rgba(28, 34, 43, .45); }
/* Bij het laden van een pagina meteen de juiste stand, zonder fade (anders fadet hij bij elke tabwissel). */
.sip-scrollbar.instant { transition: none; }

:root {
  --sip-bg: #050403;
  --sip-panel: rgba(20, 16, 14, 0.55);
  --sip-ink: #f4f1ee;
  --sip-ink-muted: rgba(244, 241, 238, 0.65);
  --sip-border: rgba(244, 241, 238, 0.14);
  --sip-accent-start: #ff4d2e;
  --sip-accent-end: #ffb020;
  --sip-accent-ink: #14100e;
}

/* ---- Topbar (op elke pagina, boven de eigenlijke app) ---- */
.sip-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: #121212; color: var(--sip-ink);
  padding: 12px 24px; font-family: Ubuntu, "Helvetica Neue", Arial, sans-serif;
  border-bottom: 1px solid rgba(248, 249, 250, .12);
}
/* Klikbaar terug-naar-tijdregistratie: bewust GEEN hover-omranding/achtergrond (enkel de
   muiscursor laat zien dat het klikbaar is) -- anders zou dit lijken op een tweede
   "geselecteerd blokje" naast het profiel-blokje hieronder. */
.sip-topbar-brand { display: flex; align-items: center; gap: 6px; text-decoration: none; color: inherit; cursor: pointer; }
.sip-topbar-logo { display: block; width: 70px; height: 34px; overflow: hidden; flex: none; }
.sip-topbar-logo img { display: block; height: 34px; width: auto; max-width: none; }
.sip-topbar-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--sip-ink-muted); }
.sip-topbar-user { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--sip-ink-muted); }
.sip-topbar-user b { color: var(--sip-ink); font-weight: 600; }
.sip-topbar-signout {
  display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0;
  color: var(--sip-ink-muted); cursor: pointer; background: transparent; border: 1px solid transparent;
  border-radius: 9px; text-decoration: none;
}
.sip-topbar-signout:hover { color: var(--sip-ink); background: rgba(248, 249, 250, .1); border-color: rgba(248, 249, 250, .16); }
.sip-topbar-brand:focus-visible { outline: 2px solid var(--sip-ink); outline-offset: 4px; border-radius: 6px; }
.sip-topbar-signout:focus-visible { outline: 2px solid var(--sip-ink); outline-offset: 2px; }
.sip-topbar-signout svg { width: 18px; height: 18px; }

/* ---- Loginpoort: overlay in dezelfde stijl als de standalone loginpagina ---- */
.sip-gate {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: #050403 url("/assets/login-hero.jpg") center center / cover no-repeat;
  color: var(--sip-ink); font-family: Ubuntu, "Helvetica Neue", Arial, sans-serif;
  box-sizing: border-box;
}
.sip-gate * { box-sizing: border-box; }
.sip-gate::before {
  content: ""; position: fixed; inset: 0;
  background: radial-gradient(120% 100% at 50% 40%, rgba(5,4,3,.35) 0%, rgba(5,4,3,.72) 65%, rgba(5,4,3,.92) 100%);
}
.sip-gate-stage { position: relative; z-index: 1; width: min(100%, 400px); display: grid; justify-items: stretch; gap: 28px; }
.sip-gate-brand { display: grid; justify-items: center; text-align: center; }
.sip-gate-brand .sip-topbar-eyebrow { margin: 0; color: var(--sip-ink); font-size: 30px; font-weight: 700; letter-spacing: -.025em; text-transform: none; }
.sip-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; }
.sip-gate-panel {
  width: 100%; background: var(--sip-panel);
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--sip-border); border-radius: 16px; padding: 30px;
  box-shadow: 0 24px 60px rgba(0,0,0,.45);
}
.sip-gate-signin {
  width: 100%; min-height: 48px; margin-top: 20px; border: 0; border-radius: 10px; font: inherit; font-weight: 700; cursor: pointer;
  background: linear-gradient(90deg, var(--sip-accent-start), var(--sip-accent-end)); color: var(--sip-accent-ink);
  display: flex; align-items: center; justify-content: center; gap: 12px;
}
.sip-gate-signin:hover { filter: brightness(1.08); }
.sip-gate-signin:disabled { cursor: wait; filter: grayscale(.4) brightness(.8); }
.sip-gate-error { min-height: 20px; margin: 14px 0 0; color: #ff9d8a; font-size: 14px; text-align: center; }
.sip-gate-status { min-height: 0; margin: 0; color: var(--sip-ink-muted); font-size: 14px; text-align: center; }
.sip-gate-logo { display: flex; justify-content: center; }
.sip-gate-logo img { width: 168px; height: auto; opacity: .85; }

/* Kleine, duidelijk secundaire link/knop waarmee je zonder in te loggen door de app kunt
   klikken (voorbeeldweergave) — bewust onopvallend t.o.v. de echte aanmeldknop. */
.sip-gate-preview {
  display: block; width: 100%; margin: 18px 0 0; padding: 8px; border: 0; background: none;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--sip-ink-muted);
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.sip-gate-preview:hover { color: var(--sip-ink); }

/* Badge in de topbar zolang de voorbeeldweergave actief is (geen echte aanmelding). */
.sip-topbar-demo-badge {
  font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: #FFB020; background: transparent; border: 1px solid rgba(255, 176, 32, .5);
  padding: 2px 8px; border-radius: 999px;
}

/* Zolang de loginpoort actief is, blijft de rest van de pagina verborgen (voorkomt flits van data vóór auth). */
/* De topbar blijft wél staan, zodat de donkere balk bij het wisselen van pagina nooit even wegvalt. */
body.sip-locked > *:not(.sip-gate):not(.sip-topbar) { visibility: hidden; }

/* ---- Vloeiend wisselen tussen de hoofdpagina's (cross-document View Transitions; Edge/Chrome,
   andere browsers negeren dit gewoon) ----
   De browser houdt de vorige pagina in beeld tot de nieuwe klaar is en laat de inhoud kort in
   elkaar overvloeien i.p.v. een witte flits. De topbar krijgt een eigen naam en wordt zonder
   animatie meteen vervangen, zodat hij stil blijft staan (enkel de actieve tab wisselt). */
/* Enkel op desktop: op een gsm (iPhone-web-app) zat de tabbalk in de momentopname van de
   overgang en werd daarin t.o.v. het volledige scherm (incl. de zone onder de thuisbalk)
   getekend → na de overgang sprong hij ±1 cm. Zonder overgang tekent de gsm de nieuwe pagina
   pas als ze volledig klaar is (blocking="render" + donkere achtergrond), dus geen flits. */
@media (min-width: 641px) {
  @view-transition { navigation: auto; }
}
.sip-topbar { view-transition-name: sip-topbar; }
::view-transition-group(sip-topbar) { animation: none; }
::view-transition-old(sip-topbar) { display: none; }
::view-transition-new(sip-topbar) { animation: none; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .16s; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

@media (min-width: 1024px) {
  .sip-gate { justify-content: flex-start; padding-left: 128px; padding-right: 128px; }
}


/* ---- Navigatie in de topbar (20 sept): Tijdregistratie / Overzicht ---- */
.sip-topbar-left { display: flex; align-items: center; gap: 28px; }
.sip-topbar-nav { display: flex; align-items: center; gap: 4px; }
.sip-topbar-nav a {
  font-size: 14px; font-weight: 600; color: var(--sip-ink-muted); text-decoration: none;
  padding: 7px 12px; border-radius: 8px; border: 1px solid transparent;
}
.sip-topbar-nav a:hover { color: var(--sip-ink); background: rgba(248, 249, 250, .08); }
/* Admin-only UI: verborgen tot sip-auth.js (cache of /api/me) .sip-is-admin op <html> zet. */
html:not(.sip-is-admin) .sip-admin-only { display: none !important; }
.sip-topbar-nav a.active { color: var(--sip-ink); background: rgba(248, 249, 250, .1); border-color: rgba(248, 249, 250, .16); }
.sip-topbar-nav a:focus-visible { outline: 2px solid var(--sip-ink); outline-offset: -2px; }
/* Iconen naast de tabnamen (desktop: klein ervoor; gsm-tabbalk: groot erboven, zie onderaan). */
.sip-topbar-nav a { display: inline-flex; align-items: center; gap: 7px; }
.sip-nav-icon { display: block; width: 16px; height: 16px; flex: none; }

/* ---- Gsm (stap 4, okt 2026): de topbar paste niet meer (Beheer afgeknipt, profiel/afmelden
   buiten beeld). Bovenaan blijven enkel logo + profiel-icoon + afmelden; de navigatie wordt
   een vaste tabbalk onderaan (icoon + label, goed bereikbaar met de duim). ---- */
@media (max-width: 640px) {
  /* z-index: de topbar is door view-transition-name een eigen stapellaag; zonder dit zou
     gepositioneerde inhoud (bv. de projectkeuzelijst) bovenop de tabbalk getekend worden. */
  /* Veilige zones (notch / thuisbalk): werken dankzij viewport-fit=cover in de viewport-meta. */
  .sip-topbar {
    gap: 10px; position: relative; z-index: 800;
    padding: calc(8px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) 8px calc(16px + env(safe-area-inset-left));
  }
  .sip-topbar-user { gap: 4px; }
  .sip-topbar-user b { display: none; } /* naam: zowel in de profiel-link als als platte tekst (voorbeeld) */
  .sip-topbar-signout { width: 44px; height: 44px; }
  .sip-topbar-brand { min-height: 44px; }
  .sip-topbar-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 800;
    display: flex; gap: 0; background: #121212; border-top: 1px solid rgba(248, 249, 250, .12);
    padding: 4px calc(6px + env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) calc(6px + env(safe-area-inset-left));
  }
  .sip-topbar-nav a:active { background: rgba(248, 249, 250, .08); }

  /* iPhone zoomt in op elk invoerveld kleiner dan 16px (en zoomt niet terug) — daarom op gsm
     overal 16px. !important omdat de pagina's hun velden met specifiekere selectors kleiner zetten. */
  input, select, textarea { font-size: 16px !important; }

  /* Geen 300ms-tikvertraging, en zichtbare drukfeedback op alles wat aantikbaar is. */
  a, button, input, select, textarea, label, [role="button"] { touch-action: manipulation; }
  button, [role="button"] { -webkit-tap-highlight-color: transparent; transition: opacity .1s ease; }
  button:active:not(:disabled), [role="button"]:active { opacity: .7; }
  .sip-topbar-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 52px; padding: 4px 2px; font-size: 12px; border: 0; border-radius: 10px;
  }
  .sip-topbar-nav a.active { background: transparent; color: var(--sip-accent-end); }
  .sip-topbar-nav a:hover { background: transparent; }
  .sip-nav-icon { width: 22px; height: 22px; }
  /* Safari (iOS 26) negeert theme-color en kleurt de strook boven de topbar met de achtergrond
     van <body> → body donker zoals de topbar. De lichtgrijze pagina (het app-blok) vult het
     scherm onder de topbar volledig, ook op korte pagina's, en loopt door tot onder de tabbalk;
     zo zie je nergens zwart waar het lichtgrijs hoort. */
  body { background: #121212; display: flex; flex-direction: column; }
  body > .tr-app, body > .ov-app, body > .tb-app, body > .pf-app {
    flex: 1 0 auto; width: 100%; max-width: none; margin: 0; border-radius: 0;
    /* ruimte onderaan zodat de laatste inhoud niet onder de tabbalk verdwijnt */
    padding-bottom: calc(28px + 64px + env(safe-area-inset-bottom));
  }
  body.sip-locked .sip-topbar-nav { display: none; }
}

/* =====================================================================================
   TWINNY UI — ontwerpsysteem (herontwerp okt 2026)
   Zie docs/superpowers/specs/2026-10-12-frontend-herontwerp-design.md.
   Eén plek voor kleurtokens, typografie en gedeelde componenten (prefix tw-). Pagina's
   gebruiken deze componenten; enkel echt pagina-eigen opmaak staat nog in hun <style>.
   Regels: één primaire knop per scherm (verloop + donkere tekst), oranje tekst = --brand-text,
   status nooit enkel met kleur (altijd icoon of tekst), uren/tijden tabular-nums.
   ===================================================================================== */
:root {
  --ink: #16181D;
  --ink-2: #5B6270;
  --ink-3: #8A909C;            /* enkel niet-essentieel (placeholder, gestippeld) */
  --page: #F6F7F9;
  --surface: #FFFFFF;
  --surface-2: #F0F2F5;        /* subtiele vlakken binnen een paneel (hover, uitklap) */
  --line: #E4E7EC;
  --line-strong: #CDD2DA;
  --brand-grad: linear-gradient(90deg, #FF4D2E, #FFB020);
  --brand-ink: #14100E;
  --brand-text: #C8391C;
  --brand-soft: #FFF1EA;
  --chrome: #121212;
  --ok: #157A4A;   --ok-soft: #E7F5EE;
  --registration-radius: 12px;
  --registration-border: 1px solid var(--line);
  --info: #2457C5; --info-soft: #EAF0FC;
  --warn: #9A5B00; --warn-soft: #FFF4DE;
  --danger: #C2281D; --danger-soft: #FDECEA;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-xs: 12px; --fs-sm: 14px; --fs-md: 16px; --fs-lg: 22px;
  --fw-regular: 400; --fw-medium: 500; --fw-bold: 600;
  --focus: #16181D;
  --t-exit: 160ms; --ease-drawer: cubic-bezier(.32, .72, 0, 1);
  --r-sm: 6px; --r-md: 8px; --r-lg: 12px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t-fast: 150ms; --t-med: 220ms;
  --shadow-pop: 0 12px 32px rgba(22, 24, 29, .14), 0 2px 6px rgba(22, 24, 29, .06);
  --content-max: 1080px;
}

body { font-family: var(--font); color: var(--ink); -webkit-font-smoothing: antialiased; }
.tw-num, .tw-time { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ---- Paginakader ---- */
body > .tr-app, body > .ov-app, body > .tb-app, body > .pf-app {
  font-family: var(--font); font-size: var(--fs-sm); color: var(--ink);
  max-width: var(--content-max); margin: 0 auto; padding: 32px 24px 120px; box-sizing: border-box;
}
.tw-pagehead { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 0 0 20px; }
.tw-title { font-size: var(--fs-lg); font-weight: var(--fw-bold); letter-spacing: -.01em; margin: 0; line-height: 1.25; }
.tw-sub { color: var(--ink-2); font-size: var(--fs-sm); margin: 4px 0 0; }
.tw-section-title { font-size: var(--fs-md); font-weight: var(--fw-bold); margin: 0; }
.tw-muted { color: var(--ink-2); }
.tw-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---- Knoppen ---- */
.tw-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 16px; border-radius: var(--r-md); border: 1px solid transparent;
  font: inherit; font-family: var(--font); font-size: var(--fs-sm); font-weight: var(--fw-bold); line-height: 1.2;
  cursor: pointer; text-decoration: none; white-space: nowrap; color: var(--ink); background: transparent;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), filter var(--t-fast) var(--ease), opacity 100ms var(--ease), transform 120ms var(--ease);
}
.tw-btn svg { width: 16px; height: 16px; flex: none; }
.tw-btn--primary { background: var(--brand-grad); color: var(--brand-ink); }
.tw-btn--secondary { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.tw-btn--ghost { color: var(--brand-text); padding-inline: 10px; }
.tw-btn--quiet { color: var(--ink-2); padding-inline: 10px; }
.tw-btn--danger { color: var(--danger); }
.tw-btn--danger-solid { background: var(--danger); color: #fff; }
.tw-btn:active:not(:disabled), .tw-iconbtn:active:not(:disabled) { transform: scale(.97); }
.tw-btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.tw-btn[aria-busy="true"] { cursor: progress; }
/* Opslaan dat wacht op een wijziging (.tw-btn--save naast --primary): wit zolang er niets te bewaren is,
   oranje zodra er iets gewijzigd is. Tijdens het bewaren (aria-busy) blijft hij oranje. */
.tw-btn--primary.tw-btn--save:disabled:not([aria-busy="true"]) {
  background: var(--surface); border-color: var(--line-strong); color: var(--ink-2); opacity: 1;
}
.tw-iconbtn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: var(--r-md);
  background: transparent; color: var(--ink-2); cursor: pointer; transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.tw-iconbtn svg { width: 18px; height: 18px; }
main :is(a, button, [role="button"], input, select, textarea, summary):focus-visible,
:is(.tr-app, .ov-app, .tb-app, .pf-app) :is(a, button, [role="button"], input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--focus); outline-offset: 2px;
}

/* ---- Segmentschakelaar (Week|Maand, Actief|Inactief) ---- */
.tw-seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: var(--r-md); }
.tw-seg button {
  min-height: 32px; padding: 4px 12px; border: 0; border-radius: 6px; background: transparent; cursor: pointer;
  font: inherit; font-family: var(--font); font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--ink-2);
}
.tw-seg button.is-active, .tw-seg button[aria-pressed="true"], .tw-seg button[aria-selected="true"] {
  background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(22, 24, 29, .12);
}

/* ---- Tabs met onderstreep (Overzicht, Beheer) ---- */
.tw-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 20px; overflow-x: auto; scrollbar-width: none; }
.tw-tab {
  position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px;
  border: 0; background: none; cursor: pointer; white-space: nowrap;
  font: inherit; font-family: var(--font); font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--ink-2);
}
.tw-tab.is-active, .tw-tab[aria-selected="true"] { color: var(--ink); }
.tw-tab.is-active::after, .tw-tab[aria-selected="true"]::after {
  content: ""; position: absolute; left: 8px; right: 8px; bottom: 0; height: 2px; border-radius: 2px; background: var(--ink);
}
.tw-tab .tw-count { font-weight: var(--fw-regular); color: var(--ink-2); margin-left: 2px; }

/* ---- Periodekiezer (pijlen + label) ---- */
.tw-period { display: inline-flex; align-items: center; gap: 4px; }
.tw-period-label { min-width: 0; padding: 0 8px; font-size: var(--fs-md); font-weight: var(--fw-bold); white-space: nowrap; }
.tw-period .tw-iconbtn:disabled { opacity: .35; cursor: not-allowed; }

/* ---- Chips en badges ---- */
.tw-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 2px 8px; border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--ink); font-size: var(--fs-xs); font-weight: var(--fw-regular); letter-spacing: .015em; line-height: 20px; white-space: nowrap;
}
.tw-chip b { font-weight: var(--fw-bold); }
.tw-chip-code { font-variant-numeric: tabular-nums; font-weight: var(--fw-medium); color: var(--ink); }
.tw-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px;
  font-size: var(--fs-xs); font-weight: var(--fw-medium); letter-spacing: .015em; line-height: 20px; white-space: nowrap;
  background: var(--surface-2); color: var(--ink-2);
}
.tw-badge svg { width: 12px; height: 12px; }
.tw-badge--ok { background: var(--ok-soft); color: var(--ok); }
.tw-badge--info { background: var(--info-soft); color: var(--info); }
.tw-badge--warn { background: var(--warn-soft); color: var(--warn); }
.tw-badge--danger { background: var(--danger-soft); color: var(--danger); }
.tw-badge--brand { background: var(--brand-soft); color: var(--brand-text); }

/* ---- Paneel, lijst en regel ---- */
.tw-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.tw-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.tw-panel-body { padding: 16px; }
.tw-list { list-style: none; margin: 0; padding: 0; }
.tw-list > li + li { border-top: 1px solid var(--line); }
.tw-row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 16px; }
.tw-row-btn { cursor: pointer; transition: background-color var(--t-fast) var(--ease); }

/* ---- Meldingen in de pagina ---- */
.tw-notice {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; border-radius: var(--r-md);
  background: var(--info-soft); color: var(--ink); font-size: var(--fs-sm); line-height: 1.45;
}
.tw-notice > svg { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--info); }
.tw-notice--warn { background: var(--warn-soft); } .tw-notice--warn > svg { color: var(--warn); }
.tw-notice--error { background: var(--danger-soft); } .tw-notice--error > svg { color: var(--danger); }
.tw-notice--ok { background: var(--ok-soft); } .tw-notice--ok > svg { color: var(--ok); }
.tw-notice a { color: var(--brand-text); font-weight: var(--fw-bold); }

/* ---- Lege toestand en skelet ---- */
.tw-empty { display: grid; justify-items: center; gap: 10px; padding: 40px 16px; text-align: center; color: var(--ink-2); }
.tw-empty b { color: var(--ink); font-size: var(--fs-md); }
.tw-skel { display: block; height: 14px; border-radius: 4px; background: linear-gradient(90deg, var(--surface-2) 0%, #E9ECF0 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: tw-shimmer 1.2s linear infinite; }
@keyframes tw-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---- Formuliervelden ---- */
.tw-field { display: grid; gap: 6px; }
.tw-label { font-size: var(--fs-xs); font-weight: var(--fw-medium); letter-spacing: .015em; color: var(--ink-2); }
.tw-input, .tw-select, .tw-textarea {
  min-height: 40px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface);
  font: inherit; font-family: var(--font); font-size: var(--fs-sm); color: var(--ink); box-sizing: border-box;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.tw-input:focus, .tw-select:focus, .tw-textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(22, 24, 29, .12); }
.tw-input::placeholder, .tw-textarea::placeholder { color: var(--ink-2); opacity: .8; }
.tw-select { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235B6270' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 10px center; }
.tw-input[aria-invalid="true"] { border-color: var(--danger); }
.tw-field-error { color: var(--danger); font-size: var(--fs-xs); font-weight: var(--fw-bold); }
.tw-check { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; cursor: pointer; }
.tw-check input { width: 18px; height: 18px; accent-color: #E8431F; }

/* ---- Weekmeter (signatuur): segmenten per dag (week) of per week (maand) ---- */
.tw-meter { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.tw-meter-seg {
  display: grid; gap: 6px; padding: 8px 10px 10px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); text-align: left; cursor: pointer; font: inherit; font-family: var(--font); color: var(--ink);
  transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.tw-meter-seg[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.tw-meter-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: var(--fs-xs); font-weight: var(--fw-medium); letter-spacing: .015em; color: var(--ink-2); white-space: nowrap; overflow: hidden; }
.tw-meter-top svg { width: 14px; height: 14px; flex: none; }
.tw-meter-bar { position: relative; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.tw-meter-fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 3px; background: var(--brand-grad); }
.tw-meter-val { font-size: var(--fs-sm); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tw-meter-seg.is-locked { cursor: default; color: var(--ink-3);
  border-style: dashed; background: repeating-linear-gradient(135deg, transparent 0 5px, rgba(22, 24, 29, .045) 5px 6px); }
.tw-meter-seg.is-locked .tw-meter-val { color: var(--ink-2); font-weight: var(--fw-regular); font-size: var(--fs-xs); }
.tw-meter-seg.is-sent .tw-meter-top svg { color: var(--ok); }
.tw-meter-seg.is-error { border-color: var(--danger); }
.tw-meter-seg.is-error .tw-meter-top svg { color: var(--danger); }

/* ---- Vaste actiebalk (versturen / opslaan) ----
   Desktop: kleeft onderaan het venster binnen de inhoudsbreedte. Gsm: vast net boven de tabbalk. */
.tw-actionbar {
  position: sticky; bottom: 16px; z-index: 50; margin-top: 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 10px 10px 18px; border-radius: var(--r-lg); background: var(--chrome); color: #F4F1EE;
  box-shadow: var(--shadow-pop);
}
.tw-actionbar[hidden], .tw-notice[hidden], .tw-panel[hidden], .tw-empty[hidden] { display: none; }
.tw-actionbar .tw-btn--primary:disabled { background: rgba(255, 255, 255, .12); color: rgba(244, 241, 238, .55); opacity: 1; }
.tw-actionbar-text { display: grid; gap: 2px; min-width: 0; }
.tw-actionbar-title { font-size: var(--fs-sm); font-weight: var(--fw-bold); }
.tw-actionbar-sub { font-size: var(--fs-xs); color: rgba(244, 241, 238, .72); overflow: hidden; text-overflow: ellipsis; }
.tw-actionbar-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.tw-actionbar .tw-btn--quiet { color: rgba(244, 241, 238, .8); }
.tw-actionbar[data-state="ok"] .tw-actionbar-title::before { content: "✓ "; color: #6BD39B; }
.tw-actionbar[data-state="error"] { background: #3A1512; }
.tw-actionbar { transition: background-color var(--t-fast) var(--ease), opacity 200ms var(--ease), transform 200ms var(--ease); }
@starting-style { .tw-actionbar { opacity: 0; transform: translateY(8px); } }
.tw-actionbar-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tw-actionbar :focus-visible { outline-color: #FFB020 !important; }

/* ---- Bottom sheet (gsm) / scrim ---- */
.tw-scrim { position: fixed; inset: 0; z-index: 950; background: rgba(10, 11, 13, .48); opacity: 0; transition: opacity var(--t-med) var(--ease); }
.tw-scrim.is-open { opacity: 1; }
.tw-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 960; max-height: 88dvh; overflow: auto;
  background: var(--surface); border-radius: 16px 16px 0 0; box-shadow: var(--shadow-pop);
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform var(--t-exit) var(--ease); overscroll-behavior: contain;
}
.tw-sheet.is-open { transform: none; transition: transform 260ms var(--ease-drawer); }
.tw-scrim:not(.is-open) { transition-duration: var(--t-exit); }
.tw-sheet-grip { width: 36px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 4px auto 12px; }
.tw-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }

/* ---- Pop-upmenu (⋯) ---- */
.tw-menu { position: absolute; z-index: 970; min-width: 180px; padding: 4px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-pop); }
.tw-menu button { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 36px; padding: 6px 10px; border: 0; border-radius: 6px; background: none; cursor: pointer; font: inherit; font-family: var(--font); font-size: var(--fs-sm); color: var(--ink); text-align: left; }
.tw-menu button.is-danger { color: var(--danger); }
.tw-menu { animation: tw-menu-in 140ms var(--ease); transform-origin: top right; }
@keyframes tw-menu-in { from { opacity: 0; transform: scale(.97); } }

/* ---- Tabel ---- */
.tw-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.tw-table th { text-align: left; font-size: var(--fs-xs); font-weight: var(--fw-medium); letter-spacing: .015em; color: var(--ink-2); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tw-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tw-table tr:last-child td { border-bottom: 0; }
.tw-table .is-num { text-align: right; font-variant-numeric: tabular-nums; }
.tw-avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); color: var(--ink-2); font-size: 11px; font-weight: var(--fw-bold); flex: none; }

/* ---- Topbar: actieve tab als onderstreep i.p.v. omlijnd blokje (desktop) ---- */
.sip-topbar { font-family: var(--font); }
.sip-topbar-eyebrow { font-family: Ubuntu, var(--font); }
@media (min-width: 641px) {
  .sip-topbar { padding-top: 0; padding-bottom: 0; min-height: 60px; }
  .sip-topbar-left { align-self: stretch; }
  .sip-topbar-nav { align-self: stretch; gap: 2px; }
  .sip-topbar-nav a { position: relative; align-self: stretch; padding: 0 12px; border: 0; border-radius: 0; }
  .sip-topbar-nav a:hover { background: transparent; color: var(--sip-ink); }
  .sip-topbar-nav a.active { background: transparent; border: 0; color: var(--sip-ink); }
  .sip-topbar-nav a.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px; border-radius: 2px 2px 0 0; background: #F4F1EE; }
}

@media (max-width: 640px) {
  body > .tr-app, body > .ov-app, body > .tb-app, body > .pf-app { padding: 20px 16px calc(150px + env(safe-area-inset-bottom)); }
  /* Typeschaal gsm (optie D): 12 · 14 · 16 · 28 en diktes 400 · 600. Medium (500) valt op gsm weg;
     badges en segmentknoppen worden 600. */
  :root { --fw-medium: 400; }
  .tw-badge, .tw-seg button { font-weight: var(--fw-bold); }
  .tw-title { font-size: 28px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
  /* De vaste actie-/bevestigingsbalk sluit op gsm aan op de ondernavigatie. Zo zijn Versturen,
     Opslaan en de waarschuwing bij navigeren een duidelijke schermbrede laag, geen zwevende kaart. */
  body > .tr-app .tw-actionbar, body > .tb-app .tw-actionbar {
    position: fixed; left: 0; right: 0; bottom: calc(60px + env(safe-area-inset-bottom)); z-index: 790;
    margin: 0; padding: 12px 16px; border: 0; border-top: 1px solid rgba(248, 249, 250, .12);
    border-radius: 14px 14px 0 0; box-shadow: none;
  }
  .tw-meter { gap: 4px; }
  .tw-meter-seg { padding: 6px 6px 8px; gap: 4px; }
  .tw-meter-top { font-size: 12px; }
  .tw-meter-val { font-size: var(--fs-xs); }
  .tw-btn, .tw-seg button, .tw-menu button, .tw-input, .tw-select { min-height: 44px; }
  .tw-meter-seg.is-locked .tw-meter-val { display: none; }
  .tw-iconbtn { width: 44px; height: 44px; }
  .tw-row { min-height: 52px; }
  .tw-table th, .tw-table td { padding: 10px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .tw-btn, .tw-iconbtn, .tw-meter-fill, .tw-sheet, .tw-row-btn, .tw-meter-seg, .tw-actionbar { transition: none !important; }
  .tw-scrim { transition: opacity 120ms linear !important; }
  .tw-menu { animation: none; }
  .tw-skel { animation: none; }
}

/* ---- Skiplink (eerste tabstop op elke pagina) ---- */
.tw-skip { position: absolute; left: 12px; top: -48px; z-index: 1001; padding: 8px 14px; border-radius: var(--r-md); background: var(--surface); color: var(--ink); font-family: var(--font); font-weight: 600; text-decoration: none; box-shadow: var(--shadow-pop); }
.tw-skip:focus { top: 8px; outline: 2px solid #FFB020; outline-offset: 2px; }

/* Hover enkel op apparaten met een echte muis (anders blijft hover op gsm na een tik hangen). */
@media (hover: hover) and (pointer: fine) {
  .tw-btn--primary:hover:not(:disabled) { filter: brightness(1.05) saturate(1.05); }
  .tw-btn--secondary:hover:not(:disabled) { background: var(--surface-2); border-color: var(--ink-3); }
  .tw-btn--ghost:hover:not(:disabled) { background: var(--brand-soft); }
  .tw-btn--quiet:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
  .tw-btn--danger:hover:not(:disabled) { background: var(--danger-soft); }
  .tw-iconbtn:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
  .tw-seg button:hover { color: var(--ink); }
  .tw-tab:hover { color: var(--ink); }
  .tw-row-btn:hover { background: var(--surface-2); }
  .tw-meter-seg:hover:not(:disabled) { border-color: var(--ink-3); }
  .tw-actionbar .tw-btn--quiet:hover:not(:disabled) { background: rgba(255, 255, 255, .08); color: #fff; }
  .tw-menu button:hover { background: var(--surface-2); }
}

/* =====================================================================================
   GSM / PWA — iOS-patronen (ronde 3, referenties in Refero, platform ios):
   - Dime "transacties per datum" (351a6af5): vlakke lijst over de volle breedte,
     kleine grijze sectiekop in hoofdletters met totaal rechts, waarde groot rechts.
   - Dime "Insights" (fbf2f6c4): grote titel, compacte periodekiezer rechts.
   - Linear "projectkiezer" (7e2db634): gevuld zoekveld zonder rand, vinkje rechts bij de keuze.
   - Vinyls "Settings" (832af722) + iOS Instellingen: gegroepeerde lijst, label in hoofdletters
     boven de groep, rij = titel + waarde/subtitel + chevron, scheidingslijn ingesprongen.
   Enkel onder 640px; desktop blijft ongewijzigd.
   ===================================================================================== */
@media (max-width: 640px) {
  /* Sectiekop in iOS-stijl (boven een lijst of groep) */
  .tw-ios-section {
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
    margin: 0; padding: 20px 16px 6px;
    font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2);
  }
  .tw-ios-section .tw-num { letter-spacing: 0; }

  /* Vlakke lijst over de volle breedte (Dime): geen kader, geen afronding, haarlijnen ingesprongen */
  .tw-ios-plain {
    margin-inline: -16px; border: 0; border-radius: 0; background: var(--surface);
    border-block: 1px solid var(--line);
  }
  .tw-ios-plain .tw-ios-row + .tw-ios-row { position: relative; }
  .tw-ios-plain .tw-ios-row + .tw-ios-row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--line); }

  /* Gegroepeerde lijst (iOS Instellingen / Vinyls): witte afgeronde groep op grijze pagina */
  .tw-ios-group { background: var(--surface); border: 0; border-radius: 12px; overflow: hidden; }
  .tw-ios-group > * + * { position: relative; }
  .tw-ios-group > * + *::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--line); pointer-events: none; }

  /* Rij: titel + subtitel links, waarde rechts, optionele chevron */
  .tw-ios-row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 16px; }
  .tw-ios-row-main { display: grid; gap: 2px; min-width: 0; flex: 1; }
  .tw-ios-row-title { font-size: 16px; font-weight: 400; color: var(--ink); line-height: 1.3; }
  .tw-ios-row-sub { font-size: 14px; color: var(--ink-2); line-height: 1.3; }
  .tw-ios-row-value { flex: none; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
  .tw-ios-chev { flex: none; width: 16px; height: 16px; color: var(--ink-3); }
  .tw-ios-row:active { background: var(--surface-2); }

  /* Gevuld zoekveld zonder rand (Linear-kiezer) */
  .tw-ios-search {
    display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px;
    background: var(--surface-2); border: 0; border-radius: 10px; color: var(--ink-2);
  }
  .tw-ios-search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font: inherit; color: var(--ink); }
  .tw-ios-check { flex: none; width: 20px; height: 20px; color: var(--ink); }

  /* Tabbalk: icoon 24, label 12px (kleinste maat van de schaal) */
  .sip-topbar-nav a { font-size: 12px; font-weight: 400; letter-spacing: .01em; gap: 2px; }
  .sip-nav-icon { width: 24px; height: 24px; }
}

/* =====================================================================================
   Contracturen (stap 13, mockup v2): i-uitleg, uren-tegen-contract (pil + balk), urenstapper.
   ===================================================================================== */
/* i-uitleg (js/tw-tip.js): bij hover met de muis of na klikken/tikken; Escape of ernaast klikken sluit. */
.tw-tip { position: relative; display: inline-flex; vertical-align: middle; }
.tw-tip-btn {
  position: relative; display: grid; place-items: center; width: 28px; height: 28px; margin: -4px; padding: 0;
  border: 0; border-radius: 50%; background: none; color: var(--ink-3); cursor: pointer;
  transition: color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.tw-tip-btn svg { width: 16px; height: 16px; }
.tw-tip.is-open .tw-tip-btn { color: var(--ink); background: var(--surface-2); }
.tw-tip-pop {
  display: none; position: absolute; z-index: 60; top: calc(100% + 8px); width: 300px; max-width: calc(100vw - 32px);
  padding: 10px 12px; border-radius: var(--r-md); background: var(--ink); color: #F4F1EE; box-shadow: var(--shadow-pop);
  font-family: var(--font); font-size: 13px; font-weight: var(--fw-regular); line-height: 1.5; letter-spacing: 0;
  text-transform: none; text-align: left; white-space: normal;
}
.tw-tip-p { display: block; }
.tw-tip-p + .tw-tip-p { margin-top: 6px; }
.tw-tip--r .tw-tip-pop { right: -6px; }
.tw-tip--l .tw-tip-pop { left: -6px; }
.tw-tip.is-open .tw-tip-pop { display: block; animation: tw-tip-in var(--t-fast) var(--ease); }
@keyframes tw-tip-in { from { opacity: 0; transform: translateY(-4px); } }
@media (hover: hover) and (pointer: fine) {
  /* .is-weg: met Escape weggestuurd terwijl de muis erop staat; weer hover-baar zodra de muis weggaat. */
  .tw-tip:hover:not(.is-weg) .tw-tip-pop { display: block; }
  .tw-tip-btn:hover { color: var(--ink); }
}

/* Uren tegenover contracturen: groen met vinkje = gehaald, oranje = niet, rood = niets verstuurd, grijs = lopend/geen contracturen. */
.tw-upill {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; flex: none;
  background: var(--surface-2); color: var(--ink-2); font-size: 13px; line-height: 22px; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.tw-upill b { font-weight: var(--fw-bold); }
.tw-upill svg { width: 14px; height: 14px; flex: none; }
.tw-upill--ok { background: var(--ok-soft); color: var(--ok); }
.tw-upill--warn { background: var(--warn-soft); color: var(--warn); }
.tw-upill--danger { background: var(--danger-soft); color: var(--danger); }
.tw-ubar { position: relative; display: block; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.tw-ubar i { position: absolute; inset: 0 auto 0 0; border-radius: 4px; background: var(--ink-2); }
.tw-ubar.is-ok i { background: var(--ok); }
.tw-ubar.is-warn i { background: #E0A030; } /* oranje van de mockup; --warn is te donker voor een vlak */

/* Urenstapper − 40 u + (per halfuur). */
.tw-uren { display: inline-flex; align-items: center; flex: none; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
.tw-uren:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(22, 24, 29, .12); }
.tw-uren button {
  width: 36px; height: 40px; padding: 0; border: 0; background: var(--surface-2); color: var(--ink-2); cursor: pointer;
  font: inherit; font-family: var(--font); font-size: 18px; font-weight: var(--fw-bold); line-height: 1;
}
.tw-uren button:disabled { color: var(--ink-3); cursor: not-allowed; }
.tw-uren button:focus-visible { outline-offset: -2px !important; }
.tw-uren input {
  width: 52px; height: 40px; padding: 0; border: 0; background: transparent; color: var(--ink); text-align: center;
  font: inherit; font-family: var(--font); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums;
}
.tw-uren input:focus, .tw-uren input:focus-visible { outline: none; }
.tw-uren em { padding: 0 10px 0 0; font-style: normal; color: var(--ink-2); }
@media (hover: hover) and (pointer: fine) { .tw-uren button:hover:not(:disabled) { background: var(--line); color: var(--ink); } }

@media (max-width: 640px) {
  /* De uitleg loopt over de volle breedte van de regel (positie t.o.v. de kop of rij), nooit buiten het scherm. */
  .tw-tip { position: static; }
  .tw-tip--l .tw-tip-pop, .tw-tip--r .tw-tip-pop { left: 0; right: 0; width: auto; max-width: none; font-size: 14px; }
  .tw-panel-head, .tw-ios-section { position: relative; }
  .tw-tip-btn::after { content: ""; position: absolute; inset: -8px; } /* 44 × 44 px raakvlak */
  .tw-upill { font-size: 14px; }
  .tw-uren button { width: 44px; height: 44px; }
  .tw-uren input { height: 44px; font-size: 16px; } /* ≥ 16px: geen iOS-zoom */
}
@media (prefers-reduced-motion: reduce) {
  .tw-tip.is-open .tw-tip-pop { animation: none; }
  .tw-tip-btn { transition: none; }
}

/* ---- Onboarding en rondleiding (statussen, Profiel: Weergave en Hulp) ---- */
.ob-statussen { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-md); }
.ob-statussen li + li { border-top: 1px solid var(--line); }
.ob-status { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 14px; cursor: pointer; }
.ob-status input { width: 18px; height: 18px; margin: 0 0 0 auto; accent-color: #E8431F; flex: none; }
.ob-status.is-vast { cursor: default; }
.ob-status .ob-vast { margin-left: auto; font-size: var(--fs-xs); color: var(--ink-2); }
.ob-staal { flex: none; width: 6px; height: 28px; border-radius: 3px; }
.ob-staal--vrij { background: #fff; box-shadow: inset 0 0 0 1px var(--line-strong); }
.ob-staal--voorlopig { background: repeating-linear-gradient(135deg, #3B73C4 0 3px, #fff 3px 6px); box-shadow: inset 0 0 0 1px #3B73C4; }
.ob-staal--bezet { background: #3B73C4; }
.ob-staal--elders { background: radial-gradient(#3B73C4 1px, #fff 1.5px) 0 0 / 4px 4px; box-shadow: inset 0 0 0 1px #3B73C4; }
.ob-staal--afwezig { background: #7B3FA0; }
.ob-groepkop { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-weight: var(--fw-bold); font-size: var(--fs-sm); }
.ob-groep + .ob-groep { margin-top: 24px; }
.ob-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; padding: 0; list-style: none; }
.ob-chip { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 4px 0 12px; border-radius: 16px; background: var(--surface-2); font-size: var(--fs-sm); }
.ob-chip button { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 50%; background: none; cursor: pointer; color: var(--ink-2); }
.ob-chip button:hover { background: rgba(22, 24, 29, .08); color: var(--ink); }
.ob-titelbalk { display: flex; gap: 8px; }
.ob-pf-label { margin: 0 0 8px; }
.ob-pf-statussen { margin-bottom: 20px; }
.ob-pf-seg { display: flex; }
.ob-pf-seg .tw-seg { width: 100%; }
.ob-pf-seg .tw-seg button { flex: 1; }
.ob-pf-hulp { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ob-pf-hulp p { margin: 0; color: var(--ink-2); font-size: var(--fs-sm); }
.ob-pf-hulp .tw-btn svg { width: 16px; height: 16px; }

/* Onboarding: popup in het midden (desktop én gsm), gedimde achtergrond, de pagina eronder scrolt niet */
.ob-scrim { position: fixed; inset: 0; z-index: 900; background: rgba(18, 18, 18, .45); animation: ob-in var(--t-med, .22s) var(--ease, ease-out); }
.ob-scrim.is-diep { background: rgba(18, 18, 18, .72); backdrop-filter: blur(2px); }
html.ob-open, html.ob-open body, html.ob-rondleiding, html.ob-rondleiding body { overflow: hidden; }
@keyframes ob-in { from { opacity: 0; } }
@keyframes ob-op { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.ob-dialog {
  position: fixed; z-index: 910; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 48px);
  display: flex; flex-direction: column; background: var(--surface); color: var(--ink);
  border-radius: 16px; box-shadow: 0 24px 64px rgba(18, 18, 18, .28); outline: none;
}
.ob-dialog.is-breed { width: min(940px, calc(100vw - 32px)); }
.ob-dialog > * { animation: ob-op .26s cubic-bezier(.2, .7, .2, 1); }
.ob-kop { padding: 24px 28px 0; }
.ob-voortgang { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.ob-balkjes { display: flex; gap: 4px; flex: 1; }
.ob-balkjes span { flex: 1; height: 4px; border-radius: 2px; background: var(--surface-2); }
.ob-balkjes span.is-af { background: var(--brand-grad); }
.ob-teller { font-size: var(--fs-xs); color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ob-titel { margin: 0; font-size: 22px; font-weight: var(--fw-bold); line-height: 1.25; letter-spacing: -.01em; }
.ob-sub { margin: 8px 0 0; color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.5; }
.ob-inhoud { padding: 20px 28px 4px; overflow: auto; }
.ob-voet { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 16px 28px 24px; }
.ob-voet .ob-links { margin-right: auto; }
.ob-later { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; padding: 0 28px; color: var(--ink-2); font-size: var(--fs-sm); }
.ob-later svg { width: 16px; height: 16px; flex: none; }
.ob-fout { margin: 8px 0 0; }
.ob-fout:empty { display: none; }
.ob-merk { display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 20px; border-radius: 12px; background: #121212; }
.ob-merk img { height: 22px; display: block; }
.ob-merk span { color: rgba(244, 241, 238, .7); font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: .12em; }
.ob-veld { display: grid; gap: 8px; }
.ob-label { font-weight: var(--fw-bold); font-size: var(--fs-sm); }
.ob-veld .tw-input { width: 100%; text-transform: uppercase; }
.ob-melding { display: flex; gap: 10px; margin-top: 16px; padding: 12px 14px; border-radius: var(--r-md); background: var(--info-soft); font-size: var(--fs-sm); line-height: 1.45; }
.ob-melding svg { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--info); }
.ob-uren-rij { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; }
.ob-titelbalk .tw-input { flex: 1; text-transform: none; }
/* Twinfield-code: drie stappen, met de knop naar Twinfield bij de eerste */
.ob-twinfield { list-style: none; margin: 0 0 20px; padding: 14px 16px; display: grid; gap: 12px; border-radius: var(--r-md); background: var(--surface-2); counter-reset: tf; }
.ob-twinfield li { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; counter-increment: tf; font-size: var(--fs-sm); line-height: 1.45; }
.ob-twinfield li::before { content: counter(tf); display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); font-size: var(--fs-xs); font-weight: var(--fw-bold); }
.ob-twinfield li > span { flex: 1; min-width: 180px; }
.ob-twinfield .tw-btn { gap: 6px; text-decoration: none; }
.ob-twinfield .tw-btn svg { width: 15px; height: 15px; }
.ob-twinfield code { font-size: 13px; }
/* Weergave: desktop twee keuzes met elk een voorbeeld; gsm twee knoppen naast elkaar en één voorbeeld eronder */
.ob-keuzes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ob-keuze, .ob-keuze-gsm { text-align: left; font: inherit; color: inherit; background: var(--surface); cursor: pointer; }
.ob-keuze {
  display: flex; flex-direction: column; gap: 12px; padding: 14px; border: 2px solid var(--line); border-radius: 14px;
  transition: border-color var(--t-fast, .15s) var(--ease, ease), box-shadow var(--t-fast, .15s) var(--ease, ease), transform var(--t-fast, .15s) var(--ease, ease);
}
.ob-keuze:hover { border-color: var(--line-strong); }
.ob-keuze:active { transform: scale(.99); }
.ob-keuze[aria-checked="true"] { border-color: #E8431F; box-shadow: 0 0 0 4px rgba(232, 67, 31, .14); }
.ob-keuze:focus-visible, .ob-keuze-gsm:focus-visible { outline: 2px solid var(--focus, #E8431F); outline-offset: 2px; }
.ob-keuze-kop { display: flex; align-items: flex-start; gap: 10px; }
.ob-radio { flex: none; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; }
:is(.ob-keuze, .ob-keuze-gsm)[aria-checked="true"] .ob-radio { border-color: #E8431F; }
:is(.ob-keuze, .ob-keuze-gsm)[aria-checked="true"] .ob-radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #E8431F; }
.ob-keuze-naam { display: block; font-weight: var(--fw-bold); font-size: var(--fs-md); }
.ob-keuze-uitleg { display: block; color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.45; margin-top: 2px; }
.ob-keuzes-gsm { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.ob-keuze-gsm { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; border: 2px solid var(--line); border-radius: 12px; touch-action: manipulation; }
.ob-keuze-gsm b { display: block; font-size: var(--fs-sm); font-weight: var(--fw-bold); line-height: 1.3; }
.ob-keuze-gsm small { display: block; margin-top: 2px; color: var(--ink-2); font-size: var(--fs-xs); line-height: 1.35; }
.ob-keuze-gsm[aria-checked="true"] { border-color: #E8431F; background: #FFF6F2; }
.ob-venster { position: relative; display: block; height: 300px; overflow: hidden; border-radius: 10px; background: var(--page); box-shadow: inset 0 0 0 1px var(--line); pointer-events: none; }
.ob-venster--gsm { height: 260px; }
.ob-venster::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 48px; background: linear-gradient(transparent, var(--page)); }
.ob-schaal { position: absolute; top: 10px; left: 10px; width: 760px; transform-origin: 0 0; }
.ob-schaal .ob-dagen { display: grid; gap: 16px; }
.ob-schaal .tr-day-head { position: static; }
/* Je profiel is klaar */
.ob-vink { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 16px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); }
.ob-vink svg { width: 26px; height: 26px; stroke-dasharray: 30; stroke-dashoffset: 30; animation: ob-teken .5s .15s cubic-bezier(.2, .7, .2, 1) forwards; }
@keyframes ob-teken { to { stroke-dashoffset: 0; } }
.ob-samenvatting { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-md); }
.ob-samenvatting li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 14px; font-size: var(--fs-sm); }
.ob-samenvatting li + li { border-top: 1px solid var(--line); }
.ob-samenvatting li span:first-child { color: var(--ink-2); white-space: nowrap; }
.ob-samenvatting li span:last-child { font-weight: var(--fw-bold); text-align: right; }
/* Rondleiding: uitsparing (vier dimvlakken + witte rand) en ballon; badge "Voorbeeld" achter de paginatitel */
.ob-dim { position: fixed; z-index: 904; background: rgba(18, 18, 18, .55); }
.ob-spot {
  position: fixed; z-index: 905; border-radius: 12px; pointer-events: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .9);
  transition: top .3s cubic-bezier(.2, .7, .2, 1), left .3s cubic-bezier(.2, .7, .2, 1), width .3s cubic-bezier(.2, .7, .2, 1), height .3s cubic-bezier(.2, .7, .2, 1);
}
.ob-ballon {
  position: fixed; z-index: 912; box-sizing: border-box; width: min(340px, calc(100vw - 32px)); padding: 16px 18px 14px;
  border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: 0 16px 40px rgba(18, 18, 18, .3);
  animation: ob-op .24s cubic-bezier(.2, .7, .2, 1);
}
.ob-ballon h2 { margin: 4px 0 6px; font-size: var(--fs-md); font-weight: var(--fw-bold); }
.ob-ballon p { margin: 0; color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.5; }
.ob-ballon .ob-teller { display: block; }
.ob-ballon-voet { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.ob-ballon-voet .ob-links { margin-right: auto; }
.ob-ballon-voet .tw-btn { min-height: 36px; padding-inline: 14px; }
.ob-voorbeeld { margin-left: 10px; vertical-align: middle; }
@media (max-width: 640px) {
  .ob-ballon-voet .tw-btn { min-height: 44px; }
  .ob-dialog, .ob-dialog.is-breed { width: calc(100vw - 24px); max-height: calc(100dvh - 32px); border-radius: 18px; }
  .ob-kop { padding: 20px 20px 0; }
  .ob-inhoud { padding: 16px 20px 4px; }
  .ob-voet { padding: 12px 20px 20px; }
  .ob-later { padding-inline: 20px; }
  .ob-titel { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .ob-scrim, .ob-dialog > *, .ob-ballon { animation: none; }
  .ob-spot { transition: none; }
  .ob-vink svg { animation: none; stroke-dashoffset: 0; }
}
