/* Kleuren, lettertype en opbouw gelijk aan Mijn energie dashboard */
:root {
  --bg: #EDF1F5;
  --panel: #FFFFFF;
  --panel2: #F5F8FB;
  --track: #E4EAF0;
  --sun: #E39A0B;
  --house: #2A72C9;
  --battery: #6352D6;
  --card: #FFFFFF;
  --card-solid: #FFFFFF;
  --card2: #F5F8FB;
  --line: #DDE4EB;
  --text: #15202A;
  --muted: #5B6A78;
  --faint: #93A1AE;
  --accent: #2A72C9;
  --accent-soft: color-mix(in srgb, #2A72C9 13%, transparent);
  --ok: #11977E;
  --warn: #E39A0B;
  --bad: #D94B3D;
  --heat: #E8742A;
  --cool: #3B83C4;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 10px 28px rgba(16, 24, 40, .07);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, .25);
  --tile-off: linear-gradient(180deg, var(--panel), var(--panel2));
  --icon-off: #E4EAF0;
  --radius: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #090F15; --panel: #111B25; --panel2: #0E1720; --track: #1C2A37;
    --sun: #FFB62E; --house: #4DA6FF; --battery: #9D8DFF;
    --card: #111B25; --card-solid: #111B25; --card2: #0E1720; --line: #1F2E3C;
    --text: #E9EFF4; --muted: #8C9DAC; --faint: #5A6B7A;
    --accent: #4DA6FF; --accent-soft: color-mix(in srgb, #4DA6FF 16%, transparent);
    --ok: #2BE3B5; --warn: #FFB62E; --bad: #FF6A5A; --heat: #FF8A4C; --cool: #6AAEE8;
    --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 12px 32px rgba(0, 0, 0, .4);
    --shadow-lg: 0 30px 80px rgba(0, 0, 0, .6);
    --icon-off: #1C2A37;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #090F15; --panel: #111B25; --panel2: #0E1720; --track: #1C2A37;
  --sun: #FFB62E; --house: #4DA6FF; --battery: #9D8DFF;
  --card: #111B25; --card-solid: #111B25; --card2: #0E1720; --line: #1F2E3C;
  --text: #E9EFF4; --muted: #8C9DAC; --faint: #5A6B7A;
  --accent: #4DA6FF; --accent-soft: color-mix(in srgb, #4DA6FF 16%, transparent);
  --ok: #2BE3B5; --warn: #FFB62E; --bad: #FF6A5A; --heat: #FF8A4C; --cool: #6AAEE8;
  --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 12px 32px rgba(0, 0, 0, .4);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, .6);
  --icon-off: #1C2A37;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Bahnschrift, "DIN Alternate", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-variant-numeric: tabular-nums;
  background:
    radial-gradient(1000px 520px at -5% -12%, color-mix(in srgb, var(--sun) 13%, transparent), transparent 70%),
    radial-gradient(900px 600px at 105% -5%, color-mix(in srgb, var(--house) 14%, transparent), transparent 70%),
    radial-gradient(800px 500px at 50% 110%, color-mix(in srgb, var(--battery) 9%, transparent), transparent 70%), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--house); }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.hidden { display: none !important; }

/* ---------- kop (zoals Mijn energie dashboard) ---------- */
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 28px 8px; max-width: 1500px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand .logo {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; color: #fff; flex: none;
  background: linear-gradient(135deg, var(--house), var(--battery));
  box-shadow: 0 8px 22px color-mix(in srgb, var(--house) 45%, transparent);
}
.brand .logo svg { width: 24px; height: 24px; stroke-width: 2.2; }
.brand h1 { margin: 0; font-weight: 600; font-size: 1.55rem; letter-spacing: .01em; line-height: 1.15; }
.brand h1 .hver { font-size: .78rem; font-weight: 400; color: var(--muted); letter-spacing: 0; white-space: nowrap; margin-left: 4px; }
.brand #sub { color: var(--muted); font-size: .95rem; }
.hr { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.live { display: inline-flex; align-items: center; gap: 7px; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.livedot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); animation: live 2s ease-out infinite; }
.live.off .livedot { background: var(--bad); animation: none; }
@keyframes live { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }
#clock { font-size: 1.8rem; font-weight: 300; color: var(--muted); letter-spacing: .02em; }
.cfg { display: inline-flex; align-items: center; gap: 7px; color: var(--text); text-decoration: none; border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 7px 14px; font-size: .92rem; box-shadow: var(--shadow); white-space: nowrap; }
.cfg:hover { border-color: var(--muted); }
.cfg svg.i { width: 16px; height: 16px; }
.cfg.on { background: var(--text); color: var(--panel); border-color: var(--text); }
.iconbtn {
  width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow);
  display: grid; place-items: center; color: var(--text); position: relative; transition: transform .12s, border-color .2s;
}
.iconbtn:hover { border-color: var(--muted); }
.iconbtn:active { transform: scale(.94); }
.iconbtn svg.i { width: 18px; height: 18px; }
.iconbtn .badge {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px;
  background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center;
}
.spin svg { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* statusregel onder de kop */
.pills { display: flex; flex-wrap: wrap; gap: 14px; padding: 0 28px 14px; color: var(--muted); font-size: .85rem; max-width: 1500px; margin: 0 auto; }
.pill { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; cursor: default; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.pill.ok .dot { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.pill.fout .dot { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.pill.verbinden .dot { background: var(--warn); animation: pulse 1.2s infinite; }
.pill.demo { color: var(--battery); cursor: pointer; font-weight: 600; }
.pill.demo::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--battery); }
@keyframes pulse { 50% { opacity: .35; } }
@media (max-width: 700px) {
  .top { padding: 14px 16px 6px; }
  .pills { padding: 0 16px 12px; }
  .brand h1 { font-size: 1.3rem; }
  .brand h1 .hver { display: block; margin: 3px 0 0; }
  #clock { display: none; }
  .cfg .cfgl { display: none; }
  .cfg { width: 36px; height: 36px; padding: 0; justify-content: center; }
  .iconbtn { width: 36px; height: 36px; }
  .hr { gap: 6px; }
  .summary { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 11px 12px; gap: 9px; }
  .stat b { font-size: 1.15rem; }
  .stat .si { width: 30px; height: 30px; }
  .room { padding: 12px 12px 14px; }
}

/* ---------- pagina ---------- */
main { max-width: 1500px; margin: 0 auto; padding: 4px 28px 90px; }
@media (max-width: 700px) { main { padding: 4px 16px 90px; } }

.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 6px 0 16px; }
.hero h1 { margin: 0; font-size: clamp(22px, 3.4vw, 30px); letter-spacing: .005em; font-weight: 600; }
.hero p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.summary { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); margin-bottom: 18px; }
.herobtns { display: flex; gap: 8px; flex-wrap: wrap; }
.roomctl.covers { gap: 6px; padding: 5px 6px 5px 12px; color: var(--muted); }
.roomctl.covers .iconbtn { width: 34px; height: 34px; }
.coverbtns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.coverbtns .btn { height: 56px; border-radius: 16px; font-size: 15px; }
.coverbtns.my { grid-template-columns: repeat(4, 1fr); }
/* kerncijfers (kpi-kaarten zoals in het energie dashboard) */
.stat {
  --c: var(--house); position: relative; overflow: hidden; text-align: left;
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px;
  border: 1px solid var(--line); color: var(--muted); font-size: .8rem;
  background: radial-gradient(240px 120px at 100% 0%, color-mix(in srgb, var(--c) 14%, transparent), transparent 70%), linear-gradient(180deg, var(--panel), var(--panel2));
  box-shadow: var(--shadow); transition: transform .25s, border-color .25s, box-shadow .25s;
}
.stat::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--c), transparent 80%); }
button.stat:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--c) 55%, var(--line)); box-shadow: var(--shadow), 0 10px 30px color-mix(in srgb, var(--c) 22%, transparent); }
.stat b { display: block; color: var(--text); font-size: 1.45rem; font-weight: 600; line-height: 1.1; white-space: nowrap; }
.stat .si { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c); }
.stat .si svg.i { width: 18px; height: 18px; }
.stat.warm { --c: var(--sun); }
.stat.heat { --c: var(--heat); }
.stat.cool { --c: var(--cool); }
.stat.bad { --c: var(--bad); }
.stat.bolt { --c: var(--battery); }

.toolbar { display: flex; gap: 10px; align-items: center; margin: 4px 0 14px; flex-wrap: wrap; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; max-width: 100%; }
.tab { font-size: .9rem; background: var(--bg); border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 5px 14px; white-space: nowrap; transition: all .2s; }
.tab:hover { border-color: var(--muted); }
.tab.on { background: var(--text); color: var(--panel); border-color: var(--text); }
.search { flex: 1; min-width: 160px; max-width: 320px; display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 38px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); }
.search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; color: var(--text); font-size: 14px; }
.search svg.i { width: 17px; height: 17px; }

.roomnav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 10px; padding: 2px 16px 6px; }
.roomnav::-webkit-scrollbar { display: none; }
.chip { border: 1px solid var(--line); background: var(--panel); padding: 5px 13px; border-radius: 99px; font-size: .88rem; color: var(--muted); white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.chip .n { color: var(--faint); }
.chip.lit { color: var(--text); }
.chip.lit::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 8px var(--sun); }

/* ---------- ruimte (als paneel) ---------- */
.room { margin: 0 0 18px; scroll-margin-top: 20px; background: linear-gradient(180deg, var(--panel), var(--panel2)); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px 18px; box-shadow: var(--shadow); }
.roomhead { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.roomhead .ri { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--house) 14%, transparent); color: var(--house); }
.roomhead .ri svg.i { width: 18px; height: 18px; }
.roomhead .ri.lit { color: var(--sun); background: color-mix(in srgb, var(--sun) 16%, transparent); }
.roomhead h2 { margin: 0; font-size: .8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.roomhead .sub { font-size: .85rem; color: var(--muted); margin-top: 2px; }
.roomhead .grow { flex: 1; min-width: 120px; }
.roomctl { display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 5px 8px 5px 14px; }
.roomctl input[type=range] { width: 140px; }
.zonetag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); background: var(--accent-soft); padding: 2px 7px; border-radius: 6px; margin-left: 6px; vertical-align: 1px; }

.scenes { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: -2px 0 12px; padding-bottom: 2px; }
.scenes::-webkit-scrollbar { display: none; }
.scene {
  display: inline-flex; align-items: center; gap: 9px; padding: 6px 14px 6px 6px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg); font-size: .88rem; white-space: nowrap; transition: transform .12s;
}
.scene:active { transform: scale(.96); }
.scene .sw { width: 24px; height: 24px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.scene.active { border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: 0 0 0 3px var(--accent-soft); }
.scene.tap .sw { display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.scene.tap .sw svg { width: 15px; height: 15px; }

/* ---------- tegels ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 12px; }
.tile {
  position: relative; border-radius: var(--radius); padding: 14px 14px 16px; min-height: 132px;
  background: var(--tile-off); border: 1px solid var(--line); box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 10px; overflow: hidden; user-select: none; -webkit-user-select: none;
  cursor: pointer; transition: transform .15s ease, background .35s, box-shadow .35s, border-color .35s;
  touch-action: pan-y;
}
.tile:active { transform: scale(.975); }
.tile .ti {
  width: 44px; height: 44px; border-radius: 15px; display: grid; place-items: center;
  background: var(--icon-off); color: var(--muted); transition: background .35s, color .35s, box-shadow .35s;
}
.tile .ti svg.i { width: 23px; height: 23px; }
/* de volledige naam, zo nodig over meerdere regels (nooit afgekapt) */
.tile .name { font-weight: 650; font-size: 14.5px; line-height: 1.25; letter-spacing: -.005em; white-space: normal; overflow-wrap: anywhere; hyphens: auto; }
.tile .state { font-size: 13px; color: var(--muted); margin-top: 2px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tile .state .big { font-size: 20px; font-weight: 700; color: var(--text); letter-spacing: -.02em; }
.tile .bottom { margin-top: auto; }
.tile .more {
  position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 10px; border: 0;
  background: transparent; color: var(--faint); display: grid; place-items: center; opacity: .85;
}
.tile .more:hover { background: var(--line); color: var(--text); }
.tile .more svg.i { width: 18px; height: 18px; }
.tile .src { position: absolute; right: 44px; top: 19px; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); }
.tile.on .src { color: color-mix(in srgb, var(--text) 45%, transparent); }
.tile .name .fav { color: #f5b20b; margin-right: 3px; }
.tile .name .fav svg.i { width: 13px; height: 13px; fill: currentColor; vertical-align: -1px; }

/* aan */
.tile.on { --glow: #ffc56b; background: linear-gradient(150deg, color-mix(in srgb, var(--glow) 34%, var(--card-solid)) 0%, color-mix(in srgb, var(--glow) 12%, var(--card-solid)) 70%); border-color: color-mix(in srgb, var(--glow) 35%, transparent); box-shadow: 0 8px 30px color-mix(in srgb, var(--glow) 25%, transparent); }
.tile.on .ti { background: var(--glow); color: color-mix(in srgb, var(--glow) 25%, #000); box-shadow: 0 0 22px color-mix(in srgb, var(--glow) 70%, transparent); }
.tile.on.kind-plug, .tile.on.kind-climate { --glow: #ff9b52; }
.tile.on.kind-plug { --glow: #42c98b; }
.tile.on.cool { --glow: #59b4ff; }
.tile.alert { --glow: #ff5a5f; background: linear-gradient(150deg, color-mix(in srgb, #ff5a5f 22%, var(--card-solid)), var(--card-solid)); border-color: rgba(255, 90, 95, .4); }
.tile.alert .ti { background: #ff5a5f; color: #fff; }
.tile.offline { opacity: .55; }
.tile.offline .state { color: var(--bad); }
.tile.ring { animation: ring 1s ease 3; }
@keyframes ring { 0%,100% { transform: none; } 20% { transform: rotate(-2deg) scale(1.02); } 40% { transform: rotate(2deg) scale(1.02); } 60% { transform: rotate(-1deg); } }

/* helderheidsbalk in de tegel */
.bribar { position: absolute; left: 0; bottom: 0; height: 5px; width: 100%; background: transparent; }
.bribar i { display: block; height: 100%; background: var(--glow, #ffc56b); border-radius: 0 3px 3px 0; transition: width .2s; opacity: .95; }
.tile.dragging { transform: none !important; }
.tile.dragging .bribar { height: 100%; opacity: .22; }
.tile .dragval { position: absolute; top: 12px; right: 14px; font-weight: 800; font-size: 22px; letter-spacing: -.02em; }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty svg.i { width: 46px; height: 46px; color: var(--faint); }
.empty h3 { color: var(--text); margin: 12px 0 6px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--card-solid);
  height: 40px; padding: 0 16px; border-radius: 999px; font-weight: 500; font-size: .92rem; box-shadow: var(--shadow); color: var(--text); transition: transform .1s, filter .2s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: #fff; border-color: transparent; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn.danger { color: var(--bad); }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; box-shadow: none; }
.btn:hover { border-color: var(--muted); }
.btn svg.i { width: 17px; height: 17px; }
.btn:disabled { opacity: .5; cursor: default; }

/* ---------- schakelaar en schuifjes ---------- */
.switch { position: relative; width: 50px; height: 30px; border-radius: 99px; background: var(--faint); border: 0; flex: none; transition: background .2s; padding: 0; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25); transition: transform .22s cubic-bezier(.3,1.4,.5,1); }
.switch.on { background: var(--ok); }
.switch.on::after { transform: translateX(20px); }
.switch:disabled { opacity: .5; }

input[type=range] { -webkit-appearance: none; appearance: none; height: 30px; background: transparent; width: 100%; margin: 0; cursor: pointer; --p: 50%; --fill: var(--accent); }
input[type=range]::-webkit-slider-runnable-track { height: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--fill) var(--p), var(--icon-off) var(--p)); }
input[type=range]::-moz-range-track { height: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--fill) var(--p), var(--icon-off) var(--p)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; margin-top: -7px; box-shadow: 0 1px 6px rgba(0,0,0,.3); border: 0; }
input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 6px rgba(0,0,0,.3); border: 0; }
input[type=range].kelvin::-webkit-slider-runnable-track { background: linear-gradient(90deg, #ff9a3c, #ffd9a8 35%, #fff6ea 55%, #dbe9ff 80%, #a9c9ff); }
input[type=range].kelvin::-moz-range-track { background: linear-gradient(90deg, #ff9a3c, #ffd9a8 35%, #fff6ea 55%, #dbe9ff 80%, #a9c9ff); }

/* grote helderheidsschuif */
.bigslider { position: relative; height: 64px; border-radius: 20px; background: var(--icon-off); overflow: hidden; cursor: ew-resize; touch-action: none; user-select: none; }
.bigslider .fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, color-mix(in srgb, var(--glow, #ffc56b) 70%, transparent), var(--glow, #ffc56b)); }
.bigslider .lbl { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; font-weight: 700; font-size: 15px; pointer-events: none; }
.bigslider .lbl b { font-size: 22px; letter-spacing: -.02em; }

/* ---------- venster (detail / instellingen) ---------- */
.scrim { position: fixed; inset: 0; background: rgba(5, 8, 15, .45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: 50; opacity: 0; transition: opacity .2s; }
.scrim.show { opacity: 1; }
.sheet {
  position: fixed; z-index: 51; left: 50%; top: 50%; transform: translate(-50%, -46%) scale(.98); opacity: 0;
  width: min(560px, calc(100vw - 32px)); max-height: min(88vh, 900px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--panel); border-radius: 18px; box-shadow: var(--shadow-lg); border: 1px solid var(--line);
  transition: transform .25s cubic-bezier(.2,.9,.3,1.1), opacity .2s;
}
.sheet.wide { width: min(760px, calc(100vw - 32px)); }
.sheet.show { transform: translate(-50%, -50%); opacity: 1; }
.sheet header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 18px 18px 14px 20px; background: color-mix(in srgb, var(--card-solid) 92%, transparent); backdrop-filter: blur(10px); }
.sheet header .ti { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; background: var(--icon-off); color: var(--muted); }
.sheet header .ti.lit { background: var(--glow); color: color-mix(in srgb, var(--glow) 25%, #000); box-shadow: 0 0 24px color-mix(in srgb, var(--glow) 60%, transparent); }
.sheet header h3 { margin: 0; font-size: 1.25rem; font-weight: 600; }
.sheet header .sub { color: var(--muted); font-size: 13px; }
.sheet header .grow { flex: 1; min-width: 0; }
.sheet .body { padding: 4px 20px 22px; display: flex; flex-direction: column; gap: 18px; }
.sect h4 { margin: 0 0 9px; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row .l { font-weight: 550; font-size: 14.5px; }
.row .l small { display: block; color: var(--muted); font-weight: 400; font-size: 12.5px; margin-top: 2px; }
.row .r { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row input[type=range] { width: min(220px, 42vw); }
.readings { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.reading { background: var(--card2); border-radius: 16px; padding: 12px 14px; }
.reading .lab { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.reading .lab svg.i { width: 15px; height: 15px; }
.reading .val { font-size: 19px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; }
.reading.alert { background: rgba(229, 72, 77, .14); }
.reading.alert .val, .reading.low .val { color: var(--bad); }
.note { font-size: 13px; color: var(--muted); background: var(--card2); border-radius: 14px; padding: 10px 14px; display: flex; gap: 8px; align-items: center; }
.note svg.i { width: 17px; height: 17px; }

.seg { display: flex; gap: 4px; background: var(--card2); padding: 4px; border-radius: 14px; flex-wrap: wrap; }
.seg button { flex: 1 1 auto; border: 0; background: transparent; padding: 9px 10px; border-radius: 11px; font-weight: 600; font-size: 13px; color: var(--muted); white-space: nowrap; }
.seg button.on { background: var(--card-solid); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
select.sel, input.inp {
  height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--card2); padding: 0 12px; min-width: 0; max-width: 100%;
  font-size: 14px; outline: none;
}
input.inp:focus, select.sel:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input.inp.wide { width: 100%; }

/* kleurenwiel */
.colorbox { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.wheel { position: relative; width: 200px; height: 200px; touch-action: none; flex: none; }
.wheel canvas { width: 200px; height: 200px; border-radius: 50%; display: block; box-shadow: 0 4px 20px rgba(0,0,0,.15); }
.wheel .knob { position: absolute; width: 26px; height: 26px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 6px rgba(0,0,0,.4); transform: translate(-50%, -50%); pointer-events: none; }
.swatches { display: grid; grid-template-columns: repeat(4, 34px); gap: 8px; }
.swatches button { width: 34px; height: 34px; border-radius: 11px; border: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); }

/* thermostaat */
.dial { position: relative; width: 230px; height: 230px; margin: 0 auto; }
.dial svg { width: 100%; height: 100%; }
.dial .center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.dial .sp { font-size: 50px; font-weight: 750; letter-spacing: -.04em; line-height: 1; }
.dial .sp small { font-size: 22px; font-weight: 600; vertical-align: 22px; margin-left: 2px; }
.dial .cur { color: var(--muted); font-size: 13.5px; margin-top: 6px; }
.dial .lbl { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; color: var(--muted); }
.stepper { display: flex; justify-content: center; gap: 22px; margin-top: 4px; }
.stepper button { width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--line); background: var(--card2); display: grid; place-items: center; }
.stepper button:active { transform: scale(.94); }

.events { display: flex; flex-direction: column; }
.ev { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ev:last-child { border-bottom: 0; }
.ev .ei { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--card2); color: var(--muted); flex: none; }
.ev .ei svg.i { width: 18px; height: 18px; }
.ev.bel .ei { background: rgba(88, 101, 242, .15); color: var(--accent); }
.ev.alarm .ei { background: rgba(229, 72, 77, .15); color: var(--bad); }
.ev .t { font-size: 14px; font-weight: 600; }
.ev .t small { display: block; color: var(--muted); font-weight: 400; font-size: 12.5px; }

/* instellingen */
.steps { margin: 6px 0 0; padding-left: 20px; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.steps b { color: var(--text); }
.field { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); }
.result { font-size: 13.5px; padding: 10px 12px; border-radius: 12px; margin-top: 10px; line-height: 1.45; }
.result.ok { background: rgba(22, 163, 74, .12); color: var(--ok); }
.result.bad { background: rgba(229, 72, 77, .12); color: var(--bad); }
.pairbox { display: flex; gap: 16px; align-items: center; padding: 16px; border-radius: 18px; background: var(--accent-soft); margin-top: 10px; }
.pairbox .count { font-size: 30px; font-weight: 800; color: var(--accent); min-width: 48px; text-align: center; }
.bridge { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--card2); margin-top: 8px; }
.bridge .grow { flex: 1; }
details.help { margin-top: 10px; background: var(--card2); border-radius: 14px; padding: 10px 14px; }
details.help summary { cursor: pointer; font-weight: 650; font-size: 13.5px; color: var(--accent); }
a { color: var(--accent); }
code { background: var(--card2); padding: 1px 6px; border-radius: 6px; font-size: 12.5px; }

/* toast */
.toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; width: calc(100vw - 32px); max-width: 440px; pointer-events: none; }
.toast { pointer-events: auto; background: #1b1e29; color: #fff; padding: 12px 16px; border-radius: 16px; box-shadow: var(--shadow-lg); font-size: 14px; display: flex; gap: 10px; align-items: center; animation: tin .25s ease; width: fit-content; max-width: 100%; }
.toast.bad { background: #c9353a; }
.toast.bel { background: var(--accent); }
.toast svg.i { width: 18px; height: 18px; }
@keyframes tin { from { transform: translateY(12px); opacity: 0; } }

/* login */
.login { min-height: 80vh; display: grid; place-items: center; }
.login .card { background: var(--card-solid); border-radius: 28px; padding: 30px; width: min(360px, 100%); box-shadow: var(--shadow-lg); text-align: center; border: 1px solid var(--line); }
.login input { width: 100%; text-align: center; font-size: 26px; letter-spacing: .4em; height: 56px; margin: 18px 0 12px; }
.login form input { margin: 0; }
.login input.acc { font-size: 16px; letter-spacing: normal; height: 46px; text-align: left; }
.login form > p:first-child { margin-top: 6px !important; }

.banner { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: 18px; background: var(--accent-soft); color: var(--text); margin-bottom: 14px; font-size: 14px; flex-wrap: wrap; }
.banner.bad { background: rgba(229, 72, 77, .12); }
.banner .grow { flex: 1; min-width: 200px; }

@media (max-width: 720px) {
  main { padding: 8px 12px 90px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tile { min-height: 124px; padding: 12px 12px 14px; border-radius: 20px; }
  .tile .name { font-size: 14px; }
  .roomctl input[type=range] { width: 100px; }
  .roomhead .roomctl { width: 100%; justify-content: space-between; }
  .roomhead .roomctl input[type=range] { flex: 1; width: auto; }
  .sheet { left: 0; right: 0; top: auto; bottom: 0; width: 100%; max-height: 92vh; transform: translateY(30px); border-radius: 28px 28px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .sheet.wide { width: 100%; }
  .sheet.show { transform: none; }
  .search { max-width: none; order: 3; flex-basis: 100%; }
  .hero { margin-top: 0; }
  .summary { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 11px 12px; gap: 9px; }
  .stat b { font-size: 1.15rem; }
  .stat .si { width: 30px; height: 30px; }
  .stat { flex: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- algemene hulpjes ---------- */
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); font-weight: 400; }
.iconbtn.small { width: 30px; height: 30px; box-shadow: none; }
.iconbtn.small svg.i { width: 15px; height: 15px; }
.empty.small { padding: 22px 10px; font-size: .92rem; line-height: 1.5; }
.pages { display: flex; gap: 6px; }
.myscenes { align-items: center; }
.myscenes .sclab { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-right: 4px; white-space: nowrap; }
.stat .kl { display: block; font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 2px; }
.stat .ks { display: block; font-size: .8rem; color: var(--muted); margin-top: 2px; }
.stat b small { font-size: .85rem; color: var(--muted); font-weight: 400; margin-left: 2px; }

/* ---------- rapporten ---------- */
.rhead { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 6px 0 10px; }
.rdates { display: flex; gap: 8px; align-items: center; color: var(--muted); }
.rdates .inp { height: 34px; }
.rhead .sel { height: 38px; border-radius: 999px; }
.rtitle { font-size: clamp(20px, 2.6vw, 26px); font-weight: 600; margin: 8px 0 12px; }
.rtabs { margin-bottom: 16px; }
.rbody.busy { opacity: .55; transition: opacity .2s; }
.rpanel { padding-bottom: 14px; }
.pricehead { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.pricehead h2 { margin: 0; font-size: .8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.legend { display: flex; gap: 6px 16px; font-size: .85rem; color: var(--muted); flex-wrap: wrap; margin-bottom: 6px; }
.legend span { display: inline-flex; align-items: center; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.chartwrap { position: relative; }
svg.chart { display: block; width: 100%; height: auto; overflow: visible; }
svg.chart text { font-family: inherit; }
.axis { fill: var(--muted); font-size: 11px; }
.gridl { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.hoverl { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }

.tt { position: absolute; top: 8px; pointer-events: none; background: var(--text); color: var(--panel); border-radius: 8px; padding: 6px 10px; font-size: .82rem; white-space: nowrap; display: none; z-index: 2; line-height: 1.5; box-shadow: 0 8px 20px rgba(0,0,0,.25); }
.tt i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.drawin { stroke-dasharray: 4000; stroke-dashoffset: 4000; animation: drawin 1.1s ease forwards; }
@keyframes drawin { to { stroke-dashoffset: 0; } }
.grow { transform-origin: bottom; }
rect.grow { animation: growup .6s ease both; transform-box: fill-box; }
@keyframes growup { from { transform: scaleY(0); } }
.note2 { color: var(--muted); font-size: .85rem; margin: 8px 0 0; line-height: 1.4; }
.prijs { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); }
.prijs .inp { width: 80px; height: 32px; }
.rank { display: grid; gap: 7px; }
.rk { display: grid; grid-template-columns: minmax(120px, 1.2fr) 2fr auto; align-items: center; gap: 10px; font-size: .9rem; }
.rk .rn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk .rn small { color: var(--muted); margin-left: 6px; font-size: .8rem; }
.rk .rb { height: 10px; background: var(--track); border-radius: 5px; overflow: hidden; }
.rk .rb i { display: block; height: 100%; border-radius: 5px; transition: width .8s; }
.rk b { font-weight: 600; text-align: right; white-space: nowrap; }
.tablewrap { overflow-x: auto; margin-top: 10px; }
.rtable { width: 100%; border-collapse: collapse; font-size: .88rem; }
.rtable th, .rtable td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.rtable th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.rtable .n { text-align: right; }
.rtable tbody tr:hover { background: color-mix(in srgb, var(--house) 6%, transparent); }
@media (max-width: 700px) { .rk { grid-template-columns: 1fr 1fr auto; } }

/* ---------- automatiseringen ---------- */
.rule { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--bg); margin-bottom: 10px; }
.rule.off { opacity: .6; }
.rule .rtop { display: flex; gap: 12px; align-items: flex-start; }
.rule .ri { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--battery) 15%, transparent); color: var(--battery); }
.rule .ri svg.i { width: 18px; height: 18px; }
.rule h3 { margin: 0 0 3px; font-size: 1.02rem; font-weight: 600; }
.rule .rs { font-size: .9rem; line-height: 1.45; }
.rule .rs b { color: var(--battery); font-weight: 600; }
.rule .rl { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.ractions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; padding-left: 46px; }
.regel .cond { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--card2); margin-bottom: 8px; font-size: .92rem; }
.regel .cond .iconbtn { margin-left: auto; }
.regel .cond .sel, .regel .cond .inp { height: 34px; }
.regel .cond .inp.num { width: 70px; }
.regel .cond .inp.wide { flex: 1; min-width: 160px; width: auto; }
.regel .cond .num:not(input) { width: 22px; height: 22px; border-radius: 50%; background: var(--battery); color: #fff; display: grid; place-items: center; font-size: .75rem; flex: none; }
.regel .sel.small { height: 30px; font-size: .85rem; text-transform: none; letter-spacing: 0; }
.regel select.sel.wide { width: 100%; }
.regel .mins { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: .85rem; }
.regel .hint { color: var(--muted); font-size: .85rem; margin: 6px 0 0; line-height: 1.45; }
.addrow { display: flex; gap: 6px; flex-wrap: wrap; }
.days { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.days button { border: 1px solid var(--line); background: var(--panel); color: var(--muted); border-radius: 999px; padding: 4px 10px; font-size: .82rem; }
.days button.on { background: var(--text); color: var(--panel); border-color: var(--text); }
.sheetfoot { display: flex; gap: 8px; align-items: center; position: sticky; bottom: 0; background: var(--panel); padding: 12px 0 2px; border-top: 1px solid var(--line); }

/* ---------- afdrukken ---------- */
@media print {
  .top, .pills, .rhead, .rtabs, #layer, .toasts, .herobtns, .ractions, .prijs { display: none !important; }
  body { background: #fff !important; color: #000; }
  main { padding: 0; max-width: none; }
  .room, .stat { box-shadow: none !important; break-inside: avoid; }
  .drawin, rect.grow { animation: none !important; stroke-dashoffset: 0 !important; }
}

/* ---------- weer, zon, volgorde, kerncijfers (1.4) ---------- */
.herol { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.wxchip { display: inline-flex; align-items: center; gap: 10px; padding: 4px 6px 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: linear-gradient(180deg, var(--panel), var(--panel2)); box-shadow: var(--shadow); color: var(--text); text-align: left; }
.wxchip:hover { border-color: var(--muted); }
.wxchip b { display: block; font-weight: 600; font-size: 1.05rem; line-height: 1.1; }
.wxchip small { color: var(--muted); font-size: .78rem; }
.wxe { font-family: "Segoe UI Emoji", "Apple Color Emoji", sans-serif; font-size: 1.6rem; line-height: 1; }
.stat .si.wxe { font-size: 1.15rem; background: color-mix(in srgb, var(--c) 12%, transparent); }
.suncomp { display: block; flex: none; overflow: visible; }
.suncomp .cdir { font-size: 7px; fill: var(--muted); font-family: inherit; }
.wonrow { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.locgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px 12px; }
.locgrid label { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; color: var(--muted); }
.order { display: grid; gap: 6px; }
.ordrow { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--card2); }
.ordrow .ri { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: var(--house); background: color-mix(in srgb, var(--house) 12%, transparent); flex: none; }
.ordrow .ri svg.i { width: 16px; height: 16px; }
.ordrow .iconbtn:disabled { opacity: .3; }
.namefld { width: 100%; height: 34px; font-weight: 600; }
.stat.edit { justify-content: center; color: var(--muted); border-style: dashed; background: transparent; box-shadow: none; gap: 8px; font-size: .9rem; }
.stat.edit::before { display: none; }
.stat.edit svg.i { width: 17px; height: 17px; }
code.lnk { word-break: break-all; font-size: .78rem; }

/* 1.7: authenticator-app instellen */
.totpbox { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; padding: 12px; margin: 4px 0 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel2); }
.totpbox .qr { width: 156px; height: 156px; background: #fff; border-radius: 10px; padding: 6px; flex: none; }
.totpbox .qr svg { width: 100%; height: 100%; display: block; }
.totpbox .grow { min-width: 220px; flex: 1; }

/* ---- via internet: eenvoudige, vriendelijke bedienversie (html.remote, zie app.js REMOTE) ---- */
.remote .pills, .remote #btnRefresh, .remote .hver { display: none; }
.remote .top { padding-bottom: 14px; }
.remote .hero h1 { font-size: clamp(26px, 6vw, 34px); }
.remote .hero p { font-size: 15px; }
.remote .tile { border-radius: 22px; }
.remote .summary .stat { min-height: 64px; }
.remote .toolbar .tabs .tab { padding: 9px 16px; font-size: 15px; }
.remote .live { display: none; }

/* ---- instellingen: tabbladen per onderdeel ---- */
.settabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 20px 12px; border-bottom: 1px solid var(--line); flex: none; }
.settabs .tab { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.tdot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.tdot.ok { background: #2ecc8f; }
.tdot.fout { background: #e5484d; }
.tdot.verbinden { background: #f5a524; }

/* ---------- 3D-plattegrond (2.7) ---------- */
.viewsw { flex: none; padding: 3px; }
.viewsw button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; }
.viewsw svg.i { width: 15px; height: 15px; }
.plan3d { background: linear-gradient(180deg, var(--panel), var(--panel2)); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 12px; margin-bottom: 18px; }
.planbar { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.planctl { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.planctl .btn.on { border-color: var(--accent); color: var(--accent); }
.planwrap { display: grid; grid-template-columns: 1fr; gap: 12px; }
.planwrap.withside { grid-template-columns: minmax(0, 1fr) 320px; }
.planstage { position: relative; border-radius: 14px; overflow: hidden; min-width: 0;
  background: radial-gradient(120% 90% at 50% 35%, #eef3f7 0%, #d5dee6 100%); }
.plansvg { display: block; width: 100%; height: min(72vh, 720px); min-height: 380px; touch-action: none; user-select: none; cursor: grab; }
.plansvg:active { cursor: grabbing; }
.plansvg.placing, .plansvg.placing * { cursor: crosshair !important; }
.plansvg.editing .pfloor { cursor: move; }
.plansvg .pin { cursor: pointer; outline: none; }
.plansvg.editing .pin { cursor: move; }
.plansvg .stem { stroke: rgba(30, 40, 50, .45); stroke-width: 1.5; stroke-dasharray: 2 2; }
.plansvg .bub { fill: #fbfcfd; stroke: rgba(20, 30, 40, .25); stroke-width: 1.2; filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); transition: fill .25s; }
.plansvg .pic { fill: none; stroke: #5b6a78; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.plansvg .pin.on .bub { fill: var(--g); stroke: #fff; stroke-width: 2; }
.plansvg .pin.on .pic { stroke: #1b1408; }
.plansvg .halo { fill: var(--g); opacity: .28; pointer-events: none; animation: plhalo 2.6s ease-in-out infinite; }
@keyframes plhalo { 50% { opacity: .14; } }
.plansvg .pin.off .bub { fill: #e3e6ea; stroke-dasharray: 3 2; }
.plansvg .pin.off .pic { stroke: #9aa5b0; }
.plansvg .pin.sel .bub { stroke: var(--accent); stroke-width: 3; }
.plansvg .pin:hover .bub, .plansvg .pin:focus .bub { stroke: var(--accent); stroke-width: 2.5; }
.plansvg .pname, .plansvg .psub, .plansvg .plab { text-anchor: middle; font-family: inherit; pointer-events: none;
  paint-order: stroke; stroke: rgba(255,255,255,.85); stroke-width: 3px; stroke-linejoin: round; }
.plansvg .pname { font-size: 11.5px; font-weight: 650; fill: #17212b; }
.plansvg .psub { font-size: 10.5px; fill: #44515e; }
.plansvg .plab { font-size: 13px; font-weight: 700; fill: rgba(20, 28, 36, .78); letter-spacing: .02em; }
.plansvg .pdim { font-size: 11px; font-weight: 500; }
.plansvg .handle { fill: #fff; stroke: var(--accent); stroke-width: 3; cursor: nwse-resize; }
.plansvg .pempty { text-anchor: middle; font-size: 18px; font-weight: 700; fill: #33414e; }
.plansvg .pempty2 { text-anchor: middle; font-size: 13px; fill: #5b6a78; }
.plancompass { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.8);
  display: grid; place-items: center; box-shadow: 0 2px 8px rgba(0,0,0,.18); font-weight: 800; font-size: 12px; color: #c0392b; pointer-events: none; }
.plancompass span { display: block; transition: transform .2s; }
.planhint { position: absolute; left: 10px; bottom: 10px; right: 10px; font-size: 12px; color: #3e4b57; pointer-events: none;
  background: rgba(255,255,255,.72); border-radius: 10px; padding: 6px 10px; width: fit-content; max-width: calc(100% - 20px); backdrop-filter: blur(4px); }
.planside { display: flex; flex-direction: column; gap: 10px; max-height: min(72vh, 720px); overflow: auto; padding-right: 2px; }
.pcard { background: var(--card2, var(--panel2)); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.pcard h4 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.pcard label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); }
.pcard label.pchk { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
.pcard .inp, .pcard .sel { width: 100%; }
.pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.prow { display: flex; gap: 6px; flex-wrap: wrap; }
.psmall { font-size: 12.5px; color: var(--muted); margin: 0; }
.plist { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow: auto; }
.pitem { display: flex; align-items: center; gap: 8px; text-align: left; border: 1px solid transparent; background: transparent; border-radius: 10px; padding: 6px 8px; color: var(--text); }
.pitem:hover { border-color: var(--line); background: var(--card-solid); }
.pitem.on { border-color: var(--accent); background: var(--accent-soft); }
.pitem span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.pitem small { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.pitem svg.i { width: 16px; height: 16px; color: var(--muted); flex: none; }
.pcard details summary { cursor: pointer; font-size: 12.5px; color: var(--muted); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .planstage { background: radial-gradient(120% 90% at 50% 35%, #1b2733 0%, #0b1218 100%); }
  :root:not([data-theme="light"]) .plansvg .pworld > :not(.plights) { filter: brightness(.62) saturate(.9); }
  :root:not([data-theme="light"]) .plansvg .pool { mix-blend-mode: screen; }
  :root:not([data-theme="light"]) .plansvg .plab { fill: rgba(235, 240, 245, .85); stroke: rgba(0,0,0,.6); }
  :root:not([data-theme="light"]) .plansvg .pname { fill: #eef3f7; stroke: rgba(0,0,0,.7); }
  :root:not([data-theme="light"]) .plansvg .psub { fill: #b8c4cf; stroke: rgba(0,0,0,.7); }
  :root:not([data-theme="light"]) .plansvg .stem { stroke: rgba(220, 230, 240, .4); }
  :root:not([data-theme="light"]) .plansvg .pempty { fill: #dfe7ee; }
  :root:not([data-theme="light"]) .plansvg .pempty2 { fill: #9aa9b6; }
  :root:not([data-theme="light"]) .planhint { background: rgba(10, 16, 22, .7); color: #c4d0da; }
}
:root[data-theme="dark"] .planstage { background: radial-gradient(120% 90% at 50% 35%, #1b2733 0%, #0b1218 100%); }
:root[data-theme="dark"] .plansvg .pworld > :not(.plights) { filter: brightness(.62) saturate(.9); }
:root[data-theme="dark"] .plansvg .pool { mix-blend-mode: screen; }
:root[data-theme="dark"] .plansvg .plab { fill: rgba(235, 240, 245, .85); stroke: rgba(0,0,0,.6); }
:root[data-theme="dark"] .plansvg .pname { fill: #eef3f7; stroke: rgba(0,0,0,.7); }
:root[data-theme="dark"] .plansvg .psub { fill: #b8c4cf; stroke: rgba(0,0,0,.7); }
:root[data-theme="dark"] .plansvg .stem { stroke: rgba(220, 230, 240, .4); }
:root[data-theme="dark"] .plansvg .pempty { fill: #dfe7ee; }
:root[data-theme="dark"] .plansvg .pempty2 { fill: #9aa9b6; }
:root[data-theme="dark"] .planhint { background: rgba(10, 16, 22, .7); color: #c4d0da; }
@media (max-width: 900px) {
  .planwrap.withside { grid-template-columns: 1fr; }
  .planside { max-height: none; }
  .plansvg { height: 62vh; min-height: 320px; }
  .plan3d { padding: 8px; }
  .viewsw button { padding: 6px 9px; }
}
/* zonnetje en stralenbundel in het zonnekompas (2.7) */
.suncomp .sunrays { animation: sunspin 24s linear infinite; }
@keyframes sunspin { to { transform: rotate(360deg); } }
.suncomp .sunbeam { animation: sunflow 1.6s linear infinite; }
@keyframes sunflow { to { stroke-dashoffset: -5.2; } }
@media (prefers-reduced-motion: reduce) { .suncomp .sunrays, .suncomp .sunbeam, .plansvg .halo { animation: none; } }
