/* SamenThuis: één stijlbestand. Kleuren staan als variabelen bovenaan. */

:root {
  --achtergrond: #121417;
  --tegel: #1e2126;
  --tegel-hover: #262a30;
  --lijn: #2e333a;
  --tekst: #f2f3f5;
  --tekst-zacht: #9aa1ab;
  --goud: #d9a441;
  --goud-tekst: #1a1408;
  --gevaar: #e5675c;
  --klaar: #5fb37d;
  --radius: 18px;
  --gat: clamp(10px, 1.4vw, 18px);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --achtergrond: #eef0f3;
  --tegel: #ffffff;
  --tegel-hover: #f5f6f8;
  --lijn: #dde1e6;
  --tekst: #16191d;
  --tekst-zacht: #5f6772;
  --goud: #c8902b;
  --goud-tekst: #ffffff;
  --gevaar: #c5443a;
  --klaar: #2f8a52;
  color-scheme: light;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --achtergrond: #eef0f3;
    --tegel: #ffffff;
    --tegel-hover: #f5f6f8;
    --lijn: #dde1e6;
    --tekst: #16191d;
    --tekst-zacht: #5f6772;
    --goud: #c8902b;
    --goud-tekst: #ffffff;
    --gevaar: #c5443a;
    --klaar: #2f8a52;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--achtergrond);
  color: var(--tekst);
  font: 17px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--goud); outline-offset: 2px; }

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

#app { padding: var(--gat); padding-bottom: 96px; max-width: 1400px; margin: 0 auto; }

/* ---------- Knoppen ---------- */
.knop {
  border: 1px solid var(--lijn); background: var(--tegel); border-radius: 14px;
  padding: 12px 18px; min-height: 48px; font-weight: 600;
}
.knop.primair { background: var(--goud); color: var(--goud-tekst); border-color: transparent; }
.knop.groot { font-size: 19px; padding: 16px 28px; }
.knop.zacht { background: transparent; min-height: 40px; padding: 8px 14px; }
.knop.gevaar { color: var(--gevaar); }
.knop-rond {
  width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--lijn);
  background: var(--tegel); display: grid; place-items: center; flex: none;
}
.knop-rond.klein { width: 40px; height: 40px; border-color: transparent; background: transparent; color: var(--tekst-zacht); }
.knop-rond.goud { background: var(--goud); color: var(--goud-tekst); border-color: transparent; }

/* ---------- Start ---------- */
.startkop { display: flex; align-items: center; gap: 16px; margin-bottom: var(--gat); }
.klok { font-size: clamp(30px, 4vw, 44px); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.datum { color: var(--tekst-zacht); text-transform: capitalize; margin-top: 4px; }
.briefing { flex: 1; margin: 0; color: var(--tekst-zacht); text-align: right; }

.raster {
  display: grid; gap: var(--gat);
  grid-template-columns: 1fr;
  grid-template-areas: "praat" "vandaag" "skyler" "agenda" "boodschappen";
}
@media (min-width: 900px) and (orientation: landscape) {
  .raster {
    height: calc(100dvh - 150px); min-height: 440px;
    grid-template-columns: 0.8fr 1.6fr 1.1fr;
    grid-template-rows: 1.5fr 1fr;
    grid-template-areas: "praat agenda vandaag" "skyler agenda boodschappen";
  }
}

.tegel {
  background: var(--tegel); border: 1px solid var(--lijn); border-radius: var(--radius);
  padding: clamp(16px, 1.8vw, 26px); text-align: left; display: flex; flex-direction: column; gap: 12px;
  min-height: 120px; transition: background .15s, transform .1s;
}
button.tegel:hover { background: var(--tegel-hover); }
button.tegel:active { transform: scale(.985); }
.tegel-kop { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: clamp(18px, 1.8vw, 22px); color: var(--tekst); width: 100%; }
.tegel-titel { font-size: clamp(22px, 2.4vw, 30px); font-weight: 700; }
.tegel-sub { color: var(--tekst-zacht); font-size: 15px; }
.tegel-getal {
  margin-left: auto; min-width: 40px; height: 40px; padding: 0 12px; border-radius: 999px;
  background: var(--goud); color: var(--goud-tekst); display: grid; place-items: center; font-size: 20px;
}
.tegel-lijst { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 20px; width: 100%; }
.tegel-lijst li { padding: 10px 0; border-bottom: 1px solid var(--lijn); font-size: clamp(17px, 1.6vw, 20px); overflow-wrap: anywhere; }
.tegel-lijst .leeg-item, .tegel-lijst .meer-item { color: var(--tekst-zacht); border-bottom: 0; }

.tegel-praat {
  grid-area: praat; background: var(--goud); color: var(--goud-tekst); border-color: transparent;
  justify-content: center; align-items: center; text-align: center; min-height: 190px;
}
.tegel-praat:hover { background: var(--goud) !important; filter: brightness(1.05); }
.tegel-praat .tegel-sub { color: inherit; opacity: .8; }
.tegel-ic.groot .ic { width: clamp(56px, 7vw, 88px); height: clamp(56px, 7vw, 88px); stroke-width: 1.6; }
.tegel-boodschappen { grid-area: boodschappen; justify-content: flex-start; }
.tegel-boodschappen .tegel-lijst { grid-template-columns: 1fr; }
.tegel-agenda { grid-area: agenda; justify-content: flex-start; min-height: 360px; overflow: hidden; }
.tegel-agenda-vak { flex: 1; min-height: 0; width: 100%; overflow-y: auto; border-radius: 12px; max-height: 420px; }
@media (min-width: 900px) and (orientation: landscape) { .tegel-agenda-vak { max-height: none; } }
.tegel-agenda .tegel-sub { font-weight: 500; font-size: 15px; }
.vul { flex: 1; }

/* ---------- Schermen ---------- */
.scherm { max-width: 760px; margin: 0 auto; }
.scherm.start { max-width: none; }
.scherm-breed { max-width: 1200px; }
.scherm-breed .invoerbalk, .scherm-breed .spraakstatus { max-width: 760px; }
.groepen { display: grid; gap: 0 var(--gat); align-items: start; }
@media (min-width: 900px) { .groepen { grid-template-columns: 1fr 1fr; } }
.voorraad { margin-bottom: 4px; }
.schermkop { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.schermkop h1 { margin: 0; font-size: 28px; }

.invoerbalk { display: flex; gap: 10px; margin-bottom: 6px; }
.invoer {
  flex: 1; min-width: 0; min-height: 52px; padding: 12px 16px; border-radius: 14px;
  border: 1px solid var(--lijn); background: var(--tegel);
}
.spraakstatus { min-height: 22px; color: var(--goud); font-size: 15px; margin-bottom: 8px; }

.groepkop { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--tekst-zacht); margin: 22px 4px 8px; }
.groepkop-rij { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 8px; }
.groepkop-rij .groepkop { margin: 0 4px; }

.lijst { background: var(--tegel); border: 1px solid var(--lijn); border-radius: var(--radius); overflow: hidden; }
.rij {
  display: flex; align-items: center; gap: 14px; padding: 8px 10px 8px 16px; min-height: 54px;
  border: 0; border-bottom: 1px solid var(--lijn); width: 100%; background: transparent; text-align: left;
}
.lijst > :last-child, .lijst > :last-child .rij-opties { border-bottom: 0; }
.rij-groep { border-bottom: 1px solid var(--lijn); }
.rij-groep .rij { border-bottom: 0; }
.rij-tekst { flex: 1; min-width: 0; }
.rij-naam { font-weight: 600; overflow-wrap: anywhere; }
.rij-meta { color: var(--tekst-zacht); font-size: 14px; }
.rij.gedaan .rij-naam { text-decoration: line-through; color: var(--tekst-zacht); font-weight: 500; }
.knop-rij { min-height: 56px; }

.vink {
  width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--tekst-zacht);
  background: transparent; display: grid; place-items: center; flex: none; padding: 0;
}
.rij.gedaan .vink { background: var(--klaar); border-color: var(--klaar); color: #fff; }
.vink .ic { width: 20px; height: 20px; stroke-width: 3; }

.rij-opties { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 4px 16px 14px 64px; }
.keuze { min-height: 44px; border-radius: 12px; border: 1px solid var(--lijn); background: var(--achtergrond); padding: 8px 10px; }
.schakel { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.schakel input { width: 22px; height: 22px; accent-color: var(--goud); }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 14px;
  border-radius: 999px; border: 1px solid var(--lijn); background: var(--tegel);
}
.uitleg { color: var(--tekst-zacht); font-size: 15px; margin: 4px 4px 10px; }
.leeg { color: var(--tekst-zacht); text-align: center; padding: 40px 10px; }

/* ---------- Inloggen ---------- */
.inlog { text-align: center; padding-top: 18vh; }
.merk { color: var(--goud); font-weight: 700; letter-spacing: .04em; }
.inlog h1 { font-size: 34px; margin: 10px 0; }
.inlog .uitleg { margin-bottom: 28px; }

/* ---------- Melding ---------- */
.melding {
  position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: min(560px, calc(100% - 32px)); background: var(--tekst); color: var(--achtergrond);
  border-radius: 14px; padding: 12px 12px 12px 18px; display: flex; align-items: center; gap: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,.35); z-index: 10;
}
.melding[hidden] { display: none; }
.melding span { flex: 1; }
.melding-knop { background: transparent; border: 0; color: var(--goud); font-weight: 700; padding: 10px; min-height: 44px; }

body.demo::after {
  content: "Demo: alleen op dit apparaat"; position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  font-size: 12px; background: var(--goud); color: var(--goud-tekst); padding: 3px 10px; border-radius: 999px; pointer-events: none;
}

@media (max-width: 520px) {
  .briefing { display: none; }
  .startkop { justify-content: space-between; }
  .knop.primair:not(.groot) { padding: 12px 14px; }
}
body.demo #app { padding-top: 40px; }

@media (min-width: 900px) { .rij-door { display: none; } }

/* ---------- Agenda ---------- */
:root { --p-sven: #5b9bd5; --p-michelle: #e07a9a; --p-skyler: #5fb37d; --p-harper: #a98be0; --p-iedereen: var(--goud); }
.ag-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.ag-dag { margin: 0; font-size: 20px; min-width: 0; flex: 1; text-align: center; text-transform: capitalize; }
.draai .ic { transform: rotate(180deg); }
.midden { text-align: center; }

.ag-raster { background: var(--tegel); border: 1px solid var(--lijn); border-radius: var(--radius); overflow: hidden; }
.ag-raster.compact { background: transparent; border: 0; border-radius: 0; }
.ag-kop, .ag-body { display: grid; grid-template-columns: 52px repeat(4, minmax(0, 1fr)); }
.compact .ag-kop, .compact .ag-body { grid-template-columns: 42px repeat(4, minmax(0, 1fr)); }
.ag-kop { position: sticky; top: 0; z-index: 2; background: var(--tegel); border-bottom: 1px solid var(--lijn); }
.ag-naam { padding: 10px 6px; font-weight: 700; font-size: 15px; text-align: center; border-left: 1px solid var(--lijn); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-naam::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; background: var(--kleur); }
.compact .ag-naam { padding: 6px 2px; font-size: 13px; }
.ag-tijden { position: relative; }
.ag-uur { position: absolute; left: 0; right: 6px; transform: translateY(-50%); font-size: 12px; color: var(--tekst-zacht); text-align: right; font-variant-numeric: tabular-nums; }
.ag-uur:first-child { transform: none; }
.ag-kol { position: relative; border-left: 1px solid var(--lijn); }
.ag-lijn { position: absolute; left: 0; right: 0; border-top: 1px solid var(--lijn); opacity: .6; }
.ag-nu { position: absolute; left: 0; right: 0; border-top: 2px solid var(--gevaar); z-index: 1; pointer-events: none; }

.p-sven { --kleur: var(--p-sven); } .p-michelle { --kleur: var(--p-michelle); }
.p-skyler { --kleur: var(--p-skyler); } .p-harper { --kleur: var(--p-harper); } .iedereen { --kleur: var(--p-iedereen); }

.ag-blok {
  position: absolute; z-index: 1; overflow: hidden; text-align: left; border: 0; margin: 0;
  border-left: 4px solid var(--kleur); border-radius: 8px; padding: 4px 6px;
  background: color-mix(in srgb, var(--kleur) 24%, var(--tegel)); color: var(--tekst);
  display: flex; flex-direction: column; gap: 1px; font-size: 14px; line-height: 1.2;
}
.ag-blok.kort { flex-direction: row; align-items: center; padding: 2px 6px; }
.ag-titel { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-tijd { font-size: 12px; color: var(--tekst-zacht); font-variant-numeric: tabular-nums; }
.compact .ag-blok { font-size: 12px; padding: 2px 5px; border-left-width: 3px; }
button.ag-blok:hover { filter: brightness(1.1); }

/* ---------- Venster (invulscherm) ---------- */
.venster {
  width: min(560px, calc(100% - 24px)); max-height: calc(100dvh - 24px); border: 1px solid var(--lijn);
  border-radius: 22px; background: var(--tegel); color: var(--tekst); padding: 20px;
}
.venster::backdrop { background: rgba(0,0,0,.55); }
.venster-kop { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.venster-kop h2 { margin: 0; font-size: 22px; }
.veld { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; font-weight: 600; font-size: 15px; color: var(--tekst-zacht); flex: 1; min-width: 0; }
.veld .invoer { color: var(--tekst); font-weight: 500; width: 100%; }
.velden-rij { display: flex; gap: 10px; flex-wrap: wrap; }
.velden-rij .veld { flex: 1 1 120px; margin-top: 0; }
.personen-keuze { display: flex; flex-wrap: wrap; gap: 8px; }
.persoon-knop {
  display: inline-flex; align-items: center; gap: 6px; min-height: 46px; padding: 8px 16px; border-radius: 999px;
  border: 2px solid var(--lijn); background: transparent; font-weight: 600; color: var(--tekst);
}
.persoon-knop[aria-pressed="true"] { border-color: var(--kleur, var(--goud)); background: color-mix(in srgb, var(--kleur, var(--goud)) 22%, transparent); }
.venster-knoppen { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; align-items: center; }
.fout { color: var(--gevaar); min-height: 1.2em; margin: 4px 0; font-weight: 600; }

/* ---------- Taken ---------- */
.tegel-vandaag { grid-area: vandaag; justify-content: flex-start; overflow: hidden; }
.tegel-kop-knop { border: 0; background: transparent; padding: 0; text-align: left; }
.tegel-kop-knop .draai-ic { transform: rotate(180deg); width: 18px; height: 18px; color: var(--tekst-zacht); }
.tegel-taken { display: flex; flex-direction: column; gap: 8px; width: 100%; overflow-y: auto; min-height: 0; }
.tegel-persoon-naam { font-size: 13px; font-weight: 700; color: var(--tekst-zacht); margin: 0 2px 4px; }
.tegel-persoon-naam::before, .ag-naam-kop::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; background: var(--kleur); }
.lijst.plat { background: transparent; border: 0; border-radius: 0; }
.lijst.plat .rij { min-height: 44px; padding: 4px 0; border-bottom: 0; gap: 10px; }
.lijst.plat .vink { width: 28px; height: 28px; }
.lijst.plat .rij-meta { font-size: 12px; }
.klaar-tekst { padding: 4px 2px; color: var(--klaar); }
.rij.belangrijk:not(.gedaan) .rij-naam::after { content: " •"; color: var(--goud); }
.taken-kolommen { display: grid; gap: 0 var(--gat); align-items: start; }
@media (min-width: 900px) { .taken-kolommen { grid-template-columns: repeat(3, 1fr); } }
.leeg.klein { padding: 14px; font-size: 15px; background: var(--tegel); border: 1px dashed var(--lijn); border-radius: var(--radius); }
.tegel-taken .rij-meta { display: none; }
.tegel-taken .lijst.plat .rij { min-height: 40px; padding: 2px 0; }
.tegel-taken { overflow-anchor: none; }

/* ---------- Skyler, geheugen, meer ---------- */
.tegel-skyler { grid-area: skyler; justify-content: flex-start; overflow: hidden; min-height: 150px; }
.tegel-skyler .tegel-persoon-naam::before { display: none; }
.tegel-praat { min-height: 160px; }
.tekstvak { resize: vertical; min-height: 64px; font: inherit; }
.geheugen-nieuw { display: flex; gap: 10px; align-items: stretch; margin-bottom: 12px; }
.geheugen-nieuw .tekstvak { flex: 1; }
.scherm > .invoer[type=search] { width: 100%; margin-bottom: 14px; }
.rij-naam.notitie { font-weight: 500; white-space: pre-wrap; }
.knop-rij { gap: 14px; color: var(--tekst); }
a.chip { color: var(--tekst); text-decoration: none; font-weight: 600; }
