/*
 * app.css – Gestaltung der öffentlichen KI-Sammlung.
 *
 * Grundlage: docs/DESIGN.md (Schulfarben des Goethe-Gymnasiums Bensheim).
 * Die vier Farben setzen Akzente auf einer ruhigen, weißen Fläche –
 * keine großen Farbflächen, keine Verläufe.
 *
 * Mobile first: Grundregeln gelten fürs Handy, ab 40rem/60rem kommen Ergänzungen.
 */

/* ---------- Farben (siehe docs/DESIGN.md) ---------- */

:root {
  --ggb-blau: #003399;
  --ggb-bordeaux: #830036;
  --ggb-gelb: #e3b300;
  --ggb-grau: #868885;

  --text: #2b2c2a;
  --text-leise: #5f615e;
  --flaeche: #ffffff;
  --flaeche-2: #f6f6f4;
  --rahmen: #dedfdc;
  --akzent: var(--ggb-blau);        /* Buttons, Links, Fokus, aktive Filter */
  --auf-akzent: #ffffff;            /* Schrift auf Akzent-Fläche */
  --marke: var(--ggb-bordeaux);     /* Seitentitel, Kopfzeile */
  --signal: var(--ggb-gelb);        /* „Kopiert ✓“ – nie als Schrift auf Weiß */
  --auf-signal: #2b2c2a;
  --fehler: #b3261e;
  --seite: var(--flaeche);          /* Seitenhintergrund: weiß */
  --schatten: 0 1px 2px rgba(20, 24, 40, 0.04), 0 2px 8px rgba(20, 24, 40, 0.05);
  --schatten-hoch: 0 2px 4px rgba(20, 24, 40, 0.06), 0 10px 24px rgba(20, 24, 40, 0.10);

  /* Kategorie-Farben: vier Gruppen nach DESIGN.md */
  --kat-unterricht: var(--ggb-blau);
  --kat-rueckmeldung: var(--ggb-bordeaux);
  --kat-schulalltag: var(--ggb-grau);
  --kat-schueler: var(--ggb-gelb);

  --radius-karte: 10px;
  --radius-knopf: 8px;
  --radius-chip: 999px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #e8e9e6;
    --text-leise: #b4b6b3;
    --flaeche: #16181d;
    --flaeche-2: #1f2229;
    --rahmen: #33363d;
    --akzent: #7f9dff;
    --auf-akzent: #0d1020;
    --marke: #ff7aa8;
    --signal: #f0c63a;
    --auf-signal: #16181d;
    --fehler: #f2b8b5;
    --schatten: 0 1px 2px rgba(0, 0, 0, 0.3);
    --schatten-hoch: 0 4px 16px rgba(0, 0, 0, 0.45);

    --kat-unterricht: #7f9dff;
    --kat-rueckmeldung: #ff7aa8;
    --kat-schulalltag: #a3a5a2;
    --kat-schueler: #f0c63a;
  }
}

/* Die Farbe einer Kategorie (in der Redaktion wählbar) setzt --kat für Streifen, Chips, Etiketten */
.farbe-blau     { --kat: var(--kat-unterricht); }
.farbe-bordeaux { --kat: var(--kat-rueckmeldung); }
.farbe-grau     { --kat: var(--kat-schulalltag); }
.farbe-gelb     { --kat: var(--kat-schueler); }

/* ---------- Grundlagen ---------- */

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  /* Platz für die klebende Kopierleiste am Handy: fokussierte Felder werden nicht verdeckt */
  scroll-padding-bottom: 7rem;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--seite);
  overflow-wrap: break-word;
}

/* Links: ohne Unterstrich, halbfett in der Akzentfarbe (Halbfett unterscheidet sie
   auch ohne Farbe vom Text). Beim Zeigen blendet eine dezente Linie ein. Links mit
   eigener Klasse (Knöpfe, Karten, Chips) gestalten sich selbst. */
a { color: var(--akzent); text-decoration: none; }
a:not([class]), .link-knopf {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
  transition: text-decoration-color 0.15s ease;
}
a:not([class]):hover, .link-knopf:hover { text-decoration-color: currentColor; }

:focus-visible {
  outline: 3px solid var(--akzent);
  outline-offset: 2px;
}

[hidden] { display: none !important; }

.sprunglink {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  background: var(--flaeche);
  padding: 0.5rem 1rem;
  z-index: 10;
}
.sprunglink:focus { left: 0.5rem; }

.klein { font-size: 0.875rem; color: var(--text-leise); }

/* ---------- Kopf (64 px: Logo, Name, „Einreichen“) ---------- */

.kopf {
  background: var(--flaeche);
  border-bottom: 1px solid var(--rahmen);
}
.kopf-innen {
  max-width: 72rem;
  min-height: 63px; /* + 1 px Rahmen = 64 px */
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.logo { margin: 0; font-weight: 700; font-size: 1.15rem; }
.logo a {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 44px;
  color: var(--akzent);
  text-decoration: none;
}
.logo-bild { height: 32px; width: auto; }
#logo-text { white-space: nowrap; }
/* Sehr schmale Handys (320 px): Kopfzeile etwas enger, damit nichts seitlich übersteht */
@media (max-width: 23rem) {
  .kopf-innen { gap: 0.5rem; padding: 0 0.75rem; }
  .logo { font-size: 0.95rem; }
  .logo a { gap: 0.5rem; }
  .logo-bild { height: 26px; }
  .knopf-kopf { padding: 0.4rem 0.75rem; }
}
@media (max-width: 23rem) and (prefers-color-scheme: dark) {
  .logo-bild { padding: 3px 4px; }
}
@media (prefers-color-scheme: dark) {
  /* Logo nicht invertieren, sondern auf weißer Fläche zeigen */
  .logo-bild { background: #ffffff; padding: 4px 6px; border-radius: 6px; box-sizing: content-box; }
}
.knopf-kopf { min-height: 40px; padding: 0.4rem 1.1rem; font-size: 0.95rem; white-space: nowrap; }

/* ---------- Inhalt ---------- */

.inhalt {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}
.inhalt:focus { outline: none; }

.seitentitel {
  font-size: 1.5rem;
  line-height: 1.25;
  font-weight: 700;
  color: var(--akzent);
  margin: 0.5rem 0 0.35rem;
  text-wrap: balance;
}
.seitentitel:focus { outline: none; }
.einleitung { margin: 0 0 1rem; color: var(--text-leise); }

.hinweis-box {
  background: var(--flaeche);
  border: 1px solid var(--rahmen);
  border-radius: var(--radius-karte);
  padding: 0.75rem 1rem;
}

/* Nur für Screenreader sichtbar */
.nur-vorlesen {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Eingabefelder (auch im Einreichen-Formular) ---------- */

input[type="search"], input[type="text"], input[type="url"], select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--rahmen);
  border-radius: var(--radius-knopf);
  background: var(--flaeche);
  color: var(--text);
  font: inherit;
}
::placeholder { color: var(--text-leise); opacity: 1; }
textarea { resize: vertical; }

/* ---------- Große Suche ---------- */

.suche {
  position: relative;
  margin: 1.25rem 0 0;
}
.suche-lupe {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  width: 22px;
  height: 22px;
  transform: translateY(-50%);
  color: var(--text-leise);
  pointer-events: none;
}
.suche input[type="search"] {
  height: 56px;
  padding: 0 1.25rem 0 3.25rem;
  border-radius: var(--radius-chip);
  font-size: 1.125rem;
  box-shadow: var(--schatten);
}
.suche input[type="search"]:focus { border-color: var(--akzent); }

/* ---------- Filterzeile: Chips + Pills ---------- */

.filterzeile {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}
.chips {
  display: flex;
  gap: 0.5rem;
  min-width: 0;
  /* Kategorien in einer wischbaren Zeile */
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 -1rem;
  padding: 2px 1rem;
}
.chips::-webkit-scrollbar { display: none; }
/* Weicher Rand zeigt: hier geht es weiter (nur wenn gescrollt werden kann, setzt app.js .mehr) */
.chips.mehr-rechts { -webkit-mask-image: linear-gradient(to right, #000 85%, transparent); mask-image: linear-gradient(to right, #000 85%, transparent); }

/* Chip: inaktiv weiß mit Rahmen und Farbpunkt, nur der aktive ist gefüllt */
.chip, .pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
  min-height: 44px;
  padding: 0.4rem 1rem;
  border: 1px solid var(--rahmen);
  border-radius: var(--radius-chip);
  background: var(--flaeche);
  color: var(--text);
  font: inherit;
  font-size: 0.925rem;
  cursor: pointer;
}
.chip::before {
  content: "";
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--kat, var(--ggb-grau));
}
.chip-alle::before { display: none; }
.chip:hover, .pill:hover { border-color: var(--akzent); }
.chip[aria-pressed="true"], .pill.aktiv {
  background: var(--akzent);
  border-color: var(--akzent);
  color: var(--auf-akzent);
  font-weight: 600;
}
.chip[aria-pressed="true"]::before { box-shadow: 0 0 0 2px var(--auf-akzent); }

.pills { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.pills .pill { padding: 0.4rem 0.6rem 0.4rem 0.85rem; font-size: 0.875rem; gap: 0.3rem; }
.pill-huelle { position: relative; }
.pill { padding-right: 0.8rem; }
.symbol { width: 18px; height: 18px; flex: 0 0 auto; }
.pill .symbol-pfeil { width: 16px; height: 16px; }
.pill[aria-expanded="true"] .symbol-pfeil { transform: rotate(180deg); }

/* Eigenes Dropdown-Menü der Pills */
.pill-menue {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  min-width: 13rem;
  max-height: min(60vh, 22rem);
  overflow-y: auto;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  background: var(--flaeche);
  border: 1px solid var(--rahmen);
  border-radius: 12px;
  box-shadow: var(--schatten-hoch);
}
.pill-menue.rechts { left: auto; right: 0; }
.pill-menue button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  min-height: 44px;
  padding: 0.4rem 0.75rem;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.pill-menue button:hover, .pill-menue button:focus-visible { background: var(--flaeche-2); }
.pill-menue button:focus-visible { outline-offset: -3px; }
.pill-menue [aria-checked="true"] { font-weight: 600; color: var(--akzent); }
.pill-menue [aria-checked="true"]::after { content: "✓"; }

/* ---------- Anmeldung, Konto in der Kopfzeile ---------- */
.kopf-konto { display: flex; align-items: center; gap: 0.75rem; }
.kopf-kuerzel {
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--rahmen);
  border-radius: var(--radius-chip);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-leise);
}
.kopf-abmelden { font-size: 0.9rem; }
/* Anmeldefenster über der verschwommenen Sammlung */
.anmelden-dialog {
  width: min(30rem, calc(100% - 2rem));
  max-height: calc(100% - 2rem);
  margin: auto;
  padding: 1.75rem 1.5rem 1.25rem;
  border: 1px solid var(--rahmen);
  border-radius: 16px;
  background: var(--flaeche);
  color: var(--text);
  box-shadow: 0 20px 60px rgba(20, 24, 40, 0.25);
  overflow: auto;
}
.anmelden-dialog::backdrop {
  background: rgba(20, 24, 40, 0.2);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.anmelden-titel { margin: 0 0 0.5rem; font-size: 1.5rem; color: var(--akzent); }
.anmelden-dialog .einleitung { margin: 0; }
.anmelden-dialog .anmelden-formular { margin-top: 1.25rem; }
.anmelden-dialog .anmelden-formular > p:last-child { margin: 0; }
@media (prefers-color-scheme: dark) {
  .anmelden-dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
}

/* Platzhalter-Karten hinter dem Anmeldefenster (keine echten Inhalte) */
.karte-platzhalter { min-height: 8.5rem; }
.karte-platzhalter:hover { transform: none; box-shadow: var(--schatten); }
.platzhalter-inhalt { flex: 1; display: flex; flex-direction: column; gap: 0.6rem; }
.platzhalter-balken { display: block; height: 0.75rem; width: 100%; border-radius: 4px; background: var(--flaeche-2); }
.platzhalter-balken.kurz { width: 35%; }
.platzhalter-balken.titel { width: 80%; height: 1.1rem; background: var(--rahmen); }
.platzhalter-balken.mittel { width: 60%; }
.anmelden-formular { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1.5rem; }
.haken { display: flex; align-items: flex-start; gap: 0.6rem; min-height: 44px; padding-top: 0.6rem; cursor: pointer; }
.haken input { width: 1.25rem; height: 1.25rem; margin: 0.1rem 0 0; flex: 0 0 auto; accent-color: var(--akzent); }

/* Knopf „KI verbinden“ in der Kopfzeile: hell, mit Stecker-Symbol */
.knopf-ki { gap: 0.4rem; }
.knopf-ki .symbol { width: 18px; height: 18px; }

/* Sehr schmale Handys: „Abmelden“ steht dann nur im Fuß */
@media (max-width: 23rem) {
  .kopf-abmelden { display: none; }
}

/* ---------- Seite „Mit KI verbinden“ ---------- */
.ki-rahmen { max-width: 46rem; }
.ki-adresse {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border: 1px solid var(--rahmen);
  border-radius: var(--radius-karte);
  background: var(--flaeche);
}
.ki-adresse-titel { margin: 0 0 0.25rem; font-weight: 600; }
.ki-adresse-wert { margin: 0 0 0.75rem; overflow-wrap: anywhere; }
.ki-adresse-wert code { font-size: 1rem; }
.ki-anleitung { border: 1px solid var(--rahmen); border-radius: 12px; background: var(--flaeche); margin: 0 0 0.75rem; }
.ki-anleitung summary { min-height: 44px; display: flex; align-items: center; padding: 0.5rem 1rem; font-weight: 600; cursor: pointer; }
.ki-anleitung ol { margin: 0 1rem 0.75rem; padding-left: 1.25rem; }
.ki-anleitung li { margin: 0.35rem 0; }
.ki-anleitung .klein { margin: 0 1rem 1rem; }
.ki-beispiele li { margin: 0.35rem 0; }

/* ---------- Kommentare ---------- */
.kommentare { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--rahmen); }
.kommentare h2 { font-size: 1.15rem; margin: 0 0 1rem; }
.kommentare-liste { list-style: none; margin: 0 0 1.5rem; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.kommentar { padding: 0.75rem 1rem; border: 1px solid var(--rahmen); border-radius: 12px; background: var(--flaeche); }
.kommentar-kopf { margin: 0 0 0.25rem; font-size: 0.85rem; color: var(--text-leise); display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; }
.kommentar-kopf .link-knopf { min-height: 32px; font-size: 0.85rem; }
.kommentar-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.kommentar-formular { display: flex; flex-direction: column; gap: 0.35rem; }
.kommentar-formular label { font-weight: 600; }
.leer-hinweis { color: var(--text-leise); }

/* Schmale Handys: Kürzel-Schild ausblenden, „Abmelden“ bleibt erreichbar */
@media (max-width: 45rem) {
  .kopf-kuerzel { display: none; }
  /* „KI verbinden“ nur als Symbol (Text bleibt für Screenreader) */
  .knopf-ki { padding: 0.4rem 0.6rem; }
  .knopf-ki-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .kopf-konto { gap: 0.5rem; }
  .kopf-abmelden { font-size: 0.85rem; }
}
/* Handys, angemeldet: Name neben dem Logo nur für Screenreader (sonst passt die Kopfzeile nicht) */
@media (max-width: 45rem) {
  .angemeldet #logo-link:has(#logo-bild) #logo-text {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
}

/* ---------- Kategorie-Suche beim Einreichen (Combobox) ---------- */
.kat-suche { position: relative; }
.kat-liste {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 20;
  max-height: min(50vh, 18rem);
  overflow-y: auto;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  background: var(--flaeche);
  border: 1px solid var(--rahmen);
  border-radius: 12px;
  box-shadow: var(--schatten-hoch);
}
.kat-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
}
.kat-option:hover, .kat-option[aria-selected="true"] { background: var(--flaeche-2); }
.kat-option[aria-selected="true"] { outline: 2px solid var(--akzent); outline-offset: -2px; }
.kat-punkt { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--kat, var(--ggb-grau)); flex: 0 0 auto; }
.kat-option-neu { color: var(--akzent); font-weight: 600; border-top: 1px solid var(--rahmen); border-radius: 0 0 8px 8px; }
.kat-option-neu:first-child { border-top: 0; border-radius: 8px; }
.kat-gewaehlt { margin: 0.4rem 0 0; }
.eingabe-kuerzel { max-width: 9rem; text-transform: uppercase; letter-spacing: 0.08em; }

/* ---------- Zeile über der Liste: Anzahl links, Sortierung rechts ---------- */

.ergebnis-zeile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin: 1.5rem 0 0.75rem;
}
.anzahl { flex: 1 1 auto; min-width: 0; margin: 0; color: var(--text-leise); display: flex; flex-wrap: wrap; align-items: center; gap: 0 1rem; }
.sortierung { flex: 0 0 auto; }
.sortierung .pill { border-color: transparent; color: var(--text-leise); padding-left: 0.75rem; }
.sortierung .pill:hover { border-color: var(--rahmen); }
.sortierung .pill-menue { left: auto; right: 0; }

.link-knopf {
  min-height: 44px;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--akzent);
  cursor: pointer;
}

.status {
  padding: 1rem;
  background: var(--flaeche);
  border: 1px solid var(--rahmen);
  border-radius: var(--radius-karte);
}
.status .knopf { margin-top: 0.5rem; }

/* ---------- Karten: einheitlich, gleiche Höhe ---------- */

.karten {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.karte {
  position: relative;
  display: flex;
  background: var(--flaeche);
  border: 1px solid var(--rahmen);
  border-radius: 12px;
  padding: 1.1rem 1.25rem 1rem;
  box-shadow: var(--schatten);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.karte:hover {
  transform: translateY(-2px);
  box-shadow: var(--schatten-hoch);
}
.karte:focus-within { outline: 3px solid var(--akzent); outline-offset: 2px; }
.karte article { display: flex; flex-direction: column; width: 100%; }

.karte-kopf { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.karte-kategorie {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-leise);
}
.karte-kategorie::before {
  content: "";
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--kat, var(--ggb-grau));
}
.karte-typ { display: inline-flex; color: var(--text-leise); }
.karte-rechts { display: inline-flex; align-items: center; gap: 0.5rem; flex: 0 0 auto; }
/* Zielgruppe: L neutral, S gelb hinterlegt (wie die Schulfarbe der Schüler:innen-Kategorie) */
.karte-ziel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border: 1px solid var(--rahmen);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-leise);
}
.karte-ziel.ziel-schueler {
  background: color-mix(in srgb, var(--ggb-gelb) 22%, var(--flaeche));
  border-color: color-mix(in srgb, var(--ggb-gelb) 60%, var(--flaeche));
  color: var(--text);
}

.karte-titel { font-size: 1.125rem; font-weight: 700; line-height: 1.3; margin: 0.65rem 0 0.35rem; }
.karte-link { color: var(--text); text-decoration: none; }
.karte-link:focus-visible { outline: none; }
/* Der Titel-Link deckt die ganze Karte ab (große Touch-Fläche) */
.karte-link::after {
  content: "";
  position: absolute;
  inset: 0;
}
/* Beschreibung höchstens zwei Zeilen */
.karte-text {
  margin: 0 0 1rem;
  color: var(--text-leise);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.karte-fuss {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-leise);
}
/* Kürzel rechts unten: kleines Schild, damit man auf einen Blick sieht, von wem der Beitrag ist */
.karte-von {
  flex: 0 0 auto;
  padding: 0.05rem 0.5rem;
  border: 1px solid var(--rahmen);
  border-radius: var(--radius-chip);
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Kategorie-Etikett (Detailansicht): getönte Fläche, dunkle Schrift, Punkt in Kategoriefarbe */
.etikett {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.1rem 0.6rem;
  border-radius: var(--radius-chip);
  background: var(--flaeche-2);
  background: color-mix(in srgb, var(--kat, var(--ggb-grau)) 10%, var(--flaeche));
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}
.etikett::before {
  content: "";
  width: 0.6em;
  height: 0.6em;
  border-radius: 50%;
  background: var(--kat, var(--ggb-grau));
}

.leer {
  grid-column: 1 / -1;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-leise);
  background: var(--flaeche);
  border: 1px dashed var(--rahmen);
  border-radius: 12px;
}
.leer p { margin: 0 0 0.75rem; }

/* Trennüberschrift "Außerdem fächerübergreifend" beim Fach-Filter */
.trenner {
  grid-column: 1 / -1;
  border-top: 1px solid var(--rahmen);
  margin-top: 0.75rem;
  padding-top: 0.75rem;
}
.trenner h2 { font-size: 1rem; margin: 0; color: var(--text-leise); font-weight: 600; }

/* ---------- Knöpfe ---------- */

.knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--akzent);
  border-radius: var(--radius-knopf);
  background: var(--flaeche);
  color: var(--akzent);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.knopf:hover { background: var(--flaeche-2); }
.knopf-klein { font-size: 0.9rem; padding: 0.4rem 0.85rem; white-space: nowrap; }
.knopf-haupt { background: var(--akzent); color: var(--auf-akzent); }
.knopf-haupt:hover { background: var(--akzent); filter: brightness(1.15); }
/* Nach dem Kopieren kurz Gelb mit dunkler Schrift: „Kopiert ✓“ */
.knopf.kopiert, .knopf.kopiert:hover {
  background: var(--signal);
  border-color: var(--signal);
  color: var(--auf-signal);
  filter: none;
}

/* ---------- Detail ---------- */

.zurueck {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.detail h2 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; }

.prompt-text {
  white-space: pre-wrap;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9375rem;
  line-height: 1.6;
  background: var(--flaeche);
  border: 1px solid var(--rahmen);
  border-radius: var(--radius-karte);
  padding: 1rem;
}

/* Platzhalter in der Vorschau */
mark { color: inherit; border-radius: 3px; padding: 0 0.15em; }
mark.offen {
  background: color-mix(in srgb, var(--signal) 22%, var(--flaeche));
  border-bottom: 2px dashed var(--signal);
}

/* Eingabefelder mit Beschriftung (Einreichen-Assistent) */
.feld { margin-top: 1.1rem; }
.feld label, .feld legend { display: block; font-weight: 600; margin-bottom: 0.25rem; }

/* Kopier-Leiste: klebt am Handy unten, solange die Vorschau im Bild ist */
.kopier-leiste {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin: 1rem -1rem 0;
  padding: 0.75rem 1rem;
  background: var(--flaeche-2);
  border-top: 1px solid var(--rahmen);
}
.knopf-gross { width: 100%; min-height: 52px; font-size: 1.1rem; }
.kopier-meldung { margin: 0.4rem 0 0; min-height: 1.5em; font-weight: 600; color: var(--text); }
.kopier-meldung:empty { display: none; }
.kopier-fehler { color: var(--fehler); }

.weitere-aktionen { display: flex; flex-wrap: wrap; gap: 0 1.5rem; margin: 0.25rem 0 0; }

/* Linkvorschau eines geteilten Chats */
.linkkarte {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--flaeche);
  border: 1px solid var(--rahmen);
  border-radius: var(--radius-karte);
  color: var(--text);
  text-decoration: none;
}
.linkkarte:hover { border-color: var(--akzent); }
.linkkarte-bild {
  display: block;
  width: 100%;
  aspect-ratio: 1.91 / 1;
  object-fit: cover;
  border-bottom: 1px solid var(--rahmen);
}
.linkkarte-text { display: flex; flex-direction: column; gap: 0.2rem; padding: 0.85rem 1rem 1rem; }
.linkkarte-anbieter { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-leise); }
.linkkarte-titel { font-size: 1.125rem; line-height: 1.3; }
.linkkarte-url { font-size: 0.875rem; color: var(--akzent); }

.tipp {
  margin-top: 1.5rem;
  padding: 0.25rem 1rem 0.75rem;
  background: var(--flaeche);
  border: 1px solid var(--rahmen);
  border-left: 4px solid var(--signal);
  border-radius: var(--radius-karte);
}
.tipp h2 { margin-top: 0.75rem; }
.tipp p { margin: 0; }

.infos { margin: 1.25rem 0 0; font-size: 0.9rem; color: var(--text-leise); }
.infos div { display: flex; gap: 0.5rem; }
.infos dt { font-weight: 600; }
.infos dt::after { content: ":"; }
.infos dd { margin: 0; }

/* ---------- Einreichen: Assistent in Schritten ---------- */

.assistent-rahmen { max-width: 46rem; }
.feld-hinweis { margin: 0 0 0.35rem; }

/* Fortschritt: „Schritt 2 von 6“, Balken, ab Tablet zusätzlich die Schrittnamen */
.fortschritt { margin: 0.75rem 0 1.5rem; }
.fortschritt-text { margin: 0 0 0.4rem; font-size: 0.875rem; font-weight: 600; color: var(--text-leise); }
.fortschritt-balken { height: 6px; border-radius: 3px; background: var(--flaeche-2); overflow: hidden; }
.fortschritt-balken span { display: block; height: 100%; width: 0; background: var(--akzent); transition: width 0.2s ease; }
.fortschritt-liste { display: none; }

.schritt-titel { font-size: 1.3rem; margin: 0 0 1rem; color: var(--text); }
.schritt-titel:focus { outline: none; }

/* Schritt 1: zwei große Auswahlkarten */
.art-karten { display: grid; gap: 0.75rem; }
.art-karte { position: relative; display: flex; cursor: pointer; }
.art-karte input, .wahl-chip input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.art-karte-inhalt {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.1rem 1.25rem;
  border: 2px solid var(--rahmen);
  border-radius: 12px;
  background: var(--flaeche);
  box-shadow: var(--schatten);
}
.art-karte-inhalt strong { font-size: 1.1rem; }
.art-karte .symbol { width: 28px; height: 28px; color: var(--akzent); }
.art-karte:hover .art-karte-inhalt { border-color: var(--akzent); }
.art-karte input:checked + .art-karte-inhalt {
  border-color: var(--akzent);
  background: color-mix(in srgb, var(--akzent) 6%, var(--flaeche));
}
.art-karte input:focus-visible + .art-karte-inhalt { outline: 3px solid var(--akzent); outline-offset: 2px; }

/* Schritt 4: Auswahl als antippbare Chips */
.chip-gruppe { border: 0; padding: 0; margin-left: 0; margin-right: 0; min-width: 0; }
.chip-gruppe legend { padding: 0; }
.wahl-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.wahl-chip { position: relative; display: inline-flex; cursor: pointer; }
.wahl-chip span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.4rem 1rem;
  border: 1px solid var(--rahmen);
  border-radius: var(--radius-chip);
  background: var(--flaeche);
  font-size: 0.925rem;
}
.wahl-chip[class*="farbe-"] span::before {
  content: "";
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--kat);
}
.wahl-chip:hover span { border-color: var(--akzent); }
.wahl-chip input:checked + span {
  background: var(--akzent);
  border-color: var(--akzent);
  color: var(--auf-akzent);
  font-weight: 600;
}
.wahl-chip input:checked + span::before { box-shadow: 0 0 0 2px var(--auf-akzent); }
.wahl-chip input:focus-visible + span { outline: 3px solid var(--akzent); outline-offset: 2px; }

/* Fehler direkt am Feld */
.feld-fehler { margin: 0.35rem 0 0; color: var(--fehler); font-weight: 600; font-size: 0.9rem; }
[aria-invalid="true"] { border-color: var(--fehler); }
fieldset[aria-invalid="true"] .wahl-chip span { border-color: var(--fehler); }
.zaehler { margin: 0.25rem 0 0; text-align: right; }
.link-status { margin: 0.4rem 0 0; }
.link-status.ok { color: var(--akzent); font-weight: 600; }

/* Zurück / Weiter: am Handy unten am Bildschirm */
.schritt-nav {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  gap: 0.75rem;
  margin: 2rem -1rem 0;
  padding: 0.75rem 1rem;
  background: var(--seite);
  border-top: 1px solid var(--rahmen);
}
.schritt-nav .knopf { flex: 1 1 0; }
.schritt-nav .knopf-haupt { margin-left: auto; }

/* Schritt 6: Zusammenfassung */
.zusammenfassung { margin: 0; }
.zusammenfassung-zeile {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.15rem 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--rahmen);
}
.zusammenfassung dt { font-weight: 600; font-size: 0.875rem; color: var(--text-leise); }
.zusammenfassung dd { margin: 0; min-width: 0; overflow-wrap: anywhere; grid-column: 1; }
.zusammenfassung .zusammenfassung-aendern { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.prompt-text-klein { font-size: 0.85rem; padding: 0.6rem 0.75rem; max-height: 12rem; overflow: auto; }

/* Deutlich sichtbarer Datenschutz-Hinweis */
.datenschutz-hinweis {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  background: var(--flaeche);
  border: 1px solid var(--rahmen);
  border-left: 4px solid var(--marke);
  border-radius: var(--radius-karte);
}

.fehler-box {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  background: var(--flaeche);
  border: 2px solid var(--fehler);
  border-radius: var(--radius-karte);
}
.fehler-box:focus { outline: 3px solid var(--akzent); outline-offset: 2px; }
.fehler-box p { margin: 0 0 0.25rem; }
.fehler-box ul { margin: 0; padding-left: 1.25rem; }

.knopf:disabled { opacity: 0.7; cursor: progress; }

code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--flaeche-2);
  border-radius: 4px;
  padding: 0 0.2em;
}

/* Honigtopf gegen Spam-Bots: für Menschen unsichtbar (aber nicht display:none) */
.honig { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Hilfsfeld fürs Kopieren (Rückfall-Lösung): unsichtbar, aber auswählbar */
.unsichtbar { position: fixed; top: 0; left: -9999px; opacity: 0; }

/* ---------- Fuß ---------- */

.fuss {
  border-top: 1px solid var(--rahmen);
  background: var(--flaeche);
  padding: 1rem;
  text-align: center;
  font-size: 0.9rem;
}
.fuss-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 1.5rem;
}
.fuss-links a { display: inline-block; padding: 0.6rem 0; }
.fuss-text { margin: 0.25rem 0 0; color: var(--text-leise); }

/* ---------- Größere Bildschirme ---------- */

@media (min-width: 40rem) {
  .seitentitel { font-size: 1.75rem; }
  .logo-bild { height: 40px; }
  .kopf-innen, .inhalt { padding-left: 1.5rem; padding-right: 1.5rem; }
  .karten { grid-template-columns: repeat(2, 1fr); }
  .detail { max-width: 46rem; }
  .knopf-gross { width: auto; padding: 0.6rem 2rem; }
  html { scroll-padding-bottom: 0; }
  .kopier-leiste { position: static; margin: 1rem 0 0; padding: 0; border-top: 0; background: none; }
  .art-karten { grid-template-columns: 1fr 1fr; }
  .schritt-nav { position: static; margin: 2rem 0 0; padding: 1.25rem 0 0; }
  .schritt-nav .knopf { flex: 0 0 auto; min-width: 8rem; }
  .fortschritt-liste {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    list-style: none;
    margin: 0.6rem 0 0;
    padding: 0;
    font-size: 0.8rem;
    color: var(--text-leise);
  }
  .fortschritt-liste li { display: flex; align-items: center; gap: 0.35rem; }
  .fortschritt-nummer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    border: 1px solid var(--rahmen);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
  }
  .fortschritt-liste .erledigt .fortschritt-nummer { background: var(--akzent); border-color: var(--akzent); color: var(--auf-akzent); }
  .fortschritt-liste [aria-current="step"] { color: var(--akzent); font-weight: 600; }
  .fortschritt-liste [aria-current="step"] .fortschritt-nummer { border-color: var(--akzent); }
  .linkkarte { flex-direction: row; }
  .linkkarte-bild { width: 40%; aspect-ratio: auto; border-bottom: 0; border-right: 1px solid var(--rahmen); }
}

/* Desktop: Pills größer und in einer Zeile unter den Kategorien
   (neben den Kategorien ist bei sechs Pills nicht genug Platz) */
@media (min-width: 56rem) {
  .chips { margin: 0; padding: 2px; }
  .pills { flex-wrap: nowrap; gap: 0.5rem; }
  .pills .pill { padding: 0.4rem 0.8rem 0.4rem 1rem; font-size: 0.925rem; gap: 0.45rem; }
}

@media (min-width: 60rem) {
  .karten { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Bewegung reduzieren ---------- */

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .karte:hover { transform: none; }
}

/* Text-Links mit eigener Klasse wie die übrigen Links (steht am Ende,
   weil „font: inherit“ in den Knopf-Regeln die Schriftstärke zurücksetzt) */
.link-knopf, .zurueck { font-weight: 600; }
.zurueck {
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
  transition: text-decoration-color 0.15s ease;
}
.zurueck:hover { text-decoration-color: currentColor; }
/* Handys: „Abmelden“ in der Kopfzeile normal stark, sonst passt die Zeile nicht */
@media (max-width: 45rem) {
  .kopf-abmelden { font-weight: 400; }
}
/* Handys im Dunkelmodus: Logo samt weißer Fläche etwas kleiner, sonst steht die Kopfzeile über */
@media (max-width: 45rem) and (prefers-color-scheme: dark) {
  .logo-bild { height: 26px; padding: 3px 4px; }
}

/* ---------- Versionsverlauf (Detailansicht) ---------- */
.link-knopf-a { display: inline-flex; align-items: center; min-height: 44px; }
.versionsverlauf { margin-top: 2rem; border: 1px solid var(--rahmen); border-radius: 12px; background: var(--flaeche); }
.versionsverlauf > summary { min-height: 44px; display: flex; align-items: center; padding: 0.5rem 1rem; font-weight: 600; cursor: pointer; }
.versionsverlauf > p { margin: 0 1rem 0.5rem; }
.versionen-liste { list-style: none; margin: 0; padding: 0 1rem 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.version { border: 1px solid var(--rahmen); border-radius: 10px; background: var(--flaeche-2); }
.version > summary { min-height: 44px; padding: 0.55rem 0.9rem; cursor: pointer; font-size: 0.9rem; }
.version[open] > summary { border-bottom: 1px solid var(--rahmen); }
.version-daten { margin: 0; padding: 0.75rem 0.9rem; display: flex; flex-direction: column; gap: 0.6rem; }
.version-daten dt { font-size: 0.8rem; font-weight: 600; color: var(--text-leise); }
.version-daten dd { margin: 0.1rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- Empfehlung der Redaktion (Stern) und eigene Merkliste (Lesezeichen) ---------- */
.pill-schalter { gap: 0.35rem; }
.pill-schalter .symbol { width: 16px; height: 16px; color: var(--text-leise); }
.pill-schalter[data-schalter="empfohlen"] .symbol { color: var(--ggb-gelb); }
.pill-schalter.aktiv .symbol { color: currentColor; }
.karte-stern, .karte-gemerkt { display: inline-flex; }
.karte-stern .symbol { width: 18px; height: 18px; color: var(--ggb-gelb); }
.karte-gemerkt .symbol { width: 16px; height: 16px; color: var(--akzent); }
.empfehlung {
  display: flex; align-items: flex-start; gap: 0.5rem;
  margin: 1rem 0 0; padding: 0.75rem 1rem;
  border: 1px solid color-mix(in srgb, var(--ggb-gelb) 55%, var(--flaeche));
  border-radius: 10px;
  background: color-mix(in srgb, var(--ggb-gelb) 14%, var(--flaeche));
}
.empfehlung .symbol { width: 20px; height: 20px; margin-top: 0.15rem; color: var(--ggb-gelb); }
.merk-knopf { display: inline-flex; align-items: center; gap: 0.35rem; }
.merk-knopf .symbol { width: 16px; height: 16px; fill: none; }
.merk-knopf .symbol path { fill: none; }
.merk-knopf.gemerkt .symbol path { fill: currentColor; }
