/* ROTHEN DB — Wand-Tablet (/tablet): drei Seiten zum Wischen, Sonos/Hue, Kalender. */

/* ───────────── Wischbereich ───────────── */
.tb-wisch { position: fixed; inset: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory;
            overscroll-behavior: contain; scrollbar-width: none; background: var(--rothn-bg); }
.tb-wisch::-webkit-scrollbar { display: none; }
.tb-seite { position: relative; flex: 0 0 100%; width: 100%; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden; }
.tb-punkte { position: fixed; left: 0; right: 0; bottom: 6px; display: flex; justify-content: center; gap: 8px; z-index: 60; pointer-events: none; }
.tb-punkte span { width: 8px; height: 8px; border-radius: 50%; background: rgba(21, 32, 43, .22); transition: background .2s, transform .2s; }
.tb-punkte span.an { background: rgba(21, 32, 43, .7); transform: scale(1.2); }

/* Familien-Dashboard im Wischbereich: füllt seine Seite statt des Fensters. */
.fd-stage.eingebettet { position: absolute; z-index: auto; }

/* ───────────── Links: Sonos | Hue ───────────── */
.th { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; height: 100%; padding: 16px 16px 24px; box-sizing: border-box; }
.th-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--rothn-surface); border: 1px solid var(--rothn-border);
            border-radius: 18px; padding: 18px 20px; }
.th-kopf { display: flex; align-items: center; gap: 10px; font-size: 1.35rem; font-weight: 800; color: var(--rothn-text); }
.th-icon { font-size: 1.4rem; }
.th-leer { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--rothn-text-muted); gap: .2rem; }
.th-leer p { margin: 0; font-size: 1.05rem; }
.th-leer .th-klein { font-size: .9rem; }

/* ───────────── Rechts: Kalender ───────────── */
/* Läuft in der Dashboard-Bühne (<TabletBuehne Klasse="tk"> = .fd.tk, 1920 breit, skaliert): Masse in Bühnen-Einheiten,
   Farben/Variablen aus familien-dashboard.css (--fd-acc, --fd-acc-soft, --fd-line, --fd-muted). Knöpfe mit „.tk “ davor,
   weil „.fd button { font: inherit }“ sonst die Schriftgrösse überschreibt. */
.fd.tk { gap: 14px; }

/* Suche (Kopfzeile rechts) */
.tk-suche { display: flex; align-items: center; gap: 12px; width: 460px; height: 64px; padding: 0 8px 0 22px; border-radius: 32px; background: #fff;
            box-shadow: 0 1px 2px rgba(21,32,43,.06), 0 0 0 1px rgba(21,32,43,.08); color: var(--fd-muted); transition: box-shadow .15s, color .15s; }
.tk-suche:focus-within, .tk-suche.an { box-shadow: 0 0 0 3px var(--fd-acc); color: var(--fd-acc); }
.tk-suche input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font: inherit; font-size: 22px; font-weight: 600; color: #15202B; }
.tk-suche input::placeholder { color: #8A96A3; font-weight: 500; }
.tk-suche input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.tk .tk-suche-x { width: 50px; height: 50px; flex: none; border-radius: 50%; border: 0; background: #EDF0F3; color: #15202B; display: flex; align-items: center; justify-content: center; cursor: pointer; }

/* Leiste: ‹ Zeitraum › Heute · Woche|Monat|Liste · Personen */
.tk .tk-leiste { gap: 24px; }
.tk .fd-wochentitel { min-width: 300px; }
.tk .fd-wochentitel h2 { display: flex; align-items: center; gap: 12px; }
.tk .tk-spinner { width: 22px; height: 22px; border-color: var(--fd-acc-soft); border-top-color: var(--fd-acc); }
.tk .tk-filter { gap: 8px; }
/* „Heute“ und „Ganzer Tag“ aus einer Familie: gleiche Höhe/Rundung/Schrift; Heute violett, wenn nicht beim aktuellen Zeitraum;
   Ganzer Tag als Umschalter (an = hell-violett mit Häkchen, wie .fd-opt.an) */
.tk .tk-knopf { height: 52px; margin-left: 4px; padding: 0 22px; border-radius: 16px; border: 2px solid #DDE2E7; background: #fff; display: flex; align-items: center; gap: 8px;
                font-size: 18px; font-weight: 800; color: #15202B; white-space: nowrap; cursor: pointer; }
.tk .tk-knopf.hervor { border-color: var(--fd-acc); background: var(--fd-acc); color: #fff; }
.tk .tk-knopf.an { border-color: var(--fd-acc); background: var(--fd-acc-soft); color: var(--fd-acc); }
.tk .fd-reiter.tk-ansicht { flex: none; }
.tk .fd-reiter.tk-ansicht button { flex: none; height: 48px; padding: 0 28px; font-size: 18px; }
.tk .fd-person.tk-person-aus { opacity: .45; }

.tk-suchinfo { display: flex; align-items: center; gap: 18px; min-height: 52px; padding: 4px 6px 4px 22px; border-radius: 16px; background: var(--fd-acc-soft);
               color: var(--fd-acc); font-size: 18px; font-weight: 600; }
.tk-suchinfo b { font-weight: 800; }
.tk .tk-link { margin-left: auto; height: 44px; padding: 0 20px; border-radius: 22px; border: 0; background: #fff; color: var(--fd-acc); font-size: 17px; font-weight: 800; cursor: pointer; }
.tk-fehler { padding: 10px 18px; border-radius: 14px; background: #FDE8E4; color: #8F1D12; font-size: 17px; font-weight: 600; }

/* Gemeinsam: Kalenderfläche als Karte, Wetter je Tag, Balken (ganztags/mehrtägig) */
.tk-flaeche { position: relative; z-index: 0; flex: 1; min-height: 0; display: flex; flex-direction: column; background: #fff; border-radius: 22px; overflow: hidden;
              box-shadow: 0 1px 2px rgba(21,32,43,.06), 0 0 0 1px rgba(21,32,43,.05); }
.tk-wetter { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 4px; border-radius: 10px; white-space: nowrap; flex: none; color: #15202B; }
.tk-wetter .ico { display: flex; }
.tk-wetter .mm { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tk-wetter small { font-size: 15px; font-weight: 500; color: var(--fd-muted); }
/* Wetter als Knopf (Tage mit Prognose; Tipp → Wetter-Details dieses Tages): Tippziel mind. 48 hoch, dank negativer Ränder im Fluss nicht höher */
.tk button.tk-wetter.knopf { min-height: 48px; margin-top: -6px; margin-bottom: -6px; padding: 2px 10px 2px 6px; border: 0; background: none; color: #15202B; cursor: pointer;
                             -webkit-tap-highlight-color: transparent; transition: background .15s; }
.tk button.tk-wetter.knopf:active { background: var(--fd-acc-soft); }

.tk .tk-balken { position: relative; z-index: 1; min-width: 0; margin: 3px 4px; padding: 0 10px 0 14px; border: 0; border-radius: 9px; display: flex; align-items: center; gap: 6px;
                 font-size: 15px; font-weight: 700; color: #15202B; text-align: left; white-space: nowrap; overflow: hidden; cursor: pointer; }
.tk-balken .tk-bt { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tk-balken .tk-bt b { color: var(--fg); font-weight: 800; margin-right: 2px; font-variant-numeric: tabular-nums; }
.tk-balken .tk-bt small { font-size: 13px; font-weight: 600; color: var(--fd-muted); margin-left: 4px; }
.tk-balken .tk-weiter { flex: none; font-size: 22px; font-weight: 800; line-height: 1; color: var(--fg); }
.tk-balken .tk-pr { flex: none; display: flex; color: #B45309; }
.tk .tk-balken.vorher { margin-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.tk .tk-balken.nachher { margin-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }

/* Woche: Kopf mit Wetter, Ganztags-Zeile, Stundenraster 06–24 (scrollt; Höhe je Stunde = --tk-h) */
.tk-wkopf, .tk-gt-raster, .tk-raster-innen { display: grid; grid-template-columns: 76px repeat(7, minmax(0, 1fr)); }
.tk-wkopf { flex: none; padding: 8px 0 6px; border-bottom: 1px solid var(--fd-line); }
.tk-wtag { margin: 0 4px; padding: 6px 8px 6px 10px; min-height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
.tk-wtag.we { background: #F5F6F8; }
.tk-wdatum { display: flex; align-items: baseline; gap: 7px; white-space: nowrap; min-width: 0; overflow: hidden; }
.tk-wdatum .t { font-size: 19px; font-weight: 800; }
.tk-wdatum .d { font-size: 15px; font-weight: 600; color: var(--fd-muted); }
.tk-wtag.vorbei .tk-wdatum { opacity: .55; }
.tk-wtag.heute { background: var(--fd-acc); color: #fff; }
.tk-wtag.heute .tk-wdatum .d { color: #fff; opacity: .85; }
.tk-wtag.heute .tk-wetter, .tk .tk-wtag.heute button.tk-wetter.knopf { background: #fff; }

.tk-ganztags { flex: none; max-height: 158px; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: none; border-bottom: 1px solid var(--fd-line); }
.tk-ganztags::-webkit-scrollbar { display: none; }
.tk-gt-raster { padding: 2px 0; }
.tk-gt-label { grid-column: 1; grid-row: 1 / -1; align-self: center; padding: 0 12px 0 4px; text-align: right; font-size: 13px; font-weight: 800;
               letter-spacing: .04em; text-transform: uppercase; color: var(--fd-muted); }
.tk-gt-hg { border-left: 1px solid var(--fd-line); }
.tk-gt-hg.we { background: #FAFBFC; }
.tk-gt-hg.heute { background: rgba(94, 43, 110, .05); }

.tk-raster { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: none; }   /* waagrecht wischen geht an die Seiten */
/* „Ganzer Tag“: 06–24 ohne Scrollen, kleine Blöcke (Titel einzeilig, sehr kurze nur als Farbblock) */
.tk-raster.ganz { overflow-y: hidden; }
.tk .tk-raster.ganz .tk-block { padding: 1px 6px 1px 10px; border-radius: 6px; }
.tk-raster.ganz .tk-block .tk-b-titel { font-size: 14px; line-height: 18px; }
.tk-raster.ganz .tk-block .tk-b-ort { font-size: 13px; line-height: 18px; }
.tk-raster.ganz .tk-block.gestapelt, .tk-raster.ganz .tk-block.zweizeilig { justify-content: flex-start; padding-top: 2px; }
.tk .tk-block.leer { padding: 0; }
.tk-raster::-webkit-scrollbar { display: none; }
.tk-raster-innen { position: relative; grid-template-rows: minmax(0, 1fr); }
.tk-stunden { position: relative; }
.tk-std { position: absolute; right: 12px; transform: translateY(-50%); font-size: 14px; font-weight: 700; color: var(--fd-muted); font-variant-numeric: tabular-nums; }
.tk-std:first-child { transform: translateY(4px); }
/* Stundenlinie + dezente Halbstundenlinie als Hintergrund der Tagesspalte */
.tk-spalte { position: relative; border-left: 1px solid var(--fd-line);
             background-image: linear-gradient(to bottom, var(--fd-line) 1px, transparent 1px), linear-gradient(to bottom, #F2F4F6 1px, transparent 1px);
             background-size: 100% var(--tk-h), 100% var(--tk-h); background-position: 0 0, 0 calc(var(--tk-h) / 2); }
.tk-spalte.we { background-color: #FAFBFC; }
.tk-spalte.heute { background-color: rgba(94, 43, 110, .035); }

/* Termin-Block: heller Personen-Hintergrund, Farbstreifen links (aus dem Inline-Stil), Layout je nach Höhe */
.tk .tk-block { position: absolute; z-index: 1; box-sizing: border-box; border: 0; border-radius: 10px; padding: 4px 8px 4px 14px; overflow: hidden;
                display: flex; flex-direction: column; text-align: left; color: #15202B; cursor: pointer; box-shadow: 0 0 0 1.5px #fff; }
.tk-block .tk-b-titel { font-size: 17px; font-weight: 700; line-height: 21px; overflow: hidden; overflow-wrap: anywhere; }
.tk-block .tk-b-titel b { color: var(--fg); font-weight: 800; font-variant-numeric: tabular-nums; margin-right: 3px; }
.tk-block.einzeilig { justify-content: center; }
.tk-block.einzeilig .tk-b-titel { white-space: nowrap; text-overflow: ellipsis; flex: none; }
.tk-block.zweizeilig .tk-b-titel, .tk-block.gestapelt .tk-b-titel { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: var(--z, 2); flex: none; }
.tk-block .tk-b-zeit { flex: none; font-size: 14px; font-weight: 800; line-height: 18px; color: var(--fg); font-variant-numeric: tabular-nums;
                       white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-block .tk-b-ort { flex: none; font-size: 15px; font-weight: 600; line-height: 21px; color: var(--fd-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-jetzt { position: absolute; left: -1px; right: 0; height: 3px; margin-top: -1px; background: #E0453A; z-index: 3; pointer-events: none; }
.tk-jetzt::before { content: ""; position: absolute; left: -7px; top: -5px; width: 13px; height: 13px; border-radius: 50%; background: #E0453A; }

/* Monat: 6 Wochenzeilen, je Zeile eigenes Raster (Tageszahl + Wetter, Balken über mehrere Tage, Termine) */
.tk-mkopf { flex: none; display: grid; grid-template-columns: 64px repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--fd-line); }
.tk-mkopf div { padding: 10px; text-align: center; font-size: 15px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--fd-muted); }
.tk-mwoche { flex: 1; min-height: 0; display: grid; grid-template-columns: 64px repeat(7, minmax(0, 1fr)); row-gap: 2px; border-top: 1px solid var(--fd-line); }
.tk-mkopf + .tk-mwoche { border-top: 0; }
.tk-mzelle { border-left: 1px solid var(--fd-line); cursor: pointer; }
.tk-mzelle.erste { border-left: 0; }
/* KW-Spalte links im Monat (Tipp → diese Woche) */
.tk-mkopf .tk-mkw-kopf { color: #A9B4BF; }
.tk .tk-mkw { z-index: 1; border: 0; border-right: 1px solid var(--fd-line); background: #F7F8FA; color: var(--fd-muted); font-size: 16px; font-weight: 800;
              display: flex; align-items: flex-start; justify-content: center; padding-top: 8px; cursor: pointer; }
.tk-mzelle.we { background: #F7F8FA; }
.tk-mzelle.fremd { background: #FAFBFC; }
.tk-mzelle.heute { background: var(--fd-acc-soft); box-shadow: inset 0 0 0 2px var(--fd-acc); }
.tk-mnum-zeile { z-index: 1; display: flex; align-items: center; gap: 8px; min-width: 0; padding: 4px 8px 0 10px; pointer-events: none; }
.tk-mnum { font-size: 18px; font-weight: 800; line-height: 26px; }
.tk-mzelle.fremd + .tk-mnum-zeile .tk-mnum { color: #A9B4BF; }
.tk-mzelle.heute + .tk-mnum-zeile .tk-mnum { padding: 0 10px; border-radius: 999px; background: var(--fd-acc); color: #fff; }
.tk-mweitere { padding: 1px 8px; border-radius: 9px; background: var(--fd-acc-soft); color: var(--fd-acc); font-size: 13px; font-weight: 800; }
.tk-mnum-zeile .tk-wetter { margin-left: auto; padding: 0; background: none; }
.tk-mnum-zeile .tk-wetter .mm { font-size: 14px; }
.tk .tk-mnum-zeile button.tk-wetter.knopf { pointer-events: auto; min-width: 48px; margin: -9px -6px -9px auto; padding: 0 6px; justify-content: flex-end; }
.tk-mrest { z-index: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; min-height: 0; padding: 0 4px 4px; overflow: hidden; pointer-events: none; }
.tk .tk-mevt { flex: none; height: 28px; padding: 0 8px 0 12px; border: 0; border-radius: 8px; text-align: left; font-size: 15px; font-weight: 600; color: #15202B;
               white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; pointer-events: auto; }
.tk-mevt b { color: var(--fg); font-weight: 800; font-variant-numeric: tabular-nums; }
.tk .tk-mwoche .tk-balken { margin: 1px 4px; font-size: 14px; border-radius: 8px; }
.tk .tk-mwoche .tk-balken.vorher { margin-left: 0; }
.tk .tk-mwoche .tk-balken.nachher { margin-right: 0; }

/* Liste: Tageskarten wie im Dashboard, Zeilen wie im Tag-Detail (.fd-dz) */
.tk-liste { position: relative; z-index: 0; flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: none; display: flex; flex-direction: column; gap: 14px; padding: 4px 4px 14px; }
.tk-liste::-webkit-scrollbar { display: none; }
.tk-ltag { flex: none; padding: 8px 22px 6px; border-radius: 22px; background: #fff; box-shadow: 0 1px 2px rgba(21,32,43,.06), 0 0 0 1px rgba(21,32,43,.05); }
.tk-ltag.heute { box-shadow: 0 0 0 3px var(--fd-acc); }
.tk-ltag.vorbei { opacity: .7; }
.tk-ltag-kopf { display: flex; align-items: center; gap: 12px; padding: 6px 0 10px; }
.tk-ltag-kopf .t { font-size: 24px; font-weight: 800; }
.tk-ltag.heute .tk-ltag-kopf .t { color: var(--fd-acc); }
.tk-ltag-kopf .d { font-size: 17px; font-weight: 600; color: var(--fd-muted); }
.tk-ltag-kopf .tk-wetter { margin-left: auto; }
.tk-ltag-kopf .tk-wetter .mm { font-size: 19px; }
.tk-ltag-kopf .tk-wetter small { font-size: 17px; }
.tk .tk-lz { width: 100%; display: flex; align-items: center; gap: 18px; min-height: 70px; padding: 10px 4px; border: 0; border-top: 1px solid var(--fd-line);
             background: none; text-align: left; cursor: pointer; }
.tk .tk-lz:active { background: #F7F8FA; }
.tk-lz-strich { width: 6px; align-self: stretch; border-radius: 3px; flex: none; }
.tk-lz .zeit { flex: none; width: 230px; display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.tk-lz .zeit b { font-size: 20px; font-weight: 800; }
.tk-lz .zeit small { font-size: 15px; font-weight: 600; color: var(--fd-muted); }
.tk-lz .zeit.pruef b { font-size: 14px; letter-spacing: .04em; text-transform: uppercase; color: #B45309; }
.tk-lz .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tk-lz .txt b { font-size: 20px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.tk-lz .txt small { font-size: 16px; color: var(--fd-muted); }
.tk-lz .wer { flex: none; display: flex; gap: 6px; }
.tk-leer { padding: 14px 4px; border-top: 1px solid var(--fd-line); font-size: 17px; color: var(--fd-muted); }
.tk-leer.gross { border: 0; padding: 40px; text-align: center; font-size: 22px; }
.tk .tk-weitere { flex: none; align-self: center; height: 56px; font-size: 18px; }

/* Termin-Detail im Dashboard-Dialog (.fd-dialog-hg + .fd-detail) */
.tk .tk-detail { width: 860px; max-height: calc(100% - 120px); }
.tk .tk-detail .fd-dz .zeit { min-width: 110px; }
/* Wetter-Details (Komponente WetterDetails, wie im Dashboard) */
.tk .tk-wetterdetail { max-height: calc(100% - 120px); }
.tk .fd-dz .txt.tk-d-wer { flex-direction: row; flex-wrap: wrap; gap: 10px 20px; }
.tk-d-person { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.tk-d-notiz { white-space: pre-wrap; overflow-wrap: anywhere; }
.tk .tk-d-notiz a { color: var(--fd-acc); text-decoration: underline; }

/* ───────────── Dunkelmodus (ROTHEN DB, Einstellung „Darstellung“) ─────────────
   Ganze Fläche umkehren; Bilder (Cover, Avatare, Logo) zurückdrehen, damit sie unverändert aussehen. */
.tb-wisch.dunkel { filter: invert(1) hue-rotate(180deg); transition: filter .6s; }
.tb-wisch.dunkel img { filter: invert(1) hue-rotate(180deg); }
.tb-punkte.dunkel span { background: rgba(255, 255, 255, .25); }
.tb-punkte.dunkel span.an { background: rgba(255, 255, 255, .75); }
/* Dialog-Hintergrund im Dunkelmodus: hell setzen, damit er nach der Umkehr dunkel ist */
.tb-wisch.dunkel .fd-dialog-hg { background: rgba(222, 211, 200, .62); }

/* Einstellungen über allen Seiten: eigene, durchsichtige Bühne */
.tb-ueber { position: fixed; inset: 0; z-index: 70; }
.tb-ueber .fd-stage.eingebettet { background: transparent; }
.tb-ueber.dunkel { filter: invert(1) hue-rotate(180deg); }
.tb-ueber.dunkel .fd-dialog-hg { background: rgba(222, 211, 200, .62); }

