/* Notizen: Liste mit Filter und der Editor mit Vorschau. */

/* Filterleiste */
.notizen-filter { display: flex; flex-wrap: wrap; align-items: center; gap: var(--abstand-3); margin-bottom: var(--abstand-4); }
.notizen-filter__suche { flex: 1 1 260px; }
.notizen-filter__projekt { flex: 0 1 220px; width: auto; }
.notizen-filter__teil { display: contents; } /* eigener Zeichen-Teil (Projekt, Archivierte) in der Filterzeile */

.schalter { display: inline-flex; align-items: center; gap: var(--abstand-2); min-height: var(--touch); cursor: pointer; }
.schalter input { width: 20px; height: 20px; margin: 0; accent-color: var(--akzent); }

/* Liste */
.notizen-liste { display: grid; padding: 0; list-style: none; }
.notizen-liste li + li { border-top: 1px solid var(--rand); }
.notizen-seite__liste--laedt { opacity: .6; transition: opacity .2s ease; }

.notiz-zeile {
  display: grid;
  gap: 4px;
  padding: var(--abstand-3);
  border-radius: var(--radius-feld);
  color: var(--text);
  text-decoration: none;
}

.notiz-zeile:hover { background: var(--hintergrund); }
.notiz-zeile__kopf { display: flex; flex-wrap: wrap; align-items: center; gap: var(--abstand-2); }
.notiz-zeile__titel { font-weight: 600; overflow-wrap: anywhere; }
.notiz-zeile__text { color: var(--text-leise); overflow-wrap: anywhere; }
.notiz-zeile__meta { display: flex; flex-wrap: wrap; gap: var(--abstand-3); color: var(--text-leise); font-size: var(--groesse-klein); }

/* Editor: Kopf mit Speicherstand und Knoepfen */
.notiz-kopf__rechts { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--abstand-3); }
.notiz-kopf__aktionen { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--abstand-2); }

.speicherstand { display: inline-flex; align-items: center; gap: 6px; color: var(--text-leise); font-size: var(--groesse-klein); font-weight: 600; }
.speicherstand--gut { color: var(--text-gut); }
.speicherstand--offen { color: var(--text-warnung); }
.speicherstand--fehler { color: var(--text-schlecht); }

.notiz-editor { display: grid; gap: var(--abstand-4); }
.notiz-editor__kopf { display: flex; flex-wrap: wrap; align-items: center; gap: var(--abstand-3); }

.notiz-editor__titel {
  flex: 1 1 280px;
  min-width: 0;
  min-height: var(--touch);
  padding: var(--abstand-1) var(--abstand-2);
  border: 0;
  border-radius: var(--radius-feld);
  background: transparent;
  font-size: var(--groesse-titel);
  font-weight: 650;
}

.notiz-editor__titel:hover { background: var(--hintergrund); }
.notiz-editor__titel:focus { background: var(--hintergrund); outline: none; box-shadow: 0 0 0 3px var(--akzent-hell); }
.notiz-editor__projekt { flex: 0 1 240px; width: auto; }

.notiz-editor__flaechen { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--abstand-5); }
.notiz-editor__schreiben, .notiz-editor__vorschau { display: grid; align-content: start; gap: var(--abstand-2); min-width: 0; }

.notiz-editor__text {
  min-height: 60vh;
  resize: vertical;
  font-family: var(--schrift-mono);
  font-size: 14px;
  line-height: 1.55;
}

.notiz-editor__vorschau-titel { color: var(--text-leise); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.notiz-editor__vorschau .markdown { padding: var(--abstand-3) 0; }
.notiz-editor__leer { color: var(--text-leise); }

/* Umschalter Schreiben/Vorschau: nur mobil, getoente Flaechen */
.segment { display: none; gap: var(--abstand-1); padding: var(--abstand-1); border-radius: var(--radius-knopf); background: var(--neutral-hell); justify-self: start; }

.segment__knopf {
  min-height: 36px;
  padding: 0 var(--abstand-4);
  border: 0;
  border-radius: var(--radius-knopf);
  background: transparent;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}

.segment__knopf[aria-pressed="true"] { background: var(--flaeche); color: var(--akzent-dunkel); box-shadow: var(--schatten); }

@media (max-width: 899px) {
  .segment { display: inline-flex; }
  .segment__knopf { min-height: var(--touch); } /* Touch-Ziel 44 px, nur mobil sichtbar */
  .notiz-editor__flaechen { grid-template-columns: minmax(0, 1fr); }
  .notiz-editor__flaechen--schreiben .notiz-editor__vorschau,
  .notiz-editor__flaechen--vorschau .notiz-editor__schreiben { display: none; }
  .notiz-editor__vorschau-titel { display: none; }
  .notiz-editor__text { min-height: 50vh; }
  .notiz-kopf__rechts { justify-content: flex-start; width: 100%; }
  .notiz-editor__titel { font-size: var(--groesse-gross); }
}
