/* ROTHEN DB — linke Seite: Sonos | Hue. Läuft in der Dashboard-Bühne (<TabletBuehne Klasse="hm">), Masse also
   in Dashboard-Einheiten (1920 breit) wie familien-dashboard.css; Farben über --fd-acc, --fd-acc-soft, --fd-line, --fd-muted. */

.hm-raster { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.hm-karte { display: flex; flex-direction: column; gap: 16px; min-height: 0; padding: 18px 22px; overflow: hidden; cursor: default; }
.hm-kopf { flex-wrap: wrap; margin-bottom: 0; }
.fd-k-ico.musik { background: var(--fd-acc-soft); color: var(--fd-acc); font-size: 20px; font-weight: 800; }
.fd-k-ico.licht { background: #FFF1DC; color: #B45309; }
.hm-leer { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; color: var(--fd-muted); font-size: 18px; }
.hm-leer p { margin: 0; }
.hm-hinweis { color: var(--fd-muted); font-size: 15px; }
.hm-fehler { padding: 10px 14px; border-radius: 14px; background: #FDE8E4; color: #8F1D12; font-size: 16px; font-weight: 600; }
.hm-abschnitt { font-size: 15px; font-weight: 800; color: var(--fd-muted); text-transform: uppercase; letter-spacing: .05em; }

/* Knöpfe und Chips — wie .fd-btn / Dashboard-Filter */
.fd .hm-btn { height: 58px; padding: 0 26px; border-radius: 18px; border: 0; background: #EDF0F3; font-size: 19px; font-weight: 700; cursor: pointer; }
.fd .hm-btn:disabled { opacity: .45; }
.fd .hm-primaer { background: var(--fd-acc); color: #fff; font-weight: 800; }
.fd .hm-btn-aus { height: 48px; padding: 0 20px; border-radius: 14px; font-size: 17px; }
.hm-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fd .hm-chip { display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 18px; border-radius: 999px; border: 2px solid transparent; background: #F3F5F7;
               font-size: 17px; font-weight: 700; cursor: pointer; }
.fd .hm-chip.an { border-color: var(--fd-acc); background: var(--fd-acc-soft); color: var(--fd-acc); }
.hm-spielt { width: 10px; height: 10px; border-radius: 50%; background: #15803D; box-shadow: 0 0 0 4px rgba(21,128,61,.18); }
.fd .hm-rund { width: 72px; height: 72px; border-radius: 50%; border: 0; background: #F3F5F7; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.fd .hm-rund.hm-gross { width: 104px; height: 104px; background: var(--fd-acc); color: #fff; }
.fd .hm-rund.hm-klein { width: 56px; height: 56px; }
.hm input[type=range] { accent-color: var(--fd-acc); height: 44px; touch-action: none; }   /* Ziehen am Regler wischt nicht die Seite */

/* Sonos */
.hm-jetzt { display: flex; align-items: center; gap: 22px; padding: 14px; border-radius: 18px; background: #F7F8FA; }
.hm-cover { flex: none; width: 168px; height: 168px; border-radius: 16px; background: var(--fd-acc-soft); color: var(--fd-acc); overflow: hidden;
            display: flex; align-items: center; justify-content: center; font-size: 64px; }
.hm-cover img { width: 100%; height: 100%; object-fit: cover; }
.hm-jetzt-text { min-width: 0; }
.hm-song { font-size: 30px; font-weight: 800; line-height: 1.15; letter-spacing: -.01em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hm-artist { font-size: 19px; color: var(--fd-muted); margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-status { display: inline-block; margin-top: 10px; height: 26px; line-height: 26px; padding: 0 10px; border-radius: 13px; background: var(--fd-acc-soft); color: var(--fd-acc); font-size: 13px; font-weight: 700; }
.hm-transport { display: flex; align-items: center; justify-content: center; gap: 30px; }
.hm-lautstaerke { display: flex; align-items: center; gap: 14px; }
.hm-lautstaerke input { flex: 1; }
.hm-wert { width: 44px; text-align: right; font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.hm-favoriten { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; align-content: start; }
.fd .hm-fav { display: flex; flex-direction: column; gap: 8px; padding: 8px; border: 0; border-radius: 16px; background: #F7F8FA; cursor: pointer; text-align: left; }
.hm-fav-bild { aspect-ratio: 1; border-radius: 12px; background: var(--fd-acc-soft); color: var(--fd-acc); overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 36px; }
.hm-fav-bild img { width: 100%; height: 100%; object-fit: cover; }
.hm-fav-name { font-size: 16px; font-weight: 700; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Hue */
.hm-raeume { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; align-content: start; }
.hm-raum { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 14px 18px 8px; border-radius: 18px; background: #F7F8FA; border: 2px solid transparent; }
.hm-raum.an { background: #FFF6E0; }
.hm-raum.gewaehlt { border-color: var(--fd-acc); }
.hm-raum input[type=range] { grid-column: 1 / -1; width: 100%; accent-color: #D97706; }
.fd .hm-raum-kopf { min-width: 0; border: 0; background: none; padding: 0; text-align: left; cursor: pointer; }
.hm-raum-name { display: block; font-size: 21px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-raum-info { display: block; font-size: 15px; color: var(--fd-muted); font-weight: 600; }
.fd .hm-schalter { position: relative; width: 76px; height: 44px; border-radius: 999px; border: 0; background: #D5DBE1; cursor: pointer; align-self: center; }
.hm-schalter span { position: absolute; top: 4px; left: 4px; width: 36px; height: 36px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: left .15s; }
.fd .hm-schalter.an { background: #D97706; }
.hm-schalter.an span { left: 36px; }
.hm-sensoren { display: flex; flex-wrap: wrap; gap: 8px; font-size: 15px; color: var(--fd-muted); }
.hm-sensor { padding: 8px 12px; border-radius: 12px; background: #F7F8FA; }
.hm-sensor b { color: #15202B; margin-right: 4px; }
.hm-sensor.bewegung { background: var(--fd-acc-soft); color: var(--fd-acc); }
.hm-koppeln .hm-btn { min-width: 340px; }
.hm .spinner { width: 28px; height: 28px; }

/* Schlaftimer (Sonos) */
.hm-schlaf { display: flex; align-items: center; gap: 10px; }
.hm-schlaf-l { font-size: 15px; font-weight: 800; color: var(--fd-muted); text-transform: uppercase; letter-spacing: .05em; }
.hm-schlaf-w { font-size: 18px; font-weight: 800; margin-right: auto; }

/* Lichtstimmungen (Hue-Hauptbedienung) */
.hm-stimmungen { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.fd .hm-stimmung { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 2px 14px; align-items: center; min-height: 104px;
                   padding: 14px 18px; border: 2px solid transparent; border-radius: 20px; background: #F7F8FA; text-align: left; cursor: pointer; }
.hm-st-icon { grid-row: 1 / span 2; width: 58px; height: 58px; border-radius: 16px; background: #EDF0F3; color: var(--fd-muted); display: flex; align-items: center; justify-content: center; }
.hm-st-name { font-size: 24px; font-weight: 800; line-height: 1.1; }
.hm-st-info { font-size: 15px; font-weight: 600; color: var(--fd-muted); }
.fd .hm-stimmung.an { background: #FFF6E0; border-color: #F2C46D; }
.hm-stimmung.an .hm-st-icon { background: #D97706; color: #fff; }
.hm-stimmung.an .hm-st-info { color: #8A3F06; }
.hm-st-aus .hm-st-icon { background: #E6E9F2; color: #3A4753; }
.fd .hm-erweitert-knopf { display: flex; align-items: center; justify-content: space-between; height: 52px; padding: 0 16px; border: 1px solid var(--fd-line);
                          border-radius: 14px; background: #fff; font-size: 17px; font-weight: 700; color: var(--fd-muted); cursor: pointer; }
.hm-erweitert-knopf .chev { display: inline-flex; transition: transform .15s; }
.hm-erweitert-knopf .chev.offen { transform: rotate(90deg); }

/* Alle Räume: Schlaftimer, Tastensperre */
.hm-alle { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hm-alle .hm-schlaf-l { margin-right: auto; }
.fd .hm-sperre.an { border-color: #B42318; background: #FDE8E4; color: #8F1D12; }

/* Licht-Kacheln als Regler: Füllung = Helligkeit (--hell), waagrecht wischen ändert sie */
.hm-stimmung, .hm-raum { position: relative; touch-action: pan-y; overflow: hidden; }
.fd .hm-stimmung.an, .hm-raum.an { background: linear-gradient(90deg, #FDE7B4 var(--hell, 0%), #FFF6E0 var(--hell, 0%)); }
.hm-stimmung.zieht, .hm-raum.zieht { background: linear-gradient(90deg, #F8C76A var(--hell, 0%), #FFF6E0 var(--hell, 0%)) !important; border-color: #D97706; }
.hm-stimmung.zieht::after, .hm-raum.zieht::after { content: attr(data-zieht) " %"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
                                                    font-size: 34px; font-weight: 800; color: #8A3F06; pointer-events: none; }
.hm-raum { grid-template-rows: auto; padding-bottom: 14px; }
.hm-gesten { font-size: 14px; }

/* Feinregler und Editor: über allem in der Bühne */
.hm-ebene { z-index: 20; }
.fd-dialog.hm-fein { width: 760px; top: 160px; display: flex; flex-direction: column; gap: 20px; }
.hm-fein-hell { display: flex; align-items: center; gap: 18px; }
.hm-fein-hell input { flex: 1; accent-color: #D97706; height: 56px; }
.hm-fein-hell b { font-size: 30px; font-weight: 800; min-width: 96px; text-align: right; }
.fd-dialog.hm-editor { width: 1180px; top: 30px; max-height: calc(100% - 60px); overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }
.hm-ed-liste { display: flex; flex-direction: column; gap: 10px; }
.hm-ed-zeile { display: flex; align-items: center; gap: 10px; }
.fd .hm-ed-name { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 18px; border: 2px solid #DDE2E7; border-radius: 16px; background: #fff; text-align: left; cursor: pointer; }
.hm-ed-name b { font-size: 22px; font-weight: 800; }
.hm-ed-name span { font-size: 15px; color: var(--fd-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.fd .hm-ed-mini { width: 54px; height: 54px; flex: none; border: 0; border-radius: 14px; background: #EDF0F3; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.fd .hm-ed-mini:disabled { opacity: .35; }
.fd .hm-ed-mini.rot { background: #FDE8E4; color: #B42318; }
.hm-ed-schritte { display: flex; flex-direction: column; gap: 12px; }
.hm-ed-schritt { display: grid; grid-template-columns: 300px auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px; border-radius: 16px; background: #F7F8FA; }
.hm-ed-select { height: 54px; padding: 0 12px; border-radius: 14px; border: 2px solid #C9D1D9; background: #fff; font: inherit; font-size: 18px; min-width: 0; }
.hm-ed-hell { display: flex; align-items: center; gap: 12px; }
.hm-ed-hell input { flex: 1; accent-color: #D97706; }
.hm-ed-hell b { font-size: 18px; min-width: 60px; text-align: right; }
.fd .hm-ed-plus { align-self: flex-start; }

/* Einstellungen ROTHEN DB */
.fd .hm-zahnrad { width: 64px; height: 64px; border: 0; border-radius: 18px; background: #fff; color: var(--fd-muted); display: flex; align-items: center; justify-content: center;
                  cursor: pointer; box-shadow: 0 1px 2px rgba(21,32,43,.06), 0 0 0 1px rgba(21,32,43,.05); }
.fd-dialog.hm-einst { width: 1180px; top: 30px; max-height: calc(100% - 60px); overflow-y: auto; display: flex; flex-direction: column; gap: 20px; }
.hm-einst-raster { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 36px; }
.hm-einst-breit { grid-column: 1 / -1; }
.hm-einst-zeit { display: flex; align-items: center; gap: 14px; font-size: 18px; font-weight: 700; color: var(--fd-muted); }
.hm-einst-info { font-size: 15px; color: var(--fd-muted); padding-top: 6px; border-top: 1px solid var(--fd-line); }

/* Wecker */
.fd-dialog.hm-wecker { width: 1120px; top: 30px; max-height: calc(100% - 60px); overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }
.hm-wk-liste { display: flex; flex-direction: column; gap: 10px; }
.hm-wk { display: flex; align-items: center; gap: 16px; padding: 10px 18px; border-radius: 18px; background: #F7F8FA; }
.hm-wk.an { background: var(--fd-acc-soft); }
.fd .hm-wk-text { flex: 1; min-width: 0; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 0 18px; align-items: baseline; border: 0; background: none; padding: 4px 0; text-align: left; cursor: pointer; }
.hm-wk-text b { grid-row: 1 / span 2; font-size: 44px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hm-wk-tage { font-size: 20px; font-weight: 800; }
.hm-wk-info { font-size: 15px; color: var(--fd-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fd-eingabe.hm-wk-zeit { width: 220px; }
.hm-wk-trenner { width: 1px; align-self: stretch; background: var(--fd-line); margin: 0 6px; }
.fd .hm-wk-loeschen { background: #FDE8E4; color: #B42318; }

/* Licht: Bearbeiten oben rechts, „Alles aus“ abgesetzt, Kinderzimmer */
.fd .hm-k-knopf { width: 52px; height: 52px; border: 0; border-radius: 14px; background: #F3F5F7; color: var(--fd-muted); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.fd .hm-alles-aus { display: flex; align-items: center; gap: 14px; height: 68px; padding: 0 22px; border: 0; border-radius: 18px; background: #2B3640; color: #fff;
                    font-size: 22px; font-weight: 800; cursor: pointer; margin-top: 4px; }
.hm-alles-aus small { margin-left: auto; font-size: 15px; font-weight: 600; opacity: .7; }
.hm-kinder { display: flex; flex-direction: column; gap: 12px; padding-top: 4px; border-top: 1px solid var(--fd-line); }
.fd .hm-kinder-wecken { display: flex; align-items: center; gap: 14px; height: 76px; padding: 0 22px; border: 2px solid #F2C46D; border-radius: 18px; background: #FFF1DC; color: #8A3F06;
                        font-size: 24px; font-weight: 800; cursor: pointer; }
.hm-kinder-wecken small { margin-left: auto; font-size: 15px; font-weight: 600; }
.hm-raeume.hm-raeume-kinder { flex: none; overflow: visible; }

