/* ============================================================================
   Bediening (dashboard). Alles staat onder #ctl, zodat de rest van de app niet verandert.
   Vaste maten: ruimte 4/8/12/16/24 px, hoeken 10/14 px, tekst 12/13/14/15/26 px.
   ========================================================================== */
#ctl {
  --d-surface: rgba(255,255,255,.035);
  --d-surface-2: rgba(255,255,255,.07);
  --d-border: color-mix(in srgb, var(--line) 85%, transparent);
  --d-good: #2ee6a6; --d-warn: #ffb703; --d-bad: var(--err);
  --d-r: 14px; --d-r-sm: 10px;
}
[data-theme="light"] #ctl {
  --d-surface: rgba(255,255,255,.7);
  --d-surface-2: rgba(255,255,255,.95);
  --d-good: #12865a; --d-warn: #a86a00;
}
#ctl :focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* ---- kader: vaste kop, scrollende inhoud ---------------------------------- */
#ctl.panel { align-items: start; padding: calc(16px + env(safe-area-inset-top)) 12px 16px; }
#ctl .ctl-box {
  width: min(1000px, 100%); max-height: min(92dvh, 940px); padding: 0; gap: 0; overflow: hidden;
  display: flex; flex-direction: column; border-radius: 18px;
}
.ctl-top { flex: none; padding: 16px 20px 0; background: var(--panel); border-bottom: 1px solid var(--d-border); }
.ctl-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.ctl-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ctl-title svg { flex: none; color: var(--cyan); }
.ctl-title strong { display: block; font-size: 18px; line-height: 1.2; letter-spacing: .01em; }
.ctl-title small { display: block; font-size: 12px; color: var(--dim); line-height: 1.3; }
.ctl-actions { display: flex; gap: 8px; flex: none; }
#ctl .icon-btn { width: 36px; height: 36px; padding: 0; display: grid; place-items: center; border-radius: 10px; background: transparent; }
#ctl .icon-btn.spin svg { animation: ctlspin .8s linear infinite; }
@keyframes ctlspin { to { transform: rotate(360deg); } }

/* ---- tabbladen ------------------------------------------------------------ */
.ctl-tabs { display: flex; gap: 2px; margin: 0 -8px; overflow-x: auto; scrollbar-width: none; }
.ctl-tabs::-webkit-scrollbar { display: none; }
#ctl .ctl-tabs button {
  height: auto; flex: none; display: flex; align-items: center; gap: 8px; padding: 10px 14px; border: 0; border-radius: 0;
  border-bottom: 2px solid transparent; background: transparent; color: var(--dim); font-size: 14px; white-space: nowrap; box-shadow: none;
}
#ctl .ctl-tabs button svg { opacity: .75; flex: none; }
#ctl .ctl-tabs button:hover:not([aria-selected="true"]) { color: var(--text); background: var(--d-surface); box-shadow: none; }
#ctl .ctl-tabs button[aria-selected="true"] { color: var(--cyan); border-bottom-color: var(--cyan); }
#ctl .ctl-tabs button[aria-selected="true"] svg { opacity: 1; }

/* melding (gelukt / fout) tussen kop en inhoud */
#ctl-msg { margin: 0; padding: 8px 20px; font-size: 13px; background: color-mix(in srgb, var(--d-bad) 14%, transparent); color: var(--d-bad); border-bottom: 1px solid var(--d-border); min-height: 0; }
#ctl-msg.ok { background: color-mix(in srgb, var(--d-good) 14%, transparent); color: var(--d-good); }
#ctl-msg:empty { display: none; }

.ctl-body { flex: 1; overflow-y: auto; padding: 16px 20px 24px; overscroll-behavior: contain; }
#ctl section[role="tabpanel"] { display: flex; flex-direction: column; gap: 12px; }
#ctl section[role="tabpanel"][hidden] { display: none; }
#ctl section[role="tabpanel"]:not([hidden]) { animation: ctlin .18s ease-out; }
@keyframes ctlin { from { opacity: 0; transform: translateY(4px); } }

/* ---- kopjes, tekst, knoppen ------------------------------------------------ */
.ctl-h { display: flex; align-items: center; gap: 12px; margin: 8px 0 0; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.ctl-h::after { content: ""; flex: 1; height: 1px; background: var(--d-border); }
.ctl-h small { text-transform: none; letter-spacing: 0; font-weight: 400; opacity: .85; }
.ctl-h .count { font-size: 12px; letter-spacing: 0; padding: 0 8px; border-radius: 999px; background: var(--d-surface-2); color: var(--text); }
.ctl-desc { font-size: 13px; color: var(--dim); line-height: 1.4; margin: 0; }
.ctl-desc.late, .late { color: var(--d-bad); }
.ctl-note { font-size: 12.5px; color: var(--dim); margin: 4px 0 0; line-height: 1.45; }
.ctl-empty { color: var(--dim); font-size: 14px; padding: 14px; text-align: center; border: 1px dashed var(--d-border); border-radius: var(--d-r-sm); list-style: none; margin: 0; }
p.ctl-empty { margin: 0; }

#ctl button { border-radius: var(--d-r-sm); font-size: 14px; padding: 0 14px; height: 36px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
#ctl button.ghost { background: transparent; border-color: var(--d-border); }
#ctl button.primary { background: var(--cyan); color: #04202a; border-color: var(--cyan); font-weight: 600; }
#ctl button.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--cyan) 88%, white); box-shadow: 0 0 14px rgba(0,229,255,.4); }
#ctl button.small { height: 28px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
#ctl button.del, #ctl button.done { width: 34px; height: 34px; padding: 0; flex: none; font-size: 15px; }
#ctl button.del { color: var(--d-bad); border-color: color-mix(in srgb, var(--d-bad) 45%, transparent); }
#ctl button.done { color: var(--d-good); border-color: color-mix(in srgb, var(--d-good) 45%, transparent); }
[data-theme="light"] #ctl button.primary { color: #fff; background: var(--cyan); }
#ctl input[type="text"], #ctl input[type="date"], #ctl input[type="time"], #ctl input[type="datetime-local"], #ctl input[type="number"], #ctl select {
  height: 36px; padding: 0 12px; border-radius: var(--d-r-sm); border: 1px solid var(--d-border); background: var(--d-surface); color: inherit; font: inherit; font-size: 14px; min-width: 0; width: auto;
}
#ctl input:focus, #ctl select:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0,229,255,.15); }
#ctl select { padding-right: 8px; }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--dim); }
#ctl .dot.ok { background: var(--d-good); box-shadow: 0 0 8px color-mix(in srgb, var(--d-good) 60%, transparent); }
#ctl .dot.bad { background: var(--d-bad); box-shadow: 0 0 8px color-mix(in srgb, var(--d-bad) 60%, transparent); }
#ctl .dot.warn { background: var(--d-warn); box-shadow: 0 0 8px color-mix(in srgb, var(--d-warn) 60%, transparent); }

/* ---- kaarten en rijen ------------------------------------------------------- */
.dcard, .today-card, .tile, .ctl-meters, .profile, .ctl-set, .ctl-det, .kv {
  background: var(--d-surface); border: 1px solid var(--d-border); border-radius: var(--d-r);
}
.ctl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ctl-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; min-height: 52px; background: var(--d-surface); border: 1px solid var(--d-border); border-radius: var(--d-r-sm); transition: background .15s, border-color .15s; }
.ctl-row:hover { background: var(--d-surface-2); }
.ctl-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.ctl-name { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.ctl-meta { margin-left: auto; font-size: 13px; color: var(--dim); font-variant-numeric: tabular-nums; }
.pill { flex: none; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--d-border); color: var(--dim); }
.pill.accent { color: var(--cyan); border-color: color-mix(in srgb, var(--cyan) 45%, transparent); }

/* ---- schakelaar ------------------------------------------------------------- */
.tgl { position: relative; flex: none; width: 44px; height: 26px; }
.tgl input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; width: 100%; height: 100%; }
.tgl .knob { position: absolute; inset: 0; border-radius: 999px; background: var(--d-surface-2); border: 1px solid var(--d-border); transition: background .15s; pointer-events: none; }
.tgl .knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--dim); transition: transform .15s, background .15s; }
.tgl input:checked + .knob { background: color-mix(in srgb, var(--cyan) 28%, transparent); border-color: color-mix(in srgb, var(--cyan) 55%, transparent); }
.tgl input:checked + .knob::after { transform: translateX(18px); background: var(--cyan); }
.tgl input:focus-visible + .knob { outline: 2px solid var(--cyan); outline-offset: 2px; }
.tgl input:disabled { cursor: wait; }

/* ---- tools: twee schakelaars (aan/uit en bevestiging) ------------------------ */
.tool-switches { display: flex; gap: 16px; align-items: flex-start; flex: none; }
.sw { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.sw small { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.ask-note { margin-top: 2px; }
.ask-note.warn { color: var(--d-warn); }

/* ---- laden (skelet) ---------------------------------------------------------- */
.skel { height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--d-surface) 25%, var(--d-surface-2) 50%, var(--d-surface) 75%); background-size: 200% 100%; animation: skel 1.2s linear infinite; }
.skel.w1 { width: 40%; height: 22px; } .skel.w2 { width: 80%; } .skel.w3 { width: 60%; }
@keyframes skel { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { #ctl *, #ctl *::before { animation: none !important; transition: none !important; } }

/* ---- Overzicht -------------------------------------------------------------- */
.ctl-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.tile { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; overflow: hidden; }
.tile::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--d-border); }
.tile.good::before { background: var(--d-good); } .tile.bad::before { background: var(--d-bad); } .tile.warn::before { background: var(--d-warn); }
.tile-v { font-size: 26px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.tile.good .tile-v { color: var(--d-good); } .tile.bad .tile-v { color: var(--d-bad); } .tile.warn .tile-v { color: var(--d-warn); }
.tile-l { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.tile-s { font-size: 12.5px; color: var(--dim); }
.ctl-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.ctl-grid2 > div { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ctl-meters { display: flex; flex-direction: column; gap: 14px; padding: 16px; }
.meter { display: grid; grid-template-columns: 96px 1fr minmax(96px, auto); align-items: center; gap: 12px; font-size: 14px; }
.meter-l { color: var(--dim); }
.meter-bar { height: 8px; border-radius: 999px; background: var(--d-surface-2); overflow: hidden; }
.meter-bar i { display: block; height: 100%; border-radius: 999px; background: var(--cyan); transition: width .4s; }
.meter-bar i.warn { background: var(--d-warn); } .meter-bar i.bad { background: var(--d-bad); }
.meter-t { text-align: right; font-variant-numeric: tabular-nums; }
.ctl-quick { display: flex; flex-wrap: wrap; gap: 8px; }
.ctl-mini .ctl-name { font-size: 14px; font-weight: 500; }
.ctl-mini { min-height: 46px; }

/* ---- Vandaag ----------------------------------------------------------------- */
.today-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.today-card { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; min-width: 0; }
.today-card .ctl-h { margin: 0 0 4px; }
.today-card.alert { border-color: color-mix(in srgb, var(--d-bad) 55%, transparent); }
.today-card.muted { opacity: .7; }
.today-big { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.2; }
.today-big.good { color: var(--d-good); } .today-big.bad { color: var(--d-bad); }
.today-line { margin: 0; font-size: 14px; overflow-wrap: anywhere; padding: 4px 0; border-top: 1px solid var(--d-border); }
.today-line:first-of-type { border-top: 0; }
.today-card .ctl-desc + .today-line { border-top: 0; }

/* ---- Taken ------------------------------------------------------------------- */
.ctl-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.ctl-cols > div { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.add-form { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; }
.add-form input[type="text"] { grid-column: 1 / -1; min-width: 0; width: 100%; }
.add-form input[type="date"], .add-form input[type="datetime-local"] { width: 100%; }
.task { align-items: center; }
.task-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; align-items: center; }

/* ---- Gezin ------------------------------------------------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips .chip { height: 30px; padding: 0 14px; border-radius: 999px; font-size: 13.5px; background: var(--d-surface); border-color: var(--d-border); }
.chips .chip[aria-pressed="true"] { background: color-mix(in srgb, var(--cyan) 18%, transparent); border-color: var(--cyan); color: var(--cyan); }
.profile { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 16px; }
.profile.person { border-color: color-mix(in srgb, var(--cyan) 50%, transparent); }
.profile .ctl-h { margin: 0; }
.profile .close { position: absolute; top: 12px; right: 12px; }
.profile.person .ctl-h { padding-right: 76px; }
.facts { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.facts li { padding: 8px 0; border-top: 1px solid var(--d-border); font-size: 14.5px; }
.facts li:first-child { border-top: 0; }

/* ---- Logboek ------------------------------------------------------------------ */
.logrow.bad .ctl-name { color: var(--d-bad); }
.logrow .ctl-name { font-weight: 500; font-size: 14.5px; }

/* ---- Systeem ------------------------------------------------------------------ */
#ctl-svc { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
#ctl-svc .ctl-row { min-height: 44px; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.kv { display: flex; flex-direction: column; gap: 1px; padding: 10px 14px; }
.kv .k { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.kv .v { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.ctl-det { padding: 0 16px; }
.ctl-det > summary { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 14px 0; font-size: 14px; font-weight: 600; list-style: none; }
.ctl-det > summary::-webkit-details-marker { display: none; }
.ctl-det > summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--dim); border-bottom: 2px solid var(--dim); transform: rotate(-45deg); transition: transform .15s; flex: none; margin: 0 4px 0 2px; }
.ctl-det[open] > summary::before { transform: rotate(45deg); }
.ctl-det > summary small { font-weight: 400; color: var(--dim); font-size: 12.5px; }
.ctl-det > *:not(summary) { margin: 0 0 12px; }
.ctl-det[open] { padding-bottom: 4px; }

.ctl-set { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; }
.ctl-set-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ctl-set-head label { font-size: 15px; font-weight: 600; }
.ctl-set-row { display: flex; gap: 8px; }
.ctl-set-row input, .ctl-set-row select { flex: 1; width: auto; }
.ctl-set-msg { min-height: 1.2em; font-size: 12.5px; }
.ctl-set-msg.ok { color: var(--d-good); } .ctl-set-msg.bad { color: var(--d-bad); }
.ctl-badge { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--cyan); border: 1px solid color-mix(in srgb, var(--cyan) 45%, transparent); border-radius: 999px; padding: 1px 9px; }

.voice-grid { display: grid; grid-template-columns: 1fr; gap: 6px; }
.voice-grid label { display: flex; justify-content: space-between; font-size: 14px; margin-top: 8px; }
.voice-grid output { color: var(--dim); font-variant-numeric: tabular-nums; }
.voice-grid input[type="range"] { width: 100%; accent-color: var(--cyan); height: 24px; padding: 0; border: 0; background: transparent; }
.voice-grid label.opt { justify-content: flex-start; gap: 10px; margin-top: 12px; }

/* ---- smalle schermen ------------------------------------------------------------ */
@media (max-width: 760px) {
  .ctl-grid2, .ctl-cols { grid-template-columns: 1fr; }
  .ctl-cols { gap: 20px; }
}
@media (max-width: 560px) {
  #ctl.panel { padding: calc(8px + env(safe-area-inset-top)) 8px 8px; }
  #ctl .ctl-box { max-height: 96dvh; border-radius: 16px; }
  .ctl-top { padding: 12px 14px 0; }
  .ctl-body { padding: 14px 14px 20px; }
  #ctl-msg { padding: 8px 14px; }
  .ctl-tabs { margin: 0 -6px; }
  #ctl .ctl-tabs button { padding: 13px 4px; font-size: 12.5px; gap: 0; flex: 1 1 auto; justify-content: center; }
  .tgl { width: 50px; height: 30px; }
  .tgl .knob::after { top: 4px; left: 4px; width: 20px; height: 20px; }
  .tgl input:checked + .knob::after { transform: translateX(20px); }
  #ctl button { min-height: 40px; }
  #ctl button.small { min-height: 34px; }
  #ctl .ctl-tabs button svg { display: none; }
  .ctl-tiles { grid-template-columns: 1fr 1fr; gap: 8px; }
  .tile { padding: 12px 14px; }
  .tile-v { font-size: 22px; }
  .tile-l { font-size: 11.5px; }
  .meter { grid-template-columns: 1fr auto; gap: 6px 12px; }
  .meter-l { grid-row: 1; } .meter-t { grid-row: 1; grid-column: 2; }
  .meter-bar { grid-row: 2; grid-column: 1 / -1; }
  .add-form { grid-template-columns: 1fr auto; }
  .add-form input[type="date"], .add-form input[type="datetime-local"] { grid-column: 1 / -1; }
  #rem-list .ctl-text { flex: 1 1 100%; }
  .task { flex-wrap: wrap; }
  .task-actions { justify-content: flex-start; }
  .ctl-tool { flex-wrap: wrap; }
  .ctl-tool .ctl-text { flex-basis: 100%; }
  .tool-switches { width: 100%; justify-content: flex-start; }
  .today-grid { grid-template-columns: 1fr; }
}

.agenda-day { margin: 6px 0 0; font-weight: 600; letter-spacing: .04em; color: var(--cyan); }
.agenda-day:first-of-type { margin-top: 0; }

/* Vandaag: nieuws en agendanaam */
.today-card.wide { grid-column: 1 / -1; }
.today-line.news { display: flex; flex-direction: column; gap: 1px; }
.today-line.news a { color: inherit; text-decoration: none; font-weight: 500; }
.today-line.news a:hover, .today-line.news a:focus-visible { color: var(--cyan); text-decoration: underline; }
.news-meta { font-size: 12.5px; color: var(--dim); }
.pill.cal { margin-left: 6px; text-transform: none; letter-spacing: 0; font-size: 12px; padding: 0 8px; vertical-align: 1px; }

/* Boodschappen */
.groc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.groc.is-done .ctl-name { text-decoration: line-through; opacity: .55; }
#ctl button.undo { width: 34px; height: 34px; padding: 0; flex: none; font-size: 15px; }
.groc-form { margin-bottom: 4px; }
.groc-form input[type="text"] { grid-column: auto; }
.groc-form { grid-template-columns: 1fr auto; }
@media (max-width: 560px) { .groc-form { grid-template-columns: 1fr auto; } .groc-grid { grid-template-columns: 1fr; } }

.today-grid .sec { display: contents; }

/* Huiskaart */
.today-card.home { grid-column: 1 / -1; max-width: 720px; }
.home-temps { margin: 0; font-size: 13px; color: var(--d-muted, inherit); opacity: .85; }
.home-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid var(--d-border); min-width: 0; }
.home-name { font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
.home-ctl { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.home-temp { font-size: 14px; font-variant-numeric: tabular-nums; }
.home-dim { width: 90px; accent-color: var(--cyan); }
#ctl button.home-sw.on { border-color: var(--cyan); color: var(--cyan); }
.home-scenes { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 8px; border-top: 1px solid var(--d-border); }
@media (max-width: 480px) { .home-dim { width: 70px; } }

/* Formule 1-agenda op Vandaag */
.today-grid .f1-wrap { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 10px; }
.f1-bar { display: flex; flex-wrap: wrap; gap: 8px; }
#ctl button.f1-btn { font-weight: 600; }
#ctl button.f1-btn.on { border-color: var(--cyan); color: var(--cyan); }
.today-card.f1 .f1-race { font-weight: 700; }
.f1-sub { margin: 10px 0 2px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; opacity: .7; }
.today-line.f1-session, .today-line.f1-next { font-variant-numeric: tabular-nums; white-space: pre-wrap; }

/* Auto */
.today-card.car { max-width: 720px; }
.car-meter { display: flex; flex-direction: column; gap: 4px; padding: 4px 0; }
.car-meter-t { display: flex; justify-content: space-between; font-size: 14px; font-variant-numeric: tabular-nums; }
.car-bar { height: 8px; border-radius: 6px; background: var(--d-border); overflow: hidden; }
.car-bar span { display: block; height: 100%; background: var(--cyan); border-radius: 6px; transition: width .4s; }
.car-ctl { display: flex; flex-direction: column; gap: 10px; padding-top: 10px; border-top: 1px solid var(--d-border); }
.car-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.car-group .ctl-desc { min-width: 52px; }
.today-card.car a { color: var(--cyan); }
.car-details { padding: 4px 0; }
.car-details summary { cursor: pointer; }

/* Werkmail */
.wm-box { display: flex; flex-direction: column; gap: 4px; padding-top: 8px; }
.wm-code { margin: 4px 0; font: 700 26px/1.1 ui-monospace, Menlo, monospace; letter-spacing: .14em; user-select: all; }
.wm-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 8px; border-top: 1px solid var(--d-border); flex-wrap: wrap; }
.today-card:has(> .car-meter) { max-width: 720px; }

/* Foto's tonen */
.ph-bar { display: flex; gap: 8px; margin: 0 0 10px; }
.ph-year { margin: 10px 0 4px; font-size: 13px; font-weight: 600; opacity: .85; }
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; }
#ctl button.ph-cell { display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: var(--d-border); cursor: pointer; min-height: 0; }
.ph-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-cell.bad { opacity: .35; }
.ph-pick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ph-sel { min-height: 40px; border-radius: 10px; border: 1px solid var(--d-border); background: var(--d-surface); color: inherit; padding: 0 10px; font: inherit; }
.ph-results { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.pv { position: fixed; inset: 0; z-index: 2000; background: rgba(0, 0, 0, .94); display: flex; flex-direction: column; align-items: center; justify-content: center; outline: none; }
.pv-img { max-width: 100vw; max-height: calc(100vh - 100px); object-fit: contain; }
.pv-cap { color: #cfe3ee; font-size: 14px; padding: 8px 12px 0; min-height: 28px; }
.pv-bar { display: flex; gap: 10px; padding: 12px; }
.pv-bar button { min-width: 48px; min-height: 44px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .08); color: #fff; font-size: 20px; cursor: pointer; }
.pv-bar button:hover, .pv-bar button:focus-visible { background: rgba(255, 255, 255, .18); }

/* Signal */
.today-card.sg { max-width: 760px; }
.sg-box { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding-top: 8px; }
.sg-qr { width: 260px; max-width: 100%; height: auto; border-radius: 12px; background: #fff; padding: 10px; image-rendering: pixelated; }
.sg-search { display: flex; gap: 8px; margin-top: 10px; }
.sg-search input { flex: 1; min-width: 0; min-height: 40px; border-radius: 10px; border: 1px solid var(--d-border); background: var(--d-surface); color: inherit; padding: 0 12px; font: inherit; }
.sg-results { display: flex; flex-direction: column; gap: 2px; margin: 6px 0; }

/* Gezondheid: weekoverzicht */
.hl-bars { display: flex; align-items: flex-end; gap: 8px; height: 104px; margin-top: 10px; }
.hl-bars span { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; gap: 3px; }
.hl-bars em { font-style: normal; font-size: .72rem; font-weight: 600; text-align: center; color: var(--dim, #8b93a5); white-space: nowrap; font-variant-numeric: tabular-nums; }
.hl-bars i { display: block; width: 100%; border-radius: 6px 6px 2px 2px; background: var(--accent-grad, linear-gradient(135deg, #14b8a6, #3b82f6)); min-height: 2px; }
.hl-bars i.none { background: rgba(127, 127, 127, .3); }
.hl-axis { display: flex; gap: 8px; margin-top: 4px; font-size: .72rem; color: var(--dim, #8b93a5); text-transform: capitalize; }
.hl-axis span { flex: 1; text-align: center; }

/* Huis: uit welk systeem een apparaat komt */
.home-src { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 600; letter-spacing: .02em; vertical-align: middle; background: rgba(127, 127, 127, .16); color: var(--dim, #8b93a5); }
.home-src.hy { background: rgba(139, 92, 246, .16); color: #7c4dd8; }
.home-src.ha { background: rgba(20, 184, 166, .16); color: #0f8f82; }

.home-bulk { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }

/* Huis: tegels */
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.home-tile { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 16px; border: 1px solid rgba(127, 127, 127, .22); background: rgba(127, 127, 127, .07); min-height: 118px; }
.home-tile.on { background: linear-gradient(135deg, rgba(250, 204, 21, .30), rgba(250, 204, 21, .08)); border-color: rgba(250, 204, 21, .55); }
.home-tile .tile-top { display: flex; justify-content: space-between; align-items: flex-start; }
.home-tile .tile-ic { font-size: 24px; line-height: 1; }
.home-tile .tile-state { font-size: 12px; color: var(--dim, #8b93a5); }
.home-tile .tile-big { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.home-tile .tile-set { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.home-tile .home-dim { width: 100%; margin-top: auto; }
.home-tile .home-step { min-width: 34px; font-size: 18px; }
.home-tile .home-name { font-weight: 600; }
.home-tile .home-sw { border-radius: 999px; min-width: 52px; }
.home-on { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.home-on-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: linear-gradient(135deg, rgba(250, 204, 21, .20), rgba(250, 204, 21, .06)); border: 1px solid rgba(250, 204, 21, .4); }
.home-on-row .home-name { flex: 1; min-width: 0; }

.home-views { display: inline-flex; gap: 4px; margin-right: 8px; }
.home-views .on { background: var(--accent-soft, rgba(20, 184, 166, .16)); border-color: rgba(20, 184, 166, .5); font-weight: 600; }
.home-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid rgba(127, 127, 127, .14); }

.tile-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 4px; }
.tile-chip-label { font-size: 11px; color: var(--dim, #8b93a5); margin-right: 2px; }
.tile-chips .on { background: var(--accent-soft, rgba(20, 184, 166, .16)); border-color: rgba(20, 184, 166, .55); font-weight: 600; }

.home-tile.climate, .home-tile.fan { grid-column: 1 / -1; }

.home-room-sel { max-width: 46%; margin-left: auto; font-size: 13px; }

/* Energie */
.en-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.en-stat { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 12px; background: rgba(127, 127, 127, .12); }
.en-k { font-size: .75rem; color: var(--dim, #8b93a5); }
.en-v { font-size: 1.15rem; }
.en-chart { width: 100%; height: auto; color: inherit; }
.en-dot.net { color: #3b82f6; }
.en-dot.sol { color: #f59e0b; }

/* Mail: gelezen zetten en archiveren */
.mail-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 8px; }
.hl-bars.dense { gap: 4px; height: 100px; }
.hl-bars.dense em { font-size: .6rem; }

/* Energie: stroomstroom, ringen en herkomst */
.en-flow { width: 100%; max-width: 460px; height: auto; display: block; margin: 0 auto; color: inherit; }
.en-flow line.flow.on { stroke-dasharray: 7 9; animation: en-flow 1.1s linear infinite; }
@keyframes en-flow { to { stroke-dashoffset: -32; } }
.en-rings { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 14px; }
.en-ringbox { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; }
.en-ring { width: 96px; height: 96px; }
.en-ringl { font-size: .9rem; }
.en-stack { display: flex; height: 30px; border-radius: 10px; overflow: hidden; background: rgba(127, 127, 127, .15); }
.en-stack span { display: flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 700; color: #fff; min-width: 0; transition: width .6s ease; }
@media (prefers-reduced-motion: reduce) { .en-flow line.flow.on { animation: none; } }
