/* CXA-Baukasten · basis.css
   Reset, Grundtypografie und das App-Geruest (Schiene, Kopf, Flaeche).
   Breiten: ab 1181 px volle Schiene, 901 bis 1180 px schmale Icon-Schiene,
   bis 900 px Schublade hinter dem Menue-Knopf. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cxa-grund);
  color: var(--cxa-text);
  font-family: var(--cxa-schrift);
  font-size: var(--cxa-t-basis);
  line-height: 1.45;
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-family: var(--cxa-schrift-titel); line-height: 1.2; letter-spacing: -.012em; }
p { margin: 0 0 .7em; }
a { color: var(--cxa-marke); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; max-width: 100%; }
[data-aktion], [role='button'] { cursor: pointer; }
:focus-visible { outline: 2px solid var(--cxa-akzent); outline-offset: 2px; }
.cxa-zahl, .cxa-tabelle td.r { font-variant-numeric: tabular-nums; }
.cxa-mono { font-family: var(--cxa-mono); font-size: .92em; }
.cxa-nur-leser {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.cxa-icon { display: inline-block; vertical-align: -.22em; width: 18px; height: 18px; flex: none; }

/* ── Geruest ─────────────────────────────────────────────────────────── */
.cxa-app {
  display: grid;
  grid-template-columns: var(--cxa-schiene-breit) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.cxa-sprung {
  position: fixed; left: 12px; top: -60px; z-index: 1000;
  padding: 10px 14px; border: 0; border-radius: var(--cxa-radius);
  background: var(--cxa-marke); color: var(--cxa-auf-marke);
}
.cxa-sprung:focus { top: 12px; }

/* Schiene */
.cxa-schiene {
  position: sticky; top: 0;
  height: 100vh; height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--cxa-schiene);
  color: var(--cxa-schiene-text);
  overflow-y: auto;
  z-index: 50;
}
.cxa-schiene-marke {
  display: flex; align-items: center; gap: 10px;
  min-height: var(--cxa-kopf-hoehe);
  padding: 12px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  color: var(--cxa-schiene-aktiv);
}
.cxa-schiene-marke img { max-height: 34px; width: auto; }
.cxa-schiene-marke b { display: block; font-size: 15px; font-weight: 700; letter-spacing: -.01em; line-height: 1.15; }
.cxa-schiene-marke small { display: block; font-size: 11px; color: var(--cxa-schiene-text); margin-top: 2px; }
.cxa-marke-kuerzel {
  display: grid; place-items: center; flex: none;
  width: 32px; height: 32px; border-radius: 7px;
  background: var(--cxa-akzent); color: #fff;
  font-weight: 800; font-size: 13px; letter-spacing: .02em;
}

.cxa-nav { padding: 10px 10px 18px; display: flex; flex-direction: column; gap: 1px; }
.cxa-nav-gruppe {
  padding: 16px 10px 6px;
  font-size: var(--cxa-t-mikro); font-weight: 700;
  letter-spacing: .11em; text-transform: uppercase;
  color: rgba(185, 198, 218, .62);
}
.cxa-nav-punkt {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  width: 100%; min-height: 38px; padding: 0 10px;
  border: 0; border-radius: var(--cxa-radius);
  background: none; color: inherit; text-align: left;
  font-size: 13.5px; font-weight: 500;
  transition: background var(--cxa-tempo), color var(--cxa-tempo);
}
.cxa-nav-punkt:hover { background: rgba(255, 255, 255, .055); color: var(--cxa-schiene-aktiv); }
.cxa-nav-punkt[aria-current='page'] { background: var(--cxa-schiene-2); color: var(--cxa-schiene-aktiv); font-weight: 600; }
.cxa-nav-punkt[aria-current='page']::before {
  content: ''; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--cxa-akzent);
}
.cxa-nav-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cxa-nav-rechts { display: flex; align-items: center; gap: 5px; }
.cxa-nav-zahl {
  min-width: 20px; height: 18px; padding: 0 6px;
  display: inline-grid; place-items: center;
  border-radius: 9px; font-size: 10.5px; font-weight: 700;
  background: rgba(255, 255, 255, .12); color: var(--cxa-schiene-aktiv);
}
.cxa-nav-zahl.ton-warn { background: var(--cxa-warn); }
.cxa-nav-zahl.ton-fehler { background: var(--cxa-fehler); }
.cxa-nav-zahl.ton-akzent { background: var(--cxa-akzent); color: #1d0f08; }

.cxa-schiene-fuss {
  margin-top: auto;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid rgba(255, 255, 255, .07);
  font-size: 12.5px;
}
.cxa-schiene-fuss b { display: block; color: var(--cxa-schiene-aktiv); font-weight: 600; }
/* Zahnrad im Fuss (Einstellungen), optional mit Hinweis-Punkt */
.cxa-zahnrad {
  position: relative; margin-left: auto; flex: none;
  display: grid; place-items: center; width: 30px; height: 30px;
  border: 0; border-radius: var(--cxa-radius); background: none;
  color: var(--cxa-schiene-text); cursor: pointer;
}
.cxa-zahnrad + .cxa-abmelden { margin-left: 0; }
.cxa-zahnrad:hover, .cxa-zahnrad:focus-visible { background: var(--cxa-schiene-2); color: var(--cxa-schiene-aktiv); }
.cxa-zahnrad[aria-current] { background: var(--cxa-schiene-2); color: var(--cxa-schiene-aktiv); }
.cxa-hinweis-punkt {
  position: absolute; top: 4px; right: 4px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--cxa-akzent); box-shadow: 0 0 0 2px var(--cxa-schiene);
}
.cxa-person {
  display: grid; place-items: center; flex: none;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--cxa-schiene-2); color: var(--cxa-schiene-aktiv);
  font-size: 11.5px; font-weight: 700;
}

/* Kopf */
.cxa-haupt { min-width: 0; display: flex; flex-direction: column; }
.cxa-kopf {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 16px;
  min-height: var(--cxa-kopf-hoehe);
  padding: 10px var(--cxa-abstand);
  background: color-mix(in srgb, var(--cxa-grund) 88%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--cxa-linie-zart);
}
.cxa-burger {
  display: none;
  width: 40px; height: 40px; margin-left: -6px;
  place-items: center;
  border: 0; border-radius: var(--cxa-radius); background: none;
}
.cxa-burger:hover { background: var(--cxa-flaeche-2); }
.cxa-kopf-titel { min-width: 0; }
.cxa-kopf-titel h1 { font-size: var(--cxa-t-titel); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cxa-kopf-titel small { display: block; color: var(--cxa-text-3); font-size: 12px; margin-top: 1px; }
.cxa-kopf-leiste { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cxa-kopf-rechts { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.cxa-suche { position: relative; }
.cxa-suche .cxa-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--cxa-text-3); pointer-events: none; }
.cxa-suche input {
  width: 220px; height: 36px; padding: 0 12px 0 34px;
  border: 1px solid var(--cxa-linie); border-radius: var(--cxa-radius);
  background: var(--cxa-flaeche);
}
.cxa-suche input:focus { outline: none; border-color: var(--cxa-marke); box-shadow: 0 0 0 3px var(--cxa-marke-hell); }

.cxa-demo-banner {
  display: flex; align-items: center; gap: 8px;
  padding: 7px var(--cxa-abstand);
  background: repeating-linear-gradient(-45deg, var(--cxa-akzent-hell), var(--cxa-akzent-hell) 10px, #fff6f1 10px, #fff6f1 20px);
  border-bottom: 1px solid rgba(201, 81, 40, .2);
  color: var(--cxa-akzent-dunkel); font-size: 12px; font-weight: 600;
}
.cxa-demo-banner .cxa-icon { width: 15px; height: 15px; }
.cxa-marke-banner { padding: 10px var(--cxa-abstand) 0; }

.cxa-flaeche { flex: 1; padding: var(--cxa-abstand); outline: none; }
.cxa-ansicht { animation: cxa-rein 220ms cubic-bezier(.2, .7, .3, 1); }
@keyframes cxa-rein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.cxa-vorhang { display: none; }

/* Schmale Schiene: nur Icons, Text als Tooltip */
@media (max-width: 1180px) and (min-width: 901px) {
  .cxa-app { grid-template-columns: var(--cxa-schiene-eng) minmax(0, 1fr); }
  .cxa-schiene-marke { justify-content: center; padding: 12px 0; }
  .cxa-schiene-marke .cxa-marke-text, .cxa-schiene-marke img { display: none; }
  .cxa-nav { padding: 10px 8px; }
  .cxa-nav-gruppe { font-size: 0; padding: 10px 0 4px; border-top: 1px solid rgba(255, 255, 255, .07); margin-top: 8px; }
  .cxa-nav-punkt { justify-content: center; padding: 0; min-height: 42px; }
  .cxa-nav-punkt[aria-current='page']::before { left: -8px; }
  .cxa-nav-text, .cxa-stufe-marke .lang { display: none; }
  .cxa-nav-rechts { position: absolute; top: 3px; right: 3px; }
  .cxa-nav-rechts .cxa-stufe-marke { display: none; }
  .cxa-nav-zahl { min-width: 16px; height: 15px; font-size: 9.5px; padding: 0 4px; }
  .cxa-schiene-fuss { flex-direction: column; justify-content: center; gap: 8px; padding: 14px 0; }
  .cxa-zahnrad, .cxa-abmelden { margin-left: 0; }
  .cxa-schiene-fuss > div { display: none; }
  /* Bereiche einer Ansicht brauchen Text, hier zeigt die Ansicht ihre eigene Liste */
  .cxa-app.cxa-bereiche-in-schiene .cxa-nav { display: none; }
}

/* Handy und kleines Tablet: Schiene als Schublade */
@media (max-width: 900px) {
  :root { --cxa-abstand: 14px; --cxa-kopf-hoehe: 56px; }
  .cxa-app { display: block; }
  .cxa-schiene {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: min(290px, 84vw);
    transform: translateX(-102%);
    transition: transform 200ms cubic-bezier(.2, .7, .3, 1);
    z-index: 300;
  }
  /* Schatten nur offen, sonst faellt er von links ins Bild */
  .cxa-app.cxa-menue-offen .cxa-schiene { transform: none; box-shadow: var(--cxa-schatten-3); }
  .cxa-app.cxa-menue-offen .cxa-vorhang {
    display: block; position: fixed; inset: 0; z-index: 290;
    background: rgba(8, 16, 30, .45);
  }
  .cxa-nav-punkt { min-height: 46px; font-size: 15px; }
  .cxa-burger { display: grid; }
  .cxa-kopf { flex-wrap: wrap; gap: 8px 10px; padding-top: 8px; padding-bottom: 8px; }
  .cxa-kopf-titel h1 { font-size: 18px; }
  .cxa-kopf-rechts { gap: 6px; }
  .cxa-suche input { width: 150px; }
  .cxa-kopf-leiste { order: 5; flex-basis: 100%; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .cxa-kopf-leiste:empty { display: none; }
  /* iOS zoomt bei Feldern unter 16 px beim Antippen in die Seite */
  input, select, textarea { font-size: 16px !important; }
  button { touch-action: manipulation; }
}
/* Ganz schmal: Suche schrumpft auf die Lupe und klappt beim Antippen ueber die Kopfzeile auf */
@media (max-width: 520px) {
  .cxa-suche { width: 40px; height: 36px; }
  .cxa-suche input { position: absolute; right: 0; top: 0; width: 40px; padding: 0 0 0 34px; }
  .cxa-suche input::placeholder { color: transparent; }
  .cxa-suche input:focus, .cxa-suche input:not(:placeholder-shown) {
    width: calc(100vw - 2 * var(--cxa-abstand)); padding-right: 10px; z-index: 5;
  }
  .cxa-suche input:focus::placeholder { color: var(--cxa-text-3); }
  .cxa-suche .cxa-icon { z-index: 6; left: auto; right: 12px; }
  .cxa-suche input:focus ~ .cxa-icon, .cxa-suche input:not(:placeholder-shown) ~ .cxa-icon { right: auto; left: calc(52px - 100vw + 2 * var(--cxa-abstand)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}

@media print {
  .cxa-schiene, .cxa-kopf, .cxa-demo-banner, .cxa-marke-banner, .cxa-toasts { display: none !important; }
  .cxa-app { display: block; }
  body { background: #fff; }
}
