/* Familien-Dashboard (iPad, Querformat 1024 × 768) */
:root {
  --bg: #f5f3ee;
  --karte: #ffffff;
  --ink: #1c1d20;
  --soft: #6b6e75;
  --rule: #dedbd3;
  --akzent: #2f5fc4;
  --heute: #1c1d20;
  --heute-ink: #ffffff;
  --regen: #3d8bea;
  --wolke: #e1e6ec;
  --wolke-rand: #98a4b0;
  --wolke-dunkel: #b3bdc8;
  --wolke-dunkel-rand: #7c8794;
  --sonne: #f3b23a;
  --mond: #d9c27e;
  --schatten: 0 1px 2px rgba(0, 0, 0, .05), 0 4px 14px rgba(0, 0, 0, .04);
  color-scheme: light;
}
html.nacht {
  --bg: #111214;
  --karte: #1a1c1f;
  --ink: #e9e7e2;
  --soft: #8d9097;
  --rule: #2c2f33;
  --akzent: #7aa2ff;
  --heute: #e9e7e2;
  --heute-ink: #111214;
  --wolke: #59616b;
  --wolke-rand: #8a949f;
  --wolke-dunkel: #464d56;
  --wolke-dunkel-rand: #737d88;
  --mond: #e4cf8c;
  --schatten: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%; -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none;
  font-variant-numeric: tabular-nums;
}
#app {
  height: 100vh; height: 100dvh; display: flex; flex-direction: column;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 28px 14px;
  transition: background .4s;
}
b { font-weight: 650; }
.leise { color: var(--soft); }
.klein { font-size: 14px; }
.leer { color: var(--soft); font-size: 22px; font-weight: 600; padding: 40px 0; }

/* ---------- Kopf ---------- */
.kopf { flex: none; padding-bottom: 10px; border-bottom: 2px solid var(--ink); }
.titel {
  text-align: center; font-size: 15px; font-weight: 650; letter-spacing: .14em; text-transform: uppercase;
  color: var(--soft); margin-bottom: 2px;
}
.kopfzeile { display: flex; align-items: baseline; gap: 18px; }
.datum { font-size: 34px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.status { flex: 1; text-align: right; font-size: 15px; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status.warn { color: #c2410c; }
.uhr { font-size: 44px; font-weight: 300; letter-spacing: -.02em; line-height: 1; }

/* ---------- Dashboard ---------- */
.dash { flex: 1; min-height: 0; display: grid; grid-template-columns: 39% 1fr; gap: 26px; padding-top: 16px; }
.spalte { min-height: 0; display: flex; flex-direction: column; }

.wetter { gap: 14px; }
.jetzt { display: flex; align-items: center; gap: 14px; }
.jetzt .j-symbol { width: 132px; height: 132px; flex: none; }
.jetzt .j-symbol .wx { width: 100%; height: 100%; }
.j-temp { font-size: 78px; font-weight: 250; line-height: .95; letter-spacing: -.03em; }
.j-text { font-size: 22px; font-weight: 650; margin-top: 4px; }
.j-det { font-size: 15px; color: var(--soft); margin-top: 3px; }

.heute-werte {
  display: grid; grid-template-columns: repeat(4, auto); justify-content: space-between;
  background: var(--karte); border-radius: 14px; padding: 12px 16px; box-shadow: var(--schatten);
}
.heute-werte div { display: flex; flex-direction: column; gap: 2px; }
.heute-werte span { font-size: 13px; color: var(--soft); }
.heute-werte b { font-size: 19px; }

.vorschau { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 10px; margin-top: auto; }
.v-tag {
  background: var(--karte); border-radius: 14px; padding: 12px 8px 10px; text-align: center; box-shadow: var(--schatten);
}
.v-name { font-size: 17px; font-weight: 650; }
.v-tag .wx { width: 64px; height: 64px; margin: 2px auto 0; display: block; }
.v-temp { font-size: 18px; color: var(--soft); }
.v-temp b { color: var(--ink); }
.v-regen { font-size: 13px; color: var(--regen); font-weight: 600; margin-top: 2px; }

.termine { border-left: 1px solid var(--rule); padding-left: 26px; }
.liste { flex: 1; min-height: 0; overflow: hidden; position: relative; }
.tag { margin-bottom: 12px; }
.tag-kopf {
  font-size: 18px; color: var(--soft); padding-bottom: 5px; margin-bottom: 4px; border-bottom: 1px solid var(--rule);
}
.tag-kopf b { color: var(--ink); }
.termin {
  display: flex; align-items: baseline; gap: 10px; padding: 5px 0; font-size: 20px; line-height: 1.25; min-width: 0;
}
.termin .zeit { flex: none; width: 92px; font-weight: 650; }
.termin.ganztags .zeit { color: var(--soft); font-weight: 500; font-size: 16px; }
.termin.keine { color: var(--soft); }
.etikett {
  flex: none; font-size: 12px; font-weight: 700; color: #fff; padding: 3px 8px; border-radius: 6px;
  letter-spacing: .02em; position: relative; top: -2px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.was { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ort { font-size: 15px; color: var(--soft); margin-left: 10px; }
.punkt { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 7px; position: relative; top: -1px; }
.weitere { flex: none; font-size: 15px; color: var(--soft); padding-top: 4px; min-height: 22px; }

.fuss { flex: none; font-size: 13px; color: #c2410c; padding-top: 6px; border-top: 1px solid var(--rule); margin-top: 6px; }

/* ---------- Warnungen ---------- */
.warnungen { display: flex; flex-direction: column; gap: 8px; }
.warnung { border-radius: 12px; padding: 9px 14px; background: #fff3c4; color: #3d3000; }
.warnung.stufe3 { background: #ffd8a8; color: #4a2300; }
.warnung.stufe4 { background: #d92d20; color: #fff; }
.warnung.stufe5 { background: #7a2ea8; color: #fff; }
.warnung.vorab { background: transparent; border: 2px solid var(--rule); color: var(--ink); }
.w-kopf { font-size: 16px; font-weight: 700; display: flex; justify-content: space-between; gap: 10px; }
.w-kopf .mehr { font-weight: 500; font-size: 13px; opacity: .8; white-space: nowrap; }
.w-text { font-size: 13px; margin-top: 2px; opacity: .9; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Kopfleiste der Unteransichten ---------- */
.topbar {
  flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding-bottom: 10px; border-bottom: 2px solid var(--ink);
}
.topbar h1 { margin: 0; font-size: 28px; font-weight: 700; text-align: center; white-space: nowrap; }
.topbar .rechts { justify-self: end; display: flex; gap: 10px; align-items: center; font-size: 14px; }
button {
  font: inherit; color: var(--ink); background: var(--karte); border: 1.5px solid var(--rule); border-radius: 12px;
  box-shadow: var(--schatten); cursor: pointer;
}
button:active { transform: scale(.97); }
.home { justify-self: start; display: flex; align-items: center; gap: 8px; font-size: 19px; font-weight: 650; padding: 10px 20px 10px 14px; }
.home svg { width: 24px; height: 24px; fill: var(--ink); }
.pfeil { width: 62px; height: 48px; display: grid; place-items: center; }
.pfeil svg { width: 24px; height: 24px; fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.knopf { font-size: 15px; font-weight: 650; padding: 6px 16px; }

/* ---------- Monatskalender ---------- */
.monat { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 292px; gap: 22px; padding-top: 12px; }
.raster {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: 24px repeat(var(--zeilen), minmax(0, 1fr)); min-height: 0;
}
.wt { font-size: 13px; font-weight: 700; color: var(--ink); text-align: center; }
.wt.we { color: var(--soft); }
.zelle {
  border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); padding: 4px 4px 2px;
  min-height: 0; display: flex; flex-direction: column; position: relative;
}
.zelle:nth-child(7n + 7) { border-right: 1px solid var(--rule); }
.raster > .zelle:nth-last-child(-n + 7) { border-bottom: 1px solid var(--rule); }
.zelle .nr { font-size: 15px; font-weight: 650; padding: 1px 6px; align-self: flex-start; border-radius: 8px; margin-bottom: 2px; }
.zelle.fremd { background: color-mix(in srgb, var(--bg) 60%, var(--rule)); }
.zelle.fremd .nr { color: var(--soft); font-weight: 400; }
.zelle.heute .nr { background: var(--heute); color: var(--heute-ink); }
.zelle.gewaehlt { outline: 3px solid var(--akzent); outline-offset: -2px; z-index: 1; border-radius: 3px; }
.chips { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 2px; }
.chip {
  font-size: 11.5px; line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-left: 3px solid var(--f); padding: 0 4px; border-radius: 3px;
  background: color-mix(in srgb, var(--f) 13%, transparent); flex: none;
}
.chip.ganz { background: var(--f); color: #fff; font-weight: 600; border-left-color: transparent; }
.chip.mehr { border: 0; background: none; color: var(--soft); font-weight: 650; }
.chip .cz { font-weight: 650; margin-right: 4px; }
.zelle.fremd .chip { opacity: .55; }

.tagesliste { min-height: 0; display: flex; flex-direction: column; }
.tl-kopf { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--rule); margin-bottom: 4px; }
.tl-kopf .tag-kopf { border: 0; margin: 0; font-size: 17px; }
.tl-liste { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.tagesliste .termin { flex-wrap: wrap; font-size: 17px; row-gap: 2px; }
.tagesliste .termin .zeit { width: 64px; font-size: 16px; }
.tagesliste .termin.ganztags .zeit { font-size: 13px; }
.tagesliste .was { white-space: normal; flex-basis: 100%; padding-left: 74px; margin-top: -2px; }
.tagesliste .etikett { top: 0; }
.tagesliste .ort { display: block; margin-left: 0; }

/* ---------- Wetteransicht ---------- */
.wetteransicht { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding-top: 10px; }
.wa-oben { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; }
.jetzt.gross .j-symbol { width: 104px; height: 104px; }
.jetzt.gross .j-temp { font-size: 66px; }
.jetzt.gross .j-text { font-size: 20px; }
.wetteransicht .w-text { -webkit-line-clamp: 1; }
.details { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 26px; background: var(--karte); border-radius: 14px; padding: 12px 18px; box-shadow: var(--schatten); }
.details div { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; border-bottom: 1px solid var(--rule); padding-bottom: 3px; white-space: nowrap; }
.details span { color: var(--soft); }
.abschnitt { font-size: 17px; font-weight: 700; display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 2px; }
.abschnitt .leise { font-size: 12px; font-weight: 500; }
.stunden { width: 100%; height: 150px; display: block; overflow: visible; }
.stunden text { text-anchor: middle; fill: var(--ink); font-size: 12px; }
.stunden .s-std { fill: var(--soft); }
.stunden .s-std.fett { fill: var(--ink); font-weight: 700; }
.stunden .s-temp { font-size: 12.5px; font-weight: 650; }
.stunden .s-pct { fill: var(--soft); font-size: 11px; }
.stunden .s-pct.stark { fill: var(--regen); font-weight: 700; }
.stunden .s-mm { fill: #fff; font-size: 10px; font-weight: 700; }
.regenbalken { fill: var(--regen); opacity: .55; }
.tempkurve { fill: none; stroke: #e0703a; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.temppunkt { fill: #e0703a; }
.mitternacht { stroke: var(--rule); stroke-width: 1.5; stroke-dasharray: 4 4; }
.wa-tage { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tagesreihen { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: space-evenly; overflow: hidden; position: relative; }
.treihe {
  display: grid; grid-template-columns: 100px 34px 1fr 40px 150px 40px; align-items: center; gap: 12px;
  border-top: 1px solid var(--rule); padding: 2px 0; flex: none;
}
.treihe .wx { width: 32px; height: 32px; }
.t-name { font-size: 17px; font-weight: 650; }
.t-text { font-size: 16px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-text b { font-weight: 600; margin-right: 6px; }
.t-text .klein { font-size: 12.5px; }
.t-min { text-align: right; color: var(--soft); font-size: 17px; }
.t-max { font-size: 17px; font-weight: 650; }
.t-balken { height: 7px; background: var(--rule); border-radius: 4px; position: relative; }
.t-balken i { position: absolute; top: 0; bottom: 0; border-radius: 4px; background: linear-gradient(90deg, #5aa0e6, #f0a23a); min-width: 7px; }
.quelle { flex: none; font-size: 12px; color: var(--soft); text-align: right; }

/* ---------- Wettersymbole ---------- */
.wx { overflow: visible; }
.wx-sun circle { fill: var(--sonne); }
.wx-sun line { stroke: var(--sonne); stroke-width: 3.5; stroke-linecap: round; }
.wx-moon { fill: var(--mond); }
.wx-cloud { fill: var(--wolke); stroke: var(--wolke-rand); stroke-width: 2; stroke-linejoin: round; }
.wx-cloud-dark { fill: var(--wolke-dunkel); stroke: var(--wolke-dunkel-rand); stroke-width: 2; stroke-linejoin: round; }
.wx-drop { stroke: var(--regen); stroke-width: 3.5; stroke-linecap: round; }
.wx-drop.thin { stroke-width: 2.4; }
.wx-snow line { stroke: #7fb6ea; stroke-width: 2.2; stroke-linecap: round; }
.wx-bolt { fill: var(--sonne); }
.wx-fog line { stroke: var(--wolke-rand); stroke-width: 3.5; stroke-linecap: round; }
