/*
  ClimateControl – Stylesheet.

  Glas-Kacheln ueber einem Himmel. Der Himmel ist eine feste Ebene hinter
  allem (.himmel), seine Variante waehlt `body[data-himmel]`. Im Grundgeruest
  gibt es nur den klaren Tag; die Wettervarianten kommen mit dem Ingest.

  Keine Frameworks, nur CSS-Variablen — Hausstil wie in WatchTower.
*/

/*
  Geist (variabel 100–900), selbst gehostet: keine Anfrage an Google (DSGVO),
  und die CSP erlaubt ohnehin nur font-src 'self'. Ersetzt Outfit
  (Design-Handoff v2) — Geist wurde dort am Handy gegen Sora getestet.

  Zwei Dateien mit unicode-range: der Browser laedt latin-ext nur, wenn ein
  Zeichen daraus wirklich vorkommt (etwa ein Name mit "ł").
*/
@font-face {
    font-family: 'Geist';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/geist-v5-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: 'Geist';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/geist-v5-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    /* Himmel: oben, unten. Je Variante ueberschrieben. */
    --himmel-oben: #3d8fd6;
    --himmel-unten: #a9d4f5;
    --wolke: rgba(255, 255, 255, .85);

    /* Glas. Die Deckkraft ist bewusst so hoch, dass weisse Schrift auch
       vor einer hellen Wolke noch traegt — der Text-Schatten hilft nach. */
    --glas: rgba(255, 255, 255, .18);
    --glas-stark: rgba(255, 255, 255, .26);
    --glas-rand: rgba(255, 255, 255, .38);
    --glas-blur: 18px;
    --schatten: 0 8px 32px rgba(15, 42, 68, .18);

    --text: #ffffff;
    --text-leise: rgba(255, 255, 255, .82);
    --akzent: #ffd166;
    --gefahr: #ff8a80;

    /* Datenskalen (Design-Handoff v2): Farbe kodiert Messwerte, nicht Deko.
       Temperatur kalt → kuehl → Komfort → warm → heiss, Feuchte trocken →
       ideal → feucht → nass. Abgestimmt auf Himmel und Glas. */
    --temp-cold: oklch(0.78 0.11 252);
    --temp-cool: oklch(0.85 0.09 215);
    --temp-comfort: oklch(0.87 0.12 165);
    --temp-warm: #ffd166;
    --temp-hot: #ff8a80;
    --hum-dry: oklch(0.89 0.10 88);
    --hum-ideal: oklch(0.87 0.10 185);
    --hum-humid: oklch(0.80 0.10 240);
    --hum-wet: oklch(0.74 0.12 282);
    --status-info: oklch(0.85 0.08 225);
    --chart-gitter: rgba(255, 255, 255, .16);

    /* Bewegung: ruhig, ease-out, keine Bounces. */
    --ease-out: cubic-bezier(.22, .61, .36, 1);
    --dauer-1: 120ms;
    --dauer-2: 200ms;
    --dauer-3: 320ms;

    --radius: 20px;
    --radius-klein: 12px;
    --schrift: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    /* Dunkler Grund unter allem: beim Ueberziehen am Seitenrand (iOS) blitzt
       sonst Weiss auf, in der installierten App besonders auffaellig.
       Das Ueberziehen selbst bleibt erlaubt — ohne das Federn am Ende
       schlaegt die Seite hart an, wie eine Mauer (overscroll-behavior: none
       stand hier, seit dem Grund ist der Grund dunkel). */
    background: #0f2a44;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font: 400 16px/1.5 var(--schrift);
    color: var(--text);
    /*
      KEIN Hintergrund am body. Seit html einen eigenen Grund hat, wird der
      des body nicht mehr auf die Leinwand uebertragen, sondern im body-Kasten
      gemalt — und der liegt UEBER .himmel (z-index -1). Der ganze Himmel war
      dann unsichtbar, nur eine flache Farbe blieb. HimmelTest haelt das fest.
    */
    text-shadow: 0 1px 2px rgba(15, 42, 68, .25);
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
}

h1,
h2,
h3 {
    margin: 0 0 .5rem;
    font-weight: 600;
    line-height: 1.2;
}

h1 {
    font-size: 1.6rem;
}

p {
    margin: 0 0 1rem;
}

code {
    font-size: .9em;
    background: rgba(0, 0, 0, .15);
    padding: .05em .35em;
    border-radius: 6px;
}

.muted {
    color: var(--text-leise);
}

.lead {
    font-size: 1.1rem;
    color: var(--text-leise);
}

.ico {
    flex: none;
    vertical-align: -.2em;
}

/* --- Himmel --------------------------------------------------------------- */

.himmel {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background: linear-gradient(180deg, var(--himmel-oben) 0%, var(--himmel-unten) 100%);
    /* #116: Der Himmel als eigene, feste Ebene. Chrome zeichnete ihn sonst
       beim Scrollen hinter dem Glas neu und liess dabei ab und zu einen
       alten, unscharfen Block (eine Kachel breit + Unschaerfe) stehen. */
    will-change: transform;
    contain: strict;
}

/*
  Wolken als weiche radiale Flecken statt als Bilder: kein Netzabruf, kein
  Asset, und sie skalieren mit jeder Breite. Die Bewegung ist langsam genug,
  um nicht abzulenken, und entfaellt bei reduzierter Bewegung ganz.
*/
.himmel__wolken {
    position: absolute;
    inset: -10% -50%;
    background:
        radial-gradient(ellipse 18% 9% at 18% 22%, var(--wolke) 0%, transparent 70%),
        radial-gradient(ellipse 12% 6% at 26% 19%, var(--wolke) 0%, transparent 70%),
        radial-gradient(ellipse 22% 10% at 62% 34%, var(--wolke) 0%, transparent 70%),
        radial-gradient(ellipse 14% 7% at 70% 30%, var(--wolke) 0%, transparent 70%),
        radial-gradient(ellipse 16% 8% at 40% 70%, var(--wolke) 0%, transparent 70%);
    animation: wolken-ziehen 180s linear infinite alternate;
}

@keyframes wolken-ziehen {
    from { transform: translateX(-6%); }
    to   { transform: translateX(6%); }
}

/*
  Sonne bzw. Mond als weicher Lichtfleck oben rechts (::after) und Sterne
  (::before, nur in klaren und heiteren Naechten). Niederschlag ist KEIN
  CSS mehr: Regen und Schnee zeichnet assets/js/himmel.js auf einen Canvas
  (Design-Handoff v2 — die Streifen und Punktraster wirkten gepixelt).
*/
.himmel::before,
.himmel::after {
    content: '';
    position: absolute;
    pointer-events: none;
}

.himmel::before {
    inset: 0 0 45%;
    opacity: var(--sterne, 0);
}

.himmel::after {
    top: -18vmax;
    right: -12vmax;
    width: 55vmax;
    height: 55vmax;
    border-radius: 50%;
    background: radial-gradient(circle, var(--licht, transparent) 0%, transparent 62%);
}

/* Alle Ebenen aus includes/himmel.php liegen ueber dem Verlauf; sichtbar
   wird nur, was die Variante einschaltet. */
.himmel__nacht,
.himmel__nebel,
.himmel__dunst,
.himmel__niederschlag,
.himmel__blitz {
    position: absolute;
    inset: 0;
    pointer-events: none;
    display: none;
}

/* --- Himmelsvarianten ----------------------------------------------------
   Die Namen kommen aus classes/Sky.php (Sky::VARIANTEN), SkyTest prueft,
   dass hier fuer jede einer steht — und dass --himmel-oben zur
   theme-color in Sky::THEME_FARBE passt. */

body[data-himmel="klar-tag"] {
    --himmel-oben: #2f86d6;
    --himmel-unten: #9fd0f5;
    --wolken-deckung: .3;
    --licht: rgba(255, 236, 160, .75);
}

body[data-himmel="heiter-tag"] {
    --himmel-oben: #3d8fd6;
    --himmel-unten: #a9d4f5;
    --wolken-deckung: .8;
    --licht: rgba(255, 236, 160, .55);
}

/* Lesbarkeit an hellen Tagen (Handoff v2, Rueckmeldung "bei Sonne schlecht
   lesbar"): das Glas wird blau getoent statt weiss aufgehellt. Werte genau
   wie im Handoff (Entscheidung vom 12.10.2026). */
body[data-himmel="klar-tag"],
body[data-himmel="heiter-tag"] {
    --glas: rgba(14, 48, 86, .22);
    --glas-stark: rgba(14, 48, 86, .30);
    --glas-rand: rgba(255, 255, 255, .34);
    --text-leise: rgba(255, 255, 255, .9);
}

body[data-himmel="bedeckt-tag"] {
    --himmel-oben: #6f8597;
    --himmel-unten: #b3c2cf;
    --wolke: rgba(236, 241, 245, .95);
    --wolken-deckung: 1;
    --glas: rgba(20, 45, 70, .22);
    --glas-stark: rgba(20, 45, 70, .30);
    --glas-rand: rgba(255, 255, 255, .42);
}

body[data-himmel="regen-tag"] {
    --himmel-oben: #4d6275;
    --himmel-unten: #8c9cab;
    --wolke: rgba(200, 210, 220, .9);
    --wolken-deckung: .9;
}

body[data-himmel="schnee-tag"] {
    --himmel-oben: #8fa5ba;
    --himmel-unten: #dce5ee;
    --wolke: rgba(245, 248, 251, .95);
    --wolken-deckung: .9;
    /* Heller Himmel: das Glas wird dunkler getoent, sonst steht weisse
       Schrift auf fast weissem Grund. */
    --glas: rgba(30, 52, 75, .28);
    --glas-stark: rgba(30, 52, 75, .36);
}

body[data-himmel="nebel"] {
    --himmel-oben: #8e9aa4;
    --himmel-unten: #c9d0d5;
    --wolke: rgba(240, 242, 244, .9);
    /* Die Wolken ersetzen beim Nebel die drei Baender (.himmel__nebel). */
    --wolken-deckung: 0;
    --glas: rgba(30, 52, 75, .28);
    --glas-stark: rgba(30, 52, 75, .36);
}

body[data-himmel="daemmerung"] {
    --himmel-oben: #2b3f75;
    --himmel-unten: #f29b6b;
    --wolke: rgba(255, 214, 190, .8);
    --wolken-deckung: .55;
    --licht: rgba(255, 170, 110, .6);
}

body[data-himmel="klar-nacht"] {
    --himmel-oben: #0b1730;
    --himmel-unten: #1d3157;
    --wolke: rgba(170, 185, 210, .5);
    --wolken-deckung: .2;
    --sterne: 1;
    --licht: rgba(220, 230, 255, .22);
}

body[data-himmel="heiter-nacht"] {
    --himmel-oben: #101d38;
    --himmel-unten: #26395e;
    --wolke: rgba(150, 165, 190, .6);
    --wolken-deckung: .6;
    --sterne: .5;
    --licht: rgba(220, 230, 255, .15);
}

body[data-himmel="bedeckt-nacht"] {
    --himmel-oben: #1c2633;
    --himmel-unten: #364352;
    --wolke: rgba(110, 125, 140, .8);
    --wolken-deckung: .9;
}

body[data-himmel="regen-nacht"] {
    --himmel-oben: #141c27;
    --himmel-unten: #2c3846;
    --wolke: rgba(90, 105, 120, .8);
    --wolken-deckung: .9;
}

body[data-himmel="schnee-nacht"] {
    --himmel-oben: #1d2a3a;
    --himmel-unten: #3d4d60;
    --wolke: rgba(150, 165, 180, .8);
    --wolken-deckung: .8;
}

body[data-himmel="gewitter"] {
    --himmel-oben: #1e2433;
    --himmel-unten: #464b62;
    --wolke: rgba(95, 100, 125, .9);
    --wolken-deckung: 1;
}

/*
  Gewitter und Nebel haben nur eine Variante, nachts waren beide zu hell.
  Kein neuer Variantenname (Sky::VARIANTEN bleibt), sondern eine Abdunklung
  ueber dem Verlauf, wenn die Sonne unter dem Horizont steht.
*/
body[data-himmel="gewitter"][data-tageszeit="nacht"],
body[data-himmel="nebel"][data-tageszeit="nacht"] {
    --wolke: rgba(70, 78, 100, .6);
}

body[data-himmel="gewitter"][data-tageszeit="nacht"] .himmel__nacht,
body[data-himmel="nebel"][data-tageszeit="nacht"] .himmel__nacht {
    display: block;
    background: linear-gradient(180deg, rgba(4, 6, 12, .62), rgba(4, 6, 12, .45));
}

/*
  Durchs Glas sehen: bei Niederschlag und Nebel sinkt der Blur der Kacheln,
  damit Tropfen, Flocken und Nebel ganz leicht durchschimmern. Die Toenung
  bleibt — sie traegt die Lesbarkeit, nicht der Blur.
*/
body[data-himmel^="regen"],
body[data-himmel^="schnee"],
body[data-himmel="gewitter"],
body[data-himmel="nebel"] {
    --glas-blur: 7px;
    --glas-saettigung: 150%;
}

.himmel__wolken {
    opacity: var(--wolken-deckung, .7);
}

/* Dunst am unteren Rand bei Regen: der Horizont verschwimmt. */
body[data-himmel^="regen"] .himmel__dunst,
body[data-himmel="gewitter"] .himmel__dunst {
    display: block;
    background: linear-gradient(180deg, transparent 40%, var(--wolke) 100%);
    opacity: .35;
    filter: blur(20px);
}

/* Regen und Schnee: der Canvas, gezeichnet von assets/js/himmel.js. */
body[data-himmel^="regen"] .himmel__niederschlag,
body[data-himmel^="schnee"] .himmel__niederschlag,
body[data-himmel="gewitter"] .himmel__niederschlag {
    display: block;
    width: 100%;
    height: 100%;
}

/*
  Blitz: nur die Ebene. Das Leuchten setzt assets/js/himmel.js zufaellig
  alle 8–20 s. Ersetzt das alte brightness-Blinken im festen 11-s-Takt,
  das mechanisch wirkte.
*/
body[data-himmel="gewitter"] .himmel__blitz {
    display: block;
    opacity: 0;
    mix-blend-mode: screen;
}

/* Sterne: fest stehende Punkte in zwei gegeneinander versetzten Rastern,
   nur in der oberen Haelfte. */
body[data-himmel="klar-nacht"] .himmel::before,
body[data-himmel="heiter-nacht"] .himmel::before {
    background:
        radial-gradient(circle, rgba(255, 255, 255, .9) 0 1px, transparent 1.5px) 0 0 / 97px 83px,
        radial-gradient(circle, rgba(255, 255, 255, .6) 0 1px, transparent 1.5px) 40px 30px / 151px 127px;
    -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent);
    mask-image: linear-gradient(180deg, #000 30%, transparent);
    animation: funkeln 6s ease-in-out infinite alternate;
}

@keyframes funkeln {
    from { opacity: var(--sterne, 1); }
    to   { opacity: calc(var(--sterne, 1) * .6); }
}

/*
  Nebel: drei weiche Baender, die minimal wabern, statt einer stillen,
  verwischten Wolkenschicht. Versetzte Startzeiten, damit sie nie im
  Gleichtakt gehen.
*/
body[data-himmel="nebel"] .himmel__nebel {
    display: block;
}

.himmel__band {
    position: absolute;
    left: -25%;
    right: -25%;
    background:
        radial-gradient(ellipse 50% 50% at 30% 50%, var(--wolke) 0%, transparent 70%),
        radial-gradient(ellipse 45% 45% at 72% 55%, var(--wolke) 0%, transparent 72%);
    filter: blur(22px);
    will-change: transform;
}

.himmel__band--1 {
    top: 18%;
    height: 34%;
    opacity: .5;
    animation: wabern-a 46s ease-in-out 0s infinite alternate;
}

.himmel__band--2 {
    top: 46%;
    height: 38%;
    opacity: .65;
    animation: wabern-b 62s ease-in-out -12s infinite alternate;
}

.himmel__band--3 {
    top: 68%;
    height: 40%;
    opacity: .75;
    animation: wabern-a 38s ease-in-out -20s infinite alternate;
}

@keyframes wabern-a {
    0%   { transform: translate3d(-3%, 0, 0) scale(1); }
    50%  { transform: translate3d(1.5%, -1.2%, 0) scale(1.05); }
    100% { transform: translate3d(4%, .8%, 0) scale(1.02); }
}

@keyframes wabern-b {
    0%   { transform: translate3d(3%, .6%, 0) scale(1.04); }
    50%  { transform: translate3d(-1%, 1.4%, 0) scale(1); }
    100% { transform: translate3d(-4%, -.6%, 0) scale(1.06); }
}

@media (prefers-reduced-motion: reduce) {
    .himmel::before,
    .himmel__wolken,
    .himmel__band,
    .raum__verlauf,
    .vollbild {
        animation: none !important;
    }
}

/* --- Glas ----------------------------------------------------------------- */

.glas {
    background: var(--glas);
    border: 1px solid var(--glas-rand);
    border-radius: var(--radius);
    box-shadow: var(--schatten);
    -webkit-backdrop-filter: blur(var(--glas-blur)) saturate(var(--glas-saettigung, 140%));
    backdrop-filter: blur(var(--glas-blur)) saturate(var(--glas-saettigung, 140%));
    /* #116: jede Glas-Flaeche eine eigene Ebene, deren Hintergrund der
       Compositor beim Scrollen neu berechnet, statt alte Bloecke zu zeigen. */
    transform: translateZ(0);
}

/*
  Ohne backdrop-filter (aeltere Browser) waere das Glas fast durchsichtig und
  die Schrift stuende ungeschuetzt auf dem Himmel. Dann deckender.
*/
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .glas {
        background: rgba(30, 70, 110, .55);
    }
}

/* --- Kopf ----------------------------------------------------------------- */

.kopf {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: calc(1rem + env(safe-area-inset-top)) 1rem 1rem;
    max-width: 72rem;
    width: 100%;
    margin: 0 auto;
}

.marke {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    text-decoration: none;
}

.marke__zeichen,
.panel__zeichen {
    /* Das freie Zeichen steht direkt am Himmel: Schatten am Umriss, keine
       Kachel und kein Kastenschatten. */
    filter: drop-shadow(0 1px 2px rgba(15, 42, 68, .25));
}

/* Wortmarke: klein geschrieben, "climate" leicht, "control" kraeftig. */
.marke__name,
.panel__marke {
    font-size: 1.25rem;
    font-weight: 300;
    letter-spacing: -.03em;
    white-space: nowrap;
}

.marke__name b,
.panel__marke b,
.foot__marke b {
    font-weight: 600;
}

.abmelden {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    min-height: 44px;
    padding: 0 .9rem;
    border-radius: 999px;
    text-decoration: none;
    color: var(--text);
    background: var(--glas);
    border: 1px solid var(--glas-rand);
    -webkit-backdrop-filter: blur(var(--glas-blur));
    backdrop-filter: blur(var(--glas-blur));
}

.abmelden:hover,
.abmelden:focus-visible {
    background: var(--glas-stark);
}

/* --- Inhalt --------------------------------------------------------------- */

.wrap {
    flex: 1;
    width: 100%;
    max-width: 72rem;
    margin: 0 auto;
    padding: 0 1rem 2rem;
}

.karte {
    padding: 1.25rem;
}

.karte--leer {
    max-width: 36rem;
    margin: 2rem auto;
    text-align: center;
    padding: 2rem 1.5rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.einheit {
    font-size: .45em;
    font-weight: 400;
    margin-left: .1em;
    vertical-align: .9em;
    color: var(--text-leise);
}

.hinweis {
    margin: 0 0 1rem;
    padding: .8rem 1rem;
    border-left: 4px solid var(--akzent);
}

/* Ausgeblendet, solange die Daten frisch sind (live.js blendet ein). */
.hinweis[hidden] {
    display: none;
}

/* Demo-Modus (classes/Demo.php): schmales Band zwischen Kopf und Inhalt,
   in der Breite des Inhalts, damit es nicht wie ein Fehler wirkt. */
.demo-band {
    width: 100%;
    max-width: 72rem;
    margin: 0 auto .75rem;
    padding: .35rem 1rem;
    box-sizing: border-box;
    font: 500 13px/1.4 var(--schrift);
    letter-spacing: .02em;
    text-align: center;
    color: var(--text-leise);
    background: var(--glas);
    border-top: 1px solid var(--glas-rand);
    border-bottom: 1px solid var(--glas-rand);
}

/* --- Innen- und Aussenkarte (#6, #7) -------------------------------------- */

/*
  Zwei Glas-Karten nebeneinander, ab ~680 px Breite; schmaler untereinander.
  Ohne Innentemperatur (noch kein Raum mit Temperatur) nimmt die Aussenkarte
  die ganze Breite.
*/
.kopfkarten {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.kopfkarten--nur-aussen {
    grid-template-columns: 1fr;
}

.kopfkarten .karte {
    padding: 1.5rem 1.75rem;
    display: grid;
    gap: 1.25rem;
    align-content: space-between;
    min-width: 0;
}

/* Kleine Ueberschrift in Versalien ("INNEN · 5 RAEUME", "AUSSEN"). */
.etikett {
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-leise);
}

/* Ein Messwert: Etikett, Zahl, ggf. Veraenderung darunter. */
.messung {
    display: grid;
    gap: .3rem;
    align-content: start;
}

.messung__zahl {
    font-size: 2rem;
    font-weight: 300;
    line-height: 1;
    letter-spacing: -.03em;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.messung__zahl--gross {
    font-size: clamp(3rem, 9vw, 4.5rem);
    font-weight: 200;
}

.messung__zahl--held {
    font-size: clamp(3.5rem, 11vw, 7rem);
    font-weight: 200;
}

.messung__hinweis {
    font-size: 11px;
    color: var(--text-leise);
}

.messung__delta {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .9rem;
    font-variant-numeric: tabular-nums;
}

.innen__oben {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem 1.5rem;
}

.innen__neben {
    display: grid;
    gap: 1rem;
    padding-top: .4rem;
}

/*
  Temperaturskala 12–30 °C: der Verlauf der Datenskala, der Komfortbereich
  als Rahmen, die aktuelle Innentemperatur als Marke.
*/
.skala {
    display: grid;
    gap: .35rem;
}

.skala__band {
    position: relative;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg,
        var(--temp-cold) 0%,
        var(--temp-cool) 30%,
        var(--temp-comfort) 50%,
        var(--temp-warm) 75%,
        var(--temp-hot) 100%);
}

.skala__komfort {
    position: absolute;
    top: -4px;
    bottom: -4px;
    border: 1.5px solid rgba(255, 255, 255, .85);
    border-radius: 4px;
}

.skala__marke {
    position: absolute;
    top: -6px;
    bottom: -6px;
    width: 6px;
    margin-left: -3px;
    border-radius: 3px;
    background: #ffffff;
    box-shadow: 0 0 0 2px #0f2a44;
}

.skala__werte {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-leise);
    font-variant-numeric: tabular-nums;
}

.aussen__kopf {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.aussen__mitte {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: .75rem 1rem;
}

.aussen__text {
    display: grid;
    gap: .2rem;
    justify-items: end;
    text-align: right;
    font-size: .9rem;
    color: var(--text-leise);
}

.aussen__zustand {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text);
}

.aussen__stand {
    font-size: .8rem;
}

/* Warn-Badges: Pille mit Punkt in Status-Farbe. */
.abzeichen {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.abzeichen__eintrag {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    min-height: 28px;
    padding: 0 .75rem;
    font-size: .85rem;
    font-weight: 500;
    border-radius: 999px;
    border: 1px solid var(--glas-rand);
    background: rgba(15, 42, 68, .18);
    font-variant-numeric: tabular-nums;
}

.abzeichen__eintrag::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: none;
}

.abzeichen__eintrag--ok::before {
    background: var(--temp-comfort);
}

.abzeichen__eintrag--warn::before {
    background: var(--akzent);
}

/* --- Raeume --------------------------------------------------------------- */

/*
  dense: eine aufgeklappte Kachel nimmt die ganze Zeile, die Kacheln danach
  ruecken in entstandene Luecken nach, statt eine halbe Zeile frei zu lassen.
*/
.raeume {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
    grid-auto-flow: dense;
    gap: 1rem;
    margin-bottom: 1rem;
}

.raum {
    padding: 1.1rem 1.2rem 1rem;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.raum.ist-gross {
    grid-column: 1 / -1;
}

.raum__kopf {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}

.raum__name {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-leise);
    margin: 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 44 px Zielflaeche, optisch aber in die Ecke geschoben. */
.raum__gross {
    position: relative;
    flex: none;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin: -10px -10px -10px 0;
    border: 0;
    border-radius: 50%;
    color: var(--text);
    background: transparent;
    cursor: pointer;
}

/* Der sichtbare Kreis ist kleiner als das Tippziel (36 statt 44 px): so
   bleibt in der grossen Kachel Luft zu "Min Ø Max" direkt darunter. */
.raum__gross::before {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: var(--glas-stark);
    opacity: 0;
    transition: opacity var(--dauer-1) var(--ease-out);
}

.raum__gross > * {
    position: relative;
}

.raum__gross:active::before,
.raum__gross:focus-visible::before {
    opacity: 1;
}

/* Nur fuer Geraete, die schweben koennen. iOS haelt :hover nach einem Tipp
   fest, bis man woanders hintippt — der Kreis blieb dann wie "aktiv" stehen. */
@media (hover: hover) {
    .raum__gross:hover::before {
        opacity: 1;
    }
}

.raum__gross .ico--zu,
.raum.ist-gross .raum__gross .ico--auf {
    display: none;
}

.raum.ist-gross .raum__gross .ico--zu {
    display: block;
}

/* Die Werte sind Knoepfe (sie waehlen den Verlauf), sehen aber wie Text aus. */
.raum__haupt,
.wert {
    font: inherit;
    color: inherit;
    text-shadow: inherit;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    text-align: left;
    border-radius: 8px;
}

.raum__haupt {
    font-size: 2.8rem;
    font-weight: 300;
    line-height: 1.15;
    margin: .2rem 0 .4rem;
    align-self: flex-start;
    font-variant-numeric: tabular-nums;
}

.raum.ist-gross .raum__haupt {
    font-size: 3.5rem;
    font-weight: 200;
}

.raum__werte {
    list-style: none;
    margin: auto 0 0;
    padding: .5rem 0 0;
    border-top: 1px solid rgba(255, 255, 255, .2);
}

.wert {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    min-height: 36px;
    align-items: center;
}

.wert__name {
    color: var(--text-leise);
    font-size: .95rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wert__zahl {
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.raum__haupt:hover,
.wert:hover .wert__zahl {
    color: var(--akzent);
}

/* Aufgeklappt: Zeitraum, Vollbild, Diagramm — sanft von unten. */
.raum__verlauf {
    display: grid;
    gap: .75rem;
    margin-top: .75rem;
    animation: steigen var(--dauer-3) var(--ease-out);
}

.raum__verlauf[hidden] {
    display: none;
}

@keyframes steigen {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

/* --- Bedienleisten: Zeitraum, Pills, Chips -------------------------------- */

.leiste {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem .75rem;
    justify-content: space-between;
    align-items: center;
}

.bereiche {
    position: relative;
    display: inline-flex;
    padding: 3px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .12);
}

.bereiche button {
    position: relative;
    z-index: 1;
    font: inherit;
    font-size: .9rem;
    color: var(--text-leise);
    background: none;
    border: 0;
    border-radius: 999px;
    min-height: 34px;
    padding: 0 .8rem;
    cursor: pointer;
    transition: color var(--dauer-3) var(--ease-out);
}

.bereiche button[aria-pressed="true"] {
    color: #0f2a44;
    background: #ffffff;
    text-shadow: none;
}

/*
  Mit JavaScript gleitet ein Schieber zum gewaehlten Zeitraum
  (CCDiagramm.bereiche); der Knopf selbst bleibt dann durchsichtig.
*/
.bereiche.mit-schieber button[aria-pressed="true"] {
    background: transparent;
}

.bereiche__schieber {
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 0;
    width: 0;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(15, 42, 68, .25);
    transition:
        transform var(--dauer-3) var(--ease-out),
        width var(--dauer-3) var(--ease-out);
}

@media (prefers-reduced-motion: reduce) {
    .bereiche__schieber {
        transition: none;
    }
}

/* Glas-Pill fuer "Vollbild" und "Schliessen". */
.pill {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    min-height: 40px;
    padding: 0 1rem;
    font: inherit;
    font-size: .95rem;
    color: var(--text);
    background: var(--glas);
    border: 1px solid var(--glas-rand);
    border-radius: 999px;
    cursor: pointer;
    transition: background var(--dauer-1) var(--ease-out), transform var(--dauer-1) var(--ease-out);
}

.pill:hover,
.pill:focus-visible {
    background: var(--glas-stark);
}

.pill:active,
.chip:active,
.bereiche button:active {
    transform: scale(.98);
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.chip {
    height: 32px;
    padding: 0 .8rem;
    font: 500 13px/1 var(--schrift);
    color: #ffffff;
    background: transparent;
    border: 1px solid var(--glas-rand);
    border-radius: 999px;
    opacity: .7;
    cursor: pointer;
}

.chip[aria-pressed="true"] {
    background: var(--glas-stark);
    opacity: 1;
}

/* --- Verlauf unten -------------------------------------------------------- */

.verlauf {
    padding: 1rem;
    display: grid;
    /* minmax(0, …): die Spalte darf nicht breiter werden als die Karte. Mit
       dem Standard "auto" waechst sie auf die Breite der laengsten Option im
       Sensor-Wahlfeld ("Schlafzimmer · Temperatur Schlafzimmer"), und mit ihr
       das Diagramm — beides ragt dann rechts aus der Karte. */
    grid-template-columns: minmax(0, 1fr);
    gap: .75rem;
}

/* Das Wahlfeld darf schmaler werden als sein laengster Eintrag. */
.verlauf__wahl {
    display: block;
    min-width: 0;
    max-width: 100%;
}

.verlauf__wahl select {
    /* Eigener Pfeil statt des Browser-Pfeils: der klebte ohne Abstand am
       rechten Rand der Pille. */
    -webkit-appearance: none;
    appearance: none;
    font: inherit;
    color: var(--text);
    background-color: var(--glas-stark);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 14px;
    border: 1px solid var(--glas-rand);
    border-radius: 999px;
    min-height: 40px;
    padding: 0 2.6rem 0 1rem;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.verlauf__wahl select:hover {
    background-color: var(--glas);
}

.verlauf__wahl option {
    color: #0f2a44;
}

/* --- Diagramm (assets/js/diagramm.js) ------------------------------------- */

.diagramm-flaeche {
    min-height: 220px;
    min-width: 0;
}

.diagramm-flaeche--raum {
    min-height: 230px;
}

[aria-busy="true"] .diagramm__svg {
    opacity: .5;
    transition: opacity var(--dauer-2) var(--ease-out);
}

.diagramm {
    display: grid;
    gap: 10px;
}

.diagramm__legende {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    font-size: 13px;
    color: var(--text-leise);
}

.diagramm__legende span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.diagramm__buehne {
    position: relative;
    text-shadow: none;
}

.diagramm__svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
    /* Waagerecht zeigt der Finger, senkrecht scrollt die Seite weiter. */
    touch-action: pan-y;
}

.diagramm__gitter {
    stroke: var(--chart-gitter);
    stroke-width: 1;
}

.diagramm__achse {
    fill: var(--text-leise);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.diagramm__komfort {
    fill: color-mix(in oklch, var(--temp-comfort) 18%, transparent);
}

.diagramm__komfort-rand {
    stroke: var(--temp-comfort);
    stroke-opacity: .7;
    stroke-dasharray: 2 4;
}

.diagramm__band {
    fill-opacity: .12;
}

.diagramm__linie {
    fill: none;
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.diagramm__zeiger line {
    stroke: rgba(255, 255, 255, .5);
}

.diagramm__zeiger circle {
    stroke: #0f2a44;
    stroke-width: 2;
}

.diagramm__tipp {
    position: absolute;
    top: 0;
    /* So breit wie der Inhalt, aber nie breiter als das Diagramm (#80). */
    width: max-content;
    min-width: 150px;
    max-width: min(260px, 100%);
    box-sizing: border-box;
    padding: 8px 10px;
    display: grid;
    gap: 4px;
    border-radius: 10px;
    background: rgba(15, 42, 68, .66);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    backdrop-filter: blur(18px) saturate(140%);
    border: 1px solid var(--glas-rand);
    box-shadow: 0 16px 48px rgba(15, 42, 68, .30);
    pointer-events: none;
    color: #ffffff;
}

/* Offene Fenster hinter den Kurven (#82), Farbe wie der Kachel-Hinweis. */
.diagramm__fenster {
    fill: #9fd8ff;
    fill-opacity: .22;
}

.diagramm__tipp-fenster {
    display: block;
    margin-top: .3rem;
    font-size: .8rem;
    color: #cfe8ff;
}

.diagramm__tipp[hidden] {
    display: none;
}

.diagramm__tipp-zeit {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-leise);
}

.diagramm__tipp-zeile {
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 6px;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.diagramm__tipp-zeile i {
    flex: none;
    width: 8px;
    height: 2px;
    border-radius: 1px;
}

.diagramm__tipp-zeile span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-leise);
}

.diagramm__tipp-spanne {
    grid-column: 3;
    justify-self: end;
    margin-top: -2px;
    font-size: 11px;
    color: var(--text-leise);
}

.diagramm__tipp-zeile b {
    font-weight: 500;
    white-space: pre;
}

.diagramm__status {
    padding: 4rem 0;
    text-align: center;
    margin: 0;
}

/* --- Vollbild ------------------------------------------------------------- */

.vollbild {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding:
        calc(1rem + env(safe-area-inset-top))
        calc(1rem + env(safe-area-inset-right))
        calc(1rem + env(safe-area-inset-bottom))
        calc(1rem + env(safe-area-inset-left));
    background: rgba(15, 42, 68, .55);
    -webkit-backdrop-filter: blur(24px) saturate(140%);
    backdrop-filter: blur(24px) saturate(140%);
    color: #ffffff;
    overflow-y: auto;
    /* Am Ende des Dialogs nicht die Seite dahinter weiterscrollen. */
    overscroll-behavior: contain;
    animation: einblenden var(--dauer-2) var(--ease-out);
}

.vollbild[hidden] {
    display: none;
}

@keyframes einblenden {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.vollbild__kopf {
    display: flex;
    align-items: center;
    gap: 12px;
}

.vollbild__titel {
    flex: 1;
    min-width: 0;
    margin: 0;
}

.vollbild .diagramm-flaeche {
    flex: 1;
    min-height: 0;
}

/* Hinter dem Vollbild scrollt die Seite nicht mit. */
html.ist-gesperrt,
html.ist-gesperrt body {
    overflow: hidden;
}

/* --- Handy ---------------------------------------------------------------- */

/*
  Bis 640 px: zwei Kacheln nebeneinander, kompakt — die Zahl kleiner, von
  den Nebenwerten nur der erste. Aufgeklappt bekommt die Kachel die ganze
  Breite und zeigt wieder alles.
*/
@media (max-width: 640px) {
    .raeume {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .raum {
        padding: .9rem .9rem .75rem;
    }

    .raum__haupt {
        font-size: 34px;
    }

    .raum:not(.ist-gross) .raum__werte li:not(:first-child) {
        display: none;
    }

    .raum:not(.ist-gross) .wert__name {
        font-size: .85rem;
    }

    .kopfkarten {
        gap: 10px;
        margin-bottom: 10px;
    }

    .kopfkarten .karte {
        padding: 1.25rem;
        gap: 1rem;
    }

    /* Nebenwerte in eine Zeile statt untereinander. */
    .innen__neben {
        grid-auto-flow: column;
        gap: 1.5rem;
        padding-top: 0;
    }

    /* Nur die Nebenwerte kleiner — die grossen Zahlen behalten ihr clamp(). */
    .innen__neben .messung__zahl {
        font-size: 1.6rem;
    }

    .messung__zahl--held {
        font-size: 4rem;
    }

    /* Zahl links, Text rechts — auch schmal nebeneinander statt umbrochen. */
    .aussen__mitte {
        flex-wrap: nowrap;
    }

    .hinweis {
        margin-bottom: .75rem;
    }
}

/* --- Splash --------------------------------------------------------------- */

/*
  Nur sichtbar, wenn splash-start.js "splash-an" gesetzt hat. Der Grund ist
  die Farbe des App-Symbols — der System-Splash der installierten App
  (background_color + Symbol) geht so nahtlos ueber.
*/
.splash {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
}

html.splash-an .splash {
    display: block;
    /* Notausgang: scheitert splash.js, gibt das CSS die Seite nach 4,5 s
       trotzdem frei. Sonst laege der Splash fuer immer ueber allem. */
    animation: splash-notaus 300ms ease-out 4.5s forwards;
}

@keyframes splash-notaus {
    to { opacity: 0; visibility: hidden; pointer-events: none; }
}

.splash__grund {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, #5aa9e6 0%, #2f6fb0 100%);
}

.splash[data-tageszeit="nacht"] .splash__grund {
    background: linear-gradient(180deg, #0b1a3a 0%, #2a4a7a 100%);
}

.splash__leinwand {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* --- Anmelden / Abgemeldet ------------------------------------------------ */

body.centered {
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem calc(1.5rem + env(safe-area-inset-bottom));
}

.panel {
    width: 100%;
    max-width: 26rem;
    padding: 2rem 1.5rem;
    text-align: center;
}

.panel__zeichen {
    display: block;
    margin: 0 auto .75rem;
}

.panel__marke {
    font-size: 1.75rem;
    margin-bottom: .5rem;
}

.note {
    text-align: left;
    margin: 0 0 1rem;
    padding: .8rem 1rem;
    border-radius: var(--radius-klein);
    background: rgba(255, 255, 255, .2);
    border-left: 4px solid var(--akzent);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 1.4rem;
    border-radius: 999px;
    font-weight: 600;
    text-decoration: none;
    text-shadow: none;
    color: #0f2a44;
    background: #ffffff;
    box-shadow: var(--schatten);
    border: 0;
    cursor: pointer;
}

.btn:hover,
.btn:focus-visible {
    background: #eaf4fd;
}

a:focus-visible,
button:focus-visible {
    outline: 3px solid var(--akzent);
    outline-offset: 2px;
}

/* --- Fuss ----------------------------------------------------------------- */

.foot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .15rem;
    padding: 2rem 1rem calc(1.5rem + env(safe-area-inset-bottom));
    font-size: .9rem;
    color: var(--text-leise);
}

.foot__marke {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .95rem;
    font-weight: 300;
    letter-spacing: -.03em;
    color: var(--text);
}

.foot__herkunft {
    color: var(--text-leise);
    text-underline-offset: 3px;
}

.foot__herkunft:hover {
    color: var(--text);
}

/* --- Kopf: Aktionen ------------------------------------------------------- */

.kopf__aktionen {
    display: flex;
    gap: .5rem;
}

.abmelden--rund {
    position: relative;
    width: 44px;
    padding: 0;
    justify-content: center;
}

/* Badge (#63): Punkt oben rechts am Knopf bzw. hinter dem Reitertext. */
.badge {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(15, 42, 68, .7);
}

.abmelden--rund .badge {
    position: absolute;
    top: 3px;
    right: 3px;
}

.bereiche--reiter .badge {
    margin-left: .35rem;
    vertical-align: .1em;
}

.badge--niedrig {
    background: var(--akzent);
}

.badge--leer {
    background: var(--temp-hot);
}

/* Zahl (#124): neue Geraete fuer den Grundriss — blau, damit Gelb/Rot den
   Batterien gehoert. Am runden Knopf unten rechts, der Punkt bleibt oben. */
.badge--zahl {
    width: auto;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    box-sizing: border-box;
    background: var(--status-info);
    color: #0f2a44;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

.abmelden--rund .badge--zahl {
    top: auto;
    bottom: -2px;
    right: -4px;
}

/*
  Drei runde Knoepfe plus "Logout" passen auf 390 px nicht mehr neben die
  Marke: darunter nur das Zeichen, das Wort bleibt fuer Screenreader.
*/
@media (max-width: 26rem) {
    /* Vier runde Knoepfe (#94): Abstaende und Name etwas kleiner, die
       Tippziele bleiben 44 px. */
    .kopf {
        gap: .5rem;
    }

    .kopf__aktionen {
        gap: .25rem;
    }

    .kopf .marke__name {
        font-size: 1.05rem;
    }

    .abmelden:not(.abmelden--rund) {
        width: 44px;
        padding: 0;
        justify-content: center;
    }

    .abmelden__text {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
}

.abmelden[aria-current="page"] {
    background: var(--glas-stark);
    border-color: #ffffff;
}

/* --- Einstellungen -------------------------------------------------------- */

.einst__kopf {
    margin: .5rem 0 1.25rem;
}

.einst__raum {
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
}

.einst__raum h2 {
    font-size: 1.1rem;
}

.einst__liste {
    list-style: none;
    margin: 0;
    padding: 0;
}

.einst__sensor {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
        "ordnen felder zeigen"
        "ordnen status status";
    gap: .25rem .75rem;
    align-items: center;
    padding: .75rem 0;
    border-top: 1px solid rgba(255, 255, 255, .18);
}

.einst__sensor:first-child {
    border-top: 0;
}

/* Ausgeblendetes bleibt bedienbar, tritt aber zurueck. */
.einst__sensor.ist-aus .einst__felder {
    opacity: .55;
}

.einst__sensor[aria-busy="true"] {
    cursor: progress;
}

.einst__ordnen {
    grid-area: ordnen;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.einst__ordnen button {
    width: 36px;
    height: 32px;
    font-size: .75rem;
    color: var(--text);
    background: var(--glas);
    border: 1px solid var(--glas-rand);
    border-radius: 8px;
    cursor: pointer;
}

.einst__ordnen button:hover {
    background: var(--glas-stark);
}

/* Erster kann nicht hoch, letzter nicht runter — leise statt versteckt,
   damit die Zeilen gleich breit bleiben. */
.einst__sensor:first-child [data-verschieben="hoch"],
.einst__sensor:last-child [data-verschieben="runter"] {
    opacity: .35;
}

.einst__felder {
    grid-area: felder;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
    gap: .5rem .75rem;
    min-width: 0;
}

.einst__feld {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    font-size: .8rem;
    color: var(--text-leise);
}

.einst__feld input {
    font: inherit;
    font-size: 1rem;
    color: var(--text);
    background: rgba(255, 255, 255, .14);
    border: 1px solid var(--glas-rand);
    border-radius: 10px;
    min-height: 40px;
    padding: 0 .7rem;
    width: 100%;
}

/* Eigene Vorschlagsliste (#110) statt der ungestylten des Browsers. */
.vorschlag {
    position: relative;
    display: block;
}

.vorschlag input[role="combobox"] {
    padding-right: 2.2rem;
}

/* Im Grundriss-Editor ist das Feld hell: Pfeil dunkel. */
.ge__feld .vorschlag::after {
    color: #0f2a44;
}

/* Pfeil als Rahmen-Ecke, genau auf halber Hoehe des Feldes. */
.vorschlag::after {
    content: "";
    position: absolute;
    top: 50%;
    right: .9rem;
    width: .45rem;
    height: .45rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    color: var(--text);
    opacity: .8;
    transform: translateY(-70%) rotate(45deg);
    pointer-events: none;
}

.vorschlag__liste {
    /* Haengt an body; Lage und Breite setzt vorschlaege.js. */
    position: fixed;
    z-index: 60;
    box-sizing: border-box;
    max-height: 15rem;
    overflow-y: auto;
    margin: 0;
    padding: .3rem;
    list-style: none;
    background: rgba(28, 44, 78, .92);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glas-rand);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}

.vorschlag__liste[hidden] {
    display: none;
}

.vorschlag__eintrag {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 .75rem;
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
    font-style: normal;
    cursor: pointer;
}

.vorschlag__eintrag:hover,
.vorschlag__eintrag[aria-selected="true"] {
    background: rgba(255, 255, 255, .18);
}

.einst__feld input::placeholder {
    /* Kursiv: der Platzhalter ist der HA-Wert, kein eigener — beides sah
       sonst fast gleich aus. */
    color: rgba(255, 255, 255, .62);
    font-style: italic;
}

.einst__feld input:focus {
    outline: 3px solid var(--akzent);
    outline-offset: 1px;
    background: rgba(255, 255, 255, .22);
}

.einst__info {
    grid-column: 1 / -1;
    margin: 0;
    font-size: .8rem;
    overflow-wrap: anywhere;
}

.einst__zeigen {
    grid-area: zeigen;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .2rem;
    font-size: .8rem;
    color: var(--text-leise);
    cursor: pointer;
}

.einst__zeigen input {
    width: 22px;
    height: 22px;
    accent-color: var(--akzent);
    cursor: pointer;
}

.einst__status {
    grid-area: status;
    min-height: 1.2em;
    font-size: .85rem;
    color: var(--text-leise);
}

.einst__status.ist-fehler {
    color: #ffffff;
    font-weight: 500;
}

.einst__status.ist-fehler::before {
    content: '⚠ ';
    color: var(--gefahr);
}

/* --- Einstellungen: Reiter ------------------------------------------------ */

/* Dieselbe Pille wie die Zeitraum-Wahl, nur mit Links (eigene Seiten). */
.bereiche--reiter {
    margin: .25rem 0 .75rem;
}

.bereiche--reiter a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 .9rem;
    font-size: .9rem;
    color: var(--text-leise);
    text-decoration: none;
    border-radius: 999px;
    transition: color var(--dauer-3) var(--ease-out);
}

.bereiche--reiter a[aria-current="page"] {
    color: #0f2a44;
    background: #ffffff;
    text-shadow: none;
}

/* --- Zustand (#31) -------------------------------------------------------- */

.zustand h3 {
    font-size: .95rem;
    margin: 1.25rem 0 .4rem;
}

.zustand__ampel {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .25rem .6rem;
    margin: 0 0 1rem;
}

.zustand__ampel strong::before {
    content: '';
    display: inline-block;
    width: .7rem;
    height: .7rem;
    margin-right: .45rem;
    border-radius: 50%;
    background: var(--ampel, var(--text-leise));
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .2);
}

.zustand__ampel--gruen { --ampel: var(--temp-comfort); }
.zustand__ampel--gelb  { --ampel: var(--akzent); }
.zustand__ampel--rot   { --ampel: var(--gefahr); }

.zustand__band {
    margin: 0 0 1rem;
}

.zustand__band svg {
    display: block;
    width: 100%;
    height: 22px;
    border-radius: 6px;
    overflow: hidden;
}

.zustand__band figcaption {
    margin-top: .35rem;
    font-size: .8rem;
    color: var(--text-leise);
}

.zustand__achse {
    display: flex;
    justify-content: space-between;
}

.zustand__legende {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem .9rem;
    margin-top: .4rem;
}

.zustand__legende i {
    display: inline-block;
    width: .7rem;
    height: .7rem;
    margin-right: .3rem;
    border-radius: 3px;
    vertical-align: -1px;
}

/* Fuer SVG-Rechtecke (fill) und Legende (background) zugleich. */
.zustand__schlitz--ok     { fill: var(--temp-comfort); background: var(--temp-comfort); }
.zustand__schlitz--leer   { fill: var(--akzent); background: var(--akzent); }
.zustand__schlitz--fehler { fill: var(--gefahr); background: var(--gefahr); }
.zustand__schlitz--nichts { fill: rgba(0, 0, 0, .18); background: rgba(0, 0, 0, .18); }

/* Breite Tabelle scrollt fuer sich, nie die Seite. */
.zustand__tabelle {
    overflow-x: auto;
}

.zustand__tabelle table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
    font-variant-numeric: tabular-nums;
}

.zustand__tabelle th,
.zustand__tabelle td {
    padding: .35rem .4rem;
    text-align: right;
    white-space: nowrap;
    border-bottom: 1px solid var(--chart-gitter);
}

.zustand__tabelle th:first-child,
.zustand__tabelle thead th {
    font-weight: 500;
}

.zustand__tabelle th:first-child {
    text-align: left;
}

/* Sechs Spalten auf 390 px: enger statt seitlich scrollen. */
@media (max-width: 30rem) {
    .zustand__tabelle table {
        font-size: .82rem;
    }

    .zustand__tabelle th,
    .zustand__tabelle td {
        padding: .35rem .25rem;
    }
}

.zustand__tabelle .ist-warn {
    color: var(--akzent);
    font-weight: 600;
}

.zustand__liste {
    margin: 0;
    padding-left: 1.1rem;
    overflow-wrap: anywhere;
}

.zustand__liste li + li {
    margin-top: .3rem;
}

.zustand__batterien .ist-niedrig strong {
    color: var(--akzent);
}

.zustand__batterien .ist-leer strong {
    color: var(--temp-hot);
}

.zustand__batterien .ist-unbekannt strong {
    opacity: .6;
}

/* Haken im Zustand (#154): ein kleiner Kreis, abgehakt gefuellt. Die Zeile
   bleibt sichtbar, verliert aber ihre Warnfarbe. */
.quittung {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    margin-right: .35rem;
    padding: 0;
    vertical-align: -.3em;
    color: transparent;
    background: none;
    border: 1px solid var(--glas-rand);
    border-radius: 50%;
    cursor: pointer;
    transition: background var(--dauer-1) var(--ease-out), color var(--dauer-1) var(--ease-out);
}

.quittung:hover {
    color: rgba(255, 255, 255, .45);
}

.quittung[aria-pressed="true"] {
    color: var(--text);
    background: var(--glas-stark);
}

.quittung:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.quittung:disabled {
    cursor: progress;
}

.zustand__haken {
    width: 1%;
    text-align: center;
}

.zustand__haken .quittung {
    margin-right: 0;
}

.ist-quittiert .ist-warn,
.zustand__batterien .ist-quittiert strong {
    color: inherit;
    font-weight: inherit;
    opacity: .7;
}

/* --- Grundriss-Editor (#46) ----------------------------------------------- */

.ge__leiste {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    padding: .6rem;
    margin-bottom: 1rem;
}

.ge__gruppe {
    display: inline-flex;
    gap: .35rem;
}

.ge__knopf {
    min-height: 36px;
    padding: 0 .8rem;
    font-size: .9rem;
}

.ge__knopf[aria-pressed="true"] {
    color: #0f2a44;
    background: #ffffff;
    text-shadow: none;
}

.ge__knopf:disabled {
    opacity: .45;
    cursor: default;
}

.ge__status {
    margin-left: auto;
    font-size: .85rem;
    color: var(--text-leise);
}

.ge__status.ist-fehler {
    color: var(--gefahr);
}

.ge__raster {
    display: grid;
    gap: 1rem;
}

@media (min-width: 60rem) {
    .ge__raster {
        grid-template-columns: minmax(0, 1fr) 20rem;
        align-items: start;
    }
}

.ge__buehne {
    position: relative;
    overflow: hidden;
    padding: 0;
}

/*
  touch-action: none — sonst scrollt der Browser die Seite, statt dass der
  Finger eine Flaeche zieht. Die Seite scrollt man ausserhalb der Buehne.
*/
.ge__svg {
    display: block;
    width: 100%;
    height: min(68vh, 640px);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    cursor: grab;
    outline: none;
}

.ge__svg:focus-visible {
    box-shadow: inset 0 0 0 2px #ffffff;
}

.ge__svg.ist-zeichnen {
    cursor: crosshair;
}

.ge__hinweis {
    position: absolute;
    left: .75rem;
    bottom: .75rem;
    margin: 0;
    padding: .3rem .7rem;
    font-size: .85rem;
    font-variant-numeric: tabular-nums;
    border-radius: 999px;
    background: rgba(15, 42, 68, .7);
    pointer-events: none;
}

.ge__linie {
    fill: none;
    stroke: rgba(255, 255, 255, .07);
    stroke-width: 1;
}

.ge__linie--halb { stroke: rgba(255, 255, 255, .1); }
.ge__linie--m    { stroke: rgba(255, 255, 255, .18); }

.ge__raum {
    fill: rgba(255, 255, 255, .16);
    stroke: rgba(255, 255, 255, .9);
    stroke-width: 2;
    pointer-events: none;
}

.ge__raum.ist-unbenannt {
    fill: rgba(255, 255, 255, .08);
    stroke-dasharray: 6 4;
}

.ge__name {
    fill: #ffffff;
    font-family: var(--schrift);
    font-weight: 600;
    pointer-events: none;
}

.ge__qm {
    font-weight: 400;
    fill-opacity: .75;
}

.ge__rechteck {
    fill: transparent;
    stroke: rgba(255, 255, 255, .22);
    stroke-width: 1;
    stroke-dasharray: 3 4;
    cursor: move;
}

.ge__rechteck.ist-gewaehlt {
    fill: rgba(255, 209, 102, .14);
    stroke: var(--akzent);
    stroke-width: 2;
    stroke-dasharray: none;
}

.ge__vorschau {
    fill: rgba(255, 209, 102, .18);
    stroke: var(--akzent);
    stroke-width: 2;
    stroke-dasharray: 6 4;
    pointer-events: none;
}

.ge__griff { cursor: pointer; }
.ge__griff--n, .ge__griff--s { cursor: ns-resize; }
.ge__griff--o, .ge__griff--w { cursor: ew-resize; }
.ge__griff--nw, .ge__griff--so { cursor: nwse-resize; }
.ge__griff--no, .ge__griff--sw { cursor: nesw-resize; }

.ge__griff-ziel,
.ge__punkt-ziel {
    fill: transparent;
}

.ge__griff-punkt {
    fill: #ffffff;
    stroke: var(--akzent);
    stroke-width: 2;
}

.ge__punkt {
    cursor: move;
}

/* Einrichtung (#86): Linien wie ein Bauplan — die Raeume bleiben vorn. */
.ge__element {
    cursor: move;
}

.ge__element-ziel {
    fill: transparent;
}

.ge__element-linie {
    fill: none;
    stroke: rgba(255, 255, 255, .7);
    stroke-width: 1.5;
    stroke-linejoin: round;
}

.ge__element--fenster .ge__element-linie {
    stroke: #cfe8ff;
}

.ge__element.ist-gewaehlt .ge__element-ziel {
    fill: rgba(255, 209, 102, .14);
}

.ge__element.ist-gewaehlt .ge__element-linie {
    stroke: var(--akzent);
    stroke-width: 2.5;
}

.ge__knoepfe {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.ge__knoepfe [hidden],
.ge__feld[hidden] {
    display: none;
}

.ge__punkt-kreis {
    fill: var(--status-info);
    stroke: #0f2a44;
    stroke-width: 1.5;
}

.ge__punkt--temperature .ge__punkt-kreis   { fill: var(--temp-warm); }
.ge__punkt--humidity .ge__punkt-kreis      { fill: var(--hum-ideal); }
.ge__punkt--carbon_dioxide .ge__punkt-kreis { fill: var(--hum-wet); }
.ge__punkt--light .ge__punkt-kreis         { fill: #fff6d6; stroke: var(--akzent); stroke-width: 3; }
.ge__punkt--kontakt .ge__punkt-kreis       { fill: #cfe8ff; }

.ge__punkt text {
    fill: #0f2a44;
    font-family: var(--schrift);
    font-weight: 700;
    pointer-events: none;
}

.ge__punkt.ist-gewaehlt .ge__punkt-kreis {
    stroke: #ffffff;
    stroke-width: 3;
}

.ge__seite {
    display: grid;
    gap: 1rem;
}

.ge__seite .einst__raum {
    margin: 0;
}

.ge__feld {
    display: grid;
    gap: .25rem;
    margin-bottom: .6rem;
    font-size: .85rem;
    color: var(--text-leise);
}

.ge__feld input {
    font: inherit;
    font-size: 1rem;
    color: #0f2a44;
    background: rgba(255, 255, 255, .92);
    border: 1px solid var(--glas-rand);
    border-radius: var(--radius-klein);
    min-height: 40px;
    padding: 0 .7rem;
}

.ge__masse {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .6rem;
}

.ge__masse[hidden] {
    display: none;
}

.ge__klein {
    font-size: .8rem;
}

.ge__dinge {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin: .5rem 0 0;
    padding: 0;
    list-style: none;
}

/* Ziehbar per Finger: kein Browser-Scrollen auf dem Knopf selbst. */
.ge__ding {
    display: inline-flex;
    align-items: baseline;
    gap: .35rem;
    min-height: 36px;
    /* Das Polster fuellt die 36 px ganz aus: bleibt unter der Mindesthoehe
       Luft, setzt die Grundlinien-Ausrichtung Text und Beschriftung oben an,
       und der mittig sitzende Punkt haengt darunter (auf iOS gut sichtbar). */
    padding: .55rem .75rem .55rem .55rem;
    font: 500 .85rem/1.2 var(--schrift);
    color: #ffffff;
    background: rgba(15, 42, 68, .2);
    border: 1px solid var(--glas-rand);
    border-radius: 999px;
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.ge__ding::before {
    content: '';
    align-self: center;
    width: .7rem;
    height: .7rem;
    border-radius: 50%;
    background: var(--status-info);
}

.ge__ding--temperature::before    { background: var(--temp-warm); }
.ge__ding--humidity::before       { background: var(--hum-ideal); }
.ge__ding--carbon_dioxide::before { background: var(--hum-wet); }
.ge__ding--light::before          { background: #fff6d6; box-shadow: 0 0 0 2px var(--akzent); }
.ge__ding--kontakt::before        { background: #cfe8ff; border-radius: 2px; }
.ge__ding--einrichtung::before   { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; border-radius: 2px; }

.ge__ding small {
    font-size: .75rem;
    color: var(--text-leise);
}

.ge__ding[aria-pressed="true"] {
    background: #ffffff;
    color: #0f2a44;
}

.ge__ding[aria-pressed="true"] small {
    color: #0f2a44;
}

.ge__geist {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
    pointer-events: none;
    background: #ffffff;
    color: #0f2a44;
    box-shadow: var(--schatten);
}

/* --- Grundriss-Ansicht (#46) ---------------------------------------------- */

.gr__kopf {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin: .5rem 0 1rem;
}

.gr__kopf h1 {
    margin: 0;
}

.gr__alt {
    margin: 1rem 0 0;
}

.gr__schalter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}

.gr__schalter .pill[hidden] {
    display: none;
}

.gr__schalter .pill[aria-pressed="false"] {
    opacity: .65;
}

/* Objekte (#86): offenes Auge = sichtbar, durchgestrichen = ausgeblendet. */
.gr__objekte {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

.gr__objekte[aria-pressed="true"] .ico--aus,
.gr__objekte[aria-pressed="false"] .ico--an {
    display: none;
}

/* Einrichtung (#86): dezent, die Farbe des Raums bleibt das Wichtigste. */
.gr__einrichtung {
    pointer-events: none;
}

.gr__element {
    fill: none;
    stroke: rgba(255, 255, 255, .55);
    stroke-width: 1.25;
    stroke-linejoin: round;
}

.gr__element--fenster {
    stroke: rgba(230, 244, 255, .85);
}

.gr__buehne {
    position: relative;
    padding: .75rem;
}

.gr__svg {
    display: block;
    width: 100%;
    max-height: 70vh;
}

.gr__leer {
    padding: 2rem 1rem;
    text-align: center;
}

.gr__raum {
    fill: rgba(255, 255, 255, .14);
    fill-opacity: .82;
    stroke: rgba(255, 255, 255, .9);
    stroke-width: 2;
    cursor: pointer;
    transition: fill var(--dauer-2) linear;
}

/* Verlauf im Raum (#109): gleiche Deckkraft wie die flaechige Raumfarbe. */
.gr__verlauf {
    opacity: .82;
    pointer-events: none;
}

.gr__spanne {
    font-weight: 500;
    opacity: .85;
}

.gr__raum.ist-ohne {
    fill: rgba(255, 255, 255, .08);
    stroke-dasharray: 6 4;
}

.gr__raum.ist-gewaehlt {
    stroke: #ffffff;
    stroke-width: 4;
}

.gr__name {
    fill: #0f2a44;
    font-family: var(--schrift);
    font-weight: 600;
    pointer-events: none;
    /* Heller Rand, damit Sensorpunkte darunter die Schrift nicht zerschneiden. */
    paint-order: stroke;
    stroke: rgba(255, 255, 255, .55);
    stroke-width: 3px;
    stroke-linejoin: round;
}

.gr__wert {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.gr__name.ist-hell {
    fill: #ffffff;
    stroke: rgba(15, 42, 68, .45);
}

.gr__ziel {
    fill: transparent;
}

.gr__sensor {
    cursor: pointer;
}

.gr__sensor circle:first-child {
    fill: #ffffff;
    stroke: #0f2a44;
    stroke-width: 1.5;
}

.gr__sensor.ist-gewaehlt circle:first-child {
    stroke-width: 3;
}

/* Staubsauger-Station (#89). */
.gr__sauger {
    cursor: pointer;
}

.gr__sauger-kern {
    fill: rgba(255, 255, 255, .35);
    stroke: rgba(15, 42, 68, .55);
    stroke-width: 1.5;
}

.gr__sauger.ist-an .gr__sauger-kern {
    fill: #9fd8ff;
    stroke: #ffffff;
}

.gr__sauger.ist-unbekannt .gr__sauger-kern {
    stroke-dasharray: 3 2;
}

.ge__punkt--vacuum .ge__punkt-kreis { fill: #d6e4ff; }
.ge__ding--vacuum::before          { background: #d6e4ff; }

.medien--sauger .ico,
.medien--geraet .ico {
    color: #9fd8ff;
}

/* Waschmaschine (#135): Restzeit leiser als der Rest. */
.geraet__rest {
    opacity: .75;
}

.ge__punkt--appliance .ge__punkt-kreis { fill: #d6e4ff; }
.ge__ding--appliance::before          { background: #d6e4ff; }

/* Fenster-/Tuerkontakt (#19): zu dezent, offen mit Fluegel und Akzent. */
.gr__kontakt {
    cursor: pointer;
}

.gr__kontakt-kern {
    fill: rgba(255, 255, 255, .35);
    stroke: rgba(15, 42, 68, .55);
    stroke-width: 1.5;
}

.gr__kontakt-fluegel {
    fill: rgba(159, 216, 255, .55);
    stroke: #ffffff;
    stroke-width: 1.5;
    stroke-linejoin: round;
}

.gr__kontakt.ist-offen .gr__kontakt-kern {
    fill: #9fd8ff;
    stroke: #ffffff;
}

.gr__kontakt.ist-unbekannt .gr__kontakt-kern {
    fill: rgba(255, 255, 255, .15);
    stroke-dasharray: 3 2;
}

.gr__lampe {
    cursor: pointer;
}

.gr__lampe-kern {
    fill: rgba(15, 42, 68, .35);
    stroke: rgba(255, 255, 255, .8);
    stroke-width: 1.5;
}

.gr__lampe.ist-an .gr__lampe-kern {
    fill: #fff6d6;
    stroke: var(--akzent);
    stroke-width: 2;
}

.gr__lampe.ist-unbekannt .gr__lampe-kern {
    stroke-dasharray: 2 2;
}

.gr__legende {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-top: .6rem;
    font-size: .8rem;
    color: var(--text-leise);
}

.gr__legende[hidden] {
    display: none;
}

.gr__band {
    flex: 1;
    height: 8px;
    border-radius: 999px;
}

.gr__band--temperatur {
    background: linear-gradient(90deg, var(--temp-cold) 0%, var(--temp-cool) 30%, var(--temp-comfort) 50%, var(--temp-warm) 75%, var(--temp-hot) 100%);
}

.gr__band--feuchte {
    background: linear-gradient(90deg, var(--hum-dry) 0%, var(--hum-ideal) 40%, var(--hum-humid) 70%, var(--hum-wet) 100%);
}

.gr__zeit {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 1rem 0;
    padding: .6rem .8rem;
}

.gr__spielen {
    flex: none;
    min-width: 7.5rem;
    justify-content: center;
}

.gr__regler {
    flex: 1;
    min-width: 0;
    accent-color: #ffffff;
}

.gr__zeitpunkt {
    flex: none;
    min-width: 7.5rem;
    text-align: right;
    font-size: .9rem;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 30rem) {
    .gr__zeit {
        flex-wrap: wrap;
    }

    .gr__regler {
        order: 3;
        flex-basis: 100%;
    }
}

.gr__karte h2 {
    margin-bottom: .2rem;
}

.gr__karte-wert {
    margin: 0 0 .5rem;
    font-size: 1.15rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.gr__linie {
    display: block;
    width: 100%;
    height: 48px;
}

.gr__linie-pfad {
    fill: none;
    stroke: #ffffff;
    stroke-width: 2;
}

.gr__linie-jetzt {
    stroke: var(--akzent);
    stroke-width: 2;
}

.gr__karte-unter {
    margin: .4rem 0 0;
    font-size: .8rem;
    overflow-wrap: anywhere;
}

/* --- Frische je Sensor (#8) ----------------------------------------------- */

.raum__zeile {
    display: flex;
    min-width: 0;
    overflow: hidden;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.raum__zeile .raum__haupt {
    margin-bottom: 0;
}

.raum__spur {
    /* Weicht einer breiten Zahl (−243,0) bis auf nichts. */
    flex: 0 1 80px;
    min-width: 0;
    height: 28px;
}

/* Grosse Kachel (#117): das Diagramm zeigt den Verlauf schon — die
   Sparkline macht Platz fuer Min/Ø/Max des gewaehlten Zeitraums. */
.raum.ist-gross .raum__spur,
.raum:not(.ist-gross) .raum__kennzahlen {
    display: none;
}

.raum__kennzahlen {
    display: grid;
    grid-template-columns: repeat(3, auto);
    column-gap: 1rem;
    margin: 0;
    text-align: right;
}

.raum__kennzahlen[hidden] {
    display: none;
}

.raum__kennzahlen dt {
    font-size: .75rem;
    color: var(--text-leise);
}

.raum__kennzahlen dd {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 26rem) {
    .raum__kennzahlen {
        column-gap: .6rem;
    }

    .raum__kennzahlen dd {
        font-size: .9rem;
    }
}

.raum__kennzahlen-zeit {
    grid-column: 1 / -1;
    margin: .15rem 0 0;
    font-size: .7rem;
    color: var(--text-leise);
}

.raum__spur path {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: .75;
}

.raum__frische {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin: .15rem 0 .4rem;
    font-size: .8rem;
    color: var(--text-leise);
}

.raum__punkt {
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--temp-comfort);
}

.raum__frische--warn .raum__punkt {
    background: var(--akzent);
}

.raum__frische--offline .raum__punkt {
    background: transparent;
    box-shadow: inset 0 0 0 1.5px var(--text-leise);
}

/* Veraltet: letzter Stand bleibt lesbar, tritt aber zurueck. */
.ist-veraltet {
    opacity: .5;
}

.raum__haupt.ist-veraltet + .raum__spur {
    opacity: .4;
}

/* Unplausibel: Wert sichtbar, aber als fraglich markiert. */
.raum__haupt.ist-unplausibel,
.wert.ist-unplausibel .wert__zahl {
    color: var(--gefahr);
    text-decoration: line-through;
    text-decoration-thickness: 1px;
}

/* --- Musik und Fernsehen (#84) ------------------------------------------- */

.medien {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    color: var(--text);
    white-space: nowrap;
}

.medien .ico {
    flex: none;
    color: var(--akzent);
}

/* Vorschlaege (#32): unter den Kopfkarten, ueber die ganze Breite. */
.vorschlaege {
    grid-column: 1 / -1;
    margin: 0;
    padding: .6rem .9rem;
    list-style: none;
    display: grid;
    gap: .35rem;
}

.vorschlaege__eintrag {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    line-height: 1.35;
}

.vorschlaege__eintrag .ico {
    flex: none;
    margin-top: .1rem;
    color: #9fd8ff;
}

.vorschlaege__eintrag.ist-dringend .ico {
    color: var(--akzent);
}

.vorschlaege__eintrag.ist-dringend .vorschlaege__text > span:first-child,
.vorschlaege__eintrag.ist-dringend > span {
    font-weight: 600;
}

/* Erklaerung hinter dem Info-Zeichen: die ganze Zeile ist der Schalter. */
.vorschlaege__details {
    flex: 1;
    min-width: 0;
}

.vorschlaege__text {
    display: flex;
    align-items: flex-start;
    gap: .45rem;
    list-style: none;
    cursor: pointer;
}

.vorschlaege__text::-webkit-details-marker {
    display: none;
}

.vorschlaege__text > span:first-child {
    flex: 1;
    min-width: 0;
}

.vorschlaege__info {
    flex: none;
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    margin-top: .05rem;
    /* Als SVG statt Schriftzeichen: ein "i" der Schrift sitzt je nach
       Metrik nie ganz mittig im Kreis (#150). */
    color: var(--text);
    border: 1px solid var(--glas-rand);
    border-radius: 50%;
    opacity: .75;
    transition: background var(--dauer-1) var(--ease-out), opacity var(--dauer-1) var(--ease-out);
}

.vorschlaege__details[open] .vorschlaege__info {
    background: var(--glas-stark);
    opacity: 1;
}

.vorschlaege__text:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
    border-radius: 4px;
}

.vorschlaege__erklaerung {
    margin: .35rem 1.7rem .15rem 0;
    font-size: .85rem;
    line-height: 1.4;
    color: var(--text-leise);
}

/* Batterie schwach/leer auf der Kachel (#63). */
.batterie {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    color: var(--text);
    white-space: nowrap;
}

.batterie.ist-niedrig .ico {
    color: var(--akzent);
}

.batterie.ist-leer .ico,
.batterie.ist-leer {
    color: var(--temp-hot);
}

/* Sollwert der Thermostate auf der Kachel (#12). */
.soll {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    color: var(--text);
    white-space: nowrap;
}

.soll .ico {
    flex: none;
    color: #ffb38a;
}

.soll.ist-aus {
    opacity: .7;
}

.soll.ist-aus .ico {
    color: currentColor;
}

/* Fensterkontakt auf der Kachel (#19): nur sichtbar, wenn offen oder unbekannt. */
.kontakt {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    color: var(--text);
    white-space: nowrap;
}

.kontakt .ico {
    flex: none;
    color: #9fd8ff;
}

.kontakt__seit {
    opacity: .75;
}

.kontakt.ist-unbekannt {
    opacity: .6;
}

.kontakt.ist-unbekannt .ico {
    color: currentColor;
}

.innen__medien {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .9rem;
    margin: .75rem 0 0;
    font-size: .85rem;
}

/* Titel fuer Admins: beim Ueberfahren bzw. Antippen (Fokus) als Blase. */
.medien[data-titel] {
    cursor: help;
    outline: none;
    border-radius: 6px;
}

.medien[data-titel]:focus-visible {
    box-shadow: 0 0 0 2px var(--glas-rand);
}

.medien[data-titel]:hover::after,
.medien[data-titel]:focus::after {
    content: attr(data-titel);
    position: absolute;
    z-index: 20;
    left: 0;
    bottom: calc(100% + 6px);
    width: max-content;
    max-width: min(18rem, 80vw);
    padding: .4rem .6rem;
    font-size: .8rem;
    line-height: 1.3;
    white-space: normal;
    color: #ffffff;
    border-radius: 8px;
    background: rgba(15, 42, 68, .85);
    box-shadow: var(--schatten);
}

@media (prefers-reduced-motion: no-preference) {
    .medien .ico {
        animation: medien-puls 2.4s ease-in-out infinite;
    }
}

@keyframes medien-puls {
    0%, 100% { opacity: 1; }
    50% { opacity: .45; }
}

/* Grundriss: Lautsprecher und Fernseher */
.ge__punkt--media .ge__punkt-kreis,
.ge__ding--media::before {
    fill: #e9d8ff;
    background: #e9d8ff;
}

.gr__medium {
    cursor: pointer;
}

.gr__medium-kern {
    fill: rgba(15, 42, 68, .35);
    stroke: rgba(255, 255, 255, .8);
    stroke-width: 1.5;
}

.gr__medium.ist-an .gr__medium-kern {
    fill: #e9d8ff;
    stroke: #b388ff;
    stroke-width: 2;
}

.gr__medium-welle {
    fill: none;
    stroke: #b388ff;
    stroke-width: 2;
    opacity: 0;
}

@media (prefers-reduced-motion: no-preference) {
    .gr__medium.ist-an .gr__medium-welle {
        animation: gr-welle 1.8s ease-out infinite;
        transform-box: fill-box;
        transform-origin: center;
    }
    .gr__medium.ist-an .gr__medium-welle--2 {
        animation-delay: .9s;
    }
}

@keyframes gr-welle {
    from { opacity: .8; transform: scale(.6); }
    to   { opacity: 0;  transform: scale(1.6); }
}

/* Frische-Zeile mit "spielt": als Ganzes umbrechen, nie mitten in "gerade eben". */
.raum__frische {
    flex-wrap: wrap;
    row-gap: .1rem;
}

.raum__frische > span:not(.medien) {
    white-space: nowrap;
}

.raum__frische .medien {
    margin-left: .35rem;
}

/* Ablage im Grundriss-Editor: gruppiert nach Art */
/* "Nicht im Grundriss" (#124): kleiner Knopf neben dem Chip. */
.ge__dinge li {
    display: flex;
    align-items: center;
    gap: .2rem;
}

.ge__ausblenden {
    flex: none;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-leise);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}

.ge__ausblenden:hover,
.ge__ausblenden:focus-visible {
    background: rgba(255, 255, 255, .15);
    color: var(--text);
}

.ge__ausgeblendet {
    margin-top: .75rem;
}

.ge__ausgeblendet summary {
    cursor: pointer;
    font-size: .8rem;
    color: var(--text-leise);
}

.ge__ausgeblendet .ge__dinge {
    margin-top: .4rem;
    opacity: .75;
}

.ge__ablage-titel {
    margin: .9rem 0 .1rem;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-leise);
}

.ge__ablage-titel:first-child {
    margin-top: .4rem;
}

.ge__ablage-gruppen .ge__dinge {
    margin-top: .3rem;
}

/* --- Raum-Icons und Etage aus HA (#9) ------------------------------------- */

.raum__name {
    display: flex;
    align-items: center;
    gap: .4rem;
}

.raum__name-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.raum-icon {
    flex: none;
}

.raum__etage {
    flex: none;
    font-size: .75rem;
    font-weight: 400;
    color: var(--text-leise);
    opacity: .8;
}

.raum__etage::before {
    content: '·';
    margin-right: .35rem;
}

.einst__raumname {
    display: flex;
    align-items: center;
    gap: .45rem;
}

.ge__ding-icon {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
    vertical-align: -.15em;
}
