/* Homey-stijl: strakke tegels, warme gloed bij brandende lampen, rustig.
   Werkt in licht én donker. */

:root {
  color-scheme: dark;
  --bg: #12141a;
  --bg-soft: #171b23;
  --card: #1b1f28;
  --card-2: #212632;
  --card-on: #221f18;
  --border: #262c38;
  --text: #eef1f7;
  --text-dim: #8a93a7;
  --accent: #ffc23d;        /* warm licht */
  --accent-ink: #241a00;    /* tekst op accent */
  --accent-soft: rgba(255, 194, 61, 0.16);
  --warm-soft: rgba(255, 194, 61, 0.16);
  --glow: rgba(255, 194, 61, 0.30);
  --cool: #6fb3ff;
  --green: #4ecb8d;
  --heat: #ff8c42;
  --red: #f87171;
  --p0: #7cb3ff;
  --p1: #ff9ecf;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 3px 12px rgba(0, 0, 0, 0.18);
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef1f6;
  --bg-soft: #e6eaf1;
  --card: #ffffff;
  --card-2: #f3f5fa;
  --card-on: #fff7e6;
  --border: #dde2ec;
  --text: #1a1e27;
  --text-dim: #667085;
  --accent: #d68a00;
  --accent-ink: #ffffff;
  --accent-soft: rgba(255, 177, 31, 0.20);
  --warm-soft: rgba(255, 177, 31, 0.24);
  --glow: rgba(255, 177, 31, 0.30);
  --shadow: 0 3px 10px rgba(70, 90, 120, 0.08);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #eef1f6;
    --bg-soft: #e6eaf1;
    --card: #ffffff;
    --card-2: #f3f5fa;
    --card-on: #fff7e6;
    --border: #dde2ec;
    --text: #1a1e27;
    --text-dim: #667085;
    --accent: #d68a00;
    --accent-ink: #ffffff;
    --accent-soft: rgba(255, 177, 31, 0.20);
    --warm-soft: rgba(255, 177, 31, 0.24);
    --glow: rgba(255, 177, 31, 0.30);
    --shadow: 0 3px 10px rgba(70, 90, 120, 0.08);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  min-height: 100%;
}

.hidden { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; }

.btn {
  border: 1px solid var(--border);
  background: var(--card-2);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-weight: 600;
  transition: transform 0.12s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-big { width: 100%; padding: 16px; font-size: 1.1rem; margin-top: 10px; }
.btn-link { background: none; border: none; color: var(--text-dim); text-decoration: underline; padding: 10px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- gedeelde tegel/kaart ---------- */

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.panel-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin: 0 0 12px;
}

/* ---------- koppel-scherm ---------- */

.setup { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.setup-card {
  width: 100%; max-width: 480px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; text-align: center; box-shadow: var(--shadow);
}
.setup-icon { width: 64px; height: 64px; margin-bottom: 8px; }
.setup-card h1 { font-size: 1.4rem; margin: 0 0 18px; }
.setup-step { text-align: left; color: var(--text-dim); margin: 14px 0 8px; line-height: 1.5; }
.stepnum {
  display: inline-flex; width: 26px; height: 26px; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; margin-right: 6px;
}
.setup-row { display: flex; gap: 10px; }
.setup-row input, .setup-msg { min-width: 0; }
.setup-row input {
  flex: 1; background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); padding: 12px 14px;
}
.setup-msg { min-height: 1.4em; color: var(--accent); margin: 12px 0 4px; }
.setup-msg.error { color: var(--red); }

/* ---------- dashboard ---------- */

.dash { max-width: 1400px; margin: 0 auto; padding: 16px clamp(14px, 3vw, 28px) 8px; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.clock { font-size: clamp(2.6rem, 7vw, 4rem); font-weight: 800; line-height: 0.95; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.date { color: var(--text-dim); margin-top: 6px; font-size: 1.05rem; text-transform: capitalize; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.demo-badge { background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 5px 12px; font-size: 0.85rem; font-weight: 700; }
.icon-btn {
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--card); color: var(--text); font-size: 1.2rem; box-shadow: var(--shadow);
}
.btn-alloff { padding: 14px 22px; font-size: 1.05rem; border-radius: 999px; box-shadow: var(--shadow); white-space: nowrap; }

/* ---------- tabbladen (alles op één scherm, geen scrollen) ---------- */

.tabbar { display: flex; gap: 10px; margin-bottom: 12px; flex: none; }
.tabbtn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 9px;
  background: var(--card); border: 1px solid var(--border); border-radius: 999px;
  padding: 12px 8px; font-weight: 700; color: var(--text-dim); box-shadow: var(--shadow);
  transition: transform 0.12s, background 0.2s, color 0.2s;
}
.tabbtn:active { transform: scale(0.97); }
.tabbtn .ti { font-size: 1.35rem; line-height: 1; }
.tabbtn .tl { font-size: 1rem; }
.tabbtn.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.tabview { flex: 1; min-height: 0; }
.tabpanel { height: 100%; min-height: 0; }
.tabpanel:not(.active) { display: none; }
.tabpanel.active { display: grid; gap: 14px; animation: tab-in 0.18s ease; }

/* Zachte overgang bij tabwissel (klik of veeg). */
@keyframes tab-in { from { opacity: 0; transform: translateX(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tabpanel.active { animation: none; } }

/* Panelen in een tab vullen hun vak en scrollen zo nodig van binnen,
   zodat de pagina zelf nooit hoeft te scrollen. */
.tabpanel .panel { min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.tabpanel .panel-title { flex: none; }
.tabpanel .rooms,
.tabpanel .todo-list,
.tabpanel .cal-events,
.tabpanel #tado-body,
.tabpanel #sonos-body,
.tabpanel #weer-body,
.tabpanel #afval-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.tabpanel[data-tab="thuis"] #afval-body { flex: 1 1 auto; }
.tabpanel .rooms,
.tabpanel .todo-list { flex: 1 1 auto; }
/* Lamptegels op natuurlijke hoogte houden i.p.v. uitrekken over de kolom. */
.tabpanel .rooms { align-content: start; }
.tabpanel .cal-events { max-height: none; flex: 1 1 auto; }

/* THUIS: lampen links, midden weer + afval, rechts verwarming */
.tabpanel[data-tab="thuis"] {
  grid-template-columns: 1.15fr 1fr 1fr;
  /* Weer en afval delen de middenkolom eerlijk: allebei een minimumhoogte en
     interne scroll, zodat de afval-ophaaldagen niet meer worden platgedrukt. */
  grid-template-rows: auto minmax(150px, 1fr) minmax(200px, 1.1fr);
  grid-template-areas:
    "scenes scenes scenes"
    "lampen weer warmte"
    "lampen afval warmte";
}
.tabpanel[data-tab="thuis"] .scene-bar { grid-area: scenes; }
.tabpanel[data-tab="thuis"] .panel-weer,
.tabpanel[data-tab="thuis"] .panel-afval { min-height: 0; }
.tabpanel[data-tab="thuis"] #weer-body,
.tabpanel[data-tab="thuis"] #afval-body { min-height: 0; overflow-y: auto; }
/* Lampen-kaart zo hoog als z'n inhoud (niet uitrekken); bij veel kamers
   vult hij de kolom en scrollen de tegels van binnen. */
.tabpanel[data-tab="thuis"] .panel-lights { grid-area: lampen; align-self: start; max-height: 100%; }
.tabpanel[data-tab="thuis"] .panel-weer { grid-area: weer; }
.tabpanel[data-tab="thuis"] .panel-afval { grid-area: afval; }
.tabpanel[data-tab="thuis"] .panel-tado { grid-area: warmte; }

/* Scène-knoppen (Goedemorgen / Welterusten / We gaan weg) */
.scene-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.scene-btn { min-width: 0; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--text); font-weight: 700; font-size: 1.02rem; box-shadow: var(--shadow); transition: transform 0.12s, background 0.2s; }
.scene-btn .sc-ic { font-size: 1.3rem; line-height: 1; flex: none; }
.scene-btn .sc-tx { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scene-btn:active { transform: scale(0.97); }
.scene-btn.busy { opacity: 0.6; }
.scene-btn.done { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
@media (max-width: 560px) {
  .scene-bar { gap: 6px; }
  .scene-btn { flex-direction: column; gap: 3px; padding: 10px 4px; font-size: 0.8rem; }
  .scene-btn .sc-ic { font-size: 1.15rem; }
}

/* VANDAAG: taken groot links; rechts routines, berichtjes en timer.
   Routines en berichtjes delen de ruimte eerlijk en scrollen van binnen. */
.tabpanel[data-tab="vandaag"] {
  grid-template-columns: 1.3fr 1fr;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr) auto;
  grid-template-areas: "todos routines" "todos berichten" "todos timer";
}
.tabpanel .msg-list { min-height: 0; flex: 1 1 auto; }
.tabpanel .todo-done-list { max-height: 32vh; overflow-y: auto; overscroll-behavior: contain; }
.tabpanel[data-tab="vandaag"] .panel-todos { grid-area: todos; }
.tabpanel[data-tab="vandaag"] .panel-routines { grid-area: routines; }
.tabpanel[data-tab="vandaag"] .panel-berichten { grid-area: berichten; min-height: 0; }
.tabpanel[data-tab="vandaag"] .panel-timer { grid-area: timer; }

/* MUZIEK: show-knoppen boven, daaronder het Sonos-paneel — volle breedte. */
.tabpanel[data-tab="muziek"] {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  align-items: start;
}
.tabpanel[data-tab="muziek"] .scene-bar { display: flex; justify-content: center; gap: 10px; }
.tabpanel[data-tab="muziek"] .scene-btn { flex: 0 1 auto; padding: 12px 26px; }
.tabpanel[data-tab="muziek"] #sonos-body { display: flex; flex-direction: column; min-height: 0; }
.scene-btn.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* AGENDA: agenda breed links, verjaardagen smaller rechts */
.tabpanel[data-tab="agenda"] { grid-template-columns: minmax(0, 680px) minmax(0, 340px); justify-content: center; }
.tabpanel[data-tab="agenda"] #bday-body { min-height: 0; overflow-y: auto; }

/* MEES & SIL: naslag — leeftijdsbalk boven, Voeding links, Ontwikkeling rechts. */
.tabpanel[data-tab="baby"] {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas: "bar bar" "voeding ontw";
}
.baby-agebar { grid-area: bar; }
.panel-voeding { grid-area: voeding; }
.panel-ontw { grid-area: ontw; }
#baby-voeding, #baby-ontw { flex: 1; min-height: 0; overflow-y: auto; }

/* Leeftijdsbalk met bladeren */
.baby-agebar { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; box-shadow: var(--shadow); }
.ab-nav { display: flex; align-items: center; gap: 12px; }
.ab-arrow { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg-soft); color: var(--text); font-size: 1.4rem; line-height: 1; }
.ab-arrow:disabled { opacity: 0.35; }
.ab-label { flex: 1; text-align: center; display: flex; flex-direction: column; gap: 1px; }
.ab-band { font-weight: 800; font-size: 1.05rem; }
.ab-now { color: var(--text-dim); font-size: 0.82rem; }
.ab-back { display: block; margin: 8px auto 0; }
.baby-agebar .baby-count { margin: 10px 0 0; }

/* Richtschema-tabel */
.vg-schema { margin-bottom: 6px; }
.vg-schema h3 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-dim); margin-bottom: 8px; }
.vg-table { width: 100%; border-collapse: collapse; background: var(--bg-soft); border-radius: var(--radius-sm); overflow: hidden; }
.vg-table td { padding: 9px 12px; font-size: 0.95rem; border-bottom: 1px solid var(--border); }
.vg-table tr:last-child td { border-bottom: 0; }
.vg-table td:first-child { color: var(--text-dim); }
.vg-table td:last-child { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.vg-vuist { font-size: 0.82rem; color: var(--text-dim); line-height: 1.45; margin-top: 8px; }

/* Voeding-items */
.vg-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.vg-ic { font-size: 1.3rem; flex: none; line-height: 1.4; }
.vg-item b { display: block; margin-bottom: 2px; }
.vg-item p { color: var(--text-dim); font-size: 0.92rem; line-height: 1.4; }
.vg-ritme { margin-top: 12px; }
.vg-ritme b { display: block; margin-bottom: 6px; }
.vg-ritme ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; }
.vg-ritme li { font-size: 0.92rem; line-height: 1.35; }

/* Ontwikkeling per onderwerp */
.ow-cat { margin-bottom: 14px; }
.ow-cat h3 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-dim); margin-bottom: 6px; }
.ow-cat ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; }
.ow-cat li { font-size: 0.92rem; line-height: 1.35; }

.baby-count { font-size: 1.05rem; font-weight: 700; background: var(--bg-soft); border-radius: var(--radius-sm); padding: 12px 14px; text-align: center; }
.baby-leap { border-left: 3px solid var(--border); padding: 2px 0 2px 12px; margin-bottom: 14px; }
.baby-leap.active { border-left-color: #22c55e; }
.baby-leap b { display: block; margin-bottom: 3px; }
.baby-leap p { color: var(--text-dim); font-size: 0.9rem; line-height: 1.4; }
.baby-note { font-size: 0.8rem; color: var(--text-dim); line-height: 1.5; margin-top: 8px; }

.baby-alert { display: block; background: rgba(34, 197, 94, 0.12); border: 1px solid rgba(34, 197, 94, 0.3); color: var(--text); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 10px; font-size: 0.95rem; cursor: pointer; }

/* Feest-banner + confetti op de verjaardag van de kinderen 🎉 */
.party-banner {
  display: block; text-align: center; cursor: pointer;
  font-size: 1.15rem; font-weight: 700; color: #fff;
  padding: 14px 16px; border-radius: var(--radius-sm); margin-bottom: 10px;
  box-shadow: var(--shadow); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  background: linear-gradient(90deg, #ff6b6b, #ffd93d, #6bcbef, #a78bfa, #ff6b6b);
  background-size: 300% 100%; animation: party-shift 6s linear infinite;
}
@keyframes party-shift { to { background-position: 300% 0; } }

.confetti-layer { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 9998; }
.confetti-piece {
  position: absolute; top: -8vh; line-height: 1; will-change: transform;
  animation-name: confetti-fall; animation-timing-function: linear; animation-fill-mode: forwards;
}
@keyframes confetti-fall { to { transform: translateY(118vh) rotate(600deg); } }
@media (prefers-reduced-motion: reduce) { .party-banner { animation: none; } }
.confetti-piece.sticker { object-fit: cover; border-radius: 50%; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); }

/* Beheer-schermpje (stickers) */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); display: flex; align-items: center; justify-content: center; z-index: 10000; padding: 20px; }
.modal.hidden { display: none; }
.modal-box { background: var(--card); color: var(--text); border-radius: var(--radius); padding: 22px; width: min(560px, 100%); max-height: 85vh; overflow-y: auto; box-shadow: var(--shadow); }
.modal-title { margin: 0 0 6px; font-size: 1.2rem; }
.modal-help { color: var(--text-dim); font-size: 0.9rem; line-height: 1.5; margin: 0 0 12px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.settings-list { display: grid; gap: 8px; }
.settings-item { text-align: left; padding: 13px 15px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-soft); color: var(--text); font-weight: 600; font-size: 1.02rem; }
.settings-item:active { transform: scale(0.99); }
.set-row { display: flex; flex-wrap: wrap; gap: 8px; }
.set-row input { flex: 1; min-width: 120px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px; color: var(--text); padding: 12px 14px; }

.stickers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.sticker-thumb { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--bg-soft); }
.sticker-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sticker-del { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 1.05rem; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* Staand of smal scherm: panelen gewoon onder elkaar (blokken) mét scrollen.
   display:block zet de bureaublad-grid uit, zodat de grid-area's geen panelen
   meer over elkaar heen leggen. */
@media (max-width: 900px) {
  .dash { height: auto; overflow: visible; }
  .tabpanel.active { display: block; }
  .tabpanel.active > .panel { margin-bottom: 14px; }
  .tabpanel .panel { overflow: visible; }
  .tabpanel .rooms, .tabpanel .todo-list, .tabpanel .cal-events,
  .tabpanel #tado-body, .tabpanel #sonos-body,
  .tabpanel #weer-body, .tabpanel #afval-body, .tabpanel #bday-body { overflow: visible; }
}

/* Telefoon: laat de vier tabknoppen krimpen zodat ze op één rij passen
   (anders lopen ze buiten het scherm en ontstaat er horizontaal geschuif). */
@media (max-width: 560px) {
  .tabbar { gap: 6px; }
  .tabbtn { min-width: 0; flex-direction: column; gap: 3px; padding: 8px 4px; }
  .tabbtn .ti { font-size: 1.25rem; }
  .tabbtn .tl { font-size: 0.78rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar { gap: 8px; }
  .topbar-right { gap: 8px; }
  .btn-alloff { padding: 12px 16px; font-size: 1rem; }
}

/* ---------- weer ---------- */

.weer-plaats { text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--text-dim); margin-left: 4px; }
.weer-main { display: flex; align-items: center; gap: 14px; }
.weer-icon { font-size: 3rem; line-height: 1; flex: none; }
.weer-temp { font-size: 2.4rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.weer-text { color: var(--text); font-weight: 600; }
.weer-meta { color: var(--text-dim); font-size: 0.9rem; margin-top: 3px; }
.weer-advice { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.weer-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 999px; padding: 7px 13px; font-size: 0.92rem; font-weight: 600; }
.weer-days { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; margin-top: 14px; }
.weer-day {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px; padding: 8px 4px;
}
.weer-day .wd-name { color: var(--text-dim); font-size: 0.78rem; font-weight: 700; text-transform: capitalize; }
.weer-day .wd-icon { font-size: 1.25rem; line-height: 1.2; }
.weer-day .wd-max { font-weight: 700; font-variant-numeric: tabular-nums; }
.weer-day .wd-min { color: var(--text-dim); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.weer-day .wd-rain { color: var(--cool); font-size: 0.72rem; font-variant-numeric: tabular-nums; }

.weer-set { margin-top: 12px; display: flex; gap: 8px; }
.weer-set input { flex: 1; min-width: 0; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px; color: var(--text); padding: 10px 12px; }
.weer-setlink { display: block; margin: 8px auto 0; font-size: 0.85rem; }

/* ---------- afvalkalender ---------- */

.afval-list { display: grid; gap: 8px; }
.afval-row { display: flex; align-items: center; gap: 12px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px; padding: 10px 13px; }
.afval-row.soon { border-color: var(--accent); background: var(--card-on); }
.afval-emoji { font-size: 1.35rem; flex: none; }
.afval-naam { flex: 1; min-width: 0; font-weight: 600; }
.afval-when { color: var(--text-dim); font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.afval-row.soon .afval-when { color: var(--accent); font-weight: 700; }
.afval-empty { color: var(--text-dim); padding: 8px 0; }
.afval-set { margin-top: 10px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; }
.afval-set input { min-width: 0; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px; color: var(--text); padding: 10px 12px; }
.afval-set .btn-primary { grid-column: 1 / -1; }
.afval-setlink { display: block; margin: 8px auto 0; font-size: 0.85rem; }

/* Compacte afval-melding onder de klok (alleen zichtbaar de dag ervóór) */
.afval-alert {
  display: flex; align-items: center; gap: 12px; flex: none;
  background: var(--card-on); border: 1px solid var(--accent);
  border-radius: 999px; padding: 7px 8px 7px 16px; margin-bottom: 10px;
  font-size: 0.98rem; cursor: pointer;
}
.afval-alert .aa-text { flex: 1; min-width: 0; }
.afval-alert .aa-text b { font-weight: 800; }
.afval-alert .aa-done {
  flex: none; border: none; background: var(--accent); color: var(--accent-ink);
  border-radius: 999px; padding: 8px 16px; font-weight: 700; white-space: nowrap;
}
.afval-alert .aa-done:active { transform: scale(0.96); }

/* ---------- verjaardagen ---------- */

.bday-list { display: grid; gap: 8px; }
.bday-row { display: flex; align-items: center; gap: 12px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px; padding: 10px 13px; }
.bday-row.soon { border-color: var(--accent); background: var(--card-on); }
.bday-emoji { font-size: 1.35rem; flex: none; }
.bday-name { flex: 1; min-width: 0; font-weight: 600; }
.bday-when { color: var(--text-dim); white-space: nowrap; text-align: right; }
.bday-row.soon .bday-when { color: var(--accent); font-weight: 700; }
.bday-empty { color: var(--text-dim); line-height: 1.5; }

/* Feestelijke verjaardag-melding onder de klok */
.bday-alert {
  display: flex; align-items: center; gap: 12px; flex: none;
  background: var(--card-on); border: 1px solid var(--accent);
  border-radius: 999px; padding: 9px 18px; margin-bottom: 10px;
  font-size: 1rem; cursor: pointer;
}
.bday-alert .ba-emoji { font-size: 1.5rem; flex: none; }
.bday-alert .ba-text b { font-weight: 800; }

/* 🏠/🎂-schakelaars in "agenda's beheren" */
.cal-list li > span:first-child { flex: 1; min-width: 0; }
.cal-bday, .cal-fam { background: none; border: none; font-size: 1.1rem; padding: 6px 8px; filter: grayscale(1) opacity(0.5); }
.cal-bday.active, .cal-fam.active { filter: none; }

/* ---------- Gezin vandaag-strip ---------- */

.gezin-strip {
  display: flex; align-items: center; gap: 12px; flex: none; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--border); border-radius: 999px;
  padding: 9px 18px; margin-bottom: 10px; cursor: pointer; box-shadow: var(--shadow);
}
.gezin-strip .gz-label { color: var(--accent); font-weight: 800; flex: none; }
.gezin-strip .gz-list { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.gezin-strip .gz-item b { font-variant-numeric: tabular-nums; }
.gezin-strip .gz-item.gz-past { color: var(--text-dim); text-decoration: line-through; }
.gezin-strip .gz-sep { color: var(--text-dim); }
.gezin-strip .gz-empty { color: var(--text-dim); }

/* ---------- nu & straks ---------- */

.nownext {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--border); border-radius: 999px;
  padding: 12px 20px; margin-bottom: 16px; font-size: 1.05rem; flex-wrap: wrap;
  box-shadow: var(--shadow);
}
.nownext .nn-label { color: var(--accent); font-weight: 800; flex: none; }
.nownext .nn-title { font-weight: 700; }
.nownext .nn-when { color: var(--text-dim); }
.nownext .nn-count { margin-left: auto; color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nownext.soon { border-color: var(--accent); box-shadow: 0 0 30px var(--glow); }
.nownext.soon .nn-count { font-size: 1.2rem; }

/* ---------- lampen (Homey-tegels) ---------- */

.rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(140px, 100%), 1fr)); gap: 10px; }
.rooms > .room { min-width: 0; }

.room {
  position: relative; overflow: hidden;
  background: var(--card-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px; transition: background 0.25s, border-color 0.25s;
}
.room > * { position: relative; z-index: 1; }
.room.on { background: var(--card-on); border-color: rgba(255, 194, 61, 0.5); }
.room.on::after {
  content: ""; position: absolute; z-index: 0; top: -34%; right: -28%;
  width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, var(--glow), transparent 70%); pointer-events: none;
}

.room-head { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: none; padding: 0; text-align: left; }
.room-head > span:last-child { flex: 1; min-width: 0; }
.room-bulb {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  display: grid; place-items: center; font-size: 1.1rem;
  background: var(--bg-soft); filter: grayscale(1) opacity(0.5); transition: filter 0.25s, background 0.25s;
}
.room.on .room-bulb { filter: none; background: var(--warm-soft); }
.room-name { font-size: 0.98rem; font-weight: 650; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-sub { color: var(--text-dim); font-size: 0.78rem; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room.on .room-sub { color: var(--accent); }

.room-bri {
  width: 100%; margin: 9px 0 0; appearance: none; -webkit-appearance: none;
  height: 20px; border-radius: 7px; background: var(--bg-soft); outline: none;
}
.room-bri::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); border: 2px solid var(--card); }
.room-bri::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); border: 2px solid var(--card); }
.room:not(.on) .room-bri { opacity: 0.4; }

.room-expand { background: none; border: none; color: var(--text-dim); padding: 5px 0 0; font-size: 0.76rem; }
.room-lights { margin-top: 7px; display: grid; gap: 6px; }
.light-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; padding: 8px 11px; width: 100%;
}
.light-row .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--border); flex: none; }
.light-row.on .dot { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.light-row .light-name { flex: 1; text-align: left; }

.soft-error { color: var(--text-dim); }
.hueapp-btn { grid-column: 1 / -1; padding: 22px; font-size: 1.15rem; border-radius: var(--radius); }

/* ---------- pil-tabs (agenda, routines, radio, verwarming) ---------- */

.cal-tabs, .sonos-rooms, .tado-zones { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.cal-tab, .sonos-roomtab, .tado-zonetab {
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--text-dim);
  border-radius: 999px; padding: 8px 16px; font-weight: 600; font-size: 0.92rem;
}
.cal-tab.active, .sonos-roomtab.active, .tado-zonetab.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.sonos-groupall { display: block; width: 100%; margin: -4px 0 12px; padding: 8px; text-align: center; font-weight: 600; }
.sonos-groupall:disabled { opacity: 0.6; }

/* ---------- agenda ---------- */

.cal-events { display: grid; gap: 6px; max-height: 260px; overflow-y: auto; }
.cal-day { color: var(--text-dim); font-weight: 700; font-size: 0.85rem; text-transform: capitalize; letter-spacing: 0.02em; margin: 8px 0 2px; }
.cal-day.today { color: var(--accent); }
.cal-day:first-child { margin-top: 0; }
.cal-event { display: flex; align-items: baseline; gap: 12px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px; padding: 9px 13px; }
.cal-event.past { opacity: 0.45; } /* al geweest */
.cal-event.now { border-color: var(--accent); background: var(--accent-soft); } /* nu bezig */

/* Kleurstipje: welke agenda hoort hierbij (in de Alles-weergave en de tabjes). */
.cal-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; align-self: center; }
.cal-tab .cal-dot { display: inline-block; margin-right: 7px; vertical-align: baseline; }
.cal-dot.c0 { background: var(--p0); }
.cal-dot.c1 { background: var(--p1); }
.cal-dot.c2 { background: var(--green); }
.cal-dot.c3 { background: var(--heat); }
.cal-dot.c4 { background: var(--cool); }
.cal-dot.c5 { background: var(--accent); }

/* Chip achter de titel: "nu" of "over 25 min". */
.cal-chip { display: inline-block; margin-left: 8px; font-size: 0.75rem; font-weight: 700; border-radius: 999px; padding: 2px 8px; vertical-align: baseline; white-space: nowrap; }
.cal-chip.now { background: var(--accent); color: var(--accent-ink); }
.cal-chip.until { background: var(--bg-soft); border: 1px solid var(--border); color: var(--text-dim); }
.cal-time { flex: none; min-width: 96px; white-space: nowrap; color: var(--text-dim); font-variant-numeric: tabular-nums; font-size: 0.95rem; }
.cal-title { flex: 1; min-width: 0; line-height: 1.35; }
.cal-loc { display: block; color: var(--text-dim); font-size: 0.85rem; margin-top: 2px; }
.cal-empty { color: var(--text-dim); text-align: center; padding: 18px 0; }
.btn-cal-manage { display: block; margin: 10px auto 0; font-size: 0.85rem; }
.cal-manage { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 14px; }
.cal-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.cal-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; padding: 8px 8px 8px 14px; }
.cal-list .cal-del { background: none; border: none; color: var(--text-dim); font-size: 1.1rem; padding: 6px 10px; }
.cal-form { display: grid; gap: 8px; }
.cal-form input { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px; color: var(--text); padding: 12px 14px; }
.cal-help { color: var(--text-dim); font-size: 0.85rem; line-height: 1.6; margin: 12px 0 0; }

/* ---------- timer ---------- */

.timer-chips { display: flex; gap: 10px; flex-wrap: wrap; }
.timer-chip { flex: 1; min-width: 80px; padding: 16px 10px; font-size: 1.05rem; border-radius: var(--radius-sm); }
.timer-run { display: flex; align-items: center; gap: 16px; }
.timer-left { font-size: 2.2rem; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 110px; }
.timer-bar { flex: 1; height: 22px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.timer-fill { height: 100%; width: 100%; background: var(--accent); border-radius: 999px; transition: width 1s linear; }
.timer-done-flash { animation: timerflash 0.6s ease-in-out 5; }
@keyframes timerflash { 50% { background: var(--accent-soft); } }

/* ---------- gedeelde muziek/bediening-stijlen (Sonos, verwarming) ---------- */

.sp-now { display: flex; gap: 14px; align-items: center; }
.sp-cover { width: 72px; height: 72px; border-radius: 14px; background: var(--bg-soft); object-fit: cover; flex: none; }
.sp-meta { flex: 1; min-width: 0; }
.sp-title { font-weight: 700; font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-artist { color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-device { color: var(--text-dim); font-size: 0.85rem; margin-top: 2px; }
.sp-controls { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.sp-btn { flex: none; width: 50px; height: 50px; border-radius: 50%; border: 1px solid var(--border); background: var(--card-2); color: var(--text); font-size: 1.25rem; display: flex; align-items: center; justify-content: center; }
.sp-btn.sp-play { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); width: 58px; height: 58px; font-size: 1.4rem; }
.sp-vol { flex: 1; display: flex; align-items: center; gap: 8px; }
.sp-vol input { flex: 1; appearance: none; -webkit-appearance: none; height: 24px; border-radius: 10px; background: var(--bg-soft); outline: none; }
.sp-vol input::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); border: 2px solid var(--card); }
.sp-vol input::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); border: 2px solid var(--card); }
.sp-msg { color: var(--text-dim); text-align: center; padding: 14px 0; line-height: 1.5; }
.sp-connect { width: 100%; padding: 16px; font-size: 1.05rem; margin-top: 6px; }
.sp-setup { display: grid; gap: 8px; }
.sp-setup input { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px; color: var(--text); padding: 12px 14px; }
.sp-help { color: var(--text-dim); font-size: 0.85rem; line-height: 1.6; }
.sp-help code { background: var(--bg-soft); padding: 2px 6px; border-radius: 6px; word-break: break-all; }
.sp-foot { text-align: center; margin-top: 10px; }

/* ---------- verwarming (Tado) ---------- */

/* Ronde thermostaat-wijzerplaat */
.tado-dial { position: relative; width: min(200px, 72%); margin: 4px auto 2px; }
.tado-dial svg { width: 100%; height: auto; display: block; overflow: visible; }
.tado-track { fill: none; stroke: var(--bg-soft); stroke-width: 11; stroke-linecap: round; }
.tado-arc { fill: none; stroke: var(--accent); stroke-width: 11; stroke-linecap: round; transition: stroke 0.3s; filter: drop-shadow(0 0 5px var(--glow)); }
.tado-dial.heating .tado-arc { stroke: var(--heat); filter: drop-shadow(0 0 10px rgba(255, 140, 66, 0.6)); }
.tado-dial-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.tado-target-big { font-size: 2.5rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.tado-dial.off .tado-target-big { font-size: 1.5rem; color: var(--text-dim); }
.tado-now { color: var(--text-dim); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.tado-row { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 8px; }
.tado-state { min-width: 104px; text-align: center; color: var(--text-dim); font-size: 0.9rem; }
.tado-state .heating { color: var(--heat); font-weight: 700; }
.tado-btn { width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--border); background: var(--card-2); color: var(--text); font-size: 1.6rem; line-height: 1; box-shadow: var(--shadow); transition: transform 0.1s; flex: none; }
.tado-btn:active { transform: scale(0.94); }
.tado-auto { margin-top: 10px; }
.tado-auto .btn-link { display: block; text-align: center; margin: 0 auto; }

/* ---------- radio (Sonos) ---------- */

.sonos-room { color: var(--text-dim); font-weight: 600; letter-spacing: 0; text-transform: none; font-size: 0.85rem; }

/* Compacte spelerbalk bovenaan: hoesje, naam, play en volume op één rij. */
.sonos-player {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: linear-gradient(120deg, var(--accent-soft), var(--bg-soft) 65%);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 14px; margin-bottom: 12px;
}
.np-art {
  position: relative; flex: none; width: 64px; height: 64px; border-radius: 14px; overflow: hidden;
  background: var(--bg-soft); display: flex; align-items: center; justify-content: center;
}
.np-art img { width: 100%; height: 100%; object-fit: cover; }
.np-note { font-size: 1.8rem; opacity: 0.45; }
.np-art .eq { position: absolute; right: 4px; bottom: 4px; background: rgba(0, 0, 0, 0.45); border-radius: 6px; padding: 3px 4px; }
.np-meta { flex: 1 1 140px; min-width: 0; }
.np-name { font-weight: 800; font-size: 1.08rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-sub { color: var(--text-dim); font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sonos-player .sp-btn.sp-play { width: 50px; height: 50px; font-size: 1.2rem; }
.sonos-player .sp-vol { flex: 3 1 200px; }
.sonos-player .sp-vol input { background: var(--card-2); border: 1px solid var(--border); }

/* Zender-tegels: klein hoesje met de naam ernaast; de spelende licht op. */
.sonos-stations { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 10px; align-content: start; overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
.sonos-station { display: flex; align-items: center; gap: 10px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; text-align: left; color: var(--text); transition: transform 0.12s; }
.sonos-station:active { transform: scale(0.97); }
.sonos-station.playing { border-color: var(--accent); background: var(--accent-soft); }
.st-art { position: relative; flex: none; width: 46px; height: 46px; border-radius: 10px; overflow: hidden; background: var(--card-2); display: flex; align-items: center; justify-content: center; }
.st-art img { width: 100%; height: 100%; object-fit: cover; }
.st-note { font-size: 1.3rem; opacity: 0.8; }
.st-note.n0 { filter: hue-rotate(0deg); } /* elk tegeltje z'n eigen tintje */
.st-note.n1 { filter: hue-rotate(140deg); }
.st-note.n2 { filter: hue-rotate(230deg); }
.st-note.n3 { filter: hue-rotate(310deg); }
.st-art .eq { position: absolute; right: 3px; bottom: 3px; background: rgba(0, 0, 0, 0.45); border-radius: 5px; padding: 2px 3px; }
.sonos-station .ss-name { flex: 1; min-width: 0; font-weight: 700; font-size: 0.95rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sonos-controls { display: flex; align-items: center; gap: 10px; margin-top: 12px; }

/* Bewegend equalizertje (alleen als er echt muziek speelt) */
.eq { display: inline-flex; gap: 2.5px; align-items: flex-end; height: 13px; }
.eq span { width: 3px; border-radius: 2px; background: var(--accent); animation: eqbounce 0.9s ease-in-out infinite; }
.eq span:nth-child(2) { animation-delay: 0.25s; }
.eq span:nth-child(3) { animation-delay: 0.5s; }
@keyframes eqbounce { 0%, 100% { height: 4px; } 50% { height: 13px; } }
@media (prefers-reduced-motion: reduce) { .eq span { animation: none; height: 9px; } }

/* Smal scherm: het volume schuift vanzelf naar een tweede regel (flex-wrap). */
@media (max-width: 700px) {
  .sonos-stations { overflow: visible; }
}

/* ---------- routines ---------- */

.routine-form { margin-top: 10px; }

/* ---------- wie-doet-wat ---------- */

.owner-chips { display: flex; gap: 8px; margin: 10px 0 4px; flex-wrap: wrap; }
.owner-chip { border: 1px solid var(--border); background: var(--bg-soft); color: var(--text-dim); border-radius: 999px; padding: 8px 16px; font-weight: 600; font-size: 0.95rem; }
.owner-chip.active { color: #10131a; border-color: transparent; }
.owner-chip.p0.active { background: var(--p0); }
.owner-chip.p1.active { background: var(--p1); }
.todo-owner { flex: none; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem; color: #10131a; }
.todo-owner.p0 { background: var(--p0); }
.todo-owner.p1 { background: var(--p1); }
.todo-recurring-row { margin: 6px 2px 12px; }

/* ---------- taken ---------- */

.todo-count { color: var(--accent); margin-left: 6px; letter-spacing: 0; font-weight: 700; }
.todo-form { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.todo-form input[type="text"] { flex: 1; min-width: 0; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); padding: 13px 14px; }
.recurring-toggle { display: flex; align-items: center; gap: 5px; color: var(--text-dim); font-size: 0.85rem; white-space: nowrap; user-select: none; }
.recurring-toggle input { width: 18px; height: 18px; accent-color: var(--accent); }
.btn-add { padding: 10px 16px; font-size: 1.4rem; line-height: 1; border-radius: var(--radius-sm); }
.todo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.todo { display: flex; align-items: center; gap: 12px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 10px 6px 6px; }
.todo-check { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 2.5px solid var(--text-dim); background: none; font-size: 1.25rem; color: transparent; transition: all 0.15s; }
.todo.done .todo-check { border-color: var(--green); background: var(--green); color: #062814; }
.todo-text { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 1.08rem; line-height: 1.35; padding: 8px 0; }
/* Smal scherm: compactere taakrijen, zodat tekst + plaatjes samen passen. */
@media (max-width: 480px) {
  .todo { gap: 6px; padding: 6px 6px 6px 4px; }
  .todo-check { width: 36px; height: 36px; }
  .todo-text { font-size: 1rem; }
  .todo-due { padding: 3px 6px; font-size: 0.75rem; }
  .todo-owner { width: 26px; height: 26px; font-size: 0.8rem; }
  .todo-del { padding: 8px 4px; }
}
.todo.done .todo-text { color: var(--text-dim); text-decoration: line-through; }
.todo-badge { color: var(--text-dim); font-size: 0.95rem; flex: none; }
.todo-del { flex: none; background: none; border: none; color: var(--text-dim); font-size: 1.2rem; padding: 10px; opacity: 0.6; }
.todo-empty { color: var(--text-dim); text-align: center; padding: 24px 0; font-size: 1.1rem; }

/* Eén nette rij onder de invoer: naam-chips links, deadline en "elke dag" rechts. */
.todo-opts { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 2px 12px; flex-wrap: wrap; }
.todo-opts .owner-chips { margin: 0; flex: 1; }

/* Deadline: "vóór hoe laat" kiezen en tonen. Oranje = binnen een uur, rood = te laat. */
.due-picker { display: flex; align-items: center; gap: 5px; color: var(--text-dim); font-size: 0.95rem; }
.due-picker input { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; color: var(--text); padding: 6px 8px; font-size: 0.9rem; font-family: inherit; }
.todo-due { flex: none; font-size: 0.82rem; font-weight: 600; color: var(--text-dim); background: var(--bg-soft); border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.todo-due.soon { color: var(--heat); border-color: var(--heat); }
.todo-due.late { color: var(--red); border-color: var(--red); font-weight: 800; }
.todo.soon { border-color: color-mix(in srgb, var(--heat) 45%, var(--border)); }
.todo.late { border-color: color-mix(in srgb, var(--red) 55%, var(--border)); }

/* Gedaan-vandaag: rustig onder een streep, doorgestreept en gedimd. */
.todo-done-wrap { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 10px; }
.done-title { margin: 0 0 8px; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); }
.done-count { color: var(--green); }
.todo-done-list .todo { opacity: 0.72; }
.todo-time { flex: none; color: var(--text-dim); font-size: 0.82rem; white-space: nowrap; }

/* Berichtjes: notities voor elkaar. */
.msg-chips { margin: 0 2px 10px; }
.msg-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; overflow-y: auto; }
.msg { display: flex; align-items: flex-start; gap: 10px; background: var(--bg-soft); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius-sm); padding: 10px 6px 10px 12px; }
.msg-body { flex: 1; min-width: 0; }
.msg-text { font-size: 1.02rem; line-height: 1.4; overflow-wrap: break-word; }
.msg-meta { color: var(--text-dim); font-size: 0.8rem; margin-top: 3px; }
.msg .todo-del { padding: 4px 8px; }
.msg-from { font-weight: 700; }
.msg-from.p0 { color: var(--p0); }
.msg-from.p1 { color: var(--p1); }

.foot { text-align: center; padding: 12px 0 6px; display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.foot .btn-link { color: var(--text-dim); opacity: 0.7; }

/* ---------- Tablet of Terror ---------- */

/* De dekking wordt via JavaScript aangestuurd, in hetzelfde ritme als de
   lampen en het geluid. */
.terror-flash { position: fixed; inset: 0; z-index: 2000; background: #c00000; opacity: 0; pointer-events: none; }

/* ---------- screensaver / fotolijst ---------- */

.screensaver { position: fixed; inset: 0; z-index: 999; background: #000; cursor: pointer; }
.ss-photo {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  opacity: 0; transition: opacity 1.6s ease;
}
.ss-photo.show { opacity: 1; }
.ss-scrim {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.68), rgba(0, 0, 0, 0.15) 32%, transparent 55%);
}
.ss-overlay { position: absolute; inset: 0; pointer-events: none; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding-bottom: 6vh; }
.ss-info { display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: 92vw; }
.ss-greet {
  color: #fff; font-size: clamp(1.3rem, 3vw, 2.1rem); font-weight: 700;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.85); margin-bottom: 2px;
}
.ss-clock {
  color: #fff; font-size: clamp(2.5rem, 8vw, 6rem); font-weight: 800; line-height: 1;
  font-variant-numeric: tabular-nums; text-shadow: 0 2px 24px rgba(0, 0, 0, 0.7);
}
.ss-date {
  color: #fff; font-size: clamp(1.1rem, 2.6vw, 1.8rem); font-weight: 600; text-transform: capitalize;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.8);
}
.ss-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; }
.ss-chip {
  color: #fff; background: rgba(0, 0, 0, 0.42); border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px; padding: 8px 16px; font-size: clamp(0.95rem, 2vw, 1.25rem); font-weight: 600;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.ss-hint { color: rgba(255, 255, 255, 0.6); margin-top: 16px; font-size: 0.95rem; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7); }
@media (prefers-reduced-motion: reduce) { .ss-photo { transition: none; } }

/* ---------- bewegingsvoorkeur ---------- */

@media (prefers-reduced-motion: reduce) { *, .timer-done-flash { transition: none !important; animation: none !important; } }

/* ---------- telefoon ---------- */

@media (max-width: 760px) {
  .columns { grid-template-columns: 1fr; }
  .col-b { order: -1; }
  .clock { font-size: 2.4rem; }
  .rooms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .room-name { font-size: 1rem; }
}

/* ---------- rust-pas: minder visuele drukte ----------
   Kleur en randen alleen waar ze iets betekenen. Gewone lijst-items zijn
   rustige vlakken; alleen actieve/urgente items krijgen een rand. */
.todo:not(.soon):not(.late), .cal-event:not(.now), .sonos-station:not(.playing),
.afval-row:not(.soon), .bday-row:not(.soon), .weer-day, .msg { border-color: transparent; }
.msg { border-left-color: var(--accent); }

/* Hulplinkjes (bewerken/ontkoppelen) zijn er wel, maar vragen geen aandacht. */
.btn-cal-manage, .sp-foot .btn-link { font-size: 0.8rem; opacity: 0.6; text-decoration: none; }
.btn-cal-manage:active, .sp-foot .btn-link:active { opacity: 1; }

/* Maximaal één melding tegelijk (gestuurd vanuit enforceOneAlert). */
.alert-suppressed { display: none !important; }
