/* Formensprache/Typografie an "Richtung 3 — Weich & Nahbar" aus den
   Mockups angelehnt (s. CHANGELOG): durchgehend stark gerundet, Karten über
   weiche Schatten statt Rahmenlinien, Quicksand/Nunito. Die Farben sind
   bewusst NICHT aus den Mockups übernommen — die ursprünglichen
   papertrail-Farben (Teal/Grau, s. :root) bleiben unverändert. */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@500;600;700;800&family=Quicksand:wght@600;700&display=swap');

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #101828;
  --text-faint: #667085;
  --border: #e4e7ec;
  --primary: #0f7b6c;
  --primary-rgb: 15, 123, 108;
  --primary-soft: #e0f1ec;
  --danger: #d92d20;
  --shadow-soft: rgba(16, 24, 40, 0.07);
  --shadow-softer: rgba(16, 24, 40, 0.05);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10161a;
    --surface: #171f24;
    --text: #f2f4f7;
    --text-faint: #98a2b3;
    --border: #2a343b;
    --primary: #2fae9a;
    --primary-rgb: 47, 174, 154;
    --primary-soft: #1b332f;
    --danger: #d92d20;
    --shadow-soft: rgba(0, 0, 0, 0.3);
    --shadow-softer: rgba(0, 0, 0, 0.2);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

h1, h2, .rounded-font {
  font-family: 'Quicksand', 'Nunito', sans-serif;
  font-weight: 700;
}

.page-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px 4px;
}

.page-logo {
  border-radius: 8px;
  flex-shrink: 0;
}

.page-header h1 {
  font-size: 1.15rem;
  margin: 0;
}

/* Testmodus (s. docs/datamodel.md "Testmodus") — deutlich sichtbar,
   solange aktiv, auf jeder Seite (nicht nur im Admin-Bereich), damit er
   nie unbemerkt anbleibt. */
.test-mode-banner {
  background: #b45309;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
  padding: 8px 16px;
}

/* Admin-Bereich: einfach zwei Buttons untereinander statt der früheren
   Topbar-Links (die sind jetzt Teil der Navigation unten, s. .bottom-nav). */
.admin-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.admin-card #test-mode-delete-btn {
  margin-top: 6px;
}

.admin-divider {
  width: 100%;
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

.content {
  padding: 20px;
  /* Platz für die fest positionierte Navigation unten, damit der letzte
     Listeneintrag nicht dahinter verschwindet. */
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
  max-width: 720px;
  margin: 0 auto;
}

.placeholder-card {
  background: var(--surface);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 3px 14px var(--shadow-soft);
}

.btn {
  display: inline-block;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 6px 16px rgba(var(--primary-rgb), 0.3);
}

.btn-secondary {
  background: transparent;
}

.btn-danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}

.btn:disabled {
  opacity: 0.45;
  cursor: default;
  box-shadow: none;
}

/* ---------- Login ---------- */

.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.auth-form {
  background: var(--surface);
  border-radius: 22px;
  padding: 32px;
  width: 100%;
  max-width: 340px;
  box-shadow: 0 8px 30px var(--shadow-soft);
}

.auth-form h1 {
  margin-top: 0;
  font-size: 1.4rem;
  text-align: center;
}

.auth-error {
  color: var(--danger);
  font-size: 0.9rem;
}

.auth-success {
  color: var(--primary);
  font-size: 0.9rem;
}

.auth-back-link {
  display: block;
  text-align: center;
  margin-top: 8px;
}

.field {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* .field setzt display:flex mit derselben Spezifität wie die Browser-
   eigene Regel für das hidden-Attribut ([hidden] { display:none }) —
   Autoren-Regeln gewinnen bei gleicher Spezifität immer gegen die
   Browser-Vorgabe, das hidden-Attribut würde also stillschweigend
   ignoriert (gefunden beim Testen des KI-Erneut-versuchen-Banners unten,
   betraf aber auch schon andere .field-Elemente mit hidden). Explizit
   zurückerobert. */
.field[hidden] {
  display: none;
}

.field label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-faint);
}

.field input[type="text"],
.field input[type="password"],
.field input[type="date"],
.field input[type="search"],
.field select,
.field textarea {
  padding: 11px 14px;
  border: none;
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  font-weight: 600;
  box-shadow: 0 2px 8px var(--shadow-softer);
}

.field textarea {
  min-height: 70px;
  resize: vertical;
  font-weight: 500;
}

.edit-note-field {
  min-height: 140px;
  resize: vertical;
  overflow: auto;
}

.field input[type="file"] {
  font-size: 0.9rem;
  color: var(--text);
}

/* ---------- Tags: Chip-Widget (assets/tag-input.js) ---------- */

.tag-input {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 2px 8px var(--shadow-softer);
}

/* Selbstgebaute Vorschlagsliste statt <datalist> — die zeigt auf Safari/
   iOS gar nichts an (s. Kommentar in tag-input.js). */
.tag-input-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 6px 20px var(--shadow-soft);
  border: 1px solid var(--border);
}

.tag-input-suggestion {
  border: none;
  background: none;
  text-align: left;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.tag-input-suggestion:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

.tag-input-suggestion-active,
.tag-input-suggestion:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.tag-input-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 5px 6px 5px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.tag-chip-remove {
  border: none;
  background: none;
  color: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 50%;
}

.tag-chip-remove:hover {
  background: rgba(var(--primary-rgb), 0.2);
}

.tag-input-field {
  flex: 1;
  min-width: 100px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  padding: 4px 2px;
}

.tag-input-field:focus {
  outline: none;
}

.hint {
  font-size: 0.8rem;
  color: var(--text-faint);
}

/* ---------- Haushaltsmitglieder: Auswahl-Widget (assets/member-picker.js) ---------- */

.member-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.member-chip {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.member-chip-selected {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

/* Admin-Verwaltung (assets/household-members.js): Chip mit Lösch-Knopf statt
   an-/abwählbar — eigene Variante statt cursor:pointer auf dem ganzen Chip. */
.member-chip-removable {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: default;
}

/* Name-Teil eines Admin-Chips (Tags, s. assets/tags-admin.js) — anklickbar
   zum Umbenennen, eigener Hover statt des × daneben. */
.member-chip-name {
  cursor: pointer;
  border-radius: 4px;
}

.member-chip-name:hover,
.member-chip-name:focus-visible {
  text-decoration: underline;
  text-underline-offset: 2px;
  outline: none;
}

.tag-rename-input {
  font: inherit;
  font-weight: 700;
  color: inherit;
  background: var(--bg);
  border: 1px solid var(--primary);
  border-radius: 4px;
  padding: 0 4px;
  min-width: 4ch;
}

.member-chip-remove {
  border: none;
  background: none;
  color: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 50%;
}

.member-chip-remove:hover {
  background: rgba(var(--primary-rgb), 0.15);
}

.household-members-add-row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.household-members-add-row input {
  flex: 1;
  padding: 9px 14px;
  border: none;
  border-radius: 16px;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  font-weight: 600;
}

.checkbox-field {
  flex-direction: row;
  align-items: center;
}

.auth-form button {
  width: 100%;
  padding: 12px;
  margin-top: 8px;
}

/* ---------- Karten / Formular (Archiv-Seite) ---------- */

.card {
  background: var(--surface);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 3px 14px var(--shadow-soft);
}

.card h2 {
  margin-top: 0;
  font-size: 1.05rem;
}

/* Hilfe-Seite (s. hilfe.php) — je Thema ein natives <details>, damit
   künftige weitere Themen nicht alle auf einmal die Seite füllen. */
.help-topic summary {
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
}

.help-topic + .help-topic {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.help-topic p,
.help-topic ul {
  margin: 12px 0 0;
  line-height: 1.5;
}

.help-topic ul {
  padding-left: 20px;
}

.help-topic code {
  background: var(--bg);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.9em;
}

.field-row {
  display: flex;
  gap: 14px;
}

.field-row .field {
  flex: 1;
}

.field-compact {
  margin-bottom: 8px;
}

.field-compact .radio-row {
  max-width: 360px;
}

.direction-field {
  flex: 0 0 116px !important;
}

.direction-toggle {
  gap: 6px;
}

.direction-toggle .radio-option {
  flex: 0 0 52px;
  padding: 10px 0;
}

.direction-toggle .radio-option svg {
  display: block;
}

/* Richtung gehört bewusst direkt zum Korrespondenzpartner. Anders als die
   übrigen Formular-Doppelzeilen bleibt diese Paarung auch auf einem schmalen
   Telefon nebeneinander: Das kleine Ablage-/Pfeil-Symbol braucht wenig Platz
   und macht die Zuordnung auf einen Blick klar. */
.correspondent-direction-row {
  align-items: flex-start;
}

.radio-row {
  display: flex;
  gap: 8px;
  padding-top: 2px;
}

/* Pillen-Umschalter statt klassischer Radiobuttons — app-weit einheitlich
   (aktuell nur "Richtung", aber als generisches Muster gedacht). Das
   input[type=radio] bleibt technisch erhalten (Formular-Semantik,
   Tastatur-Fokus), wird aber nur noch unsichtbar mitgeführt; :has() lässt
   den ganzen Pillen-Rahmen auf den Checked-Zustand reagieren, ohne die
   Eltern-Kind-Struktur (input in label) umbauen zu müssen. */
.radio-option {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 2px 8px var(--shadow-softer);
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.radio-option input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.radio-option:has(input:checked) {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.35);
}

.radio-option:has(input:focus-visible) {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.form-actions {
  margin-top: 4px;
}

.form-error {
  color: var(--danger);
  font-size: 0.9rem;
}

.ai-usage-breakdown {
  color: var(--text-faint);
  font-size: 0.78rem;
  margin-top: 6px;
}

.ai-usage-timing {
  color: var(--text-faint);
  font-size: 0.78rem;
  margin-top: 2px;
}

.ai-usage-error {
  color: var(--danger);
  font-size: 0.78rem;
  margin-top: 4px;
}

/* ---------- Archiv-Liste ---------- */

.list-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.list-header h2 {
  margin: 0;
}

.archive-count {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-faint);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.list-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.search-control {
  position: relative;
  flex: 1;
  max-width: 220px;
}

.list-header input[type="search"] {
  width: 100%;
  padding: 10px 14px;
  border: none;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  font-weight: 600;
  box-shadow: 0 2px 8px var(--shadow-softer);
}

.list-header input[type="search"]::-webkit-search-cancel-button {
  display: none;
  -webkit-appearance: none;
}

.search-clear-btn {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 50%;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  cursor: pointer;
}

.search-clear-btn[hidden] {
  display: none;
}

.search-clear-btn svg {
  display: block;
}

.search-clear-btn:hover,
.search-clear-btn:focus-visible {
  background: var(--border);
  color: var(--text);
}

.entries-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.entry-row {
  border-radius: 20px;
  padding: 15px 18px;
  background: var(--surface);
  box-shadow: 0 3px 14px var(--shadow-soft);
}

.entry-main {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.entry-title {
  font-size: 0.98rem;
  font-weight: 700;
}

/* ---------- Eintrag-Ansicht (Lese-Ansicht, s. #entry-view) ---------- */

.entry-view-title {
  margin: 0 0 10px;
  font-size: 1.25rem;
}

.entry-view-badges {
  margin-bottom: 20px;
}

.entry-view-field {
  margin-bottom: 16px;
}

.entry-view-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-faint);
  margin-bottom: 4px;
}

.entry-view-value {
  white-space: pre-wrap;
}

.entry-view-value-muted {
  color: var(--text-faint);
}

/* E-Mail-Eingangsbox (s. docs/datamodel.md "E-Mail-Eingangsbox") — roher
   E-Mail-Text, eingeklappt und unauffällig (Daniels Wunsch: soll die
   Oberfläche nicht überladen), sowohl in der Lese-Ansicht als auch im
   Bearbeiten-Formular. */
.entry-view-email-raw {
  margin-bottom: 16px;
}

.entry-view-email-raw summary {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-faint);
  cursor: pointer;
}

.entry-view-email-raw .entry-view-value {
  margin-top: 8px;
  font-size: 0.9rem;
  color: var(--text-faint);
}

/* Große Dokumenten-Vorschau in der Lese-Ansicht (unter den übrigen
   Feldern, Daniels Vorgabe) — Bilder direkt eingebettet, PDFs über
   <embed>, mit Rückfall-Link falls das im Browser mal nicht geht. */
.entry-view-previews {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 4px;
}

.entry-view-preview {
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 2px 8px var(--shadow-softer);
}

.entry-view-preview-label {
  padding: 10px 14px 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-faint);
}

.entry-view-preview-img {
  display: block;
  width: 100%;
  max-height: 75vh;
  object-fit: contain;
  background: var(--bg);
  cursor: zoom-in;
  margin-top: 8px;
}

/* Umschließt die eingebettete PDF-Vorschau — ein ganz normaler Link auf
   dieselbe Datei wie "Original öffnen" darunter (target=_blank, öffnet in
   einem neuen Tab mit der normalen Browser-PDF-Ansicht, ganz normal
   schließbar). Die eigentliche Blockade fürs Scrollen ist
   .entry-view-preview-pdf-overlay unten. */
.entry-view-preview-pdf-frame {
  position: relative;
  display: block;
  width: 100%;
  margin-top: 8px;
}

.entry-view-preview-pdf {
  display: block;
  width: 100%;
  height: 75vh;
  border: none;
}

/* Liegt sichtbar ÜBER dem <embed> und fängt jede Berührung ab, bevor sie
   das <embed> erreicht — pointer-events:none AUF dem <embed> reicht in
   manchen Browsern (v. a. Safari/iOS) nicht aus, weil ein PDF-<embed> dort
   technisch eine eigene native Ansicht ist, die Scroll-/Touch-Gesten
   trotzdem selbst abgreift (Daniels gemeldetes Problem: Scrollen über der
   Vorschau blätterte stattdessen im PDF). Diese leere, transparente Ebene
   sitzt räumlich davor und übernimmt die Berührung stattdessen — dadurch
   scrollt die Seite normal weiter, und ein Antippen führt zum Link
   (.entry-view-preview-pdf-frame) statt ins PDF hinein. */
.entry-view-preview-pdf-overlay {
  position: absolute;
  inset: 0;
}

.entry-view-preview-fallback,
.entry-view-preview-download {
  display: block;
  padding: 10px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

/* Zeile mit "Original öffnen" + (im Bearbeiten-Formular) "Dokument
   entfernen" nebeneinander statt jeweils eine eigene Blockzeile. */
.entry-view-preview-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.entry-view-preview-actions .entry-view-preview-download {
  padding-right: 0;
}

.entry-view-preview-remove {
  padding: 10px 14px 10px 0;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--danger);
  cursor: pointer;
}

.entry-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-faint);
  white-space: nowrap;
}

.badge-direction-incoming {
  background: var(--primary-soft);
  color: var(--primary);
}

.badge-direction-outgoing {
  color: var(--text);
}

/* Haushaltsmitglieder ("Betrifft", s. docs/datamodel.md
   "Haushaltsmitglieder") — eigene Farbe, unterscheidet sich optisch von
   Tags (die tragen ein #-Präfix). */
.badge-member {
  background: var(--primary-soft);
  color: var(--primary);
}

/* Postbox (s. docs/datamodel.md "Postbox"): kennzeichnet unvollständig
   erfasste Einträge auch außerhalb der Postbox-Übersicht selbst. */
.badge-open {
  background: rgba(var(--primary-rgb), 0.15);
  color: var(--primary);
}

.entry-row-clickable {
  cursor: pointer;
}

/* To-Do (s. docs/datamodel.md "To-Do (Aufgaben)"): Hinweis auf eine offene
   Aufgabe auch außerhalb der To-Dos-Liste selbst. */
.badge-task {
  background: rgba(217, 45, 32, 0.12);
  color: var(--danger);
}

/* Testmodus (s. docs/datamodel.md "Testmodus") — nur sichtbar, wenn "Test-
   Einträge anzeigen" im Filter aktiv ist. Eigene Warnfarbe (Amber), damit
   ein Test-Eintrag auf den ersten Blick von echten Einträgen zu
   unterscheiden ist. */
.badge-test {
  background: rgba(217, 119, 6, 0.15);
  color: #b45309;
}

/* Postbox: Hinweis, dass die KI-Erkennung für diesen Eintrag fehlgeschlagen
   ist — Felder bleiben dann leer und müssen von Hand ausgefüllt werden. */
.badge-error {
  background: rgba(217, 45, 32, 0.12);
  color: var(--danger);
}

/* Postbox: Banner im Bearbeiten-Formular, wenn die KI-Erkennung
   fehlgeschlagen ist — mit Knopf, sie erneut anzustoßen (s.
   assets/postbox.js). */
.ai-retry-banner {
  background: rgba(217, 45, 32, 0.08);
  border: 1px solid rgba(217, 45, 32, 0.25);
  border-radius: 12px;
  padding: 14px;
}

.ai-retry-banner p {
  margin: 0 0 10px;
  font-size: 0.85rem;
  color: var(--text);
}

/* Postbox: zeigt, dass die KI gerade noch an diesem Eintrag arbeitet (s.
   docs/datamodel.md "Postbox") — verschwindet automatisch, sobald
   assets/postbox.js beim Neuladen "done"/"failed" sieht. */
.ai-status-pending {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
}

.ai-status-spin {
  animation: ai-status-spin-rotate 0.9s linear infinite;
}

@keyframes ai-status-spin-rotate {
  to { transform: rotate(360deg); }
}

/* ---------- To-Dos: Zeile mit Abhak-Haken ---------- */

.todo-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.todo-check-btn {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  margin-top: 2px;
}

.todo-check-btn:hover {
  border-color: var(--primary);
}

/* Abhak-Kreis in der Eintrag-Lese-Ansicht (s. #entry-view) — dasselbe
   Aussehen wie in der To-Dos-Liste, plus ein erledigt-Zustand (dort nicht
   nötig, weil eine abgehakte Aufgabe die To-Dos-Liste einfach verlässt). */
.entry-view-task-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.entry-view-task-check {
  margin-top: 2px;
}

.entry-view-task-check-done {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  cursor: default;
}

.todo-row-content {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.todo-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  margin-top: 1px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-faint);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.todo-share-btn:hover,
.todo-share-btn:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
  outline: none;
}

.todo-task-note {
  font-size: 0.88rem;
  color: var(--text);
  margin-top: 2px;
}

.todo-due-date {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-faint);
}

.todo-due-date-overdue {
  color: var(--danger);
}

.entry-date {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-faint);
  margin-top: 4px;
}

.entry-date-missing {
  font-style: italic;
  font-weight: 500;
}


/* Anhang-Chips (s. assets/attachment-chip.js) — kompakte Pillen mit
   Dokument-Icon statt einer reinen Text-/Link-Liste, angelehnt an
   FinanceHubs "insurance-document-row"-Muster, aber im papertrail-Look
   (weicher Schatten statt Rahmenlinie). */
.attachment-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg);
  box-shadow: 0 2px 8px var(--shadow-softer);
  color: var(--text);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  max-width: 240px;
}

.attachment-chip svg {
  flex-shrink: 0;
  color: var(--text-faint);
}

.attachment-chip-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

a.attachment-chip:hover,
a.attachment-chip:hover svg {
  color: var(--primary);
}

@media (max-width: 480px) {
  .field-row {
    flex-direction: column;
    gap: 0;
  }

  .correspondent-direction-row {
    flex-direction: row;
    gap: 10px;
  }

  .edit-date-type-row {
    flex-direction: row;
    gap: 10px;
  }

  .edit-date-type-row .field {
    min-width: 0;
  }
}

/* ---------- Datei-Vorschau (im Details-Schritt des Erfassungs-Ablaufs) ---------- */

.selected-files-preview {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* [hidden] hat dieselbe CSS-Spezifität wie eine einzelne Klasse — ohne
   diese Regel würde die obige "display: flex" das hidden-Attribut wirkungslos
   machen (Attribut+Klasse hat höhere Spezifität und gewinnt zuverlässig). */
.selected-files-preview[hidden] {
  display: none;
}

/* ---------- Navigation unten: Archiv/Postbox/To-Dos/Admin + "+" ---------- */

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 4px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: var(--surface);
  box-shadow: 0 -1px 0 var(--border);
  z-index: 90;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
  padding: 4px 2px;
  border: none;
  background: none;
  color: var(--text-faint);
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
}

.bottom-nav-item[aria-current="page"] {
  color: var(--primary);
}

.nav-badge {
  position: absolute;
  top: -2px;
  right: 18%;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

/* Runder "+"-Button mittig in der Navigation statt frei schwebend — bleibt
   optisch der wichtigste Button (Leitprinzip 1: Erfassen muss trivial
   sein), ragt bewusst etwas über die Leiste hinaus. */
.bottom-nav-fab {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--primary);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(var(--primary-rgb), 0.4);
  cursor: pointer;
  flex-shrink: 0;
  margin: -20px 6px 0;
}

.bottom-nav-fab-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--primary);
}

/* Statt eines generischen "+" das eigentliche papertrail-Symbol (dieselbe
   Grafik wie im App-Icon, nur ohne den quadratischen Hintergrund
   freigestellt, s. assets/icons/README.md) — der runde Button selbst
   liefert die passende Hintergrundfarbe schon mit. */
.bottom-nav-fab-glyph {
  display: block;
  width: 34px;
  height: auto;
}

.bottom-nav-fab-label {
  display: none;
}

.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  /* über .flow-overlay (110) — das Look-Auswahl-Sheet wird aus dem
     Vollbild-Ablauf heraus geöffnet und muss darüber liegen */
  z-index: 120;
}

.sheet-overlay[hidden] {
  display: none;
}

.sheet {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  color: var(--text);
  border-radius: 22px 22px 0 0;
  padding: 10px 18px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 30px var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 3px;
  background: var(--border);
  margin: 6px auto 16px;
}

.sheet h2 {
  font-size: 1.05rem;
  margin: 0 0 6px;
}

.option-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px;
  border: none;
  background: var(--bg);
  border-radius: 16px;
  text-align: left;
  cursor: pointer;
}

.option-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}

.option-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.option-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
}

.option-sub {
  font-size: 0.78rem;
  color: var(--text-faint);
}

/* ---------- Vollbild-Ablauf: Kamera/Kanten → Seiten+Look → Details ---------- */

.flow-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 110;
}

.flow-overlay[hidden] {
  display: none;
}

.flow-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
}

.flow-screen[hidden] {
  display: none;
}

.flow-screen-dark {
  background: #0b0d10;
  color: #fff;
}

.flow-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(14px + env(safe-area-inset-top)) 18px 14px;
  background: var(--surface);
  box-shadow: 0 1px 0 var(--border);
  flex-shrink: 0;
}

.flow-topbar h2 {
  font-size: 1.05rem;
  margin: 0;
}

.icon-btn {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  background: var(--bg);
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}

/* Archiv-Filter (s. docs/datamodel.md "Filter und gespeicherte Ansichten") */

.filter-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.saved-views-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 14px;
  padding-bottom: 2px;
}

.saved-views-row[hidden] {
  display: none;
}

.saved-view-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 8px 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.saved-view-chip-active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

.saved-view-chip-remove {
  border: none;
  background: none;
  color: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 50%;
}

.saved-view-chip-remove:hover {
  background: rgba(var(--primary-rgb), 0.2);
}

/* Der Filter-Sheet-Inhalt kann lang werden (Dokumentart, Korrespondent,
   Tags, Betrifft, Zeitraum, …) — eigene Scroll-Höhe statt das Sheet über
   den sichtbaren Bereich hinauswachsen zu lassen und Anwenden/Zurücksetzen
   vom Bildschirm zu schieben. */
.filter-sheet-scroll {
  max-height: 55vh;
  overflow-y: auto;
  padding: 4px 2px;
}

.flow-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
}

.section-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-faint);
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.flow-bottom-bar {
  display: flex;
  gap: 10px;
  padding: 16px 18px calc(16px + env(safe-area-inset-bottom));
  flex-shrink: 0;
}

.flow-bottom-bar-light {
  background: var(--surface);
  box-shadow: 0 -1px 0 var(--border);
}

.flow-bottom-bar .btn {
  flex: 1;
}

/* Seiten-Übersicht: Look-Auswahl oberhalb der Weiter-Buttons, statt als
   eigener Abschnitt im Scroll-Bereich. */
.flow-bottom-bar-column {
  flex-direction: column;
}

.flow-bottom-actions {
  display: flex;
  gap: 10px;
}

.flow-bottom-actions .btn {
  flex: 1;
}

/* Zeigt nur den aktuell gewählten Look; Antippen öffnet das Sheet mit den
   restlichen Optionen (s. #flow-filter-sheet). */
.pill-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  border: none;
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.88rem;
  font-family: inherit;
  cursor: pointer;
}

.pill-select strong {
  color: var(--primary);
}

.pill-select svg {
  color: var(--text-faint);
  flex-shrink: 0;
}

/* Vollbild-Kamera/Kanten-Ansicht: dunkler Hintergrund, damit ein Foto in
   voller Bildschirmbreite Platz zum präzisen Ecken-Ziehen hat (statt wie
   vorher in einem auf 60vh gequetschten Modal). */

.flow-capture-hint {
  position: absolute;
  top: calc(60px + env(safe-area-inset-top));
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.7);
  padding: 0 24px;
  z-index: 2;
}

.flow-close-btn-dark {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top));
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}

.flow-corner-editor-host {
  position: relative;
  flex: 1;
  overflow: hidden;
}

/* KI-Erkennung: Lade-Screen zwischen "Datei ausgewählt" und "Vorschläge
   bestätigen" (s. saveDraftAndReview() in add-flow.js). Bewusst im hellen
   Erscheinungsbild der App statt eines generischen dunklen Spinners —
   sanft pulsierendes Logo + wechselnde Statustexte statt einer reinen
   Warteanimation. */
.flow-loading-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 24px;
  text-align: center;
}

.flow-loading-logo {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  box-shadow: 0 10px 28px rgba(var(--primary-rgb), 0.3);
  animation: flow-loading-pulse 1.8s ease-in-out infinite;
}

@keyframes flow-loading-pulse {
  0%, 100% { transform: scale(0.94); opacity: 0.85; }
  50% { transform: scale(1.04); opacity: 1; }
}

.flow-loading-content p {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  min-height: 1.4em; /* kein Layout-Sprung, wenn der Text wechselt */
}

.flow-capture-error {
  margin: 0 18px;
}

.btn-secondary-dark {
  background: rgba(255, 255, 255, 0.14);
  border: none;
  color: #fff;
}

.flow-add-page-btn {
  width: 100%;
  margin-top: 14px;
}

.scan-pages-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.scan-page {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-radius: 18px;
  padding: 10px;
  background: var(--surface);
  box-shadow: 0 2px 10px var(--shadow-softer);
}

/* Deutlich größere Vorschau statt der alten 56×56px-Miniatur — Antippen
   öffnet die noch größere Ansicht (#flow-image-lightbox), damit sich die
   Scan-Qualität wirklich beurteilen lässt. Feste Höhe + object-fit:contain
   hält alle Karten gleich groß, unabhängig vom Seitenverhältnis des Fotos
   (Hoch-/Querformat), ohne etwas vom Inhalt abzuschneiden. */
.scan-page-image-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 280px;
  border: none;
  padding: 0;
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg);
  cursor: pointer;
}

.scan-page-image-btn img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.scan-page-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.scan-page-number {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-faint);
  margin-right: 4px;
}

.scan-page-btn {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: none;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
}

.scan-page-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.scan-page-remove {
  color: var(--danger);
}

.scan-filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.scan-filter-btn {
  padding: 9px 14px;
  border-radius: 999px;
  border: none;
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px var(--shadow-softer);
}

.scan-filter-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.35);
}

/* ---------- Seiten-Großansicht (Antippen einer Seiten-Vorschau) ---------- */

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 130;
}

.lightbox-overlay[hidden] {
  display: none;
}

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* ---------- Einfügen (Copy/Paste aus Mail o. ä.) ---------- */

.paste-target {
  display: block;
  width: 100%;
  min-height: 160px;
  margin-top: 18px;
  border: 2px dashed var(--border);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  text-align: center;
  padding: 20px;
}

.paste-target::placeholder {
  color: var(--text-faint);
}

.paste-target:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--primary-soft);
}

/* ---------------------------------------------------------------------
   Desktop-Ansicht (ab 960px) — s. docs/adr/0005-desktop-layout.md für die
   Begründung (Optionen, Entscheidung, Folgearbeit). Dieselbe
   Seite, kein separates Template: die Navigation wandert von unten nach
   links (Daniels Entscheidung — das üblichere Muster statt rechts), der
   Inhalt bekommt mehr Platz zum Atmen, und Overlays (Eintrag ansehen/
   bearbeiten, Neuer-Eintrag-Ablauf, Sheets) werden zu einem zentrierten
   Fenster statt eines Vollbild-/Bogen-Overlays, das die Liste im
   Hintergrund komplett verdeckt hätte. Liste+Detail nebeneinander (ohne
   jedes Overlay) ist als mögliche Erweiterung zurückgestellt, s.
   docs/requirements.md Backlog.
   --------------------------------------------------------------------- */

@media (min-width: 960px) {
  .page-header {
    margin-left: 220px;
    padding: 24px 32px 8px;
  }

  .test-mode-banner {
    margin-left: 220px;
  }

  .content {
    margin-left: 220px;
    max-width: 900px;
    padding: 24px 32px 40px;
  }

  /* Navigation: von der unteren Leiste zur linken Seitenleiste — dieselbe
     Markup-Struktur (s. index.php), nur per CSS umgehängt. */
  .bottom-nav {
    left: 0;
    right: auto;
    top: 0;
    bottom: 0;
    width: 220px;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 4px;
    padding: 28px 14px;
    box-shadow: 1px 0 0 var(--border);
  }

  .bottom-nav-item {
    flex-direction: row;
    justify-content: flex-start;
    flex: none;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 14px;
    font-size: 0.92rem;
  }

  .bottom-nav-item[aria-current="page"] {
    background: var(--primary-soft);
  }

  .nav-badge {
    position: static;
    margin-left: auto;
  }

  /* Die wichtigste Aktion steht über dem Archiv als eigener Menüeintrag:
     Der Kreis ist etwas größer als die 22px-Navigationsicons und überlappt
     die links darunter beginnende Pille leicht. So bleibt „Neu“ klar
     hervorgehoben, wirkt aber nicht wie ein losgelöster Floating Button. */
  .bottom-nav-fab {
    order: -1;
    width: 100%;
    height: 40px;
    margin: 0 0 4px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--primary);
    justify-content: flex-start;
  }

  .bottom-nav-fab-circle {
    position: relative;
    z-index: 1;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    box-shadow: 0 3px 9px rgba(var(--primary-rgb), 0.28);
  }

  .bottom-nav-fab-glyph {
    width: 25px;
  }

  .bottom-nav-fab-label {
    display: flex;
    align-items: center;
    flex: 1;
    height: 36px;
    margin-left: -20px;
    padding: 0 15px 0 35px;
    border: 2px solid var(--primary);
    border-left: 0;
    border-radius: 0 999px 999px 0;
    color: var(--primary);
    background: var(--surface);
    font-size: 0.88rem;
    font-weight: 700;
    white-space: nowrap;
  }

  .bottom-nav-fab:hover .bottom-nav-fab-label,
  .bottom-nav-fab:focus-visible .bottom-nav-fab-label {
    background: var(--primary-soft);
  }

  .bottom-nav-fab:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
  }

  /* Overlays: zentriertes Fenster statt Vollbild/Bogen von unten — nutzt
     den freien Platz drumherum, statt die Liste komplett zu verdecken. */
  .flow-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(16, 24, 40, 0.45);
    padding: 40px;
  }

  .flow-screen {
    position: relative;
    inset: auto;
    /* .flow-screen hatte nie einen eigenen Hintergrund — auf Mobile lag es
       deckungsgleich (inset:0) über .flow-overlay und dessen deckender
       Hintergrundfarbe (var(--bg)) "durch". Seit .flow-overlay hier oben
       zum halbtransparenten Abdunkeln hinter dem Dialog wird, braucht
       .flow-screen jetzt zwingend seine eigene deckende Füllung — sonst
       scheint die Seite dahinter durch (Fehler, den Daniel gemeldet hat). */
    background: var(--bg);
    width: 100%;
    /* War 640px — Daniels Beobachtung: Ansicht/Bearbeiten wirkten auf
       großen Bildschirmen immer noch schmal. Anders als bei Fließtext
       (wo sehr lange Zeilen das Lesen erschweren) sind Formularfelder,
       Badges und vor allem die große Dokumenten-Vorschau bei mehr Platz
       nicht schlechter lesbar, nur großzügiger — spricht also nichts
       dagegen, deutlich breiter zu gehen. */
    max-width: 1000px;
    max-height: 88vh;
    border-radius: 22px;
    box-shadow: 0 20px 60px var(--shadow-soft);
    overflow: hidden;
  }

  /* .flow-screen-dark (Kamera-Aufnahme-Bildschirm, #flow-capture trägt
     beide Klassen) hat dieselbe Selektor-Spezifität wie .flow-screen oben
     — ohne diese erneute Regel würde die spätere .flow-screen-Regel hier
     im selben Media-Query den dunklen Hintergrund überschreiben. */
  .flow-screen-dark {
    background: #0b0d10;
  }

  .sheet-overlay {
    align-items: center;
  }

  .sheet {
    border-radius: 22px;
    max-height: 88vh;
  }

  /* Die Wisch-Anfasser-Andeutung ergibt nur bei einem Bogen sinn, der von
     unten hereingezogen wird — bei einem zentrierten Fenster ohne Wisch-
     Geste überflüssig. */
  .sheet-handle {
    display: none;
  }

  /* Listenzeilen (Archiv/Postbox): Titel+Badges links, Datum+Anhänge
     rechts in einer Zeile statt untereinander gestapelt — auf einem
     breiten Bildschirm passen so spürbar mehr Einträge ohne Scrollen auf
     einen Blick ("viel auf einmal erkennen"). Bewusst nur für Archiv/
     Postbox skaliert (nicht der bloße ".entry-row"-Klassenname überall):
     dieselbe Klasse trägt auch die To-Dos-Zeilen (dort unauffällig, weil
     .entry-row dort nur ein einzelnes Kind hat, .todo-row, das seine
     eigene Struktur mitbringt) UND die KI-Nutzungsprotokoll-Zeilen in
     Admin (assets/ai-usage.js) — die haben aber zusätzliche Kind-Elemente
     (Kosten-Aufschlüsselung, Zeit-Aufschlüsselung) und einen oft
     mehrzeiligen Titel, für die dieses Zeilen-Layout nicht gemacht ist.
     Ein früherer, ungezielter ".entry-row"-Selektor hier hat genau dort
     Text überlappen lassen (Daniel gemeldet, Screenshot) — daher jetzt
     gezielt nur auf die beiden Listen, in denen es passt. */
  #entries-list .entry-row,
  #postbox-list .entry-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
  }

  #entries-list .entry-main,
  #postbox-list .entry-main {
    flex: 1;
    min-width: 0;
  }

  #entries-list .entry-date,
  #postbox-list .entry-date {
    flex-shrink: 0;
    margin-top: 0;
  }

  #entries-list .attachment-chips,
  #postbox-list .attachment-chips {
    flex: 0 1 34%;
    justify-content: flex-end;
    margin-top: 0;
  }

  #entries-list .attachment-chip,
  #postbox-list .attachment-chip {
    min-width: 0;
  }
}
