
  :root {
    color-scheme: light dark;
    --brand-primary: var(--petrol);
    --brand-accent: var(--petrol-strong);
    --brand-ink: var(--ink);
    --brand-muted: var(--ink-muted);
    --brand-bg: var(--surface);
    --status-gruen: var(--ok);
    --status-gelb: var(--warn);
    --status-rot: var(--alert);
  }
  body { background: var(--brand-bg); font-family: var(--font-sans); }
  /* E-274 Nachtrag: Links und Knöpfe ohne eigene Gestaltung nehmen CI-Farben statt Browser-Blau bzw. -Schwarz -
     sonst im Dunkelmodus kaum lesbar */
  a:not([class]), a:not([class]):visited { color: var(--petrol); }
  button:not([class]) { color: var(--ink); }
  h1, h2, h3 { font-family: var(--font-display); }
  .brand { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1.5rem; }
  .brand-logo { display: block; height: 26px; width: auto; }
  /* E-274: Dunkelmodus (Graphit) nach Systemeinstellung - im Dunkeln die helle Wortmarke */
  .logo-dunkel { display: none !important; }
  @media (prefers-color-scheme: dark) { .logo-hell { display: none !important; } .logo-dunkel { display: block !important; } }
  .karte {
    background: var(--surface-raised); border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow-card);
    scroll-margin-top: 96px;
  }

  /* E-088: Seitenrahmen wie bei Buchungsseiten (DB, Flix): Kopfleiste ueber die
     volle Breite, Inhalt in einer mittigen Spalte bis 1200 px. Elemente mit
     .vollbreit (z. B. die Suchflaeche der Uebersicht) laufen randlos durch.
     "html body" statt "body", weil einige Seiten ihre alte 640-px-Regel erst
     nach diesem Block setzen. */
  html body:has(> .kopfleiste) {
    max-width: none; margin: 0; padding: 0 0 var(--space-12);
    display: grid; align-content: start;
    grid-template-columns: [voll-start] minmax(var(--space-4), 1fr) [inhalt-start] minmax(0, 1200px)
      [inhalt-end] minmax(var(--space-4), 1fr) [voll-end];
  }
  body:has(> .kopfleiste) > * { grid-column: inhalt; min-width: 0; }
  body:has(> .kopfleiste) > .brand { display: none; }
  body:has(> .kopfleiste) > .kopfleiste, body:has(> .kopfleiste) > .vollbreit { grid-column: voll; }
  body:has(> .kopfleiste) > h1 { margin-top: 0; }
  .kopfleiste {
    position: sticky; top: 0; z-index: 50; margin-bottom: var(--space-8);
    background: var(--surface-raised); box-shadow: var(--shadow-card);
  }
  .kopfleiste-innen {
    max-width: 1200px; margin: 0 auto; padding: 0 var(--space-4);
    display: flex; flex-wrap: wrap; align-items: stretch; gap: 0 var(--space-6); min-height: 64px;
  }
  .kopf-logo { display: flex; align-items: center; }
  .kopf-logo img { display: block; height: 26px; width: auto; }
  .hauptnav { display: flex; align-items: stretch; gap: var(--space-1); margin: 0; }
  .hauptnav > a, .nav-menue > summary {
    display: flex; align-items: center; gap: var(--space-1); min-height: 44px; padding: 0 var(--space-3);
    font-size: 0.92rem; font-weight: 600; color: var(--ink-muted); text-decoration: none; cursor: pointer;
    border-bottom: 3px solid transparent; list-style: none; white-space: nowrap;
  }
  .nav-menue > summary::-webkit-details-marker { display: none; }
  .hauptnav > a:hover, .nav-menue > summary:hover { color: var(--ink); }
  .hauptnav > a.aktiv, .nav-menue.aktiv > summary { color: var(--petrol); border-bottom-color: var(--petrol); }
  .nav-menue { position: relative; display: flex; }
  .nav-menue > summary::after { content: "▾"; font-size: 0.75rem; }
  .nav-menue-liste {
    position: absolute; top: 100%; left: 0; min-width: 14rem; padding: var(--space-2) 0;
    background: var(--surface-raised); border-radius: var(--radius-md); box-shadow: var(--shadow-pop);
  }
  .nav-menue-liste a {
    display: flex; align-items: center; min-height: 44px; padding: 0 var(--space-4);
    color: var(--ink); text-decoration: none; font-size: 0.92rem;
  }
  .nav-menue-liste a:hover { background: var(--petrol-soft); }
  .nav-menue-liste a.aktiv { color: var(--petrol); font-weight: 700; }
  .nav-konto {
    margin-left: auto; display: flex; align-items: center; gap: var(--space-2);
    font-size: 0.875rem; color: var(--ink-muted);
  }
  .nav-konto a { color: var(--petrol); font-weight: 600; text-decoration: none; }
  @media (min-width: 56.25em) {
    html body:has(> .kopfleiste) {
      grid-template-columns: [voll-start] minmax(var(--space-8), 1fr) [inhalt-start] minmax(0, 1200px)
        [inhalt-end] minmax(var(--space-8), 1fr) [voll-end];
    }
    .kopfleiste-innen { padding: 0 var(--space-8); }
  }
  .konto-menue { position: relative; }
  .konto-menue > summary {
    display: flex; align-items: center; gap: var(--space-1); min-height: 44px; padding: 0 var(--space-2);
    color: var(--petrol); font-weight: 600; cursor: pointer; list-style: none; border-radius: var(--radius-sm);
  }
  .konto-menue > summary::-webkit-details-marker { display: none; }
  .konto-menue > summary::after { content: "▾"; font-size: 0.75rem; }
  .konto-menue > summary:hover { background: var(--petrol-soft); }
  .konto-menue-liste {
    position: absolute; top: 100%; right: 0; min-width: 15rem; padding: var(--space-2) 0; z-index: 60;
    background: var(--surface-raised); border-radius: var(--radius-md); box-shadow: var(--shadow-pop);
  }
  .konto-menue-liste a {
    display: flex; align-items: center; min-height: 44px; padding: 0 var(--space-4);
    color: var(--ink); font-weight: 400; text-decoration: none; font-size: 0.92rem;
  }
  .konto-menue-liste a:hover { background: var(--petrol-soft); }
  .konto-menue-liste a.abmelden { color: var(--alert); border-top: 1px solid var(--line); margin-top: var(--space-1); }
  .konto-info { padding: var(--space-1) var(--space-4) var(--space-2); font-size: 0.875rem; color: var(--ink-muted); }
  .konto-trenner { border-top: 1px solid var(--line); margin-top: var(--space-1); padding-top: var(--space-2); }
  /* E-107: Hinweisband der Entwickler-Ansicht */
  .ansicht-band {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--space-2) var(--space-4);
    padding: var(--space-2) var(--space-4); background: var(--lime); color: var(--on-lime); font-size: 0.9rem;
    font-weight: 600;
  }
  .ansicht-band button {
    min-height: 44px; padding: 0 var(--space-4); border: none; border-radius: var(--radius-pill); background: var(--nacht);
    color: var(--on-nacht); font: inherit; font-weight: 700; cursor: pointer;
  }
  .zurueck-link {
    justify-self: start; display: inline-flex; align-items: center; min-height: 44px; margin: calc(-1 * var(--space-4)) 0 var(--space-2);
    color: var(--petrol); font-weight: 600; text-decoration: none; font-size: 0.9rem;
  }
  body:has(> .kopfleiste) > main > .einzelansicht { width: 100%; max-width: 760px; box-sizing: border-box; }  /* E-392: Innenabstand nicht über den Rand */
  .reise-layout { display: grid; gap: var(--space-6); align-items: start; }
  .reise-layout .karte + .karte, .reise-seite > * + * { margin-top: 0; }
  .reise-seite { display: grid; gap: var(--space-6); }
  .reise-seite .kalender-knopf { margin-top: var(--space-2); }
  @media (min-width: 62.5em) {
    body:has(> .kopfleiste) .reise-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 24rem); }
  }
  /* E-088: Formulare in breiten Karten - Felder in Bereichen statt ueber die
     volle Breite gezogen, Knoepfe in normaler Breite. */
  .karten-titel { font-size: 1.1rem; margin: 0 0 var(--space-2); }
  .zweitknopf {
    min-height: 44px; padding: 0 var(--space-6); border: 1px solid var(--line-strong); border-radius: var(--radius-pill);
    background: var(--surface-raised); color: var(--ink); font-weight: 600; font-size: 0.95rem;
    font-family: inherit; cursor: pointer;
  }
  .zweitknopf:hover { background: var(--petrol-soft); }
  /* E-290: Download-Links (Datenexport) im Aussehen der Knöpfe */
  a.zweitknopf, a.hauptknopf { display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
    box-sizing: border-box; }
  a.zweitknopf { color: var(--ink); }
  .zweitknopf[hidden] { display: none; }
  :where(body:has(> .kopfleiste)) .karte + .karte { margin-top: var(--space-6); }
  .abschnitt-titel { font-size: 1.2rem; margin: var(--space-8) 0 var(--space-2); }
  .formular-spalten { display: grid; gap: 0 var(--space-8); }
  .formular-zeile { display: grid; gap: 0 var(--space-4); align-items: end; }
  .formular-aktionen { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-6); }
  html .formular-aktionen button, html .formular-zeile > button,
  .formular-aktionen > #absenden, .formular-aktionen > #abbrechen, .formular-zeile > #absenden {
    width: auto; margin-top: 0; min-height: 44px; padding: 0 var(--space-6);
  }
  @media (min-width: 56.25em) {
    .formular-spalten { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
    .formular-zeile { grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
    .formular-zeile > button { justify-self: start; }
  }
  @media (max-width: 56.1875em) {
    .kopfleiste { margin-bottom: var(--space-6); }
    .kopfleiste-innen { min-height: 0; }
    .kopf-logo { min-height: 52px; }
    .kopf-logo img { height: 22px; }
    /* Menue als eine wischbare Zeile; das Verwaltungsmenue klappt fixiert auf
       und wird deshalb vom Scrollbereich nicht abgeschnitten. */
    .hauptnav {
      order: 3; flex-basis: 100%; overflow-x: auto; scrollbar-width: none;
      margin: 0 calc(-1 * var(--space-4)); padding: 0 var(--space-1);
    }
    .hauptnav::-webkit-scrollbar { display: none; }
    .hauptnav > a, .nav-menue > summary { padding: 0 var(--space-3); font-size: 0.88rem; }
    .nav-konto { min-height: 52px; }
    .nav-konto .nav-name { max-width: 55vw; }
    .konto-menue-liste { position: fixed; left: auto; right: var(--space-4); top: auto; }
    .nav-menue-liste { position: fixed; left: var(--space-4); right: var(--space-4); top: auto; }
  }
  @media print {
    .kopfleiste { position: static; box-shadow: none; }
    .hauptnav, .nav-konto { display: none; }
  }
  /* E-191: Handy - Leiste unten statt Reiter oben (Vorbild DB Navigator) */
  .tab-leiste { display: none; }
  .hauptnav > a .icon { width: 16px; height: 16px; }
  /* E-192: Unterreiter „nach der Reise“ auf allen Größen */
  .unter-reiter { display: inline-grid; grid-auto-flow: column; grid-auto-columns: minmax(8rem, 1fr); gap: 2px; padding: 3px;
    justify-self: start; margin-bottom: var(--space-6); background: var(--surface-sunken); border-radius: var(--radius-md); }
  .unter-reiter a { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 var(--space-4);
    border-radius: var(--radius-lg); color: var(--ink-muted); text-decoration: none; font-size: 0.9rem; font-weight: 600; }
  .unter-reiter a.aktiv { background: var(--surface-raised); color: var(--ink); box-shadow: var(--shadow-card); }
  @media (max-width: 47.5em) {
    html body:has(> .kopfleiste) { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
    .kopfleiste .hauptnav, .kopfleiste .nav-konto a.nav-name { display: none; }
    .kopfleiste { margin-bottom: var(--space-4); }
    select, input, textarea { max-width: 100%; }
    .tab-leiste {
      display: grid; grid-auto-flow: column; grid-auto-columns: minmax(max-content, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
      padding: 6px 4px calc(8px + env(safe-area-inset-bottom)); background: var(--surface-raised);
      border-top: 1px solid var(--line); box-shadow: var(--shadow-card);
    }
    .tab-leiste a { display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 52px;
      color: var(--ink-muted); text-decoration: none; font-size: 0.8125rem; font-weight: 600; }
    .tab-leiste a .icon { width: 24px; height: 24px; }
    .tab-leiste a.aktiv { color: var(--petrol); }
    .unter-reiter { display: grid; grid-auto-columns: 1fr; justify-self: stretch; margin-bottom: var(--space-4); }
    .unter-reiter a { padding: 0; font-size: 0.875rem; }
  }
  /* E-401: !important – die Leiste unten steht weiter unten in einer (max-width)-Regel, die beim Drucken auf A4 (schmaler
     als 64em) sonst gewinnt; sie druckte auf jeder Seite mit und verdeckte Inhalt */
  @media print { .tab-leiste, .unter-reiter { display: none !important; } html body:has(> .kopfleiste) { padding-bottom: 0 !important; } }
  /* E-275: Seitenaufteilung wie im Redesign - Laptop Seitenleiste links, Handy und Tablet schwebende Leiste unten */
  .seitenleiste { display: none; }
  .kopfleiste { box-shadow: none; border-bottom: 1px solid var(--line); background: var(--surface-raised); }
  .kopfleiste .hauptnav { display: none !important; }
  .kopfleiste-innen { min-height: 56px; }
  .kopf-logo img { height: 24px; }
  .nav-konto a.nav-name { display: none !important; }

  /* Handy und Tablet: schwebende Leiste unten */
  @media (max-width: 63.9375em) {
    html body:has(> .kopfleiste) { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
    /* Firmenverwaltung (Johannes 16.11.): für die Verwaltung fünf Reiter – jede Spalte mindestens so breit wie ihre
       Beschriftung, der Rest gleich verteilt (vorher repeat(4, 1fr): „Abrechnung“ stieß an „Verwaltung“) */
    .tab-leiste { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(max-content, 1fr); gap: 4px; position: fixed; z-index: 60;
      left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right));
      bottom: calc(12px + env(safe-area-inset-bottom)); max-width: 30rem; margin: 0 auto; padding: 6px;
      border-radius: var(--radius-pill); background: var(--surface-raised); border: 1px solid var(--line);
      box-shadow: var(--shadow-pop); }
    .tab-leiste a { display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 52px;
      border-radius: var(--radius-pill); color: var(--ink-muted); text-decoration: none; font-size: 0.8125rem; font-weight: 500;
      position: relative; padding-inline: 4px; min-width: 2.75rem; }  /* A-17: 13 px nur hier, das Symbol steht daneben */
    .tab-leiste a .icon { width: 22px; height: 22px; }
    .tab-leiste a[aria-current="page"] { background: var(--primary); color: var(--on-primary); }
    .tab-leiste a.aktiv:not([aria-current]) { background: none; color: var(--ink-muted); }
  }
  /* E-408: fünf Reiter auf sehr schmalen Handys (320 px) – jede Tippfläche mindestens 44 px (E-393): weniger Rand außen
     und zwischen den Reitern statt kleinerer Schrift */
  @media (max-width: 22.5em) {
    .tab-leiste { gap: 2px; left: max(8px, env(safe-area-inset-left)); right: max(8px, env(safe-area-inset-right)); }
    .tab-leiste a { padding-inline: 2px; }
  }
  /* Laptop: Seitenleiste links, kein Kopf */
  @media (min-width: 64em) {
    .kopfleiste, .tab-leiste { display: none !important; }
    html body:has(> .kopfleiste) { padding-left: 16rem; padding-top: var(--space-8); }
    .seitenleiste { position: fixed; z-index: 50; top: 0; left: 0; bottom: 0; width: 16rem; box-sizing: border-box; display: flex;
      flex-direction: column; gap: 4px; padding: var(--space-6) var(--space-4); background: var(--surface-raised);
      border-right: 1px solid var(--line); }
    .seitenleiste-logo { display: flex; align-items: center; min-height: 44px; padding: 0 var(--space-3) var(--space-4); }
    .seitenleiste-logo img { height: 26px; width: auto; }
    .seitenleiste-punkt { display: flex; align-items: center; gap: var(--space-3); min-height: 48px; padding: 0 var(--space-4);
      border-radius: var(--radius-pill); color: var(--ink); text-decoration: none; font-weight: 500; position: relative; }
    .seitenleiste-punkt .icon { width: 22px; height: 22px; color: var(--ink-muted); }
    .seitenleiste-punkt:hover { background: var(--surface-sunken); }
    .seitenleiste-punkt[aria-current="page"] { background: var(--primary); color: var(--on-primary); }
    .seitenleiste-punkt[aria-current="page"] .icon { color: var(--on-primary); }
    .seitenleiste-text { display: grid; gap: 0; line-height: 1.25; }
    .seitenleiste-unter { font-size: 0.875rem; font-weight: 400; color: var(--ink-muted); }
    .seitenleiste-punkt[aria-current="page"] .seitenleiste-unter { color: var(--on-primary); }
    .seitenleiste-person { margin-top: auto; display: grid; gap: 2px; padding: var(--space-3) var(--space-4);
      border-radius: var(--radius-lg); color: var(--ink); text-decoration: none; }
    .seitenleiste-person:hover { background: var(--surface-sunken); }
    .seitenleiste-person .name { font-weight: 600; }
    .seitenleiste-person .rolle { font-size: 0.875rem; color: var(--ink-muted); }
    .ansicht-band { position: sticky; top: 0; z-index: 40; }
  }
  .nav-zahl { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; box-sizing: border-box;
    margin-left: 6px; border-radius: var(--radius-pill); background: var(--warn); color: var(--on-status); font-size: 0.875rem; font-weight: 700; }
  .tab-leiste .nav-zahl { position: absolute; top: 4px; left: calc(50% + 8px); margin: 0; }
  /* Unterreiter als Pillen wie im Redesign-Entwurf */
  .unter-reiter { display: flex; flex-wrap: wrap; gap: var(--space-2); padding: 0; background: none; justify-self: start;
    margin-bottom: var(--space-6); }
  .unter-reiter a { min-height: 44px; padding: 0 var(--space-4); border-radius: var(--radius-pill); border: 1px solid var(--line);
    background: var(--surface-raised); color: var(--ink-muted); font-weight: 500; box-shadow: none; }
  .unter-reiter a:hover { color: var(--ink); background: var(--surface-sunken); }
  .unter-reiter a.aktiv, .unter-reiter a[aria-current="page"] { background: var(--primary); border-color: var(--primary);
    color: var(--on-primary); box-shadow: none; }
  @media (max-width: 63.9375em) { .unter-reiter { justify-self: stretch; } }
  @media print { .seitenleiste { display: none !important; } html body:has(> .kopfleiste) { padding-left: 0; } }
  /* E-173: Einstellungen wie bei Claude - links Reiter je Rolle, rechts der Inhalt */
  .nav-konto a.nav-name { display: flex; align-items: center; gap: var(--space-1); min-height: 44px;
    padding: 0 var(--space-3); border-radius: var(--radius-sm); }
  .nav-konto a.nav-name:hover, .nav-konto a.nav-name.aktiv { background: var(--petrol-soft); }
  .nav-konto a.nav-name .icon { width: 18px; height: 18px; }
  .einst-layout { display: grid; gap: var(--space-6); align-items: start; }
  .einst-nav { display: flex; flex-direction: column; gap: 2px; padding: var(--space-3);
    background: var(--surface-raised); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
  .einst-titel { margin: var(--space-1) var(--space-3) var(--space-2); font-family: var(--font-display);
    font-size: 1.1rem; font-weight: 700; color: var(--ink); }
  .einst-gruppe { margin: var(--space-4) var(--space-3) var(--space-1); font-size: 0.875rem; font-weight: 600;
    color: var(--ink-muted); text-transform: none; }
  .einst-nav a, .einst-nav button { box-sizing: border-box; display: flex; align-items: center; gap: var(--space-3); min-height: 44px;
    padding: 0 var(--space-3); border: 0; border-radius: var(--radius-pill); background: none; color: var(--ink); font: inherit;
    font-size: 0.95rem; text-decoration: none; cursor: pointer; text-align: left; width: 100%; margin: 0; }
  .einst-nav a .icon, .einst-nav button .icon { width: 20px; height: 20px; color: var(--ink-muted); flex: none; }
  .einst-nav a:hover, .einst-nav button:hover { background: var(--surface-sunken); }
  .einst-nav a.aktiv { background: var(--petrol-soft); color: var(--petrol); font-weight: 700; }
  .einst-nav a.aktiv .icon { color: var(--petrol); }
  .einst-nav .einst-abmelden { color: var(--alert); margin-top: var(--space-4); border-top: 1px solid var(--line);
    border-radius: 0 0 8px 8px; }
  .einst-nav .einst-abmelden .icon { color: var(--alert); }
  .einst-nav button[aria-current="true"] { font-weight: 700; color: var(--petrol); }
  .einst-inhalt { min-width: 0; }
  .einst-zeilen { display: grid; margin-top: var(--space-2); }
  .einst-zeile { display: flex; justify-content: space-between; gap: var(--space-4); padding: var(--space-3) 0;
    border-top: 1px solid var(--line); font-size: 0.95rem; }
  .einst-zeile:first-child { border-top: 0; }
  .einst-zeile[hidden] { display: none; }
  .r-firma-titel { font-size: 0.95rem; margin: var(--space-4) 0 0; color: var(--ink); }  /* E-249 */
  .einst-zeile span { color: var(--ink-muted); }
  .einst-zeile strong { text-align: right; overflow-wrap: anywhere; }
  .einst-inhalt > h1 { margin-top: 0; }
  /* E-279: Laptop-Raster, Übersicht auf Handy/Tablet und Schalter in _EINSTELLUNGEN_CSS (über _einstellungen_rahmen) */
  @media (min-width: 64em) { .einst-nav #einst-entwickler:not([hidden]) { display: contents; } }
