/* Klimaat — "warmtebeeld". Every temperature carries its own colour, from cool blue to glowing ember. */

@property --heat { syntax: '<color>'; inherits: true; initial-value: #F2B84B; }

:root {
  --ink: #0A0D13; --surface: #121722; --surface-2: #1A2030; --line: rgba(255, 255, 255, .08);
  --text: #F2F4F8; --muted: #8C95A8; --faint: #5B6377;
  --accent: #FFB547; --on-accent: #1A1206;
  --ok: #4ADE9B; --warn: #FFB547; --bad: #FF6B4A;
  --koel: #5B7CFA; --fris: #2FB5C8; --warm: #F2B84B; --gloed: #FF6B4A;
  --heat: var(--warm);
  --radius: 22px;
  --spring: cubic-bezier(.34, 1.36, .64, 1);
  --ease: cubic-bezier(.22, .8, .25, 1);
  --display: "Bricolage Grotesque", ui-rounded, -apple-system, system-ui, sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --ink: #F3F0EA; --surface: #FFFFFF; --surface-2: #F7F4EF; --line: rgba(20, 23, 31, .08);
    --text: #14171F; --muted: #6B7280; --faint: #A3A9B6;
    --accent: #E8890C; --on-accent: #FFFFFF;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { background: var(--ink); }
body {
  margin: 0; background: var(--ink); color: var(--text);
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior: none;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
[hidden] { display: none !important; }
.num { font-family: var(--display); font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; letter-spacing: -.02em; }

/* ---------------------------------------------------------------- ambient heat behind everything */
.aurora { position: fixed; inset: -20%; z-index: 0; pointer-events: none; filter: blur(70px); opacity: .55; transition: opacity 1s; }
.aurora i { position: absolute; width: 55vmax; height: 55vmax; border-radius: 50%; mix-blend-mode: screen; }
.aurora i:nth-child(1) { background: radial-gradient(circle, var(--heat) 0%, transparent 62%); left: 15%; top: -5%; animation: drift1 22s ease-in-out infinite alternate; transition: --heat 1.4s; }
.aurora i:nth-child(2) { background: radial-gradient(circle, color-mix(in oklab, var(--koel) 70%, transparent) 0%, transparent 60%); right: -10%; top: 30%; animation: drift2 28s ease-in-out infinite alternate; }
.aurora i:nth-child(3) { background: radial-gradient(circle, color-mix(in oklab, var(--gloed) 45%, transparent) 0%, transparent 60%); left: -15%; bottom: -10%; animation: drift3 34s ease-in-out infinite alternate; }
@media (prefers-color-scheme: light) { .aurora { opacity: .32; } .aurora i { mix-blend-mode: multiply; } }
body.app-actief .aurora { opacity: .28; }
@media (prefers-color-scheme: light) { body.app-actief .aurora { opacity: .18; } }
@keyframes drift1 { to { transform: translate(-12vw, 18vh) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-18vw, -12vh) scale(.9); } }
@keyframes drift3 { to { transform: translate(20vw, -15vh) scale(1.1); } }

/* ---------------------------------------------------------------- connect */
.scherm { position: fixed; inset: 0; overflow-y: auto; z-index: 1; display: grid; place-items: center; padding: max(24px, env(safe-area-inset-top)) 20px 24px; }
.inlog { width: 100%; max-width: 380px; padding: 28px 22px 22px; border-radius: 30px; background: color-mix(in oklab, var(--surface) 72%, transparent);
  border: 1px solid var(--line); backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4);
  animation: opkomen .8s var(--ease) both; }
.logo { width: 64px; height: 64px; border-radius: 18px; overflow: hidden; box-shadow: 0 12px 40px -8px color-mix(in oklab, var(--heat) 70%, transparent); animation: zweven 6s ease-in-out infinite; }
.logo img { display: block; }
.inlog h1 { font: 800 40px/1 var(--display); letter-spacing: -.04em; margin: 18px 0 6px; }
.lead { color: var(--muted); margin: 0 0 18px; font-size: 16px; }
.veld { display: block; margin: 12px 0; }
.veld > span { display: block; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.veld input { width: 100%; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); font-size: 16px; outline: none; transition: border-color .2s, box-shadow .2s; }
.veld input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 22%, transparent); }
.hint { color: var(--muted); font-size: 13px; margin: 6px 0 16px; }
.primair { width: 100%; padding: 16px; border-radius: 16px; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 16px;
  position: relative; overflow: hidden; transition: transform .2s var(--spring), opacity .2s; }
.primair:active { transform: scale(.97); }
.primair[aria-busy="true"] span { opacity: .5; }
.primair[aria-busy="true"]::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%);
  animation: glans 1.1s linear infinite; }
.of { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; margin: 22px 0 4px; }
.of::before, .of::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.homey-keuze { display: grid; gap: 8px; margin-top: 12px; }
.homey-keuze button { width: 100%; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: inherit; font-weight: 650; text-align: left; cursor: pointer; }
.homey-keuze button:active { transform: scale(.98); }
.fout { color: var(--bad); font-size: 14px; margin: 12px 0 0; animation: schud .4s; }
@keyframes opkomen { from { opacity: 0; transform: translateY(24px) scale(.98); } }
@keyframes zweven { 50% { transform: translateY(-5px); } }
@keyframes glans { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes schud { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* ---------------------------------------------------------------- layout */
#app { position: fixed; z-index: 1; inset: 0; }
main { position: absolute; inset: 0; }
.tab { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; animation: tabIn .45s var(--ease) both; }
.tab iframe { width: 100%; height: 100%; border: 0; display: block; background: transparent; }
#tab-bediening, #tab-huis, #tab-regels { padding: calc(env(safe-area-inset-top) + 14px) 16px calc(env(safe-area-inset-bottom) + 110px); }
@keyframes tabIn { from { opacity: 0; transform: translateY(10px); } }

/* Floating tab bar */
.tabs { position: fixed; z-index: 5; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 14px); transform: translateX(-50%);
  display: grid; grid-template-columns: repeat(3, 76px); padding: 6px; border-radius: 26px;
  background: color-mix(in oklab, var(--surface) 70%, transparent); border: 1px solid var(--line);
  backdrop-filter: blur(22px) saturate(1.6); -webkit-backdrop-filter: blur(22px) saturate(1.6);
  box-shadow: 0 18px 50px -12px rgba(0, 0, 0, .45); }
.tabs button { position: relative; z-index: 1; height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); font-size: 11px; font-weight: 600; transition: color .3s; }
.tabs svg { width: 24px; height: 24px; fill: currentColor; transition: transform .35s var(--spring); }
.tabs button.aan { color: var(--on-accent); }
.tabs button.aan svg { transform: translateY(-1px) scale(1.08); }
.tabs button:active svg { transform: scale(.85); }
.tabs-thumb { position: absolute; z-index: 0; top: 6px; left: 6px; width: 76px; height: 52px; border-radius: 20px; background: var(--accent);
  box-shadow: 0 6px 20px -4px color-mix(in oklab, var(--accent) 70%, transparent);
  transform: translateX(calc(var(--i, 0) * 76px)); transition: transform .5s var(--spring); }

/* ---------------------------------------------------------------- header */
.kop { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 2px 6px; animation: opkomen .6s var(--ease) both; }
.groet { font: 700 26px/1.1 var(--display); letter-spacing: -.03em; margin: 0; }
.wie { color: var(--muted); font-size: 13px; margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; }
.wie span { display: inline-flex; align-items: center; gap: 5px; }
.wie i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.wie .thuis i { background: var(--ok); }
.wie .kijk { color: var(--accent); font-weight: 600; }
.wie .kijk i { background: var(--accent); }
.weer { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 10px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.weer .num { font-size: 20px; font-weight: 700; }
.weer small { display: block; color: var(--muted); font-size: 11px; line-height: 1.2; max-width: 92px; }
.live { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); position: relative; flex: none; }
.live.vers { background: var(--ok); }
.live.vers::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--ok); animation: puls 2.4s ease-out infinite; }
@keyframes puls { from { transform: scale(.4); opacity: .9; } to { transform: scale(1.6); opacity: 0; } }

/* ---------------------------------------------------------------- warnings */
.let-op { margin: 12px 0 0; padding: 12px 14px; border-radius: 18px; background: color-mix(in oklab, var(--warn) 14%, var(--surface));
  border: 1px solid color-mix(in oklab, var(--warn) 40%, transparent); color: var(--text); font-size: 14px; display: flex; gap: 10px;
  animation: neerglijden .5s var(--spring) both; }
.let-op svg { width: 20px; height: 20px; fill: var(--warn); flex: none; margin-top: 1px; }
.let-op ul { margin: 0; padding: 0; list-style: none; }
.let-op li + li { margin-top: 4px; }
@keyframes neerglijden { from { opacity: 0; transform: translateY(-10px) scale(.98); } }

/* Picking a room (app.js vlieg): tap pulse on the row, flying temperature, and the meter taking over */
.kamer.tik { animation: tik .45s var(--spring); }
@keyframes tik { 30% { transform: scale(.96); box-shadow: inset 0 0 0 2px var(--heat), 0 0 22px -6px var(--heat); } }
.vlieger { position: fixed; z-index: 60; margin: 0; pointer-events: none; transform-origin: 0 0; white-space: nowrap;
  font: 700 30px/1 var(--display); letter-spacing: -.04em; color: var(--heat); text-shadow: 0 0 18px var(--heat); }
.vlieger sup { font-size: 14px; color: var(--muted); }
.held.wissel .midden { animation: wisselIn .55s .38s var(--ease) both; }
.held.wissel .gloed { animation: opgloeien 1.1s .3s var(--ease) both, ademen 6s 1.4s ease-in-out infinite; }
.held.wissel .dial { animation: indeuken .7s .32s var(--spring) both; }
@keyframes wisselIn { from { opacity: 0; transform: translateY(14px) scale(.92); filter: blur(3px); } }
@keyframes opgloeien { 0% { opacity: .35; transform: scale(.85); } 45% { opacity: 1; transform: scale(1.22); } 100% { opacity: 1; transform: scale(1); } }
@keyframes indeuken { 40% { transform: scale(.97); } }

/* ---------------------------------------------------------------- hero dial */
.held { position: relative; margin: 6px 0 4px; display: grid; place-items: center; animation: opkomen .7s .05s var(--ease) both; }
.held .gloed { position: absolute; width: 300px; height: 300px; border-radius: 50%; top: 50%; left: 50%; translate: -50% -54%;
  background: radial-gradient(circle, color-mix(in oklab, var(--heat) 55%, transparent) 0%, transparent 65%);
  filter: blur(18px); animation: ademen 6s ease-in-out infinite; transition: --heat 1.4s; }
@keyframes ademen { 50% { transform: scale(1.08); opacity: .8; } }
.dial { position: relative; width: 290px; max-width: 86vw; aspect-ratio: 1; }
.dial svg { width: 100%; height: 100%; overflow: visible; }
.dial .spoor { fill: none; stroke: var(--line); stroke-width: 14; stroke-linecap: round; }
.dial .streep { stroke: var(--faint); stroke-width: 2; stroke-linecap: round; opacity: .6; }
.dial .boog { fill: none; stroke: url(#hittegradient); stroke-width: 14; stroke-linecap: round; stroke-dasharray: 100 100; transition: stroke-dashoffset 1.4s var(--ease); }
.dial .doel-arm, .dial .knop-arm { transform-origin: 120px 120px; transition: transform 1.4s var(--spring); }
.dial .doel { fill: var(--ink); stroke: var(--text); stroke-width: 3; }
.dial .knop { fill: #fff; filter: drop-shadow(0 0 8px var(--heat)); transition: --heat 1.4s; }
.midden { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.midden .kamer-naam { font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.midden .groot { font: 800 92px/0.95 var(--display); letter-spacing: -.03em; margin: 4px 0 2px; display: flex; align-items: flex-start; justify-content: center; }
.midden .groot sup { font-size: 34px; font-weight: 600; margin: 10px 0 0 2px; color: var(--muted); }
.toestand { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--text); padding: 5px 12px; border-radius: 999px;
  background: color-mix(in oklab, var(--heat) 18%, transparent); transition: --heat 1.4s; }
.toestand { pointer-events: auto; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.toestand [data-toestand] { animation: pilWissel .35s var(--ease); }
.toestand.trend { box-shadow: inset 0 0 0 1.5px color-mix(in oklab, var(--heat) 60%, transparent); font-variant-numeric: tabular-nums; }
@keyframes pilWissel { from { opacity: 0; transform: translateY(4px); } }
.toestand .pijlen { display: inline-flex; flex-direction: column; height: 14px; overflow: hidden; }
.toestand .pijlen svg { width: 12px; height: 14px; fill: var(--heat); animation: stijgen 1.4s linear infinite; }
/* Falling: turn the holder, not the arrow — the arrow's own transform is taken by the "stijgen" animation */
.toestand.daalt .pijlen { transform: rotate(180deg); }
.toestand.daalt .pijlen svg { fill: var(--koel); }
@keyframes stijgen { from { transform: translateY(14px); } to { transform: translateY(-14px); } }

/* Today strip under the dial */
.dag { margin: 12px 4px 0; }
.dag-balk { position: relative; height: 34px; border-radius: 12px; overflow: hidden; display: flex; background: var(--surface); border: 1px solid var(--line); }
.dag-balk .blok { height: 100%; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: rgba(255, 255, 255, .92); white-space: nowrap; overflow: hidden;
  transform-origin: left; animation: uitrollen .9s var(--ease) both; animation-delay: calc(var(--i) * 60ms); }
.dag-balk .blok + .blok { box-shadow: inset 1px 0 0 rgba(0, 0, 0, .18); }
.dag-balk .nu-naald { position: absolute; top: -2px; bottom: -2px; width: 3px; border-radius: 2px; background: var(--text); box-shadow: 0 0 0 3px var(--ink); left: var(--x); transition: left 1s var(--ease); }
.dag-uren { display: flex; justify-content: space-between; color: var(--faint); font-size: 10px; margin-top: 5px; padding: 0 2px; }
@keyframes uitrollen { from { transform: scaleX(0); opacity: 0; } }

/* ---------------------------------------------------------------- cards */
.kaart { position: relative; margin: 14px 0 0; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  animation: opkomen .6s var(--ease) both; animation-delay: calc(var(--n, 0) * 70ms + 120ms); }
.kaart-kop { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.kaart-kop h2 { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.kaart-kop small { color: var(--muted); font-size: 12px; }

/* Mode selector with a sliding thumb */
.modi { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 5px; border-radius: 18px; background: var(--surface-2); }
.modi button { position: relative; z-index: 1; height: 44px; border-radius: 13px; font-weight: 600; font-size: 14px; color: var(--muted); transition: color .3s, transform .2s var(--spring); }
.modi button:active { transform: scale(.94); }
.modi button.aan { color: var(--on-accent); }
.modi-thumb { position: absolute; z-index: 0; top: 5px; left: 5px; width: calc((100% - 22px) / 3); height: 44px; border-radius: 13px; background: var(--accent);
  box-shadow: 0 8px 20px -6px color-mix(in oklab, var(--accent) 80%, transparent);
  transform: translate(calc(var(--k, 0) * (100% + 6px)), calc(var(--r, 0) * (100% + 6px))); transition: transform .55s var(--spring); }
.modi.bezig .modi-thumb { animation: kloppen .9s ease-in-out infinite; }
@keyframes kloppen { 50% { opacity: .6; } }

/* Rooms */
.kamers { display: grid; gap: 4px; }
.kamer { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 12px; padding: 12px; margin: 0 -6px; border-radius: 16px; text-align: left;
  transition: background .25s, transform .2s var(--spring); animation: opkomen .5s var(--ease) both; animation-delay: calc(var(--i) * 45ms + 200ms); }
.kamer:active { transform: scale(.98); }
/* The room shown in the big meter: tinted with its own heat colour and a thin ring, so it also stands out in dark mode */
.kamer.gekozen { background: color-mix(in oklab, var(--heat) 13%, var(--surface-2));
  box-shadow: inset 0 0 0 1.5px color-mix(in oklab, var(--heat) 55%, transparent); }
.kamer .naam { font-weight: 650; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.kamer .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; color: var(--muted); font-size: 12px; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); font-weight: 600; }
.kamer.gekozen .tag { background: var(--surface); }
.tag i { width: 7px; height: 7px; border-radius: 50%; }
.tag.raam { color: var(--koel); }
.tag.hand { color: var(--accent); }
.e-chip { display: inline-flex; align-items: center; gap: 1px; margin-left: 5px; color: var(--ok); font-size: .85em; font-weight: 700;
  font-variant-numeric: tabular-nums; white-space: nowrap; }
.e-chip svg { width: 1em; height: 1em; fill: currentColor; }
[data-energie-chip]:empty { display: none; }
.kamer .graden { font: 700 30px/1 var(--display); letter-spacing: -.04em; color: var(--heat); transition: --heat 1.4s; text-align: right; }
.kamer .graden sup { font-size: 14px; color: var(--muted); margin-left: 1px; }
.thermo { grid-column: 1 / -1; position: relative; height: 8px; border-radius: 6px; background: var(--surface-2); overflow: visible; }
.kamer.gekozen .thermo { background: var(--surface); }
.thermo .vul { position: absolute; inset: 0 auto 0 0; border-radius: 6px; width: var(--w, 0%);
  background: linear-gradient(90deg, var(--koel), var(--fris) 33%, var(--warm) 60%, var(--gloed)); background-size: var(--bw, 100%) 100%;
  transition: width 1.4s var(--ease); box-shadow: 0 0 14px -2px var(--heat); }
.thermo .doelstreep { position: absolute; top: -4px; bottom: -4px; width: 3px; border-radius: 2px; background: var(--text); left: var(--d, 0%); transition: left 1.4s var(--spring); }
/* Measure-only rooms look the same as the others (Robbert 13 nov): heat colour, same size; only no target line */

/* Energy */
.prijzen { position: relative; height: 84px; display: flex; align-items: flex-end; gap: 3px; padding-top: 22px; }
.prijzen .staaf { flex: 1; border-radius: 4px 4px 2px 2px; background: var(--faint); opacity: .55; height: var(--h); transform-origin: bottom;
  animation: groeien .9s var(--spring) both; animation-delay: calc(var(--i) * 22ms + 250ms); position: relative; }
.prijzen .staaf.goedkoop { background: var(--ok); opacity: .7; }
.prijzen .staaf.duur { background: var(--bad); opacity: .75; }
.prijzen .staaf.voorbij { opacity: .2; }
.prijzen .staaf.nu { opacity: 1; box-shadow: 0 0 16px -2px currentColor; }
.prijzen .staaf.nu::before { content: attr(data-label); position: absolute; bottom: calc(100% + 6px); left: 50%; translate: -50% 0; white-space: nowrap;
  font: 700 12px/1 var(--display); padding: 4px 7px; border-radius: 8px; background: var(--text); color: var(--ink); }
.prijzen .staaf.nu.links::before { left: 0; translate: 0 0; }
.prijzen .staaf.nu.rechts::before { left: auto; right: 0; translate: 0 0; }
.prijzen .staaf.cv::after { content: ""; position: absolute; left: 50%; bottom: 3px; translate: -50% 0; width: 4px; height: 4px; border-radius: 50%; background: #fff; }
@keyframes groeien { from { transform: scaleY(0); } }
.prijs-uren { display: flex; justify-content: space-between; color: var(--faint); font-size: 10px; margin-top: 6px; }
.prijs-tip { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.prijs-tip b { color: var(--text); font-weight: 650; }
.stromen { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.stroom { padding: 10px; border-radius: 14px; background: var(--surface-2); }
.stroom small { display: block; color: var(--muted); font-size: 11px; font-weight: 600; }
.stroom .num { font-size: 18px; font-weight: 700; margin-top: 2px; display: block; }
.stroom .num em { font-style: normal; font-size: 12px; color: var(--muted); font-weight: 600; margin-left: 2px; }
.stroom svg { width: 16px; height: 16px; fill: var(--muted); float: right; }
.stroom.zon svg { fill: var(--warm); animation: draaien 18s linear infinite; }

.regel { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.regel b { display: block; font-weight: 650; }
.regel small { color: var(--muted); font-size: 12px; }
.schakel { position: relative; width: 56px; height: 34px; flex: none; border-radius: 20px; background: var(--surface-2); border: 1px solid var(--line); transition: background .35s; }
.schakel::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35); transition: transform .45s var(--spring), width .2s; }
.schakel:active::after { width: 32px; }
.schakel[aria-checked="true"] { background: var(--ok); }
.schakel[aria-checked="true"]::after { transform: translateX(22px); }
.schakel[aria-checked="true"]:active::after { transform: translateX(16px); }

/* Ventilation */
.vent { display: flex; align-items: center; gap: 16px; }
.fan { width: 58px; height: 58px; flex: none; border-radius: 18px; background: var(--surface-2); display: grid; place-items: center; }
.fan svg { width: 36px; height: 36px; fill: var(--fris); display: block; }
/* The rotation sits on an HTML wrapper: iOS Safari does not reliably animate a transform on the <svg> itself */
.fan .rotor { display: block; width: 36px; height: 36px; transform-origin: 50% 50%; will-change: transform; animation: draaien 3.2s linear infinite; }
.vent.hoog .fan .rotor { animation-duration: .55s; }
.vent.hoog .fan svg { fill: var(--accent); }
.vent.hoog .fan { background: color-mix(in oklab, var(--accent) 16%, var(--surface-2)); }
.vent b { font: 700 22px/1.1 var(--display); letter-spacing: -.02em; display: block; }
.vent small { color: var(--muted); font-size: 13px; }
.lucht { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
@keyframes draaien { to { transform: rotate(360deg); } }

/* Quick actions */
.acties { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.actie { padding: 14px 8px 12px; border-radius: 18px; background: var(--surface-2); display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 650; line-height: 1.2; text-align: center; position: relative; overflow: hidden; transition: transform .2s var(--spring); }
.actie:active { transform: scale(.93); }
.actie svg { width: 26px; height: 26px; }
.actie.bezig::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, color-mix(in oklab, var(--accent) 35%, transparent) 50%, transparent 70%);
  animation: glans 1s linear infinite; }
.actie .ico-vuur { fill: var(--gloed); }
.actie .ico-druppel { fill: var(--fris); }
.actie .ico-hand { fill: var(--accent); }

.voet { color: var(--faint); font-size: 12px; text-align: center; margin: 22px 0 0; }
.voet button { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; font-size: 12px; }

/* Toast */
.toast { position: fixed; z-index: 10; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 96px); translate: -50% 0; max-width: calc(100% - 32px);
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 16px; background: var(--text); color: var(--ink); font-weight: 600; font-size: 14px;
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, .5); animation: toastIn .5s var(--spring) both; }
.toast.weg { animation: toastUit .3s var(--ease) both; }
.toast i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.toast.fout i { background: var(--bad); }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px) scale(.9); } }
@keyframes toastUit { to { opacity: 0; transform: translateY(12px) scale(.95); } }

/* Skeleton while loading */
.laden { display: grid; gap: 14px; padding-top: 30px; }
.laden i { display: block; height: 120px; border-radius: var(--radius); background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%);
  background-size: 300% 100%; animation: skelet 1.4s linear infinite; }
.laden i:first-child { height: 280px; border-radius: 50%; width: 280px; margin: 0 auto; }
@keyframes skelet { from { background-position: 100% 0; } to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ================================================================ shared for Huis and Regels */
.kop-tab { margin-bottom: 14px; }
.leeg { color: var(--muted); font-size: 14px; text-align: center; padding: 28px 8px; margin: 0; }
.leeg.klein { padding: 4px 0 8px; text-align: left; font-size: 13px; }
.laden.klein { padding-top: 0; }
.laden.klein i, .laden.klein i:first-child { height: 90px; width: auto; border-radius: var(--radius); }

/* Bottom sheet (lives on <body>, above the tab bar) */
.vel-achter { position: fixed; inset: 0; z-index: 20; background: rgba(4, 6, 10, .55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: vervagen .3s both; }
.vel-achter.dicht { animation: vervagenUit .3s both; }
.vel { position: fixed; z-index: 21; left: 0; right: 0; bottom: 0; max-height: 86vh; overflow-y: auto; padding: 8px 18px calc(env(safe-area-inset-bottom) + 22px);
  border-radius: 28px 28px 0 0; background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -20px 60px -10px rgba(0, 0, 0, .5);
  animation: velIn .5s var(--spring) both; transition: transform .25s var(--ease); }
.vel::before { content: ""; position: absolute; inset: 0 0 auto; height: 160px; border-radius: inherit; pointer-events: none;
  background: radial-gradient(120% 100% at 80% 0%, color-mix(in oklab, var(--heat, var(--accent)) 22%, transparent), transparent 70%); }
.vel.dicht { animation: velUit .3s var(--ease) both; }
.vel-greep { width: 40px; height: 5px; border-radius: 3px; background: var(--faint); margin: 2px auto 14px; opacity: .6; }
.vel-inhoud { position: relative; }
.vel-kop { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.vel-kop h2 { margin: 0; font: 750 28px/1.1 var(--display); letter-spacing: -.03em; }
.vel-status { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; margin-top: 4px; }
.vel-status i { width: 8px; height: 8px; border-radius: 50%; }
.vel-temp { font: 800 52px/1 var(--display); letter-spacing: -.03em; color: var(--heat); }
.vel h3, .kamer-kaart h3 { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; }
.vel-melding { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 14px; margin-bottom: 10px; font-size: 14px; font-weight: 600; }
.vel-melding svg { width: 20px; height: 20px; flex: none; fill: currentColor; }
.vel-melding small { display: block; font-weight: 500; color: var(--muted); margin-top: 2px; }
.vel-melding.hand { background: color-mix(in oklab, var(--accent) 14%, transparent); color: var(--accent); }
.vel-melding.raam { background: color-mix(in oklab, var(--koel) 16%, transparent); color: var(--koel); }
.apparaat { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 16px; background: var(--surface-2); margin-bottom: 8px; }
.apparaat svg { width: 26px; height: 26px; fill: var(--heat); flex: none; }
.apparaat b { display: block; font-weight: 650; }
.apparaat small { color: var(--muted); font-size: 13px; }
.vel-ramen { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.vel-ramen span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: var(--surface-2); font-size: 13px; font-weight: 600; color: var(--muted); }
.vel-ramen span svg { width: 14px; height: 14px; fill: currentColor; }
.vel-ramen span.open { color: var(--koel); background: color-mix(in oklab, var(--koel) 16%, transparent); }
.vel .dag-balk { margin-top: 4px; }
.vel-knop { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; background: var(--surface-2); margin-top: 16px; font-weight: 650; text-align: left;
  transition: transform .2s var(--spring); }
.vel-knop:active { transform: scale(.98); }
.vel-knop span { flex: 1; }
.vel-knop svg { width: 22px; height: 22px; fill: var(--accent); }
.vel-knop svg:last-child { fill: var(--faint); width: 18px; }
@keyframes velIn { from { transform: translateY(100%); } }
@keyframes velUit { to { transform: translateY(100%); } }
@keyframes vervagen { from { opacity: 0; } }
@keyframes vervagenUit { to { opacity: 0; } }

/* ================================================================ Huis */
.vloer-kies { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.vloer-kies button { position: relative; z-index: 1; height: 40px; border-radius: 12px; font-size: 13px; font-weight: 650; color: var(--muted); transition: color .3s; }
.vloer-kies button.aan { color: var(--on-accent); }
.vloer-thumb { position: absolute; top: 4px; left: 4px; width: calc((100% - 16px) / 3); height: 40px; border-radius: 12px; background: var(--accent);
  transform: translateX(calc(var(--i, 0) * (100% + 4px))); transition: transform .5s var(--spring); }
.raam-stip { position: absolute; top: 8px; right: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--koel); box-shadow: 0 0 0 3px color-mix(in oklab, var(--koel) 30%, transparent); }
.foto-kaart { margin-top: 14px; border-radius: 26px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); position: relative;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .6); animation: opkomen .6s var(--ease) both; touch-action: pan-y; }
.foto-rail { position: relative; display: grid; }
.foto { grid-area: 1 / 1; position: relative; }
.foto img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-select: none; }
.foto::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(0, 0, 0, .35)); }
.foto.in-rechts { animation: inRechts .45s var(--ease) both; }
.foto.in-links { animation: inLinks .45s var(--ease) both; }
.foto.uit-links { animation: uitLinks .42s var(--ease) both; }
.foto.uit-rechts { animation: uitRechts .42s var(--ease) both; }
@keyframes inRechts { from { transform: translateX(40%); opacity: 0; } }
@keyframes inLinks { from { transform: translateX(-40%); opacity: 0; } }
@keyframes uitLinks { to { transform: translateX(-40%); opacity: 0; } }
@keyframes uitRechts { to { transform: translateX(40%); opacity: 0; } }
.pin { position: absolute; z-index: 2; translate: -50% -50%; display: flex; flex-direction: column; align-items: center; gap: 3px;
  animation: pinIn .6s var(--spring) both; animation-delay: calc(var(--n) * 90ms + 150ms); }
.pin-kop { display: flex; align-items: baseline; gap: 6px; padding: 6px 10px 6px 8px; border-radius: 14px;
  background: color-mix(in oklab, var(--surface) 78%, transparent); backdrop-filter: blur(12px) saturate(1.5); -webkit-backdrop-filter: blur(12px) saturate(1.5);
  border: 1.5px solid var(--heat); box-shadow: 0 8px 24px -6px color-mix(in oklab, var(--heat) 60%, transparent); transition: border-color 1.2s, box-shadow 1.2s, transform .25s var(--spring); }
.pin:active .pin-kop { transform: scale(.94); }
.pin-naam { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.pin-temp { font-size: 19px; font-weight: 800; color: var(--text); }
.pin-sub { font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--heat); color: #10131a; opacity: .95; }
.pin-sub:empty { display: none; }
.pin.meet .pin-sub { background: var(--surface-2); color: var(--muted); }
.pin.raam .pin-sub { background: var(--koel); color: #fff; }
.pin.hand .pin-sub { background: var(--accent); }
.pin-ring { position: absolute; left: 50%; top: 14px; width: 18px; height: 18px; translate: -50% -50%; border-radius: 50%; pointer-events: none; }
.pin.warmt .pin-ring { box-shadow: 0 0 0 2px var(--heat); animation: ringPuls 2s ease-out infinite; }
@keyframes ringPuls { from { scale: 1; opacity: .9; } to { scale: 5; opacity: 0; } }
@keyframes pinIn { from { opacity: 0; transform: translateY(10px) scale(.8); } }
.raam-pin { position: absolute; z-index: 3; translate: -50% -50%; display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px 4px 6px; border-radius: 999px;
  background: var(--koel); color: #fff; font-size: 11px; font-weight: 700; box-shadow: 0 0 0 0 var(--koel); animation: raamPuls 1.8s ease-out infinite; }
.raam-pin svg { width: 14px; height: 14px; fill: #fff; }
@keyframes raamPuls { to { box-shadow: 0 0 0 12px transparent; } }
.vloer-kamers { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-top: 14px; }
.vk { position: relative; overflow: hidden; text-align: left; padding: 14px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line);
  animation: opkomen .5s var(--ease) both; animation-delay: calc(var(--n) * 70ms + 200ms); transition: transform .2s var(--spring); }
.vk:active { transform: scale(.97); }
.vk::before { content: ""; position: absolute; right: -30px; top: -30px; width: 100px; height: 100px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in oklab, var(--heat) 45%, transparent), transparent 70%); }
.vk-temp { display: block; font-size: 30px; font-weight: 800; color: var(--heat); letter-spacing: -.04em; }
.vk-naam { display: block; font-weight: 650; margin-top: 2px; }
.vk-sub { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; margin-top: 2px; }
.vk-sub i { width: 7px; height: 7px; border-radius: 50%; }

/* ================================================================ Regels */
.secties { position: relative; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 14px; padding: 0 16px 10px; }
.secties::-webkit-scrollbar { display: none; }
.secties button { flex: none; padding: 9px 14px; font-weight: 650; font-size: 15px; color: var(--muted); transition: color .3s; }
.secties button.aan { color: var(--text); }
.secties-lijn { position: absolute; bottom: 6px; left: 0; height: 3px; border-radius: 2px; background: var(--accent); transition: transform .45s var(--spring), width .45s var(--spring); }
.sectie.wissel > * { animation: opkomen .45s var(--ease) both; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 10px; padding: 0 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip-k { flex: none; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: 14px; color: var(--muted);
  transition: background .25s, color .25s, transform .2s var(--spring); }
.chip-k:active { transform: scale(.94); }
.chip-k.aan { background: var(--text); color: var(--ink); border-color: var(--text); }
.chips.klein .chip-k { padding: 6px 12px; font-size: 13px; }

.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 4px 0 0; }
.stat { padding: 10px 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); text-align: center; }
.stat small { display: block; color: var(--muted); font-size: 11px; font-weight: 600; }
.stat b { display: block; font-size: 17px; margin-top: 2px; }
.grafiek-kaart { padding: 10px 8px 12px; }
.grafiek { position: relative; min-height: 220px; }
.grafiek svg { display: block; overflow: visible; touch-action: pan-y; }
.raster { stroke: var(--line); stroke-width: 1; }
.raster.v { stroke-dasharray: 2 4; }
.as { fill: var(--faint); font-size: 10px; font-family: var(--display); }
.lijn-kamer { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 4px 8px color-mix(in oklab, var(--heat) 40%, transparent)); }
.lijn-doel { fill: none; stroke: var(--text); stroke-width: 1.5; stroke-dasharray: 4 4; opacity: .55; }
.lijn-buiten { fill: none; stroke: var(--koel); stroke-width: 1.5; opacity: .55; }
.raam-vlak { fill: var(--koel); opacity: .12; }
.grafiek svg.teken .lijn-kamer { stroke-dasharray: 1; stroke-dashoffset: 1; animation: lijnTekenen 1.6s var(--ease) forwards .1s; }
.grafiek svg.teken .lijn-buiten { stroke-dasharray: 1; stroke-dashoffset: 1; animation: lijnTekenen 1.6s var(--ease) forwards .3s; }
.grafiek svg.teken .vlak, .grafiek svg.teken .lijn-doel { animation: vervagen 1s ease .7s both; }
@keyframes lijnTekenen { to { stroke-dashoffset: 0; } }
.scrub-lijn { stroke: var(--text); stroke-width: 1; opacity: .5; }
.scrub-punt { stroke: var(--surface); stroke-width: 2.5; }
.scrub-buiten { fill: var(--koel); stroke: var(--surface); stroke-width: 2; }
.as.buiten { fill: var(--koel); opacity: .8; }
.paneel-kop { fill: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.paneel-nu { fill: var(--text); font-family: var(--display); letter-spacing: 0; text-transform: none; font-size: 12px; }
.paneel-grens { stroke: var(--bad); stroke-width: 1; stroke-dasharray: 3 4; opacity: .6; }
.lijn-paneel { fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.lijn-v { stroke: var(--fris); }
.paneel-vlak-v { fill: var(--fris); opacity: .12; }
.paneel-vlak-c { fill: var(--ok); opacity: .08; }
.scrub-paneel { stroke: var(--surface); stroke-width: 2; }
.scrub-v { fill: var(--fris); }
.scrub-c { fill: var(--warm); }
.grafiek svg.teken .lijn-paneel { stroke-dasharray: 1; stroke-dashoffset: 1; animation: lijnTekenen 1.6s var(--ease) forwards .5s; }
.l-v { background: var(--fris); }
.raam-spoor { stroke: var(--line); stroke-width: 8; stroke-linecap: round; }
.raam-balk { fill: var(--koel); filter: drop-shadow(0 0 6px color-mix(in oklab, var(--koel) 60%, transparent)); }
.raam-naam { fill: var(--muted); font-size: 10px; font-weight: 700; }
.raam-duur { fill: var(--koel); font-size: 9px; font-weight: 700; font-family: var(--display); }
.vent-balk { fill: #2bb3a3; filter: drop-shadow(0 0 6px color-mix(in oklab, #2bb3a3 60%, transparent)); }
.vent-duur { fill: #2bb3a3; font-size: 9px; font-weight: 700; font-family: var(--display); }
.grafiek svg.teken .vent-balk { transform-box: fill-box; transform-origin: left; animation: uitrollen .8s var(--ease) both .6s; }
.bel i.l-vent { display: inline-block; width: 14px; height: 3px; border-radius: 2px; background: #2bb3a3; }
.grafiek svg.teken .raam-balk { transform-box: fill-box; transform-origin: left; animation: uitrollen .8s var(--ease) both .6s; }
.l-c { background: linear-gradient(90deg, var(--ok), var(--warm), var(--bad)); }
.bel { position: absolute; top: -6px; z-index: 2; display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 12px; background: var(--text); color: var(--ink);
  font-size: 12px; pointer-events: none; box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .5); white-space: nowrap; }
.bel b { font-size: 12px; }
.bel span { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.bel i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.legenda { display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: center; color: var(--muted); font-size: 12px; margin-top: 6px; }
.legenda span { display: inline-flex; align-items: center; gap: 6px; }
.legenda i, .bel i.l-doel, .bel i.l-buiten { display: inline-block; width: 14px; height: 3px; border-radius: 2px; }
.l-kamer { background: linear-gradient(90deg, var(--koel), var(--warm), var(--gloed)); }
.l-doel { background: repeating-linear-gradient(90deg, var(--text) 0 4px, transparent 4px 7px); opacity: .7; }
.l-buiten { background: var(--koel); opacity: .7; }
.l-raam { background: var(--koel); opacity: .3; height: 10px !important; border-radius: 3px !important; }

.tussenkop { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 22px 4px 8px; }
.groep { margin-bottom: 8px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); overflow: hidden;
  animation: opkomen .5s var(--ease) both; animation-delay: calc(var(--n) * 40ms); }
.groep summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 14px 16px; font-weight: 650; cursor: pointer; }
.groep summary::-webkit-details-marker { display: none; }
.groep summary span { flex: 1; }
.groep summary svg { width: 18px; height: 18px; fill: var(--faint); transition: transform .35s var(--spring); }
.groep[open] summary svg { transform: rotate(90deg); }
.groep[open] .groep-rijen { animation: openklappen .4s var(--ease); }
@keyframes openklappen { from { opacity: 0; transform: translateY(-6px); } }
.badge { font-style: normal; font-size: 10px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; padding: 3px 7px; border-radius: 999px;
  background: color-mix(in oklab, var(--fris) 18%, transparent); color: var(--fris); }
.badge.voorstel { background: color-mix(in oklab, var(--accent) 18%, transparent); color: var(--accent); }
.groep-rijen { padding: 0 16px 10px; }
.g-rij { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 2px 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13px; }
.g-rij span { color: var(--muted); }
.g-rij b { font-weight: 600; text-align: right; }
.g-rij small { grid-column: 1 / -1; color: var(--faint); font-size: 12px; }
.g-rij.voorstel { margin: 4px -10px; padding: 10px; border-radius: 12px; border: 0; background: color-mix(in oklab, var(--accent) 12%, transparent); }
.g-rij.voorstel span, .g-rij.voorstel b { color: var(--accent); }
.g-rij.voorstel b { text-align: left; grid-column: 1 / -1; }
.tijdlijn { list-style: none; margin: 0; padding: 4px 0 0 14px; border-left: 2px solid var(--line); }
.tijdlijn li { position: relative; padding: 0 0 12px 12px; font-size: 13px; }
.tijdlijn li::before { content: ""; position: absolute; left: -21px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.tijdlijn time { display: block; color: var(--faint); font-size: 11px; font-weight: 700; font-family: var(--display); }

/* Two-way segmented control */
.duo { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 4px; }
.duo button { position: relative; z-index: 1; height: 40px; font-weight: 650; color: var(--muted); transition: color .3s; }
.duo button.aan { color: var(--on-accent); }
.duo-thumb { position: absolute; top: 4px; left: 4px; width: calc(50% - 4px); height: 40px; border-radius: 12px; background: var(--accent);
  transform: translateX(calc(var(--i, 0) * 100%)); transition: transform .5s var(--spring); }

/* Steppers and toggles */
.stapper { display: inline-flex; align-items: center; gap: 4px; padding: 3px; border-radius: 14px; background: var(--surface-2); flex: none; }
.stapper button { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--surface); transition: transform .2s var(--spring), opacity .2s; }
.stapper button:active { transform: scale(.85); }
.stapper button:disabled { opacity: .3; }
.stapper svg { width: 18px; height: 18px; fill: var(--text); }
.stapper b { min-width: 56px; text-align: center; font-size: 17px; font-weight: 700; }
.schakel.klein { width: 44px; height: 27px; }
.schakel.klein::after { width: 21px; height: 21px; }
.schakel.klein[aria-checked="true"]::after { transform: translateX(17px); }
.profiel .kaart-kop h2 { display: flex; align-items: center; gap: 8px; color: var(--text); letter-spacing: .02em; text-transform: none; font-size: 17px; font-family: var(--display); }
.stip { width: 10px; height: 10px; border-radius: 50%; background: var(--kleur); box-shadow: 0 0 12px var(--kleur); }
.profiel { border-top: 3px solid var(--kleur); }
.p-rij { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.p-rij + .p-rij { border-top: 1px solid var(--line); }
.p-naam { flex: 1; font-weight: 600; }
.p-rij .stapper b { color: var(--heat); }
.p-uit { color: var(--faint); font-weight: 600; padding: 9px 14px; }
.t-rij { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; }
.t-rij + .t-rij { border-top: 1px solid var(--line); }
.t-rij b { display: block; font-weight: 650; }
.t-rij small { color: var(--muted); font-size: 12px; }

/* Schedule: draggable day timeline */
.hint-r { color: var(--muted); font-size: 13px; margin: 10px 2px 12px; }
.tijdlijn-dag { position: relative; margin-left: 46px; }
.uur { position: absolute; left: -46px; translate: 0 -50%; font: 600 11px/1 var(--display); color: var(--faint); }
.uur { right: 0; }
.uur::after { content: ""; position: absolute; left: 46px; right: 0; top: 50%; height: 1px; background: var(--line); }
.baan { position: absolute; inset: 0; }
.sblok { position: absolute; left: 0; right: 0; display: grid; grid-template-columns: 1fr auto; align-content: start; gap: 0 8px; padding: 8px 12px; text-align: left; overflow: hidden;
  border-radius: 14px; background: color-mix(in oklab, var(--kleur) 26%, var(--surface)); border: 1px solid color-mix(in oklab, var(--kleur) 55%, transparent);
  box-shadow: inset 4px 0 0 var(--kleur); transition: transform .2s var(--spring), filter .2s; animation: opkomen .45s var(--ease) both; animation-delay: calc(var(--n) * 60ms); }
.sblok:active { transform: scale(.985); filter: brightness(1.15); }
.sb-naam { font-weight: 700; }
.sb-temp { font-size: 18px; font-weight: 800; }
.sb-tijd { grid-column: 1 / -1; color: var(--muted); font-size: 12px; font-weight: 600; }
.grens { position: absolute; left: -8px; right: -8px; height: 32px; translate: 0 -50%; z-index: 2; display: flex; align-items: center; touch-action: none; cursor: ns-resize; }
.grens i { flex: 1; height: 4px; margin: 0 40px 0 30px; border-radius: 3px; background: var(--text); opacity: .0; transition: opacity .2s; }
.grens::before { content: ""; position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: 38px; height: 6px; border-radius: 4px; background: var(--text);
  box-shadow: 0 0 0 3px var(--ink); transition: width .25s var(--spring), height .25s var(--spring); }
.grens em { position: absolute; right: 14px; top: 50%; translate: 0 -50%; font-style: normal; font-size: 12px; font-weight: 800; padding: 3px 7px; border-radius: 8px;
  background: var(--text); color: var(--ink); opacity: 0; transition: opacity .2s, transform .25s var(--spring); transform: scale(.8); }
.grens.sleept::before { width: 60px; height: 8px; background: var(--accent); }
.grens.sleept i { opacity: .35; }
.grens.sleept em { opacity: 1; transform: scale(1.1); background: var(--accent); color: var(--on-accent); }
.nu-lijn { position: absolute; left: -6px; right: 0; height: 2px; background: var(--bad); z-index: 1; pointer-events: none; }
.nu-lijn::before { content: ""; position: absolute; left: -4px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--bad); }
.nu-lijn em { position: absolute; left: -44px; top: -7px; font-style: normal; font-size: 10px; font-weight: 800; color: var(--bad); text-transform: uppercase; }
.profiel-kies { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.profiel-kies button { display: flex; align-items: center; gap: 8px; padding: 12px; border-radius: 14px; background: var(--surface-2); border: 2px solid transparent; font-weight: 650; text-align: left;
  transition: transform .2s var(--spring), border-color .2s; }
.profiel-kies button:active { transform: scale(.95); }
.profiel-kies button.aan { border-color: var(--kleur); background: color-mix(in oklab, var(--kleur) 18%, var(--surface-2)); }
.profiel-kies i { width: 10px; height: 10px; border-radius: 50%; background: var(--kleur); }
.profiel-kies span { flex: 1; }
.profiel-kies em { font-style: normal; color: var(--muted); font-size: 13px; }
.vel-acties { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.vel-acties button { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 13px; border-radius: 14px; background: var(--surface-2); font-weight: 650; }
.vel-acties svg { width: 18px; height: 18px; fill: currentColor; }
.vel-acties .gevaar { color: var(--bad); }
.vel-acties button:disabled { opacity: .35; }

/* Rooms */
.k-naam { flex: 1; min-width: 0; font: 700 18px/1.2 var(--display); background: none; border: 0; padding: 4px 0; color: var(--text); outline: none; border-bottom: 1px dashed transparent; }
.k-naam:focus { border-bottom-color: var(--accent); }
.k-veld { display: block; margin: 4px 0 6px; }
.k-veld span { display: block; color: var(--muted); font-size: 12px; font-weight: 600; margin-bottom: 4px; }
select { width: 100%; appearance: none; -webkit-appearance: none; padding: 11px 36px 11px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2)
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%238C95A8' d='m7 10 5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 8px center / 22px;
  color: var(--text); font: inherit; font-size: 15px; }
select.mini { width: auto; padding: 7px 30px 7px 10px; font-size: 13px; }
select.toevoegen { margin-top: 6px; color: var(--accent); font-weight: 650; border-style: dashed; }
.lijst-rij { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.lijst-rij + .lijst-rij { border-top: 1px solid var(--line); }
.lijst-rij > svg { width: 20px; height: 20px; fill: var(--muted); flex: none; }
.lijst-rij > span { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lijst-rij .stapper b { min-width: 52px; font-size: 14px; }
.lijst-rij .stapper button { width: 30px; height: 30px; }
.weg { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in oklab, var(--bad) 12%, transparent); flex: none; }
.weg svg { width: 16px; height: 16px; fill: var(--bad); }

/* Save bar */
.bewaar { position: fixed; z-index: 6; left: 16px; right: 16px; bottom: calc(env(safe-area-inset-bottom) + 92px); display: flex; align-items: center; gap: 8px;
  padding: 8px 8px 8px 16px; border-radius: 20px; background: color-mix(in oklab, var(--surface) 82%, transparent); border: 1px solid var(--line);
  backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5); box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .55);
  transform: translateY(160%); opacity: 0; pointer-events: none; transition: transform .5s var(--spring), opacity .3s; }
.bewaar.zichtbaar { transform: none; opacity: 1; pointer-events: auto; }
.bewaar span { flex: 1; font-weight: 650; font-size: 14px; }
.bewaar button { padding: 11px 14px; border-radius: 14px; font-weight: 650; }
.bewaar .primair { width: auto; padding: 11px 18px; font-size: 15px; }
#tab-regels { padding-bottom: calc(env(safe-area-inset-bottom) + 170px); }

/* ================================================================ animated icons (only move inside .aan) */
.ico-l { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.ico-airco .lucht { stroke: var(--warm); stroke-dasharray: 3 4; opacity: 0; transition: opacity .4s; }
.koel .ico-airco .lucht { stroke: var(--fris); }
.aan .ico-airco .lucht { opacity: 1; animation: blazen .9s linear infinite; }
.aan .ico-airco .lucht:nth-of-type(2) { animation-delay: -.3s; }
.aan .ico-airco .lucht:nth-last-of-type(1) { animation-delay: -.6s; }
@keyframes blazen { to { stroke-dashoffset: -14; } }
.ico-radiator .golf { stroke: var(--gloed); opacity: 0; }
.aan .ico-radiator .golf { animation: golfStijgt 2s ease-in-out infinite; }
.aan .ico-radiator .golf:nth-child(2) { animation-delay: .5s; }
.aan .ico-radiator .golf:nth-child(3) { animation-delay: 1s; }
@keyframes golfStijgt { 0% { opacity: 0; transform: translateY(4px); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(-5px); } }
.apparaat .ico-l { width: 30px; height: 30px; color: var(--muted); flex: none; fill: none; }
.apparaat.aan .ico-l { color: var(--text); }
.ico-wind .w { stroke-dasharray: 16 6; }
.aan .ico-wind .w { animation: waaien 1.4s linear infinite; }
.aan .ico-wind .w:nth-child(2) { animation-duration: 1.1s; }
.aan .ico-wind .w:nth-child(3) { animation-duration: 1.7s; }
@keyframes waaien { to { stroke-dashoffset: -22; } }
.raam-pin .ico-l { width: 15px; height: 15px; stroke: #fff; }
.tag.raam .ico-l { width: 13px; height: 13px; }
.vel-ramen .ico-l { width: 15px; height: 15px; }

/* Weather */
.weer-ico { width: 30px; height: 30px; flex: none; color: var(--text); }
.weer-ico svg { width: 100%; height: 100%; }
.ico-zon circle { fill: var(--warm); stroke: var(--warm); }
.ico-zon .stralen, .ico-zonwolk .stralen { stroke: var(--warm); transform-origin: 16px 16px; }
.aan .ico-zon .stralen { animation: draaien 14s linear infinite; }
.ico-zonwolk .stralen { transform-origin: 12px 11px; }
.ico-zonwolk circle { fill: var(--warm); }
.aan .ico-zonwolk .stralen { animation: pulseren 3s ease-in-out infinite; }
.ico-zonwolk .drijf, .ico-wolk .drijf { fill: var(--surface-2); }
.aan .drijf { animation: drijven 5s ease-in-out infinite; }
.ico-regen .drup { stroke: var(--fris); }
.aan .ico-regen .drup { animation: vallen 1s linear infinite; }
.aan .ico-regen .drup:nth-of-type(2) { animation-delay: .33s; }
.aan .ico-regen .drup:nth-of-type(3) { animation-delay: .66s; }
.ico-maan path { fill: color-mix(in oklab, var(--warm) 30%, transparent); stroke: var(--warm); }
.ico-maan .ster { fill: var(--text); stroke: none; }
.aan .ico-maan path { animation: maanGloed 4s ease-in-out infinite; }
.aan .ico-maan .ster { animation: twinkelen 2.4s ease-in-out infinite; }
.aan .ico-maan .ster:last-child { animation-delay: 1.2s; }
@keyframes pulseren { 50% { opacity: .55; transform: scale(.9); } }
@keyframes drijven { 50% { transform: translateX(2px); } }
@keyframes vallen { from { transform: translateY(-3px); opacity: 0; } 30% { opacity: 1; } to { transform: translateY(5px); opacity: 0; } }
@keyframes maanGloed { 50% { filter: drop-shadow(0 0 4px var(--warm)); } }
@keyframes twinkelen { 50% { opacity: .2; } }

/* Room warming up: a sheen runs over the thermometer */
.kamer.warmt .vul { overflow: hidden; }
.kamer.warmt .vul::after { content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .55) 50%, transparent 80%); background-size: 200% 100%; animation: glinster 2.2s linear infinite; }
@keyframes glinster { from { background-position: 150% 0; } to { background-position: -50% 0; } }

/* Quick actions */
.actie .ico-vuur { transform-origin: 50% 90%; animation: flakkeren 1.6s ease-in-out infinite; }
.actie .ico-druppel { animation: deinen 2.6s ease-in-out infinite; }
.actie .ico-hand { transform-origin: 50% 85%; }
.actie:active .ico-hand, .actie.bezig .ico-hand { animation: zwaaien .6s ease-in-out 2; }
@keyframes flakkeren { 0%, 100% { transform: scale(1) skewX(0); } 25% { transform: scale(1.06, .96) skewX(-3deg); } 50% { transform: scale(.97, 1.05) skewX(2deg); } 75% { transform: scale(1.03, .98) skewX(-1deg); } }
@keyframes deinen { 50% { transform: translateY(-3px); } }
@keyframes zwaaien { 25% { transform: rotate(-14deg); } 75% { transform: rotate(14deg); } }

/* Energy flow */
.flow { margin: 12px -4px 0; }
.flow svg { width: 100%; height: auto; display: block; overflow: visible; }
.f-spoor { fill: none; stroke: var(--line); stroke-width: 3; }
.f-stroom { fill: none; stroke-width: 5; stroke-linecap: round; stroke-dasharray: .1 12; opacity: 0; transition: opacity .5s;
  animation: vloeien 1.5s linear infinite; filter: drop-shadow(0 0 3px currentColor); }
.f-stroom.actief { opacity: 1; }
@keyframes vloeien { to { stroke-dashoffset: -24.2; } }
.f-huis { fill: var(--surface-2); stroke: var(--line); stroke-width: 1.5; }
.flow svg > svg { fill: var(--text); }
.f-knoop .f-cirkel { fill: var(--surface-2); stroke: var(--line); stroke-width: 1.5; transition: stroke .5s; }
.f-knoop svg { fill: var(--muted); transition: fill .5s; }
.f-knoop.actief .f-cirkel { stroke: var(--kleur); }
.f-knoop.actief svg { fill: var(--kleur); }
.f-puls { fill: none; stroke: var(--kleur); stroke-width: 2; opacity: 0; transform-box: fill-box; transform-origin: center; }
.f-knoop.actief .f-puls { animation: knoopPuls 2.4s ease-out infinite; }
@keyframes knoopPuls { from { opacity: .7; transform: scale(1); } to { opacity: 0; transform: scale(1.6); } }
.f-knoop[data-knoop="zon"].actief svg { animation: draaien 16s linear infinite; transform-box: fill-box; transform-origin: center; }
.f-naam { fill: var(--muted); font-size: 11px; font-weight: 650; }
.f-waarde { fill: var(--text); font: 700 15px var(--display); }
.f-midden { font-size: 13px; fill: var(--muted); }
.f-eenheid { fill: var(--muted); font-size: 11px; font-weight: 600; }

/* ================================================================ tablet (iPad) and wider
   Phone layout stays exactly as it is: the wrappers below are plain blocks there.
   From 740px the tabs use the width with columns instead of stretching every card. */
@media (min-width: 740px) {
  #tab-bediening, #tab-huis, #tab-regels { padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); }
  #tab-bediening > *, #tab-huis > *, #tab-regels > * { max-width: 1320px; margin-left: auto; margin-right: auto; }
  .kop { margin-top: 10px; }
  .groet { font-size: 30px; }

  /* Nu: column A (meter, day, mode) + B (rooms) on the left, C (power, air, quick) on the right */
  .nu-raster { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 18px; align-items: start; }
  .nu-raster .kaart { margin-top: 18px; }
  .nu-c > .kaart:first-child { margin-top: 10px; }
  .dial { width: 300px; }
  .flow { max-width: 520px; margin-left: auto; margin-right: auto; }
  .prijzen { height: 96px; }

  /* Huis without a floor plan: bigger room cards */
  .vloer-kamers { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
  .vk { padding: 18px 18px 16px; border-radius: 24px; }
  .vk::before { width: 140px; height: 140px; right: -40px; top: -40px; }
  .vk-temp { font-size: 40px; }
  .vk-naam { font-size: 17px; margin-top: 4px; }
  .vk-sub { font-size: 13px; }

  /* Huis with photos (portrait renders): photo on the left, rooms beside it */
  #tab-huis[data-foto="1"] { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); grid-template-rows: auto auto 1fr; gap: 0 22px; align-content: start; }
  #tab-huis[data-foto="1"] > * { margin-left: 0; margin-right: 0; max-width: none; }
  #tab-huis[data-foto="1"] > .kop { grid-column: 1 / -1; }
  #tab-huis[data-foto="1"] > .vloer-kies { grid-column: 1; }
  #tab-huis[data-foto="1"] > .foto-kaart { grid-column: 1; }
  #tab-huis[data-foto="1"] > .vloer-kamers { grid-column: 2; grid-row: 2 / span 2; margin-top: 0; align-content: start; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

  /* Regels: room cards side by side */
  .secties { margin-left: 0; margin-right: 0; padding-left: 0; }
  .chips { flex-wrap: wrap; overflow: visible; margin-left: 0; margin-right: 0; padding: 0; }
  .sectie[data-s="profielen"], .sectie[data-s="regels"], .sectie[data-s="kamers"] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
  .sectie[data-s] > :not(.kaart) { grid-column: 1 / -1; }
  .sectie[data-s="profielen"] > .kaart, .sectie[data-s="regels"] > .kaart, .sectie[data-s="kamers"] > .kaart { margin-top: 0; }

  /* Inzicht: the calculated groups in two columns */
  .groepen { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; align-items: start; }
  .groepen > :not(.groep) { grid-column: 1 / -1; }

  /* Schema: controls on the left, the day on the right */
  .sectie[data-s="schema"] { display: grid; grid-template-columns: 300px minmax(0, 1fr); grid-template-rows: auto auto auto auto 1fr; gap: 12px 28px; align-items: start; }
  .sectie[data-s="schema"] > .tijdlijn-dag { grid-column: 2; grid-row: 1 / -1; margin-top: 8px; }
  .sectie[data-s="schema"] > :not(.tijdlijn-dag) { grid-column: 1; margin: 0; }
  .sectie[data-s="schema"] .chips { gap: 8px; }

  /* Sheets and the save bar float in the middle instead of spanning the screen */
  .vel { max-width: 640px; margin: 0 auto; border-radius: 28px 28px 0 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
  .bewaar { max-width: 560px; margin: 0 auto; }
}

/* Landscape iPad and wider: Nu gets three columns (meter | rooms | power) */
@media (min-width: 1100px) {
  .nu-links { display: contents; }
  .nu-raster { grid-template-columns: minmax(330px, .9fr) minmax(0, 1fr) minmax(0, 1fr); }
  .nu-b > .kaart:first-child { margin-top: 10px; }
  .sectie[data-s="profielen"], .sectie[data-s="regels"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #tab-huis[data-foto="1"] { grid-template-columns: minmax(0, 560px) minmax(0, 1fr); }
}

/* Warmtemodel tegen de werkelijkheid (app 3.21) */
.model-kaart { margin-top: 12px; }
.model-kop { padding: 6px 8px 2px; }
.model-kop h3 { margin: 0; font-family: var(--display); font-size: 17px; }
.model-uitleg { margin: 4px 0 6px; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.model-stats { grid-template-columns: repeat(4, 1fr); margin: 0 4px 6px; }
.lijn-echt { fill: none; stroke: var(--text); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.lijn-model { fill: none; stroke: var(--fris); stroke-width: 2.25; stroke-dasharray: 5 4; stroke-linecap: round; }
.afw-vlak { fill: var(--bad); fill-opacity: .18; }
.afw-band { fill: var(--ok); fill-opacity: .1; }
.scrub-model { fill: var(--fris); stroke: var(--surface); stroke-width: 2; }
.grafiek svg.teken .lijn-echt { stroke-dasharray: 1; stroke-dashoffset: 1; animation: lijnTekenen 1.4s var(--ease) forwards .1s; }
.grafiek svg.teken .lijn-model, .grafiek svg.teken .afw-vlak { animation: vervagen .9s ease .6s both; }
.l-echt { background: var(--text); }
.l-model { background: repeating-linear-gradient(90deg, var(--fris) 0 5px, transparent 5px 8px); }
.l-afw { background: var(--bad); opacity: .45; height: 8px !important; }
.bel i.l-echt, .bel i.l-model { display: inline-block; width: 14px; height: 3px; border-radius: 2px; }
.bel i.l-echt { background: var(--ink); }

/* Verbinden: terug / verbreken (app 3.23) */
.knoppen-rij { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; }
.tekstknop { background: none; border: 0; padding: 8px 4px; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.tekstknop:hover { color: var(--text); }
.tekstknop.gevaar:hover { color: var(--bad); }

/* Start without status (e.g. cloud 429): message and the way to the connection screen */
.startfout { margin: 24px 16px; padding: 22px 20px; display: grid; gap: 12px; text-align: center; }
.startfout p { margin: 0; color: var(--text); line-height: 1.45; }
