/* Entwurf v2 "Zuhause zuerst – Rollen-Startseite": Ergaenzungen und Ueberschreibungen (laedt als letzte Datei).
   Aufbau: 1 Ansicht Einfach/Experte | 2 Rahmen (Kopfzeile, untere Leiste, Tabs) | 3 Seitenleiste/Menue |
   4 Startseite (Schnell-Deck, Abschnitte) | 5 Geraete, Einkauf. Regeln: kein Flex-gap, kein clamp/min/max/inset. */

/* ============================================== 1. Ansicht Einfach/Experte == */
html[data-mode="einfach"] .x-expert,
html[data-mode="einfach"] .x-expert-inline { display: none !important; }

/* ===================================================== 2. Rahmen =========== */
/* Leisten deckender: nichts scheint mehr durch die Beschriftungen (vorher .62) */
:root { --bar-bg: rgba(7,10,19,.9); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a.pill.power { text-decoration: none; color: var(--t2); }
a.tab { display: inline-flex; align-items: center; text-decoration: none; }
html[data-area="zuhause"] .topbar::after, html[data-area="apps"] .topbar::after, html[data-area="technik"] .topbar::after { opacity: 0; }

/* Einkauf-Zahl an der Navigation */
.nav-badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: rgba(244,114,182,.18); border: 1px solid rgba(244,114,182,.5); color: #fbcfe8;
  font-size: 11px; font-weight: 800; font-style: normal; line-height: 1; font-variant-numeric: tabular-nums;
}
.nav-badge[hidden] { display: none; }
.mn .nav-badge { margin-left: 7px; }
.bn .nav-badge { position: absolute; top: 3px; left: 50%; margin-left: 6px; }

/* "Mehr" ist ein Knopf in der Leiste */
.bn-more { -webkit-appearance: none; appearance: none; border: 0; background: transparent; font: inherit; cursor: pointer; }

@media (max-width: 699.98px) {
  /* oben nur Marke, Titel, Status - Menue ("Mehr") und Start sind unten */
  .topbar .tb-menu, .topbar .back { display: none; }
  .topbar .back:not([hidden]) + .brand { display: inline-flex; }
  .topbar .brand { margin-right: 10px; }
  .bottomnav { background: #080b15; }   /* deckend: sonst scheinen leuchtende Kacheln durch */
  .bottomnav { padding-top: 4px; padding-bottom: 4px; padding-bottom: calc(4px + env(safe-area-inset-bottom)); }
  .bn { flex: 1 1 0; min-height: 52px; font-size: 12px; letter-spacing: 0; color: var(--t2); }
  .bn svg { width: 22px; height: 22px; margin-bottom: 3px; }
  .bn.active { color: #5eead4; }
  /* Tabs: sichtbarer Ueberhang rechts = "hier geht es weiter" */
  .tab { padding: 0 13px; }
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  @media (max-width: 699.98px) {
    .bottomnav { background: #080b15; }
  }
}
@media (max-width: 359.98px) {
  .bn { font-size: 11px; }
}

/* ============================================ 3. Seitenleiste / Menue ======= */
.side-areas { padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid var(--line-soft); }
.side-subarea { min-height: 40px; padding-left: 22px; font-size: 13px; color: var(--t3); }
.side-subarea .side-ico { width: 24px; height: 24px; }
.side-subarea .side-ico > svg { width: 14px; height: 14px; }
.side-apps-gt { margin-top: 4px; }
/* Desktop-Leiste: Bereiche stehen oben in der Hauptnavigation - hier nur die Apps */
@media (min-width: 1100px) {
  .side-areas, .side-apps-gt { display: none; }
}
/* Schublade: Kopf "Apps" entfaellt (die Liste beginnt mit den Bereichen) */
@media (max-width: 1099.98px) {
  .side-head { display: none; }
  .side-list { padding-top: 8px; }
}

/* Fussleiste: "N weitere" als eigene Zeile (verdeckt nichts mehr), Ansicht, dann Alle Apps | Abmelden | Einklappen */
.side-foot { display: block; text-align: center; }
.side-more { position: relative; bottom: auto; left: auto; transform: none; margin: 0 0 8px; }
.side-mode {
  display: flex; margin: 0 0 8px; padding: 3px; border-radius: 13px;
  background: rgba(255,255,255,.035); border: 1px solid var(--edge);
}
.side-mode-b {
  -webkit-appearance: none; appearance: none; flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center;
  min-height: 36px; padding: 0 6px; border: 0; border-radius: 10px; background: transparent; color: var(--t3);
  font: inherit; font-size: 12.5px; font-weight: 650; cursor: pointer;
}
.side-mode-b > svg { width: 15px; height: 15px; margin-right: 6px; flex: 0 0 auto; }
.side-mode-b + .side-mode-b { margin-left: 3px; }
.side-mode-b.on { color: #fff; background: var(--glass-3); box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 4px 14px -8px rgba(94,234,212,.7); }
.side-mode-b.on > svg { color: #5eead4; }
.side-foot-row { display: flex; justify-content: space-between; text-align: left; }
.side-foot-row > .side-item {
  flex: 1 1 auto; flex-direction: column; justify-content: center; width: auto; min-width: 60px; min-height: 54px; margin: 0; padding: 6px 2px 5px;
}
.side-foot-row > .side-item + .side-item { margin-left: 4px; }
.side-foot-row > .side-item.active::before { display: none; }
.side-logout .side-ico { color: #fda4af; }
@media (min-width: 1100px) {
  #app.side-mini .side-mode { display: none; }
  #app.side-mini .side-foot-row { display: block; }
  #app.side-mini .side-foot-row > .side-item { flex-direction: row; justify-content: flex-start; width: 100%; min-width: 0; min-height: 36px; margin: 1px 0; padding: 4px 8px; }
  #app.side-mini .side-foot-row > .side-item + .side-item { margin-left: 0; }
  #app.side-mini .side-foot-row .side-name { display: none; }
}
/* Schublade: eine Fusszeile - Ansicht-Schalter + Abmelden ("Alle Apps" steht oben unter Bereiche) */
@media (max-width: 1099.98px) {
  .side-foot { display: flex; flex-wrap: wrap; align-items: center; }
  .side-more { -webkit-box-flex: 0; margin: 0 auto 8px; }
  .side-foot > .side-more:not([hidden]) + .side-mode { margin-left: 0; }
  .side-more:not([hidden]) { -webkit-flex: 0 0 auto; flex: 0 0 auto; }
  .side-foot::before { content: ""; -webkit-flex: 1 0 100%; flex: 1 0 100%; -webkit-box-ordinal-group: 3; order: 2; }
  .side-more { order: 1; }
  .side-mode { order: 3; flex: 1 1 auto; margin: 0; }
  .side-foot-row { order: 4; flex: 0 0 auto; margin-left: 8px; }
  .side-foot-row > .side-nav[data-route] { display: none; }
  .side-foot-row > .side-item { min-height: 50px; min-width: 70px; }
  .side-mode-b { min-height: 44px; font-size: 13.5px; }
}

/* =========================================== 4. Startseite =============== */
/* "Anpassen" steht als Symbolknopf im Kopf des Decks; die Leiste erscheint nur im Bearbeitungsmodus */
.hb:not(.editing) .hb-bar { display: none; }

/* --- Schnell-Deck --- */
.zd { position: relative; margin: 0 0 26px; }
.zd-head { display: flex; align-items: center; margin: 0 0 14px; }
.zd-hi { flex: 1 1 auto; min-width: 0; }
.page .zd-greet {
  display: block; margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.015em; text-transform: none; color: var(--t1); line-height: 1.2;
}
.page .zd-greet::before { display: none; }
.zd-date { margin: 2px 0 0; font-size: 14px; color: var(--t3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zd-time { margin-right: 8px; padding-right: 9px; border-right: 1px solid var(--edge-2); color: #5eead4; font-weight: 650; }
.zd-time:empty { display: none; }
.zd-tools { display: flex; align-items: center; flex: 0 0 auto; margin-left: 12px; }
.zd-mode { display: flex; padding: 3px; border-radius: 13px; background: rgba(255,255,255,.035); border: 1px solid var(--edge); }
.zd-mb {
  -webkit-appearance: none; appearance: none; min-height: 34px; padding: 0 12px; border: 0; border-radius: 10px;
  background: transparent; color: var(--t3); font: inherit; font-size: 13px; font-weight: 650; cursor: pointer;
}
.zd-mb + .zd-mb { margin-left: 2px; }
.zd-mb[aria-pressed="true"] { color: #fff; background: var(--glass-3); box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 4px 14px -8px rgba(94,234,212,.7); }
.zd-edit { flex: 0 0 auto; }

.zd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); grid-gap: 12px; gap: 12px; }
.zd-t, .zd-room {
  -webkit-appearance: none; appearance: none; position: relative; display: flex; align-items: center; width: 100%; min-width: 0;
  min-height: 76px; padding: 12px 14px; border-radius: 20px; text-align: left; text-decoration: none; cursor: pointer;
  font: inherit; color: var(--t1);
  background: var(--panel); border: 1px solid var(--edge);
  box-shadow: inset 0 1px 0 var(--edge-hi), 0 14px 34px -24px rgba(0,0,0,.9);
  transition: border-color .16s, background-color .16s, box-shadow .2s, transform .12s;
}
.zd-t:active, .zd-room:active { transform: scale(.98); }
.zd-t:disabled { opacity: .55; }
.zd-ico {
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 46px; height: 46px; border-radius: 15px;
  background: rgba(255,255,255,.07); border: 1px solid var(--edge); color: #a3aec6;
  transition: background-color .2s, color .2s, box-shadow .2s;
}
.zd-ico > svg { width: 24px; height: 24px; }
.zd-txt { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; margin-left: 12px; }
.zd-txt > b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 15.5px; font-weight: 650; line-height: 1.25; overflow: hidden; }
.zd-sub { margin-top: 2px; font-size: 13px; color: var(--t3); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Farben je Aktion (Aurora: Bernstein = Licht, Cyan = TV/PC, Violett = Szene, Pink = Einkauf) */
.zd-lights-on .zd-ico { color: #fcd34d; }
.zd-lights-off .zd-ico { color: #c4b5fd; }
.zd-tv .zd-ico, .zd-pc .zd-ico { color: #93c5fd; }
.zd-scene .zd-ico { color: #ddd6fe; background: rgba(167,139,250,.14); border-color: rgba(167,139,250,.4); }
.zd-shop .zd-ico { color: #f9a8d4; background: rgba(244,114,182,.1); border-color: rgba(244,114,182,.35); }
.zd-t.is-on, .zd-room.is-on { border-color: rgba(251,191,36,.42); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 0 26px -12px rgba(251,191,36,.6); }
.zd-t.is-on .zd-ico, .zd-room.is-on .zd-ico {
  color: #1c1405; background: #fbbf24; background: linear-gradient(140deg, #f59e0b, #fcd34d); border-color: rgba(253,230,138,.9);
  box-shadow: 0 0 18px rgba(251,191,36,.55);
}
.zd-t.is-on .zd-sub, .zd-room.is-on .zd-sub { color: #fcd34d; }
.zd-tv.is-on, .zd-pc.is-on { border-color: rgba(96,165,250,.45); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 0 26px -12px rgba(96,165,250,.65); }
.zd-tv.is-on .zd-ico, .zd-pc.is-on .zd-ico {
  color: #fff; background: #3b82f6; background: linear-gradient(140deg, #3b82f6, #60a5fa); border-color: rgba(147,197,253,.9);
  box-shadow: 0 0 18px rgba(96,165,250,.55);
}
.zd-tv.is-on .zd-sub, .zd-pc.is-on .zd-sub { color: #93c5fd; }
.zd-pc.is-starting .zd-ico { animation: zd-pulse 1.4s ease-in-out infinite; }
@keyframes zd-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

.zd-rooms-h { display: flex; align-items: center; margin: 18px 0 10px; }
.zd-rooms-h > span { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--t2); }
.zd-rooms-all { display: inline-flex; align-items: center; margin-left: auto; min-height: 36px; padding: 0 4px 0 10px; color: var(--t2); font-size: 13px; font-weight: 600; text-decoration: none; }
.zd-rooms-all > svg { margin-left: 3px; }
.zd-rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); grid-gap: 10px; gap: 10px; }
.zd-room { min-height: 60px; padding: 8px 12px; border-radius: 16px; }
.zd-room .zd-ico { width: 38px; height: 38px; border-radius: 12px; }
.zd-room .zd-ico > svg { width: 20px; height: 20px; }
.zd-room .zd-txt > b { font-size: 14.5px; }

/* --- Abschnitte --- */
.z-sec { margin: 0 0 26px; }
.z-sec.is-empty { display: none; }
.z-sh { display: flex; align-items: center; flex-wrap: wrap; min-height: 40px; margin: 0 0 12px; }
.page .z-st {
  display: flex; align-items: center; margin: 0; font-size: 13px; letter-spacing: .14em; color: var(--t1);
}
.page .z-st::before { display: none; }
.z-st-ico {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; margin-right: 10px; border-radius: 10px;
  background: rgba(94,234,212,.1); border: 1px solid rgba(94,234,212,.35); color: #5eead4;
}
.z-sec-medien .z-st-ico { background: rgba(244,114,182,.1); border-color: rgba(244,114,182,.38); color: #f9a8d4; }
.z-sec-technik .z-st-ico { background: rgba(96,165,250,.1); border-color: rgba(96,165,250,.38); color: #93c5fd; }
.z-away { display: inline-flex; align-items: center; margin-left: 14px; font-size: 13px; color: #fcd34d; }
.z-away > svg { margin-right: 6px; flex: 0 0 auto; }
.z-away[hidden] { display: none; }
.z-body[hidden] { display: none; }

/* Technik: Kopf als Glas-Leiste mit Kurzstatus; eingeklappt (Standard) ist das alles */
.z-sh-tech {
  padding: 10px 12px 10px 14px; border-radius: 20px; background: var(--panel); border: 1px solid var(--edge);
  box-shadow: inset 0 1px 0 var(--edge-hi);
}
.z-sec-technik.is-open .z-sh-tech { margin-bottom: 16px; }
.z-tsum { display: flex; flex-wrap: wrap; align-items: center; flex: 1 1 auto; min-width: 0; margin: -3px 0 -3px 14px; }
.z-chip { margin: 3px 6px 3px 0; min-height: 34px; text-decoration: none; color: var(--t2); }
.z-chip > svg { width: 15px; height: 15px; }
.z-fold { flex: 0 0 auto; margin-left: auto; min-height: 40px; }
.z-fold > svg { transition: transform .25s var(--ease); }
.z-sec-technik.is-open .z-fold > svg { transform: rotate(180deg); }
.z-fold[hidden] { display: none; }

/* Handy: Deck zuerst, zwei Spalten, kompakter Kopf; Raeume in zwei Spalten */
@media (max-width: 699.98px) {
  .zd { margin-bottom: 22px; }
  .zd-head { margin-bottom: 12px; }
  .page .zd-greet { font-size: 21px; }
  .zd-date { font-size: 13px; }
  .zd-mb { min-height: 38px; padding: 0 9px; font-size: 12.5px; }
  .zd-edit { width: 44px; height: 44px; margin-left: 6px; }
  .zd-grid, .zd-rooms { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-gap: 10px; gap: 10px; }
  .zd-t { min-height: 72px; padding: 10px 11px; border-radius: 18px; }
  .zd-ico { width: 42px; height: 42px; border-radius: 13px; }
  .zd-txt { margin-left: 10px; }
  .zd-txt > b { font-size: 15px; }
  .zd-sub { font-size: 12.5px; white-space: normal; }
  .zd-room { min-height: 56px; }
  /* ungerade Anzahl: die letzte Kachel fuellt die Reihe (kein Loch) */
  .zd-grid > .zd-t:last-child:nth-child(odd), .zd-rooms > .zd-room:last-child:nth-child(odd) { grid-column: span 2; }
  .z-sh-tech { padding: 10px; }
  .z-tsum { order: 3; flex: 1 1 100%; margin: 8px 0 -3px; }
  .z-chip { min-height: 40px; }
}
/* iPhone SE und kleiner: Begruessung kuerzer, Ansicht-Schalter bleibt */
@media (max-width: 389.98px) {
  .page .zd-greet { font-size: 19px; }
  .zd-mb { padding: 0 8px; }
  .zd-t { min-height: 66px; }
  .zd-ico { width: 38px; height: 38px; }
  .zd-ico > svg { width: 22px; height: 22px; }
}
@media (hover: hover) {
  .zd-t:hover, .zd-room:hover { border-color: var(--edge-2); background-color: rgba(255,255,255,.03); }
  .zd-mb:hover:not([aria-pressed="true"]), .side-mode-b:hover:not(.on) { color: var(--t1); }
  .zd-rooms-all:hover { color: var(--t1); }
  .z-chip:hover { color: var(--t1); border-color: var(--edge-2); }
}
@media (prefers-reduced-motion: reduce) {
  .zd-pc.is-starting .zd-ico { animation: none; }
}

/* ===================================== 5. Geraete, Einkauf ================ */
/* Technik-Steckdosen: eigene, gestrichelt umrandete Gruppe ganz unten */
.page h2.tech-h { color: #fcd34d; }
.page h2.tech-h::before { background: #fbbf24; box-shadow: 0 0 8px rgba(251,191,36,.9); }
.tech-grid .tile { border-style: dashed; border-color: rgba(251,191,36,.35); }
/* Einkauf: Punkte statt Pseudo-Checkboxen (abhaken geht nur in der Alexa-App) */
.hm-shop-box { width: 7px; height: 7px; margin-right: 12px; border: 0; border-radius: 50%; background: #f472b6; box-shadow: 0 0 8px rgba(244,114,182,.6); }
/* Tablet (auch Wand-iPad quer): weniger, breitere Kacheln - Namen brechen nicht mitten im Wort */

/* Tablet + Desktop: vier breite Spalten statt sieben schmaler (Namen wurden abgeschnitten); Einkauf doppelt breit mit Vorschau */
@media (min-width: 700px) and (max-width: 1099.98px) {   /* Tablet/Wand-iPad: drei Spalten, Einkauf als ganze Zeile */
  .zd-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .zd-grid > .zd-shop { grid-column: 1 / -1; }
}
@media (min-width: 1100px) {
  .zd-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .zd-grid > .zd-shop { grid-column: span 2; }
}
/* Touch (Handy, Tablet, Wand-iPad): alle Bedienziele mindestens 44 px hoch */
@media (max-width: 1099.98px) {
  .zd-mb, .z-chip, .z-fold, .zd-rooms-all, .side-subarea { min-height: 44px; }
}

/* ===================================== 6. Widget Claude-Auslastung ======== */
.hm-ul-body { flex: 1 1 auto; min-height: 0; }
.hm-ul-accs { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); grid-gap: 12px; gap: 12px; }
.hm-ul-acc {
  position: relative; padding: 12px 14px 10px; border-radius: 16px; min-width: 0;
  background: rgba(255,255,255,.035); border: 1px solid var(--edge);
}
.hm-ul-acc::before {               /* Kontofarbe als Leuchtkante links */
  content: ""; position: absolute; left: -1px; top: 12px; bottom: 12px; width: 3px; border-radius: 3px;
  background: var(--acc, var(--coral)); box-shadow: 0 0 10px var(--acc, var(--coral));
}
.hm-ul-h { display: flex; align-items: center; min-height: 24px; margin-bottom: 8px; }
.hm-ul-h .hm-acc-dot { flex: 0 0 auto; }
.hm-ul-name { flex: 1 1 auto; min-width: 0; margin-left: 8px; font-size: 15px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-ul-h .hm-plan { flex: 0 0 auto; margin-left: 8px; }
.hm-ul-row {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) 46px; grid-template-rows: auto auto;
  align-items: center; grid-column-gap: 10px; column-gap: 10px; margin-top: 6px;
}
.hm-ul-l { font-size: 13px; color: var(--t2); }
.hm-ul-m { height: 8px; }
.hm-ul-pct { text-align: right; font-size: 15px; font-variant-numeric: tabular-nums; }
.hm-ul-rs { grid-column: 2 / 4; font-size: 12px; color: var(--t3); min-height: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-ul-row.warning .hm-ul-pct { color: #fcd34d; }
.hm-ul-row.critical .hm-ul-pct { color: #fda4af; }
.hm-ul-acc.stale .hm-ul-pct::after { content: " ·"; color: var(--t3); }
.hm-ul-note { margin: 4px 0 2px; font-size: 13px; color: var(--t3); }
.hm-ul-acc .h-skel.line { display: block; margin-top: 8px; }
.z-sec-claude .z-st-ico { background: rgba(255,143,107,.1); border-color: rgba(255,143,107,.38); color: #ff8f6b; }
@media (max-width: 699.98px) {
  .hm-ul-accs { grid-template-columns: minmax(0, 1fr); grid-gap: 10px; gap: 10px; }
}
