:root {
  color-scheme: light;
  --achtergrond: #F2F3F5;
  --kaart: #FFFFFF;
  --lijn: #E1E3E8;
  --lijn-zacht: #ECEEF1;
  --veld: #F6F7F9;
  --inkt: #14171C;
  --tekst2: #3A3F48;
  --stil: #5B616B;
  --blauw: #2557D6;
  --blauw-zacht: #DCE5FB;
  --blauw-mid: #93B0F0;
  --gemist: #C9CDD5;
  --leeg: #D5D8DE;
  --kop: "Space Grotesk", Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--achtergrond);
  color: var(--inkt);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.35;
  -webkit-tap-highlight-color: transparent;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--inkt); outline-offset: 2px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--blauw); outline-offset: 0; border-color: var(--blauw); }
input::placeholder, textarea::placeholder { color: #6B717B; }

.getal { font-family: var(--kop); font-variant-numeric: tabular-nums; }

/* Opbouw */
.app { max-width: 480px; margin: 0 auto; min-height: 100dvh; }
.scherm {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(96px + env(safe-area-inset-bottom));
}

.menu {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 480px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0 4px calc(10px + env(safe-area-inset-bottom));
  background: var(--kaart);
  border-top: 1px solid var(--lijn);
  z-index: 10;
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 56px;
  color: var(--stil);
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
}
.tab .streep { width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: transparent; }
.tab.actief { color: var(--inkt); font-weight: 700; }
.tab.actief .streep { background: var(--blauw); }

/* Kop */
.kop { display: flex; flex-direction: column; gap: 10px; }
.kop-rij { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.kop h1 {
  margin: 0;
  font-family: var(--kop);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.kop h1.lang { font-size: 28px; }
.sub { margin: 0 0 2px; font-size: 13px; font-weight: 500; color: var(--stil); }
.pijlen { display: flex; gap: 6px; flex: none; }
.rond {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--lijn);
  background: var(--kaart);
  color: var(--inkt);
  padding: 0;
  flex: none;
}
.rond:disabled { color: #B4B9C2; }
.terug {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: -6px;
  padding: 6px;
  border: 0;
  background: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--tekst2);
  text-decoration: none;
}
.afspraak { margin: 0; font-size: 14px; font-style: italic; line-height: 1.4; color: var(--tekst2); }

/* Secties en kaarten */
.sectie { display: flex; flex-direction: column; gap: 8px; }
.sectiekop { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.label {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stil);
}
.hint { font-size: 12px; color: var(--stil); }
.kaart {
  background: var(--kaart);
  border: 1px solid var(--lijn);
  border-radius: 16px;
  padding: 14px;
}
.kaart.lijst { padding-top: 2px; padding-bottom: 2px; }
.kaart-titel { margin: 0; font-family: var(--kop); font-size: 19px; font-weight: 600; line-height: 1.2; }
.notitie { margin: 0; font-size: 13px; color: var(--stil); }
.leeg-tekst { margin: 0; padding: 12px 0; font-size: 14px; color: var(--stil); }

.link-knop {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  border: 0;
  background: none;
  color: var(--blauw);
  font-size: 14px;
  font-weight: 600;
}

/* Afspraken-tegels */
.tegels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tegel {
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1.5px solid var(--lijn);
  background: var(--kaart);
  overflow: hidden;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.tegel-knop {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 14px 10px;
  border: 0;
  background: none;
  text-align: left;
  color: inherit;
}
.tegel-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tegel-ritme { font-size: 12px; font-weight: 600; color: var(--stil); }
.vink {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  border: 2px solid #B4B9C2;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blauw);
}
.vink svg { visibility: hidden; }
.tegel-titel { font-family: var(--kop); font-size: 19px; font-weight: 600; line-height: 1.1; }
.tegel-titel small { display: block; margin-top: 3px; font-family: Inter, system-ui, sans-serif; font-size: 13px; font-weight: 500; color: var(--stil); }
.stand { font-size: 12px; font-weight: 500; color: var(--stil); }
.teller {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 8px;
  border-top: 1px solid var(--lijn-zacht);
}
.teller button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--lijn);
  background: var(--kaart);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--inkt);
}
.teller-waarde { font-family: var(--kop); font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.teller-waarde small { font-family: Inter, system-ui, sans-serif; font-size: 12px; font-weight: 500; color: var(--stil); }
.tegel.aan { background: var(--blauw); border-color: var(--blauw); color: #FFFFFF; }
.tegel.aan .vink { background: #FFFFFF; border-color: #FFFFFF; }
.tegel.aan .vink svg { visibility: visible; }
.tegel.aan .tegel-ritme, .tegel.aan .stand, .tegel.aan .tegel-titel small, .tegel.aan .teller-waarde small { color: rgba(255, 255, 255, 0.85); }
.tegel.aan .teller { border-top-color: rgba(255, 255, 255, 0.25); }
.tegel.aan .teller button { background: transparent; border-color: rgba(255, 255, 255, 0.5); color: #FFFFFF; }

/* Doel op Vandaag */
.doelblok { display: flex; flex-direction: column; gap: 10px; }
.doelblok-kop { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; text-decoration: none; color: inherit; }
.doelblok-kop strong { font-family: var(--kop); font-size: 18px; font-weight: 600; line-height: 1.2; }
.aftellen { flex: none; font-size: 13px; font-weight: 600; color: var(--tekst2); white-space: nowrap; }
.volgende {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--achtergrond);
  font-size: 13px;
  color: var(--tekst2);
}
.volgende svg { flex: none; color: var(--stil); }
.volgende strong { color: var(--inkt); font-weight: 600; }

/* Taken */
.taken { display: flex; flex-direction: column; }
.taak {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--lijn-zacht);
}
.taak:last-child { border-bottom: 0; }
.taak-vink {
  width: 26px;
  height: 26px;
  flex: none;
  margin-top: -2px;
  border-radius: 50%;
  border: 2px solid #B4B9C2;
  background: var(--kaart);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #FFFFFF;
}
.taak-vink svg { visibility: hidden; }
.taak.klaar .taak-vink { background: var(--blauw); border-color: var(--blauw); }
.taak.klaar .taak-vink svg { visibility: visible; }
.taak-tekst { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.taak-open {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
}
.taak-titel { font-size: 15px; font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; }
.taak.klaar .taak-titel { color: var(--stil); text-decoration: line-through; text-decoration-color: var(--gemist); }
.taak-meta { font-size: 12px; color: var(--stil); }
.taak-acties { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.mini {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--lijn);
  background: var(--kaart);
  font-size: 12px;
  font-weight: 600;
  color: var(--tekst2);
}
.mini.blauw { border-color: var(--blauw); color: var(--blauw); }

.banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: var(--inkt);
  color: #FFFFFF;
  text-decoration: none;
}
.banner-tekst { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.banner-tekst strong { font-size: 15px; }
.banner-tekst span { font-size: 13px; color: rgba(255, 255, 255, 0.75); }

/* Week */
.weekrij { display: flex; align-items: center; gap: 8px; padding: 8px 0; }
.weekrij-naam { width: 92px; flex: none; display: flex; flex-direction: column; line-height: 1.15; }
.weekrij-naam strong { font-size: 14px; overflow-wrap: anywhere; }
.weekrij-naam small { font-size: 11px; color: var(--stil); }
.weekrij-dagen { flex: 1; display: flex; gap: 4px; }
.weekrij-dagen > span { flex: 1; display: flex; justify-content: center; }
.dagletter { font-size: 11px; font-weight: 500; color: var(--stil); text-align: center; flex: 1; }
.dagletter.vandaag { color: var(--inkt); font-weight: 700; }
.weekrij-telling { width: 40px; flex: none; text-align: right; font-family: var(--kop); font-size: 17px; font-weight: 600; }
.weekrij-telling small { color: var(--stil); font-size: 15px; }
.stip { width: 24px; height: 24px; border-radius: 50%; background: var(--lijn-zacht); border: 1.5px solid var(--lijn-zacht); }
.stip.gedaan { background: var(--blauw); border-color: var(--blauw); }
.stip.deels { background: var(--blauw-zacht); border-color: var(--blauw-mid); }
.stip.gemist { background: #FFFFFF; border-color: var(--gemist); }
.stip.vandaag { background: #FFFFFF; border: 1.5px dashed var(--inkt); }
.stip.uit { background: transparent; border-color: transparent; }

.dagkop { margin: 10px 0 0; font-size: 12px; font-weight: 700; color: var(--tekst2); }
.dagkop:first-child { margin-top: 6px; }

.cijfers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cijfers.twee { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cijfer { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--kaart); border: 1px solid var(--lijn); }
.cijfer span { font-size: 12px; font-weight: 500; color: var(--stil); }
.cijfer strong { font-family: var(--kop); font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.cijfer strong small { font-size: 14px; font-weight: 600; color: var(--stil); }

.afsluiting { display: flex; flex-direction: column; gap: 12px; }
.afsluiting textarea, .veld textarea {
  width: 100%;
  min-height: 84px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--lijn);
  background: var(--veld);
  font-size: 16px;
  line-height: 1.4;
  resize: vertical;
}
.citaat { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--achtergrond); font-size: 14px; line-height: 1.45; white-space: pre-wrap; }

/* Doelen */
.doelkaart { display: flex; flex-direction: column; gap: 12px; color: inherit; text-decoration: none; }
.doelkaart-kop { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.doelkaart-kop svg { flex: none; margin-top: 2px; color: #8A909A; }
.balk { display: flex; height: 6px; border-radius: 3px; background: var(--lijn-zacht); overflow: hidden; }
.balk span { border-radius: inherit; background: var(--blauw); }
.balk-rij { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 500; color: var(--stil); }
.chip {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--lijn-zacht);
  font-size: 12px;
  font-weight: 600;
  color: var(--tekst2);
}
.chip.blauw { background: var(--blauw-zacht); color: #1A3F9E; }
.chip.donker { background: var(--inkt); color: #FFFFFF; }

.rijlink {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--lijn-zacht);
  color: inherit;
  text-decoration: none;
}
.rijlink:last-child { border-bottom: 0; }
button.rijlink { width: 100%; background: none; border-width: 0 0 1px; text-align: left; }
button.rijlink:last-child { border-bottom: 0; }
.rijlink-tekst { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rijlink-tekst strong { font-size: 15px; font-weight: 600; }
.rijlink-tekst span { font-size: 12px; color: var(--stil); }

/* Mijlpalen */
.mijlpaal { position: relative; display: flex; gap: 12px; padding: 0 0 4px; }
.mijlpaal-lijn { position: relative; width: 26px; flex: none; display: flex; flex-direction: column; align-items: center; }
.mijlpaal-lijn::after { content: ""; flex: 1; width: 2px; margin: 4px 0; background: var(--lijn); }
.mijlpaal:last-child .mijlpaal-lijn::after { display: none; }
.mijlpaal-inhoud { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding-bottom: 14px; }
.mijlpaal-kop { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 0; border: 0; background: none; text-align: left; }
.mijlpaal-titel { font-size: 15px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.mijlpaal.klaar .taak-vink { background: var(--blauw); border-color: var(--blauw); }
.mijlpaal.klaar .taak-vink svg { visibility: visible; }
.mijlpaal.klaar .mijlpaal-titel { color: var(--stil); text-decoration: line-through; text-decoration-color: var(--gemist); }
.mijlpaal-datum { flex: none; font-size: 12px; font-weight: 600; color: var(--tekst2); white-space: nowrap; }
.mijlpaal-sub { font-size: 12px; color: var(--stil); }
.mijlpaal .taken { margin-top: 4px; }
.mijlpaal .taak { padding: 8px 0; }

/* Afspraken-scherm */
.afspraak-kaart { display: flex; flex-direction: column; gap: 10px; }
.afspraak-kop { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.vierweken { display: grid; grid-template-columns: repeat(28, minmax(0, 1fr)); gap: 3px; }
.vierweken span { aspect-ratio: 1; border-radius: 3px; background: var(--lijn-zacht); }
.vierweken .gedaan { background: var(--blauw); }
.vierweken .deels { background: var(--blauw-mid); }
.vierweken .uit { background: transparent; border: 1px dashed var(--lijn); }

/* Knoppen */
.knop {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1.5px solid var(--inkt);
  background: transparent;
  color: var(--inkt);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}
.knop.vol { background: var(--blauw); border-color: var(--blauw); color: #FFFFFF; }
.knop.stil { border-color: var(--lijn); color: var(--tekst2); }
.knoppen { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.bewaarstatus { margin: 0; text-align: center; font-size: 12px; color: var(--stil); min-height: 16px; }
.bewaarstatus.fout { color: #B42318; font-weight: 600; }
.formfout { margin: 0; font-size: 13px; font-weight: 600; color: #B42318; }
.formfout:empty { display: none; }

/* Venster (onderblad) */
.venster {
  width: 100%;
  max-width: 480px;
  max-height: 92dvh;
  margin: auto auto 0;
  padding: 0;
  border: 0;
  border-radius: 20px 20px 0 0;
  background: var(--kaart);
  color: var(--inkt);
}
.venster::backdrop { background: rgba(20, 23, 28, 0.45); }
.venster form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
}
.venster-kop { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.venster-kop h2 { margin: 0; font-family: var(--kop); font-size: 22px; font-weight: 700; }
.sluit { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--achtergrond); display: flex; align-items: center; justify-content: center; padding: 0; }
.veld { display: flex; flex-direction: column; gap: 6px; }
.veld > label, .veld > .veldlabel { font-size: 13px; font-weight: 600; color: var(--tekst2); }
.veld input[type="text"], .veld input[type="date"], .veld input[type="number"], .veld select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--lijn);
  background: var(--veld);
  font-size: 16px;
}
.veld-uitleg { margin: 0; font-size: 12px; line-height: 1.4; color: var(--stil); }
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.keuzes { display: flex; flex-wrap: wrap; gap: 6px; }
.keuze {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--lijn);
  background: var(--kaart);
  font-size: 14px;
  font-weight: 500;
}
.keuze[aria-pressed="true"] { background: var(--inkt); border-color: var(--inkt); color: #FFFFFF; }
.keuzes.dagen .keuze { min-width: 40px; padding: 8px 0; text-align: center; flex: 1; }
.gevaar { color: #8A2A1F; border-color: var(--lijn); }

/* Slot (code) */
.slot {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.slot-kaart {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px 20px;
  border-radius: 20px;
  background: var(--kaart);
  border: 1px solid var(--lijn);
}
.slot-kaart h1 { margin: 0; font-family: var(--kop); font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.slot-kaart p { margin: 0; color: var(--tekst2); }
.slot-veld { display: flex; flex-direction: column; gap: 6px; }
.slot-veld label { font-size: 13px; font-weight: 600; color: var(--tekst2); }
.slot-veld input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--lijn);
  background: var(--veld);
  font-size: 18px;
}
.melding { margin: 0; font-size: 14px; color: var(--tekst2); text-align: center; padding: 40px 16px; }
