/* Kilometervreter - één stylesheet, geen afhankelijkheden.
   Petrolgroen accent op warm papier; zand voor privé-kilometers. */

:root {
  color-scheme: light dark;

  --bg: #f4f2ec;
  --surface: #ffffff;
  --surface-2: #ebe8e0;
  --ink: #13201d;
  --ink-2: #4a5955;
  --ink-3: #7f8b87;
  --line: rgba(19, 32, 29, 0.1);
  --accent: #0b6b5f;
  --accent-hi: #17907f;
  --accent-lo: #074f46;
  --accent-tint: #dcefea;
  --accent-ink: #0a5a50;
  --on-accent: #ffffff;
  --sand: #d39233;
  --sand-tint: #f8ead1;
  --sand-ink: #7a4a06;
  --danger: #b3261e;
  --danger-tint: #fbe9e7;
  --odo: #16231f;
  --odo-ink: #ffffff;
  --shadow: 0 1px 2px rgba(19, 32, 29, 0.04), 0 8px 24px -12px rgba(19, 32, 29, 0.12);
  --glow: rgba(11, 107, 95, 0.45);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-num: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --r-card: 24px;
  --r-btn: 20px;
  --pad: 20px;
  --tabbar: 76px;
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
  --spring: cubic-bezier(0.3, 1.5, 0.5, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1012;
    --surface: #151c1f;
    --surface-2: #1e282c;
    --ink: #edf3f1;
    --ink-2: #aab7b3;
    --ink-3: #7b8985;
    --line: rgba(255, 255, 255, 0.09);
    --accent: #2fbfa9;
    --accent-hi: #63dcc8;
    --accent-lo: #1c9d8a;
    --accent-tint: #10302b;
    --accent-ink: #7fe3d2;
    --on-accent: #03211c;
    --sand: #e5a94b;
    --sand-tint: #33270f;
    --sand-ink: #f2c77f;
    --danger: #ff8a80;
    --danger-tint: #3a1613;
    --odo: #222e33;
    --odo-ink: #ffffff;
    --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 12px 28px -16px rgba(0, 0, 0, 0.6);
    --glow: rgba(47, 191, 169, 0.35);
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 400 18px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

h1, h2, p, dl, dd, ol, fieldset { margin: 0; padding: 0; }
fieldset { border: 0; min-width: 0; }
ol { list-style: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
b { font-weight: 700; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.ic {
  width: 24px; height: 24px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------------------------------------------------------------- opbouw */

#main {
  max-width: 520px;
  margin: 0 auto;
  padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom));
}
body.in-flow #main { padding-bottom: 0; }

.screen {
  padding: calc(env(safe-area-inset-top) + 18px) max(var(--pad), env(safe-area-inset-right)) 28px max(var(--pad), env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: screen-in 0.36s var(--ease) both;
}

@keyframes screen-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.title-bar { padding-top: 6px; }
.title-bar h1 {
  font-size: 34px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.eyebrow {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink-2);
}
.eyebrow--center { text-align: center; font-size: 19px; }

/* ---------------------------------------------------------------- kaarten */

.card {
  background: var(--surface);
  border-radius: var(--r-card);
  padding: 18px 20px 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.card--welcome p { color: var(--ink-2); }

.card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-time { margin-left: auto; font-size: 16px; color: var(--ink-2); }
.card--active { box-shadow: var(--shadow), inset 0 0 0 2px var(--accent-tint); }

.live-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--glow);
  animation: live 2s ease-out infinite;
}
@keyframes live {
  0% { box-shadow: 0 0 0 0 var(--glow); }
  100% { box-shadow: 0 0 0 12px transparent; }
}

.banner {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--accent-tint);
  color: var(--accent-ink);
  font-weight: 600;
  animation: pop 0.45s var(--spring) both;
}
@keyframes pop {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- kilometerteller */

.odo {
  --gap: 5px;
  --avail: calc(min(100vw, 520px) - 2 * var(--pad) - 10px);
  --w: min(58px, calc((var(--avail) - (var(--n) - 1) * var(--gap)) / var(--n)));
  display: flex;
  justify-content: center;
  gap: var(--gap);
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}
.odo--md {
  --gap: 4px;
  --avail: calc(min(100vw, 520px) - 2 * var(--pad) - 40px - 8px);
  --w: min(48px, calc((var(--avail) - (var(--n) - 1) * var(--gap)) / var(--n)));
  justify-content: flex-start;
}
.odo-d {
  position: relative;
  width: var(--w);
  height: calc(var(--w) * 1.38);
  border-radius: calc(var(--w) * 0.22);
  background: var(--odo);
  color: var(--odo-ink);
  font-size: calc(var(--w) * 0.96);
  font-weight: 700;
  line-height: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: 0 6px 14px -8px rgba(0, 0, 0, 0.5);
}
.odo-d::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.34), transparent 28%, transparent 72%, rgba(0, 0, 0, 0.34));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border-radius: inherit;
  pointer-events: none;
}
.odo-d--gap { margin-left: calc(var(--gap) + 3px); }
.odo-d b {
  animation: roll 0.6s var(--ease) both;
  animation-delay: calc(var(--i) * 50ms);
}
@keyframes roll {
  from { transform: translateY(70%); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.unit { text-align: center; font-size: 19px; color: var(--ink-2); font-weight: 600; margin-top: -4px; }

/* ---------------------------------------------------------------- knoppen */

.btn {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
  min-height: 64px;
  padding: 10px 20px;
  border: 0;
  border-radius: var(--r-btn);
  background: var(--surface);
  color: var(--ink);
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.01em;
  box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
  transition: transform 0.15s var(--ease), filter 0.15s;
}
.btn:active { transform: scale(0.975); filter: brightness(0.96); }
.btn[disabled] { opacity: 0.5; }

.btn--primary {
  background: linear-gradient(180deg, var(--accent-hi), var(--accent) 70%);
  background-color: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 12px 24px -12px var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.btn--xl { min-height: 78px; font-size: 24px; border-radius: 24px; }
.btn--xl .ic { width: 30px; height: 30px; stroke-width: 2.4; }

.btn--danger { background: var(--danger); color: #fff; box-shadow: none; }
@media (prefers-color-scheme: dark) { .btn--danger { color: #2b0906; } }
.btn--danger-quiet { background: transparent; color: var(--danger); box-shadow: none; }
.btn--quiet { background: transparent; box-shadow: none; color: var(--ink-2); font-size: 18px; font-weight: 600; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 5px; }

.btn--stop {
  width: auto;
  min-height: 52px;
  padding: 8px 20px 8px 14px;
  border-radius: 26px;
  font-size: 18px;
}
.btn--stop::before { content: ""; position: absolute; inset: -6px; } /* raakvlak 64px */

.link {
  border: 0; background: none; padding: 0 2px;
  min-height: 48px;
  color: var(--accent-ink);
  font-size: 17px; font-weight: 600;
}

.stack { display: flex; flex-direction: column; gap: 10px; }

/* ---------------------------------------------------------------- de microfoonknop */

.mic-wrap {
  --size: 168px;
  position: relative;
  width: var(--size);
  height: var(--size);
  flex: none;
}
.mic-wrap--xl { --size: 212px; }
.mic-wrap--md { --size: 112px; }

.mic {
  position: absolute; inset: 0;
  border: 0; padding: 0;
  border-radius: 50%;
  background: var(--surface);
  color: var(--on-accent);
  box-shadow: 0 22px 44px -18px var(--glow), 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s var(--ease), color 0.35s, box-shadow 0.35s;
  isolation: isolate;
}
.mic::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(120% 120% at 28% 18%, var(--accent-hi), transparent 58%),
    linear-gradient(180deg, var(--accent), var(--accent-lo));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), inset 0 -10px 24px rgba(0, 0, 0, 0.14);
  transition: opacity 0.4s var(--ease);
  z-index: -1;
}
.mic:active { transform: scale(0.955); }

.mic-face {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.3s var(--ease), transform 0.4s var(--spring);
}
.mic-face .ic { width: 38%; height: 38%; stroke-width: 1.7; }
.mic-wrap--xl .mic-face { inset: 0 0 20% 0; }
.mic-wrap--xl .mic-face .ic { width: 34%; height: 44%; stroke-width: 1.6; }

.mic-label {
  position: absolute; left: 0; right: 0; bottom: 19%;
  text-align: center;
  font-size: 26px; font-weight: 750; letter-spacing: -0.02em;
}

[data-state="idle"] .mic-face--idle,
[data-state="listening"] .mic-face--listening,
[data-state="speaking"] .mic-face--speaking,
[data-state="thinking"] .mic-face--thinking { opacity: 1; transform: none; }

/* praten en denken: rustige, lichte knop */
[data-state="speaking"] .mic,
[data-state="thinking"] .mic {
  color: var(--accent);
  box-shadow: 0 14px 30px -18px rgba(0, 0, 0, 0.3), inset 0 0 0 2px var(--accent-tint);
}
[data-state="speaking"] .mic::before,
[data-state="thinking"] .mic::before { opacity: 0; }

.mic-face--speaking .w1 { animation: talk 1.1s ease-in-out infinite; }
.mic-face--speaking .w2 { animation: talk 1.1s ease-in-out 0.22s infinite; }
@keyframes talk { 0%, 100% { opacity: 0.2; } 50% { opacity: 1; } }

/* luisteren: golfjes in de knop, zachte ringen eromheen */
.wave { display: flex; align-items: center; gap: 6%; width: 46%; height: 40%; }
.wave i {
  flex: 1; height: 100%;
  border-radius: 99px;
  background: currentColor;
  transform: scaleY(0.25);
}
[data-state="listening"] .wave i { animation: wave 1.05s ease-in-out infinite; }
.wave i:nth-child(1) { animation-delay: -0.9s !important; }
.wave i:nth-child(2) { animation-delay: -0.3s !important; }
.wave i:nth-child(3) { animation-delay: -0.6s !important; }
.wave i:nth-child(4) { animation-delay: -0.1s !important; }
.wave i:nth-child(5) { animation-delay: -0.75s !important; }
@keyframes wave { 0%, 100% { transform: scaleY(0.22); } 50% { transform: scaleY(1); } }

.ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  pointer-events: none;
}
[data-state="listening"] .ring { animation: ring 2.4s cubic-bezier(0.2, 0.6, 0.3, 1) infinite; }
[data-state="listening"] .ring--2 { animation-delay: 0.8s; }
[data-state="listening"] .ring--3 { animation-delay: 1.6s; }
@keyframes ring {
  0% { transform: scale(0.92); opacity: 0.3; }
  100% { transform: scale(1.7); opacity: 0; }
}

/* beginscherm: stille halo die langzaam ademt */
.mic-wrap--xl .ring--1 { opacity: 0.1; transform: scale(1.16); animation: breathe 4.5s ease-in-out infinite; }
.mic-wrap--xl .ring--2 { opacity: 0.05; transform: scale(1.36); animation: breathe 4.5s ease-in-out 0.4s infinite; }
@keyframes breathe { 50% { transform: scale(1.24); } }
.mic-wrap--xl .ring--2 { animation-name: breathe-2; }
@keyframes breathe-2 { 50% { transform: scale(1.46); } }

.dots { display: flex; gap: 14%; width: 42%; justify-content: center; }
.dots i {
  width: 22%; aspect-ratio: 1;
  border-radius: 50%;
  background: currentColor;
  animation: dots 1s ease-in-out infinite;
}
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dots { 0%, 100% { transform: translateY(20%); opacity: 0.35; } 40% { transform: translateY(-35%); opacity: 1; } }

/* ---------------------------------------------------------------- beginscherm */

.hero {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px;
  padding: 44px 0 8px;
}
.hero-hint {
  margin-top: 40px;
  max-width: 18em;
  text-align: center;
  font-size: 19px;
  color: var(--ink-2);
}
.hero .btn--quiet { width: auto; }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 0 4px 8px;
}
.section-head h2 { font-size: 22px; font-weight: 750; letter-spacing: -0.02em; }
.section-km { font-size: 17px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- ritten */

.trips {
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.trip {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto 16px;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 84px;
  padding: 12px 12px 12px 14px;
  border: 0;
  background: none;
  text-align: left;
  position: relative;
  transition: background-color 0.15s;
}
.trip:active { background: var(--surface-2); }
.trip + .trip::before {
  content: ""; position: absolute; top: 0; left: 76px; right: 0; height: 1px; background: var(--line);
}
.trip--new { animation: flash 2.4s ease-out both; }
@keyframes flash { 0%, 40% { background: var(--accent-tint); } 100% { background: transparent; } }

.trip-date {
  display: grid; place-items: center; align-content: center;
  width: 50px; height: 56px;
  border-radius: 16px;
  background: var(--surface-2);
  line-height: 1.05;
}
.trip-date b { font: 750 22px/1 var(--font-num); font-variant-numeric: tabular-nums; }
.trip-date span { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-top: 3px; }

.trip-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.trip-read {
  display: flex; align-items: center; gap: 6px;
  font-size: 18px; font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ic--arrow { width: 18px; height: 18px; color: var(--ink-3); }
.trip-meta { font-size: 15px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.trip-note { font-size: 15px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.trip-side { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.trip-km { font: 750 24px/1 var(--font-num); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.trip-km small { font: 600 15px var(--font); color: var(--ink-2); letter-spacing: 0; }
.ic--chev { width: 16px; height: 16px; color: var(--ink-3); stroke-width: 2.4; }

.badge {
  display: inline-block;
  padding: 3px 10px 4px;
  border-radius: 99px;
  font-size: 14px; font-weight: 700; line-height: 1.2;
  white-space: nowrap;
}
.badge--business { background: var(--accent-tint); color: var(--accent-ink); }
.badge--private { background: var(--sand-tint); color: var(--sand-ink); }

/* ---------------------------------------------------------------- het gesprek (stappen) */

.screen--step, .screen--saved {
  min-height: 100vh;
  min-height: 100dvh;
  gap: 0;
  padding-bottom: calc(env(safe-area-inset-bottom) + 20px);
}

.step-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.progress { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.progress-label { font-size: 15px; font-weight: 600; color: var(--ink-2); }
.pips { display: flex; gap: 5px; }
.pips i { width: 22px; height: 5px; border-radius: 3px; background: var(--surface-2); transition: background-color 0.3s; }
.pips i.on { background: var(--accent); }

.step-body {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 14px;
  /* Vast vanaf boven: de knop verspringt niet als er tekst bij komt. */
  padding: clamp(12px, 7vh, 64px) 0 20px;
  text-align: center;
}
.step-display { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }

.question {
  font-size: clamp(28px, 8.2vw, 36px);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-wrap: balance;
  max-width: 11em;
}
.context { font-size: 18px; color: var(--ink-2); }
.context b { color: var(--ink); font-variant-numeric: tabular-nums; }

.step-voice { display: flex; flex-direction: column; align-items: center; gap: 16px; padding-top: 22px; }
[data-step$="-km"] .step-voice { padding-top: 40px; gap: 34px; }

.status {
  position: relative; z-index: 1;
  min-height: 1.5em;
  font-size: 19px; font-weight: 600;
  color: var(--ink-2);
  transition: color 0.3s;
}
.status[data-state="listening"] { color: var(--accent-ink); font-size: 22px; font-weight: 750; }

.heard {
  max-width: 100%;
  padding: 10px 16px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 20px; font-weight: 600;
  overflow-wrap: anywhere;
  animation: pop 0.3s var(--ease) both;
}
.heard span { display: block; font-size: 14px; font-weight: 600; color: var(--ink-2); }

.msg {
  max-width: 22em;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 18px; font-weight: 550;
  text-align: left;
  background: var(--surface-2);
  animation: pop 0.3s var(--ease) both;
}
.msg--error { background: var(--danger-tint); color: var(--danger); }
@media (prefers-color-scheme: light) { .msg--error { color: #8c1d18; } }

.warn {
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--sand-tint);
  color: var(--sand-ink);
  font-size: 18px; font-weight: 650;
}

.bignum {
  display: flex; align-items: baseline; justify-content: center; gap: 10px;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  line-height: 0.95;
}
.bignum b {
  font-size: clamp(88px, 31vw, 136px);
  font-weight: 800;
  letter-spacing: -0.045em;
  animation: num-in 0.55s var(--spring) both;
}
.bignum span { font-size: 30px; font-weight: 700; color: var(--ink-2); }
@keyframes num-in { from { opacity: 0; transform: translateY(18px) scale(0.92); } to { opacity: 1; transform: none; } }

.fromto {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  border-radius: 99px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 19px; font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.step-actions { display: flex; flex-direction: column; gap: 12px; }

.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn--choice {
  flex-direction: column; gap: 10px;
  min-height: 128px;
  border-radius: 26px;
  font-size: 23px;
}
.btn--choice .ic { width: 38px; height: 38px; stroke-width: 1.7; }
.btn--choice[data-type="business"] .ic { color: var(--accent); }
.btn--choice[data-type="private"] .ic { color: var(--sand); }

.manual { display: flex; flex-direction: column; gap: 8px; animation: pop 0.3s var(--ease) both; }
.manual label { font-size: 16px; font-weight: 600; color: var(--ink-2); padding-left: 4px; }
.manual-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.manual-row .btn { width: auto; min-height: 68px; padding: 10px 26px; }

input[type="text"], select {
  width: 100%;
  min-height: 64px;
  padding: 8px 18px;
  border: 0;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--line);
  font-size: 22px;
  transition: box-shadow 0.2s;
  appearance: none;
  -webkit-appearance: none;
}
input[type="text"]:focus, select:focus { outline: none; box-shadow: inset 0 0 0 3px var(--accent); }
input::placeholder { color: var(--ink-3); opacity: 1; }
[data-km-input] {
  min-height: 68px;
  font: 750 30px var(--font-num);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

/* ---------------------------------------------------------------- opgeslagen */

.saved {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 24px 0;
}
.saved h1 { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; animation: num-in 0.5s var(--ease) 0.35s both; }
.saved .bignum b { animation-delay: 0.45s; }
.saved .bignum span, .saved-type, .saved .fromto { animation: num-in 0.5s var(--ease) 0.6s both; }
.saved .badge { font-size: 18px; padding: 6px 16px 7px; }

.saved-check { width: 112px; height: 112px; overflow: visible; margin-bottom: 6px; }
.saved-disc {
  fill: var(--accent);
  transform-origin: 48px 48px;
  animation: disc 0.6s var(--spring) both;
  filter: drop-shadow(0 14px 18px var(--glow));
}
.saved-tick {
  fill: none; stroke: var(--on-accent); stroke-width: 8; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 58; stroke-dashoffset: 58;
  animation: tick 0.45s var(--ease) 0.35s forwards;
}
@keyframes disc { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes tick { to { stroke-dashoffset: 0; } }

/* ---------------------------------------------------------------- overzicht */

.years { display: flex; gap: 8px; overflow-x: auto; padding: 2px; margin: -2px; scrollbar-width: none; }
.years::-webkit-scrollbar { display: none; }
.year {
  flex: none;
  min-width: 92px; min-height: 64px;
  padding: 8px 20px;
  border: 0; border-radius: 20px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  font: 700 20px var(--font-num);
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
  transition: background-color 0.2s, color 0.2s;
}
.year.on { background: var(--ink); color: var(--bg); box-shadow: none; }

.totals {
  background: var(--surface);
  border-radius: 28px;
  padding: 22px 22px 20px;
  box-shadow: var(--shadow);
}
.totals-num {
  display: flex; align-items: baseline; gap: 8px;
  margin-top: 2px;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}
.totals-num b { font-size: clamp(56px, 17vw, 72px); font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; }
.totals-num span { font-size: 24px; font-weight: 700; color: var(--ink-2); }
.totals-count { font-size: 17px; color: var(--ink-2); }

.split {
  display: flex; gap: 4px;
  height: 16px;
  margin: 20px 0 16px;
  border-radius: 8px;
  background: var(--surface-2);
  overflow: hidden;
  animation: grow 0.8s var(--ease) 0.1s both;
  transform-origin: left center;
}
.split span { min-width: 8px; border-radius: 3px; }
.split span[style="flex-grow:0"] { display: none; }
.split-b { background: linear-gradient(90deg, var(--accent-lo), var(--accent-hi)); }
.split-p { background: var(--sand); }
@keyframes grow { from { clip-path: inset(0 100% 0 0 round 8px); } to { clip-path: inset(0 0 0 0 round 8px); } }

.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.legend dt { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 600; color: var(--ink-2); }
.legend dd { font: 750 28px/1.2 var(--font-num); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.legend dd small { font: 600 16px var(--font); color: var(--ink-2); letter-spacing: 0; }
.dot { width: 12px; height: 12px; border-radius: 4px; }
.dot--business { background: var(--accent); }
.dot--private { background: var(--sand); }

.footnote { font-size: 16px; color: var(--ink-2); text-align: center; padding: 0 12px; }

.empty {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 36px 12px 12px;
  text-align: center;
}
.empty h2 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.empty p { color: var(--ink-2); max-width: 19em; margin-bottom: 12px; }
.empty-art { width: 240px; height: 144px; fill: none; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 8px; }
.art-road { stroke: var(--surface-2); stroke-width: 14; }
.art-dash { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 10 12; }
.art-line { stroke: var(--ink); stroke-width: 3; fill: var(--surface); }
.art-wheel { stroke: var(--ink); stroke-width: 3; fill: var(--bg); }

/* ---------------------------------------------------------------- instellingen */

.group {
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.group-title {
  font-size: 15px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ink-2);
  padding: 16px 18px 4px;
}
.howto .group-title { padding: 4px 4px 10px; }

.row {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  width: 100%;
  min-height: 76px;
  padding: 12px 16px;
  border: 0; background: none;
  text-align: left;
  transition: background-color 0.15s;
}
button.row:active { background: var(--surface-2); }
.row[disabled] { opacity: 0.55; }
.row + .row::before, .row + input + .row::before {
  content: ""; position: absolute; top: 0; left: 72px; right: 0; height: 1px; background: var(--line);
}
.row-icon {
  display: grid; place-items: center;
  width: 44px; height: 44px; flex: none;
  border-radius: 14px;
  background: var(--accent-tint);
  color: var(--accent-ink);
}
.row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.row-text b { font-size: 19px; font-weight: 650; letter-spacing: -0.01em; }
.row-text small { font-size: 15.5px; color: var(--ink-2); }
.row--select select { width: auto; min-width: 120px; min-height: 52px; background: var(--surface-2); box-shadow: none; font-weight: 700; text-align: center; }

.switch {
  flex: none;
  width: 60px; height: 36px;
  border-radius: 18px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  padding: 3px;
  transition: background-color 0.25s;
}
.switch i {
  display: block; width: 30px; height: 30px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: transform 0.3s var(--spring);
}
[aria-checked="true"] .switch { background: var(--accent); box-shadow: none; }
[aria-checked="true"] .switch i { transform: translateX(24px); }

.notice {
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--sand-tint);
  color: var(--sand-ink);
  font-size: 17px; font-weight: 550;
}

.steps { display: flex; flex-direction: column; gap: 4px; counter-reset: step; margin-bottom: 16px; }
.steps li {
  counter-increment: step;
  position: relative;
  display: flex; flex-direction: column;
  padding: 8px 0 12px 58px;
  min-height: 56px;
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 6px;
  display: grid; place-items: center;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--ink); color: var(--bg);
  font: 750 19px var(--font-num);
}
.steps li:not(:last-child)::after {
  content: ""; position: absolute; left: 20px; top: 52px; bottom: -2px; width: 2px; border-radius: 1px; background: var(--line);
}
.steps b { font-size: 19px; }
.steps span { color: var(--ink-2); font-size: 17px; }

/* ---------------------------------------------------------------- tabbalk */

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  z-index: 10;
  display: flex; justify-content: center;
  padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  backdrop-filter: saturate(1.6) blur(18px);
  box-shadow: 0 -1px 0 var(--line);
  transition: transform 0.35s var(--ease), opacity 0.25s;
}
body.in-flow .tabbar { transform: translateY(110%); opacity: 0; pointer-events: none; }

.tab {
  flex: 1; max-width: 170px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 64px;
  border: 0; background: none;
  border-radius: 18px;
  color: var(--ink-2);
  font-size: 14px; font-weight: 650;
  transition: color 0.2s;
}
.tab svg {
  width: 28px; height: 28px;
  fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
  transition: transform 0.3s var(--spring);
}
.tab[aria-current="page"] { color: var(--accent-ink); }
.tab[aria-current="page"] svg { transform: translateY(-1px) scale(1.08); stroke-width: 2.2; }

/* ---------------------------------------------------------------- dialogen en meldingen */

.dialog {
  width: 100%; max-width: 520px;
  max-height: 92dvh;
  margin: auto auto 0;
  padding: 26px var(--pad) calc(20px + env(safe-area-inset-bottom));
  border: 0;
  border-radius: 30px 30px 0 0;
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.3);
  overflow-y: auto;
}
.dialog[open] { animation: sheet 0.36s var(--ease) both; }
.dialog::backdrop { background: rgba(8, 14, 13, 0.5); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fade 0.3s both; }
@keyframes sheet { from { transform: translateY(40%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.dialog form { display: flex; flex-direction: column; gap: 14px; }
.dialog h2 { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }
.dialog p { color: var(--ink-2); }
.dialog .stack { margin-top: 8px; }
.muted { color: var(--ink-2); margin-top: -8px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .field > legend { font-size: 16px; font-weight: 600; color: var(--ink-2); padding: 0 4px 6px; }
.field > span { padding-bottom: 0; }
.field input[inputmode="numeric"] { font: 700 26px var(--font-num); font-variant-numeric: tabular-nums; }

.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; border-radius: 22px; background: var(--surface-2); }
.segmented label { position: relative; display: block; }
.segmented input { position: absolute; inset: 0; opacity: 0; margin: 0; }
.segmented span {
  display: grid; place-items: center;
  min-height: 60px;
  border-radius: 17px;
  font-size: 20px; font-weight: 650;
  color: var(--ink-2);
  transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
}
.segmented input:checked + span { background: var(--accent); color: var(--on-accent); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14); }
.segmented input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 14px);
  z-index: 30;
  transform: translateX(-50%);
  width: max-content; max-width: min(92vw, 480px);
  padding: 14px 22px;
  border-radius: 99px;
  background: var(--ink); color: var(--bg);
  font-size: 18px; font-weight: 600;
  text-align: center;
  box-shadow: 0 16px 36px -12px rgba(0, 0, 0, 0.45);
  animation: toast 0.4s var(--spring) both;
}
.toast--error { background: var(--danger); color: #fff; border-radius: 22px; }
@media (prefers-color-scheme: dark) { .toast--error { color: #2b0906; } }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 16px) scale(0.95); } to { opacity: 1; transform: translateX(-50%); } }

/* ---------------------------------------------------------------- rust voor wie dat wil */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  /* Luisteren blijft zichtbaar zonder beweging. */
  [data-state="listening"] .ring { animation: none; }
  [data-state="listening"] .ring--1 { opacity: 0.22; transform: scale(1.18); }
  [data-state="listening"] .ring--2 { opacity: 0.1; transform: scale(1.38); }
  [data-state="listening"] .wave i { animation: none; }
  .wave i:nth-child(1), .wave i:nth-child(5) { transform: scaleY(0.4); }
  .wave i:nth-child(2), .wave i:nth-child(4) { transform: scaleY(0.75); }
  .wave i:nth-child(3) { transform: scaleY(1); }
  .mic-wrap--xl .ring { animation: none; }
  .dots i { animation: none; opacity: 0.8; }
  .mic-face--speaking .w1, .mic-face--speaking .w2 { animation: none; opacity: 1; }
  .saved-tick { stroke-dashoffset: 0; }
}

/* Kleine telefoons: iets compacter, raakvlakken blijven groot. */
@media (max-height: 700px) {
  .mic-wrap { --size: 148px; }
  .mic-wrap--md { --size: 96px; }
  .mic-wrap--xl { --size: 184px; }
  .hero { padding-top: 28px; }
  .hero-hint { margin-top: 30px; }
  [data-step$="-km"] .step-voice { padding-top: 20px; gap: 26px; }
  .step-bar { min-height: 56px; }
  .step-body { padding-top: 6px; gap: 8px; }
  .step-display { gap: 8px; }
  .step-voice { padding-top: 8px; gap: 10px; }
  .question { font-size: 27px; }
  .status { font-size: 17px; }
  .bignum b { font-size: 84px; }
  .btn--xl { min-height: 70px; }
}
