/* Oberflaeche des Familienkalenders auf dem iPhone.
 *
 * Bewusst ohne Framework. Ausgelegt auf Bedienung mit dem Daumen: grosse
 * Beruehrflaechen, Eingabemasken als Blatt von unten, Ruecksicht auf die
 * abgerundeten Ecken und den Home-Balken (safe-area).
 */

:root {
  --grund: #ffffff;
  --flaeche: #f8fafc;
  --flaeche-2: #f1f5f9;
  --linie: #e2e8f0;
  --text: #0f172a;
  --text-leise: #64748b;
  --blau: #3b82f6;
  --rot: #dc2626;
  --heute: #eff6ff;

  --schrift: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    sans-serif;
  --rand: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --grund: #0f172a;
    --flaeche: #1e293b;
    --flaeche-2: #334155;
    --linie: #334155;
    --text: #f1f5f9;
    --text-leise: #94a3b8;
    --heute: #1e3a5f;
  }
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* Muss nach den Regeln mit display stehen: sonst gewinnt zum Beispiel
   .app { display: flex } gegen das hidden-Attribut und der Anmeldebildschirm
   zeigt Teile der App. */
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  height: 100%;
  overscroll-behavior: none;
}

body {
  background: var(--grund);
  color: var(--text);
  font-family: var(--schrift);
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

/* ----------------------------------------------------------------- Knoepfe */

.knopf {
  border: none;
  border-radius: var(--rand);
  padding: 14px 18px;
  background: var(--blau);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.knopf-voll {
  display: block;
  width: 100%;
}

.knopf-gefahr {
  background: var(--rot);
}

.knopf-klein {
  border: 1px solid var(--linie);
  border-radius: 999px;
  padding: 6px 14px;
  background: var(--flaeche);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.knopf-blank {
  border: none;
  background: none;
  padding: 8px 10px;
  font-size: 17px;
  color: var(--blau);
  cursor: pointer;
}

.knopf-stark {
  font-weight: 700;
}

.knopf-leise {
  color: var(--text-leise);
  font-size: 15px;
}

/* --------------------------------------------------------------- Anmeldung */

.anmeldung {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
}

.anmeldung-form {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.anmeldung-form h1 {
  margin: 0 0 8px;
  font-size: 28px;
  text-align: center;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-leise);
}

input,
select,
textarea {
  border: 1px solid var(--linie);
  border-radius: var(--rand);
  padding: 12px 14px;
  background: var(--flaeche);
  font-weight: 400;
  color: var(--text);
  /* 16px verhindert, dass iOS beim Tippen hineinzoomt. */
  font-size: 16px;
}

textarea {
  resize: vertical;
}

.hinweis {
  margin: 0;
  font-size: 14px;
  color: var(--rot);
}

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

.leise {
  color: var(--text-leise);
  font-weight: 400;
}

/* ------------------------------------------------------------- Grundaufbau */

.app {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.kopf {
  flex: none;
  padding: max(8px, env(safe-area-inset-top)) 12px 8px;
  border-bottom: 1px solid var(--linie);
  background: var(--grund);
}

.kopf-oben {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
}

.kopf-oben .knopf-blank {
  font-size: 28px;
  line-height: 1;
}

.kopf-titel {
  text-align: center;
  font-size: 19px;
  font-weight: 700;
}

.kopf-unten {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
}

.ansichten {
  display: flex;
  background: var(--flaeche-2);
  border-radius: 999px;
  padding: 3px;
}

.ansicht {
  border: none;
  background: none;
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-leise);
  cursor: pointer;
}

.ansicht.aktiv {
  background: var(--grund);
  color: var(--text);
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.12);
}

.inhalt {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.fuss {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--linie);
  font-size: 14px;
  color: var(--text-leise);
}

.ich {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.ich::before {
  content: '';
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--farbe, var(--blau));
}

.plus {
  position: fixed;
  right: 20px;
  bottom: calc(64px + env(safe-area-inset-bottom));
  width: 60px;
  height: 60px;
  border: none;
  border-radius: 50%;
  background: var(--blau);
  color: #fff;
  font-size: 34px;
  line-height: 1;
  box-shadow: 0 4px 14px rgb(0 0 0 / 0.25);
  cursor: pointer;
  z-index: 10;
}

/* ----------------------------------------------------------- Monatsansicht */

/* Aufbau nach Alwins Vorlage: links die Kalenderwoche, dann sieben Spalten.
   Mehrtaegige Eintraege wie Ferien laufen als Band durch. */

.monat-kopf {
  display: grid;
  grid-template-columns: 22px repeat(7, minmax(0, 1fr));
  padding: 6px 0;
  border-bottom: 1px solid var(--linie);
  position: sticky;
  top: 0;
  background: var(--grund);
  z-index: 2;
}

.monat-kopf span {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-leise);
}

.monat-woche {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  border-bottom: 1px solid var(--linie);
}

/* Die Kalenderwoche steht klein und blass am Rand — sie soll da sein, wenn
   man sie sucht, und sonst nicht stoeren. */
.monat-kw {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-leise);
  text-align: center;
  padding-top: 6px;
  border-right: 1px solid var(--linie);
}

.monat-raster {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px 1px;
  padding: 4px 2px 6px;
  min-height: 76px;
}

.monat-zahl-zelle {
  text-align: center;
}

.monat-zahl {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  min-width: 22px;
  padding: 2px 0;
  border-radius: 999px;
}

.monat-zahl.fremd {
  color: var(--text-leise);
  opacity: 0.5;
}

.monat-zahl.ist-heute {
  background: var(--blau);
  color: #fff;
}

/* Band fuer Ferien und Feiertage. Es spannt ueber so viele Tage, wie der
   Zeitraum in dieser Woche dauert. */
.monat-band {
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  padding: 2px 5px;
  border-radius: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
}

.monat-band.ferien {
  background: #16a34a;
}

.monat-band.feiertag {
  background: #dc2626;
}

/* Laeuft der Zeitraum ueber den Wochenrand hinaus, bleibt die Kante gerade —
   so sieht man, dass es weitergeht. */
.monat-band.offen-links {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.monat-band.offen-rechts {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.monat-stapel {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 0 1px;
  cursor: pointer;
  border-radius: 4px;
}

.monat-stapel.ist-heute {
  background: var(--heute);
}

.monat-stapel.fremd {
  opacity: 0.45;
}

/* Farbige Kachel je Termin, in der Farbe der Person. */
/* Helle Flaeche in der Personenfarbe mit dunklem Text und kraeftigem
   Streifen an der Seite.
   Vorteil gegenueber einer voll gefuellten Kachel: die gewaehlte Farbe bleibt
   sichtbar, auch bei hellen Toenen wie Gelb, und der Text ist immer lesbar.
   color-mix mischt mit dem Seitenhintergrund — dadurch stimmt es auch im
   dunklen Erscheinungsbild. */
.monat-kachel {
  font-size: 10px;
  font-weight: 600;
  color: var(--text);
  background: var(--farbe, var(--blau));
  background: color-mix(in srgb, var(--farbe, var(--blau)) 22%, var(--grund));
  border-left: 3px solid var(--farbe, var(--blau));
  border-radius: 3px;
  padding: 2px 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
}

.monat-mehr {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-leise);
  padding-left: 3px;
}

/* -------------------------------------------------- Wochen- und Tagesansicht */

.liste {
  padding: 8px 12px calc(90px + env(safe-area-inset-bottom));
}

.listen-tag {
  margin-top: 18px;
}

.listen-tag:first-child {
  margin-top: 4px;
}

.listen-tag-kopf {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 2px 8px;
  font-weight: 700;
}

.listen-tag-kopf.ist-heute {
  color: var(--blau);
}

.listen-tag-datum {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-leise);
}

.eintrag {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--flaeche);
  border-radius: var(--rand);
  border-left: 5px solid var(--farbe, var(--blau));
  padding: 12px 14px;
  margin-bottom: 8px;
  cursor: pointer;
}

.eintrag-zeit {
  flex: none;
  width: 58px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-leise);
  font-variant-numeric: tabular-nums;
}

.eintrag-text {
  min-width: 0;
}

.eintrag-titel {
  font-weight: 600;
}

.eintrag-zusatz {
  font-size: 14px;
  color: var(--text-leise);
  margin-top: 2px;
}

.leer {
  text-align: center;
  color: var(--text-leise);
  padding: 40px 20px;
}

/* --------------------------------------------------------- Blatt von unten */

.blatt {
  border: none;
  padding: 0;
  margin: 0 auto auto;
  width: 100%;
  max-width: 560px;
  max-height: 92dvh;
  border-radius: 20px 20px 0 0;
  background: var(--grund);
  color: var(--text);
  position: fixed;
  bottom: 0;
  top: auto;
}

.blatt::backdrop {
  background: rgb(0 0 0 / 0.45);
}

.blatt-kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 8px;
  border-bottom: 1px solid var(--linie);
  position: sticky;
  top: 0;
  background: var(--grund);
}

.blatt-koerper {
  padding: 16px 16px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}

.blatt-koerper h2 {
  margin: 0;
  font-size: 17px;
}

.blatt-koerper hr {
  border: none;
  border-top: 1px solid var(--linie);
  margin: 4px 0;
}

.feldpaar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* -------------------------------------------------------- Verbindungshinweis */

.verbindung {
  position: fixed;
  left: 50%;
  bottom: calc(70px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--rot);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  z-index: 30;
}

/* ------------------------------------------------------- Auswahl beim Plus */

.wahl {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--linie);
  border-radius: var(--rand);
  background: var(--flaeche);
  padding: 14px 16px;
  cursor: pointer;
}

.wahl-symbol {
  font-size: 28px;
  line-height: 1;
  flex: none;
}

.wahl-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.wahl-text small {
  color: var(--text-leise);
  font-size: 14px;
}

/* ------------------------------------------------------------- Anhaenge */

.feldgruppe {
  margin: 4px 0 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-leise);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.anhang-bereich {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--linie);
  padding-top: 14px;
}

.anhang-liste,
.anhang-wartend {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.anhang {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--flaeche);
  border-radius: var(--rand);
  padding: 10px 12px;
}

.anhang-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.anhang-name a {
  color: var(--blau);
  text-decoration: none;
}

.anhang-groesse {
  font-size: 13px;
  color: var(--text-leise);
  flex: none;
}

.anhang-weg {
  border: none;
  background: none;
  color: var(--rot);
  font-size: 20px;
  line-height: 1;
  padding: 4px 6px;
  cursor: pointer;
  flex: none;
}

.anhang.wartet .anhang-name {
  color: var(--text-leise);
}

/* Die eigentliche Dateiauswahl ist unschoen — deshalb versteckt und ueber
   das Label bedient. */
.dateiwahl {
  display: block;
  border: 2px dashed var(--linie);
  border-radius: var(--rand);
  padding: 14px;
  text-align: center;
  color: var(--blau);
  font-weight: 600;
  cursor: pointer;
}

.dateiwahl input {
  display: none;
}

.bildvorschau {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  align-self: center;
  border: 3px solid var(--linie);
}

/* --------------------------------------------------------------- Zettel */

.blatt-hoch {
  max-height: 94dvh;
}

.zettelvorschau {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: var(--rand);
  background: var(--flaeche-2);
}

.laeuft {
  text-align: center;
  font-weight: 600;
  padding: 24px 0 8px;
}

.laeuft::after {
  content: '';
  display: block;
  width: 32px;
  height: 32px;
  margin: 16px auto 0;
  border: 3px solid var(--linie);
  border-top-color: var(--blau);
  border-radius: 50%;
  animation: dreht 0.9s linear infinite;
}

@keyframes dreht {
  to {
    transform: rotate(360deg);
  }
}

/* Ein Vorschlag aus dem Zettel — alle Felder sind aenderbar, bevor
   gespeichert wird. */
.vorschlag {
  border: 1px solid var(--linie);
  border-radius: var(--rand);
  padding: 12px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vorschlag.unsicher {
  border-color: #f59e0b;
  background: #fffbeb;
}

@media (prefers-color-scheme: dark) {
  .vorschlag.unsicher {
    background: #422006;
  }
}

.vorschlag-kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.vorschlag-warnung {
  font-size: 13px;
  font-weight: 700;
  color: #b45309;
}

.vorschlag-weg {
  border: none;
  background: none;
  color: var(--rot);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px;
}

.vorschlag label {
  font-size: 13px;
}

.vorschlag input,
.vorschlag select {
  padding: 8px 10px;
}

/* ------------------------------------------------------- Personenliste */

.personenliste {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.personenzeile {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--rand);
  padding: 10px 12px;
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.personenbild {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  border: 2px solid var(--farbe, var(--blau));
  background: var(--flaeche-2);
}

.personenkreis {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex: none;
  background: var(--farbe, var(--blau));
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
}

.personenname {
  flex: 1;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.personenrolle {
  font-size: 13px;
  color: var(--text-leise);
  flex: none;
}

/* --------------------------------------------------------- Bildzuschnitt */

.zuschnitt {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

/* Quadratische Buehne, in der das Bild frei liegt. Der Kreis darueber zeigt,
   was spaeter zu sehen ist. */
.zuschnitt-buehne {
  position: relative;
  width: 240px;
  height: 240px;
  overflow: hidden;
  border-radius: var(--rand);
  background: var(--flaeche-2);
  touch-action: none; /* sonst scrollt iOS statt zu verschieben */
  cursor: grab;
  user-select: none;
}

.zuschnitt-buehne:active {
  cursor: grabbing;
}

.zuschnitt-bild {
  position: absolute;
  transform-origin: 0 0;
  pointer-events: none;
  max-width: none;
}

/* Alles ausserhalb des Kreises wird abgedunkelt — der grosse Schatten ist
   billiger als eine echte Maske und funktioniert ueberall. */
.zuschnitt-maske {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: var(--rand);
  box-shadow: inset 0 0 0 999px rgb(0 0 0 / 0.45);
  -webkit-mask:
    radial-gradient(circle at 50% 50%, transparent 119px, #000 120px);
  mask: radial-gradient(circle at 50% 50%, transparent 119px, #000 120px);
}

.zuschnitt input[type='range'] {
  width: 240px;
  padding: 0;
  border: none;
  background: none;
}

/* Der Farbwaehler braucht eigene Regeln: die allgemeinen Eingabefeld-Regeln
   (Polsterung, Hintergrund) verdecken sonst die Farbflaeche. */
input[type='color'] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 52px;
  padding: 4px;
  background: var(--flaeche);
  cursor: pointer;
}

input[type='color']::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type='color']::-webkit-color-swatch {
  border: none;
  border-radius: 8px;
}

input[type='color']::-moz-color-swatch {
  border: none;
  border-radius: 8px;
}

/* ---------------------------------------------------- Geburtstagsübersicht */

.kopf-knoepfe {
  display: flex;
  align-items: center;
  gap: 8px;
}

.knopf-symbol {
  border: 1px solid var(--linie);
  border-radius: 999px;
  background: var(--flaeche);
  font-size: 17px;
  line-height: 1;
  padding: 6px 10px;
  cursor: pointer;
}

.gebgruppe {
  margin-bottom: 18px;
}

.gebgruppe-titel {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-leise);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0 0 8px;
}

/* Die naechsten Geburtstage stehen oben — das ist die Frage, die man
   tatsaechlich hat: wer kommt als Naechstes dran. */
.gebgruppe.naechste .gebzeile {
  background: var(--heute);
}

.gebzeile {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--rand);
  padding: 10px 12px;
  margin-bottom: 6px;
  cursor: pointer;
}

.gebzeile.ist-heute {
  background: #fef3c7;
  border-color: #f59e0b;
}

@media (prefers-color-scheme: dark) {
  .gebzeile.ist-heute {
    background: #422006;
  }
}

.gebdatum {
  flex: none;
  width: 58px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-leise);
}

.gebzeile.ist-heute .gebdatum {
  color: #b45309;
}

.gebname {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.gebalter {
  flex: none;
  font-size: 14px;
  color: var(--text-leise);
}

.gebbald {
  flex: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--blau);
}

/* Der Wochentag neben dem Datumsfeld. Das Eingabefeld zeigt nur Zahlen —
   ob der 17. ein Dienstag ist, sieht man sonst nirgends. */
.wochentag {
  font-weight: 500;
  color: var(--blau);
  text-transform: none;
}

.wochentag:not(:empty)::before {
  content: '— ';
  color: var(--text-leise);
}

/* Umschalter fuer mehrtaegige Termine */
.schalter {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--text);
}

.schalter input[type='checkbox'] {
  width: 22px;
  height: 22px;
  flex: none;
  padding: 0;
  accent-color: var(--blau);
}

/* Band eines mehrtaegigen Termins in der Monatsansicht. Anders als bei
   Ferien und Feiertagen traegt es die Personenfarbe. */
.monat-band.termin {
  background: var(--farbe, var(--blau));
  background: color-mix(in srgb, var(--farbe, var(--blau)) 30%, var(--grund));
  color: var(--text);
  border-left: 3px solid var(--farbe, var(--blau));
}

/* ------------------------------------------------ Abgesagt und wichtig */

.eintrag.abgesagt {
  opacity: 0.55;
}

.eintrag.abgesagt .eintrag-titel {
  text-decoration: line-through;
}

.eintrag.hervorgehoben {
  border: 2px solid var(--rot);
}

.monat-kachel.abgesagt {
  opacity: 0.5;
  text-decoration: line-through;
}

.monat-kachel.hervorgehoben {
  outline: 2px solid var(--rot);
}

/* Kleiner Stempel neben dem Titel. */
.stempel {
  display: inline-block;
  margin-left: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rot);
  border: 1px solid var(--rot);
  border-radius: 4px;
  padding: 0 4px;
  text-decoration: none;
  vertical-align: middle;
}

.wichtig {
  margin-right: 4px;
}

/* Hinweis auf Ueberschneidungen — Warnung, keine Fehlermeldung. */
.hinweis.warnung {
  color: #b45309;
  background: #fef3c7;
  border-radius: var(--rand);
  padding: 10px 12px;
  font-weight: 500;
}

@media (prefers-color-scheme: dark) {
  .hinweis.warnung {
    background: #422006;
    color: #fcd34d;
  }
}

/* ----------------------------------------------------- Schaltzeiten TV */

.zeitenliste {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.zeitzeile {
  display: grid;
  /* minmax(0, ...) statt fester Breiten: sonst waechst eine Spalte mit
     langem Inhalt ueber den Bildschirmrand hinaus und der Loeschknopf am
     Ende ist nicht mehr erreichbar. */
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.1fr) 30px;
  gap: 6px;
  align-items: center;
}

.zeitzeile select,
.zeitzeile input {
  padding: 10px 4px;
  font-size: 14px;
  min-width: 0;
  text-align: center;
}

/* Der Zustand soll sofort erkennbar sein, ohne zu lesen. */
.zeitzeile select.aktion-an {
  background: #dcfce7;
  color: #15803d;
  font-weight: 700;
}

.zeitzeile select.aktion-aus {
  background: var(--flaeche-2);
  color: var(--text-leise);
  font-weight: 700;
}

@media (prefers-color-scheme: dark) {
  .zeitzeile select.aktion-an {
    background: #14532d;
    color: #86efac;
  }
}

.zeitweg {
  border: none;
  background: none;
  color: var(--rot);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

/* Der Radioknopf faerbt sich, wenn das Radio laeuft — so sieht man den
   Zustand, ohne ihn antippen zu muessen. */
.knopf-symbol.laeuft {
  background: #1d4ed8;
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgb(29 78 216 / 0.2);
}
