/* ============================================================
   MIF Signal Radar v0.1 — Strukturebene
   Layout, Komponenten, Zustände. Unveränderlich pro Marke.
   Markenwerte kommen ausschließlich aus css/tokens.css.
   ============================================================ */

/* ── Reset ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; }

body {
  height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--t-body);
  line-height: var(--lh-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#root { height: 100%; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: var(--radius);
}

a { color: inherit; }

::selection { background: var(--brand-accent); color: var(--brand-accent-ink); }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

/* ── Typografische Grundformen ─────────────────── */

/* Ebene 3: Versal-Zwischenüberschrift — tragendes Gliederungselement */
.label {
  font-size: var(--t-label);
  font-weight: 700;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--ink);
}
.label--muted { color: var(--gray-500); }

/* Ebene 4: Metadaten */
.meta {
  font-size: var(--t-meta);
  color: var(--gray-500);
}

.tech {
  font-family: var(--font-tech);
  font-size: var(--t-tech);
  color: var(--gray-400);
}

/* Hauptaktion: genau eine pro sichtbarer Fläche */
.btn-primary {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
  font-weight: 600;
  padding: 11px 22px;
  letter-spacing: 0.01em;
  transition: opacity var(--ease);
}
.btn-primary:hover { opacity: 0.85; }
.btn-primary:disabled { background: var(--gray-300); cursor: default; }

/* Nebenaktionen: Textaktionen ohne Rahmen */
.btn-text {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 6px 2px;
  border-bottom: 1px solid transparent;
}
.btn-text:hover { border-bottom-color: var(--ink); }
.btn-text--muted { color: var(--gray-500); }

/* Sekundäre Icon-Aktion: kompakt, ruhig, mit Tooltip und aria-label */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  color: var(--gray-500);
  border: 1px solid transparent;
  transition: background var(--ease), color var(--ease);
}
.btn-icon:hover {
  color: var(--ink);
  background: var(--wash);
  border-color: var(--hairline);
}
.btn-icon .ic { display: block; }

/* Externe Quelle: eindeutige Linkbehandlung, kein Status- oder Metatext */
.ext-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  border-bottom: 1px solid var(--gray-300);
  padding-bottom: 1px;
  transition: border-color var(--ease);
}
.ext-link:hover { border-bottom-color: var(--ink); }
.ext-link .ic { width: 11px; height: 11px; flex: none; color: var(--gray-500); }
.ext-link:hover .ic { color: var(--ink); }
.ext-link--strong { font-size: 14px; font-weight: 600; border-bottom-color: var(--ink); }
.ext-link--primary { border-bottom: none; }
.ext-link--primary .ic { color: inherit; margin-left: 5px; }

/* Marker: einzige Farbe der Anwendung */
.mark {
  background: var(--brand-accent);
  color: var(--brand-accent-ink);
}

/* ════════════════════════════════════════════════
   EINSTIEGSFLÄCHE
   ════════════════════════════════════════════════ */

.entry {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-7);
  text-align: center;
  padding: var(--s-8);
}

.entry .wordmark {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.entry .wordmark .product {
  display: block;
  font-size: 30px;
  letter-spacing: 0.04em;
  margin-top: var(--s-2);
}

.entry-claim {
  font-family: var(--font-read);
  font-size: 19px;
  color: var(--ink-soft);
  max-width: 26em;
}

.entry-workspace {
  border-top: var(--edge);
  border-bottom: var(--edge);
  padding: var(--s-6) var(--s-8);
  min-width: 340px;
}
.entry-workspace .ws-name {
  font-size: 17px;
  font-weight: 600;
}
.entry-workspace .ws-status {
  margin-top: var(--s-2);
}

/* ════════════════════════════════════════════════
   PRODUKTSCHALE
   ════════════════════════════════════════════════ */

.app {
  height: 100%;
  display: grid;
  grid-template-columns: var(--w-nav) 1fr;
  overflow: hidden;
}

/* ── Navigation: reine Textliste ───────────────── */
.nav {
  border-right: var(--edge);
  display: flex;
  flex-direction: column;
  padding: var(--s-6) 0;
}

.nav .wordmark {
  font-family: var(--font-display);
  padding: 0 var(--s-6);
  margin-bottom: var(--s-8);
}
.nav .wordmark .brand {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gray-500);
}
.nav .wordmark .product {
  display: block;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.nav-item {
  display: block;
  width: 100%;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-500);
  padding: 9px var(--s-6);
  border-left: 2px solid transparent;
}
.nav-item:hover { color: var(--ink); }
.nav-item.active {
  color: var(--ink);
  font-weight: 600;
  border-left-color: var(--ink);
}

.nav-spacer { flex: 1; }

.nav-foot {
  border-top: var(--edge);
  margin: 0 var(--s-6);
  padding-top: var(--s-4);
}
.nav-foot .nav-item { padding-left: 0; font-size: 13px; }

/* ── Modulfläche ───────────────────────────────── */
.module {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.module-head {
  display: flex;
  align-items: baseline;
  gap: var(--s-4);
  padding: var(--s-6) var(--s-7) var(--s-5);
  border-bottom: var(--edge);
  position: relative;
}

.module-title {
  font-size: var(--t-module);
  font-weight: 650;
  letter-spacing: -0.015em;
}

.ws-switch {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}
.ws-switch .caret { font-size: 11px; color: var(--gray-400); }
.ws-switch:hover { color: var(--ink); }

.module-head .spacer { flex: 1; }
.module-head .head-status .ic { display: inline-block; }
.module-head .head-status .ic-spin { animation: spin 900ms linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* §PR18-06: dünne, monochrome Fortschrittslinie während des Refresh —
   indeterminate (keine erfundenen Zwischenwerte wie "3/5"), erst der reale
   Response-Text danach (siehe ViewHelpers.describeRefreshSummary). */
.refresh-progress { height: 2px; overflow: hidden; position: relative; }
.refresh-progress.active { background: var(--hairline); }
.refresh-progress.active::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 30%;
  /* PR18-12: monochrom — Marker-Gelb bleibt für inhaltliche Akzente
     (Zu LinkedIn kopieren, Belege) reserviert, nicht für technischen
     Fortschritt. */
  background: var(--ink);
  animation: refresh-sweep 1100ms ease-in-out infinite;
}
@keyframes refresh-sweep {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(430%); }
}

/* ── Prozessnavigation (Signal · Perspektive · Post) ──
   Sichtbare Produktlogik, kein Stepper, keine Nummern. Der aktuelle
   Schritt ist eindeutig, abgeschlossene Schritte bleiben erreichbar aber
   leiser; ein noch nicht existierender Post ist sichtbar, nicht anklickbar. */
.process-nav {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-3) var(--s-7);
  border-bottom: var(--edge);
}
.process-nav button {
  background: none;
  font-size: var(--t-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  font-weight: 700;
  color: var(--gray-400);
  padding: 2px 0;
}
.process-nav button:not(:disabled):hover { color: var(--ink); }
.process-nav button.current { color: var(--ink); border-bottom: 2px solid var(--ink); }
.process-nav button:disabled { color: var(--gray-300); cursor: default; }
.process-nav .pn-sep { color: var(--gray-300); font-size: var(--t-label); }

/* Arbeitsraum-Menü */
.ws-menu {
  position: absolute;
  top: calc(100% - 8px);
  left: 210px;
  min-width: 300px;
  background: var(--paper);
  border: var(--edge-strong);
  box-shadow: var(--overlay-shadow);
  z-index: 40;
  padding: var(--s-3) 0;
}
.ws-menu .label { padding: var(--s-2) var(--s-5); display: block; }
.ws-menu-item {
  display: flex;
  width: 100%;
  text-align: left;
  padding: 9px var(--s-5);
  gap: var(--s-3);
  font-size: 14px;
  align-items: baseline;
}
.ws-menu-item:hover { background: var(--wash); }
.ws-menu-item .check { width: 14px; font-weight: 700; }
.ws-menu-item.current { font-weight: 600; }
.ws-menu hr { border: none; border-top: var(--edge); margin: var(--s-3) 0; }
.ws-menu .ws-menu-item--secondary { color: var(--gray-500); font-size: 13.5px; }

/* ════════════════════════════════════════════════
   WERKSTATT — drei Zonen
   ════════════════════════════════════════════════ */

.workshop {
  flex: 1;
  display: grid;
  grid-template-columns: var(--w-feed) minmax(0, 1fr) var(--w-bench);
  min-height: 0;
  transition: grid-template-columns var(--ease);
}
@media (prefers-reduced-motion: reduce) {
  .workshop { transition: none; }
}

/* ── Dynamische Flächenverteilung (UX Focus v0.2 §6/§12/§15, PO18-01/02/04
   korrigiert) ── Ab 1024px trägt der Prozesszustand die Spaltenbreiten: welche
   Zone die verbleibende Fläche (1fr) bekommt, wechselt mit dem Zustand —
   Reader im Signal-Zustand, Werkbank in Perspektive/Post. Der Feed bleibt in
   jedem Zustand eine ECHTE, lesbare Liste (kein Punkte-Rail mehr) — nur die
   Spaltenbreite und, im schmalen Desktop-Bereich, die Zeilendichte ändern
   sich. */
@media (min-width: 1024px) {
  /* §15 Post-Breite: bei sehr breiter Werkbank-Zone (z. B. 1920px) bleibt
     der Editor bei ~760–820px und links am Reader ausgerichtet, statt in
     der großen Zone zentriert und dadurch "verloren" zu wirken. */
  .workshop[data-state="post"] .bench-body { max-width: 820px; }

  /* PO18-11: die große Werkbank-Zone im Perspektive-Zustand bleibt breit,
     aber der eigentliche Inhalt (empfohlene/gewählte Perspektive, Deine
     These, POST ERSTELLEN, weitere Perspektiven) bekommt eine sinnvolle
     Lesebreite statt fast bildschirmbreiter Textzeilen — links an der
     Werkbank ausgerichtet, nicht zentriert im Weißraum (derselbe
     Stretch-vor-Center-Mechanismus wie bereits beim Post-Zustand oben). */
  .workshop[data-state="perspective"] .bench-body { max-width: 880px; }
}

/* 1024–1439px: PO18-04 — statt der verworfenen Punkte-Rail eine echte,
   schmale Mini-Liste mit lesbaren (mehrzeiligen) Titeln. Meta-/Statuszeile
   und die Mehr-Aktion weichen der Enge; Titel und Ungelesen-Punkt bleiben
   die einzigen, aber echten Informationsträger — der Nutzer sieht immer,
   WAS er anklickt, nie eine abstrakte Punktewand. */
@media (min-width: 1024px) and (max-width: 1439px) {
  .workshop[data-state="signal"] { grid-template-columns: 300px minmax(0, 1fr) 380px; }
  .workshop[data-state="perspective"] { grid-template-columns: 160px 340px minmax(0, 1fr); }
  .workshop[data-state="post"] { grid-template-columns: 150px 300px minmax(0, 1fr); }

  .workshop[data-state="perspective"] .feed .fi-meta,
  .workshop[data-state="perspective"] .feed .fi-status,
  .workshop[data-state="perspective"] .feed .fi-actions,
  .workshop[data-state="post"] .feed .fi-meta,
  .workshop[data-state="post"] .feed .fi-status,
  .workshop[data-state="post"] .feed .fi-actions {
    display: none;
  }
  .workshop[data-state="perspective"] .feed .feed-item,
  .workshop[data-state="post"] .feed .feed-item {
    grid-template-columns: 16px minmax(0, 1fr);
    padding: var(--s-3) var(--s-3);
  }
}

/* PO18-02: ab 1440px ist genug Raum vorhanden — der Feed nutzt ihn als
   echte, komfortabel lesbare Spalte statt künstlich auf 64–88px reduziert
   zu werden. */
@media (min-width: 1440px) {
  .workshop[data-state="signal"] { grid-template-columns: 360px minmax(0, 1fr) 400px; }
  .workshop[data-state="perspective"] { grid-template-columns: 300px 360px minmax(0, 1fr); }
  .workshop[data-state="post"] { grid-template-columns: 280px 340px minmax(0, 1fr); }
}

.zone {
  overflow-y: auto;
  min-height: 0;
}

/* ── Zone 1: Signal-Feed ───────────────────────── */
.feed {
  border-right: var(--edge);
  display: flex;
  flex-direction: column;
}

.feed-filters {
  padding: var(--s-4) var(--s-5);
  border-bottom: var(--edge);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-3);
  align-items: center;
  position: relative;
}

.filter-state {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-500);
  padding: 4px 8px;
}
.filter-state.active {
  color: var(--ink);
  font-weight: 600;
  background: var(--wash);
}
.filter-state .count { color: var(--gray-400); font-weight: 500; margin-left: 3px; }
.filter-state.active .count { color: var(--gray-500); }

.filter-dim {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--gray-500);
  padding: 4px 6px;
}
.filter-dim + .filter-dim { margin-left: 0; }
.filter-dim:hover { color: var(--ink); }
.filter-dim.set { color: var(--ink); font-weight: 600; }

.filter-menu {
  position: absolute;
  top: 100%;
  right: var(--s-4);
  background: var(--paper);
  border: var(--edge-strong);
  box-shadow: var(--overlay-shadow);
  z-index: 30;
  min-width: 200px;
  padding: var(--s-2) 0;
}
.filter-menu button {
  display: block;
  width: 100%;
  text-align: left;
  font-size: 13.5px;
  padding: 7px var(--s-4);
}
.filter-menu button:hover { background: var(--wash); }
.filter-menu button.current { font-weight: 600; }

.filter-chip {
  flex-basis: 100%;
  font-size: 12.5px;
  color: var(--ink-soft);
}
.filter-chip button {
  font-size: 12px;
  color: var(--gray-500);
  margin-left: 6px;
  border-bottom: 1px solid var(--gray-300);
}

.feed-list { flex: 1; }

/* Feed-Item: Statusspalte | Textblock | eine Overflow-Aktion.
   Der Punkt sitzt vertikal zentriert in einer eigenen schmalen Spalte;
   Headline und Metazeile beginnen auf derselben horizontalen Achse. */
.feed-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 26px;
  align-items: center;
  column-gap: var(--s-2);
  width: 100%;
  text-align: left;
  cursor: pointer;
  padding: var(--s-4) var(--s-4);
  border-bottom: 1px solid var(--hairline-soft);
  transition: background var(--ease);
}
.feed-item:hover { background: var(--wash); }
.feed-item:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}
/* Ausgewählt: ausschließlich eine sehr helle Marker-Tönung.
   Keine schwarze Auswahlkante, keine Karten-Umrandung. */
.feed-item.selected { background: var(--accent-tint); }
.feed-item.selected:hover { background: var(--accent-tint); }

/* Statusspalte: nur der Ungelesen-Punkt, sonst leer */
.fi-dot-col {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
}
.unread-dot {
  width: 7px;
  height: 7px;
  background: var(--sys-unread);
  border-radius: 50%;
}

.fi-body { min-width: 0; }

/* Headline: alle gleich kräftig, unabhängig vom Lesezustand */
.feed-item .fi-title {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: var(--t-item);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.38;
}

/* Erste Metazeile: Quelle · Datum (PO18-03) — wird bei Platzmangel sauber
   umgebrochen statt kryptisch gekürzt; keine erzwungene Einzeiligkeit mehr. */
.feed-item .fi-meta {
  margin-top: 3px;
  font-size: 12px;
  display: flex;
  flex-wrap: wrap;
  row-gap: 2px;
  gap: var(--s-2);
  align-items: baseline;
  min-width: 0;
}
.fi-meta .dot-sep { color: var(--gray-300); }
.fi-marks {
  margin-left: auto;
  display: inline-flex;
  gap: 5px;
  flex: none;
}
.fi-mark { display: inline-flex; color: var(--gray-400); }
.fi-mark .ic { width: 12px; height: 12px; }
.fi-mark--muted { color: var(--gray-300); }

/* Zweite, eigene Zeile für den Erfassungsstatus (PO18-03/PO18-05): reine
   Metadateninformation, kein Warnzustand — durchgehend ruhig/systemgrau,
   nie Marker-Gelb. Auf normalen Breiten (ab dem Feed-Ausbau aus PO18-02)
   bleibt "Feed vollständig erfasst" dadurch vollständig lesbar. */
.feed-item .fi-status {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--gray-500);
}

/* PO18-07: eine geöffnete Feed-Zeile bekommt einen eigenen, expliziten
   Stacking-Kontext (statt sich nur auf "andere Zeilen sind unpositioniert"
   zu verlassen) — robust gegen jede spätere Änderung an Nachbarzeilen. */
.feed-item.menu-open {
  position: relative;
  z-index: 30;
}

/* Genau eine Sekundäraktion, bei Auswahl, Hover oder Tastaturfokus */
.fi-actions {
  position: relative;
  visibility: hidden;
}
.feed-item:hover .fi-actions,
.feed-item:focus-within .fi-actions,
.feed-item.menu-open .fi-actions,
.feed-item.selected .fi-actions { visibility: visible; }
.feed-more {
  position: absolute;
  top: calc(100% + 2px);
  right: 0;
  left: auto;
  bottom: auto;
  min-width: 210px;
}
/* PO18-07 — der eigentliche Fehler: .feed-more UND das generische
   .more-menu (unten, für das Post-Editor-"Mehr"-Menü) sitzen auf demselben
   Element. .more-menu ankert nach OBEN (bottom: ...) für sein eigenes
   Anwendungsfeld, .feed-more nach UNTEN (top: ...) für die Feed-Zeile —
   beide Werte griffen gleichzeitig, wodurch die Box eine falsche, fast
   kollabierte Höhe bekam: Hintergrund/Rahmen saßen an der falschen Stelle,
   während der Text sichtbar in die nächste Feed-Zeile lief. Diese Regel
   (höhere Spezifität durch Kombination beider Klassen, unabhängig von der
   Reihenfolge im Stylesheet) legt Positionierung/Breite für die
   Feed-Variante eindeutig und ausschließlich fest. */
.more-menu.feed-more {
  top: calc(100% + 2px);
  bottom: auto;
  right: 0;
  left: auto;
  width: 210px;
  min-width: 0;
}
/* Bei wenig Platz unterhalb (Zeile nahe des unteren Viewport-/Feed-Rands,
   siehe positionFeedMenu() in app.js) öffnet das Menü stattdessen nach oben. */
.more-menu.feed-more.feed-more--up {
  top: auto;
  bottom: calc(100% + 2px);
}

.feed-empty {
  padding: var(--s-8) var(--s-5);
  text-align: center;
  color: var(--gray-500);
  font-size: 13.5px;
}


/* ── Zone 2: Reader ────────────────────────────── */
.reader {
  border-right: var(--edge);
  position: relative;
}

.reader-inner {
  max-width: var(--w-read-max);
  margin: 0 auto;
  padding: var(--s-7) var(--s-8) var(--s-9);
}

.reader-topmeta {
  display: flex;
  gap: var(--s-2);
  flex-wrap: wrap;
  align-items: baseline;
}
.reader-topmeta .src { font-weight: 600; color: var(--ink-soft); }
.reader-topmeta .status-full,
.reader-topmeta .status-multi { color: var(--gray-500); }
.reader-topmeta .status-partial,
.reader-topmeta .status-linkonly { color: var(--brand-warn-ink); font-weight: 500; }

.reader-title {
  font-family: var(--font-read);
  font-size: var(--t-doc);
  font-weight: 600;
  line-height: 1.28;
  margin-top: var(--s-4);
  letter-spacing: -0.005em;
}

/* Einschränkungs-Bande: Marker-Mechanik, keine Ampel */
.status-band {
  background: var(--brand-accent);
  color: var(--brand-warn-ink);
  font-size: 13.5px;
  line-height: 1.5;
  padding: var(--s-3) var(--s-4);
  margin-top: var(--s-5);
}
.status-band a, .status-band button {
  color: inherit;
  font-weight: 600;
  border-bottom: 1px solid currentColor;
  font-size: inherit;
}

/* Reader-Modi: zwei Ebenen, keine Tab-Leiste */
.reader-modes {
  display: flex;
  gap: var(--s-5);
  margin-top: var(--s-6);
  border-bottom: var(--edge);
  padding-bottom: var(--s-3);
}
.reader-mode {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray-500);
  padding-bottom: 2px;
}
.reader-mode.active {
  color: var(--ink);
  box-shadow: 0 2px 0 var(--ink);
}

/* Reader Clarity v0.2: readerSummary as an editorial lead-in under the
   title — no card, no background, no icon, just typography. */
.reader-summary {
  font-family: var(--font-read);
  font-size: var(--t-read);
  line-height: var(--lh-read);
  color: var(--ink-soft);
  margin-top: var(--s-5);
}

/* §8: Rückfall auf den Feed-Ausschnitt, wenn kein readerSummary
   existiert — klar als Feed-Inhalt erkennbar, nie als "KI-Zusammenfassung"
   ausgegeben. */
.reader-summary-fallback { margin-top: var(--s-5); }
.reader-summary-fallback .reader-summary { margin-top: 6px; }

.reader-fulltext-toggle { margin-top: var(--s-5); }
.reader-evidence-toggle { display: inline-block; }

.reader-body { margin-top: var(--s-6); }

.reader-body p.read {
  font-family: var(--font-read);
  font-size: var(--t-read);
  line-height: var(--lh-read);
  color: var(--ink);
}
.reader-body p.read + p.read { margin-top: var(--s-4); }

.reader-section { margin-top: var(--s-7); }
.reader-section > .label { display: block; margin-bottom: var(--s-4); }

/* PO18-08: pro Fakt ein vertikaler Block — .fact-main (Index+Text
   horizontal) oben, ein optionales Zitat und die Quellenangabe darunter
   über die volle Readerbreite. Keine Tabelle, keine parallelen Spalten
   (das war der vorherige Fehler: .fact selbst war display:flex und
   drückte Index/Text/Zitat/Quelle in eine einzige, extrem schmale Zeile). */
.fact {
  display: block;
  width: 100%;
  padding: var(--s-4) 0;
  border-bottom: 1px solid var(--hairline-soft);
}
.fact-main {
  display: flex;
  gap: var(--s-3);
  align-items: baseline;
  font-size: 14.5px;
  line-height: 1.5;
}
.fact-main .fact-text { flex: 1; }
.fact-main .fact-index {
  flex: none;
  color: var(--gray-400);
  font-variant-numeric: tabular-nums;
}
.fact-main .fact-type {
  margin-left: auto;
  flex: none;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--gray-500);
}
.fact-main .fact-type.luecke { color: var(--brand-warn-ink); }

.fact-quote {
  margin-top: var(--s-3);
  padding-left: var(--s-3);
  border-left: 2px solid var(--hairline);
  font-family: var(--font-read);
  font-size: 14px;
  line-height: var(--lh-read);
  color: var(--ink-soft);
}
.fact-source {
  margin-top: var(--s-2);
}

.reader-original {
  margin-top: var(--s-7);
}
.reader-original a {
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 1px;
}

.reader-related { margin-top: var(--s-7); }
.reader-related summary {
  cursor: pointer;
  list-style: none;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray-500);
}
.reader-related summary::-webkit-details-marker { display: none; }
.reader-related summary::after { content: " ▾"; font-size: 11px; }
.reader-related[open] summary::after { content: " ▴"; }
.related-item {
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--hairline-soft);
  font-size: 14px;
}
.related-item .meta { display: block; margin-top: 2px; }

.reader-placeholder {
  padding: var(--s-9) var(--s-8);
  text-align: center;
  color: var(--gray-500);
}

/* ── Beleg-Drawer: überlagert den Reader, nie die Werkbank ── */
.evidence {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 86%);
  background: var(--paper);
  border-left: var(--edge-strong);
  box-shadow: var(--overlay-shadow);
  padding: var(--s-7) var(--s-6);
  overflow-y: auto;
  z-index: 20;
}
.evidence .ev-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.evidence .ev-close { font-size: 13px; color: var(--gray-500); }
.evidence .ev-close:hover { color: var(--ink); }

.evidence .ev-claim {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  margin-top: var(--s-5);
}
.evidence .ev-quote {
  font-family: var(--font-read);
  font-size: 16px;
  line-height: var(--lh-read);
  margin-top: var(--s-5);
  padding-left: var(--s-4);
  border-left: 2px solid var(--ink);
}
.evidence .ev-quote.is-gap { border-left-color: var(--gray-300); color: var(--ink-soft); }
.evidence dl { margin-top: var(--s-6); }
.evidence dt {
  font-size: var(--t-label);
  font-weight: 700;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--gray-500);
  margin-top: var(--s-4);
}
.evidence dd { font-size: 13.5px; margin-top: 3px; }
.evidence .ev-type-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  padding: 3px 8px;
  border: var(--edge-strong);
  margin-top: var(--s-5);
}
.evidence .ev-type-badge.beleg { background: var(--ink); color: var(--paper); }
.evidence .ev-type-badge.luecke { background: var(--brand-accent); color: var(--brand-warn-ink); border-color: transparent; }

/* ── Zone 3: Strategische Werkbank ─────────────── */
.bench {
  display: flex;
  flex-direction: column;
}

.bench-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--s-6);
}

.bench-section { margin-bottom: var(--s-6); }
.bench-section > .label { display: block; margin-bottom: var(--s-2); }
.bench-section p { font-size: 14px; line-height: 1.55; color: var(--ink-soft); }
.bench-section ul { list-style: none; }
.bench-section li {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
  padding: 5px 0 5px 14px;
  position: relative;
}
.bench-section li::before {
  content: "·";
  position: absolute;
  left: 0;
  font-weight: 700;
}

.bench-note {
  background: var(--brand-accent);
  color: var(--brand-warn-ink);
  font-size: 13.5px;
  line-height: 1.5;
  padding: var(--s-3) var(--s-4);
  margin-bottom: var(--s-6);
}

.bench-cta { margin-top: var(--s-7); }
.bench-cta .btn-primary { width: 100%; text-align: center; }
.bench-cta .aside {
  display: block;
  text-align: center;
  margin-top: var(--s-3);
}

/* Perspektivwahl — keine umrandeten Karten, kein Dashboard. Empfohlene
   Perspektive zuerst; Alternativen eingeklappt (persp-alt-list), erst
   per "N weitere Perspektiven" erreichbar (UX Focus v0.2 §12). */
.persp-recommended { padding: var(--s-4) 0; }
.persp-recommended .p-title { font-size: 17px; font-weight: 600; line-height: 1.35; letter-spacing: -0.01em; }
.persp-recommended .p-rationale { font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; margin-top: var(--s-2); }
.persp-pick-btn {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 18px;
  margin-top: var(--s-4);
  transition: opacity var(--ease);
}
.persp-pick-btn:hover { opacity: 0.85; }

.persp-alt-toggle {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-500);
  margin-top: var(--s-6);
}
.persp-alt-toggle:hover { color: var(--ink); }
.persp-alt-toggle .chev { transition: transform var(--ease); display: inline-block; }
.persp-alt-toggle[aria-expanded="true"] .chev { transform: rotate(90deg); }

.persp-alt-list { max-height: 0; overflow: hidden; transition: max-height var(--ease); }
.persp-alt-list.open { max-height: 600px; }
.persp-alt-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-top: 1px solid var(--hairline-soft);
  font-family: inherit;
  cursor: pointer;
  padding: var(--s-4) 0;
}
.persp-alt-item .p-title { font-size: 14.5px; font-weight: 600; }
.persp-alt-item .p-rationale { font-size: 13px; color: var(--gray-500); line-height: 1.5; margin-top: 4px; }
/* PR18-03: Perspektiv-Chooser nach bereits erfolgter Auswahl — dieselbe
   Liste, aktuelle Auswahl bleibt sichtbar markiert. */
.persp-alt-item.selected { background: var(--wash); }
.persp-alt-item--current { cursor: default; }
.persp-alt-current { font-weight: 400; color: var(--gray-500); }

.persp-selected-block { padding-bottom: var(--s-4); }
.persp-selected-block .p-title { font-size: 17px; font-weight: 600; margin-top: var(--s-2); letter-spacing: -0.01em; }
.persp-change-link { display: block; margin-top: var(--s-4); }
.field-label { margin: var(--s-6) 0 var(--s-2); }

.thesis-field {
  width: 100%;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  border: var(--edge);
  padding: var(--s-3);
  resize: vertical;
  border-radius: var(--radius);
}
.thesis-field::placeholder { color: var(--gray-400); }
.thesis-field:focus { outline: none; border-color: var(--ink); }

.gen-status {
  margin-top: var(--s-5);
  font-size: 13.5px;
  color: var(--gray-500);
  text-align: center;
  white-space: pre-line;
}

/* "Relevant als Beobachtung" (§11) — kein neuer Status, nur Sprache. */
.observation-panel { padding-top: var(--s-4); }
.observation-panel p { font-size: 14px; line-height: 1.55; color: var(--ink-soft); margin: var(--s-3) 0 var(--s-5); }
.btn-primary.confirmed { background: var(--ink-soft); cursor: default; }
.btn-primary.confirmed:hover { opacity: 1; }

/* Post-Provenienz + Editor (§15/§16/§17/§19) */
.post-provenance {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-4);
  flex-wrap: wrap;
  font-size: 13.5px;
  color: var(--ink-soft);
}
.post-editor-wrap { margin-top: var(--s-3); }
.post-editor {
  width: 100%;
  min-height: 210px;
  font-family: var(--font-ui);
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  border: var(--edge);
  padding: var(--s-4);
  resize: vertical;
  border-radius: var(--radius);
}
.post-editor:focus { outline: none; border-color: var(--ink); }

.autosave-note { margin-top: var(--s-2); }
.autosave-note--error { color: var(--alert); }

/* Zu LinkedIn kopieren — die einzige Primäraktion im Post-Zustand,
   Marker als bewusste Ausnahme vom sonst monochromen Interface. */
.copy-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  width: 100%;
  background: var(--brand-accent);
  color: var(--brand-accent-ink);
  font-size: 14px;
  font-weight: 700;
  padding: 12px;
  margin-top: var(--s-5);
  transition: opacity var(--ease);
}
.copy-cta:hover { opacity: 0.88; }
.copy-cta.copied { background: var(--ink); color: var(--paper); }
.copy-cta.error { background: var(--wash); color: var(--ink-soft); }

.post-secondary {
  display: flex;
  gap: var(--s-4);
  margin-top: var(--s-4);
  justify-content: center;
  position: relative;
  flex-wrap: wrap;
}
.post-more-wrap { position: relative; }
.post-foot {
  margin-top: var(--s-6);
  font-size: 10px;
  letter-spacing: 0.02em;
  color: var(--gray-400);
  text-align: center;
}

.more-menu {
  position: absolute;
  bottom: calc(100% + 4px);
  right: 0;
  background: var(--paper);
  border: var(--edge-strong);
  box-shadow: var(--overlay-shadow);
  min-width: 190px;
  padding: var(--s-2) 0;
  z-index: 25;
}
.more-menu button {
  display: block;
  width: 100%;
  text-align: left;
  font-size: 13.5px;
  padding: 8px var(--s-4);
}
.more-menu button:hover { background: var(--wash); }
.more-menu hr { border: none; border-top: var(--edge); margin: var(--s-2) 0; }
.more-menu button.danger { color: var(--alert); }

/* Einordnung: Evidenzlage als eine Summenzeile, keine Listen */
.bench-tally { font-variant-numeric: tabular-nums; }

/* Kein Winkel / unzureichende Evidenz */
.bench-verdict {
  padding: var(--s-6) 0;
}
.bench-verdict .v-main {
  font-family: var(--font-read);
  font-size: 17px;
  line-height: 1.55;
}
.bench-verdict .v-detail {
  font-size: 13.5px;
  color: var(--gray-500);
  line-height: 1.55;
  margin-top: var(--s-4);
}

.bench-placeholder {
  padding: var(--s-8) var(--s-6);
  color: var(--gray-500);
  font-size: 13.5px;
  text-align: center;
}

/* ════════════════════════════════════════════════
   LEERZUSTAND
   ════════════════════════════════════════════════ */

.workshop-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-8);
}
.workshop-empty .inner {
  max-width: 460px;
  text-align: center;
}
.workshop-empty h2 {
  font-family: var(--font-read);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.4;
}
.workshop-empty p {
  margin-top: var(--s-4);
  font-size: 14px;
  color: var(--gray-500);
  line-height: 1.55;
}
.workshop-empty .btn-text { margin-top: var(--s-5); }

/* ════════════════════════════════════════════════
   STATUSZEILE / RÜCKGÄNGIG
   ════════════════════════════════════════════════ */

.toast {
  position: fixed;
  left: calc(var(--w-nav) + var(--s-6));
  bottom: var(--s-6);
  background: var(--ink);
  color: var(--paper);
  font-size: 13.5px;
  padding: 10px var(--s-5);
  display: flex;
  gap: var(--s-5);
  align-items: baseline;
  z-index: 60;
  box-shadow: var(--overlay-shadow);
}
.toast button {
  color: var(--paper);
  font-weight: 600;
  font-size: 13px;
  border-bottom: 1px solid var(--paper);
}
.toast--error { background: var(--ink-soft); }

/* §27: Quellen-Übersicht — ruhige Overlay-Fläche, read-only. */
.sources-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(360px, 90%);
  background: var(--paper);
  border-left: var(--edge-strong);
  box-shadow: var(--overlay-shadow);
  padding: var(--s-6);
  overflow-y: auto;
  z-index: 45;
}
.sources-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--s-5);
}
.source-row {
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--hairline-soft);
}
.source-row .src-name { font-size: 14px; font-weight: 600; }
.sources-note {
  margin-top: var(--s-6);
  line-height: 1.5;
}

/* ════════════════════════════════════════════════
   RESPONSIVE
   Fachliche Reihenfolge bleibt: Feed → Reader → Werkbank.
   Nur die Gleichzeitigkeit ändert sich.
   ════════════════════════════════════════════════ */

@media (max-width: 1023px) {
  /* Sequenzieller Fokus: eine Zone, klare Führung */
  .app { grid-template-columns: 1fr; }
  .nav {
    flex-direction: row;
    align-items: center;
    border-right: none;
    border-bottom: var(--edge);
    padding: var(--s-3) var(--s-5);
    gap: var(--s-5);
  }
  .nav .wordmark { margin-bottom: 0; padding: 0; }
  .nav .wordmark .brand { display: none; }
  .nav .wordmark .product { font-size: 15px; margin-top: 0; }
  .nav-item { width: auto; padding: 6px 0; border-left: none; }
  .nav-item.active { box-shadow: 0 2px 0 var(--ink); }
  .nav-spacer { flex: 1; }
  .nav-foot { border-top: none; margin: 0; padding-top: 0; }

  .module-head { padding: var(--s-4) var(--s-5); flex-wrap: wrap; }
  .ws-menu { left: var(--s-5); }

  .workshop { display: block; overflow-y: auto; }

  .workshop > .zone { display: none; border-right: none; }
  .workshop[data-mobile="feed"] .feed { display: flex; }
  .workshop[data-mobile="reader"] .reader { display: block; }
  .workshop[data-mobile="bench"] .bench { display: flex; }

  .reader-inner { padding: var(--s-6) var(--s-5) var(--s-8); }

  /* Mobile Zonenleiste */
  .mobile-zonebar {
    display: flex;
    position: sticky;
    top: 0;
    background: var(--paper);
    border-bottom: var(--edge);
    z-index: 15;
  }
  .mobile-zonebar button {
    flex: 1;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gray-400);
    padding: var(--s-3);
  }
  .mobile-zonebar button.active { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }

  .toast { left: var(--s-4); right: var(--s-4); }
}

@media (min-width: 1024px) {
  .mobile-zonebar { display: none; }
}

/* Kompakte Höhen (z. B. 1366×768 oder 125 % Zoom):
   vertikale Großzügigkeit reduzieren, Lesegrößen unverändert */
@media (max-height: 760px) and (min-width: 1024px) {
  .module-head { padding: var(--s-4) var(--s-7) var(--s-3); }
  .reader-inner { padding-top: var(--s-5); padding-bottom: var(--s-7); }
  .bench-body { padding-top: var(--s-5); }
  .feed-item { padding-top: var(--s-4); padding-bottom: var(--s-4); }
  /* PR18-05: bei knapper Höhe soll der Editor nicht auf eine starre 44vh
     gezwungen werden — das würde das inhaltsgetriebene Auto-Grow wieder
     aushebeln. Eine niedrigere Mindesthöhe spart Platz, ohne zu wachsen. */
  .workshop[data-state="post"] .post-editor { min-height: 160px; }
}

/* Reduzierte Bewegung respektieren */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  /* PR18-06: die globale Regel oben deaktiviert nur transition — der
     Refresh-Spinner/-Sweep laufen über animation und brauchen ihre eigene
     Abschaltung. */
  .ic-spin, .refresh-progress.active::after { animation: none !important; }
}
