/* CoreForge · neue Shell „Build-Space“ (Welle A1, Entwurf D7: Gerüst nach Entwurf).
   Die Grundwerte der Farben stehen hier; tokens.css lädt danach und darf sie überschreiben.
   Die Dunkelvariante steht in [data-theme="dark"]. Das Attribut setzt neu.js. */

/* Farb-Tokens.
   RICHTWERT: Die Töne #f8f8f8, #f0f0f8 (hell) und #101018, #181820, #080810
   (dunkel) stammen aus der Pixelzählung des Entwurfs D7 (8 Quantisierungsstufen,
   Plan §4). Die Zuordnung zu den Flächen ist eine Annahme. Alle übrigen Werte
   sind Annahmen und nicht gemessen; Kontraste sind nur überschlagen, nicht im
   Browser gemessen. Die Abnahme prüft je Token am Entwurf nach. */
:root {
  color-scheme: light;
  --cf-kopf: #f8f8f8;            /* RICHTWERT hell: Kopfzeile, Seitenleiste */
  --cf-flaeche: #f0f0f8;         /* RICHTWERT hell: Hauptfläche */
  --cf-karte: #f8f8f8;           /* Annahme: Karten, Felder */
  --cf-rahmen: #d4d4e0;          /* Annahme */
  --cf-text: #1a1a24;            /* Annahme: Kontrast um 15:1 auf der Fläche */
  --cf-text-leise: #5a5a68;      /* Annahme: Kontrast um 6:1 auf der Fläche */
  --cf-markierung: #e4e4f0;      /* Annahme: aktiver Eintrag, Hover */
  --cf-akzent: #1f7a4d;          /* Annahme: Primärfarbe (Entwurf: grüner Hauptknopf) */
  --cf-akzent-text: #ffffff;     /* Annahme: Kontrast um 5:1 auf dem Akzent */
  --cf-fokus: #2a5bd7;           /* Annahme: Fokusrahmen, Kontrast um 5:1 */
  --cf-gefahr: #a3262b;          /* Annahme: Fehlermeldung, Kontrast um 6:1 */
  --cf-link: #2a5bd7;
  --cf-warnung: #7a4f00;         /* Annahme: Text des Warn-Chips, Kontrast um 6:1 auf dem weichen Grund */
  --cf-akzent-weich: #e3f3ea;    /* Annahme: Grund des Akzent-Chips, Text um 4,6:1 */
  --cf-warnung-weich: #fbf1d9;   /* Annahme: Grund des Warn-Chips */
  --cf-gefahr-weich: #f9e4e4;    /* Annahme: Grund des Gefahr-Chips, Text um 6:1 */
  --cf-info-weich: #e6edfc;      /* Annahme: Grund des Info-Chips, Text um 5:1 */
  --cf-schatten: 0 8px 24px rgba(0, 0, 0, 0.18);
  /* Shell (A1). Gruppenfarben nach Entwurf D7: Punkte der Seitenleiste und Icons der Seitenköpfe.
     Weißes Zeichen auf der Gruppenfarbe: mindestens 4,5:1 (überschlagen). */
  --cf-leiste: #f2f2f8;          /* Annahme: Seitenleiste und Spalte „Arbeitsflächen“ */
  --cf-gruppe-projekt: #0f7477;
  --cf-gruppe-build: #3d7a1f;
  --cf-gruppe-agentenfabrik: #4b55c9;
  --cf-gruppe-administration: #555d6b;
  --cf-gruppe-research: #9a5520;
  --cf-zeichen-auf-gruppe: #ffffff;
  --cf-abdunklung: rgba(10, 10, 20, 0.45);
}

[data-theme="dark"] {
  color-scheme: dark;
  --cf-kopf: #101018;            /* RICHTWERT dunkel: Kopfzeile, Seitenleiste */
  --cf-flaeche: #080810;         /* RICHTWERT dunkel: Hauptfläche */
  --cf-karte: #181820;           /* RICHTWERT dunkel: Karten, Felder */
  --cf-rahmen: #2a2a36;          /* Annahme */
  --cf-text: #e8e8f0;            /* Annahme: Kontrast um 16:1 auf der Fläche */
  --cf-text-leise: #9a9aaa;      /* Annahme: Kontrast um 7:1 auf der Fläche */
  --cf-markierung: #22222e;      /* Annahme */
  --cf-akzent: #4cc17f;          /* Annahme */
  --cf-akzent-text: #080810;     /* Annahme: Kontrast um 9:1 auf dem Akzent */
  --cf-fokus: #7aa2ff;           /* Annahme */
  --cf-gefahr: #ff8a8a;          /* Annahme */
  --cf-link: #9db9ff;
  --cf-warnung: #f0c264;         /* Annahme: Text des Warn-Chips, Kontrast um 9:1 */
  --cf-akzent-weich: #13291d;    /* Annahme: Grund des Akzent-Chips */
  --cf-warnung-weich: #2c2410;   /* Annahme: Grund des Warn-Chips */
  --cf-gefahr-weich: #2c1516;    /* Annahme: Grund des Gefahr-Chips */
  --cf-info-weich: #15203a;      /* Annahme: Grund des Info-Chips */
  --cf-schatten: 0 8px 24px rgba(0, 0, 0, 0.6);
  --cf-leiste: #0c0c14;
  --cf-gruppe-projekt: #3fc3c6;
  --cf-gruppe-build: #7cc95a;
  --cf-gruppe-agentenfabrik: #8f97ff;
  --cf-gruppe-administration: #a3abba;
  --cf-gruppe-research: #e39a5f;
  --cf-zeichen-auf-gruppe: #080810;
  --cf-abdunklung: rgba(0, 0, 0, 0.6);
}

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

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  background: var(--cf-flaeche);
  color: var(--cf-text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

[hidden] {
  display: none !important;
}

/* Fokusrahmen nur für die Tastatur. Kein :focus mit outline: none außerhalb von :not(:focus-visible). */
:focus-visible {
  outline: 2px solid var(--cf-fokus);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.neu-sprunglink {
  position: absolute;
  top: -100px;
  left: 8px;
  z-index: 100;
  padding: 8px 12px;
  background: var(--cf-karte);
  color: var(--cf-text);
  border: 1px solid var(--cf-rahmen);
  border-radius: 8px;
}

.neu-sprunglink:focus-visible {
  top: 8px;
}

.neu-link {
  color: var(--cf-link);
  text-decoration: underline;
}

.neu-taste {
  display: inline-block;
  padding: 0 5px;
  font: 600 11px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--cf-text-leise);
  background: var(--cf-markierung);
  border: 1px solid var(--cf-rahmen);
  border-radius: 4px;
  white-space: nowrap;
}

/* ---------- Aufbau: Kopfzeile, Seitenleiste, Inhalt ---------- */

.neu-app {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  min-height: 100vh;
}

.neu-kopf {
  grid-column: 1 / -1;
  grid-row: 1;
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  min-height: 64px;
  padding: 10px 20px;
  background: var(--cf-kopf);
  border-bottom: 1px solid var(--cf-rahmen);
}

.neu-seitenleiste {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 12px;
  background: var(--cf-leiste);
  border-right: 1px solid var(--cf-rahmen);
}

.neu-inhalt {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.neu-inhalt:focus:not(:focus-visible) {
  outline: none;
}

#neu-seite {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.neu-seitenleiste-kopf {
  display: none;
  justify-content: flex-end;
}

/* ---------- Kopfzeile ---------- */

.neu-knopf {
  font: inherit;
  padding: 6px 12px;
  color: var(--cf-text);
  background: var(--cf-karte);
  border: 1px solid var(--cf-rahmen);
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.neu-knopf:hover {
  background: var(--cf-markierung);
}

.neu-knopf[aria-pressed="true"] {
  background: var(--cf-markierung);
}

.neu-knopf-gefahr {
  color: var(--cf-gefahr);
  border-color: var(--cf-gefahr);
}

.neu-startknopf {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-weight: 500;
  border-radius: 999px;
}

.neu-navknopf {
  display: none;
}

.neu-marke {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 2px 4px;
  color: var(--cf-text);
  text-decoration: none;
  border-radius: 8px;
}

.neu-marke-zeichen {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--cf-gruppe-build);
  color: var(--cf-zeichen-auf-gruppe);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.neu-marke-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.neu-marke-zeile {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.neu-marke-name {
  font-size: 17px;
  font-weight: 600;
}

.neu-marke-unter {
  font-size: 13px;
  color: var(--cf-text-leise);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.neu-space {
  padding: 1px 9px;
  font-size: 12px;
  font-weight: 600;
  color: var(--cf-akzent);
  background: var(--cf-akzent-weich);
  border-radius: 999px;
}

.neu-kopf-rechts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-left: auto;
}

/* Projektwahl in der Seitenleiste: Ordnerzeichen, „Projekt:“, die Auswahl. */
.neu-projekt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  font-size: 13.5px;
  color: var(--cf-text-leise);
  background: var(--cf-karte);
  border: 1px solid var(--cf-rahmen);
  border-radius: 8px;
  min-width: 0;
  box-sizing: border-box;
}

.neu-projekt-icon {
  flex: none;
}

.neu-projekt label {
  flex: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--cf-text-leise);
}

.neu-projekt select {
  font: inherit;
  font-weight: 500;
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 3px 4px;
  color: var(--cf-text);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.neu-projekt select:disabled {
  cursor: default;
  color: var(--cf-text-leise);
}

.neu-projekt select:focus-visible {
  outline: 2px solid var(--cf-fokus);
  outline-offset: 1px;
}

.neu-projekt option {
  color: var(--cf-text);
  background: var(--cf-karte);
}

.neu-konto {
  position: relative;
}

.neu-avatar {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  color: var(--cf-zeichen-auf-gruppe);
  background: var(--cf-gruppe-agentenfabrik);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.neu-avatar[aria-expanded="true"] {
  box-shadow: 0 0 0 3px var(--cf-markierung);
}

.neu-konto-menue {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  display: grid;
  gap: 8px;
  width: 300px;
  padding: 14px;
  background: var(--cf-karte);
  border: 1px solid var(--cf-rahmen);
  border-radius: 12px;
  box-shadow: var(--cf-schatten);
}

.neu-konto-menue p {
  margin: 0;
  font-size: 14px;
}

.neu-konto-satz {
  color: var(--cf-text-leise);
}

.neu-konto-menue .neu-knopf {
  text-align: left;
}

.neu-konto-bestaetigung {
  display: grid;
  gap: 8px;
}

.neu-konto-knoepfe {
  display: flex;
  gap: 8px;
}

.neu-konto-fehler {
  color: var(--cf-gefahr);
}

/* ---------- Seitenleiste: Gruppen mit Punkt und Zähler, Einträge ---------- */

#neu-nav {
  flex: 1;
}

.neu-gruppe {
  margin-bottom: 8px;
}

.neu-gruppe-kopf {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.neu-gruppe-knopf {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 10px;
  font: inherit;
  font-weight: 600;
  color: var(--cf-text);
  text-align: left;
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.neu-gruppe-knopf:hover {
  background: var(--cf-markierung);
}

.neu-gruppe-punkt {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cf-text-leise);
}

.neu-gruppe-knopf[data-gruppe="projekt"] .neu-gruppe-punkt { background: var(--cf-gruppe-projekt); }
.neu-gruppe-knopf[data-gruppe="build"] .neu-gruppe-punkt { background: var(--cf-gruppe-build); }
.neu-gruppe-knopf[data-gruppe="agentenfabrik"] .neu-gruppe-punkt { background: var(--cf-gruppe-agentenfabrik); }
.neu-gruppe-knopf[data-gruppe="administration"] .neu-gruppe-punkt { background: var(--cf-gruppe-administration); }
.neu-gruppe-knopf[data-gruppe="research"] .neu-gruppe-punkt { background: var(--cf-gruppe-research); }

.neu-gruppe-name {
  flex: 1;
  min-width: 0;
}

.neu-gruppe-zahl,
.neu-eintrag-zahl {
  font-size: 12px;
  font-weight: 500;
  color: var(--cf-text-leise);
  font-variant-numeric: tabular-nums;
}

.neu-caret {
  display: inline-block;
  width: 1em;
  font-size: 11px;
  text-align: center;
  color: var(--cf-text-leise);
}

.neu-liste {
  list-style: none;
  margin: 2px 0 10px;
  padding: 0 0 0 4px;
}

.neu-eintrag {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 12px;
  font-size: 14px;
  color: var(--cf-text-leise);
  text-decoration: none;
  border-radius: 8px;
}

.neu-eintrag-name {
  flex: 1;
  min-width: 0;
}

.neu-eintrag:hover {
  color: var(--cf-text);
  background: var(--cf-markierung);
}

.neu-eintrag[aria-current="page"] {
  font-weight: 600;
  color: var(--cf-text);
  background: var(--cf-karte);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.neu-seitenleiste-fuss {
  display: grid;
  gap: 4px;
  padding: 0 10px;
  font-size: 12px;
  color: var(--cf-text-leise);
}

.neu-seitenleiste-fuss p {
  margin: 0;
}

.neu-zaehler-status:empty {
  display: none;
}

/* ---------- Seitenkopf: Icon, Titel, Untertitel, Aktionsleiste ---------- */

.neu-meldung {
  max-width: 720px;
  margin: 16px 24px 0;
  padding: 12px 14px;
  color: var(--cf-text);
  background: var(--cf-karte);
  border: 1px solid var(--cf-gefahr);
  border-radius: 8px;
}

.neu-meldung p {
  margin: 0 0 6px;
}

.neu-meldung p:last-child {
  margin-bottom: 0;
}

.neu-meldung-technik {
  font-size: 13px;
  color: var(--cf-text-leise);
}

.neu-seitenkopf {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  min-height: 60px;
  padding: 10px 20px;
  background: var(--cf-kopf);
  border-bottom: 1px solid var(--cf-rahmen);
}

.neu-seitenicon {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--cf-zeichen-auf-gruppe);
  background: var(--cf-text-leise);
}

.neu-seitenicon[data-gruppe="projekt"],
.neu-palette-icon[data-gruppe="projekt"] { background: var(--cf-gruppe-projekt); }
.neu-seitenicon[data-gruppe="build"],
.neu-palette-icon[data-gruppe="build"] { background: var(--cf-gruppe-build); }
.neu-seitenicon[data-gruppe="agentenfabrik"],
.neu-palette-icon[data-gruppe="agentenfabrik"] { background: var(--cf-gruppe-agentenfabrik); }
.neu-seitenicon[data-gruppe="administration"],
.neu-palette-icon[data-gruppe="administration"] { background: var(--cf-gruppe-administration); }
.neu-seitenicon[data-gruppe="research"],
.neu-palette-icon[data-gruppe="research"] { background: var(--cf-gruppe-research); }

.neu-seitenkopf-text {
  flex: 1;
  min-width: 160px;
}

.neu-titel {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.25;
}

.neu-titel:focus:not(:focus-visible) {
  outline: none;
}

.neu-untertitel {
  margin: 0;
  font-size: 13px;
  color: var(--cf-text-leise);
}

.neu-untertitel:empty {
  display: none;
}

.neu-aktionen {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.neu-suchknopf {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 260px;
  padding: 7px 10px;
  font: inherit;
  font-size: 14px;
  color: var(--cf-text-leise);
  text-align: left;
  background: var(--cf-flaeche);
  border: 1px solid var(--cf-rahmen);
  border-radius: 8px;
  cursor: text;
}

.neu-suchknopf:hover {
  border-color: var(--cf-text-leise);
}

.neu-suchknopf-text {
  flex: 1;
}

.neu-assistent {
  position: relative;
}

.neu-assistent-knopf {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--cf-text);
  background: var(--cf-karte);
  border: 1px solid var(--cf-rahmen);
  border-radius: 999px;
  cursor: pointer;
}

.neu-assistent-knopf[aria-disabled="true"] {
  color: var(--cf-text-leise);
  border-style: dashed;
  cursor: not-allowed;
}

/* Das Feld des Assistenten (K7): öffnet sich unter dem Knopf, schliesst mit Escape. */
.neu-assistent-feld {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  display: none;
  width: 380px;
  padding: 12px;
  font-size: 13px;
  color: var(--cf-text);
  background: var(--cf-karte);
  border: 1px solid var(--cf-rahmen);
  border-radius: 8px;
  box-shadow: var(--cf-schatten);
}

.neu-assistent[data-offen="true"] .neu-assistent-feld {
  display: block;
}

.neu-assistent-eingabe {
  box-sizing: border-box;
  width: 100%;
  font: inherit;
  color: var(--cf-text);
  background: var(--cf-karte);
  border: 1px solid var(--cf-rahmen);
  border-radius: 6px;
  padding: 6px 8px;
}

.neu-assistent-zeile {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.neu-assistent-senden,
.neu-assistent-abbrechen,
.neu-assistent-uebernehmen {
  font: inherit;
  padding: 4px 10px;
  border: 1px solid var(--cf-rahmen);
  border-radius: 6px;
  background: var(--cf-karte);
  color: var(--cf-text);
  cursor: pointer;
}

.neu-assistent-chip,
.neu-assistent-belege {
  color: var(--cf-text-leise);
}

.neu-assistent-entwurf {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}

.neu-assistent-entwurf code {
  overflow-wrap: anywhere;
}

/* ---------- Arbeitsfläche: zweite Spalte und Bereich ---------- */

.neu-arbeit {
  display: grid;
  flex: 1;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}

.neu-arbeit-mit-flaechen {
  grid-template-columns: 220px minmax(0, 1fr);
}

.neu-flaechen {
  padding: 18px 12px;
  background: var(--cf-leiste);
  border-right: 1px solid var(--cf-rahmen);
}

.neu-flaechen-kopf {
  margin: 0 10px 8px;
  font: 600 11px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cf-text-leise);
}

.neu-flaechen-liste {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
}

.neu-flaeche {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  font-size: 14px;
  color: var(--cf-text);
  text-decoration: none;
  border-radius: 8px;
}

.neu-flaeche svg {
  flex: none;
  color: var(--cf-text-leise);
}

.neu-flaeche-name {
  flex: 1;
  min-width: 0;
}

.neu-flaeche:hover {
  background: var(--cf-markierung);
}

.neu-flaeche[aria-current="page"] {
  font-weight: 600;
  color: var(--cf-akzent);
  background: var(--cf-akzent-weich);
}

.neu-flaeche[aria-current="page"] svg {
  color: var(--cf-akzent);
}

.neu-arbeit > .neu-bereich {
  align-content: start;
  padding: 20px 24px 48px;
}

.neu-eyebrow {
  margin: 0 0 4px;
  font-size: 13px;
  color: var(--cf-text-leise);
}

.neu-leer {
  max-width: 640px;
  padding: 24px;
  background: var(--cf-karte);
  border: 1px dashed var(--cf-rahmen);
  border-radius: 12px;
}

.neu-leer p {
  margin: 0 0 8px;
}

.neu-leer p:last-child {
  margin-bottom: 0;
}

.neu-leer-satz {
  font-weight: 600;
}

.neu-leer-verweis,
.neu-leer-hinweis {
  font-size: 14px;
  color: var(--cf-text-leise);
}

/* ---------- Befehlspalette ---------- */

.neu-palette {
  width: min(620px, calc(100vw - 32px));
  max-height: min(560px, calc(100vh - 96px));
  margin: 12vh auto auto;
  padding: 0;
  color: var(--cf-text);
  background: var(--cf-karte);
  border: 1px solid var(--cf-rahmen);
  border-radius: 14px;
  box-shadow: var(--cf-schatten);
}

.neu-palette[open] {
  display: flex;
  flex-direction: column;
}

.neu-palette::backdrop {
  background: var(--cf-abdunklung);
}

.neu-palette-feld {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: var(--cf-text-leise);
  border-bottom: 1px solid var(--cf-rahmen);
}

.neu-palette-feld input {
  flex: 1;
  min-width: 0;
  padding: 4px 0;
  font: inherit;
  font-size: 16px;
  color: var(--cf-text);
  background: transparent;
  border: 0;
}

.neu-palette-liste {
  flex: 1;
  overflow-y: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
}

.neu-palette-treffer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.neu-palette-treffer[aria-selected="true"] {
  background: var(--cf-markierung);
  box-shadow: inset 3px 0 0 var(--cf-fokus);
}

.neu-palette-icon {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  color: var(--cf-zeichen-auf-gruppe);
  background: var(--cf-text-leise);
}

.neu-palette-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.neu-palette-titel {
  font-size: 14px;
  font-weight: 500;
}

.neu-palette-zusatz {
  font-size: 12px;
  color: var(--cf-text-leise);
}

.neu-palette-art {
  font-size: 12px;
  color: var(--cf-text-leise);
}

.neu-palette-status,
.neu-palette-fuss {
  margin: 0;
  padding: 8px 16px;
  font-size: 12px;
  color: var(--cf-text-leise);
}

.neu-palette-status {
  padding-bottom: 0;
}

.neu-palette-fuss {
  border-top: 1px solid var(--cf-rahmen);
}

/* ---------- Bausteine für Bereiche (window.CFNeu) ----------
   Reine Klassen für die Inhalte, die ein Bereich in seinen Container rendert.
   Farben nur über Variablen, damit Hell und Dunkel aus derselben Regel kommen. */

.neu-bereich {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.neu-abschnitt-titel {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
}

.neu-lade {
  margin: 0;
  color: var(--cf-text-leise);
}

.neu-leer-grund {
  margin: 0;
  font-size: 14px;
  color: var(--cf-text-leise);
}

/* Karten: einzeln oder im Raster. Ein Raster ist eine Liste (ul/ol mit class="neu-karten"). */
.neu-karten {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.neu-karte {
  min-width: 0;
  padding: 16px;
  color: var(--cf-text);
  background: var(--cf-karte);
  border: 1px solid var(--cf-rahmen);
  border-radius: 12px;
}

.neu-karte-titel {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.neu-karte-wert {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.neu-karte-zusatz {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--cf-text-leise);
}

/* Tabellen. Der Rahmen scrollt bei schmalen Fenstern; ein scrollender Rahmen braucht
   tabindex="0" und einen Namen (aria-label), das setzt der Bereich selbst. */
.neu-tabelle-rahmen {
  max-width: 100%;
  overflow-x: auto;
  background: var(--cf-karte);
  border: 1px solid var(--cf-rahmen);
  border-radius: 12px;
}

.neu-tabelle {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  color: var(--cf-text);
}

.neu-tabelle caption {
  padding: 12px 12px 8px;
  font-weight: 600;
  text-align: left;
  caption-side: top;
}

.neu-tabelle th,
.neu-tabelle td {
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--cf-rahmen);
}

.neu-tabelle th {
  font-size: 13px;
  font-weight: 600;
  color: var(--cf-text-leise);
  white-space: nowrap;
}

/* Lange Zellen (Kennungen, lange Titel) brechen um, statt die Spalte zu sprengen. */
.neu-tabelle td {
  overflow-wrap: anywhere;
}

.neu-tabelle tbody tr:last-child td {
  border-bottom: 0;
}

.neu-tabelle tbody tr:hover {
  background: var(--cf-markierung);
}

.neu-tabelle .neu-zahl {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Chips: ein Status als Wort, die Farbe trägt es nicht allein. Die Textpaare
   (Text auf dem weichen Grund) sind in beiden Farbschemata nachgerechnet: mindestens
   4,6:1 (hell, Akzent-Chip, der knappste Wert), dunkel mindestens 6,8:1. */
.neu-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 2px 10px;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  color: var(--cf-text-leise);
  background: var(--cf-karte);
  border: 1px solid var(--cf-rahmen);
  border-radius: 999px;
}

.neu-chip-ok {
  color: var(--cf-akzent);
  background: var(--cf-akzent-weich);
  border-color: var(--cf-akzent);
}

.neu-chip-warnung {
  color: var(--cf-warnung);
  background: var(--cf-warnung-weich);
  border-color: var(--cf-warnung);
}

.neu-chip-gefahr {
  color: var(--cf-gefahr);
  background: var(--cf-gefahr-weich);
  border-color: var(--cf-gefahr);
}

.neu-chip-info {
  color: var(--cf-link);
  background: var(--cf-info-weich);
  border-color: var(--cf-link);
}

/* Chip-Gruppe: mehrere Chips nebeneinander, bei schmalen Fenstern umbrechend. Als Liste oder als Behälter. */
.neu-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ---------- Schmale Fenster: Seitenleiste als einklappbares Panel ---------- */

@media (max-width: 1199.98px) {
  .neu-suchknopf {
    min-width: 0;
  }

  .neu-suchknopf-text {
    display: none;
  }
}

@media (max-width: 899.98px) {
  .neu-app {
    grid-template-columns: minmax(0, 1fr);
  }

  .neu-navknopf {
    display: inline-block;
  }

  .neu-marke-unter {
    display: none;
  }

  .neu-seitenleiste {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 30;
    width: min(320px, 88vw);
    overflow-y: auto;
    visibility: hidden;
    box-shadow: var(--cf-schatten);
  }

  .neu-app[data-nav-offen="true"] .neu-seitenleiste {
    visibility: visible;
  }

  .neu-seitenleiste-kopf {
    display: flex;
  }

  .neu-inhalt {
    grid-column: 1;
  }

  /* Die Arbeitsflächen stehen über dem Bereich als waagerechte, scrollbare Leiste. */
  .neu-arbeit-mit-flaechen {
    grid-template-columns: minmax(0, 1fr);
  }

  .neu-flaechen {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 8px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--cf-rahmen);
  }

  .neu-flaechen-kopf {
    display: none;
  }

  .neu-flaechen-liste {
    display: flex;
    gap: 6px;
    margin: 0;
  }

  .neu-flaeche {
    white-space: nowrap;
  }

  .neu-arbeit > .neu-bereich {
    padding: 16px 16px 40px;
  }

  .neu-assistent-feld {
    width: min(380px, 86vw);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .neu-eintrag,
  .neu-flaeche,
  .neu-gruppe-knopf {
    transition: background-color 120ms ease;
  }
}
