:root {
  --accent: #DC4C3E;
  --accent-soft: #FBEAE8;
  --ground: #F6F5F3;
  --card: #FFFFFF;
  --ink: #202020;
  --muted: #757068;
  --line: #E8E5E1;
  --check: #B4AFA8;
}
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #E4584A;
    --accent-soft: #3A2320;
    --ground: #191817;
    --card: #232120;
    --ink: #F2F0ED;
    --muted: #A39D94;
    --line: #38352F;
    --check: #6E6A62;
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input { font: inherit; }
a { color: inherit; text-decoration: none; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--card);
  color: var(--ink);
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}

.verborgen { display: none !important; }

/* ---------- login ---------- */
.login-body {
  background: var(--ground);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 36px 28px;
  width: 100%;
  max-width: 380px;
  text-align: center;
}
.login-logo svg { width: 64px; height: 64px; }
.login-card h1 { font-size: 1.7rem; font-weight: 800; margin: 10px 0 24px; }
.login-fout {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 16px;
}
.login-card form { text-align: left; }
.login-card label {
  display: block;
  font-weight: 600;
  margin: 14px 0 6px;
}
.login-card input {
  width: 100%;
  font-size: 1.15rem;
  padding: 13px 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
}
.login-card input:focus { outline: none; border-color: var(--accent); }
.login-card button {
  width: 100%;
  margin-top: 24px;
  background: var(--accent);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  padding: 15px;
  border-radius: 12px;
}

/* ---------- hoofdscherm ---------- */
.app {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 18px 90px;
}

.topbar {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 4px;
}
.burger {
  width: 30px;
  height: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3px 2px;
  flex: none;
  align-self: center;
}
.burger span { display: block; height: 3px; border-radius: 2px; background: var(--ink); }
.screen-title { font-size: 1.7rem; font-weight: 800; }
.screen-date { font-size: 1.05rem; color: var(--muted); }

/* plusknop */
.fab {
  position: fixed;
  right: 20px;
  bottom: calc(24px + env(safe-area-inset-bottom));
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  z-index: 10;
}
.fab svg { width: 30px; height: 30px; }
.fab:active { transform: scale(0.94); }

/* invoervenster (komt omhoog boven het toetsenbord) */
.compose { padding: 16px 16px calc(14px + env(safe-area-inset-bottom)); }
.compose-rij {
  display: flex;
  align-items: center;
  gap: 10px;
}
.compose-rij input {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  color: var(--ink);
  font-size: 1.2rem;
  padding: 8px 2px;
}
.compose-rij input:focus { outline: none; }
.compose-rij input::placeholder { color: var(--muted); }

.mic {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.mic svg { width: 24px; height: 24px; }
.mic .icon-stop { display: none; }
.mic.recording { background: var(--ink); animation: pulse 1.1s ease-in-out infinite; }
.mic.recording .icon-mic { display: none; }
.mic.recording .icon-stop { display: block; }
.mic.bezig { opacity: 0.5; pointer-events: none; }
.mic.klein { width: 46px; height: 46px; }
.mic.klein svg { width: 21px; height: 21px; }
.verstuur { animation: verschijn 0.18s ease; }
.verstuur.klein svg { width: 23px; height: 23px; }
@keyframes verschijn {
  from { transform: scale(0.5); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .verstuur { animation: none; }
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 76, 62, 0.45); }
  50% { box-shadow: 0 0 0 9px rgba(220, 76, 62, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .mic.recording { animation: none; }
}
.rec-hint {
  font-size: 0.95rem;
  color: var(--accent);
  font-weight: 600;
  min-height: 1.4em;
  margin: 6px 2px 0;
  visibility: hidden;
}
.rec-hint.aan { visibility: visible; }

/* chips: altijd op één regel, schuiven opzij als het krap wordt */
.chips {
  display: flex;
  gap: 6px;
  margin: 8px 0 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: none;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--card);
  white-space: nowrap;
}
.chip svg { width: 14px; height: 14px; flex: none; }
.chip span:last-child {
  max-width: 7em;
  overflow: hidden;
  text-overflow: ellipsis;
}
#chip-datum { color: var(--accent); border-color: var(--accent-soft); background: var(--accent-soft); }
.chip-leeg { border-color: var(--accent); color: var(--accent); border-style: dashed; }
/* Nog geen datum gekozen: zelfde gestippelde stijl als een leeg projecttegeltje. */
#chip-datum.chip-leeg { background: var(--card); border-color: var(--accent); }

/* taken */
.tasks { list-style: none; margin-top: 8px; }
.groep-kop {
  font-weight: 800;
  font-size: 1.05rem;
  padding: 20px 2px 6px;
  border-bottom: 1px solid var(--line);
}
.groep-kop.te-laat { color: var(--accent); }
.task {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 17px 2px;
  border-bottom: 1px solid var(--line);
}
.checkbox {
  flex: none;
  width: 30px;
  height: 30px;
  border: 2.5px solid var(--check);
  border-radius: 50%;
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: all 0.15s;
}
.task.done .checkbox {
  background: var(--check);
  border-color: var(--check);
  color: var(--card);
}
.checkbox svg { width: 16px; height: 16px; }
.task-body { flex: 1; min-width: 0; }
.task-name { font-size: 1.2rem; font-weight: 600; overflow-wrap: break-word; }
.task.done .task-name { text-decoration: line-through; color: var(--muted); }
.task-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
  color: var(--muted);
  margin-top: 2px;
  flex-wrap: wrap;
}
.proj-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.task-datum { font-weight: 600; }
.task-datum.te-laat { color: var(--accent); }
.task-herhaling { display: inline-flex; align-items: center; gap: 4px; }
.task-herhaling svg { width: 13px; height: 13px; }
.task-meer {
  flex: none;
  color: var(--muted);
  font-size: 1.3rem;
  font-weight: 700;
  padding: 0 6px;
  letter-spacing: 1px;
}
.topbar-meer { margin-left: auto; align-self: center; font-size: 1.5rem; }

/* Snel terug naar Vandaag, op elk scherm behalve Vandaag zelf. */
.vandaag-knop {
  margin-left: auto;
  align-self: center;
  flex: none;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 7px 13px;
  border-radius: 999px;
  text-decoration: none;
}
.vandaag-knop + .topbar-meer { margin-left: 10px; }
/* Lange projectnamen mogen de knop niet van het scherm drukken:
   netjes afbreken over twee regels in plaats van afkappen met puntjes. */
.screen-title { min-width: 0; overflow-wrap: anywhere; hyphens: auto; }

.leeg {
  text-align: center;
  color: var(--muted);
  font-size: 1.05rem;
  padding: 40px 10px;
}

/* ---------- zijmenu ---------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(310px, 84vw);
  background: var(--ground);
  border-right: 1px solid var(--line);
  padding: 18px 14px;
  transform: translateX(-105%);
  transition: transform 0.22s ease;
  z-index: 30;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.sidebar-onder {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 13px;
}
.sidebar.open { transform: translateX(0); }
@media (prefers-reduced-motion: reduce) {
  .sidebar { transition: none; }
}
.sidebar-kop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px 18px;
}
.sidebar-naam { font-weight: 800; font-size: 1.2rem; }
.sidebar-uitlog { color: var(--muted); font-size: 0.95rem; font-weight: 600; }
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 10px;
  border-radius: 12px;
  font-size: 1.15rem;
  font-weight: 600;
  text-align: left;
}
.sidebar-item.actief { background: var(--accent-soft); color: var(--accent); }
.sidebar-icoon {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vandaag-icoon {
  border: 2px solid var(--accent);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 7px;
}
.binnenkort-icoon { color: var(--accent); }
.binnenkort-icoon svg { width: 21px; height: 21px; }
.plus-icoon { color: var(--accent); font-size: 1.5rem; font-weight: 700; }
.sidebar-sectie {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  padding: 20px 10px 6px;
}
.sidebar-nieuw { color: var(--muted); }
#nieuw-project-form { display: flex; gap: 8px; padding: 4px 10px; }
#nieuw-project-form input {
  flex: 1;
  min-width: 0;
  font-size: 1.05rem;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
}
#nieuw-project-form input:focus { outline: none; border-color: var(--accent); }
#nieuw-project-form button {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  border-radius: 10px;
  padding: 10px 14px;
}

.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 20;
}

/* ---------- sheets ---------- */
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--card);
  border-top: 1px solid var(--line);
  border-radius: 20px 20px 0 0;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  z-index: 40;
  max-width: 560px;
  margin: 0 auto;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.18);
}
.sheet-titel {
  font-weight: 800;
  font-size: 1.15rem;
  text-align: center;
  margin-bottom: 12px;
}
#sheet-taak-naam {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sheet-lijst { display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow-y: auto; }
.sheet-optie {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 12px;
  border-radius: 12px;
  font-size: 1.15rem;
  font-weight: 600;
  text-align: left;
}
.sheet-optie:active { background: var(--ground); }
.sheet-optie.gevaar { color: var(--accent); }
.sheet-optie.sheet-nieuw { color: var(--accent); }
.sheet-form { display: flex; gap: 8px; }
.sheet-form input {
  flex: 1;
  min-width: 0;
  font-size: 1.1rem;
  padding: 13px 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
}
.sheet-form input:focus { outline: none; border-color: var(--accent); }
.sheet-form button {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  border-radius: 12px;
  padding: 13px 20px;
}
.sheet-knop {
  width: 100%;
  margin-top: 14px;
  background: var(--accent);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  padding: 15px;
  border-radius: 14px;
}

/* installatievraag */
.sheet-tekst {
  text-align: center;
  color: var(--muted);
  font-size: 1.02rem;
  margin-bottom: 16px;
}
.sheet-knop.stil {
  background: var(--ground);
  color: var(--ink);
  margin-top: 10px;
}
.install-stappen {
  margin: 4px 0 6px;
  padding-left: 26px;
  font-size: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* melding bij doorgeschoven herhalende taak */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(100px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--ground);
  font-size: 1.05rem;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  z-index: 50;
  white-space: nowrap;
}

/* scrollwiel */
.wiel-houder { position: relative; height: 220px; overflow: hidden; }
.wiel {
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  padding: 88px 0;
  scrollbar-width: none;
}
.wiel::-webkit-scrollbar { display: none; }
.wiel-item {
  height: 44px;
  line-height: 44px;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--muted);
  scroll-snap-align: center;
}
.wiel-lijn {
  position: absolute;
  top: 88px;
  left: 8px;
  right: 8px;
  height: 44px;
  border-top: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
  pointer-events: none;
}
