/* Tagebuch (nur Eltern), Karte über der Statistik. Nutzt die Farben und Bausteine aus app.css. */
.tagebuch .tb-unter { color: var(--leise); font-size: 14px; margin: -2px 0 14px; }
.tagebuch .tb-neu { width: 100%; margin-bottom: 6px; }
.tagebuch .tb-neu span { font-weight: 800; margin-right: 4px; }

/* Kopf zum Auf- und Zuklappen (05.12.2026) */
.tagebuch .tb-kopf { display: flex; align-items: center; gap: 8px; }
.tagebuch .tb-h2 { flex: 1; min-width: 0; margin: 0; }
.tb-auf {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0; margin: 0;
  background: none; border: 0; color: inherit; font: inherit; letter-spacing: inherit; text-align: left; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tb-auf-titel { flex: none; }
.tb-auf .zahl-chip { flex: none; }
.tb-pfeil {
  flex: none; margin-left: auto; width: 32px; height: 32px; border-radius: 50%; background: var(--karte-2); border: 1px solid var(--rand);
  display: grid; place-items: center;
}
.tb-pfeil::before {
  content: ""; width: 8px; height: 8px; border-right: 2.5px solid var(--leise); border-bottom: 2.5px solid var(--leise);
  transform: translateY(-2px) rotate(45deg); transition: transform 0.2s ease;
}
.tb-auf[aria-expanded="true"] .tb-pfeil::before { transform: translateY(2px) rotate(-135deg); }
.tb-auf:focus-visible { outline: 2px solid var(--karamell); outline-offset: 4px; border-radius: 12px; }
.tb-plus {
  flex: none; width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--espresso); color: #FBEBD6; font-size: 20px; font-weight: 800; line-height: 1; display: grid; place-items: center;
}
@media (prefers-color-scheme: dark) { .tb-plus { background: var(--karamell); color: #1C120A; } }
.tagebuch:not(.zu) .tb-plus { display: none; }
.tagebuch .tb-koerper { margin-top: 10px; }

/* Eingeklappt: Vorschau auf den letzten Eintrag */
.tb-letzter {
  display: flex; flex-direction: column; gap: 8px; width: 100%; margin-top: 10px; text-align: left; cursor: pointer;
  background: var(--karte-2); border: 1px solid var(--rand); border-radius: 18px; padding: 12px 14px; color: inherit; font: inherit;
}
.tb-letzter[hidden] { display: none; }
.tb-letzter:active { transform: scale(0.99); }
.tb-l-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.tb-l-titel { font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--leise); }
.tb-l-her { font-size: 12px; font-weight: 750; color: var(--karamell-tief, var(--karamell)); white-space: nowrap; }
@media (prefers-color-scheme: dark) { .tb-l-her { color: var(--gold); } }
.tb-l-zeile { display: flex; gap: 12px; align-items: flex-start; padding-left: 10px; border-left: 4px solid var(--karamell); }
.tb-l-zeile.tb-einschlafen { border-left-color: var(--nacht); }
.tb-l-zeile.tb-nacht { border-left-color: var(--espresso); }
.tb-l-zeile.tb-meilenstein { border-left-color: var(--gut); }
@media (prefers-color-scheme: dark) { .tb-l-zeile.tb-nacht { border-left-color: var(--gold); } }
.tb-letzter .tb-l-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; white-space: normal; }
.tb-letzter.leer .tb-l-text { color: var(--leise); font-size: 15px; }

.tb-form { background: var(--karte-2); border: 1px solid var(--rand); border-radius: 20px; padding: 14px 14px 10px; margin-bottom: 8px; }
.tb-form .teil-titel { font-weight: 800; margin-bottom: 10px; }
.tb-feld-label { display: block; font-size: 13px; font-weight: 700; color: var(--leise); }
.tb-form .feld { background: var(--karte); margin: 4px 0 12px; }
.tb-datum-feld { min-height: 48px; -webkit-appearance: none; appearance: none; }
.tb-themen { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.tb-themen .chip { background: var(--karte); font-size: 14px; padding: 10px 8px; }
.tb-text-feld { resize: vertical; min-height: 110px; line-height: 1.4; margin-bottom: 4px !important; }
.tb-zaehler { font-size: 12px; color: var(--leise); text-align: right; min-height: 4px; }
.tb-fehler { color: var(--warn); font-size: 14px; font-weight: 650; min-height: 4px; margin: 2px 0 8px; }
.tb-fehler:empty { margin: 0; }
.tb-loeschen { display: block; margin: 12px auto 4px; background: none; border: 0; color: var(--warn); font-weight: 700; font-size: 15px; padding: 6px 12px; cursor: pointer; }

.tb-msg { font-size: 14px; color: var(--gut); font-weight: 700; margin: 8px 2px 0; }
.tb-msg.fehler { color: var(--warn); }
.tb-leer { color: var(--leise); font-size: 15px; padding: 6px 2px 2px; }

.tb-liste { margin-top: 8px; }
.tb-tag + .tb-tag { margin-top: 14px; }
.tb-tag-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 0 2px 6px; border-bottom: 1px solid var(--rand); margin-bottom: 8px; }
.tb-datum { font-weight: 800; font-size: 15px; }
.tb-alter { font-size: 12px; color: var(--leise); white-space: nowrap; }

.tb-eintrag {
  display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; cursor: pointer;
  background: var(--karte-2); border: 1px solid var(--rand); border-radius: 18px; padding: 12px 14px; margin-bottom: 8px;
  border-left: 4px solid var(--karamell);
}
.tb-eintrag:active { transform: scale(0.99); }
.tb-eintrag.tb-einschlafen { border-left-color: var(--nacht); }
.tb-eintrag.tb-nacht { border-left-color: var(--espresso); }
.tb-eintrag.tb-meilenstein { border-left-color: var(--gut); }
@media (prefers-color-scheme: dark) { .tb-eintrag.tb-nacht { border-left-color: var(--gold); } }
.tb-symbol { font-size: 20px; line-height: 1.3; flex: none; }
.tb-inhalt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tb-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; line-height: 1.4; }
.tb-meta { font-size: 12.5px; color: var(--leise); font-weight: 600; }
.tagebuch .tb-mehr { width: 100%; margin-top: 4px; }
.tb-koerper[hidden] { display: none; }
