/*
 * TPS AI – Grundgestaltung
 * Mobile-first; Breakpoint 768 px (Tabellen-Karten, Formularraster), 1024 px (feste Seitenleiste statt Schublade).
 * Rahmen: helle Seitenleiste mit Benutzermenue, unter 1024 px obere Leiste und Schublade.
 * Optik angelehnt an das DMS: IBM Plex Sans, Aktionsblau, neutrale Grautoene.
 */

/* ---------- Schrift (lokal, OFL-Lizenz: ../fonts/ibm-plex/OFL.txt) ---------- */

@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/ibm-plex/IBMPlexSans-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/ibm-plex/IBMPlexSans-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/ibm-plex/IBMPlexSans-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/ibm-plex/IBMPlexSans-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- Variablen ---------- */

:root {
  color-scheme: light;

  /* Hoehe der oberen Leiste unter 1024 px (Menue-Knopf); ab 1024 px gibt es sie nicht */
  --obenleiste: 52px;
  --seitenleiste: 248px;
  --seitenleiste-schmal: 56px;

  /* Aktionsblau (Spec 6.8); weisse Schrift nur auf --blau-dunkel (Kontrast mind. 4,5:1) */
  --blau: #0ea5e9;
  --blau-tief: #0284c7;
  --blau-dunkel: #0369a1;
  --blau-nacht: #075985;
  --blau-tint: #e0f2fe;
  --blau-hauch: #f0f9ff;

  /* Grautoene */
  --grau-900: #111827;
  --grau-700: #374151;
  --grau-500: #6b7280;
  --grau-300: #d1d5db;
  --grau-200: #e5e7eb;
  --grau-100: #f3f4f6;
  --grau-50: #f9fafb;
  --weiss: #ffffff;

  /* Status */
  --gruen: #059669;
  --gruen-dunkel: #047857;
  --gruen-tint: #d1fae5;
  --gruen-hauch: #ecfdf5;
  --rot: #dc2626;
  --rot-dunkel: #b91c1c;
  --rot-tint: #fee2e2;
  --rot-hauch: #fef2f2;

  /* SQL-Anzeige: Kontrast auf --grau-100 mind. 4,5:1 */
  --sql-zahl: #6250d6;
  --sql-kommentar: #4b5563;

  --schrift: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --schrift-mono: ui-monospace, "SF Mono", Consolas, "Liberation Mono", monospace;

  --radius-control: 8px;
  --radius-karte: 10px;
  --radius-panel: 14px;
  --schatten-karte: 0 1px 2px rgb(17 24 39 / 0.05), 0 1px 3px rgb(17 24 39 / 0.08);

  --tippflaeche: 44px;
  --seitenrand: 16px;
  --inhalt-breite: 72rem;
  --dauer: 150ms;
}

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

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

[hidden] {
  display: none !important;
}

html {
  scroll-padding-top: calc(var(--obenleiste) + 8px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--weiss);
  color: var(--grau-900);
  font-family: var(--schrift);
  font-size: 1rem;
  line-height: 1.5;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0 0 0.75rem;
  line-height: 1.25;
  color: var(--grau-900);
}

h1 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

h2 {
  font-size: 1.125rem;
  font-weight: 600;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
}

p {
  margin: 0 0 1rem;
}

a {
  color: var(--blau-dunkel);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--blau-nacht);
}

img,
svg {
  max-width: 100%;
}

pre,
code {
  font-family: var(--schrift-mono);
}

/* Sichtbarer Tastaturfokus fuer alle bedienbaren Elemente */
:focus-visible {
  outline: 2px solid var(--blau-dunkel);
  outline-offset: 2px;
}

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

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 10;
  padding: 10px 16px;
  background: var(--weiss);
  color: var(--blau-dunkel);
  font-weight: 600;
  border-radius: var(--radius-control);
  box-shadow: var(--schatten-karte);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* ---------- Rahmen: Seitenleiste, Benutzermenue, obere Leiste, Schublade ---------- */
/* Maße und Farben nach docs/superpowers/specs/2026-11-20-oberflaeche-tps-ai/entwurf-auswertungen.html */

.icon {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon--small {
  width: 14px;
  height: 14px;
}

.logo {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--blau-dunkel);
  color: var(--weiss);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--blau-dunkel);
  color: var(--weiss);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1;
}

/* Benutzer ohne Adminrechte: grauer Kreis (Entwurf; weiss auf #6b7280 hat 4,8:1) */
.avatar--user {
  background: #6b7280;
}

.icon-button {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--grau-500);
  cursor: pointer;
  transition: background-color var(--dauer), color var(--dauer);
}

.icon-button:hover {
  background: #ebebe7;
  color: var(--grau-900);
}

.icon-button--quiet {
  width: 24px;
  height: 24px;
  color: #9ca3af;
}

/* Anmeldeseite: Logo ueber der zentrierten Karte, keine Seitenleiste */
.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 40px var(--seitenrand) 0;
  font-size: 1.125rem;
  font-weight: 700;
}

/* Obere Leiste: nur unter 1024 px */
.topbar {
  position: sticky;
  top: 0;
  z-index: 5; /* ueber den Tabellenkoepfen (1), unter Schublade (30) und Sprunglink (10) */
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--obenleiste); /* inklusive Linie unten: die Seite Auswertungen fuellt genau den Rest der Fensterhoehe */
  padding: 6px 12px 5px;
  background: var(--weiss);
  border-bottom: 1px solid #f0f0ee;
}

.topbar .icon-button {
  width: 40px;
  height: 40px;
  color: var(--grau-900);
}

.topbar__name {
  color: var(--grau-900);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

/* Seitenleiste (Schublade unter 1024 px) */
.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: min(280px, 86vw);
  padding: 14px 10px 10px;
  background: #f7f7f5;
  border-right: 1px solid #e7e5e4;
  color: #374151;
  font-size: 13px;
  line-height: 1.45;
  transform: translateX(-100%);
  visibility: hidden;
  transition: transform var(--dauer), visibility var(--dauer);
}

.sidebar:focus {
  outline: none;
}

.sidebar-open .sidebar {
  transform: none;
  visibility: visible;
}

.sidebar-open {
  overflow: hidden;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgb(17 24 39 / 0.4);
}

/* Ohne JavaScript steht die Seitenleiste schmal oben im Fluss, damit die Navigation erreichbar bleibt */
.no-js .sidebar {
  position: static;
  width: auto;
  transform: none;
  visibility: visible;
  border-right: 0;
  border-bottom: 1px solid #e7e5e4;
}

.no-js .topbar,
.no-js .sidebar__label,
.no-js .sidebar__chats,
.no-js .sidebar__collapse {
  display: none;
}

.sidebar__head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 2px 8px 14px;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: var(--grau-900);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.sidebar__collapse {
  display: none;
  margin-left: auto;
}

.sidebar__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.sidebar__new {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 8px 10px;
  background: var(--weiss);
  border: 1px solid var(--grau-200);
  border-radius: 9px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
  color: var(--blau-dunkel);
  font-weight: 600;
  text-decoration: none;
  transition: background-color var(--dauer);
}

.sidebar__new:hover {
  background: var(--blau-hauch);
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 7px;
  color: var(--grau-700);
  text-decoration: none;
  transition: background-color var(--dauer);
}

.sidebar__link:hover {
  background: #f0f0ed;
}

.sidebar__link[aria-current="page"] {
  background: var(--blau-tint);
  color: var(--blau-nacht);
  font-weight: 600;
}

/* Gesperrter Bereich (Lizenz): sichtbar, aber ausgegraut und ohne Link */
.sidebar__link--locked {
  color: var(--grau-500);
  cursor: not-allowed;
}

.sidebar__link--locked:hover {
  background: none;
}

.sidebar__link--locked .icon {
  opacity: 0.6;
}

.sidebar__link-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar__lock {
  font-size: 0.7rem;
  line-height: 1.3;
}

.sidebar__label {
  margin: 0;
  padding: 14px 10px 4px;
  color: #6b7280;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Mit JavaScript blendet sidebar.js ueberzaehlige Gespraeche aus (nichts scrollt); ohne JavaScript scrollt die Liste innen */
.sidebar__chats {
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Link unter der Liste, nur sichtbar, wenn Gespraeche ausgeblendet sind (hidden bis dahin) */
.sidebar__all {
  flex: none;
  padding: 7px 10px;
  color: var(--grau-500);
  font-size: 12.5px;
  text-decoration: none;
}

.sidebar__all:hover,
.sidebar__all:focus-visible {
  text-decoration: underline;
}

.chat-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.chat-list__group {
  margin: 0;
  padding: 8px 10px 2px;
  color: #6b7280;
  font-size: 11px;
}

.chat-list__empty {
  margin: 0;
  padding: 5px 10px;
  color: #6b7280;
  font-size: 12.5px;
}

.chat-list__item {
  display: flex;
  align-items: center;
  gap: 2px;
  border-radius: 7px;
  color: #4b5563;
  font-size: 12.5px;
  transition: background-color var(--dauer);
}

.chat-list__item:hover,
.chat-list__item:focus-within {
  background: #f0f0ed;
}

.chat-list__item:has(> [aria-current="page"]) {
  background: #ebebe7;
  color: var(--grau-900);
  font-weight: 500;
}

.chat-list__link {
  display: block;
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  color: inherit;
  text-decoration: none;
}

/* Beim Darueberfahren (und bei Fokus) macht der Papierkorb Platz; sonst steht der Titel bis zum Rand (Entwurf .hist .it) */
.chat-list__item:hover .chat-list__link,
.chat-list__item:focus-within .chat-list__link {
  padding-right: 4px;
}

.chat-list__title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Zeit und Haekchen zeigt erst die Gespraechsauswahl; die Seitenleiste folgt dem Entwurf (nur Titel) */
.sidebar .chat-list__time,
.sidebar .chat-list__check {
  display: none;
}

.chat-list__delete {
  display: none;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  margin-right: 4px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  transition: color var(--dauer);
}

.chat-list__item:hover .chat-list__delete,
.chat-list__item:focus-within .chat-list__delete {
  display: grid;
}

.chat-list__delete:hover {
  color: var(--rot-dunkel);
}

@media (hover: none) {
  .chat-list__delete {
    display: grid;
  }
}

.sidebar__user {
  position: relative;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e7e5e4;
}

.user-button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--grau-900);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--dauer);
}

.user-button:hover,
.user-button[aria-expanded="true"] {
  background: #ebebe7;
}

.user-button__who {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  line-height: 1.2;
}

.user-button__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-button small {
  color: #6b7280;
  font-size: 11px;
}

.user-button__chevron {
  color: #9ca3af;
}

.user-menu {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 0;
  z-index: 40;
  width: 270px;
  max-width: calc(100vw - 20px);
  padding: 6px;
  background: var(--weiss);
  border: 1px solid var(--grau-200);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgb(15 23 42 / 0.16);
}

.user-menu__head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 4px;
  padding: 8px 10px 10px;
  border-bottom: 1px solid #f0f0ee;
}

.user-menu__who {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.user-menu__who b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu__who small {
  color: #6b7280;
  font-size: 11px;
}

.user-menu__label {
  margin: 0;
  padding: 8px 10px 3px;
  color: #6b7280;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.user-menu__rule {
  margin: 4px 0;
  border: 0;
  border-top: 1px solid #f0f0ee;
}

.user-menu__form {
  margin: 0;
}

.user-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--grau-700);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.user-menu__item:hover,
.user-menu__item:focus-visible {
  background: var(--grau-100);
}

.user-menu__item[aria-current="page"] {
  color: var(--blau-nacht);
  font-weight: 600;
}

.user-menu__hint {
  margin-left: auto;
  color: var(--blau-nacht);
  font-size: 0.75rem;
  font-weight: 600;
  text-align: right;
}

.user-menu__item--out {
  color: var(--rot-dunkel);
}

/* Gesperrte Einrichtungsseite (Lizenz): sichtbar, aber ausgegraut und ohne Link */
.user-menu__item--locked {
  color: var(--grau-500);
  cursor: not-allowed;
}

.user-menu__item--locked:hover {
  background: none;
}

.user-menu__item--locked .icon {
  opacity: 0.6;
}

.user-menu__item-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-menu__lock {
  font-size: 0.7rem;
  line-height: 1.3;
}

/* Schalter „Beim Öffnen alle Ergebnisse zeigen …“ im Benutzermenue: Checkbox mit Schalter-Optik */
.user-menu__switch {
  margin: 0;
}

.switch {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 7px;
  color: var(--grau-700);
  line-height: 1.35;
  cursor: pointer;
}

.switch:hover {
  background: var(--grau-100);
}

/* Die echte Checkbox liegt unsichtbar ueber der Schiene; Fokus und Klick bleiben bei ihr */
.switch__input {
  position: absolute;
  top: 9px;
  left: 10px;
  width: 28px;
  height: 16px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.switch__track {
  position: relative;
  flex: none;
  width: 28px;
  height: 16px;
  margin-top: 1px;
  border-radius: 8px;
  background: var(--grau-500); /* Kontrast zum weissen Menue mind. 3:1 (WCAG 1.4.11) */
  transition: background-color var(--dauer);
}

.switch__track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--weiss);
  box-shadow: 0 1px 2px rgb(17 24 39 / 0.2);
  transition: transform var(--dauer);
}

.switch__input:checked + .switch__track {
  background: var(--blau-dunkel);
}

.switch__input:checked + .switch__track::after {
  transform: translateX(12px);
}

.switch__input:focus-visible + .switch__track {
  outline: 2px solid var(--blau-dunkel);
  outline-offset: 2px;
}

/* „Speichern“ nur ohne JavaScript; mit JavaScript speichert schon das Umschalten (Selektor staerker als .button) */
.user-menu__switch .user-menu__save {
  display: none;
  margin: 0 10px 6px 48px;
}

.no-js .user-menu__switch .user-menu__save {
  display: inline-flex;
}

.user-menu__status {
  margin: 0 10px;
  color: var(--rot-dunkel);
  font-size: 12px;
}

.user-menu__status:not(:empty) {
  padding: 4px 0 6px;
}

.user-menu__status a {
  color: inherit;
  text-decoration: underline;
}

/*
 * Ohne JavaScript laesst sich das Menue nicht aufklappen: Es steht dann offen im Fluss der Seitenleiste
 * (Kopf mit Name und Rolle, Verwaltung, Schalter mit „Speichern“, Passwort, Abmelden); der Benutzerknopf entfaellt.
 */
.no-js .user-menu[hidden] {
  position: static;
  display: block !important;
  width: auto;
  max-width: none;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.no-js .user-button {
  display: none;
}

/* Ab 1024 px: feste Seitenleiste, Inhalt rechts daneben */
@media (min-width: 1024px) {
  :root {
    --obenleiste: 0px;
  }

  .topbar,
  .sidebar-backdrop {
    display: none;
  }

  /* 1024-1279 px: die eingeklappte Leiste oeffnet sich als Ueberlagerung (Klasse sidebar-overlay, sidebar.js): der Inhalt bleibt
     auf 56 px Abstand stehen, die Leiste liegt mit Schatten darueber, dahinter die Abdunkelung wie bei der Schublade */
  .sidebar-overlay .sidebar {
    z-index: 30;
    box-shadow: 0 12px 32px rgb(15 23 42 / 0.18);
  }

  .sidebar-overlay .sidebar-backdrop {
    display: block;
  }

  .sidebar {
    width: var(--seitenleiste);
    z-index: 6;
    transform: none;
    visibility: visible;
    transition: width var(--dauer);
  }

  .sidebar__link {
    padding: 6px 10px;
  }

  .chat-list__link,
  .sidebar__all {
    padding-block: 5px;
  }

  .user-menu__item,
  .switch {
    padding: 7px 10px; /* Entwurf; unter 1024 px bleiben 9 px fuer Touch */
  }

  .switch__input {
    top: 7px;
  }

  .sidebar__collapse {
    display: grid;
  }

  .sidebar-open {
    overflow: visible;
  }

  .has-sidebar {
    padding-left: var(--seitenleiste);
    transition: padding-left var(--dauer);
  }

  .no-js .sidebar {
    position: fixed;
    width: var(--seitenleiste); /* sonst richtet sich die Breite nach dem laengsten Text (width: auto oben) */
    overflow-y: auto; /* niedrige Fenster: das offene Benutzermenue bleibt per Scrollen erreichbar */
    border-bottom: 0;
    border-right: 1px solid #e7e5e4;
  }

  .no-js .sidebar__chats {
    display: block;
  }

  .no-js .sidebar__label {
    display: block;
  }

  /* Eingeklappt: schmale Leiste mit Logo und Knopf */
  .sidebar-collapsed:not(.sidebar-overlay) .sidebar {
    width: var(--seitenleiste-schmal);
    padding-inline: 0;
    align-items: center;
  }

  .sidebar-collapsed .has-sidebar {
    padding-left: var(--seitenleiste-schmal);
  }

  .sidebar-collapsed:not(.sidebar-overlay) .sidebar__head {
    flex-direction: column;
    gap: 10px;
    padding: 2px 0 14px;
  }

  .sidebar-collapsed:not(.sidebar-overlay) .sidebar__collapse {
    margin-left: 0;
  }

  .sidebar-collapsed:not(.sidebar-overlay) .sidebar__brand-name,
  .sidebar-collapsed:not(.sidebar-overlay) .sidebar__body,
  .sidebar-collapsed:not(.sidebar-overlay) .sidebar__user {
    display: none;
  }
}

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

.site-main {
  /* Listen und Berichte nutzen die volle Breite neben der Seitenleiste */
  margin: 0;
  padding: 20px var(--seitenrand) 40px;
  background: var(--weiss);
}

/* Formularseiten behalten eine Lesebreite */
.site-main--form {
  max-width: var(--inhalt-breite);
}

.site-main:focus {
  outline: none;
}

.page-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.page-header .button-row {
  margin: 0;
}

.page-header h1 {
  margin: 0;
}

.panel {
  background: var(--weiss);
  border: 1px solid var(--grau-200);
  border-radius: var(--radius-panel);
  box-shadow: var(--schatten-karte);
  padding: 16px;
}

/* Ausgegrauter Bereich (nicht lizenziert) */
.panel--locked {
  background: var(--grau-50);
  box-shadow: none;
  color: var(--grau-500);
}

/* Abstand zwischen aufeinanderfolgenden Bloecken des Inhalts */
.panel,
.table-wrap {
  margin-bottom: 24px;
}

.site-main > :last-child {
  margin-bottom: 0;
}

.panel--narrow {
  max-width: 32rem;
  margin-inline: auto;
}

/* Auf Formularseiten mit Seitenleiste linksbuendig wie der Seitenkopf */
.site-main--form .panel--narrow {
  margin-inline: 0;
}

.muted {
  color: var(--grau-500);
}

/* ---------- Einstellungen: zwei Spalten ---------- */

.settings-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0 24px;
  align-items: start;
}

@media (min-width: 1024px) {
  .settings-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Lizenzblock: Teilblöcke (h3) durch Abstand und feine Linie getrennt */
.settings-columns #lizenz h3 {
  margin: 16px 0 8px;
  padding-top: 16px;
  border-top: 1px solid var(--grau-200);
}

/* ---------- Meldungen ---------- */

.flashes {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.flash {
  margin: 0;
  padding: 12px 16px;
  border: 1px solid;
  border-left-width: 4px;
  border-radius: 8px;
  font-weight: 500;
}

.flash--success {
  background: var(--gruen-hauch);
  border-color: var(--gruen-tint);
  border-left-color: var(--gruen);
  color: var(--gruen-dunkel);
}

.flash--error {
  background: var(--rot-hauch);
  border-color: var(--rot-tint);
  border-left-color: var(--rot);
  color: var(--rot-dunkel);
}

.flash--info {
  background: var(--blau-hauch);
  border-color: var(--blau-tint);
  border-left-color: var(--blau-tief);
  color: var(--blau-dunkel);
}

/* ---------- Knoepfe ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tippflaeche);
  padding: 8px 16px;
  background: var(--blau-dunkel);
  color: var(--weiss);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  cursor: pointer;
  transition: background-color var(--dauer), border-color var(--dauer), color var(--dauer);
}

.button:hover {
  background: var(--blau-nacht);
  color: var(--weiss);
}

.button--secondary {
  background: var(--weiss);
  color: var(--grau-700);
  border-color: var(--grau-300);
}

.button--secondary:hover {
  background: var(--blau-hauch);
  color: var(--grau-900);
}

.button--danger {
  background: var(--rot);
}

.button--danger:hover {
  background: var(--rot-dunkel);
}

.button:disabled,
.button[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 16px 0 0;
}

/* Schmal: Knoepfe einer Aktionszeile nutzen die volle Breite */
.button-row > .button {
  flex: 1 1 auto;
}

/* ---------- Formulare ---------- */

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.field {
  display: grid;
  gap: 6px;
  align-content: start;
  min-width: 0;
}

.field > label,
.field__head > label,
.field__label {
  color: var(--grau-700);
  font-size: 0.9375rem;
  font-weight: 600;
}

.field__hint {
  margin: 0;
  color: var(--grau-500);
  font-size: 0.875rem;
}

/* Hinweis unter der Knopfzeile einer Liste: 12 px Luft zur Liste darunter (sonst klebt er an deren Rand) */
.page-header + .field__hint {
  margin-bottom: 12px;
}

.field__error {
  margin: 0;
  color: var(--rot-dunkel);
  font-size: 0.875rem;
  font-weight: 500;
}

input:where([type="text"], [type="date"], [type="datetime-local"], [type="password"], [type="email"], [type="number"], [type="search"], [type="url"], [type="tel"]),
select,
textarea {
  width: 100%;
  min-height: var(--tippflaeche);
  padding: 8px 12px;
  background: var(--weiss);
  color: var(--grau-900);
  /* 16 px verhindert den automatischen Zoom von iOS beim Fokussieren */
  font: inherit;
  font-size: 1rem;
  border: 1px solid var(--grau-300);
  border-radius: var(--radius-control);
  transition: border-color var(--dauer), box-shadow var(--dauer);
}

textarea {
  min-height: 6rem;
  resize: vertical;
}

input:where([type="text"], [type="datetime-local"], [type="password"], [type="email"], [type="number"], [type="search"], [type="url"], [type="tel"]):focus-visible,
select:focus-visible,
textarea:focus-visible {
  /* transparenter Umriss bleibt im Kontrastmodus von Windows sichtbar */
  outline: 2px solid transparent;
  outline-offset: 0;
  border-color: var(--blau-dunkel);
  box-shadow: 0 0 0 1px var(--blau-dunkel), 0 0 0 4px var(--blau-tint);
}

[aria-invalid="true"] {
  border-color: var(--rot) !important;
}

[aria-invalid="true"]:focus-visible {
  box-shadow: 0 0 0 1px var(--rot), 0 0 0 4px var(--rot-tint) !important;
}

input:disabled,
select:disabled,
textarea:disabled {
  background: var(--grau-100);
  color: var(--grau-500);
  cursor: not-allowed;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 6px;
  padding: 0;
  color: var(--grau-700);
  font-size: 0.9375rem;
  font-weight: 600;
}

/* Checkbox/Radio mit Beschriftung: ganze Zeile ist Tippflaeche */
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tippflaeche);
  cursor: pointer;
}

.check input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--blau-dunkel);
}

/* ---------- Tabellen ---------- */

.table-wrap {
  /* position: relative haelt absolut positionierte Kinder (z. B. .visually-hidden) im Scrollbereich */
  position: relative;
  overflow-x: auto;
  background: var(--weiss);
  border: 1px solid var(--grau-200);
  border-radius: var(--radius-karte);
}

table {
  width: 100%;
  border-collapse: collapse;
}

table {
  font-size: 12.5px;
}

th,
td {
  padding: 6px 10px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--grau-100);
}

th {
  background: var(--grau-50);
  color: var(--grau-700);
  font-size: 11.5px;
  font-weight: 600;
  color: #4b5563;
  padding-block: 8px;
  border-bottom: 1px solid var(--grau-200);
  white-space: nowrap;
}

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

/* Titel in Tabellen wie im Entwurf: halbfett, ohne Unterstreichung */
td a:not(.button) {
  font-weight: 600;
  text-decoration: none;
}

td a:not(.button):hover {
  text-decoration: underline;
}

td input[type="checkbox"] {
  accent-color: var(--blau-dunkel);
  margin: 0;
  vertical-align: middle;
}

/* Schmal: .table-cards zeigt jede Zeile als Karte, Spaltenname aus data-label */
@media (max-width: 767.98px) {
  .table-wrap:has(> .table-cards) {
    overflow: visible;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .table-cards,
  .table-cards tbody,
  .table-cards tr,
  .table-cards td {
    display: block;
    width: 100%;
  }

  .table-cards thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .table-cards tr {
    margin-bottom: 12px;
    padding: 8px 16px;
    background: var(--weiss);
    border: 1px solid var(--grau-200);
    border-radius: var(--radius-karte);
    box-shadow: var(--schatten-karte);
  }

  .table-cards tr:last-child {
    margin-bottom: 0;
  }

  .table-cards td {
    display: grid;
    grid-template-columns: minmax(6.5rem, 38%) minmax(0, 1fr);
    gap: 12px;
    justify-items: start;
    padding: 8px 0;
    border-bottom: 1px solid var(--grau-100);
  }

  .table-cards td:last-child {
    border-bottom: 0;
  }

  .table-cards td::before {
    content: attr(data-label);
    color: var(--grau-500);
    font-size: 0.875rem;
    font-weight: 600;
  }

  /* Zellen ohne Beschriftung (z. B. Aktionen) ueber die ganze Breite */
  .table-cards td:not([data-label]),
  .table-cards td[data-label=""] {
    grid-template-columns: minmax(0, 1fr);
    justify-items: stretch;
  }

  .table-cards td:not([data-label])::before,
  .table-cards td[data-label=""]::before {
    content: none;
  }
}

/* ---------- Plaketten ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
  padding: 1px 8px;
  background: var(--grau-100);
  color: var(--grau-700);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  border-radius: 999px;
  white-space: nowrap;
}

.badge--success {
  background: var(--gruen-hauch);
  color: var(--gruen-dunkel);
}

.badge--error {
  background: var(--rot-tint);
  color: var(--rot-dunkel);
}

.badge--info {
  background: var(--blau-tint);
  color: var(--blau-nacht);
}

/* ---------- Verbindungen ---------- */

.button--small {
  padding: 6px 12px;
  font-size: 0.875rem;
}

.form-alert {
  margin-bottom: 16px;
}

/* Radiogruppen nebeneinander, Checkbox-Listen in Spalten */
.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0 24px;
}

/* Pruefergebnis: einspaltig, je Gruppe eine Ueberschrift; Stufe immer als Symbol und Wort */
.check-summary {
  margin: 0 0 8px;
  font-weight: 600;
}

.check-group {
  margin: 20px 0 8px;
  font-size: 1rem;
}

.check-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.check-line {
  padding: 8px 0;
  border-bottom: 1px solid var(--grau-100);
  overflow-wrap: anywhere;
}

.check-line:last-child {
  border-bottom: 0;
}

.check-line__text,
.check-line__remedy {
  margin: 0;
}

.check-line__remedy {
  margin-top: 4px;
  color: var(--grau-700);
  font-size: 0.9375rem;
}

.check-line .table-wrap {
  margin-top: 8px;
}

.badge--hint {
  background: var(--gelb-tint);
  color: var(--gelb);
}

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

/* Ergebniszeile des Verbindungstests: Symbol + Text, Farbe nur zusaetzlich */
.test-result {
  margin: 12px 0 0;
}

.test-result:empty {
  margin: 0;
}

.test-line {
  display: block;
  font-weight: 500;
  overflow-wrap: break-word;
}

.test-line__symbol {
  margin-right: 0.35em;
  font-weight: 700;
}

.test-line--ok {
  color: var(--gruen-dunkel);
}

.test-line--error {
  color: var(--rot-dunkel);
}

.test-line--busy {
  color: var(--grau-700);
}

/* Ladeanzeige; bei reduzierter Bewegung steht der Kreis still (siehe unten) */
.test-line--busy::before {
  content: "";
  display: inline-block;
  margin-right: 0.5em;
  vertical-align: -0.15em;
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: drehen 0.8s linear infinite;
}

@keyframes drehen {
  to {
    transform: rotate(360deg);
  }
}

.status--ok {
  color: var(--gruen-dunkel);
  font-weight: 500;
}

.status--error {
  color: var(--rot-dunkel);
  font-weight: 500;
}

/* Liste (Admin) */
.connection-name {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font-weight: 600;
}

.target {
  font-family: var(--schrift-mono);
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

.last-test {
  display: grid;
  gap: 2px;
  max-width: 28rem;
  overflow-wrap: break-word;
}

.last-test__time {
  font-size: 0.8125rem;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.row-actions > .button,
.row-actions__form {
  flex: 1 1 auto;
}

.row-actions__form {
  display: flex;
  margin: 0;
}

.row-actions__form > .button {
  flex: 1 1 auto;
}

/* Loeschen erst nach Aufklappen (ohne JavaScript) */
.danger-zone > summary {
  display: list-item;
  min-height: var(--tippflaeche);
  padding: 10px 0;
  color: var(--rot-dunkel);
  font-weight: 600;
  cursor: pointer;
}

.danger-zone[open] > summary {
  margin-bottom: 8px;
}

.danger-zone form {
  margin: 0;
}

/* Startseite: nutzbare Verbindungen ohne Zielangaben */
.connection-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.connection-list__item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  padding: 12px 16px;
  background: var(--grau-50);
  border: 1px solid var(--grau-200);
  border-radius: var(--radius-karte);
}

.connection-list__name {
  font-weight: 600;
}

.connection-list__status {
  flex-basis: 100%;
  font-size: 0.9375rem;
}

/* ---------- Fehlerseite ---------- */

.error-page__status {
  margin-bottom: 4px;
  color: var(--grau-500);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.error-page__detail {
  max-height: 24rem;
  overflow: auto;
  margin: 0 0 1rem;
  padding: 12px;
  background: var(--grau-100);
  color: var(--grau-900);
  font-size: 0.8125rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border-radius: var(--radius-control);
}

/* ---------- Ab 768 px ---------- */

@media (min-width: 768px) {
  :root {
    --seitenrand: 24px;
  }

  .site-main {
    padding-top: 32px;
    padding-bottom: 56px;
  }

  .panel {
    padding: 24px;
  }

  .button-row > .button {
    flex: 0 0 auto;
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 24px;
  }

  .form-grid > .field--full,
  .form-grid > fieldset,
  .form-grid > .button-row,
  .form-grid > .form-actions {
    grid-column: 1 / -1;
  }

  .field--check {
    align-self: end;
  }

  .button--small {
    min-height: 36px;
  }

  .row-actions {
    justify-content: flex-end;
  }

  .row-actions > .button,
  .row-actions__form,
  .row-actions__form > .button {
    flex: none;
  }

  .row-actions .button,
  .target {
    white-space: nowrap;
  }

  .connection-list__status {
    flex-basis: auto;
    margin-left: auto;
  }
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
  }
}

/* ---------- KI-Einstellungen ---------- */

.usage-list {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 4px 16px;
  margin: 0;
}

.usage-list dt {
  color: var(--grau-700);
  font-weight: 600;
}

.usage-list dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

/* ---------- Diagramme (serverseitiges SVG, Palette: dataviz, helle Variante) ---------- */

:root {
  --chart-1: #2a78d6;
  --chart-2: #eb6834;
  --chart-3: #1baf7a;
  --chart-4: #eda100;
  --chart-5: #e87ba4;
  --chart-6: #008300;
  --chart-flaeche: #fcfcfb;
  --chart-raster: #e5e7eb;
  --chart-achse: #6b7280;
}

.chart {
  margin: 0 0 16px;
  padding: 12px;
  background: var(--chart-flaeche);
  border: 1px solid var(--grau-200);
  border-radius: var(--radius-karte);
}

.chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.chart__grid {
  stroke: var(--chart-raster);
  stroke-width: 1;
}

.chart__axis {
  stroke: var(--chart-achse);
  stroke-width: 1;
}

.chart__label {
  fill: var(--grau-700);
  font-family: var(--schrift);
  font-size: 11px;
}

.chart__series--1 { --serie: var(--chart-1); }
.chart__series--2 { --serie: var(--chart-2); }
.chart__series--3 { --serie: var(--chart-3); }
.chart__series--4 { --serie: var(--chart-4); }
.chart__series--5 { --serie: var(--chart-5); }
.chart__series--6 { --serie: var(--chart-6); }

.chart__bar {
  fill: var(--serie);
}

.chart__line {
  fill: none;
  stroke: var(--serie);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart__point {
  fill: var(--serie);
  stroke: var(--chart-flaeche);
  stroke-width: 2;
}

.chart__hover-area {
  fill: transparent;
}

.chart__hover-guide,
.chart__tip {
  pointer-events: none;
  visibility: hidden;
}

.chart__hover-guide {
  stroke: var(--grau-500);
  stroke-dasharray: 4 3;
  stroke-width: 1;
}

.chart__hover:hover .chart__hover-guide,
.chart__hover:hover .chart__tip {
  visibility: visible;
}

.chart--bar .chart__hover:hover .chart__hover-area {
  fill: var(--grau-700);
  fill-opacity: 0.08;
}

.chart__tip-box {
  fill: #fff;
  stroke: var(--grau-300);
  stroke-width: 1;
}

.chart__tip-label {
  fill: var(--grau-700);
  font-family: var(--schrift);
  font-size: 11px;
  font-weight: 700;
}

.chart__tip-value {
  fill: var(--grau-700);
  font-family: var(--schrift);
  font-size: 11px;
}

.chart__tip-swatch {
  fill: var(--serie);
}

.chart__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  color: var(--grau-700);
  font-size: 0.875rem;
}

.chart__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart__swatch {
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: var(--serie);
}

.chart__notice {
  margin-top: 8px;
  color: var(--grau-700);
  font-size: 0.875rem;
}

/* ---------- Auswertungen (Gespraech mit der KI) ---------- */

/* Ohne JavaScript ist das Gespraech nicht nutzbar (Hinweis in <noscript>). */
.no-js [data-chat-form] {
  display: none;
}

/* Seite fuellt die Fensterhoehe; nur der Gespraechsteil und die Ergebnisse scrollen (Entwurf: Auswertungen, 1:1) */
.analysis {
  min-width: 0;
}

.analysis__chat {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.analysis__results {
  display: none;
  min-width: 0;
  flex-direction: column;
}

.analysis--results-open .analysis__results {
  display: flex;
}

/* Kopf der Chat-Spalte mit Gespraechsauswahl (Entwurf .chead, .pick und .dd); die Liste liegt ueber dem Gespraech, nicht darin */
.analysis__chat-head {
  position: relative;
  z-index: 5;
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  height: 52px;
  padding: 0 12px;
  border-bottom: 1px solid #f0f0ee;
}

.analysis__picker {
  display: flex;
  flex: 1;
  min-width: 0;
}

.picker-button {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 5px 8px 5px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: var(--grau-900);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
}

.picker-button[aria-expanded="true"] {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px #e0f2fe;
}

.picker-button:focus-visible {
  outline: 2px solid var(--blau);
  outline-offset: 2px;
}

.picker-button__clock {
  color: #9ca3af;
}

.picker-button__arrow {
  color: #6b7280;
}

.picker-button[aria-expanded="true"] .picker-button__arrow {
  transform: rotate(180deg);
}

.picker-button__title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.picker-button__time {
  margin-left: auto;
  color: #9ca3af;
  font-size: 10.8px; /* Entwurf: <small> im Knopf */
  font-weight: 400;
  white-space: nowrap;
}

.picker-button__time + .picker-button__arrow {
  margin-left: 0;
}

.picker-button__title + .picker-button__arrow {
  margin-left: auto;
}

.picker {
  position: absolute;
  top: 47px;
  left: 12px;
  width: 380px;
  max-width: calc(100% - 24px);
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 40px rgb(15 23 42 / 0.16);
}

.picker__search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px;
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  color: #9ca3af;
}

.picker__search:focus-within {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px #e0f2fe;
}

.picker .picker__input {
  flex: 1;
  width: auto;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--grau-900);
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
}

.picker .picker__input:focus-visible {
  /* den Rahmen zeigt das umgebende Feld (.picker__search:focus-within), nicht das Eingabefeld selbst */
  outline: 2px solid transparent;
  box-shadow: none;
}

.picker__input::placeholder {
  color: #9ca3af;
}

.picker__list {
  max-height: min(55vh, 380px);
  overflow-y: auto;
  overscroll-behavior: contain;
  /* Scroll-Hinweis nur mit CSS: Ein Schatten am unteren Rand steht fest (scroll), eine weisse Flaeche am Ende des Inhalts
     (local, scrollt mit) deckt ihn ab. Ist unten noch etwas zu sehen, bleibt der Schatten sichtbar, am Ende der Liste verschwindet er. */
  background:
    linear-gradient(to bottom, transparent, var(--weiss) 70%) bottom / 100% 32px no-repeat local,
    radial-gradient(farthest-side at 50% 100%, rgb(15 23 42 / 0.18), transparent) bottom / 100% 12px no-repeat scroll;
  background-color: var(--weiss);
}

.picker .chat-list__group {
  padding: 6px 14px 2px;
}

.picker .chat-list__empty {
  padding: 6px 14px;
  font-size: 13px;
}

.picker .chat-list__item {
  gap: 0;
  border-radius: 0;
  color: #374151;
  font-size: 13px;
}

.picker .chat-list__item:hover,
.picker .chat-list__item:focus-within {
  background: #f6f7f9;
}

.picker .chat-list__item:has(> [aria-current="page"]) {
  background: #f0f9ff;
  color: #075985;
  font-weight: 600;
}

.picker .chat-list__link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
}

.picker .chat-list__item:hover .chat-list__link,
.picker .chat-list__item:focus-within .chat-list__link {
  padding-right: 8px;
}

.picker .chat-list__link:focus-visible {
  outline: 2px solid var(--blau);
  outline-offset: -2px;
}

.picker .chat-list__check {
  visibility: hidden;
}

.picker [aria-current="page"] .chat-list__check {
  visibility: visible;
}

.picker .chat-list__title {
  flex: 1;
  min-width: 0;
}

.picker .chat-list__time {
  flex: none;
  color: #9ca3af;
  font-size: 11.5px;
  font-weight: 400;
}

.picker [aria-current="page"] .chat-list__time {
  color: #0369a1;
}

.picker .chat-list__delete {
  width: 22px;
  height: 22px;
  margin-right: 8px;
}

.picker__new {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 9px 14px;
  border-top: 1px solid #f0f0ee;
  color: #0369a1;
  font-weight: 600;
  text-decoration: none;
}

.picker__new:hover {
  background: #f6f7f9;
}

.picker__new:focus-visible {
  outline: 2px solid var(--blau);
  outline-offset: -2px;
}

.analysis__scroll {
  position: relative; /* haelt .visually-hidden-Kinder im Scrollbereich, sonst scrollt die Seite selbst */
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  gap: 12px;
  padding: 16px max(20px, calc(50% - 350px)); /* Lesebreite des Texts: hoechstens 740 px, mittig */
  overflow-y: auto;
}

/* Wenige Nachrichten stehen unten (statt justify-content, das beim Scrollen den Anfang abschneidet) */
.analysis__scroll > :first-child {
  margin-top: auto;
}

.analysis__scroll > * {
  flex: none;
}

.analysis__empty-title {
  margin: 0;
  line-height: 1.45;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-align: center;
}

.analysis:not(.analysis--empty) .analysis__empty-title {
  display: none;
}

/* Plakette (Verbindung) */
.plate {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  padding: 2px 9px;
  background: var(--grau-100);
  border-radius: 999px;
  color: var(--grau-500);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.45;
  white-space: nowrap;
}

.plate .icon {
  width: 12px;
  height: 12px;
}

@media (min-width: 1024px) {
  /* doppelte Klasse: schlaegt die Innenabstaende von .site-main weiter unten in der Datei */
  .site-main.site-main--full {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    padding: 0;
    overflow: hidden;
  }

  .site-main--full > .analysis {
    flex: 1;
    min-height: 0;
  }

  .analysis {
    display: flex;
    font-size: 13px;
    line-height: 1.45;
  }

  .analysis__chat {
    flex: 1;
  }

  .analysis--results-open .analysis__chat {
    flex: 0 0 360px;
    border-right: 1px solid var(--grau-200);
  }

  .analysis__results {
    flex: 1;
    min-height: 0;
  }

  /* Chat breit (alle Reiter zu, Gespraech ohne Ergebnis): Auswahlknopf hoechstens 420 px, Plakette direkt daneben (Entwurf „Alle Reiter geschlossen“) */
  .analysis:not(.analysis--results-open) .analysis__picker {
    flex: 0 1 420px;
  }

  /* Ohne Gespraech: Ueberschrift, Eingabe und Hinweis in der Mitte, kein Kopf */
  .analysis--empty .analysis__chat {
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 30px;
  }

  .analysis--empty .analysis__chat-head {
    display: none;
  }

  .analysis--empty .analysis__scroll {
    flex: none;
    width: 100%;
    max-width: 640px;
    padding: 0;
    overflow: visible;
  }

  .analysis--empty .chat-form {
    width: 100%;
    max-width: 640px;
    margin: 0;
  }
}

@media (min-width: 1280px) {
  .analysis--results-open .analysis__chat {
    flex-basis: 400px;
  }
}

/* Unter 1024 px: eine Spalte; Kopfzeile (Gespraechsauswahl, Verbindung) und Umschalter Chat | Ergebnisse stehen oben,
   darunter entweder der Chat oder die Ergebnisse (Klassen analysis--view-chat und analysis--view-results, result-tabs.js).
   Die Seite fuellt die Fensterhoehe, nur Chat und Ergebnisse scrollen (wie ab 1024 px). Entwurf: „4 · Schmale Bildschirme“. */
.analysis__switch {
  display: none; /* ab 1024 px, ohne Gespraech und ohne JavaScript nicht da */
}

@media (max-width: 1023.98px) {
  .site-main.site-main--full {
    display: flex;
    flex-direction: column;
    height: calc(100dvh - var(--obenleiste));
    padding: 0;
    overflow: hidden;
  }

  .site-main--full > .analysis {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    font-size: 13px;
    line-height: 1.45;
  }

  .analysis__chat {
    flex: 1 1 auto;
    min-height: 0;
  }

  .analysis--empty .analysis__chat-head {
    display: none;
  }

  .analysis__scroll {
    padding-block: 16px;
  }

  /* Kopfzeile (Entwurf .ptop): Die Gespraechsauswahl sitzt kompakt rechts in der oberen Leiste neben ☰ und dem Namen.
     Die DOM-Stelle bleibt; fixed, weil .site-main--full hier overflow: hidden hat. Schublade (30) und Abdunkelung (20) liegen darueber. */
  .analysis__chat-head {
    position: fixed;
    top: 0;
    right: 12px;
    z-index: 6;
    height: var(--obenleiste);
    max-width: calc(100% - 132px); /* ☰ (12 + 40 px) und „TPS AI“ bleiben frei, auch bei 320 px */
    padding: 0;
    border-bottom: 0;
  }

  .no-js .analysis__chat-head {
    position: static;
    max-width: none;
    height: auto;
    min-height: 52px;
    padding: 0 12px;
    border-bottom: 1px solid #f0f0ee;
  }

  .analysis__chat-head .plate,
  .picker-button__clock,
  .picker-button__time {
    display: none; /* der Entwurf zeigt unter 1024 px nur „Titel ⌄“ */
  }

  .analysis__picker {
    flex: 0 1 auto;
  }

  /* Knopf als Pille (Entwurf .selc), 36 px hoch zum Tippen */
  .picker-button {
    flex: 0 1 auto;
    max-width: 200px;
    min-height: 36px;
    padding: 2px 8px 2px 12px;
    border-radius: 999px;
    color: #374151;
    font-size: 12.5px;
    font-weight: 500;
  }

  .picker-button__title + .picker-button__arrow {
    margin-left: 0;
  }

  /* Liste ueber die Breite des Bildschirms, unter der oberen Leiste, mit eigenem Scrollen */
  .picker {
    position: fixed;
    top: var(--obenleiste);
    right: 8px;
    left: 8px;
    width: auto;
    max-width: none;
    max-height: calc(100dvh - var(--obenleiste) - 8px);
    overflow-y: auto;
  }

  /* Umschalter (Entwurf .psw): grauer Streifen, der aktive Knopf weiss; Knopfhoehe fuer Touch 38 px */
  .analysis__switch {
    display: flex;
    flex: none;
    margin: 8px 12px;
    padding: 3px;
    background: #f1f3f6;
    border-radius: 9px;
  }

  .analysis--empty .analysis__switch,
  .no-js .analysis__switch {
    display: none;
  }

  .analysis__switch-button {
    flex: 1;
    min-height: 38px;
    padding: 5px 0;
    background: none;
    border: 0;
    border-radius: 7px;
    color: #4b5563;
    font: inherit;
    font-size: 12.5px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
  }

  .analysis__switch-button[aria-selected="true"] {
    background: var(--weiss);
    color: #075985;
    font-weight: 600;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.12);
  }

  .analysis__switch-button:focus-visible {
    outline: 2px solid var(--blau);
    outline-offset: 1px;
  }

  .analysis__count {
    display: inline-grid;
    place-items: center;
    min-width: 17px;
    height: 17px;
    margin-left: 1px; /* dazu das Leerzeichen im Text: zusammen die 4 px des Entwurfs */
    padding: 0 4px;
    background: var(--blau-dunkel);
    border-radius: 9px;
    color: var(--weiss);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
  }

  /* Ergebnisansicht: Kopfzeile und Umschalter bleiben, Eingabe und Gespraech weichen den Ergebnissen */
  .analysis--view-results .analysis__chat {
    flex: none;
  }

  .analysis--view-results .analysis__chat > :not(.analysis__chat-head, .analysis__switch) {
    display: none;
  }

  .analysis--view-chat .analysis__results {
    display: none;
  }

  .analysis--view-results .analysis__results {
    display: flex;
    flex: 1;
    min-height: 0;
  }

  .analysis--view-results:not(.analysis--results-open) .analysis__results-empty {
    display: block;
  }

  .analysis:not(.analysis--results-open) .results {
    display: none;
  }

  [data-results-wide] {
    display: none; /* „Ergebnis breit“ gibt es nur neben dem Chat */
  }

}

.analysis__results-empty {
  display: none;
  margin: 0;
  padding: 32px 24px;
  color: var(--grau-500);
  text-align: center;
}

.conversation {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.conversation:empty {
  display: none;
}

.message {
  min-width: 0;
}

.message > :first-child {
  margin-top: 0;
}

.message > :last-child {
  margin-bottom: 0;
}

/* Benutzertext: grau hinterlegte Blase rechts; KI-Text ohne Rahmen links (Entwurf .u / .a) */
.message--user {
  justify-self: end;
  max-width: 82%;
  padding: 8px 12px;
  background: #f1f5f9;
  border-radius: 14px;
  color: var(--grau-900);
}

.message__text {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message--ai {
  max-width: 97%;
  color: #1f2937;
}

.message--ai p {
  margin: 0 0 8px;
}

.message--ai ul,
.message--ai ol {
  margin: 0 0 8px;
  padding-left: 1.25rem;
}

/* Rueckfrage: bleibt als solche erkennbar (nicht im Entwurf gezeichnet) */
.message--ask {
  padding-left: 10px;
  border-left: 3px solid var(--blau-tief);
}

.message__hint {
  margin: 8px 0 0;
  color: var(--grau-500);
  font-size: 11.5px;
}

.answer-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.conversation__notice {
  margin: 0;
}

/* Karte je gezeigtem Ergebnis im Chat (Entwurf .card); .is-active setzt result-tabs.js */
.result-card {
  display: grid;
  grid-template-columns: 42px auto minmax(0, 1fr) auto; /* Kachel 32 px + 10 px Abstand (Entwurf .card gap 10px) */
  grid-template-rows: auto auto;
  align-items: center;
  width: 100%;
  max-width: 340px;
  margin: 8px 0 0;
  padding: 8px 11px;
  background: var(--weiss);
  border: 1px solid var(--grau-200);
  border-radius: 10px;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

/* Im Entwurf liegen Karte und Hinweis innerhalb des KI-Texts (8 bzw. 6 px darunter); hier sind sie Geschwister im Raster mit 12 px Abstand */
.conversation > .result-card {
  margin-top: -4px;
}

/* Alle Reiter geschlossen: Der Chat ist breit, die Karte darf wie im Entwurf bis 420 px wachsen („Rechts öffnen“ passt dann daneben) */
.analysis:not(.analysis--results-open) .result-card {
  max-width: 420px;
}

.result-card:hover {
  background: #f8fcff;
  border-color: #bae6fd;
}

.result-card.is-active {
  border-color: var(--blau);
  box-shadow: 0 0 0 3px var(--blau-tint);
}

.result-card__no {
  display: grid;
  grid-row: 1 / span 2;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-right: 10px;
  background: var(--blau-hauch);
  border-radius: 8px;
  color: var(--blau-dunkel);
  font-size: 12px;
  font-weight: 700;
}

.result-card b {
  grid-column: 2 / span 2;
  min-width: 0;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-card small {
  grid-column: 2;
  color: var(--grau-500);
  font-size: 11.5px;
  white-space: nowrap;
}

.result-card__open,
.result-card__hint {
  display: none;
}

.result-card.is-active .result-card__open {
  display: block;
  grid-column: 3;
  grid-row: 2;
  color: var(--grau-500);
  font-size: 11.5px;
  white-space: nowrap;
}

.result-card.is-active .result-card__open::before {
  content: "\00a0· ";
}

.result-card:not(.is-active):hover .result-card__hint,
.result-card:not(.is-active):focus-visible .result-card__hint {
  display: flex;
  grid-column: 4;
  grid-row: 1 / span 2;
  align-items: center;
  gap: 4px;
  padding-left: 10px;
  color: var(--blau-dunkel);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}

.result-card__hint .icon {
  width: 13px;
  height: 13px;
}

/* „An die KI gesendet“ im Chat: kleine Plakette (Entwurf .sent), Klick oeffnet das Fenster. Farben: ok gruen (Entwurf);
   hit rot und neutral grau sind im Entwurf nicht gezeichnet und aus der Farblogik der frueheren Zusammenfassung abgeleitet. */
.sent-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  justify-self: start;
  max-width: 100%;
  margin: 0;
  padding: 2px 9px 2px 6px;
  background: var(--gruen-hauch);
  color: var(--gruen-dunkel);
  font: inherit;
  font-size: 11.5px;
  line-height: 1.45;
  text-align: left;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

/* Im Entwurf liegt die Plakette im KI-Text, 6 px unter der Karte; hier ist sie Geschwister im Raster mit 12 px Abstand */
.conversation > .sent-chip {
  margin-top: -6px;
}

.sent-chip .icon {
  width: 13px;
  height: 13px;
}

.sent-chip--hit {
  background: var(--rot-hauch);
  color: var(--rot-dunkel);
}

.sent-chip--neutral {
  background: var(--grau-100);
  color: var(--grau-500);
}

.sent-chip:hover {
  filter: brightness(0.96);
}

/* Reiterleiste der Ergebnisse (Entwurf .tabs / .rt); Verhalten in result-tabs.js */
.analysis__results .results {
  position: relative; /* wie .analysis__scroll */
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

/* Die untere Linie ist ein innerer Schatten statt eines Rands: Der aktive Reiter liegt buendig darueber und
   verdeckt sie, ohne dass der waagrecht scrollende Reiterbereich ihn beschneidet. */
.result-tabbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex: none;
  align-items: stretch;
  gap: 2px;
  height: 52px;
  padding: 0 12px;
  background: #f6f7f9;
  box-shadow: inset 0 -1px 0 var(--grau-200);
}

.result-tabs {
  display: flex;
  flex: 1;
  align-items: flex-end;
  gap: 2px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.result-tabs::-webkit-scrollbar {
  display: none;
}

.result-tabbar > .icon-button {
  align-self: center;
  margin: 0 0 1px auto; /* im Entwurf zentriert in der Leiste ohne ihre untere Linie */
}

.result-tab {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  min-width: 0;
  max-width: 250px;
  margin-bottom: 1px; /* der aktive Reiter reicht dagegen bis zur Leistenkante */
  border-radius: 8px 8px 0 0;
  color: var(--grau-500);
  font-size: 12.5px;
  white-space: nowrap;
}

.result-tab[hidden] {
  display: none;
}

.result-tab > [data-tab-select] {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 8px 7px 8px 12px;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.result-tab__no {
  display: grid;
  flex: none;
  place-items: center;
  width: 18px;
  height: 18px;
  background: var(--grau-200);
  border-radius: 5px;
  color: #4b5563;
  font-size: 10.5px;
  font-weight: 700;
}

.result-tab__title {
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-tab > [data-tab-close] {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: 16px;
  height: 16px;
  margin: 0 12px 0 2px;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 4px;
  color: #9ca3af;
  cursor: pointer;
}

.result-tab > [data-tab-close] .icon {
  width: 100%;
  height: 100%;
}

/* Trefferflaeche des kleinen Kreuzes */
.result-tab > [data-tab-close]::after {
  content: "";
  position: absolute;
  inset: -7px;
}

.result-tab.is-active {
  margin-bottom: 0;
  background: var(--weiss);
  border: 1px solid var(--grau-200);
  border-bottom-color: var(--weiss);
  color: var(--grau-900);
  font-weight: 600;
}

.result-tab.is-active .result-tab__no {
  background: var(--blau-dunkel);
  color: var(--weiss);
}

.result-tab.is-active > [data-tab-close] {
  padding: 1px; /* Symbol 14 px im grauen Feld */
  background: var(--grau-100);
  color: #4b5563;
}

/* Ohne JavaScript sind alle Ergebnisse sichtbar; die Reiterleiste hat dann keine Funktion */
.no-js .result-tabbar {
  display: none;
}

/* „Ergebnis breit“: nur die Ergebnisse, der Chat ist verborgen (result-tabs.js); unter 1024 px gibt es dafuer den Umschalter */
@media (min-width: 1024px) {
  .analysis--wide .analysis__chat {
    display: none;
  }
}

/* Ergebnisse in der rechten Spalte (Entwurf .rtitle, .tools, .tw): ohne Kartenrahmen; Titel, Metazeile und Umschalter
   liegen in eigenen Zeilen, der Inhalt hat 18 px Rand rechts und links */
.analysis__results .result {
  padding: 0 0 18px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

/* Mit JavaScript ist nur ein Ergebnis sichtbar; ohne stehen alle untereinander */
.no-js .analysis__results .result + .result {
  border-top: 1px solid var(--grau-200);
}

.analysis__results .result > :not(.result__head, .result__tools, dialog) {
  margin-right: 18px;
  margin-left: 18px;
}

.analysis__results .result__head {
  display: block;
  margin: 0;
  padding: 14px 18px 0;
}

.analysis__results .result__title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -0.01em;
}

.analysis__results .result__meta {
  margin: 0;
  font-size: 13px; /* wie im Entwurf: die 12-px-Schrift steht in einer Zeile mit der Zeilenhoehe der 13-px-Schrift */
  line-height: 1.45;
}

.analysis__results .result__meta > span {
  color: var(--grau-500);
  font-size: 12px;
}

.analysis__results .result__tools {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
}

/* Umschalter klein (Entwurf .seg); dieselben dichten Regeln gelten in der Berichtsansicht (.site-main > .result), damit der Baustein dort genauso aussieht */
.analysis__results .segmented,
.site-main > .result .segmented {
  flex-wrap: nowrap;
  border-color: var(--grau-300);
  border-radius: 8px;
}

.analysis__results .segmented__button,
.site-main > .result .segmented__button {
  min-height: 0;
  padding: 4px 11px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  border-left-color: var(--grau-300);
}

/* Tabelle (Entwurf .tw / .t) */
.analysis__results .result__table,
.site-main > .result .result__table {
  max-height: max(16rem, calc(100dvh - 18rem)); /* die Kopfzeile bleibt beim Scrollen stehen */
  margin-bottom: 12px;
  border-radius: 10px;
  font-size: 12.5px;
}

.analysis__results .result__table th,
.site-main > .result .result__table th,
.analysis__results .result__table td,
.site-main > .result .result__table td {
  padding: 6px 10px;
  font-size: 12.5px;
  line-height: 1.45;
  border-bottom: 1px solid var(--grau-100);
}

.analysis__results .result__table thead th,
.site-main > .result .result__table thead th {
  padding: 8px 10px;
  background: var(--grau-50);
  color: #4b5563;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
  border-bottom: 1px solid var(--grau-200);
}

.analysis__results .result__problem,
.site-main > .result .result__problem,
.analysis__results .result__notice,
.site-main > .result .result__notice,
.analysis__results .group-list__by,
.site-main > .result .group-list__by,
.analysis__results .group-list__levels-label,
.site-main > .result .group-list__levels-label {
  font-size: 12px;
}

/* Ergebnis: Titel, Umschalter, Tabelle oder Diagramm, Aktionen */
.result {
  min-width: 0;
  padding: 16px;
  background: var(--weiss);
  border: 1px solid var(--grau-200);
  border-radius: var(--radius-karte);
  box-shadow: var(--schatten-karte);
}

.result__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 12px;
}

.result__title {
  margin: 0;
}

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  border: 1px solid var(--grau-300);
  border-radius: var(--radius-control);
  overflow: hidden;
}

.segmented__button {
  min-height: 36px;
  padding: 4px 12px;
  background: var(--weiss);
  color: var(--grau-700);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  border: 0;
  border-left: 1px solid var(--grau-300);
  cursor: pointer;
}

.segmented__button:first-child {
  border-left: 0;
}

.segmented__button:hover {
  background: var(--blau-hauch);
}

.segmented__button[aria-pressed="true"] {
  background: var(--blau-dunkel);
  color: var(--weiss);
}

.result__problem,
.result__notice,
.group-list__by {
  margin: 0 0 12px;
  color: var(--grau-700);
  font-size: 0.9375rem;
}

.result__problem {
  padding: 8px 12px;
  background: var(--blau-hauch);
  border-left: 4px solid var(--blau-tief);
  border-radius: var(--radius-control);
}

/* Tabellen scrollen innerhalb ihres Kastens (waagerecht und bei vielen Zeilen senkrecht) */
.result__table {
  max-height: 32rem;
  margin-bottom: 12px;
  overflow: auto;
  box-shadow: none;
}

.result__table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.result__table th,
.result__table td {
  padding: 8px 12px;
  white-space: nowrap;
}

.result__table tbody th {
  text-align: left;
  font-weight: 700;
  font-size: inherit;
  color: inherit;
  letter-spacing: normal;
  border-bottom-width: 1px;
}

.result__table tbody tr:last-child th {
  border-bottom: 0;
}

/* Nach dem Neuaufbau erst zeigen, wenn group-list.js die Liste uebernommen hat (kein Aufblitzen) */
[data-group-lists] .group-list:not([data-ready]) tr[data-parent] {
  display: none;
}

.group-list__levels {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 12px;
}

.group-list__levels-label {
  color: var(--grau-700);
  font-size: 0.9375rem;
}

.group-list__toggle {
  display: block;
  width: 100%;
  padding: 0;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.group-list__toggle::before {
  content: "\25B8";
  content: "\25B8" / "";
  display: inline-block;
  width: 1.25em;
}

.group-list__toggle[aria-expanded="true"]::before {
  content: "\25BE";
  content: "\25BE" / "";
}

.group-list__group > *,
.group-list__total > * {
  background: var(--blau-hauch);
  font-weight: 700;
}

.group-list__total > * {
  border-top: 2px solid var(--blau-dunkel);
}

.group-list__level-0 > :first-child {
  padding-left: 12px;
}

.group-list__level-1 > :first-child {
  padding-left: 32px;
}

.group-list__level-2 > :first-child {
  padding-left: 52px;
}

.group-list__level-3 > :first-child {
  padding-left: 72px;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.result__message {
  margin: 0 0 12px;
  color: var(--rot-dunkel);
  font-weight: 500;
}

.result__save-form {
  padding-bottom: 4px;
}

.sql__keyword {
  color: var(--blau-dunkel);
  font-weight: 600;
}

.sql__string {
  color: var(--gruen-dunkel);
}

.sql__number {
  color: var(--sql-zahl);
}

.sql__comment {
  color: var(--sql-kommentar);
  font-style: italic;
}

.analysis__progress {
  margin: 0;
}

.analysis__thinking {
  color: var(--grau-500);
  font-size: 0.875rem;
}

.analysis__thinking summary {
  cursor: pointer;
}

.analysis__thinking-text {
  margin: 6px 0 0;
  max-height: 12rem;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: inherit;
}

.analysis__error {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 12px 16px;
  background: var(--rot-hauch);
  border: 1px solid var(--rot-tint);
  border-left: 4px solid var(--rot);
  border-radius: var(--radius-control);
  color: var(--rot-dunkel);
}

.analysis__error-text {
  flex: 1 1 16rem;
  margin: 0;
  font-weight: 500;
}

/* Eingabe unten fest (Entwurf .comp): Feld, darunter Plakette, Hinweis und runder Sende-Knopf */
.chat-form {
  flex: none;
  width: calc(100% - 32px);
  max-width: 708px;
  margin: 0 auto 14px;
}

.chat-form__box {
  padding: 10px 12px;
  background: var(--weiss);
  border: 1px solid var(--grau-300);
  border-radius: 14px;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.05);
}

.chat-form__box:focus-within {
  border-color: var(--blau);
  box-shadow: 0 0 0 3px var(--blau-tint);
}

.chat-form__box textarea {
  display: block;
  width: 100%;
  min-height: 34px;
  max-height: 160px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--grau-900);
  font: inherit;
  line-height: 1.45;
  resize: none;
  field-sizing: content;
}

.chat-form__box textarea:focus,
.chat-form__box textarea:focus-visible {
  outline: none;
}

.chat-form__box textarea::placeholder {
  color: #9ca3af;
  opacity: 1;
}

.chat-form__row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #9ca3af;
  font-size: 11.5px;
}

.chat-form__shortcut {
  white-space: nowrap;
}

@media (max-width: 1023.98px) {
  /* Auf dem Handy zeigt der Entwurf nur Feld und Sende-Knopf */
  .chat-form__shortcut {
    display: none;
  }
}

.chat-form__send {
  display: grid;
  flex: none;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-left: auto;
  padding: 0;
  background: var(--blau-dunkel);
  border: 0;
  border-radius: 50%;
  color: var(--weiss);
  cursor: pointer;
  transition: background-color var(--dauer);
}

.chat-form__send:hover {
  background: var(--blau-nacht);
}

.chat-form__send[aria-disabled="true"] {
  background: #9ca3af;
  cursor: default;
}

/* Verbindung im Eingabefeld: Auswahl bzw. feste Verbindung als Plakette mit Rand (Entwurf .selc) */
.chat-form__connection {
  position: relative;
  padding: 2px 6px 2px 9px;
  background: transparent;
  border: 1px solid var(--grau-200);
  color: var(--grau-700);
}

.chat-form__connection .icon {
  width: 13px;
  height: 13px;
}

.chat-form__connection select {
  width: auto;
  max-width: 14rem;
  min-height: 0;
  padding: 0 18px 0 0;
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: inherit;
  font: inherit;
  text-overflow: ellipsis;
  cursor: pointer;
}

.chat-form__connection select + .icon {
  margin-left: -18px;
  pointer-events: none;
}

.chat-form__connection strong {
  font-weight: 600;
}

.chat-form__hint {
  margin: 14px 0 0;
  color: #9ca3af;
  font-size: 11.5px;
  text-align: center;
}

.analysis:not(.analysis--empty) .chat-form__hint {
  display: none;
}

@media (min-width: 1024px) {
  .analysis--empty .chat-form__box textarea {
    min-height: 56px;
  }
}

@media (max-width: 1023.98px) {
  /* Touch: groesserer Sende-Knopf */
  .chat-form__send {
    width: 40px;
    height: 40px;
  }
}

/* Berichte: Umschalter als Links, Aktionen, SQL-Eingabe */
a.segmented__button {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

a.segmented__button[aria-current="true"] {
  background: var(--blau-dunkel);
  color: var(--weiss);
}

.report-actions {
  margin: 16px 0;
}

.code-input {
  /* unter 1024 px 16 px: sonst zoomt iOS beim Antippen hinein (ab 1024 px 12,5 px, siehe Abschnitt „Dichte Schrift“) */
  font-size: 1rem;
  font-family: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  line-height: 1.45;
}

/* ---------- Vorschau der Markierungen (Modus „nein“) ---------- */
.preview {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.preview__title {
  margin: 0;
  font-size: 1.125rem;
}

.preview__intro,
.preview__none,
.preview__status {
  margin: 0;
  font-size: 0.9375rem;
}

.preview__warning,
.preview__limit,
.preview__history {
  margin: 0;
}

.preview__history-text {
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}

.preview__text {
  margin: 0;
  padding: 12px;
  background: var(--grau-50);
  border: 1px solid var(--grau-200);
  border-radius: var(--radius-control);
  line-height: 2;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.preview__mark,
.preview__hint {
  display: inline;
  margin: 0;
  padding: 2px 4px;
  font: inherit;
  line-height: inherit;
  text-align: inherit;
  white-space: inherit;
  overflow-wrap: anywhere;
  border-radius: 4px;
  cursor: pointer;
}

.preview__mark {
  background: var(--blau-tint);
  color: var(--blau-nacht);
  border: 1px solid var(--blau-tief);
}

.preview__mark::after {
  content: " ✕";
  font-size: 0.8em;
}

.preview__hint {
  background: transparent;
  color: var(--grau-900);
  border: 0;
  border-bottom: 2px dashed var(--grau-500);
  border-radius: 0;
}

.preview__mark:hover,
.preview__hint:hover {
  background: var(--blau-hauch);
}

.preview__legend {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
}

.preview__legend-item {
  overflow-wrap: anywhere;
}

.preview__note {
  color: var(--grau-700);
}

.preview__report {
  margin: 0;
}

.preview__report-title {
  margin: 0 0 4px;
  font-size: 1rem;
}

.preview__report-body {
  max-height: 16rem;
  overflow-y: auto;
  padding: 12px;
  background: var(--grau-50);
  border: 1px solid var(--grau-200);
  border-radius: var(--radius-control);
  line-height: 2;
  overflow-wrap: anywhere;
}

/* Vorgeschichte: viele Durchgaenge moeglich, deshalb in der Hoehe begrenzt; scrollt innen, die Seite nie waagerecht */
.preview__report--history .preview__report-body {
  max-height: 20rem;
  max-width: 100%;
  overflow-x: hidden;
}

.preview__report-group + .preview__report-group {
  margin-top: 4px;
}

.preview__report-label {
  font-weight: 600;
  color: var(--grau-700);
}

.preview__report-section {
  display: inline-block;
  max-width: 100%;
  margin-right: 4px;
  padding: 0 6px;
  border: 1px solid var(--grau-200);
  border-radius: var(--radius-control);
  background: var(--weiss);
  white-space: pre-wrap;
  vertical-align: top;
}

.preview__add {
  display: flex;
  justify-content: flex-start;
}

/* Inhalt von „An die KI gesendet“ (Fenster im Chat und Admin-Seite) */
.sent__note {
  margin: 0 0 8px;
  color: var(--grau-500);
}

.sent__check {
  margin: 0 0 8px;
  font-weight: 600;
}

.sent__check--ok {
  color: var(--gruen-dunkel);
}

.sent__check--hit {
  color: var(--rot-dunkel);
}

.sent__item,
.sent__map {
  margin-top: 12px;
}

.sent__item h4,
.sent__map h4 {
  margin: 0 0 4px;
  font-size: 0.875rem;
}

.sent__text {
  max-height: 16rem;
  overflow: auto;
  margin: 0;
  padding: 12px;
  background: var(--grau-100);
  font-size: 0.8125rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border-radius: var(--radius-control);
}

/* im Fenster: Textfeld mit dem Grund des Abfrage-Blocks (--grau-100), Radius 9 px wie der Textblock im Entwurf */
.dialog .sent__text {
  background: var(--grau-100);
  border-radius: 9px;
}

.sent__ph {
  padding: 0 2px;
  background: var(--blau-tint);
  color: var(--blau-nacht);
  border-radius: 3px;
}

/* Admin: KI-Gespraeche */
.chat-audit__filter {
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  align-items: end;
}

.chat-audit__title {
  overflow-wrap: anywhere;
}

.chat-audit__meta {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 4px 16px;
  margin: 0;
}

.chat-audit__meta dt {
  color: var(--grau-700);
  font-weight: 600;
}

.chat-audit__meta dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.chat-audit__sub {
  margin: 0 0 8px;
  font-size: 1.0625rem;
}

.chat-audit__details {
  margin-bottom: 16px;
}

.chat-audit__details > summary {
  min-height: var(--tippflaeche);
  font-weight: 600;
  cursor: pointer;
}

.chat-audit__tools {
  margin: 0;
  padding-left: 20px;
}

.chat-audit__turn {
  min-width: 0;
}

.chat-audit__table .badge {
  white-space: normal;
}

/* ---------- Bestelleingang ---------- */

:root {
  --gelb: #b45309;
  --gelb-tint: #fef3c7;
}

/* Ampel: Symbol und Text, die Farbe ist nur Zugabe */
.light {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  border-radius: 4px;
  white-space: nowrap;
}

.light--gruen {
  background: var(--gruen-tint);
  color: var(--gruen-dunkel);
}

.light--gelb {
  background: var(--gelb-tint);
  color: var(--gelb);
}

.light--rot {
  background: var(--rot-tint);
  color: var(--rot-dunkel);
}

.badge--zu_pruefen {
  background: var(--blau-tint);
  color: var(--blau-nacht);
}

.badge--uebergeben {
  background: var(--gruen-tint);
  color: var(--gruen-dunkel);
}

.badge--freigegeben {
  background: var(--grau-100);
  color: var(--grau-700);
}

.badge--fehler {
  background: var(--rot-tint);
  color: var(--rot-dunkel);
}

.orders-filter {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px 16px;
  align-items: end;
}

@media (min-width: 768px) {
  .orders-filter {
    grid-template-columns: repeat(2, minmax(0, 16rem)) auto;
  }
}

/* Pruefansicht: gestapelt, ab 900 px Nachricht links und Vorschlag rechts */
.orders-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

@media (min-width: 900px) {
  .orders-detail {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  }
}

.orders-detail h2,
.orders-detail h3 {
  margin: 0 0 8px;
}

.orders-detail h3 {
  margin-top: 16px;
  font-size: 1rem;
}

.orders-proposal__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}

.orders-proposal__marks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 8px;
}

.orders-facts {
  margin: 0 0 12px;
}

.orders-facts > div {
  display: grid;
  grid-template-columns: minmax(5.5rem, 28%) minmax(0, 1fr);
  gap: 8px;
  padding: 4px 0;
}

.orders-facts dt {
  color: var(--grau-500);
  font-weight: 600;
}

.orders-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.orders-history {
  margin: 12px 0;
  padding: 0;
  list-style: none;
}

.orders-history__entry {
  padding: 8px 0;
  border-top: 1px solid var(--grau-100);
}

.orders-history__time {
  margin-right: 8px;
  color: var(--grau-700);
  font-size: 0.875rem;
}

.orders-history__text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.orders-history__status {
  margin-top: 2px;
  color: var(--grau-700);
  font-size: 0.875rem;
}

.orders-attachments {
  margin: 12px 0;
  padding: 0;
  list-style: none;
}

.orders-attachments__item {
  padding: 8px 0;
  border-top: 1px solid var(--grau-100);
}

.orders-attachments__name {
  overflow-wrap: anywhere;
  font-weight: 600;
}

.orders-attachments__meta {
  color: var(--grau-700);
  font-size: 0.875rem;
}

.orders-attachments__preview {
  display: block;
  max-width: min(320px, 100%);
  max-height: 240px;
  margin: 8px 0;
  border: 1px solid var(--grau-200);
  border-radius: var(--radius-control);
  object-fit: contain;
}

.orders-attachments audio {
  display: block;
  width: min(360px, 100%);
  margin: 8px 0;
}

.orders-attachments__form {
  display: inline;
  margin: 0;
}

.orders-reply {
  margin: 12px 0;
}

.orders-replies {
  margin: 16px 0;
}

.orders-reply--draft {
  padding: 12px;
  border: 1px solid var(--grau-200);
  border-radius: var(--radius-control);
}

.orders-reply--draft h4 {
  margin: 0 0 4px;
}

.orders-reply__marks {
  margin: 0 0 8px;
}

.orders-history__answer {
  margin: 8px 0 0 16px;
  padding-left: 12px;
  border-left: 3px solid var(--grau-200);
}

.orders-mark {
  display: inline-block;
  margin-left: 6px;
}

.orders-reply textarea {
  width: 100%;
}

.orders-message__body {
  margin: 12px 0;
  padding: 12px;
  background: var(--grau-100);
  border-radius: var(--radius-control);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.orders-message__body:focus-visible,
.orders-details > summary:focus-visible {
  outline: 2px solid var(--blau-dunkel);
  outline-offset: 2px;
}

.orders-details {
  margin: 8px 0;
}

.orders-details > summary {
  cursor: pointer;
  font-weight: 600;
}

.orders-choice fieldset {
  margin: 8px 0;
  padding: 0;
  border: 0;
}

.orders-choice__option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
}

.orders-search,
.orders-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px 12px;
  margin: 12px 0;
}

.orders-search .field,
.orders-inline .field {
  flex: 1 1 12rem;
}

.orders-lines select,
.orders-lines input {
  min-width: 0;
  max-width: 100%;
}

.orders-lines input[name$="[qty]"] {
  min-width: 5rem;
}

.orders-lines tr[data-changed] {
  box-shadow: inset 4px 0 0 var(--gelb);
}

.orders-lines tr[data-changed] td[data-label="Pos"]::after {
  content: " geändert";
  color: var(--gelb);
  font-size: 0.875rem;
}

fieldset[data-changed],
.field[data-changed] {
  border-left: 4px solid var(--gelb);
  padding-left: 8px;
}

.orders-cell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  min-width: 0;
}

.orders-cell--row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.orders-lines select {
  text-overflow: ellipsis;
}

.orders-lines__info,
.orders-table td {
  overflow-wrap: anywhere;
}

.orders-lines__info {
  color: var(--grau-500);
  font-size: 0.875rem;
}

/* Angaben unter der Artikelauswahl: Label links, Wert rechts */
.orders-lines__facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 2px 10px;
  margin: 0 0 6px;
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}

.orders-lines__facts dt {
  color: var(--grau-500);
  font-weight: 600;
}

.orders-lines__facts dd {
  margin: 0;
  color: var(--grau-700);
}

.orders-lines__quote {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  font-style: italic;
}

/* Tabellenansicht: Zellen unten ausrichten, damit Artikelauswahl, Menge, ME und
   Aktionen auf einer Linie stehen; die Einheiten-Bestaetigung haengt unter dem
   Mengenfeld, ohne es nach oben zu schieben */
@media (min-width: 768px) {
  .orders-lines td {
    vertical-align: bottom;
  }

  .orders-lines td[data-label="Menge"] {
    position: relative;
  }

  .orders-lines td[data-label="Menge"] [data-unit-confirmation] {
    position: absolute;
    top: calc(100% - 6px);
    left: 10px;
    right: 10px;
    z-index: 1;
  }

  .orders-lines tr:has([data-unit-confirmation]:not([hidden])) td {
    padding-bottom: 3.5rem;
  }

  /* Hoehe der Steuerelemente (Auswahl, Menge): unter 1024 px --tippflaeche,
     ab 1024 px 13 px Schrift * 1,45 Zeilenhoehe + 2 * 6 px Polster + 2 * 1 px Rand */
  .orders-lines {
    --orders-control-h: var(--tippflaeche);
  }

  /* Pos, ME und Aktionen: Inhalt mittig zur Steuerelement-Hoehe (ME setzt orders.js per textContent) */
  .orders-lines td[data-label="Pos"],
  .orders-lines td[data-label="ME"] {
    line-height: var(--orders-control-h);
    white-space: nowrap;
  }

  .orders-lines .orders-cell--row {
    flex-wrap: nowrap;
    align-items: center;
    min-height: var(--orders-control-h);
  }
}

@media (min-width: 1024px) {
  .orders-lines {
    --orders-control-h: calc(13px * 1.45 + 14px);
  }
}

@media (max-width: 767.98px) {
  .orders-lines__facts {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .orders-lines__facts dd {
    margin-bottom: 4px;
  }
}

.orders-rules,
.orders-hits,
.orders-actions__reasons {
  margin: 8px 0;
  padding-left: 20px;
}

.orders-rules {
  padding-left: 0;
  list-style: none;
}

.orders-rules li {
  margin-bottom: 4px;
  color: var(--gelb);
  font-weight: 500;
}

.orders-rules .orders-rules__info {
  color: var(--blau-dunkel);
  font-weight: 400;
}

.orders-actions {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--grau-200);
}

.orders-actions__reasons {
  color: var(--rot-dunkel);
}

.orders-final {
  margin: 16px 0 0;
  font-weight: 600;
}

/* ---------- Bestell-Eingang: gegliedertes Formular ---------- */

.inbox-form {
  display: grid;
  gap: 24px;
}

.form-section {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 16px 0 0;
  border: 0;
  border-top: 1px solid var(--grau-200);
}

fieldset.form-section:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.form-section > legend {
  float: left;
  width: 100%;
  margin: 0 0 12px;
  color: var(--grau-900);
  font-size: 1.125rem;
  font-weight: 600;
}

.form-section > legend + * {
  clear: both;
}

.form-details > summary {
  display: flex;
  align-items: center;
  gap: 0.5em;
  list-style: none;
  min-height: var(--tippflaeche);
  color: var(--grau-900);
  font-size: 1.125rem;
  font-weight: 600;
  cursor: pointer;
}

.form-details > summary::-webkit-details-marker {
  display: none;
}

/* Eigenes Aufklappzeichen: display:flex nimmt der Zusammenfassung sonst die Marke. */
.form-details > summary::before {
  content: "▸";
  flex: none;
  width: 1em;
  color: var(--grau-700);
}

.form-details[open] > summary::before {
  content: "▾";
}

.form-details > summary:focus-visible {
  outline: 2px solid var(--blau-dunkel);
  outline-offset: 2px;
}

.form-details[open] > summary {
  margin-bottom: 8px;
}

.form-section__body {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

/* ---------- Silos: Probelauf des Silo-SQL ---------- */

.silo-dryrun {
  min-width: 0;
  margin: 0 0 16px;
  padding: 0;
  border: 0;
}
.silo-dryrun legend {
  padding: 0;
  font-weight: 600;
}
.silo-dryrun__fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0 16px;
}
.silo-dryrun__result {
  min-width: 0;
  margin-top: 16px;
}

/* ---------- Silos: Baum der Warengruppen (verschachtelte details, ohne JavaScript) ---------- */

.silo-tree {
  min-width: 0;
  margin: 0 0 16px;
}

.silo-tree__list {
  display: grid;
  gap: 2px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.silo-tree__list .silo-tree__list {
  margin-left: 20px;
  padding-left: 12px;
  border-left: 1px solid var(--grau-200);
}

.silo-tree__item {
  min-width: 0;
}

.silo-tree__node > summary {
  display: flex;
  align-items: center;
  gap: 0.5em;
  min-height: var(--tippflaeche);
  list-style: none;
  cursor: pointer;
}

.silo-tree__node > summary::-webkit-details-marker {
  display: none;
}

.silo-tree__node > summary::before {
  content: "▸";
  flex: none;
  width: 1em;
  color: var(--grau-700);
}

.silo-tree__node[open] > summary::before {
  content: "▾";
}

.silo-tree__node > summary:focus-visible {
  outline: 2px solid var(--blau-dunkel);
  outline-offset: 2px;
}

.silo-tree__check {
  min-width: 0;
}

.silo-tree__kind {
  color: var(--grau-700);
  font-size: 0.875rem;
}

.silo-tree__note {
  color: var(--grau-700);
  font-size: 0.875rem;
  font-style: normal;
}

.silo-tree__pseudo {
  color: var(--grau-700);
  font-weight: 600;
}

/* ---------- KI-Einstellungen: gegliedertes Formular mit festem Fuss ---------- */

.settings-form {
  display: grid;
  gap: 24px;
}

/* Beschriftung und Zustandsplakette in einer Zeile (API-Schluessel) */
.field__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
}

/* Hervorgehobener Datenschutzschalter: Kurzfassung sichtbar, voller Text aufklappbar */
.privacy-switch {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 12px 16px;
  background: var(--blau-hauch);
  border: 1px solid var(--blau-tint);
  border-left: 4px solid var(--blau-dunkel);
  border-radius: var(--radius-control);
}

.privacy-switch > .check {
  font-weight: 600;
}

.privacy-switch__summary,
.privacy-switch__note {
  margin: 0;
}

/* Platz fuer einen Warnhinweis zum Schalter (z. B. Zeilen gehen unmaskiert an den KI-Dienst) */
.privacy-switch__note {
  padding: 8px 12px;
  background: var(--gelb-tint);
  color: var(--grau-900);
  border-radius: var(--radius-control);
}

.privacy-switch__details > summary {
  display: inline-block;
  color: var(--blau-dunkel);
  font-weight: 600;
  cursor: pointer;
}

.privacy-switch__details > summary:focus-visible {
  outline: 2px solid var(--blau-dunkel);
  outline-offset: 2px;
}

.privacy-switch__details[open] > summary {
  margin-bottom: 6px;
}

/* Fester Fuss: die Knoepfe bleiben beim Scrollen am unteren Fensterrand erreichbar (reines CSS, ohne JavaScript) */
.form-actions--sticky {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin-inline: -16px;
  padding: 10px 16px;
  background: var(--weiss);
  border-top: 1px solid var(--grau-200);
}

.form-actions--sticky > .button-row {
  margin-top: 0;
}

@media (min-width: 768px) {
  .form-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

}

/* Das Feld hat 24 px Polster zwischen 768 und 1023 px, sonst 16 px (siehe .panel) */
@media (min-width: 768px) and (max-width: 1023px) {
  .form-actions--sticky {
    margin-inline: -24px;
    padding-inline: 24px;
  }
}

.inbox-health {
  margin: 0 0 16px;
  font-size: 0.9375rem;
  overflow-wrap: anywhere;
}

.inbox-health--stoerung {
  color: var(--rot-dunkel);
  font-weight: 500;
}

/* ---------- Abruf-Zustand der Eingaenge (Liste) und Hinweisband im Bestelleingang ---------- */

.inbox-fetch__body {
  min-width: 0;
}

.inbox-fetch__detail {
  display: block;
  margin-top: 4px;
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

.inbox-fetch__secret--fehler {
  color: var(--rot-dunkel);
  font-weight: 500;
}

.fetch-notice {
  margin: 0 0 16px;
}

.fetch-notice p {
  margin: 0;
}

.fetch-notice p + p {
  margin-top: 6px;
}

.fetch-notice .alert-link {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
}

/* ---------- Entwurfsmasse ab 1024 px (1:1 aus entwurf-weitere-punkte) ---------- */
/* Darunter bleiben Tippflaechen und Tabellenschrift fuer Touch groesser. */

@media (max-width: 1023.98px) {
  table {
    font-size: 0.875rem;
  }

  th,
  td {
    padding: 10px 14px;
  }

  th {
    font-size: 0.8125rem;
  }

  .badge {
    font-size: 0.8125rem;
    padding: 2px 10px;
  }

  h1 {
    font-size: 1.25rem;
  }
}

@media (min-width: 1024px) {
  .site-main {
    padding: 22px 28px 40px;
  }

  /* Abstand zwischen Titel und Aktionszeile wie die leere Unterzeile im Entwurf (4 + 17 + 12 px) */
  .page-header {
    gap: 34px;
  }

  /* Auswahlspalte (Checkbox) schmal, bis zum Titel etwa 44 px wie im Entwurf */
  .col-select {
    width: 34px;
  }

  .button,
  .button--small {
    gap: 6px;
    min-height: 0;
    padding: 5px 12px;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.45;
  }

  .button--secondary {
    font-weight: 500;
  }
}


/* ---------- Werkzeugleiste unter dem Ergebnistitel (Entwurf .tools, .tb) ---------- */

.result__tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.result__tools--plain {
  margin: 12px 0;
}

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

.tb {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  background: var(--weiss);
  color: var(--grau-700);
  font: inherit;
  font-size: 12px;
  line-height: 1.45;
  white-space: nowrap;
  text-decoration: none;
  border: 1px solid var(--grau-200);
  border-radius: 7px;
  cursor: pointer;
}

.tb:hover {
  background: var(--blau-hauch);
  color: var(--grau-900);
}

.tb--primary {
  background: var(--blau-dunkel);
  color: var(--weiss);
  font-weight: 600;
  border-color: var(--blau-dunkel);
}

.tb--primary:hover {
  background: var(--blau-nacht);
  color: var(--weiss);
}

/* Verbindungsauswahl im leeren Gespraech unter 1024 px: Touch-Flaeche (die Auswahl fuellt die Plakette, 40 px hoch) */
@media (max-width: 1023.98px) {
  .chat-form__connection {
    padding-block: 0;
  }

  .chat-form__connection select {
    min-height: 40px;
  }
}

/* Karten im Chat unter 1024 px (Entwurf: nur „Tabelle · 12 Zeilen“): kein „rechts geöffnet“ und kein „Rechts öffnen“, es gibt kein Rechts */
@media (max-width: 1023.98px) {
  .result-card.is-active .result-card__open,
  .result-card:not(.is-active):hover .result-card__hint,
  .result-card:not(.is-active):focus-visible .result-card__hint {
    display: none;
  }
}

/* ---------- Ergebnisse unter 1024 px (Entwurf „4 · Schmale Bildschirme“: .ptabs, .ibtn) ---------- */
/* Reiter als Pillen (waagrecht scrollend), Abfrage, CSV und Speichern als Symbolknoepfe mit aria-label; Touch-Groessen */

@media (max-width: 1023.98px) {
  .no-js .site-main.site-main--full {
    height: auto;
    overflow: visible;
  }

  .no-js .analysis--view-chat .analysis__results {
    display: flex;
  }

  .result-tabbar {
    height: auto;
    gap: 6px;
    padding: 8px 12px;
    background: var(--weiss);
    box-shadow: inset 0 -1px 0 #f0f0ee;
  }

  .result-tabs {
    align-items: center;
    gap: 6px;
  }

  .result-tab {
    flex: none;
    min-height: 36px;
    margin-bottom: 0;
    background: #f3f4f6;
    border-radius: 999px;
    color: #4b5563;
    font-size: 12px;
  }

  .result-tab.is-active {
    background: #e0f2fe;
    border: 0;
    color: #075985;
  }

  .result-tab > [data-tab-select] {
    gap: 4px;
    padding: 4px 2px 4px 12px;
  }

  /* „1 · Titel“ wie im Entwurf statt der Nummer im Kaestchen */
  .result-tab__no,
  .result-tab.is-active .result-tab__no {
    display: inline;
    width: auto;
    height: auto;
    background: none;
    border-radius: 0;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
  }

  .result-tab__no::after {
    content: " ·";
    white-space: pre;
  }

  .result-tab > [data-tab-close],
  .result-tab.is-active > [data-tab-close] {
    width: 14px;
    height: 14px;
    margin: 0 12px 0 4px;
    padding: 0;
    background: none;
    color: #9ca3af;
  }

  .result-tab > [data-tab-close]::after {
    inset: -11px -8px;
  }

  .analysis__results .result__head {
    padding: 10px 12px 0;
  }

  .analysis__results .result__tools {
    padding: 8px 12px;
  }

  .analysis__results .result > :not(.result__head, .result__tools, dialog) {
    margin-right: 12px;
    margin-left: 12px;
  }

  .analysis__results .segmented__button,
  .site-main > .result .segmented__button {
    min-height: 36px;
  }

  .result__tool-buttons {
    flex-wrap: nowrap;
    gap: 2px;
  }

  /* Symbolknopf (Entwurf .ibtn, 28 px; hier 40 px zum Tippen) */
  .tb,
  .tb--primary {
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 8px;
    color: #6b7280;
  }

  .tb:hover,
  .tb--primary:hover {
    background: #ebebe7;
    color: var(--grau-900);
  }

  .tb .icon {
    width: 16px;
    height: 16px;
  }

  .tb__text {
    display: none;
  }
}

/* ---------- Fenster (Entwurf „Vorschau der Markierungen“: .dim, .pv, .mh, .mb, .mf, .b2) ---------- */

html.dialog-open {
  overflow: hidden; /* die Seite dahinter scrollt nicht */
}

.dialog {
  display: none; /* geschlossen: nichts zeigen; offen: Spalte aus Kopf, Koerper und Fuss */
  flex-direction: column;
  width: 640px;
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  background: var(--weiss);
  color: var(--grau-900);
  font-family: var(--schrift);
  font-size: 13px;
  line-height: 1.45;
  text-align: left;
  border: 0;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgb(15 23 42 / 0.35);
}

.dialog[open] {
  display: flex;
  position: fixed; /* mittig in Fenster: ausdruecklich, nicht nur ueber die Browser-Vorgabe fuer :modal */
  inset: 0;
  height: fit-content;
  margin: auto;
}

.dialog:focus {
  outline: none; /* Anfangsfokus liegt auf dem Fenster selbst (autofocus), nicht auf dem ✕ */
}

.dialog::backdrop {
  background: rgb(15 23 42 / 0.4);
}

.dialog__head {
  display: flex;
  flex: none;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid #eef0f4;
}

.dialog__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  background: var(--blau-tint);
  color: var(--blau-nacht);
  border-radius: 9px;
}

.dialog__heading {
  min-width: 0;
}

.dialog__heading h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: normal;
}

.dialog__heading p {
  margin: 0;
  color: var(--grau-500);
  font-size: 11.5px;
  line-height: 18.85px;
  overflow-wrap: anywhere;
}

.dialog__close {
  display: grid;
  flex: none;
  place-items: center;
  width: 24px;
  height: 24px;
  margin: -4px -4px 0 auto; /* das Symbol (16 px) sitzt wie im Entwurf; die Tippflaeche ist 24 px */
  padding: 0;
  background: none;
  color: var(--grau-500);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.dialog__close:hover {
  background: var(--grau-100);
  color: var(--grau-900);
}

.dialog__form {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  margin: 0;
}

.dialog__body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 14px 16px;
  overflow: auto;
}

.dialog__foot {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  background: #fafbfc;
  border-top: 1px solid #eef0f4;
}

.dialog__status {
  margin-right: auto;
  color: var(--rot-dunkel);
  font-size: 12px;
}

.dialog__button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--weiss);
  color: var(--grau-900);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.45;
  border: 1px solid var(--grau-300);
  border-radius: 8px;
  cursor: pointer;
}

.dialog__button:hover {
  background: var(--blau-hauch);
}

.dialog__button--primary {
  background: var(--blau-dunkel);
  color: var(--weiss);
  font-weight: 600;
  border-color: var(--blau-dunkel);
}

.dialog__button--primary:hover {
  background: var(--blau-nacht);
}

.dialog__sql {
  margin: 0;
  padding: 12px;
  overflow: auto;
  background: var(--grau-100);
  font-size: 0.8125rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border-radius: var(--radius-control);
}

/* Formular im Fenster: eine Spalte, auch auf breiten Bildschirmen. Die dichten Masse ab 1024 px (Felder, Beschriftungen, Kontrollkaestchen)
   stehen im Abschnitt „Dichte Schrift ab 1024 px“ am Ende dieser Datei und gelten fuer Fenster und Seiten gemeinsam. */
.dialog .form-grid {
  grid-template-columns: minmax(0, 1fr);
}

/* Vorschau der Markierungen als Fenster (Entwurf „weitere Punkte“, Abschnitt 2: .pv, .mh .ic, .mb, .txt, .leg, .add, .mf).
   Das Panel fuellt das Fenster als Spalte; nur der Koerper scrollt, Kopf, Fehlermeldung und Knoepfe bleiben stehen.
   Die Markierungen selbst (blau mit ✕, gestrichelte Hinweise) bleiben wie bisher. */
.dialog--preview .preview {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0;
  min-height: 0;
}

.dialog__icon--preview {
  background: #fef3c7;
  color: #92400e;
}

.dialog--preview .preview__title:focus {
  outline: none; /* Anfangsfokus zum Vorlesen, kein Bedienelement */
}

.preview__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dialog--preview .preview__text {
  padding: 12px 14px;
  background: #f9fafb;
  border: 0;
  border-radius: 9px;
  font-size: 14px;
  line-height: 1.7;
}

.dialog--preview .preview__legend {
  gap: 4px;
  color: var(--grau-700);
  font-size: 12px;
}

.dialog--preview .preview__legend-value {
  font-weight: 400;
}

.dialog--preview .preview__note {
  color: var(--grau-500);
}

.dialog--preview .preview__none,
.dialog--preview .preview__status {
  font-size: 12px;
}

/* leere Statuszeile (aria-live, bleibt im Baum): kein zusaetzlicher Abstand unter „Markieren“ */
.dialog--preview .preview__status:empty {
  margin-top: -12px;
}

.dialog--preview .preview__report-title {
  font-size: 13px;
}

/* Hinweis unter der (verborgenen) Eingabe: bei offener Vorschau nicht neben dem Fenster stehen lassen */
.chat-form:has([data-preview-dialog][open]) .chat-form__hint {
  visibility: hidden;
}

.preview__error {
  flex: none;
  margin: 0 16px 12px;
  padding: 8px 12px;
  font-size: 12.5px;
  overflow-wrap: anywhere;
}

/* gesperrt (z. B. „Jetzt senden“ bei mehr als 50 Werten): blass, ohne Hover */
.dialog__button:disabled,
.dialog__button:disabled:hover {
  background: var(--weiss);
  opacity: 0.55;
  cursor: not-allowed;
}

.dialog__button--primary:disabled,
.dialog__button--primary:disabled:hover {
  background: var(--blau-dunkel);
}

/* Bestaetigungsfenster (data-confirm) und Wartefenster (data-ai-busy) in orders.js */
.dialog--confirm {
  width: 440px;
}

.dialog__text {
  margin: 0;
  padding: 14px 16px;
}

.dialog__button--danger {
  background: var(--rot);
  border-color: var(--rot);
}

.dialog__button--danger:hover {
  background: var(--rot-dunkel);
}

.ai-busy {
  padding: 18px 16px;
}

.ai-busy__title {
  margin: 0 0 12px;
  font-weight: 600;
}

/* Unbestimmter Ladebalken: ein Schimmer laeuft von links nach rechts (kein vorgetaeuschter Fortschritt) */
.ai-busy__bar {
  position: relative;
  height: 6px;
  overflow: hidden;
  background: var(--blau-tint);
  border-radius: 3px;
}

.ai-busy__bar::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 35%;
  background: var(--blau-dunkel);
  border-radius: 3px;
  animation: balken 1.4s ease-in-out infinite;
}

@keyframes balken {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(290%);
  }
}

.ai-busy__hint {
  margin: 12px 0 0;
}

.ai-busy__time {
  margin: 4px 0 0;
  color: var(--grau-500);
  font-variant-numeric: tabular-nums;
}

/* Bei reduzierter Bewegung pulsiert der Balken ruhig, statt zu laufen */
@media (prefers-reduced-motion: reduce) {
  .ai-busy__bar::before {
    width: 100%;
    transform: none;
    animation: puls 2s ease-in-out infinite alternate !important;
    animation-duration: 2s !important;
    animation-iteration-count: infinite !important;
  }
}

@keyframes puls {
  from {
    opacity: 0.35;
  }
  to {
    opacity: 1;
  }
}

/* Unter 768 px fuellen die Fenster fast den ganzen Bildschirm (Spec 6.9) */
@media (max-width: 767.98px) {
  .dialog {
    width: calc(100vw - 16px);
    max-width: none;
    max-height: calc(100dvh - 16px);
  }
}

/* ---------- Dichte Schrift ab 1024 px (Task 16, Abnahme) ---------- */
/* Fenster (.dialog) und alle Seiten ausser Auswertungen (.site-main--full) bekommen dieselben Masse wie die gezeichneten Seiten:
   Grundschrift 13 px, Felder 13 px mit 6/10 px Polster, Beschriftungen 12 px, Hinweise 12 px, Knoepfe 12,5 px (siehe oben).
   :where() haelt die Spezifitaet bei null: Regeln einzelner Bausteine (Chat-Eingabe, Auswahl, Ergebnisse) bleiben massgeblich.
   Unter 1024 px gilt nichts davon: Touch-Flaechen (--tippflaeche) und 16 px in Eingabefeldern (kein Zoom von iOS) bleiben. */

@media (min-width: 1024px) {
  :where(.site-main:not(.site-main--full)) {
    font-size: 13px;
  }

  :where(.site-main:not(.site-main--full)) p {
    margin-bottom: 12px;
  }

  :where(.site-main:not(.site-main--full)) p.muted,
  :where(.site-main:not(.site-main--full)) .connection-list__status {
    font-size: 12.5px;
  }

  :where(.site-main:not(.site-main--full)) .panel h2 {
    font-size: 14px;
    margin-bottom: 8px;
  }

  :where(.site-main:not(.site-main--full)) .panel h3 {
    font-size: 13px;
    margin-bottom: 6px;
  }

  :where(.site-main:not(.site-main--full)) .panel {
    padding: 14px 16px;
    border-radius: var(--radius-karte);
  }

  :where(.site-main:not(.site-main--full)) .panel {
    margin-bottom: 16px;
  }

  :where(.site-main:not(.site-main--full)) .flash {
    padding: 8px 12px;
  }

  :where(.site-main:not(.site-main--full), .dialog) .form-grid {
    gap: 12px 20px;
  }

  :where(.site-main:not(.site-main--full), .dialog) .field {
    gap: 4px;
  }

  /* Formulare ohne Raster (Startseite): Abstand zwischen den Feldern wie im Raster */
  :where(.site-main:not(.site-main--full)) form:not(.form-grid) > .field + .field {
    margin-top: 12px;
  }

  :where(.site-main:not(.site-main--full), .dialog) .field > label,
  :where(.site-main:not(.site-main--full), .dialog) .field__head > label,
  :where(.site-main:not(.site-main--full)) .field__label,
  :where(.site-main:not(.site-main--full)) legend {
    font-size: 12px;
  }

  :where(.site-main:not(.site-main--full)) legend {
    margin-bottom: 4px;
  }

  :where(.site-main:not(.site-main--full)) .field .field__hint,
  :where(.site-main:not(.site-main--full)) .field .field__error,
  :where(.site-main:not(.site-main--full)) .panel .field__hint {
    font-size: 12px;
  }

  :where(.site-main:not(.site-main--full)) .panel:not(.error-page) > h1 {
    margin-bottom: 10px;
  }

  :where(.site-main:not(.site-main--full)) .panel > .field__hint {
    margin-bottom: 12px;
  }

  :where(.site-main:not(.site-main--full), .dialog) :is(input:where([type="text"], [type="date"], [type="password"], [type="email"], [type="number"], [type="search"], [type="url"], [type="tel"]), select, textarea) {
    min-height: 0;
    padding: 6px 10px;
    font-size: 13px;
    line-height: 1.45;
  }

  :where(.site-main:not(.site-main--full), .dialog) textarea {
    min-height: 4.5rem;
  }

  :where(.site-main:not(.site-main--full)) input[type="file"] {
    font-size: 12.5px;
  }

  :where(.site-main:not(.site-main--full)) input[type="file"]::file-selector-button {
    margin-right: 10px;
    padding: 4px 10px;
    background: var(--weiss);
    color: var(--grau-700);
    font: inherit;
    border: 1px solid var(--grau-300);
    border-radius: var(--radius-control);
    cursor: pointer;
  }

  /* im Fenster bleibt der Rand auch im Fokus grau (der blaue Ring genuegt, so ist das Fenster gezeichnet) */
  .dialog input:where([type="text"]),
  .dialog textarea {
    border-color: var(--grau-300);
  }

  :where(.site-main:not(.site-main--full)) .code-input {
    font-size: 12.5px;
  }

  :where(.site-main:not(.site-main--full), .dialog) .check {
    gap: 8px;
    min-height: 0;
    font-size: 12.5px;
  }

  :where(.site-main:not(.site-main--full)) .check {
    padding-block: 3px;
  }

  /* Kontrollkaestchen mit Beschriftung im Feld: Schrift wie die uebrigen Kontrollkaestchen, nicht wie eine Feldbeschriftung (im Fenster bleibt es bei 12 px wie gezeichnet) */
  :where(.site-main:not(.site-main--full)) .field > label.check {
    font-size: 12.5px;
  }

  :where(.site-main:not(.site-main--full), .dialog) .check input {
    width: 16px;
    height: 16px;
  }

  :where(.site-main:not(.site-main--full)) .danger-zone > summary,
  :where(.site-main:not(.site-main--full)) .chat-audit__details > summary {
    min-height: 0;
    padding-block: 4px;
    font-size: 12.5px;
  }

  :where(.site-main:not(.site-main--full)) .connection-list__item {
    padding: 8px 12px;
  }

  :where(.site-main:not(.site-main--full)) .error-page__status {
    font-size: 11.5px;
  }

  :where(.site-main:not(.site-main--full)) .test-result {
    margin-top: 8px;
  }
}

/* ---------- Aktualisierung ---------- */

.update-release {
  margin: 0 0 16px;
  padding-top: 12px;
  border-top: 1px solid var(--grau-100);
}

.update-release__title {
  margin: 0 0 6px;
  font-size: 1rem;
}

.update-release__notes {
  margin: 0 0 8px;
  padding-left: 20px;
}

.update-release p {
  margin: 0 0 6px;
}

.update__checks {
  margin-top: 12px;
}

.update__bar {
  display: block;
  width: 100%;
  height: 10px;
  accent-color: var(--blau-dunkel);
}

.update__phase {
  margin: 4px 0 8px;
  color: var(--grau-700);
  font-variant-numeric: tabular-nums;
}

.update__message {
  margin: 8px 0;
  overflow-wrap: anywhere;
}

.update__log {
  max-height: 22rem;
  margin: 8px 0 0;
  padding: 10px 12px;
  overflow: auto;
  background: var(--grau-50);
  border: 1px solid var(--grau-200);
  border-radius: var(--radius-control);
  font-size: 0.8125rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.update [hidden] {
  display: none;
}
