/* termine.css — Terminplaner (ADR-067). Farben nur aus farben.css, Formen aus bausteine.css. */

/* ---------- Oben: der große Knopf, Kalender wählen, Blättern und Ansicht ---------- */
#inhalt .tm-kalender-wahl { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
#inhalt .tm-kal {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1.5px solid var(--rand); background: var(--karte); color: var(--text-leise); text-decoration: none; font-weight: 600;
}
#inhalt .tm-kal.an { color: var(--text); border-color: var(--tm-farbe); }
#inhalt .tm-punkt { width: 10px; height: 10px; border-radius: 50%; background: var(--rand); }
#inhalt .tm-kal.an .tm-punkt { background: var(--tm-farbe); }

#inhalt .tm-leiste { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0 0 12px; }
#inhalt .tm-blaettern { display: flex; gap: 6px; }
#inhalt .tm-pfeil { min-width: 44px; justify-content: center; }
#inhalt .tm-zeitraum { margin: 0; font-size: 1.2rem; color: var(--text); flex: 1 1 auto; }
#inhalt .tm-ansicht { display: inline-flex; border: 1.5px solid var(--rand); border-radius: 999px; overflow: hidden; background: var(--karte); }
#inhalt .tm-ansicht-knopf { min-height: 44px; padding: 0 16px; display: inline-flex; align-items: center; color: var(--text); text-decoration: none; font-weight: 600; }
#inhalt .tm-ansicht-knopf.an { background: var(--akzent); color: var(--auf-akzent); }

/* ---------- Farben je Kalender (eigener zuerst) ---------- */
#inhalt .tm-farbe-0 { --tm-farbe: var(--akzent); }
#inhalt .tm-farbe-1 { --tm-farbe: var(--gold); }
#inhalt .tm-farbe-2 { --tm-farbe: var(--lila); }
#inhalt .tm-farbe-3 { --tm-farbe: var(--blau); }

/* ---------- Ein Eintrag ---------- */
#inhalt .tm-liste { background: var(--karte); border: 1px solid var(--bs-kante); border-radius: var(--bs-rund); box-shadow: var(--bs-schatten); overflow: hidden; }
#inhalt .tm-eintrag {
  display: grid; grid-template-columns: 7.5em 1fr; gap: 12px; align-items: baseline; padding: 14px 16px;
  border-left: 4px solid var(--tm-farbe, var(--akzent)); color: var(--text); text-decoration: none;
}
#inhalt .tm-liste .tm-eintrag + .tm-eintrag { border-top: 1px solid var(--linie); }
#inhalt a.tm-eintrag:hover, #inhalt a.tm-eintrag:focus-visible { background: var(--flaeche); }
#inhalt .tm-zeit { color: var(--text-leise); font-variant-numeric: tabular-nums; font-size: .92rem; }
#inhalt .tm-zeit-bis::before { content: '–'; }
#inhalt .tm-text { display: grid; gap: 2px; min-width: 0; }
#inhalt .tm-titel { font-weight: 600; overflow-wrap: break-word; }   /* W3c: nie mitten im Wort, nur ein zu langes Wort allein */
#inhalt .tm-unter { color: var(--text-leise); font-size: .9rem; }
#inhalt .tm-belegt .tm-titel { color: var(--text-leise); font-style: italic; }
/* Aus dem Programm, nur zum Lesen: leise, ohne Farbkante des Kalenders */
#inhalt .tm-nurlesen { border-left-color: var(--rand); }
#inhalt .tm-nurlesen .tm-titel { font-weight: 500; color: var(--text-leise); }
#inhalt .tm-team { color: var(--text-leise); font-size: .9rem; padding: 6px 2px 10px; }

/* ---------- Woche: sieben Spalten, am Handy untereinander ---------- */
#inhalt .tm-woche { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
#inhalt .tm-spalte {
  background: var(--karte); border: 1px solid var(--bs-kante); border-radius: var(--bs-rund-klein); padding: 8px; min-height: 180px;
  display: flex; flex-direction: column; gap: 6px; min-width: 0;
}
#inhalt .tm-spalte.tm-wochenende { background: var(--flaeche); }
#inhalt .tm-spalte.tm-heute { border-color: var(--akzent); box-shadow: 0 0 0 1px var(--akzent); }
#inhalt .tm-spalte-kopf { display: flex; gap: 6px; align-items: baseline; min-height: 44px; box-sizing: border-box; text-decoration: none; color: var(--text); padding: 2px 4px 6px; }
#inhalt .tm-wt { color: var(--text-leise); font-size: .85rem; font-weight: 600; }
#inhalt .tm-nr { font-weight: 700; font-variant-numeric: tabular-nums; }
#inhalt .tm-spalte .tm-eintrag { grid-template-columns: 1fr; gap: 2px; padding: 6px 8px; border-radius: 8px; background: var(--flaeche); font-size: .9rem; }
#inhalt .tm-spalte .tm-team { padding: 0 4px; font-size: .8rem; }
/* Schmale Spalte: bis zu drei Zeilen mit deutscher Silbentrennung („Bewerbungs-gespräch“) statt „Bankgespräch …“ (Klicktest 11.11.);
   nie mitten im Wort ohne Strich (W3c) — erst nach drei Zeilen „…“, der ganze Titel steht im Tooltip und im Termin */
#inhalt .tm-spalte .tm-titel { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; hyphens: auto; -webkit-hyphens: auto; }
#inhalt .tm-frei { color: var(--text-leise); font-size: .9rem; padding: 0 4px; }

/* ---------- Monat ---------- */
#inhalt .tm-monat-kopf, #inhalt .tm-gitter { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
#inhalt .tm-monat-kopf span { color: var(--text-leise); font-size: .85rem; font-weight: 600; padding: 0 6px 4px; }
#inhalt .tm-zelle {
  min-height: 108px; background: var(--karte); border: 1px solid var(--bs-kante); border-radius: var(--bs-rund-klein); padding: 6px;
  display: flex; flex-direction: column; gap: 3px; text-decoration: none; color: var(--text); min-width: 0;
}
#inhalt .tm-zelle.tm-anders { opacity: .55; }
#inhalt .tm-zelle.tm-heute { border-color: var(--akzent); box-shadow: 0 0 0 1px var(--akzent); }
#inhalt .tm-zelle.tm-heute .tm-nr { color: var(--akzent-text); }
#inhalt .tm-mini {
  font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid var(--tm-farbe, var(--akzent));
  padding: 1px 5px; border-radius: 4px; background: var(--flaeche);
}
#inhalt .tm-mini.tm-dienst, #inhalt .tm-mini.tm-abwesenheit, #inhalt .tm-team-mini { border-left-color: var(--rand); color: var(--text-leise); }
#inhalt .tm-mehr { font-size: .78rem; color: var(--text-leise); padding: 0 4px; }

/* ---------- Formular und Unterseiten ---------- */
#inhalt .tm-formular {
  background: var(--karte); border: 1px solid var(--bs-kante); border-radius: var(--bs-rund); box-shadow: var(--bs-schatten);
  padding: 20px; display: grid; gap: 14px; max-width: 720px;
}
#inhalt .tm-feld { margin: 0; display: grid; gap: 6px; color: var(--text); font-weight: 600; }
#inhalt .tm-feld input, #inhalt .tm-feld select, #inhalt .tm-feld textarea { min-height: 44px; font-size: 1rem; }
#inhalt .tm-feld [hidden], #inhalt [hidden] { display: none; }
#inhalt .tm-zwei { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: end; }
#inhalt .tm-haken { display: flex; align-items: center; gap: 8px; margin: 0; min-height: 44px; font-weight: 600; color: var(--text); }
#inhalt .tm-fuss { display: flex; gap: 12px; flex-wrap: wrap; justify-content: space-between; align-items: center; margin-top: 4px; }
#inhalt .tm-speichern { min-height: 52px; min-width: 220px; justify-content: center; font-size: 1.05rem; }
#inhalt .tm-schritte { max-width: 720px; color: var(--text); line-height: 1.5; padding-left: 1.3em; }
#inhalt .tm-ergebnis { display: grid; gap: 12px; }
#inhalt .tm-leise { color: var(--text-leise); font-size: .9rem; margin: 14px 0 0; }
#inhalt .tm-schalter input { transform: scale(1.4); margin: 0 10px; }
.tm-frage h2 { margin-top: 0; }

/* ---------- Handy: Woche als Liste, Monat als ruhiges Raster ---------- */
@media (max-width: 720px) {
  #inhalt .tm-leiste { gap: 8px; }
  #inhalt .tm-zeitraum { order: -1; flex-basis: 100%; }
  /* Am Handy (Klicktest 11.11.): Ansicht und Blättern je eine volle Zeile mit gleich breiten Teilen — nichts hängt rechts allein */
  #inhalt .tm-ansicht { order: 0; flex: 1 1 100%; display: flex; }
  #inhalt .tm-ansicht-knopf { flex: 1; justify-content: center; padding: 0 12px; }
  #inhalt .tm-blaettern { order: 1; flex: 1 1 100%; }
  #inhalt .tm-blaettern > a { flex: 1; justify-content: center; }
  /* Woche als Liste: der Titel hat die ganze Breite — ganz zeigen statt kürzen */
  #inhalt .tm-spalte .tm-titel { display: block; -webkit-line-clamp: none; overflow: visible; }
  #inhalt .tm-eintrag { grid-template-columns: 6.2em 1fr; padding: 14px 12px; }
  /* Tagesliste wie „Mein Morgen“: Beginn oben, Ende leise darunter — die Uhrzeit-Spalte bleibt schmal */
  #inhalt .tm-tag .tm-eintrag { grid-template-columns: 4.6em 1fr; }
  #inhalt .tm-tag .tm-zeit { color: var(--text); font-weight: 600; }
  #inhalt .tm-tag .tm-zeit-bis { display: block; color: var(--text-leise); font-weight: 400; font-size: .85rem; }
  #inhalt .tm-tag .tm-zeit-bis::before { content: none; }
  #inhalt .tm-woche { grid-template-columns: 1fr; gap: 6px; }
  /* Woche am Handy (Klicktest 11.11.): links fest der Tag, rechts alle Einträge bündig untereinander —
     vorher rutschte der erste Eintrag unter den Tag und die übrigen eingerückt daneben */
  #inhalt .tm-spalte { min-height: 0; display: grid; grid-template-columns: 3em minmax(0, 1fr); column-gap: 10px; row-gap: 0; grid-auto-rows: min-content; align-items: start; }
  #inhalt .tm-spalte > :not(.tm-spalte-kopf):not(:last-child) { margin-bottom: 6px; }
  #inhalt .tm-spalte-kopf { grid-column: 1; grid-row: 1 / span 30; flex-direction: column; align-items: center; gap: 0; padding: 4px 0; min-height: 44px; }
  #inhalt .tm-spalte > :not(.tm-spalte-kopf) { grid-column: 2; }
  #inhalt .tm-spalte .tm-frei { align-self: center; min-height: 44px; display: flex; align-items: center; }
  #inhalt .tm-zelle { min-height: 52px; padding: 4px; align-items: center; }
  #inhalt .tm-monat-kopf, #inhalt .tm-gitter { gap: 3px; }
  #inhalt .tm-monat-kopf span { text-align: center; padding: 0; }
  #inhalt .tm-mehr { color: var(--akzent-text); letter-spacing: 1px; }
  #inhalt .tm-formular { padding: 16px; }
  #inhalt .tm-speichern { width: 100%; }
}
