/*
 * Gestaltung der Zentrale nach den Apple Human Interface Guidelines.
 * Regeln und Quellen: docs/GESTALTUNG.md.
 *
 * Farben sind semantisch. In Safari auf dem Mac kommen sie aus dem System
 * (Akzentfarbe, Text, Trennlinien, Auswahl) und folgen damit den Einstellungen
 * für Akzentfarbe, Erscheinungsbild und erhöhten Kontrast. Andere Browser
 * bekommen gleichwertige Ersatzwerte.
 */

/* --- Farben -------------------------------------------------------------- */

:root {
  color-scheme: light dark;
  --text: #1d1d1f;
  --text-2: #5e5e63;
  --text-3: #86868b;
  --akzent: #0064d2;
  --akzent-text: #ffffff;
  --inhalt: #ffffff;
  --fenster: #f2f2f4;
  --leiste: rgb(242 242 244 / 0.82);
  --linie: rgb(0 0 0 / 0.12);
  --gitter: rgb(0 0 0 / 0.08);
  --streifen: rgb(0 0 0 / 0.028);
  --auswahl: rgb(0 100 210 / 0.14);
  --kopftext: #5e5e63;
  --rot: #c7251a;
  --orange: #a15c00;
  --gruen: #1d7a34;
  --warnung-grund: rgb(255 159 10 / 0.14);
  --hinweis-grund: rgb(0 122 255 / 0.10);
  --schatten: 0 1px 2px rgb(0 0 0 / 0.12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #f5f5f7;
    --text-2: #aeaeb2;
    --text-3: #8e8e93;
    --akzent: #3d9bff;
    --akzent-text: #000000;
    --inhalt: #1e1e1f;
    --fenster: #161617;
    --leiste: rgb(38 38 40 / 0.78);
    --linie: rgb(255 255 255 / 0.14);
    --gitter: rgb(255 255 255 / 0.08);
    --streifen: rgb(255 255 255 / 0.035);
    --auswahl: rgb(61 155 255 / 0.22);
    --kopftext: #aeaeb2;
    --rot: #ff6961;
    --orange: #ffb340;
    --gruen: #4cd964;
    --warnung-grund: rgb(255 159 10 / 0.18);
    --hinweis-grund: rgb(10 132 255 / 0.18);
    --schatten: 0 1px 2px rgb(0 0 0 / 0.5);
  }
}

/* Standard-Systemfarbe für die Akzentfarbe (CSS Color 4), wo verfügbar. */
@supports (color: AccentColor) {
  :root { --akzent: AccentColor; --akzent-text: AccentColorText; }
}

/* Safari auf dem Mac: dynamische Systemfarben von macOS. */
@supports (color: -apple-system-label) {
  :root {
    --text: -apple-system-label;
    --text-2: -apple-system-secondary-label;
    --text-3: -apple-system-tertiary-label;
    --akzent: -apple-system-control-accent;
    --akzent-text: #ffffff;
    --inhalt: -apple-system-control-background;
    --linie: -apple-system-separator;
    --gitter: -apple-system-grid;
    --auswahl: -apple-system-unemphasized-selected-content-background;
    --kopftext: -apple-system-header-text;
    --rot: -apple-system-red;
    --orange: -apple-system-orange;
    --gruen: -apple-system-green;
  }
}

@media (prefers-contrast: more) {
  :root { --text-2: var(--text); --linie: var(--text); --gitter: var(--text-2); --leiste: var(--fenster); }
}

/* --- Schrift: Verhältnisse der macOS-Textstile, relativ zur Browsereinstellung --- */

:root {
  --schrift-gross: 1.75rem;   /* Large Title */
  --schrift-titel: 1.25rem;   /* Title 2, fett */
  --schrift-titel-3: 1.0625rem; /* Title 3 */
  --schrift-text: 0.875rem;   /* Body */
  --schrift-klein: 0.8125rem; /* Callout */
  --schrift-fuss: 0.75rem;    /* Subheadline, Untergrenze */
  --abstand: 0.5rem;          /* 8-Punkt-Raster */
}

* { box-sizing: border-box; }
html { font-family: system-ui, sans-serif; font-size: 100%; line-height: 1.45; color: var(--text); background: var(--fenster); -webkit-font-smoothing: antialiased; }
body { margin: 0; font-size: var(--schrift-text); }
h1 { font-size: var(--schrift-titel); font-weight: 700; margin: 0; }
h2 { font-size: var(--schrift-titel-3); font-weight: 600; margin: 0 0 var(--abstand); }
a { color: var(--akzent); }
input, select, button { font: inherit; accent-color: var(--akzent); }

.text-2 { color: var(--text-2); }
.technisch { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.95em; overflow-wrap: anywhere; }
.nur-screenreader { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.js .nur-ohne-js { display: none; }
[hidden] { display: none !important; }

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

.sprunglink { position: absolute; left: var(--abstand); top: -100px; padding: var(--abstand) calc(var(--abstand) * 2); background: var(--inhalt); color: var(--text); z-index: 20; border-radius: 8px; }
.sprunglink:focus { top: var(--abstand); }

/* --- Fenster: Seitenleiste | Werkzeugleiste und Inhalt ------------------------ */

.fenster { display: grid; grid-template-columns: 15rem 1fr; min-height: 100vh; }
.fenster:not(:has(.seitenleiste)) { grid-template-columns: 1fr; }
.ohne-seitenleiste .fenster { grid-template-columns: 1fr; }
.ohne-seitenleiste .seitenleiste { display: none; }

/* Bedienebene (Seitenleiste, Werkzeugleiste): durchscheinend; Inhalt nie. */
.seitenleiste, .werkzeugleiste { background: var(--leiste); }
@supports (backdrop-filter: blur(1px)) {
  .seitenleiste, .werkzeugleiste { backdrop-filter: saturate(180%) blur(24px); }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .seitenleiste, .werkzeugleiste { background: var(--fenster); backdrop-filter: none; }
}

.seitenleiste { position: sticky; top: 0; height: 100vh; overflow-y: auto; border-right: 1px solid var(--linie); padding: calc(var(--abstand) * 2) var(--abstand); }
.seitenleiste-kopf { padding: 0 var(--abstand) calc(var(--abstand) * 1.5); border-bottom: 1px solid var(--linie); }
.marke { display: block; font-weight: 700; margin-bottom: calc(var(--abstand) / 2); }
.konto { display: flex; align-items: center; justify-content: space-between; gap: var(--abstand); color: var(--text-2); font-size: var(--schrift-klein); }
.konto form { margin: 0; }
/* Abschnitte der Seitenleiste mit kurzer Überschrift, wie im Finder (HIG, Sidebars):
   „Mandant“ für alles, was vom Wechsler abhängt, „Betrieb“ für Übergreifendes. */
.bereich { padding: calc(var(--abstand) * 1.5) 0; }
.bereich + .bereich { border-top: 1px solid var(--linie); }
.bereich-titel { display: block; margin: 0 0 calc(var(--abstand) / 2); padding: 0 calc(var(--abstand) * 1.5); font-size: var(--schrift-fuss); font-weight: 600; color: var(--text-2); }
.mandant-name { margin: 0 0 var(--abstand); padding: 0 calc(var(--abstand) * 1.5); font-weight: 600; }
.wechsler { margin: 0 0 var(--abstand); }
.wechsler-zeile { display: flex; gap: var(--abstand); padding: 0 var(--abstand); }
.wechsler select { flex: 1; min-width: 0; }

.navigation, .navigation ul { list-style: none; margin: 0; padding: 0; }
.navigation a, .navigation summary { display: flex; align-items: center; min-height: 2.75rem; padding: 0 calc(var(--abstand) * 1.5); border-radius: 8px; color: var(--text); text-decoration: none; }
.navigation a:hover, .navigation summary:hover { background: var(--gitter); }
/* Aktuelle Seite dauerhaft hervorgehoben (HIG, Split views). */
.navigation a[aria-current="page"] { background: var(--auswahl); font-weight: 600; }
.navigation summary { cursor: pointer; list-style: none; font-weight: 600; color: var(--text-2); font-size: var(--schrift-klein); }
.navigation summary::-webkit-details-marker { display: none; }
/* Dreieck zeigt nach innen, wenn zu; nach unten, wenn offen (HIG, Disclosure controls). */
.navigation summary::before { content: "▸"; display: inline-block; width: 1.1em; color: var(--text-3); }
.navigation details[open] > summary::before { content: "▾"; }
.navigation details ul { padding-left: var(--abstand); }

.arbeitsbereich { min-width: 0; display: flex; flex-direction: column; }
.werkzeugleiste { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: calc(var(--abstand) * 1.5); min-height: 3.25rem; padding: var(--abstand) calc(var(--abstand) * 3); border-bottom: 1px solid var(--linie); }
.werkzeuge-anfang, .werkzeuge { display: flex; align-items: center; gap: var(--abstand); flex-wrap: wrap; }
.werkzeuge form { margin: 0; display: flex; gap: var(--abstand); align-items: center; }

main { padding: calc(var(--abstand) * 3); width: 100%; max-width: 90rem; }
main:focus { outline: none; }
.einleitung { color: var(--text-2); max-width: 48rem; margin: 0 0 calc(var(--abstand) * 2); }
.fusszeile { color: var(--text-2); font-size: var(--schrift-klein); }
section { margin-top: calc(var(--abstand) * 4); }
section:first-child { margin-top: 0; }

@media (max-width: 45rem) {
  .fenster { grid-template-columns: 1fr; }
  .seitenleiste { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--linie); }
  .navigation { display: flex; flex-wrap: wrap; gap: 2px; }
  main, .werkzeugleiste, .meldungen { padding-left: calc(var(--abstand) * 2); padding-right: calc(var(--abstand) * 2); }
}

/* --- Bedienelemente ------------------------------------------------------- */

/* Klickfläche mindestens 44 px (HIG, Buttons; WCAG 2.2). */
.knopf { display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; min-width: 2.75rem; padding: 0 calc(var(--abstand) * 2); border-radius: 8px; border: 1px solid var(--linie); background: var(--inhalt); color: var(--text); font-weight: 500; text-decoration: none; cursor: pointer; box-shadow: var(--schatten); white-space: nowrap; }
.knopf:hover { background: color-mix(in srgb, var(--inhalt) 92%, var(--text)); }
/* Gedrückter Zustand (HIG: jeder eigene Knopf braucht einen). */
.knopf:active { background: color-mix(in srgb, var(--inhalt) 82%, var(--text)); box-shadow: none; }
/* Hauptaktion: höchstens eine pro Ansicht, in Akzentfarbe. */
.knopf-haupt { background: var(--akzent); color: var(--akzent-text); border-color: transparent; font-weight: 600; }
.knopf-haupt:hover { background: color-mix(in srgb, var(--akzent) 88%, #000); }
.knopf-haupt:active { background: color-mix(in srgb, var(--akzent) 75%, #000); }
.knopf[disabled] { opacity: 0.45; cursor: default; box-shadow: none; }
.knopf-text { min-height: 2.75rem; padding: 0 var(--abstand); border: none; background: none; color: var(--akzent); cursor: pointer; }
.knopf-text:active { opacity: 0.6; }
.knopf-symbol { display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; border: none; border-radius: 8px; background: none; color: var(--text-2); cursor: pointer; }
.knopf-symbol:hover { background: var(--gitter); }
.knopf-symbol:active { background: var(--linie); }

select, input[type="text"], input[type="search"], input[type="email"], input[type="number"] {
  min-height: 2.75rem; padding: 0 var(--abstand); color: var(--text); background: var(--inhalt);
  border: 1px solid var(--linie); border-radius: 8px;
}
/* Einheitliche Höhe mit Knöpfen; das Menü selbst bleibt das des Systems. */
select { appearance: none; -webkit-appearance: none; padding-right: 2rem; background: var(--inhalt) url("pfeil.45baa7a4263d.svg") no-repeat right 0.625rem center / 0.625rem; box-shadow: var(--schatten); }
input[type="search"] { width: 17rem; }
input[type="checkbox"], input[type="radio"] { width: 1.25rem; height: 1.25rem; }
textarea {
  width: 100%; min-height: 8rem; padding: var(--abstand); color: var(--text); background: var(--inhalt);
  border: 1px solid var(--linie); border-radius: 8px; font: inherit; font-family: ui-monospace, monospace; resize: vertical;
}
input[type="file"] { min-height: 2.75rem; font: inherit; }

.aktionen { display: flex; flex-wrap: wrap; gap: var(--abstand); margin-top: calc(var(--abstand) * 2); }
/* Abbrechen links, Aktion rechts (HIG, Alerts). */
.aktionen-dialog { justify-content: flex-end; }

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

.tabelle { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--inhalt); border: 1px solid var(--linie); border-radius: 10px; overflow: hidden; }
.tabelle th, .tabelle td { text-align: left; padding: calc(var(--abstand) * 1.25) calc(var(--abstand) * 1.5); vertical-align: middle; border-bottom: 1px solid var(--gitter); }
.tabelle tbody tr:last-child > * { border-bottom: none; }
.tabelle thead th { font-size: var(--schrift-klein); font-weight: 600; color: var(--kopftext); background: var(--inhalt); border-bottom: 1px solid var(--linie); white-space: nowrap; }
.tabelle tbody th { font-weight: 600; }
/* Abwechselnde Zeilen in mehrspaltigen Tabellen (HIG, Lists and tables). */
.tabelle-streifen tbody tr:nth-child(even) { background: var(--streifen); }
/* Ausgewählte Zeilen bleiben hervorgehoben. */
/* Nur das Auswahlkästchen markiert die Zeile, nicht andere Kästchen wie „Aktiv“ im WatchDog. */
.tabelle tbody tr:has(td.auswahl input[type="checkbox"]:checked) { background: var(--auswahl); }
.tabelle .zahl { text-align: right; font-variant-numeric: tabular-nums; }
.tabelle .auswahl { width: 2.75rem; }
/* Sortieren per Klick auf die Spaltenüberschrift. */
.sortieren { display: inline-flex; align-items: center; gap: 4px; min-height: 2rem; color: inherit; text-decoration: none; }
.sortieren:hover { color: var(--text); }
/* Einträge in Tabellen wie in Mac-Tabellen: nicht unterstrichen, erst beim Zeigen. */
.tabelle td a, .tabelle th a:not(.sortieren) { text-decoration: none; font-weight: 500; }
.tabelle td a:hover { text-decoration: underline; }
.sortierpfeil { font-size: 0.7em; color: var(--text-2); min-width: 0.8em; }
th[aria-sort] { color: var(--text); }

/* --- Zustände: immer Text, Farbe nur zusätzlich ------------------------------- */

.markierung, .status-marke { display: inline-block; padding: 1px var(--abstand); border-radius: 6px; font-size: var(--schrift-klein); font-weight: 500; white-space: nowrap; }
.markierung-warnung, .wert-hinweis { color: var(--orange); background: var(--warnung-grund); }
.wert-schlecht, .markierung-kritisch { color: var(--rot); background: color-mix(in srgb, var(--rot) 15%, transparent); }
.markierung-hinweis { color: var(--akzent); background: var(--hinweis-grund); }
.status-marke { background: var(--gitter); color: var(--text); }
/* Wertung in Karten: gut grün, schlecht rot, Hinweis orange (Text sagt es auch ohne Farbe). */
.wert-gut, .status-active, .zustand-erledigt { color: var(--gruen); background: color-mix(in srgb, var(--gruen) 14%, transparent); }
.status-pending { color: var(--akzent); background: var(--hinweis-grund); }
/* Priorität eines Tickets: niedrig grau (Grundform), normal blau, hoch orange, kritisch rot. */
.schwere-info { color: var(--text-2); }
.schwere-warnung, .zustand-bestaetigt { color: var(--akzent); background: var(--hinweis-grund); }
.schwere-hoch, .zustand-wartet { color: var(--orange); background: var(--warnung-grund); }
.schwere-kritisch { color: var(--rot); background: color-mix(in srgb, var(--rot) 12%, transparent); }
/* Zähler in der Seitenleiste wie in Mail: rechts, zurückhaltend, Zahl statt Farbe allein. */
.zaehler { float: right; min-width: 1.5em; padding: 0 6px; border-radius: 999px; text-align: center; font-size: var(--schrift-klein); font-weight: 600; color: var(--text-2); background: var(--gitter); }
.status-quarantined, .status-rejected { color: var(--rot); background: color-mix(in srgb, var(--rot) 12%, transparent); }
.status-retired, .status-token-abgelaufen, .status-token-widerrufen, .status-token-verbraucht { color: var(--text-2); }

/* --- Inhalte ---------------------------------------------------------------- */

.karte, .dialog { max-width: 36rem; padding: calc(var(--abstand) * 3); background: var(--inhalt); border: 1px solid var(--linie); border-radius: 12px; box-shadow: var(--schatten); }
.karte { margin: calc(var(--abstand) * 4) auto; }
.schritte { padding-left: 1.25rem; }
.notizen { list-style: none; padding: 0; }
.notizen li { padding: var(--abstand) 0; border-bottom: 1px solid var(--gitter); }
.notiz { margin: 4px 0 0; white-space: normal; }
.aufklappen { text-decoration: none; }
.aufklappen .dreieck { display: inline-block; width: 1em; color: var(--text-2); }
.tabelle tr.aufgeklappt-kopf td { font-weight: 600; }
.tabelle tr.aufgeklappt > td { padding: 0 0 var(--abstand) 1.75rem; background: var(--inhalt); }
.tabelle tr.aufgeklappt .tabelle { margin: 0; }
.auf-liste { padding: var(--abstand) 0; border-top: 1px solid var(--gitter); }
.auf-liste p { margin: 4px 0; }
.einzelheiten { color: var(--text-2); font-size: var(--schrift-klein); }
.spaltenliste { list-style: none; padding: 0; margin: calc(var(--abstand) * 2) 0; }
.spaltenliste li { display: flex; align-items: center; justify-content: space-between; min-height: 2.75rem; border-bottom: 1px solid var(--gitter); }
.spaltenliste label { display: flex; align-items: center; gap: var(--abstand); flex: 1; min-height: 2.75rem; }
.spaltenknoepfe { display: flex; gap: 4px; }
.spaltenliste .griff { display: none; color: var(--text-2); cursor: grab; padding-right: var(--abstand); }
.js .spaltenliste .griff { display: inline; }
.spaltenliste li.wird-gezogen { opacity: 0.5; }
/* QR-Code immer schwarz auf weiß, auch im dunklen Modus: sonst lesen ihn manche Kameras nicht. */
.qr svg { display: block; border-radius: 8px; }
.dialog ul { padding-left: calc(var(--abstand) * 2.5); }
.dialog-breit { max-width: 52rem; }
.dialog h2 { margin-top: calc(var(--abstand) * 3); }
.dialog > h2:first-child { margin-top: 0; }
.befehl { margin: 0; padding: calc(var(--abstand) * 1.5); background: var(--fenster); border: 1px solid var(--linie); border-radius: 8px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: var(--schrift-klein); white-space: pre-wrap; overflow-wrap: anywhere; }
.aktionen form { margin: 0; }
.leer { max-width: 36rem; margin: calc(var(--abstand) * 6) auto; text-align: center; color: var(--text-2); }
.leer .knopf { margin-top: var(--abstand); }

.angaben { display: grid; grid-template-columns: 11rem 1fr; gap: var(--abstand) calc(var(--abstand) * 3); margin: 0; }
.angaben dt { color: var(--text-2); }
.angaben dd { margin: 0; }

/* Meldungen: fester Platz oben unter der Werkzeugleiste, Farbe nach Dringlichkeit, nie nur Farbe (Text sagt es). */
.meldungen { display: flex; flex-direction: column; gap: var(--abstand); padding: 0 calc(var(--abstand) * 3); width: 100%; max-width: 90rem; box-sizing: border-box; }
.meldungen:has(.meldung) { padding-top: calc(var(--abstand) * 2); }
.meldung { position: relative; margin: 0; padding: 10px 44px 10px 14px; border-radius: 10px; border-left: 4px solid var(--m-farbe);
  background: color-mix(in srgb, var(--m-farbe) 14%, var(--inhalt)); --m-farbe: var(--akzent); }
.meldung-success { --m-farbe: var(--gruen); }
.meldung-info { --m-farbe: var(--akzent); }
.meldung-warning { --m-farbe: var(--orange); }
.meldung-error { --m-farbe: var(--rot); }
.meldung a { color: inherit; text-decoration: underline; }
.meldung-schliessen { position: absolute; top: 0; right: 0; width: 44px; height: 44px; border: 0; background: none;
  color: var(--text-2); font-size: 1.2rem; cursor: pointer; }
.meldung-schliessen:hover { color: var(--text); }
.hinweis-kasten { padding: calc(var(--abstand) * 2); background: var(--warnung-grund); border-radius: 10px; }
.hinweis-erfolg { background: color-mix(in srgb, var(--gruen) 14%, transparent); }
.hinweis-info { background: var(--hinweis-grund); }
.hinweis-kritisch { background: color-mix(in srgb, var(--rot) 12%, transparent); border-left: 4px solid var(--rot); }
.hinweis-kritisch h2 { margin-top: 0; }
.konto a.benutzer { color: var(--text-2); text-decoration: none; }
.konto a.benutzer:hover, .konto a.benutzer[aria-current] { color: var(--text); text-decoration: underline; }
.status { min-height: 1.5em; margin-top: calc(var(--abstand) * 2); }
.status.ist-fehler { color: var(--rot); }
.status.ist-fehler::before { content: "Fehler: "; font-weight: 600; }
.hinweis { color: var(--text-2); }
.feld { margin-bottom: calc(var(--abstand) * 2); }
.feld label { display: block; font-weight: 600; }
.feld input { width: 100%; }

.formular > div { margin-bottom: calc(var(--abstand) * 2); }
.formular label { display: block; font-weight: 600; margin-bottom: 4px; }
.formular .helptext { display: block; color: var(--text-2); font-size: var(--schrift-klein); margin-top: 4px; }
.formular ul { list-style: none; padding: 0; margin: 0; }
.formular ul label { display: flex; align-items: center; gap: var(--abstand); min-height: 2.75rem; font-weight: normal; }
.errorlist { color: var(--rot); padding: 0; list-style: none; margin: 4px 0 0; }
.errorlist li::before { content: "Fehler: "; font-weight: 600; }
.zeilenformular { display: flex; gap: var(--abstand); align-items: center; margin: 0; }

.seiten { display: flex; gap: var(--abstand); margin-top: calc(var(--abstand) * 2); }
.verlauf { padding-left: calc(var(--abstand) * 2.5); }

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

/* Detailseiten: Kopf, Warnleiste, Umschalter, gruppierte Karten wie in den Systemeinstellungen. */
.geraet-kopf { margin-bottom: calc(var(--abstand) * 2); }
.geraet-untertitel { font-size: 1.05rem; margin: 0 0 var(--abstand); }
.geraet-marken { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
.marke-leise { display: inline-block; padding: 1px var(--abstand); border-radius: 6px; font-size: var(--schrift-klein); color: var(--text-2); background: var(--gitter); text-decoration: none; }
a.marke-leise:hover { color: var(--text); }
.warnleiste { list-style: none; margin: 0 0 calc(var(--abstand) * 2); padding: 0; border: 1px solid var(--linie); border-radius: 10px; background: var(--inhalt); }
.warnleiste li { display: flex; gap: var(--abstand); align-items: baseline; padding: 8px 12px; }
.warnleiste li + li { border-top: 1px solid var(--gitter); }
.segmente { display: inline-flex; gap: 2px; padding: 2px; margin-bottom: calc(var(--abstand) * 2); border-radius: 9px; background: var(--gitter); }
.segmente a { display: inline-flex; align-items: center; padding: 0 16px; min-height: 44px; border-radius: 7px; color: var(--text); text-decoration: none; font-size: var(--schrift-klein); font-weight: 500; }
.segmente a[aria-current] { background: var(--inhalt); box-shadow: var(--schatten); }
/* Karten untereinander in einer Spalte, gleicher Abstand. */
.karten { display: flex; flex-direction: column; gap: calc(var(--abstand) * 2); max-width: 48rem; margin-bottom: calc(var(--abstand) * 2); }
.gruppenkarte { border: 1px solid var(--linie); border-radius: 12px; background: var(--inhalt); overflow: hidden; margin-bottom: calc(var(--abstand) * 2); }
.karten .gruppenkarte { margin: 0; }
.gruppenkarte h2 { font-size: var(--schrift-klein); font-weight: 600; color: var(--text-2); margin: 0; padding: 10px 14px 6px; }
.gruppenkarte dl { margin: 0; }
.gruppenkarte dl > div, .kartenzeile { display: flex; justify-content: space-between; gap: calc(var(--abstand) * 2); padding: 9px 14px; border-top: 1px solid var(--gitter); }
.kartenzeile { display: block; }
/* Ungelesene Tickets wie in Mail: fett mit blauem Punkt; der Zähler in der Seitenleiste blau. */
.tabelle tr.ungelesen td { font-weight: 600; }
.punkt-neu { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--akzent); vertical-align: middle; }
.navigation a[href$="/tickets/"] .zaehler, .segmente a[href$="/tickets/"] .zaehler { color: #fff; background: var(--akzent); }
/* Verlauf eines Tickets als Chat: Mac links grün, Antworten der Zentrale rechts blau, interne Notizen und
   Zustände wie ein Aktivitätsprotokoll in der Mitte. */
.chat { list-style: none; margin: 0; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px;
  border-top: 1px solid var(--gitter); }
.chat-zeile { display: flex; }
.chat-links { justify-content: flex-start; }
.chat-rechts { justify-content: flex-end; }
.chat-blase { max-width: 80%; padding: 8px 12px; border-radius: 14px; background: var(--gitter); }
.chat-benutzer { background: color-mix(in srgb, var(--gruen) 22%, var(--inhalt)); }
.chat-links .chat-blase { border-bottom-left-radius: 4px; }
.chat-rechts .chat-blase { border-bottom-right-radius: 4px; }
.chat-an_benutzer { background: color-mix(in srgb, var(--akzent) 22%, var(--inhalt)); }
.chat-ereignis.chat-intern { max-width: 80%; padding: 6px 12px; border: 1px dashed var(--linie); border-radius: 10px; color: var(--text); }
.chat-ereignis .notiz { margin: 4px 0 0; text-align: left; }
.chat-blase p { margin: 0; }
.chat-kopf { font-size: var(--schrift-klein); margin-bottom: 2px !important; }
.chat-zeit { font-size: var(--schrift-fuss, 0.75rem); color: var(--text-2); margin-top: 4px !important; text-align: right; }
.chat-ereignis { align-self: center; text-align: center; font-size: var(--schrift-klein); color: var(--text-2); }
.auswahl-zeile { border: 0; padding: 0; margin: 0 0 calc(var(--abstand) * 1.5); display: flex; flex-wrap: wrap; gap: calc(var(--abstand) * 3); }
.auswahl-zeile label { display: flex; align-items: center; gap: 6px; font-weight: normal; min-height: 2.75rem; }
.gruppenkarte dt { color: var(--text-2); }
.gruppenkarte dd { margin: 0; text-align: right; }
.gruppenkarte meter { width: 6rem; vertical-align: middle; }
.karten-breit { max-width: none; }
.kartenteil { margin: 0; padding: 12px 14px; border-top: 1px solid var(--gitter); }
.kartenteil > :first-child { margin-top: 0; }
.kartenteil > :last-child { margin-bottom: 0; }
.gruppenkarte > div > .tabelle, .gruppenkarte > .tabelle { border: 0; border-radius: 0; margin: 0; border-top: 1px solid var(--gitter); }
/* Formularfelder nebeneinander; Erklärtext steht über dem Feld, damit Felder und Knopf unten bündig sind. */
textarea { font: inherit; }
.formular textarea, .formular input.breit { width: 100%; box-sizing: border-box; }
.formular-zeile { display: flex; flex-wrap: wrap; gap: calc(var(--abstand) * 2); align-items: flex-end; }
.formular-zeile > div { margin-bottom: 0; }
.formular-zeile .helptext { margin: 0 0 4px; }
.aufklappkarte summary { padding: 10px 14px; cursor: pointer; font-weight: 500; }
.aufklappkarte .tabelle { border: 0; border-radius: 0; margin: 0; }
.schalter { position: relative; width: 2.6rem; height: 1.5rem; padding: 0; border-radius: 999px; border: 0; background: var(--linie); cursor: pointer; vertical-align: middle; }
.schalter span { position: absolute; top: 2px; left: 2px; width: calc(1.5rem - 4px); height: calc(1.5rem - 4px); border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 0.3); transition: left 0.15s; }
.schalter::after { content: ""; position: absolute; inset: -10px; }  /* Klickfläche 44 px */
.schalter[aria-checked="true"] { background: var(--gruen); }
.schalter[aria-checked="true"] span { left: calc(100% - 1.5rem + 2px); }
.segmente a[aria-current] { font-weight: 600; }
.segmente .zaehler { float: none; margin-left: 6px; }
.segmente + section, .segmente + .dialog { margin-top: 0; }

/* Screenshots zu Tickets vom Mac: Vorschau, Klick öffnet das Original. */
.bilder { list-style: none; margin: 0.75rem 0 0; padding: 0; display: grid; gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); }
.bilder li { display: flex; flex-direction: column; gap: 0.25rem; }
.bilder img { width: 100%; height: auto; max-height: 14rem; object-fit: contain; border-radius: 8px;
  border: 1px solid var(--linie); background: var(--fenster); }
.unterueberschrift { font-size: 1rem; margin: 1rem 0 0; }
