/* Layout: a single-column phone app (max 520px) with a bottom tab bar; on desktop it sits centred on a quiet ground. */
:root {
  --bg: #EEF2EE;
  --surface: #FFFFFF;
  --surface-2: #F3F6F3;
  --ink: #17251F;
  --muted: #5E6E66;
  --line: #DCE5DE;
  --green: #1F4E3D;
  --green-ink: #FFFFFF;
  --green-soft: #DCEBE1;
  --orange: #D9661A;
  --orange-soft: #FCE7D6;
  --t-wandelen: #2E7D5B; --t-lopen: #C2571B; --t-padel: #2B6CB0; --t-fietsen: #7B5BB5; --t-stretch: #B23E73;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1512; --surface: #16201B; --surface-2: #1C2923; --ink: #E6EEE9; --muted: #9AACA2; --line: #2A3A32;
    --green: #7CC4A0; --green-ink: #0E1512; --green-soft: #1F3A2E; --orange: #F08A3E; --orange-soft: #3A2616;
    --t-wandelen: #6CC79A; --t-lopen: #F0925A; --t-padel: #74A9E8; --t-fietsen: #B49BE6; --t-stretch: #E883B3; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1512; --surface: #16201B; --surface-2: #1C2923; --ink: #E6EEE9; --muted: #9AACA2; --line: #2A3A32;
  --green: #7CC4A0; --green-ink: #0E1512; --green-soft: #1F3A2E; --orange: #F08A3E; --orange-soft: #3A2616;
  --t-wandelen: #6CC79A; --t-lopen: #F0925A; --t-padel: #74A9E8; --t-fietsen: #B49BE6; --t-stretch: #E883B3; color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
/* Telefoon-app-opbouw: de pagina zelf scrolt nooit. Alleen het middenstuk (.main) scrolt;
   de balk onderaan is het onderste stuk van het scherm, daaronder komt niets meer. */
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; touch-action: manipulation; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
button, input { font: inherit; color: inherit; }
/* iPhone zoomt automatisch in bij tekstvakken kleiner dan 16px; daarna staat de pagina scheef */
input, textarea, select { font-size: 16px; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.app { max-width: 520px; margin: 0 auto; height: 100vh; height: 100dvh; background: var(--surface); display: flex; flex-direction: column; position: relative; }
.main { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding-block: calc(18px + env(safe-area-inset-top, 0px)) 40px; min-width: 0; padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 16px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
h1 { font-size: 26px; font-weight: 800; margin: 2px 0 0; letter-spacing: -.01em; text-wrap: balance; }
h2 { font-size: 15px; font-weight: 800; margin: 6px 0 0; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.banner { background: var(--orange-soft); border-radius: 14px; padding: 12px 14px; font-size: 13px; line-height: 1.45; }
.banner b { display: block; margin-bottom: 2px; }

/* cards */
.day { display: flex; flex-direction: column; gap: 10px; }
.card { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px; border-radius: 18px;
  background: var(--surface-2); border: 1px solid var(--line); text-align: left; width: 100%; }
.card.past { opacity: .62; }
.card.mine { border-color: var(--green); }
.ticon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: #fff; }
.ticon svg { width: 24px; height: 24px; }
.cmeta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ctitle { font-weight: 800; font-variant-numeric: tabular-nums; }
.csub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cgoing { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--green); }
.avs { display: inline-flex; }
.avs span { width: 22px; height: 22px; border-radius: 50%; color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--surface-2); margin-left: -6px; }
.avs span:first-child { margin-left: 0; }
.pill { border: 0; border-radius: 999px; padding: 9px 14px; font-weight: 800; font-size: 13px; white-space: nowrap; }
.pill.join { background: var(--green); color: var(--green-ink); }
.pill.in { background: var(--green-soft); color: var(--green); }
.pill.full { background: var(--line); color: var(--muted); }
.empty { border: 1.5px dashed var(--line); border-radius: 18px; padding: 22px 18px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }

/* buttons & form */
.primary { background: var(--green); color: var(--green-ink); border: 0; border-radius: 14px; padding: 15px; font-weight: 800; font-size: 16px; width: 100%; }
.secondary { background: transparent; border: 1.5px solid var(--line); border-radius: 14px; padding: 13px; font-weight: 700; width: 100%; }
.danger { background: transparent; border: 0; color: #B3402A; font-weight: 700; padding: 10px; }
.back { border: 0; background: transparent; font-weight: 800; color: var(--green); padding: 6px 0; align-self: flex-start; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > span { font-size: 13px; font-weight: 700; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; padding: 9px 13px; font-weight: 700; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 6px; }
.chip svg { width: 18px; height: 18px; }
.chip[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: var(--green-ink); }
.othertime { padding: 4px 6px 4px 13px; color: var(--muted); cursor: text; }
.othertime input { border: 0; background: var(--surface-2); border-radius: 8px; padding: 4px 6px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); width: 76px; min-width: 0; }
#cdur { width: 66px; text-align: center; }
.othertime .unit { font-size: 13px; }
/* geldig = groen, onmogelijk = rood */
.othertime.on { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.othertime.on input { background: var(--surface); }
.othertime.bad { border-color: #C0392B; background: #FBE3DE; color: #9B2C17; }
.othertime.bad input { background: #fff; color: #9B2C17; }

/* uitschuifpaneel: "Andere sport" en "Andere datum" */
.sheet-wrap { position: fixed; inset: 0; z-index: 45; display: flex; align-items: flex-end; justify-content: center; background: rgba(10, 20, 15, .35); }
.sheet { width: 100%; max-width: 520px; max-height: 88vh; max-height: 88dvh; background: var(--surface); border-radius: 22px 22px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 12px; box-shadow: 0 -10px 40px rgba(0,0,0,.2); animation: sheetup .25s ease-out; }
@keyframes sheetup { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; font-size: 17px; }
.sheet-list { overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 2px; margin: 0 -6px; min-height: 0; flex: 1; }
.sport-i { display: flex; align-items: center; gap: 12px; border: 0; background: transparent; padding: 7px 6px; border-radius: 12px; text-align: left; font-weight: 700; width: 100%; }
.sport-i:hover, .sport-i:focus-visible { background: var(--surface-2); }
.sport-i .ticon { width: 34px; height: 34px; border-radius: 10px; flex: none; }
.sport-i .ticon svg { width: 19px; height: 19px; }
.sport-i.own { color: var(--orange); }
.cal-head { display: flex; align-items: center; justify-content: space-between; text-transform: capitalize; }
.cal-nav { width: 40px; height: 40px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); font-size: 20px; font-weight: 800; color: var(--green); }
.cal-nav:disabled { opacity: .35; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; }
.cal-w { font-size: 12px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.cal-d { aspect-ratio: 1; border-radius: 12px; border: 0; background: var(--surface-2); font-weight: 800; font-variant-numeric: tabular-nums; display: grid; place-items: center; font-size: 15px; }
.cal-d.today { box-shadow: inset 0 0 0 2px var(--orange); }
.cal-d.sel { background: var(--green); color: var(--green-ink); }
.cal-d.off { background: transparent; color: var(--line); font-weight: 600; }
.card.new { box-shadow: 0 0 0 3px var(--orange-soft); border-color: var(--orange); }

/* longen */
.lungs { background: var(--surface-2); border: 1px solid var(--line); border-radius: 20px; padding: 16px; display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 14px; align-items: center; }
.lungs svg { width: 130px; height: auto; display: block; overflow: visible; }
.lungs .breathe { transform-origin: 100px 100px; animation: breathe 4.5s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }
@media (prefers-reduced-motion: reduce) { .lungs .breathe { animation: none; } }
.lungs .lfill { transition: y .9s ease, height .9s ease; }
.lungs .pct { font-size: 30px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; color: var(--green); }
.lungs .lmeta { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lungs .lnext { font-size: 13px; font-weight: 700; }
.lungs .mine-bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.lungs .mine-bar > i { display: block; height: 100%; background: var(--orange); border-radius: 999px; }
.text { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; width: 100%; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* detail */
.hero { display: flex; gap: 14px; align-items: center; }
.hero .ticon { width: 58px; height: 58px; border-radius: 18px; }
.hero .ticon svg { width: 30px; height: 30px; }
.bigtime { font-size: 40px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; color: var(--green); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fact { background: var(--surface-2); border-radius: 14px; padding: 11px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fact small { color: var(--muted); font-size: 12px; font-weight: 600; }
.fact b { font-size: 15px; overflow-wrap: anywhere; }
.people { display: flex; flex-direction: column; gap: 8px; }
.person { display: flex; align-items: center; gap: 10px; }
.av { width: 34px; height: 34px; border-radius: 50%; color: #fff; font-weight: 800; font-size: 13px; display: grid; place-items: center; flex: none; }
.person small { color: var(--muted); display: block; }
.status { border-radius: 12px; padding: 10px 12px; font-size: 13px; font-weight: 700; }
.status.ok { background: var(--green-soft); color: var(--green); }
/* uitleg web-app op het beginscherm */
.install { border: 1.5px solid var(--green); }
.install .linkbtn { flex: none; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.4; }
.inl { width: 16px; height: 16px; vertical-align: -3px; display: inline-block; }
/* profielfoto in plaats van initialen */
.av, .avs span { overflow: hidden; }
.av img, .avs span img { width: 100%; height: 100%; object-fit: cover; display: block; }
.av-lg { width: 52px; height: 52px; font-size: 18px; cursor: pointer; }
label.pill { cursor: pointer; display: inline-block; }
.vh { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.box { background: var(--surface-2); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }

/* samen */
.goal { background: var(--green); color: var(--green-ink); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.goal .num { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.bar { height: 10px; border-radius: 999px; background: rgba(255,255,255,.25); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--orange); border-radius: 999px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--surface-2); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat small { font-size: 12px; color: var(--muted); font-weight: 600; line-height: 1.3; }
.badges { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.badge { border: 1.5px solid var(--line); border-radius: 16px; padding: 12px; display: flex; gap: 10px; align-items: flex-start; }
.badge .medal { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--line); color: var(--muted); }
.badge.on { border-color: transparent; background: var(--orange-soft); }
.badge.on .medal { background: var(--orange); color: #fff; }
.badge b { display: block; font-size: 14px; }
.badge span { font-size: 12px; color: var(--muted); line-height: 1.35; }
.badge:not(.on) b { color: var(--muted); }
/* beloning die zich vult (in plaats van de longen) */
.reward { background: var(--surface-2); border: 1px solid var(--line); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.reward .rpic { width: 170px; max-width: 60%; }
.rart { width: 100%; height: auto; display: block; overflow: visible; }
.rart .lfill { transition: y .9s ease, height .9s ease; }
.reward .rmeta { display: flex; flex-direction: column; gap: 6px; align-items: center; width: 100%; }
.reward .rname { font-size: 18px; font-weight: 800; text-wrap: balance; }
.reward .lnext { font-size: 14px; font-weight: 700; }
.reward .rbar { width: 100%; max-width: 280px; height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.reward .rbar > i { display: block; height: 100%; background: var(--orange); border-radius: 999px; transition: width .9s ease; }
.reward .rdone { font-size: 16px; font-weight: 800; color: var(--orange); }
.reward.done { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-soft); }
.reward.done .rpic { animation: party 1.6s ease-in-out 2; }
@keyframes party { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-4deg) scale(1.04); } 75% { transform: rotate(4deg) scale(1.04); } }
@media (prefers-reduced-motion: reduce) { .reward.done .rpic { animation: none; } }
.rprev { border-top: 1px solid var(--line); padding-top: 10px; margin: 10px 0 14px; }
.rprev-in { display: flex; gap: 12px; align-items: center; }
.rprev-in .rart { width: 84px; flex: none; }
.celebrate .medal svg { width: 28px; height: 28px; }
/* felicitatie bij een nieuwe badge */
.celebrate { position: fixed; left: 50%; top: calc(12px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); z-index: 50; width: calc(100% - 32px); max-width: 488px;
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--orange); color: #fff; box-shadow: 0 12px 30px rgba(217,102,26,.35); }
.celebrate .medal { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.22); display: grid; place-items: center; flex: none; }
.celebrate b { font-size: 15px; }
.celebrate.show { animation: pop .5s cubic-bezier(.2,.9,.3,1.4); }
@keyframes pop { from { transform: translate(-50%, -20px) scale(.9); opacity: 0; } to { transform: translate(-50%, 0) scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .celebrate.show { animation: none; } }
/* aantal badges naast een naam (geen ranglijst) */
.bcount { display: inline-flex; align-items: center; gap: 2px; margin-left: 6px; padding: 1px 7px 1px 5px; border-radius: 999px; background: var(--orange-soft); color: var(--orange); font-size: 12px; font-weight: 800; vertical-align: 1px; font-variant-numeric: tabular-nums; }
.bcount svg { width: 13px; height: 13px; }

/* nav */
/* de balk is gewoon het laatste stuk van de app (geen zwevende balk meer); hij loopt door tot de onderrand van het scherm */
.nav { position: relative; flex: none; width: 100%; background: var(--surface); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; z-index: 10;
  padding: 8px max(18px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px)); }
.tab { border: 0; background: transparent; font-weight: 800; font-size: 13px; color: var(--muted); padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tab svg { width: 22px; height: 22px; }
.tab[aria-current="page"] { color: var(--green); }
.add { width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--orange); color: #fff; display: grid; place-items: center; margin-top: -26px; box-shadow: 0 8px 20px rgba(217,102,26,.35); }
.add svg { width: 28px; height: 28px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(92px + env(safe-area-inset-bottom, 0px)); width: calc(100% - 32px); max-width: 488px;
  background: var(--ink); color: var(--surface); padding: 12px 14px; border-radius: 14px; font-weight: 700; font-size: 14px; z-index: 20; }
.loading { padding: 40px 0; text-align: center; color: var(--muted); }
@media (min-width: 560px) { .app { margin-block: 24px; border-radius: 28px; height: calc(100vh - 48px); height: calc(100dvh - 48px); box-shadow: 0 20px 60px rgba(20,40,30,.12); overflow: hidden; } .nav { border-radius: 0 0 28px 28px; } }

/* ---------- extra ---------- */
body { margin: 0; -webkit-tap-highlight-color: transparent; }
.app { overflow-x: clip; width: 100%; }
.linkbtn { border: 0; background: transparent; color: var(--green); font-weight: 800; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.me-row { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border-radius: 14px; padding: 10px 12px; }
.me-row .grow { flex: 1; min-width: 0; }
.welcome { display: flex; flex-direction: column; gap: 16px; padding-top: 10px; }
.welcome .logo { width: 64px; height: 64px; border-radius: 20px; background: var(--green); color: var(--green-ink); display: grid; place-items: center; }
.welcome .logo svg { width: 36px; height: 36px; }
.sugg { display: flex; flex-wrap: wrap; gap: 8px; }
.sugg:empty { display: none; }
.sugg-h { width: 100%; font-size: 12px; font-weight: 700; color: var(--muted); }
.sugg-i { border: 1.5px solid var(--green); background: var(--green-soft); color: var(--green); border-radius: 12px; padding: 9px 13px; font-weight: 800; }

/* pop-up melding */
.pop-wrap { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-start; justify-content: center; padding: calc(14px + env(safe-area-inset-top, 0px)) 14px 14px; background: rgba(10, 20, 15, .28); }
.pop { width: 100%; max-width: 480px; background: var(--surface); border-radius: 22px; padding: 16px; box-shadow: 0 18px 50px rgba(0,0,0,.25); display: flex; flex-direction: column; gap: 12px; animation: drop .35s cubic-bezier(.2,.9,.3,1.2); border: 2px solid var(--orange); }
@keyframes drop { from { transform: translateY(-30px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pop { animation: none; } }
.pop .ptop { display: flex; gap: 12px; align-items: center; }
.pop .bell { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--orange); }
.pop .pbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pop .pbtns .primary { grid-column: 1 / -1; }

/* dashboard */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kpi { background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi b { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi small { font-size: 12px; color: var(--muted); font-weight: 600; line-height: 1.3; }
.kpi .sub { font-size: 12px; color: var(--green); font-weight: 800; }
.funnel { display: flex; flex-direction: column; gap: 10px; }
.frow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: baseline; }
.frow .ftrack { grid-column: 1 / -1; height: 12px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.frow .ftrack i { display: block; height: 100%; background: var(--green); border-radius: 999px; }
.frow:last-child .ftrack i { background: var(--orange); }
.frow span { font-size: 13px; font-weight: 700; }
.frow b { font-variant-numeric: tabular-nums; font-size: 14px; }
.frow em { font-style: normal; color: var(--muted); font-weight: 700; font-size: 12px; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
table.t { border-collapse: collapse; width: 100%; font-size: 13px; }
table.t th, table.t td { padding: 9px 10px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
table.t th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface-2); }
table.t td.n, table.t th.n { text-align: right; font-variant-numeric: tabular-nums; }
table.t tr:last-child td { border-bottom: 0; }
.seat { display: flex; flex-direction: column; gap: 8px; background: var(--green); color: var(--green-ink); border-radius: 20px; padding: 16px; }
.seat .bar { background: rgba(255,255,255,.25); }
.note { font-size: 12px; color: var(--muted); line-height: 1.45; }
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
@media (min-width: 560px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
