/* mattlab Zuhause – Design „Nachtglas“
   Werte 1:1 aus design_handoff_mattlab_zuhause/README.md. Tablet 1280×800 ist die Referenz,
   unter 760 px gilt das Handy-Layout (412×915). */

@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 300 800; font-display: swap; src: url(../fonts/manrope-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 300 800; font-display: swap; src: url(../fonts/manrope-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Material Symbols Rounded'; font-style: normal; font-weight: 300; font-display: block; src: url(../fonts/material-symbols-rounded.woff2) format('woff2'); }

/* ---------- Tokens ---------- */
:root, [data-zh="dark"] {
  --bg: #0A0F14; --glow1: rgba(123,224,195,.10); --glow2: rgba(244,194,107,.08);
  --surface: rgba(255,255,255,.04); --surface-2: rgba(255,255,255,.07); --surface-3: rgba(255,255,255,.11);
  --border: rgba(255,255,255,.07); --border-2: rgba(255,255,255,.14);
  --text: #E8EEF2; --text-2: #8C9AA6; --text-3: #808E9A;
  --accent: #7BE0C3; --on-accent: #08110E; --pv: #F4C26B; --grid: #9DB4FF; --heat: #F5A47A; --danger: #FF8F7A;
  --toast: rgba(28,36,44,.95); --sheet: #111820; --knob: #E8EEF2; --shadow: 0 16px 48px rgba(0,0,0,.5);
  color-scheme: dark; --gap: 20px;
}
[data-zh="light"] {
  --bg: #EDF1F3; --glow1: rgba(8,127,98,.10); --glow2: rgba(214,150,40,.12);
  --surface: rgba(255,255,255,.74); --surface-2: rgba(14,24,32,.05); --surface-3: rgba(14,24,32,.09);
  --border: rgba(14,24,32,.08); --border-2: rgba(14,24,32,.16);
  --text: #0E1820; --text-2: #55636F; --text-3: #626F7A;
  --accent: #087F62; --on-accent: #FFFFFF; --pv: #94600C; --grid: #3D5FD0; --heat: #C25A28; --danger: #C9412E;
  --toast: rgba(255,255,255,.97); --sheet: #FFFFFF; --knob: #FFFFFF; --shadow: 0 16px 40px rgba(14,24,32,.14);
  color-scheme: light;
}

@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }
@keyframes spin { to { transform: rotate(360deg) } }
@keyframes flow { from { stroke-dashoffset: 22 } to { stroke-dashoffset: 0 } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px) } to { opacity: 1; transform: translate(-50%, 0) } }
@keyframes shimmer { from { background-position: 200% 0 } to { background-position: -200% 0 } }
@keyframes sheetIn { from { transform: translateY(40px); opacity: 0 } to { transform: none; opacity: 1 } }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(900px 560px at 8% -12%, var(--glow1), transparent 60%), radial-gradient(760px 560px at 106% 112%, var(--glow2), transparent 60%), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: 'Manrope', system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
#app { position: fixed; inset: 0; }
button { font-family: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
input::placeholder { color: var(--text-3); }
.hidden { display: none !important; }
.muted { color: var(--text-2); }

.ms {
  font-family: 'Material Symbols Rounded'; font-weight: 300; font-style: normal; line-height: 1; display: inline-block;
  white-space: nowrap; letter-spacing: normal; text-transform: none; direction: ltr; flex: none;
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24; -webkit-font-smoothing: antialiased;
}
.ms.fill { font-variation-settings: 'FILL' 1, 'wght' 300, 'GRAD' 0, 'opsz' 24; }

.spinner { width: 18px; height: 18px; flex: none; border-radius: 50%; border: 2px solid var(--surface-3); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.dot { width: 8px; height: 8px; flex: none; border-radius: 50%; display: inline-block; }
.sk { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.6s linear infinite; display: block; }

/* ---------- Grundbausteine ---------- */
.panel { padding: 20px 22px; border-radius: 24px; background: var(--surface); border: 1px solid var(--border); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); min-width: 0; min-height: 0; }
.sec-head { display: flex; align-items: baseline; gap: 10px; }
.sec-title { font-size: 18px; font-weight: 800; }
.sec-right { margin-left: auto; font-size: 14px; color: var(--text-2); }

.btn { height: 56px; padding: 0 22px; border-radius: 28px; border: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 800 15px 'Manrope', sans-serif; white-space: nowrap; transition: background .2s, opacity .3s; }
.btn.primary { background: var(--accent); color: var(--on-accent); padding: 0 28px; }
.btn.secondary { background: transparent; border: 1px solid var(--border-2); color: var(--text); }
.btn.secondary:hover { background: var(--surface-2); }
.btn.tonal { background: var(--surface-2); color: var(--text); font-weight: 700; }
.btn.tonal:hover { background: var(--surface-3); }
.btn.ghost { background: transparent; color: var(--text-2); font-weight: 700; padding: 0 20px; }
.btn.danger-outline { height: 48px; padding: 0 18px; border: 1px solid color-mix(in oklab, var(--danger) 45%, transparent); background: transparent; color: var(--danger); font-size: 14px; border-radius: 24px; }
.btn.danger { background: var(--danger); color: var(--on-accent); }
.btn.sm { height: 48px; padding: 0 18px; border-radius: 24px; font-size: 14px; }
.btn.block { width: 100%; }
.btn.busy { opacity: .6; }

.icon-btn { width: 56px; height: 56px; flex: none; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--text); display: grid; place-items: center; transition: background .2s; }
.icon-btn:hover { background: var(--surface-3); }

.switch { flex: none; width: 68px; height: 40px; border: 0; border-radius: 20px; background: var(--surface-3); position: relative; padding: 0; transition: background .3s; }
.switch .knob { position: absolute; left: 4px; top: 4px; width: 32px; height: 32px; border-radius: 50%; background: var(--text-2); transition: left .3s, background .3s; }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"] .knob { left: 32px; background: var(--on-accent); }
.switch.small { width: 60px; height: 36px; border-radius: 18px; }
.switch.small .knob { width: 28px; height: 28px; }
.switch.small[aria-checked="true"] .knob { left: 28px; }

.segment { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; border-radius: 20px; background: var(--surface-2); }
.segment button { height: 48px; border: 0; border-radius: 16px; background: transparent; color: var(--text-2); display: flex; align-items: center; justify-content: center; gap: 8px; font: 700 14px 'Manrope', sans-serif; min-width: 0; padding: 0 12px; white-space: nowrap; transition: background .2s, color .2s; }
.segment button:hover { color: var(--text); }
.segment button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); font-weight: 800; }
.segment.tall button { height: 52px; font-size: 15px; }
.segment.soft button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); }

.slider { position: relative; flex: 1; height: 56px; min-width: 0; touch-action: pan-y; }
.slider .sl-track, .slider .sl-fill { position: absolute; left: 0; top: 23px; height: 10px; border-radius: 5px; }
.slider .sl-track { right: 0; background: var(--surface-3); }
.slider .sl-fill { background: var(--accent); }
.slider .sl-knob { position: absolute; top: 13px; width: 30px; height: 30px; border-radius: 50%; background: var(--knob); box-shadow: 0 2px 10px rgba(0,0,0,.35); pointer-events: none; }
.slider input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.slider .sl-knob { cursor: grab; transition: transform .12s; }
.slider.drag .sl-knob { transform: scale(1.15); }
.slider:has(input:focus-visible) .sl-knob { outline: 3px solid var(--accent); outline-offset: 2px; }
.slider.big .sl-track, .slider.big .sl-fill { top: 20px; height: 16px; border-radius: 8px; }
.slider.big .sl-knob { top: 12px; width: 32px; height: 32px; }

/* aktive/inaktive Auswahlkarte (Lademodus, Betriebsmodus, Bereiche, Räume) */
.choice { position: relative; border-radius: 20px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: 700 15px 'Manrope', sans-serif; min-width: 0; transition: background .2s; }
.choice:hover { background: var(--surface-3); }
.choice[aria-pressed="true"] { border: 1.5px solid var(--accent); background: color-mix(in oklab, var(--accent) 13%, transparent); font-weight: 800; }
.choice .ic { color: var(--text-2); }
.choice[aria-pressed="true"] .ic { color: var(--accent); font-variation-settings: 'FILL' 1, 'wght' 300, 'GRAD' 0, 'opsz' 24; }
.choice .check { color: var(--accent); font-variation-settings: 'FILL' 1, 'wght' 300, 'GRAD' 0, 'opsz' 24; }
.choice[aria-pressed="false"] .check { color: var(--text-3); font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24; }
.choice-row { height: 64px; display: flex; align-items: center; gap: 10px; padding: 0 14px; text-align: left; }
.hide-off[aria-pressed="false"] .check { display: none; }
.choice-row .lbl { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Kachel in Panels */
.tile { padding: 14px 16px; border-radius: 20px; background: var(--surface-2); min-width: 0; }
.tile-label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.tile-value { font-size: 24px; font-weight: 800; margin-top: 4px; white-space: nowrap; }

/* Unbekannter Wert */
.unknown { display: flex !important; align-items: center; gap: 6px; color: var(--text-3) !important; }
.unknown .dash { letter-spacing: .08em; }
.unknown .unk { display: flex; align-items: center; gap: 3px; font-size: 13px; font-weight: 700; letter-spacing: 0; }

/* Status-Pill */
.pill { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 20px; font-size: 15px; font-weight: 700; white-space: nowrap; }
.pill.live { background: color-mix(in oklab, var(--accent) 12%, transparent); color: var(--accent); }
.pill.live .dot { background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: pulse 2.4s ease-in-out infinite; }
.pill.off { background: color-mix(in oklab, var(--danger) 13%, transparent); color: var(--danger); }
.pill.wait { background: var(--surface-2); color: var(--text-2); }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 18px; font-size: 14px; font-weight: 800; white-space: nowrap; }
.chip.ok { background: color-mix(in oklab, var(--accent) 12%, transparent); color: var(--accent); }
.chip.tonal { background: var(--surface-2); color: var(--text-2); }

/* Hinweis-/Fehlerbanner */
.alert { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 6px 6px 6px 14px; border-radius: 18px; background: color-mix(in oklab, var(--danger) 12%, transparent); border: 1px solid color-mix(in oklab, var(--danger) 30%, transparent); }
.alert .t { font-size: 16px; font-weight: 800; }
.alert .s { font-size: 13px; color: var(--text-2); }
.result { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 16px; border-radius: 16px; font-size: 15px; font-weight: 700; }
.result.run { background: var(--surface-2); }
.result.ok { background: color-mix(in oklab, var(--accent) 12%, transparent); }
.result.err { background: color-mix(in oklab, var(--danger) 12%, transparent); }

/* ---------- App-Rahmen ---------- */
.rail { position: absolute; left: calc(20px + env(safe-area-inset-left)); top: calc(20px + env(safe-area-inset-top)); bottom: calc(20px + env(safe-area-inset-bottom)); width: 76px; border-radius: 38px; background: var(--surface); border: 1px solid var(--border); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 0; z-index: 2; }
.logo { width: 52px; height: 52px; flex: none; border-radius: 50%; border: 1.5px solid color-mix(in oklab, var(--accent) 55%, transparent); color: var(--accent); display: grid; place-items: center; font-weight: 800; font-size: 15px; }
.rail .logo { margin-bottom: 12px; }
.rail a { width: 52px; height: 52px; flex: none; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); text-decoration: none; transition: background .2s, color .2s; }
.rail a:hover { background: var(--surface-2); color: var(--text); }
.rail a.active { background: var(--accent); color: var(--on-accent); }
.rail a.active .ms { font-variation-settings: 'FILL' 1, 'wght' 300, 'GRAD' 0, 'opsz' 24; }
.rail a.settings { margin-top: auto; }

.main { position: absolute; left: calc(116px + env(safe-area-inset-left)); right: calc(24px + env(safe-area-inset-right)); top: env(safe-area-inset-top); bottom: calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; }
.head { flex: none; height: 96px; display: flex; align-items: center; gap: 14px; }
.head-title { font-size: 30px; font-weight: 600; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.head-date { font-size: 16px; color: var(--text-2); margin-top: 2px; white-space: nowrap; }
.head-time { margin-left: auto; font-size: 34px; font-weight: 500; letter-spacing: -.02em; }
.banner { flex: none; margin: 0 0 16px; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 6px 6px 6px 18px; border-radius: 20px; background: color-mix(in oklab, var(--danger) 11%, var(--bg)); border: 1px solid color-mix(in oklab, var(--danger) 32%, transparent); }
.content { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 0 0 2px; scrollbar-width: none; transition: opacity .3s; }
.content::-webkit-scrollbar { display: none; }
.content.dim { opacity: .55; }
.fh { height: 100%; }

.tabbar, .more, .scrim { display: none; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; min-height: 56px; max-width: calc(100% - 32px); padding: 10px 22px 10px 18px; border-radius: 28px; background: var(--toast); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid var(--border-2); box-shadow: var(--shadow); font-size: 15px; font-weight: 700; z-index: 9; animation: toastIn .35s cubic-bezier(.2,.8,.2,1); }

/* Fenster (Dialog / Sheet) */
.sheet-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 7; animation: fadeIn .2s ease; }
.sheet { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100% - 32px)); max-height: calc(100% - 48px); overflow-y: auto;
  padding: 26px 26px 22px; border-radius: 28px; background: var(--sheet); border: 1px solid var(--border); box-shadow: var(--shadow); z-index: 8;
  display: flex; flex-direction: column; gap: 20px; animation: dialogIn .3s cubic-bezier(.2,.8,.2,1); }
.sheet-title { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.sheet-sub { font-size: 15px; color: var(--text-2); margin-top: 2px; }
.sheet-actions { display: flex; align-items: center; gap: 10px; justify-content: flex-end; margin-top: 4px; }
.sheet-sec { display: flex; flex-direction: column; gap: 10px; }
.sheet-sec .hd { display: flex; align-items: baseline; gap: 10px; }
.sheet-sec .hd .t { font-size: 16px; font-weight: 800; }
.sheet-sec .hd .v { margin-left: auto; font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.sheet-sec .hd .v small { font-size: 16px; color: var(--text-2); }
.sheet-note { font-size: 13px; color: var(--text-2); }
.sheet .slider { flex: none; }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes dialogIn { from { opacity: 0; transform: translate(-50%, calc(-50% + 16px)) } to { opacity: 1; transform: translate(-50%, -50%) } }

/* ---------- Einrichtung ---------- */
.setup { position: absolute; inset: 0; display: grid; grid-template-columns: 440px minmax(0, 1fr); overflow-y: auto; }
.setup-side { padding: 48px 56px; display: flex; flex-direction: column; }
.setup-brand { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 800; }
.setup-kicker { margin-top: auto; font-size: 15px; font-weight: 700; color: var(--accent); }
.setup-h { font-size: 38px; font-weight: 700; letter-spacing: -.03em; line-height: 1.12; margin-top: 6px; text-wrap: balance; }
.steps { display: flex; flex-direction: column; gap: 6px; margin: 36px 0 auto; }
.step { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.step-n { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 16px; background: var(--surface-2); color: var(--text-3); }
.step-n.done { background: var(--accent); color: var(--on-accent); }
.step-n.current { background: transparent; border: 2px solid var(--accent); color: var(--accent); }
.step .l { font-size: 17px; font-weight: 800; }
.step .s { font-size: 14px; color: var(--text-2); }
.setup-main { padding: 40px 56px 40px 0; display: flex; flex-direction: column; justify-content: center; min-height: 0; }
.setup-phonehead { display: none; }
.setup-card { width: 100%; max-width: 620px; padding: 36px 36px 30px; border-radius: 28px; background: var(--surface); border: 1px solid var(--border); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); display: flex; flex-direction: column; gap: 18px; }
.setup-card h2 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.setup-card .sub { font-size: 15px; color: var(--text-2); margin-top: 4px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > span { font-size: 14px; font-weight: 700; color: var(--text-2); }
.input { width: 100%; height: 60px; padding: 0 18px; border-radius: 18px; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text); font: 600 17px 'Manrope', sans-serif; outline: none; transition: border-color .2s, box-shadow .2s; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 25%, transparent); }
.pw { position: relative; display: block; }
.pw .input { padding-right: 64px; }
.pw button { position: absolute; right: 6px; top: 6px; width: 48px; height: 48px; border: 0; border-radius: 14px; background: transparent; color: var(--text-2); display: grid; place-items: center; }
.setup-actions { margin-top: auto; display: flex; align-items: center; gap: 10px; }
.setup-actions .primary { margin-left: auto; }
.setup-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

/* ---------- Ansichten (Tablet) ---------- */
.g-ov { display: grid; grid-template-columns: 600px minmax(0, 1fr); gap: 20px; height: 100%; }
.col { display: flex; flex-direction: column; gap: 20px; min-height: 0; min-width: 0; }
.ov-energy { order: 2; flex: 1; min-height: 0; padding: 20px 24px; display: flex; flex-direction: column; text-align: left; cursor: pointer; }
.ov-car { order: 3; flex: none; min-height: 150px; padding: 18px 24px; display: flex; align-items: center; gap: 20px; text-align: left; cursor: pointer; }
.ov-warn { order: 1; flex: none; padding: 16px 18px 8px; border-radius: 24px; background: color-mix(in oklab, var(--danger) 6%, var(--surface)); border: 1px solid color-mix(in oklab, var(--danger) 22%, transparent); }
.ov-tiles { order: 4; flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 20px; }
.ov-tile { padding: 18px 20px; display: flex; flex-direction: column; align-items: stretch; text-align: left; cursor: pointer; color: var(--text); }
.ov-tile .k { flex: 1; min-width: 0; font-size: 14px; font-weight: 700; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-tile .v { margin-top: auto; font-size: 36px; line-height: 1.1; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-tile .s { margin-top: 4px; font-size: 15px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.warn-row { display: flex; align-items: center; gap: 14px; min-height: 68px; border-top: 1px solid var(--border); }
.warn-ic { width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; }
.warn-row .t { font-size: 17px; font-weight: 800; }
.warn-row .s { font-size: 14px; color: var(--text-2); }
a.panel, button.panel { color: var(--text); text-decoration: none; font: inherit; }

/* Energiefluss */
.flow { position: relative; width: 100%; aspect-ratio: 600 / 380; }
.flow svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.flow .base { fill: none; stroke: var(--surface-3); stroke-width: 8; stroke-linecap: round; }
.flow .run { fill: none; stroke-linecap: round; stroke-dasharray: 1 10; transition: opacity .4s; animation: flow 1s linear infinite; }
.fn { position: absolute; transform: translate(-50%, -50%); border-radius: 50%; display: grid; place-items: center; transition: all .4s; }
.fl { position: absolute; transform: translateX(-50%); text-align: center; white-space: nowrap; }
.fl .v { font-weight: 700; letter-spacing: -.02em; }
.fl .l { font-size: 13px; color: var(--text-2); }

.g-pv { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 16px; }
/* Hauptkachel: kräftiges Glas, größerer Radius */
.pv-hero { position: relative; min-height: 0; border-radius: 28px; overflow: hidden; background: linear-gradient(180deg, color-mix(in oklab, var(--surface-2) 90%, transparent), var(--surface)); border: 1px solid var(--border-2); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); display: flex; flex-direction: column; }
.pv-top { position: relative; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 30px 0; }
.pv-now { font-size: 136px; font-weight: 300; letter-spacing: -.045em; line-height: .9; white-space: nowrap; }
.pv-now small { font-size: 52px; font-weight: 400; letter-spacing: -.01em; margin-left: 10px; }
.pv-now-l { font-size: 26px; font-weight: 600; color: var(--text-2); margin-top: 12px; }
.pv-today { text-align: right; }
.pv-today .k { font-size: 24px; font-weight: 600; color: var(--text-2); }
.pv-today .v { font-size: 64px; font-weight: 500; letter-spacing: -.03em; line-height: 1.05; white-space: nowrap; }
.pv-today .v small { font-size: 26px; font-weight: 500; color: var(--text-2); margin-left: 6px; }
.pv-cmp { font-size: 22px; color: var(--text-2); margin-top: 8px; }
.pv-cmp b { color: var(--pv); font-weight: 700; }
.pv-plot { position: relative; flex: 1; min-height: 80px; margin-top: -40px; }
.pv-curve { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.pv-sun { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: #FFE2A8; box-shadow: 0 0 0 8px color-mix(in oklab, var(--pv) 30%, transparent), 0 0 28px var(--pv); animation: pv-sun 3.2s ease-in-out infinite; }
@keyframes pv-sun { 50% { box-shadow: 0 0 0 14px color-mix(in oklab, var(--pv) 12%, transparent), 0 0 28px var(--pv); } }
.pv-axis { position: relative; flex: none; height: 44px; background: color-mix(in oklab, var(--pv) 5%, transparent); font-size: 17px; font-weight: 600; color: var(--text-3); }
.pv-axis span { position: absolute; top: 11px; transform: translateX(-50%); white-space: nowrap; }
/* Aufteilung: flacher als die Hauptkachel */
/* Aufteilung: schmaler Balken über vier gleich gebauten Kacheln */
.pv-low { display: grid; gap: 12px; min-width: 0; }
.pv-splitrow { display: flex; align-items: center; gap: 20px; padding: 0 6px; min-width: 0; }
.pv-splitrow h3 { margin: 0; font-size: 18px; font-weight: 700; color: var(--text-2); white-space: nowrap; }
.pv-split { flex: 1; display: flex; gap: 4px; height: 14px; border-radius: 7px; overflow: hidden; }
.pv-split i { display: block; flex-basis: 0; min-width: 8px; transition: flex-grow .8s; }
.pv-split.empty { background: var(--surface-3); }
.pv-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; min-width: 0; }
.pv-tile { --c: var(--text-3); border-radius: 22px; background: var(--surface); padding: 16px 20px 16px; display: flex; flex-direction: column; min-width: 0; min-height: 262px; transition: background .6s; border-top: 4px solid color-mix(in oklab, var(--c) 70%, transparent); }
.pv-tile:not([data-dir="idle"], [data-dir="unknown"]) { background: radial-gradient(120% 120% at 100% 0%, color-mix(in oklab, var(--c) 18%, transparent), transparent 60%), var(--surface); }
.tl-haus { --c: var(--text); }
.tl-akku { --c: var(--accent); }
.tl-auto { --c: var(--heat); }
.tl-netz[data-dir="feed"] { --c: var(--grid); }
.tl-netz[data-dir="draw"] { --c: var(--danger); background: radial-gradient(120% 120% at 0% 0%, color-mix(in oklab, var(--c) 18%, transparent), transparent 60%), var(--surface); }
.pv-tile h3 { margin: 0; font-size: 26px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.tl-state { margin-left: auto; font-size: 17px; font-weight: 800; padding: 5px 11px; border-radius: 12px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.pv-tile:not([data-dir="idle"], [data-dir="unknown"]) .tl-state { background: color-mix(in oklab, var(--c) 18%, transparent); color: var(--c); }
.tl-big { display: flex; align-items: center; gap: 4px; margin: auto 0; font-size: 74px; font-weight: 400; letter-spacing: -.035em; line-height: 1.05; white-space: nowrap; }
.tl-big small { font-size: 28px; color: var(--text-2); margin-left: 4px; letter-spacing: 0; }
.tl-big .ms { color: var(--c); margin-right: 6px; }
.pv-tile.wide .tl-big { font-size: 62px; }
.pv-tile:is([data-dir="idle"], [data-dir="unknown"]):not(.tl-akku) .tl-big, .tl-akku[data-dir="unknown"] .tl-big { color: var(--text-3); }
.tl-gauge { position: relative; height: 30px; border-radius: 15px; background: var(--surface-3); margin: 12px 0 8px; }
.tl-fill { position: absolute; top: 0; bottom: 0; border-radius: 15px; background: var(--c); transition: left .8s, width .8s; }
.tl-mark { position: absolute; top: -5px; bottom: -5px; width: 4px; margin-left: -2px; border-radius: 2px; background: var(--text); }
.tl-gauge.mid::after { content: ''; position: absolute; left: 50%; top: -6px; bottom: -6px; width: 3px; margin-left: -1.5px; background: var(--text-2); border-radius: 1px; }
.tl-gl { display: flex; justify-content: space-between; gap: 8px; font-size: 16px; font-weight: 600; color: var(--text-2); min-height: 1.2em; white-space: nowrap; }
.tl-gl b { color: var(--text); }
.tl-gl .d { color: var(--danger); }
.tl-gl .f { color: var(--grid); }
.pv-tile.tap { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.pv-tile.tap:active { transform: scale(.985); }
.pv-tile.tap:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.tl-more { color: var(--text-3); margin-right: -6px; }
/* Popups der Energie-Kacheln */
.sheet.sheet-wide { width: min(760px, calc(100% - 32px)); gap: 14px; padding-top: 22px; padding-bottom: 18px; }
.pd-top { display: flex; align-items: center; gap: 24px; }
.pd-big { font-size: 72px; font-weight: 300; letter-spacing: -.045em; line-height: .95; white-space: nowrap; }
.pd-big small { font-size: 38px; font-weight: 400; color: var(--text-2); margin-left: 6px; letter-spacing: 0; }
.pd-side { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.pd-chip { --c: var(--text-2); font-size: 17px; font-weight: 800; padding: 7px 14px; border-radius: 14px; background: color-mix(in oklab, var(--c) 16%, transparent); color: var(--c); }
.pd-note b { color: var(--text); }
.pd-note { font-size: 17px; color: var(--text-2); }
.pd-h { display: flex; align-items: center; gap: 16px; font-size: 16px; font-weight: 800; color: var(--text-2); margin-bottom: -4px; }
.pd-lg { margin-left: auto; display: flex; gap: 16px; font-size: 14px; font-weight: 600; }
.pd-lg span { display: flex; align-items: center; gap: 6px; }
.pd-lg i { width: 16px; height: 4px; border-radius: 2px; }
.pd-lg i.dash { height: 0; border-top: 2px dotted var(--text-3); }
.pd-lg b { color: var(--text); }
.pd-src { display: flex; flex-direction: column; gap: 10px; }
.pd-sbar { display: flex; gap: 4px; height: 16px; border-radius: 8px; overflow: hidden; background: var(--surface-3); }
.pd-sbar i { display: block; flex-basis: 0; min-width: 6px; }
.pd-slg { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 15px; color: var(--text-2); }
.pd-slg span { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.pd-slg i { width: 12px; height: 12px; border-radius: 4px; margin-right: 4px; }
.pd-slg b { color: var(--text); }
.pd-foot { font-size: 13px; color: var(--text-3); }
.pd-empty { height: 120px; display: grid; place-items: center; border-radius: 16px; background: var(--surface-2); color: var(--text-2); font-size: 17px; }
.dc-plot { position: relative; height: 150px; margin-right: 52px; }
.dc-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.dc-dot { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--dc); box-shadow: 0 0 0 6px color-mix(in oklab, var(--dc) 25%, transparent); }
.dc-y span { position: absolute; left: calc(100% + 10px); transform: translateY(-50%); font-size: 14px; font-weight: 600; color: var(--text-3); white-space: nowrap; }
.dc-x { position: relative; height: 26px; margin: 8px 52px 0 0; font-size: 14px; font-weight: 600; color: var(--text-3); }
.dc-x span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.dc-x span:first-child { transform: none; }
.dc-x span:last-child { transform: translateX(-100%); }
.pd-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ps { background: var(--surface-2); border-radius: 16px; padding: 12px 14px; min-width: 0; }
.ps .k { font-size: 14px; font-weight: 700; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps .v { font-size: 28px; font-weight: 500; letter-spacing: -.02em; white-space: nowrap; }
.ps .s { font-size: 14px; color: var(--text-2); min-height: 1.3em; }
.bar { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.bar > div { height: 100%; border-radius: 4px; background: var(--accent); transition: width .6s; }

.g-auto { display: grid; grid-template-columns: 520px minmax(0, 1fr); gap: 20px; }
.loc-panel { display: flex; align-items: center; gap: 14px; padding: 16px 20px; text-align: left; cursor: pointer; min-height: 76px; }
.loc-t { font-size: 18px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loc-s { font-size: 14px; color: var(--text-2); }
.sheet.sheet-map { width: min(1000px, calc(100% - 32px)); }
.sheet-map .map { flex: none; height: min(60vh, 520px); }
.grow-center { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.map { position: relative; flex: 1; min-height: 0; border-radius: 18px; overflow: hidden; background: var(--surface-2); cursor: default; }
.map-tiles { position: absolute; inset: 0; }
.map-tiles img { position: absolute; width: 256px; height: 256px; user-select: none; pointer-events: none; }
[data-zh="dark"] .map-tiles { filter: invert(1) hue-rotate(180deg) brightness(.82) contrast(.92) saturate(.55); }
.map-marker { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; box-shadow: 0 0 0 6px color-mix(in oklab, var(--accent) 25%, transparent), var(--shadow); }
.map-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--text-3); font-weight: 700; }
.map-zooms { position: absolute; right: 10px; top: 10px; display: flex; gap: 8px; }
.map-zoom { width: 48px; height: 48px; border: 1px solid var(--border-2); border-radius: 50%; background: var(--toast); color: var(--text); display: grid; place-items: center; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.map-zoom:disabled { opacity: .4; }
.map-attr { position: absolute; right: 8px; bottom: 6px; padding: 2px 8px; border-radius: 8px; background: var(--toast); color: var(--text-2); font-size: 13px; font-weight: 600; text-decoration: none; }
.car-main { display: flex; flex-direction: column; align-items: center; }
.car-ring { position: relative; width: 290px; height: 290px; margin-top: 2px; transition: opacity .4s; }
.car-ring .big { font-size: 90px; }
.car-ring .in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.big { font-size: 104px; font-weight: 300; letter-spacing: -.05em; line-height: 1; }
.facts { margin-top: auto; padding-top: 12px; align-self: stretch; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr); gap: 10px; }
.fact { height: 64px; border: 0; border-radius: 20px; background: var(--surface-2); color: var(--text); display: flex; align-items: center; gap: 8px; padding: 0 12px; font: 700 14px 'Manrope', sans-serif; min-width: 0; white-space: nowrap; overflow: hidden; }
button.fact:hover { background: var(--surface-3); }
.fact.wake { justify-content: center; gap: 6px; border: 1px solid var(--border-2); background: transparent; font-weight: 800; }
.fact.wake.primary { border: 0; background: var(--accent); color: var(--on-accent); }
.modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.mode { height: 124px; padding: 14px; display: flex; flex-direction: column; align-items: flex-start; text-align: left; }
.mode .lbl { margin-top: auto; font-size: 17px; }
.mode .d { font-size: 13px; color: var(--text-2); margin-top: 2px; font-weight: 500; }
.mode .check { position: absolute; right: 12px; top: 12px; }
.mode[aria-pressed="false"] .check { display: none; }
.mode.locked { opacity: .4; }
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper .val { font-size: 42px; font-weight: 700; letter-spacing: -.03em; min-width: 140px; text-align: center; }
.stepper .val small { font-size: 20px; color: var(--text-2); font-weight: 700; }

.g-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; height: 100%; }
.g-two.auto-h { height: auto; align-items: start; }
.g-robots { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; gap: 20px; height: 100%; }
.wp-hero { font-size: 120px; font-weight: 300; letter-spacing: -.05em; line-height: 1.05; }
.robot-ic { position: relative; width: 52px; height: 52px; flex: none; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; }
.robot-ic .sweep { position: absolute; inset: -3px; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--accent); animation: spin 1.2s linear infinite; }
.actions4 { margin-top: auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.act { height: 68px; border: 0; border-radius: 20px; background: var(--surface-2); color: var(--text); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font: 700 13px 'Manrope', sans-serif; white-space: nowrap; transition: background .2s; }
.act:hover { background: var(--surface-3); }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.grid4.tight { gap: 10px; }

.bin { padding: 20px 22px; display: flex; flex-direction: column; gap: 6px; }
.bin-ic { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; color: #0A0F14; }
.bin .cd { margin-top: 14px; min-height: 64px; display: flex; align-items: baseline; gap: 6px; }
.bin .n { font-size: 64px; font-weight: 300; letter-spacing: -.04em; line-height: 1; }

.scene { position: relative; height: 116px; border-radius: 24px; border: 1px solid var(--border); padding: 16px 18px; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; text-align: left; min-width: 0; color: var(--text); transition: border-color .2s; }
.scene:hover { border-color: var(--border-2); }
.scene[aria-pressed="true"] { border: 1.5px solid var(--accent); }
.scene .n { font-size: 19px; font-weight: 700; max-width: 100%; }
.scene[aria-pressed="true"] .n { font-weight: 800; }
.scene .s { font-size: 13px; color: var(--text-2); }
.scene .check { position: absolute; right: 14px; top: 14px; color: var(--accent); }
.scene[aria-pressed="false"] .check { display: none; }
.swatch-btn { border: 0; background: transparent; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text-2); font: 600 11px 'Manrope', sans-serif; min-width: 0; }
.swatch { width: 48px; height: 48px; border-radius: 50%; }
.swatch-btn[aria-pressed="true"] .swatch { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--text), 0 0 18px var(--sw); }

.set-row { display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 0 8px; border-top: 1px solid var(--border); }
.set-card { padding: 18px 20px; display: flex; align-items: center; gap: 14px; }

.flow-panel { display: flex; flex-direction: column; }
.climate { display: flex; flex-direction: column; justify-content: space-between; gap: 14px; }

.wp-main { padding: 22px 24px; display: flex; flex-direction: column; gap: 18px; }
.wp-dhw { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.robot { display: flex; flex-direction: column; gap: 14px; }
.rooms { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 14px; }

.stack > :empty { display: none; }

.content { container-type: size; }
.ctl-panel { padding: 18px 14px 10px; display: flex; flex-direction: column; }
.set-row.wrap { flex-wrap: wrap; row-gap: 8px; padding-top: 8px; padding-bottom: 8px; }
.row-l { font-size: 16px; font-weight: 700; }
.row-s { font-size: 13px; color: var(--text-2); }
.ctl-sub { font-size: 13px; font-weight: 800; color: var(--text-2); padding: 14px 8px 6px; border-top: 1px solid var(--border); }
.segment.compact button { height: 40px; font-size: 13px; padding: 0 10px; border-radius: 14px; }
.segment.compact { border-radius: 18px; }
.stepper.sm { gap: 8px; }
.icon-btn.sm { width: 44px; height: 44px; }
.step-v { font-size: 18px; font-weight: 800; min-width: 82px; text-align: center; white-space: nowrap; }
.act-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; padding: 4px 0 12px; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; padding: 4px 0 12px; }
.info-grid .tile-value { font-size: 20px; }
.info-grid .tile-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.info-grid .tile { padding: 12px 14px; }

.more-btn { width: 40px; height: 40px; flex: none; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--text-2); display: grid; place-items: center; transition: background .2s, color .2s; }
.more-btn:hover { background: var(--surface-3); color: var(--text); }
.klima-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.klima-chip { height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border-radius: 18px; white-space: nowrap; overflow: hidden; }
.sheet-list { display: flex; flex-direction: column; }
.sheet-list .set-row:first-child { border-top: 0; }

.car-main { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.car-chips { align-self: stretch; display: flex; flex-wrap: wrap; gap: 8px; }
.car-info { align-self: stretch; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: auto; padding-top: 14px; }
.ci { padding: 10px 12px; border-radius: 16px; background: var(--surface-2); min-width: 0; }
.ci-l { display: flex; align-items: center; gap: 5px; font-size: 14px; color: var(--text-2); white-space: nowrap; }
.car-charge { margin-top: 12px; padding-top: 0; }
.car-charge .ci { background: color-mix(in oklab, var(--accent) 12%, transparent); }
.car-charge .ci-l { color: var(--accent); }
.car-charge .ci-v { font-size: 24px; }
.ci-s { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-v { font-size: 17px; font-weight: 800; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.car-acts { align-self: stretch; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.car-act { height: 64px; font-size: 14px; }
.car-act span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.act.on { background: color-mix(in oklab, var(--accent) 16%, var(--surface-2)); color: var(--accent); }
.act.warn { background: color-mix(in oklab, var(--danger) 14%, var(--surface-2)); color: var(--danger); }
.act.primary { background: var(--accent); color: var(--on-accent); }
.charge { display: flex; flex-direction: column; }
.charge .modes { margin-top: 12px; gap: 8px; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.charge .mode { height: 104px; padding: 12px; }
.charge .mode .lbl { font-size: 15px; letter-spacing: -.01em; white-space: nowrap; }
.charge .mode .d { white-space: nowrap; }
.limit-row { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.limit-l { display: flex; flex-direction: column; min-width: 92px; line-height: 1.1; }
.klima-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.klima-row .klima-chips { flex: 1; min-width: 250px; }
.klima-row .stepper { gap: 8px; }
.klima-row .stepper .val { min-width: 112px; font-size: 38px; }
.klima-row .klima-chip { padding: 0 12px; gap: 8px; font-size: 14px; }
.climate { flex: none; }

/* Skeleton-Übersicht */
.skel-energy { order: 2; flex: 1; min-height: 320px; display: flex; flex-direction: column; gap: 14px; }

/* ---------- Handy ---------- */
@media (max-width: 760px), (orientation: portrait), (max-height: 500px) {
  :root { --gap: 14px; }
  .sheet { left: 12px; right: 12px; top: auto; bottom: calc(12px + env(safe-area-inset-bottom)); width: auto; transform: none; padding: 22px 18px 18px; animation: sheetIn .3s cubic-bezier(.2,.8,.2,1); }
  .sheet-actions .btn { flex: 1; }
  .rail { display: none; }
  .main { left: env(safe-area-inset-left); right: env(safe-area-inset-right); bottom: 0; }
  .head { height: 76px; padding: 0 18px; }
  .head-title { font-size: 24px; }
  .head-date { font-size: 14px; }
  .head-time { font-size: 22px; }
  .banner { margin: 0 16px 12px; }
  .content { padding: 2px 16px calc(104px + env(safe-area-inset-bottom)); }
  .fh { height: auto; }
  .toast { bottom: calc(100px + env(safe-area-inset-bottom)); }

  .tabbar { display: grid; position: fixed; left: calc(12px + env(safe-area-inset-left)); right: calc(12px + env(safe-area-inset-right)); bottom: calc(12px + env(safe-area-inset-bottom)); height: 72px; border-radius: 36px; background: color-mix(in oklab, var(--sheet) 90%, transparent); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border: 1px solid var(--border); box-shadow: var(--shadow); grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 0 6px; z-index: 3; }
  .tabbar a, .tabbar button { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--text-2); text-decoration: none; min-width: 0; font-family: inherit; }
  .tabbar .pillw { width: 52px; height: 32px; border-radius: 16px; display: grid; place-items: center; transition: background .2s; }
  .tabbar .lbl { font-size: 13px; font-weight: 700; white-space: nowrap; }
  .tabbar .on { color: var(--text); }
  .tabbar .on .pillw { background: color-mix(in oklab, var(--accent) 22%, transparent); }
  .tabbar .on .ms { font-variation-settings: 'FILL' 1, 'wght' 300, 'GRAD' 0, 'opsz' 24; }
  .scrim.open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 6; }
  .more.open { display: block; position: fixed; left: 12px; right: 12px; bottom: 96px; padding: 10px; border-radius: 28px; background: var(--sheet); border: 1px solid var(--border); box-shadow: var(--shadow); z-index: 7; animation: sheetIn .3s cubic-bezier(.2,.8,.2,1); }
  .more a { height: 60px; border-radius: 18px; color: var(--text); display: flex; align-items: center; gap: 14px; padding: 0 14px; font: 700 17px 'Manrope', sans-serif; text-decoration: none; }
  .more a.sel { background: var(--surface-2); }

  .setup { grid-template-columns: minmax(0, 1fr); }
  .setup-side { display: none; }
  .setup-main { padding: 20px 16px 16px; justify-content: flex-start; }
  .setup-phonehead { display: flex; flex-direction: column; gap: 14px; padding: 8px 4px 20px; }
  .setup-card { flex: 1 1 auto; padding: 24px 20px 20px; }
  .setup-grid { grid-template-columns: minmax(0, 1fr); }

  .g-ov, .g-pv, .g-auto, .g-two, .g-robots { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; gap: 14px; height: auto; }
  .sheet-map .map { height: 55vh; }
  .col { display: contents; }
  .pv-top { flex-direction: column; gap: 14px; padding: 18px 20px 0; }
  .pv-now { font-size: 88px; }
  .pv-now small { font-size: 34px; }
  .pv-now-l { font-size: 19px; margin-top: 8px; }
  .pv-today { text-align: left; }
  .pv-today .k { font-size: 16px; }
  .pv-today .v { font-size: 44px; }
  .pv-cmp { font-size: 17px; margin-top: 4px; }
  .pv-plot { flex: none; height: 180px; margin-top: 8px; }
  .pv-axis { height: 36px; font-size: 14px; }
  .pv-axis span { top: 9px; }
  .pv-splitrow h3 { font-size: 15px; }
  .pv-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pv-tile { padding: 14px 14px; }
  .pv-tile h3 { font-size: 20px; }
  .tl-state { font-size: 13px; padding: 4px 8px; }
  .tl-more { display: none; } /* am Handy zu schmal; Antippen geht trotzdem */
  .pv-tile { min-height: 0; }
  .tl-big { font-size: 44px; margin: 4px 0 0; }
  .tl-big .ms { font-size: 38px !important; margin-right: 2px; }
  .pv-tile.wide .tl-big { font-size: 36px; }
  .tl-big small { font-size: 18px; }
  .tl-gl { font-size: 13px; }
  .tl-gauge { height: 22px; margin: 10px 0 6px; }
  .pd-big { font-size: 64px; }
  .pd-big small { font-size: 26px; }
  .dc-plot { height: 160px; margin-right: 44px; }
  .dc-x { margin-right: 44px; }
  .pd-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ps .v { font-size: 24px; }
  .ov-tiles { grid-auto-rows: minmax(150px, auto); gap: 14px; }
  .ov-model { display: none; }
  .ov-tile .v { font-size: 26px; }
  .ov-tile .s { font-size: 13px; }
  .ov-tile .chev { display: none; }
  .ov-tile .k { font-size: 13px; }
  .car-ring { width: 230px; height: 230px; margin-top: 4px; }
  .car-acts { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .car-act { grid-column: span 2; }
  .car-act:nth-child(n+4) { grid-column: span 3; }
  .limit-row { flex-wrap: wrap; }
  .limit-row .slider { order: 3; flex-basis: 100%; }
  .limit-l { flex: 1; }
  .charge .modes { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .charge .mode { grid-column: span 2; }
  .charge .mode:nth-child(n+4) { grid-column: span 3; }
  .charge .mode { height: 104px; }
  .charge .mode .lbl { font-size: 15px; }
  .charge .sec-head { flex-wrap: wrap; }
  .charge .sec-right { margin-left: 0; width: 100%; flex-wrap: wrap; white-space: nowrap; }
  .charge .sec-right > :first-child { flex-basis: 100%; }
  .charge .sec-right .more-btn { margin-left: auto; }
  .car-ring .big { font-size: 84px; }
  .loc-panel { order: 5; }
  .act-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .big { font-size: 84px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fact.wake { grid-column: 1 / -1; }
  .mode { height: 132px; }
  .mode .lbl { font-size: 15px; }
  .wp-hero { font-size: 88px; }
  .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .grid4.tight { gap: 10px; }
  .bin .n { font-size: 48px; }
  .bin .cd { min-height: 48px; }
  .ov-energy { --flow-max: 420px; }
  .scene .n { font-size: 16px; }
  .stepper .val { min-width: 120px; }
}

/* ---------- Bedienung: Rückmeldung beim Antippen, Tastaturfokus ---------- */
button:not(:disabled):active, .rail a:active, .tabbar a:active { transform: scale(.92); filter: brightness(1.3); }
.panel:is(button):not(:disabled):active { transform: scale(.97); filter: brightness(1.15); }
.switch:active .knob { width: 38px; }
.switch[aria-checked="true"]:active .knob { left: 26px; }
.switch.small:active .knob { width: 34px; }
.switch.small[aria-checked="true"]:active .knob { left: 22px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
:focus:not(:focus-visible) { outline: none; }

/* ---------- Weniger Bewegung (Android: „Animationen entfernen“) ---------- */
@media (prefers-reduced-motion: reduce) {
  .flow .run, .pill.live .dot, .sk, .robot-ic .sweep, .pv-sun { animation: none; }
  .toast, .sheet, .sheet-scrim { animation: none; }
  * { transition-duration: .01ms !important; }
}

/* ---------- Nachtmodus: dimmt nachts, Antippen hellt kurz auf ---------- */
.night-veil { position: fixed; inset: 0; z-index: 20; pointer-events: none; background: rgb(4 6 8 / var(--night-dim, .62)); opacity: 0; transition: opacity 1.2s ease; }
html.night .night-veil { opacity: 1; }
html.night.night-wake .night-veil { opacity: 0; transition-duration: .3s; }

/* Einstellungen: drei Spalten, Tag und Nacht */
.g-set { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.g-set .set-card { padding: 14px 18px; }
.tn { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.tn-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tn-row .segment { width: 220px; flex: none; }
.tn-row.col1 { flex-direction: column; align-items: stretch; gap: 6px; }
.tn-lab { display: flex; justify-content: space-between; align-items: baseline; }
.tn-val { font-size: 16px; font-weight: 800; color: var(--text-2); }
.tn-sub { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 800; padding-top: 14px; border-top: 1px solid var(--border); }
.tn-times { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tn-time { background: var(--surface-2); border-radius: 18px; padding: 10px 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.tn-time .step-v { font-size: 24px; min-width: 76px; }
.tn-note { display: flex; gap: 12px; align-items: center; background: var(--surface-2); border-radius: 18px; padding: 14px 16px; }
.tn-night { display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 760px), (orientation: portrait), (max-height: 500px) {
  .g-set { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .tn-row .segment { width: 190px; }
}
.tn .slider, .set-row .slider { flex: none; }
.tn-times { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.tn-time .stepper { gap: 4px; }
.tn-time .step-v { min-width: 0; flex: 1; }
.segment button:disabled { opacity: .4; cursor: not-allowed; }

/* Energie: Unterseiten Bilanz und Technik */
.head-extra { margin-left: auto; }
.head-extra:empty { display: none; }
.head-extra + .head-time { margin-left: 18px; }
.pv-tabs { width: 360px; }
.pv-views > [hidden] { display: none !important; }
.g-pb { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 16px; }
.pb-chart { padding: 20px 26px 12px; }
.pb-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.pb-big { font-size: 64px; font-weight: 500; letter-spacing: -.03em; line-height: 1; white-space: nowrap; }
.pb-big small { font-size: 26px; color: var(--pv); margin-left: 6px; letter-spacing: 0; }
.pb-sub { font-size: 18px; font-weight: 600; color: var(--text-2); margin-top: 8px; }
.pb-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; flex: none; }
.pb-side .segment { width: 260px; }
.pb-best { font-size: 16px; color: var(--text-2); text-align: right; line-height: 1.45; }
.pb-best b { color: var(--text); font-weight: 700; }
.pb-plot { position: relative; flex: 1; min-height: 80px; margin-top: 16px; }
.pb-bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 6px; }
.pb-bar { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.pb-bar i { display: block; width: 100%; min-height: 2px; border-radius: 10px 10px 4px 4px; background: color-mix(in oklab, var(--pv) 45%, transparent); }
.pb-bars.many .pb-bar i { border-radius: 6px 6px 3px 3px; }
.pb-bar.today i { background: var(--pv); }
.pb-bar .kv { font-size: 16px; font-weight: 700; color: var(--text-2); margin-bottom: 6px; white-space: nowrap; }
.pb-bar.today .kv { color: var(--pv); }
.pb-avg { position: absolute; left: 0; right: 0; border-top: 2px dashed color-mix(in oklab, var(--text) 35%, transparent); pointer-events: none; }
.pb-avg span { position: absolute; left: 8px; bottom: 4px; font-size: 15px; font-weight: 600; color: var(--text-2); background: color-mix(in oklab, var(--surface) 80%, transparent); padding: 0 8px; border-radius: 8px; white-space: nowrap; }
.pb-labels { display: flex; gap: 6px; padding-top: 8px; }
.pb-labels span { flex: 1; min-width: 0; text-align: center; font-size: 15px; font-weight: 600; color: var(--text-3); white-space: nowrap; overflow: visible; height: 20px; }
.pb-labels span.today { color: var(--text); }
.pb-sums { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.pb-sum { border-radius: 22px; background: var(--surface); padding: 16px 20px; min-width: 0; }
.pb-sum .n, .tk-ph .n { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; color: var(--text-2); }
.pb-sum .sw { width: 14px; height: 14px; flex: none; border-radius: 5px; }
.pb-sum .v { font-size: 46px; font-weight: 500; letter-spacing: -.03em; line-height: 1.1; margin-top: 4px; white-space: nowrap; }
.pb-sum .v small, .tk .v small, .tk-ph .w small { font-size: 20px; color: var(--text-2); margin-left: 4px; letter-spacing: 0; }
.pb-sum .s { font-size: 15px; color: var(--text-2); }

.g-tk { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.tk { border-radius: 24px; background: var(--surface); border: 1px solid var(--border); padding: 18px 22px; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.tk.s2 { grid-column: span 2; }
.tk.s4 { grid-column: span 4; }
.tk h3 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 700; color: var(--text-2); }
.tk h3 .st { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 800; white-space: nowrap; }
.tk h3 .st::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.tk h3 .st.muted { color: var(--text-2); }
.tk .v { font-size: 60px; font-weight: 500; letter-spacing: -.03em; line-height: 1.1; margin-top: 6px; white-space: nowrap; }
.tk-share { height: 10px; border-radius: 5px; background: var(--surface-3); overflow: hidden; margin-top: 10px; }
.tk-share i { display: block; height: 100%; border-radius: 5px; background: var(--pv); transition: width .8s; }
.tk-kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; margin-top: auto; padding-top: 10px; }
.tk-kv div { font-size: 15px; color: var(--text-2); min-width: 0; }
.tk-kv b { display: block; font-size: 22px; font-weight: 600; color: var(--text); white-space: nowrap; }
.tk-phases { flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 12px; }
.tk-ph { border-radius: 18px; background: var(--surface-2); padding: 14px 16px; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; min-width: 0; }
.tk-ph .w { font-size: 44px; font-weight: 500; letter-spacing: -.03em; white-space: nowrap; }
.tk-ph .s { font-size: 15px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px), (orientation: portrait), (max-height: 500px) {
  .head:has(.head-extra:not(:empty)) { flex-wrap: wrap; height: auto; padding-top: 12px; padding-bottom: 12px; row-gap: 10px; }
  .head-extra { order: 5; flex-basis: 100%; margin-left: 0; }
  .head-extra + .head-time { margin-left: auto; }
  .pv-tabs { width: 100%; }
  .g-pb, .g-tk { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; height: auto; gap: 14px; }
  .pb-head { flex-direction: column; gap: 12px; }
  .pb-big { font-size: 48px; }
  .pb-sub { font-size: 15px; }
  .pb-side { align-items: stretch; width: 100%; }
  .pb-side .segment { width: 100%; }
  .pb-best { text-align: left; font-size: 15px; }
  .pb-plot { flex: none; height: 220px; }
  .pb-bars { gap: 3px; }
  .pb-labels { gap: 3px; }
  .pb-labels span { font-size: 12px; }
  .pb-bar .kv { font-size: 12px; }
  .pb-sums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pb-sum { padding: 14px 16px; }
  .pb-sum .n { font-size: 15px; }
  .pb-sum .v { font-size: 36px; }
  .pb-sum:last-child { grid-column: 1 / -1; }
  .tk.s2, .tk.s4 { grid-column: auto; }
  .tk .v { font-size: 46px; }
  .tk-phases { gap: 8px; }
  .tk-ph { padding: 12px; }
  .tk-ph .w { font-size: 28px; }
  .tk-ph .w small { font-size: 14px; }
  .tk-ph .s { font-size: 13px; white-space: normal; }
}

/* Reifendruck */
.ci.tap { cursor: pointer; transition: background .2s; }
.ci.tap:hover, .ci.tap:active { background: var(--surface-3); }
.tire-grid { display: grid; grid-template-columns: minmax(0, 1fr) 110px minmax(0, 1fr); grid-template-rows: auto auto; gap: 12px 14px; align-items: center; }
.tire-car { grid-column: 2; grid-row: 1 / 3; width: 110px; height: auto; }
.tire-c { min-width: 0; padding: 12px 14px; border-radius: 18px; background: var(--surface-2); }
.tire-c.r { text-align: right; }
.tire-n { font-size: 14px; font-weight: 700; color: var(--text-2); }
.tire-v { font-size: 34px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; white-space: nowrap; }
.tire-v small { font-size: 16px; color: var(--text-2); margin-left: 4px; }
.tire-d { font-size: 13px; color: var(--text-2); }
.tire-d b { font-weight: 800; }
.tire-verdict { display: flex; flex-direction: column; gap: 6px; font-size: 16px; }
@media (max-width: 760px), (orientation: portrait), (max-height: 500px) {
  .tire-grid { grid-template-columns: minmax(0, 1fr) 76px minmax(0, 1fr); gap: 10px; }
  .tire-car { width: 76px; }
  .tire-c { padding: 10px; }
  .tire-v { font-size: 26px; }
  .tire-v small { font-size: 13px; }
  .tire-d { font-size: 12px; }
}
.tire-warm { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--heat); }

/* Laufende Aktion: Knopf nimmt keine weiteren Eingaben an; unbekannter Zustand: gesperrt */
.busy { pointer-events: none; }
:is(.act, .switch, .choice, .icon-btn):disabled { opacity: .4; }
.pb-bar.none .kv { color: var(--text-3); }

/* ---------- Licht ---------- */
.lp { display: flex; flex-direction: column; gap: var(--gap); }
.lp-head { display: flex; align-items: center; gap: 12px; }
.lp-cnt { font-size: 15px; color: var(--text-2); font-weight: 600; white-space: nowrap; }
.new-badge { background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 10px; white-space: nowrap; }
.sh-n .new-badge { margin-left: 8px; vertical-align: 2px; }
.lp-scenes { flex: none; display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; }
.lp-scenes::-webkit-scrollbar { display: none; }
.lp-scenes > * { flex: 0 0 210px; }
.scene-wrap { position: relative; }
.lp-scenes .scene { width: 100%; height: 100px; background: var(--surface); }
.scene .sc-ic { position: absolute; left: 16px; top: 14px; color: var(--pv); }
.sc-more { position: absolute; right: 6px; top: 6px; width: 48px; height: 48px; border: 0; border-radius: 50%; background: transparent; color: var(--text-2); display: grid; place-items: center; }
.sc-more:hover { background: var(--surface-2); }
.scene.add { height: 100px; border: 1.5px dashed var(--border-2); background: transparent; flex-direction: row; align-items: center; justify-content: center; gap: 8px; color: var(--text-2); font-weight: 700; font-size: 15px; }
.lp-main { flex: 1; min-height: 0; display: flex; gap: var(--gap); }
.lp-rooms { flex: 1.35 1 0; min-width: 0; overflow-y: auto; scrollbar-width: none; display: flex; flex-direction: column; gap: 14px; }
.lp-rooms::-webkit-scrollbar { display: none; }
.lp-rooms > .panel { flex: none; }
.room-h { display: flex; align-items: baseline; gap: 10px; padding: 0 6px 12px; }
.room-h .c { font-size: 14px; color: var(--text-2); }
.lgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.lt { position: relative; height: 124px; border-radius: 22px; border: 1px solid var(--border); background: var(--surface-2); padding: 14px 16px; display: flex; flex-direction: column; justify-content: flex-end; color: var(--text); cursor: pointer; overflow: hidden; min-width: 0; outline: none; transition: border-color .2s; }
.lt:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.lt.on { background: radial-gradient(130% 120% at 0% 0%, color-mix(in oklab, var(--g) 28%, transparent), transparent 65%), var(--surface-2); }
.lt.sel { border: 1.5px solid var(--text-2); }
.lt.na { opacity: .55; }
.lt .bulb { position: absolute; left: 14px; top: 14px; color: var(--text-3); }
.lt.on .bulb { color: var(--g); filter: drop-shadow(0 0 8px var(--g)); }
.lt .n { font-size: 17px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 4px; }
.lt .s { font-size: 14px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt-pw { position: absolute; right: 10px; top: 10px; width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--surface-3); color: var(--text-2); display: grid; place-items: center; }
.lt.on .lt-pw { background: var(--accent); color: var(--on-accent); }
.lt.add { border: 1.5px dashed var(--border-2); background: transparent; align-items: center; justify-content: center; gap: 6px; color: var(--text-2); font: 700 15px 'Manrope', sans-serif; }
.lt.add .new-badge { position: absolute; right: 12px; top: 12px; }
.lp-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; color: var(--text-2); }
.lp-empty .sec-title { color: var(--text); }
.lp-det { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 22px; overflow-y: auto; scrollbar-width: none; }
.ld-top { display: flex; align-items: center; gap: 12px; }
.ld-ic { width: 52px; height: 52px; flex: none; border-radius: 50%; display: grid; place-items: center; }
.ld-n { font-size: 20px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ld-s { font-size: 14px; color: var(--text-2); }
.ld-lab { display: flex; align-items: baseline; font-size: 15px; color: var(--text-2); }
.ld-lab b { margin-left: auto; font-size: 40px; font-weight: 300; letter-spacing: -.04em; color: var(--text); }
.ld-lab b.sm { font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.slider.ct .sl-track { background: linear-gradient(90deg, #FFB86B, #FFF4E0 55%, #DCE8FF); }
.slider.ct .sl-fill { background: transparent; }
.ld-sw { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.sh-list { display: flex; flex-direction: column; gap: 2px; margin: 0 -8px; }
.sh-row { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 0 8px 0 10px; border-radius: 16px; }
.sh-n { font-size: 16px; font-weight: 800; }
.sh-s { font-size: 13px; color: var(--text-2); }
.btn.danger-text { color: var(--danger); }
@media (max-width: 760px), (orientation: portrait), (max-height: 500px) {
  .lp-head .btn span:not(.ms):not(.new-badge) { display: none; }
  .lp-head .btn { width: 48px; padding: 0; position: relative; }
  .lp-head .btn .new-badge { position: absolute; right: -6px; top: -6px; padding: 2px 6px; font-size: 11px; }
  .lp-scenes > * { flex-basis: 170px; }
  .lp-main { flex-direction: column; flex: none; }
  .lp-rooms, .lp-det { flex: none; overflow: visible; }
  .lgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ld-sw { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 14px; }
}
