/* ─────────────────────────────────────────────────────────────────────────
   biodanza-cockpit — css/mod-notes.css

   Geschichtserzaehlung: Stile des Bau-Pakets "notes+reflection" — Notizen & Vortraege, Reflexionen, Audio-Notizen, Verlauf. Praefixe .notes-, .reflection-, .history-.
   Gehoert NUR diesem Paket (Parallel-Bau-Schutz, DECISION in modules.css).

   Regeln fuer alle Modul-Stile:
     - Farben nur als var(--color-...), Abstaende als var(--space-...) —
       sonst bleibt der Screen im Dunkel- und Ruhig-Modus hell
     - Klassen mit Modul-Praefix, damit nichts in fremde Screens wirkt
     - Ruhiger Modus: :root[data-quiet="true"] .mein-element { ... }
     - Touch-Ziele mindestens 44 px; 360 px Breite ohne horizontales Scrollen
   ───────────────────────────────────────────────────────────────────────── */

/* ── Editor-Screens: Karten ohne Titel stehen dicht beieinander ──
   .section + .section (Kern) setzt Aussenabstand, .stack zusaetzlich gap —
   zusammen eine Doppel-Luecke zwischen zusammengehoerigen Karten. */
.notes-detail > .section + .section,
.reflection-editor > .section + .section {
  margin-top: 0;
}

/* ── Notiz-Editor: Kategorie-Vorschlaege, Werkzeugleiste, Vorschau ── */
.notes-title {
  min-height: var(--input-h);
  resize: none;            /* waechst selbst mit (autoGrow), kein Zieh-Griff */
  font-weight: var(--font-weight-semibold);
}

.notes-suggestions {
  flex-wrap: wrap;
}

.notes-toolbar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}

.notes-format {
  min-height: var(--touch-min);
  justify-content: center;
}

/* Die Knoepfe zeigen ihre Wirkung selbst: Fett ist fett, Kursiv ist kursiv. */
.notes-format--bold {
  font-weight: var(--font-weight-bold);
}

.notes-format--italic {
  font-style: italic;
}

.notes-hint {
  margin: 0;
}

/* Vorschau (auch im Session-Datei-Overlay und in der Druckansicht genutzt) */
.notes-preview {
  overflow-wrap: anywhere;
  line-height: var(--line-height-body);
}

.notes-preview > p,
.notes-preview > ul {
  margin: 0 0 var(--space-3);
}

.notes-preview > :last-child {
  margin-bottom: 0;
}

.notes-preview ul {
  padding-left: var(--space-5);
  list-style: disc;        /* Basis-CSS nimmt Listen die Punkte */
}

.notes-preview li + li {
  margin-top: var(--space-1);
}

/* ── Reflexion: Kopf "worum es geht", Uebungs-Log, Audio-Notiz ── */
.reflection-subject__title {
  margin: 0;
  font-size: var(--font-size-subtitle);
  font-weight: var(--font-weight-semibold);
  overflow-wrap: anywhere;
}

.reflection-subject .muted,
.reflection-subject__heading {
  margin: 0;
}

.reflection-subject__heading {
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-semibold);
}

.reflection-log {
  margin: 0;
  padding-left: var(--space-5);
}

.reflection-log__item + .reflection-log__item {
  margin-top: var(--space-2);
}

.reflection-log__title {
  font-weight: var(--font-weight-medium);
  overflow-wrap: anywhere;
}

.reflection-log__time {
  margin-left: var(--space-2);
  font-size: var(--font-size-small);
}

.reflection-log__note {
  margin: var(--space-1) 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--color-text-secondary);
}

/* <summary> mit display:flex verliert den Pfeil — eigener Pfeil (wie Vivencia-Editor) */
.reflection-details > summary {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--touch-min);
  cursor: pointer;
  font-weight: var(--font-weight-semibold);
  list-style: none;
}

.reflection-details > summary::-webkit-details-marker {
  display: none;
}

.reflection-details > summary::before {
  content: '▸';
  color: var(--color-text-secondary);
  transition: transform var(--duration-fast) var(--ease-out);
}

.reflection-details[open] > summary::before {
  transform: rotate(90deg);
}

.reflection-audio__clock {
  margin: 0;
  font-size: var(--font-size-subtitle);
  font-weight: var(--font-weight-semibold);
  font-variant-numeric: tabular-nums;
  color: var(--color-danger-text);
}

.reflection-audio__player {
  width: 100%;
}

.reflection-audio__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.reflection-audio__message {
  margin: 0;
  padding: var(--space-3);
  border-radius: var(--radius-m);
  background: var(--color-warning-soft);
  color: var(--color-warning-text);
}

/* ── Verlauf: Reiter (Optik wie die Bibliothek), Balken, Ranglisten ── */
/* Vier Reiter: Breite nach Inhalt, nie Umbruch im Wort ("Auswertun-g");
   reicht die Breite nicht (360 px, Spanisch), scrollt die Leiste seitlich. */
.history-tabs {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  gap: var(--space-1);
  padding: var(--space-1);
  border-radius: var(--radius-l);
  background: var(--color-surface-muted);
}

.history-tab {
  flex: 1 0 auto;
  min-height: var(--touch-min);
  padding: 0 var(--space-2);
  white-space: nowrap;
  border: 0;
  border-radius: var(--radius-m);
  background: transparent;
  color: var(--color-text);
  font: inherit;
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-semibold);
}

.history-tab.is-active {
  background: var(--color-surface);
  color: var(--color-primary-text);
  box-shadow: var(--shadow-card);
}

.history-bars,
.history-rank {
  margin: 0;
  padding: 0;
  list-style: none;
}

.history-bar {
  display: grid;
  grid-template-columns: minmax(0, 8rem) 1fr auto;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--touch-min);
}

.history-bar__label {
  overflow-wrap: anywhere;
}

.history-bar__track {
  height: 0.75rem;
  border-radius: var(--radius-progress);
  background: var(--color-progress-track);
  overflow: hidden;
}

.history-bar__fill {
  display: block;
  height: 100%;
  background: var(--color-progress-fill);
}

.history-bar__value,
.history-rank__value {
  font-variant-numeric: tabular-nums;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.history-rank__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: var(--touch-min);
  border-bottom: 1px solid var(--color-divider);
}

.history-rank__item:last-child {
  border-bottom: 0;
}

.history-rank__label {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--color-text);
}

a.history-rank__label {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  min-height: var(--touch-min);   /* ganze Zeile antippbar, nicht nur das Wort */
  color: var(--color-primary-text);
}

/* Ruhiger Modus: keine Balken-Farbe, nur Zahlen */
:root[data-quiet="true"] .history-bar__fill {
  background: var(--color-text-secondary);
}

/* Uebungs-Log im Karten-Abschnitt: .section--card laesst nur 4 px Innenabstand
   (er rechnet mit Zeilen, die eigenes Padding haben) — der letzte Eintrag
   klebte am Kartenrand (Sichtpruefung 2026-10-08). */
.reflection-detail {
  padding-bottom: var(--space-3);
}
