/* Gerüst (Doc 34 §4) und Komponenten (§5), nur über Tokens aus tokens.css.
   Mobile zuerst (390 px), dann M ≥ 640 px und L ≥ 1024 px. */
@import url('tokens.css');

/* ---------- Grundlage ---------- */

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

html,
body {
  margin: 0;
  min-height: 100%;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Fokus und Sprungziele nie unter festem Kopf oder schwebender Bottom-Nav (WCAG 2.4.11): Scrollen hält Abstand */
  scroll-padding: var(--kopf-hoehe) 0
    calc(var(--nav-hoehe) + var(--rand-schwebe) + env(safe-area-inset-bottom) + var(--space-2));
}

@media (min-width: 1024px) {
  html {
    scroll-padding: 0;
  }
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-app);
  line-height: var(--lh-app);
  font-variant-numeric: tabular-nums;
  color: var(--text-1);
  background: var(--seite-glanz), var(--seite);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-heading);
}

p {
  margin: 0;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

a {
  color: var(--text-link);
}

/* Fokus (U-18, Audit 10.11.): Linie in --focus-ring (8,4:1 auf Weiß), bleibt auch im Windows-Kontrastmodus,
   in dem Schatten entfallen. Der weiche Schatten kommt nur dazu. */
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  box-shadow: var(--shadow-focus);
}

/* Kontrastmodus: alle Fokuslinien in der Systemfarbe für Auswahl, die der Modus nicht überschreibt */
@media (forced-colors: active) {
  :root {
    --focus-ring: Highlight;
    --focus-ring-dunkel: Highlight;
  }
}

[hidden] {
  display: none !important;
}

.symbol {
  width: var(--icon);
  height: var(--icon);
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.symbol-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* ---------- Gerüst §4 ---------- */

.geruest-marke {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-1);
  text-decoration: none;
}

.geruest-logo {
  display: block;
  width: var(--logo-klein);
  height: var(--logo-klein);
  padding: var(--space-1);
  border-radius: var(--radius-sm);
  background: var(--logo-kachel);
}

/* Wortmarke im Verlauf (dunkel Kupfer, hell Tinte); im Kontrastmodus setzt der Browser die Schriftfarbe */
.geruest-wortmarke {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: var(--fs-caption);
  letter-spacing: 0.08em; /* A44: fett, engere Laufweite als --ls-wordmark */
  color: transparent;
  background: var(--wortmarke);
  -webkit-background-clip: text;
  background-clip: text;
}

/* Kopfleiste und Bottom-Nav: S und M */
.geruest-kopf {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-1);
  height: var(--kopf-hoehe);
  padding: 0 var(--space-2) 0 var(--space-4);
  background: var(--kopf-flaeche);
  border-bottom: 1px solid var(--karte-linie);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.design-schalter-icon {
  margin-left: auto;
}

/* An: gefüllte Sonne auf gewölbter Fläche, aus: Umriss ohne Fläche — Zustand nicht nur über die Farbe */
.design-schalter-icon[aria-checked='true'] {
  color: var(--brand);
  background: var(--konvex);
  box-shadow: var(--konvex-schatten);
}

.design-schalter-icon[aria-checked='true'] .symbol {
  fill: currentColor;
}

.geruest-unten {
  position: fixed;
  inset: auto 0 calc(var(--rand-schwebe) + env(safe-area-inset-bottom));
  z-index: 20;
  /* 4 bis 6 Einträge (Spec 40: „Aufgaben“ nur mit Schalter); verborgene belegen keinen Platz. Breite je Eintrag nach
     seinem Text plus gleichem Anteil am Rest, damit bei 390 px auch „Posteingang“ ganz bleibt */
  display: flex;
  width: min(100% - 2 * var(--space-2), var(--nav-breite));
  height: var(--nav-hoehe);
  margin-inline: auto;
  padding: var(--space-1);
  background: var(--karte-flaeche);
  border: 1px solid var(--karte-linie);
  border-radius: var(--radius-pill);
  box-shadow: var(--schatten-hebung);
}

.geruest-unten-eintrag {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-width: 0;
  padding: 0;
  font-size: var(--fs-mini);
  line-height: 1;
  letter-spacing: -0.01em;
  font-weight: var(--fw-medium);
  color: var(--text-3);
  text-decoration: none;
  border-radius: var(--radius-pill);
}

.geruest-unten-eintrag span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.geruest-unten-eintrag .symbol {
  width: var(--icon-nav);
  height: var(--icon-nav);
}

.geruest-unten-eintrag[aria-current='page'] {
  color: var(--text-1);
  background: var(--konvex);
  box-shadow: var(--konvex-schatten);
}

.geruest-unten-eintrag[aria-current='page'] .symbol {
  color: var(--brand);
}

/* Dashboard v3 (#195): Trenner zwischen Reinigung und Post, fällt mit dem verborgenen Posteingang weg */
.geruest-unten-trenner {
  flex: 0 0 1px;
  align-self: stretch;
  margin: var(--space-2) var(--space-1);
  background: var(--border-2);
}

.geruest-unten-trenner:has(+ [hidden]) {
  display: none;
}

/* Sidebar: L */
.geruest-seitenleiste {
  display: none;
}

.geruest-inhalt {
  padding: calc(var(--kopf-hoehe) + var(--space-5)) var(--space-4)
    calc(var(--nav-hoehe) + var(--rand-schwebe) + env(safe-area-inset-bottom) + var(--space-7));
}

.geruest-inhalt > * {
  max-width: var(--container);
  margin-inline: auto;
}

.geruest-titelzeile {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  margin-bottom: var(--space-5);
}

/* v3: Seitentitel in Jost leicht wie im Prototyp, auf allen Seiten gleich */
.geruest-titel {
  font-family: var(--font-akzent);
  font-size: var(--fs-h3);
  font-weight: var(--fw-light);
  letter-spacing: var(--ls-akzent);
  line-height: 1.2;
}

.geruest-stand {
  font-size: var(--fs-caption);
  color: var(--text-3);
}

.demo-badge {
  position: fixed;
  right: var(--space-4);
  bottom: calc(
    var(--nav-hoehe) + var(--rand-schwebe) + env(safe-area-inset-bottom) + var(--space-3)
  );
  z-index: 30;
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-eyebrow);
  color: var(--text-1);
  background: var(--konvex);
  border-radius: var(--radius-pill);
  box-shadow: var(--konvex-schatten);
  pointer-events: none;
}

/* Wenig Höhe (Handy quer, 200 % Zoom): die Kopfleiste scrollt mit, nur die Navigation bleibt fest (U-20) */
@media (max-height: 500px) {
  .geruest-kopf {
    position: absolute;
  }
}

@media (min-width: 1024px) {
  .geruest-kopf,
  .geruest-unten {
    display: none;
  }

  .geruest-seitenleiste {
    position: fixed;
    inset: var(--rand-schwebe) auto var(--rand-schwebe) var(--rand-schwebe);
    z-index: 20;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-breite);
    padding: calc(var(--space-6) - var(--space-1)) var(--space-3) var(--space-3);
    overflow-y: auto;
    background: var(--karte-flaeche);
    border: 1px solid var(--karte-linie);
    border-radius: var(--radius-xl);
    box-shadow: var(--schatten-karte);
  }

  .geruest-seitenleiste > .geruest-marke {
    padding-left: var(--space-3);
  }

  .geruest-seitenleiste .geruest-logo {
    width: var(--logo);
    height: var(--logo);
  }

  .geruest-seitenleiste .geruest-wortmarke {
    font-size: var(--fs-small);
  }

  .geruest-firma {
    margin-top: var(--space-3);
    font-size: var(--fs-small);
    color: var(--text-2);
  }

  .geruest-nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    margin-top: var(--space-6);
  }

  /* Dashboard v3 (#195): Gruppen Reinigung und Post, deutlich getrennt; Post verschwindet ohne sichtbaren Eintrag */
  .geruest-nav-gruppe {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
  }

  .geruest-nav-gruppe + .geruest-nav-gruppe {
    margin-top: var(--space-5);
    padding-top: var(--space-5);
    border-top: 1px solid var(--border-1);
  }

  .geruest-nav-gruppe:not(:has(.geruest-nav-eintrag:not([hidden]))) {
    display: none;
  }

  .geruest-nav-titel {
    margin: 0;
    padding: 0 var(--space-4) var(--space-2);
    font-family: var(--font-akzent);
    font-size: var(--fs-mini);
    letter-spacing: var(--ls-kicker);
    text-transform: uppercase;
    color: var(--text-3);
  }

  .geruest-nav-eintrag {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    height: var(--ziel);
    padding: 0 var(--space-4);
    border-radius: var(--radius-pill);
    font-weight: var(--fw-medium);
    color: var(--text-2);
    text-decoration: none;
    transition:
      background-color var(--dur-fast) var(--ease-out),
      color var(--dur-fast) var(--ease-out);
  }

  .geruest-nav-eintrag:hover {
    color: var(--text-1);
    background: var(--zeile-hover);
  }

  .geruest-nav-eintrag[aria-current='page'] {
    color: var(--text-1);
    background: var(--konvex);
    box-shadow: var(--konvex-schatten);
  }

  .geruest-nav-eintrag[aria-current='page'] .symbol {
    color: var(--brand);
  }

  .geruest-nav-eintrag[aria-current='page']::after {
    content: '';
    width: calc(var(--space-1) + 2px);
    height: calc(var(--space-1) + 2px);
    margin-left: auto;
    border-radius: var(--radius-pill);
    background: var(--punkt-aktiv);
    box-shadow: var(--punkt-glanz);
  }

  .geruest-seitenleiste-fuss {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-top: auto;
  }

  .geruest-konto {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    width: 100%;
    min-height: var(--ziel);
    padding: 0 var(--space-4);
    border: 0;
    border-radius: var(--radius-pill);
    box-shadow: var(--konvex-schatten);
    background: var(--konvex);
    color: var(--text-2);
    cursor: pointer;
    transition: box-shadow var(--dur-fast) var(--ease-out);
  }

  .geruest-konto:hover {
    color: var(--text-1);
    box-shadow: var(--konvex-schatten-hover);
  }

  .geruest-konto span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* #212: Kundenname über der E-Mail */
  .geruest-konto-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding-block: var(--space-2);
    text-align: left;
  }

  .geruest-konto-kunde {
    color: var(--text-1);
    font-weight: var(--fw-semibold);
  }

  .geruest-recht {
    padding-left: var(--space-3);
    font-size: var(--fs-caption);
    color: var(--text-3);
  }

  .geruest-recht a {
    color: inherit;
  }

  .geruest-inhalt {
    margin-left: calc(var(--sidebar-breite) + 2 * var(--rand-schwebe));
    padding: var(--space-7);
  }

  .geruest-titel {
    font-size: var(--fs-h2);
    line-height: 1.15;
  }

  .demo-badge {
    bottom: var(--space-5);
    right: var(--space-5);
  }
}

/* Schalter „Helles Design“ (src/design.js): Spur und Knopf aus CSS, Zustand aus aria-checked */
.design-schalter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  min-height: var(--ziel);
  padding: 0 var(--space-3);
  font-weight: var(--fw-medium);
  color: var(--text-2);
  background: transparent;
  border: 0;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.design-schalter:hover {
  color: var(--text-1);
}

.design-schalter-spur {
  position: relative;
  display: block;
  flex-shrink: 0;
  width: calc(var(--space-6) + var(--space-2));
  height: var(--space-5);
  border-radius: var(--radius-pill);
  background: var(--feld);
  box-shadow:
    var(--konkav),
    inset 0 0 0 1px var(--border-feld);
  transition: background var(--dur-base) var(--ease-out);
}

.design-schalter-spur::after {
  content: '';
  position: absolute;
  top: var(--space-1);
  left: var(--space-1);
  width: var(--space-4);
  height: var(--space-4);
  border-radius: var(--radius-pill);
  /* Knopf hebt sich in beiden Zuständen mindestens 3:1 von der Spur ab (aus: 6,9 / 9,3:1, an: ≥ 4,5:1) */
  background: var(--text-2);
  transition: transform var(--dur-base) var(--ease-out);
}

.design-schalter[aria-checked='true'] .design-schalter-spur {
  background: var(--knopf-primaer);
  box-shadow: var(--knopf-primaer-schatten);
}

.design-schalter[aria-checked='true'] .design-schalter-spur::after {
  background: var(--knopf-primaer-text);
  transform: translateX(var(--space-4));
}

/* Kontrastmodus: Flächen entfallen, Spur und Knopf bleiben als Linie und Fläche in Systemfarben */
@media (forced-colors: active) {
  .design-schalter-spur {
    border: 1px solid CanvasText;
  }

  .design-schalter-spur::after {
    background: CanvasText;
  }
}

/* Login §4.4: Blur-Blobs und Scanline nur aus CSS, kein Foto */
.login {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: var(--space-5) var(--space-4);
  overflow: hidden;
  background: var(--seite-glanz), var(--seite);
}

.login-blob {
  position: absolute;
  width: 60vmax;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(var(--space-8));
  opacity: 0.3;
  animation: login-treiben 18s var(--ease-out) infinite alternate;
}

.login-blob.eins {
  top: -25%;
  left: -20%;
  background: var(--brand-accent);
}

.login-blob.zwei {
  right: -25%;
  bottom: -30%;
  background: var(--brand);
  animation-delay: -6s;
}

.login-blob.drei {
  top: 30%;
  right: 10%;
  width: 30vmax;
  background: var(--brand-tint);
  animation-delay: -12s;
}

.login-scan {
  position: absolute;
  inset: 0 0 auto;
  height: var(--space-10);
  background: linear-gradient(to bottom, transparent, var(--brand-soft), transparent);
  opacity: 0.6;
  animation: login-scan 6s linear infinite;
  pointer-events: none;
}

@keyframes login-treiben {
  to {
    transform: translate(6%, 8%) scale(1.08);
  }
}

@keyframes login-scan {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(100vh);
  }
}

.login-karte {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  width: 100%;
  max-width: var(--login-breite);
  padding: var(--space-6) var(--space-5);
  background: var(--dialog-flaeche);
  border: 1px solid var(--karte-linie);
  border-radius: var(--radius-xl);
  box-shadow: var(--schatten-dialog);
}

.login-karte .geruest-marke {
  margin-bottom: var(--space-2);
}

.login-karte .geruest-wortmarke {
  font-size: var(--fs-lead);
}

.login-titel {
  font-size: var(--fs-h3);
  line-height: 1.2;
}

.login-hinweis {
  font-size: var(--fs-caption);
  color: var(--text-3);
}

.login-erfolg,
.login-kein-zugang {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--fs-small);
}

.login-erfolg {
  background: var(--success-soft);
  color: var(--green-700);
}

.login-kein-zugang {
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  background: var(--warning-soft);
  color: var(--amber-700);
}

.login-fehler {
  font-size: var(--fs-small);
  color: var(--danger);
}

/* Zwei-Faktor (E-151): Karte wie beim Login. Der QR-Code bleibt auch im dunklen Design dunkel auf Weiß, sonst
   lesen ihn manche Apps nicht. */
.zweifaktor-text {
  font-size: var(--fs-small);
  color: var(--text-2);
}

.zweifaktor-einrichtung {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

.zweifaktor-qr {
  width: 200px;
  max-width: 100%;
  height: auto;
  padding: var(--space-2);
  background: var(--neutral-0);
  border-radius: var(--radius-md);
}

.zweifaktor-einrichtung .feld-label {
  margin: var(--space-2) 0 0;
  text-align: center;
}

.zweifaktor-schluessel {
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  color: var(--text-1);
  text-align: center;
  overflow-wrap: anywhere;
  user-select: all;
}

.zweifaktor-code {
  font-family: var(--font-mono);
  letter-spacing: var(--ls-eyebrow);
}

/* ---------- Eingaben ---------- */

.feld-label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  color: var(--text-2);
}

.feld,
.suche input {
  display: block;
  width: 100%;
  height: var(--ziel);
  padding: 0 var(--space-4);
  color: var(--text-1);
  background: var(--feld);
  border: 1px solid var(--border-feld);
  border-radius: var(--radius-pill);
  box-shadow: var(--konkav);
  transition:
    border-color var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
}

.feld::placeholder,
.suche input::placeholder {
  color: var(--text-3);
}

.feld:focus,
.suche input:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
  border-color: var(--brand);
  box-shadow: var(--shadow-focus);
}

/* Feld mit Symbol links: Suchfeld, Login-E-Mail */
.suche,
.eingabe {
  position: relative;
  display: flex;
  align-items: center;
}

.suche .symbol,
.eingabe .symbol {
  position: absolute;
  left: var(--space-4);
  color: var(--text-3);
  pointer-events: none;
}

.suche input,
.eingabe .feld {
  padding-left: calc(var(--space-4) + var(--icon) + var(--space-2));
}

/* ---------- Knöpfe ---------- */

.knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--ziel);
  padding: 0 var(--space-5);
  font-weight: var(--fw-semibold);
  text-decoration: none;
  white-space: nowrap;
  border: 0;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition:
    background-color var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out),
    filter var(--dur-fast) var(--ease-out);
}

/* Primär: Kupfer-Verlauf, Schrift dunkel (4,5:1 auch an der dunkelsten Stelle), in beiden Designs gleich */
.knopf.primaer {
  color: var(--knopf-primaer-text);
  background: var(--knopf-primaer);
  box-shadow: var(--knopf-primaer-schatten);
}

.knopf.primaer:hover {
  filter: brightness(1.06);
}

.knopf.primaer:active {
  filter: brightness(0.94);
}

.knopf.gross {
  min-height: var(--ziel-gross);
}

.knopf.sekundaer {
  color: var(--text-1);
  background: var(--konvex);
  box-shadow: var(--konvex-schatten);
}

.knopf.sekundaer:hover {
  box-shadow: var(--konvex-schatten-hover);
}

.knopf.geist {
  color: var(--text-2);
  background: transparent;
}

.knopf.geist:hover,
.knopf-icon:hover {
  background: var(--zeile-hover);
}

.knopf:disabled,
.knopf-icon:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.knopf-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--ziel);
  height: var(--ziel);
  padding: 0;
  color: var(--text-2);
  background: transparent;
  border: 0;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out);
}

/* ---------- Karte ---------- */

.karte {
  background: var(--karte-flaeche);
  border-radius: var(--radius-lg);
  box-shadow: var(--schatten-karte);
  padding: var(--space-4);
}

/* Kartenlinie nur am Bildschirm: im Druckblatt (.karte.berichte-blatt) zöge print.css sie in Tinte nach */
@media screen {
  .karte {
    border: 1px solid var(--karte-linie);
  }
}

.karte-kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.karte-titel {
  font-size: var(--fs-karte);
  font-weight: var(--fw-medium);
  line-height: 1.3;
}

.karte-zaehler {
  display: inline-flex;
  align-items: center;
  min-width: calc(var(--space-6) - var(--space-1));
  min-height: calc(var(--space-6) - var(--space-1));
  justify-content: center;
  padding: 0 var(--space-2);
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-app);
  color: var(--text-1);
  background: var(--konvex);
  border-radius: var(--radius-pill);
  box-shadow: var(--konvex-schatten);
}

@media (min-width: 1024px) {
  .karte {
    padding: var(--space-6);
  }
}

/* ---------- Status-Punkt (Tabelle, Hero, Filter-Chip) ---------- */

.punkt,
.tabelle-status {
  display: inline-block;
  width: var(--space-2);
  height: var(--space-2);
  flex-shrink: 0;
  border-radius: var(--radius-pill);
  background: var(--text-3);
}

.punkt.ok,
.tabelle-status.ok {
  background: var(--success);
}

.punkt.warnung,
.tabelle-status.warnung {
  background: var(--warning);
}

.punkt.fehler,
.tabelle-status.fehler {
  background: var(--danger);
}

/* ---------- Hero-Karte (Übersicht), Dashboard v2 ----------
   Kopf als dunkle Karte (::before, eigene Rasterzelle über den Kopfzeilen) mit Kupfer-Streifen nur aus
   CSS-Verläufen, darunter die drei Kennzahlen als eigene Karten (Fuß, letzte Zeile). Der Textblock gibt seine Kinder
   ans Raster ab (display: contents): am Handy Titel oben über die ganze Breite, Stand und Ring nebeneinander; ab
   640 px Text links, Ring rechts. Die Kopffarben sind in beiden Designs gleich (dunkel). */

.uebersicht-hero {
  --hero-rand: var(--space-4);

  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto 1fr minmax(var(--hero-rand), auto) auto;
  color: var(--text-auf-dunkel);
}

.uebersicht-hero::before {
  content: '';
  grid-column: 1 / -1;
  grid-row: 1 / 5;
  z-index: -1;
  min-height: calc(var(--hero-hoehe) - var(--space-8));
  border-radius: var(--radius-xl);
  background-color: var(--surface-dark);
  /* oben die Streifen (multiply), darunter die Lichtquellen. Am Handy im mittleren Band zwischen Titel und Stand,
     damit Kicker, Titel und Stand auf dunklem Grund stehen (Kontrast); ab 640 px am oberen und unteren Rand */
  background-image:
    var(--hero-streifen-klein), radial-gradient(9% 22% at 6% 54%, var(--glut)),
    radial-gradient(10% 16% at 19% 50%, var(--glut-matt)),
    radial-gradient(9% 22% at 32% 56%, var(--glut)),
    radial-gradient(8% 16% at 45% 52%, var(--glut-matt)),
    radial-gradient(9% 18% at 56% 55%, var(--glut-matt));
  background-blend-mode: multiply, normal, normal, normal, normal, normal;
  box-shadow: var(--hero-schatten);
  animation: uebersicht-hero-einblenden calc(var(--dur-slow) * 3) var(--ease-out) both;
}

@keyframes uebersicht-hero-einblenden {
  from {
    opacity: 0.4;
  }

  to {
    opacity: 1;
  }
}

.uebersicht-hero-text {
  display: contents;
}

.uebersicht-hero-kicker {
  grid-area: 1 / 1 / 2 / -1;
  padding: var(--hero-rand) var(--hero-rand) 0;
  font-family: var(--font-akzent);
  font-size: var(--fs-caption);
  font-weight: var(--fw-light);
  line-height: 1.3;
  letter-spacing: var(--ls-kicker);
  text-transform: uppercase;
  color: var(--hero-akzent);
}

.uebersicht-hero-firma {
  grid-area: 2 / 1 / 3 / -1;
  padding: var(--space-2) var(--hero-rand) 0;
  font-family: var(--font-akzent);
  font-size: var(--fs-hero-klein);
  font-weight: var(--fw-light);
  line-height: 1.25;
  letter-spacing: var(--ls-akzent);
  text-transform: uppercase;
  text-shadow: var(--hero-titel-schatten);
  overflow-wrap: anywhere;
}

/* Stand: Mono, mit glühendem Punkt davor */
.uebersicht-hero-stand {
  padding-left: var(--hero-rand);
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  line-height: 1.35;
  color: var(--text-auf-dunkel-2);
  grid-area: 3 / 1 / 4 / 2;
  align-self: end;
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  padding-top: var(--space-3);
}

.uebersicht-hero-stand::before {
  content: '';
  flex-shrink: 0;
  width: calc(var(--space-1) + 2px);
  height: calc(var(--space-1) + 2px);
  border-radius: var(--radius-pill);
  background: var(--hero-punkt);
  box-shadow: var(--punkt-glanz);
}

/* Ring: 60 Striche aus bogen(); Verlauf Kupfer → Hell über die Breite in fünf Stufen (Kind 2 bis 61 = Strich 1 bis
   60), dahinter ein dunkler Schleier, damit Zahl und Beschriftung auf den Streifen lesbar bleiben */
.uebersicht-hero-bogen {
  position: relative;
  grid-area: 3 / 2 / 5 / 3;
  align-self: end;
  width: var(--ring-klein);
  aspect-ratio: 1;
  margin: var(--space-3) var(--hero-rand) var(--hero-rand) 0;
}

.uebersicht-hero-bogen::before {
  content: '';
  position: absolute;
  inset: -12%;
  z-index: -1;
  border-radius: var(--radius-pill);
  background: var(--hero-schleier);
}

.uebersicht-hero-bogen svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.uebersicht-hero-bogen-spur,
.uebersicht-hero-bogen-wert {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
}

.uebersicht-hero-bogen-spur {
  stroke: var(--text-auf-dunkel);
  stroke-opacity: 0.06;
  stroke-width: 1;
}

.uebersicht-hero-bogen-wert {
  stroke: var(--ring-1);
}

.uebersicht-hero-bogen-strich {
  stroke: var(--text-auf-dunkel);
  stroke-opacity: 0.13;
  stroke-width: 2;
  stroke-linecap: round;
}

.uebersicht-hero-bogen-strich.aktiv {
  stroke: var(--ring-1);
  stroke-opacity: 1;
  filter: drop-shadow(0 0 2px var(--ring-1));
}

.uebersicht-hero-bogen-strich.aktiv:nth-child(n + 23) {
  stroke: color-mix(in srgb, var(--ring-1), var(--ring-2));
}

.uebersicht-hero-bogen-strich.aktiv:nth-child(n + 29) {
  stroke: var(--ring-2);
}

.uebersicht-hero-bogen-strich.aktiv:nth-child(n + 35) {
  stroke: color-mix(in srgb, var(--ring-2), var(--ring-3));
}

.uebersicht-hero-bogen-strich.aktiv:nth-child(n + 41) {
  stroke: var(--ring-3);
}

.uebersicht-hero-bogen-endpunkt {
  r: 3;
  fill: var(--ring-3);
  stroke: none;
  filter: drop-shadow(0 0 4px var(--ring-3));
}

/* Text im inneren Kreis der Striche (r 48 von 120 = 80 % der Breite), mit 1 % Luft je Seite gegen Rundung */
.uebersicht-hero-bogen-text {
  position: absolute;
  inset: 12% 11%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  text-align: center;
}

.uebersicht-hero-bogen-zahl {
  font-family: var(--font-display);
  font-size: var(--fs-ring-klein);
  font-weight: var(--fw-medium);
  line-height: 1;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.uebersicht-hero-bogen-text span {
  font-size: var(--fs-mini);
  font-weight: var(--fw-medium);
  line-height: 1.2;
  color: var(--text-auf-dunkel);
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.uebersicht-hero-bogen-text span + span {
  font-weight: var(--fw-regular);
  color: var(--hero-akzent);
}

/* Kennzahlen: drei Karten mit Kupfer-Verlauf; am Handy je eine Zeile (Label links, Zahl rechts), ab 640 px
   nebeneinander mit rundem Symbol oben rechts */
.uebersicht-hero-fuss {
  grid-area: 5 / 1 / 6 / -1;
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.uebersicht-hero-kennzahl {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  min-height: calc(var(--space-8) - var(--space-1));
  padding: var(--space-2) var(--space-4);
  color: var(--kachel-text);
  background: var(--kachel-1);
  border: 1px solid var(--karte-linie);
  border-radius: var(--radius-lg);
  box-shadow: var(--schatten-karte);
}

.uebersicht-hero-kennzahl:nth-child(2) {
  background: var(--kachel-2);
}

.uebersicht-hero-kennzahl:nth-child(3) {
  background: var(--kachel-3);
}

.uebersicht-hero-kennzahl > span {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  min-width: 0;
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  color: var(--kachel-text-2);
}

.uebersicht-hero-kennzahl strong {
  display: flex;
  align-items: center;
  gap: 0 var(--space-3);
  font-family: var(--font-display);
  font-size: var(--fs-kennzahl-klein);
  font-weight: var(--fw-medium);
  flex-wrap: wrap;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.uebersicht-hero-kennzahl strong .punkt {
  width: var(--space-2);
  height: var(--space-2);
  box-shadow: 0 0 10px currentColor;
}

.uebersicht-hero-kennzahl strong .punkt.fehler {
  color: var(--danger);
}

.uebersicht-hero-kennzahl strong .punkt.ok {
  color: var(--success);
}

.uebersicht-hero-kennzahl .symbol {
  width: var(--space-4);
  height: var(--space-4);
}

@media (min-width: 640px) {
  .uebersicht-hero {
    --hero-rand: calc(var(--space-6) + var(--space-1));

    grid-template-rows: minmax(var(--hero-rand), 1fr) auto auto minmax(var(--hero-rand), 1fr) auto;
  }

  .uebersicht-hero::before {
    min-height: var(--hero-hoehe);
    background-blend-mode:
      multiply, normal, normal, normal, normal, normal, normal, normal, normal, normal, normal,
      normal, normal;
    background-image:
      var(--hero-streifen), radial-gradient(9% 40% at 6% -10%, var(--glut)),
      radial-gradient(10% 30% at 20% -14%, var(--glut-matt)),
      radial-gradient(9% 44% at 36% -10%, var(--glut)),
      radial-gradient(8% 30% at 50% -18%, var(--glut-matt)),
      radial-gradient(10% 36% at 12% 116%, var(--glut)),
      radial-gradient(11% 28% at 28% 120%, var(--glut-matt)),
      radial-gradient(10% 40% at 44% 114%, var(--glut)),
      radial-gradient(8% 30% at 56% 120%, var(--glut-matt)),
      radial-gradient(11% 58% at 68% -6%, var(--glut)),
      radial-gradient(10% 48% at 64% 112%, var(--glut-matt)),
      radial-gradient(10% 40% at 100% -10%, var(--glut-matt)),
      radial-gradient(10% 40% at 96% 112%, var(--glut-matt));
  }

  .uebersicht-hero-kicker {
    grid-area: 1 / 1 / 2 / 2;
    align-self: end;
    padding-top: 0;
  }

  .uebersicht-hero-firma {
    grid-area: 2 / 1 / 3 / 2;
    padding-top: var(--space-4);
    line-height: 1.15;
  }

  .uebersicht-hero-stand {
    padding-top: var(--space-4);
  }

  .uebersicht-hero-bogen {
    grid-area: 1 / 2 / 5 / 3;
    align-self: center;
    width: calc(var(--ring) - var(--space-8));
    margin: var(--space-5) var(--hero-rand);
  }

  .uebersicht-hero-bogen::before {
    inset: -22%;
  }

  .uebersicht-hero-bogen-zahl {
    font-size: var(--fs-h3);
  }

  .uebersicht-hero-bogen-text span {
    font-size: var(--fs-caption);
  }

  .uebersicht-hero-fuss {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-4);
    margin-top: var(--space-4);
  }

  .uebersicht-hero-kennzahl {
    grid-template-rows: auto auto;
    align-items: start;
    gap: var(--space-4) var(--space-3);
    padding: var(--space-5);
  }

  .uebersicht-hero-kennzahl > span {
    grid-area: 1 / 1;
    align-self: center;
  }

  .uebersicht-hero-kennzahl > strong {
    grid-area: 2 / 1 / 3 / -1;
  }
}

@media (min-width: 1024px) {
  .uebersicht-hero-bogen {
    width: var(--ring);
  }

  .uebersicht-hero-bogen-zahl {
    font-size: var(--fs-ring);
  }

  .uebersicht-hero-fuss {
    gap: var(--grid-gap);
    margin-top: var(--grid-gap);
  }
}

/* Großer Titel, große Kennzahlen erst ab 1280 bzw. 1440 px (Breite des Prototyps): bei 1024 px (Inhalt 784 px) lief
   „101 h 15 min“ in 40 px 18 px über die Seite, und „Leistungsnachweis“ brach in 28 px mitten im Wort */
@media (min-width: 1280px) {
  .uebersicht-hero-firma {
    font-size: var(--fs-hero);
  }

  .uebersicht-hero-kennzahl {
    padding: calc(var(--space-6) - var(--space-1));
  }
}

@media (min-width: 1440px) {
  .uebersicht-hero-kennzahl strong {
    font-size: var(--fs-kennzahl);
    line-height: 1.2;
  }
}

/* ---------- Liste „Ohne Meldung" ---------- */

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

.uebersicht-ohne-zeile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: calc(var(--ziel) + var(--space-3));
  font-weight: var(--fw-medium);
  border-bottom: 1px solid var(--border-1);
}

.uebersicht-ohne-tage {
  font-weight: var(--fw-medium);
  color: var(--danger);
  white-space: nowrap;
}

.uebersicht-ohne-fuss {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-top: var(--space-3);
  font-weight: var(--fw-medium);
  text-decoration: none;
}

/* ---------- Abdeckungs-Kalender ---------- */

.uebersicht-kalender {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--space-1);
}

.uebersicht-kalender-wochentag {
  font-size: var(--fs-caption);
  font-weight: var(--fw-medium);
  text-align: center;
  color: var(--text-3);
}

.uebersicht-kalender-tag {
  min-height: var(--ziel);
  padding: var(--space-1) var(--space-2);
  font-size: var(--fs-caption);
  line-height: 1.2;
  color: var(--text-2);
  background: var(--stufe-0);
  border-radius: var(--radius-md);
}

/* Audit U-22: drei Stufen statt fünf, die hellen unterschieden sich kaum (0→1 1,11:1, 1→2 1,31:1). Die Daten liefern
   weiter abdeckung_stufe 0–4 (summen.js); hier sind 0 und 1 (unter 50 %) schwach, 2 (50–79 %) mittel, 3 und 4 (ab
   80 %) kräftig. Abstand der Kupferstufen dunkel 2,1:1 und 2,1:1, hell 2,1:1 und 2,2:1. Gleiche Zuordnung für die
   Felder der Legende. */
.uebersicht-kalender-tag.stufe-0,
.uebersicht-kalender-tag.stufe-1,
.uebersicht-kalender-legende .stufe-0,
.uebersicht-kalender-legende .stufe-1 {
  background: var(--stufe-1);
}

.uebersicht-kalender-tag.stufe-2,
.uebersicht-kalender-legende .stufe-2 {
  background: var(--stufe-3);
  color: var(--stufe-3-text);
}

.uebersicht-kalender-tag.stufe-3,
.uebersicht-kalender-tag.stufe-4,
.uebersicht-kalender-legende .stufe-3,
.uebersicht-kalender-legende .stufe-4 {
  background: var(--stufe-4);
  color: var(--stufe-4-text);
}

.uebersicht-kalender-tag.zukunft {
  color: var(--text-disabled);
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--border-2);
}

/* „Gestern“ (jüngster Tag mit Daten): Zahl fett und unterstrichen, im Feld statt als Ring darum, damit es nie wie
   der Fokusring aussieht (Audit U-22, M4). Bleibt im Kontrastmodus sichtbar, Schatten entfallen dort */
.uebersicht-kalender-tag.heute {
  font-weight: var(--fw-bold);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.schraffur {
  background-image: repeating-linear-gradient(135deg, var(--schraffur) 0 2px, transparent 2px 7px);
}

/* Legende in drei Stufen mit Prozentbereichen und Ausfall (Audit U-22); ein Eintrag bricht nie in sich um. Hier
   statt in uebersicht.css, damit der Schaukasten (beispiele.html, nur app.css) gleich aussieht */
.uebersicht-kalender-legende {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-1) var(--space-3);
  margin-top: var(--space-4);
  font-size: var(--fs-caption);
  color: var(--text-3);
  white-space: nowrap;
}

.uebersicht-kalender-legende-eintrag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.uebersicht-kalender-legende .uebersicht-kalender-legende-ausfall {
  background-color: var(--stufe-0);
}

.uebersicht-kalender-legende i {
  width: var(--space-3);
  height: var(--space-3);
  border-radius: var(--radius-xs);
}

@media (min-width: 640px) {
  .uebersicht-kalender {
    gap: var(--space-2);
  }

  .uebersicht-kalender-tag {
    min-height: var(--space-8);
  }
}

/* ---------- Verlauf (Diagramme aus svg.js) ---------- */

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

.svg-achse {
  stroke: var(--gitter);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

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

.svg-punkt,
.svg-balken {
  fill: var(--linie);
}

/* ---------- Segment-Leiste: Zeitraum, Liste / Matrix, Verlauf Tage / Wochen / Monate ----------
   Vertiefte Spur (konkav), der gewählte Knopf als erhabene Pille (konvex) */

.zeitraum-wahl,
.ansicht-wahl,
.uebersicht-verlauf-wahl {
  display: flex;
  gap: var(--space-1);
  max-width: 100%;
  padding: var(--space-1);
  overflow-x: auto;
  background: var(--feld);
  border-radius: var(--radius-pill);
  box-shadow: var(--konkav);
  scrollbar-width: none;
}

.ansicht-wahl,
.uebersicht-verlauf-wahl {
  display: inline-flex;
}

.zeitraum-segment,
.ansicht-wahl > button,
.uebersicht-verlauf-wahl > button {
  display: inline-flex;
  flex: 1 0 auto;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: calc(var(--ziel) - 2 * var(--space-1));
  padding: 0 var(--space-3);
  font-weight: var(--fw-medium);
  white-space: nowrap;
  color: var(--text-2);
  background: transparent;
  border: 0;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition:
    background-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out);
}

.zeitraum-segment:hover,
.ansicht-wahl > button:hover,
.uebersicht-verlauf-wahl > button:hover {
  color: var(--text-1);
}

.zeitraum-segment.aktiv,
.ansicht-wahl > button.aktiv,
.uebersicht-verlauf-wahl > button.aktiv {
  color: var(--text-1);
  background: var(--konvex);
  box-shadow: var(--konvex-schatten);
}

/* ---------- Filter-Chip ---------- */

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--ziel);
  padding: 0 var(--space-4);
  font-weight: var(--fw-medium);
  color: var(--text-1);
  background: var(--konvex);
  border: 0;
  border-radius: var(--radius-pill);
  box-shadow: var(--konvex-schatten);
  cursor: pointer;
}

.filter-chip.aktiv {
  background: var(--danger-soft);
  box-shadow: inset 0 0 0 1px var(--danger);
}

.filter-chip-zahl {
  color: var(--text-3);
}

/* ---------- Tabelle (tabelle.js) ---------- */

.tabelle {
  width: 100%;
  border-collapse: collapse;
}

.tabelle-titel {
  padding-bottom: var(--space-2);
  text-align: left;
  color: var(--text-3);
}

.tabelle-kopf {
  padding: 0;
  text-align: left;
  font-size: var(--fs-caption);
  font-weight: var(--fw-medium);
  color: var(--text-3);
  border-bottom: 1px solid var(--border-1);
}

/* Nicht sortierbare Köpfe: gleicher Innenabstand wie Knopf und Zelle, sonst laufen Köpfe ineinander (Audit U-26) */
.tabelle-kopftext {
  display: block;
  padding: var(--space-2) var(--space-3);
}

.tabelle-knopf {
  width: 100%;
  min-height: var(--ziel);
  padding: 0 var(--space-3);
  text-align: inherit;
  white-space: nowrap;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
}

/* Tabellen scrollen oft seitlich (overflow), ein Ring nach außen würde abgeschnitten */
.tabelle-knopf:focus-visible {
  outline-offset: -2px;
}

/* Der Inhalt bekommt den Fokus nur per Skript (nach „Erneut versuchen“), ohne Ring um die ganze Seite */
main[tabindex='-1']:focus {
  outline: none;
  box-shadow: none;
}

.tabelle-sortiert .tabelle-knopf {
  color: var(--text-1);
}

.tabelle-sortiert[aria-sort='descending'] .tabelle-knopf::before {
  content: '↓ ';
}

.tabelle-sortiert[aria-sort='ascending'] .tabelle-knopf::before {
  content: '↑ ';
}

.tabelle-zelle {
  padding: var(--space-3);
  border-bottom: 1px solid var(--border-1);
}

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

.tabelle-zeile {
  transition: background-color var(--dur-fast) var(--ease-out);
}

.tabelle-zeile:hover {
  background: var(--zeile-hover);
}

/* Tabellenkopf mit eigener Fläche wie im Prototyp, nur am Bildschirm: der Druck bleibt unverändert. Versalien mit
   Laufweite wie im Prototyp passen nicht: die Objekte-Liste liefe bei 640 und 1024 px quer, die KW-Tabelle am Handy */
@media screen {
  .tabelle-kopf {
    background: var(--tabelle-kopf-flaeche);
  }
}

.tabelle-zeile.aktiv > :first-child {
  box-shadow: inset 3px 0 0 var(--brand);
}

.tabelle-zelle .tabelle-status {
  margin-right: var(--space-2);
}

.tabelle-chevron {
  width: 1%;
  text-align: right;
  color: var(--text-3);
}

.tabelle-chevron .symbol {
  vertical-align: middle;
}

@media (min-width: 1024px) {
  .tabelle-zelle {
    padding: var(--space-5) var(--space-3);
  }
}

/* ---------- Avatar ---------- */

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: calc(var(--space-6) + var(--space-2));
  height: calc(var(--space-6) + var(--space-2));
  flex-shrink: 0;
  font-weight: var(--fw-semibold);
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: var(--radius-pill);
}

/* ---------- Matrix (Objekte) ---------- */

.objekte-matrix {
  overflow-x: auto;
}

.objekte-matrix table {
  width: 100%;
  border-collapse: collapse;
}

.objekte-matrix th {
  padding: var(--space-2) var(--space-1);
  font-size: var(--fs-caption);
  font-weight: var(--fw-medium);
  line-height: 1.3;
  text-align: center;
  color: var(--text-3);
}

/* Namensspalte bleibt beim seitlichen Wischen stehen und bricht am Handy um (U-02, Audit 10.11.) */
.objekte-matrix th:first-child,
.objekte-matrix td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  width: min(40vw, 12rem);
  min-width: min(40vw, 12rem);
  padding-right: var(--space-3);
  text-align: left;
  overflow-wrap: break-word;
  hyphens: auto;
  background: var(--surface-card);
  box-shadow: inset -1px 0 0 var(--border-1);
}

@media (min-width: 1024px) {
  .objekte-matrix th:first-child,
  .objekte-matrix td:first-child {
    width: auto;
    min-width: 0;
    white-space: nowrap;
  }
}

.objekte-matrix th.heute {
  color: var(--brand);
}

.objekte-matrix td {
  border-top: 1px solid var(--border-1);
}

.objekte-zelle {
  position: relative;
  height: var(--ziel);
  text-align: center;
}

.objekte-zelle::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  vertical-align: middle;
  border-radius: var(--radius-pill);
  box-shadow: inset 0 0 0 2px var(--border-2);
}

.objekte-zelle.gemeldet::before {
  background: var(--linie);
  box-shadow: none;
}

.tipp {
  position: absolute;
  bottom: calc(100% - var(--space-1));
  left: 50%;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-2);
  font-size: var(--fs-caption);
  white-space: nowrap;
  color: var(--tipp-text);
  background: var(--tipp-hintergrund);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateX(-50%);
  pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease-out);
}

.tipp-text-2 {
  color: var(--tipp-text-2);
}

.tipp-punkt {
  width: var(--space-2);
  height: var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--tipp-punkt);
}

.objekte-zelle:hover .tipp,
.objekte-zelle:focus-within .tipp {
  opacity: 1;
}

.tipp.offen {
  position: static;
  align-self: flex-start;
  display: inline-flex;
  opacity: 1;
  transform: none;
}

/* ---------- Bottom-Sheet / Dialog (Objekt-Detail, Zeitraum) ---------- */

.blatt {
  width: 100%;
  max-width: var(--blatt-breite);
  padding: var(--space-2) var(--space-4) var(--space-5);
  color: var(--text-1);
  background: var(--dialog-flaeche);
  border: 0;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: var(--schatten-dialog);
}

dialog.blatt {
  max-height: 90dvh;
  margin: auto auto 0;
  overflow-y: auto;
}

dialog.blatt::backdrop {
  background: var(--abdunklung);
}

.blatt-griff {
  width: var(--space-6);
  height: var(--space-1);
  margin: 0 auto var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--griff);
}

.blatt-kopf {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.blatt-kopf p {
  color: var(--text-2);
}

.objekte-detail {
  display: flex;
  flex-direction: column;
}

.objekte-detail-liste {
  overflow-x: auto;
}

.objekte-detail h3 {
  margin: var(--space-5) 0 var(--space-2);
  font-size: var(--fs-small);
  color: var(--text-2);
}

.kennzahl-raster {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.kennzahl {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3);
  background: var(--surface-subtle);
  border-radius: var(--radius-md);
}

.kennzahl-wert {
  font-family: var(--font-display);
  font-size: var(--fs-lead);
  font-weight: var(--fw-semibold);
  line-height: 1.2;
}

.kennzahl-label {
  font-size: var(--fs-caption);
  color: var(--text-3);
}

@media (min-width: 640px) {
  .kennzahl-raster {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .blatt {
    padding: var(--space-6);
    border-radius: var(--radius-lg);
  }

  dialog.blatt {
    margin: auto;
  }

  .blatt-griff {
    display: none;
  }
}

.zeitraum-dialog-felder {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.zeitraum-dialog-monat {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--space-1);
  margin-top: var(--space-4);
  text-align: center;
}

.zeitraum-dialog-monat > span {
  font-size: var(--fs-caption);
  color: var(--text-3);
}

.zeitraum-dialog-tag {
  height: calc(var(--ziel) - var(--space-1));
  padding: 0;
  color: var(--text-1);
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.zeitraum-dialog-tag:hover {
  background: var(--surface-sunken);
}

.zeitraum-dialog-tag.im-bereich {
  background: var(--brand-soft);
}

.zeitraum-dialog-tag.aktiv {
  color: var(--text-on-brand);
  background: var(--brand);
}

.blatt-aktionen {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-5);
}

/* ---------- Auswahl-Knopf ---------- */

.auswahl {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-height: calc(var(--ziel) + var(--space-3));
  padding: 0 var(--space-4);
  color: var(--text-1);
  background: var(--surface-card);
  border: 0;
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 0 1px var(--border-feld);
  outline: 1px solid transparent; /* im Kontrastmodus sichtbarer Rand */
  outline-offset: -1px;
  cursor: pointer;
}

/* Das echte select ist unsichtbar (opacity 0), deshalb trägt die Hülle den Fokusring (U-18) */
.auswahl:has(:focus-visible) {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.auswahl-label {
  color: var(--text-3);
}

.auswahl-wert {
  font-weight: var(--fw-semibold);
}

.auswahl .symbol {
  color: var(--text-3);
}

/* ---------- Druckblatt (Berichte); print.css folgt in P9 ---------- */

.berichte-aktionen {
  display: flex;
  justify-content: flex-end;
  margin-bottom: var(--space-3);
}

.berichte-blatt {
  max-width: var(--container);
  padding: var(--space-5) var(--space-4);
  background: var(--karte-flaeche);
  border-radius: var(--radius-lg);
  box-shadow: var(--schatten-karte);
}

.berichte-blatt-kopf {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-3) var(--space-5);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--border-1);
}

.berichte-blatt-kicker {
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--brand);
}

.berichte-blatt-firma {
  margin-top: var(--space-1);
  font-size: var(--fs-h3);
  line-height: 1.2;
}

.berichte-blatt-monat {
  font-weight: var(--fw-semibold);
}

.berichte-blatt-monat span {
  display: block;
  font-size: var(--fs-caption);
  font-weight: var(--fw-regular);
  color: var(--text-3);
}

.berichte-blatt-titel {
  margin: var(--space-5) 0 var(--space-4);
  font-size: var(--fs-lead);
}

.berichte-blatt .tabelle {
  margin-top: var(--space-5);
}

@media (min-width: 640px) {
  .berichte-blatt-monat {
    text-align: right;
  }
}

@media (min-width: 1024px) {
  .berichte-blatt {
    padding: var(--space-7);
  }

  .berichte-blatt-firma {
    font-size: var(--fs-blatt);
  }
}

/* ---------- Zustände ---------- */

.zustand-leer,
.zustand-fehler,
.folgt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-7) var(--space-4);
  text-align: center;
  color: var(--text-2);
}

.zustand-leer strong,
.zustand-fehler strong {
  font-size: var(--fs-body);
  font-weight: var(--fw-semibold);
  color: var(--text-1);
}

.zustand-leer > .symbol {
  color: var(--text-3);
}

.zustand-fehler > .symbol {
  color: var(--danger);
}

.zustand-fehler .knopf {
  margin-top: var(--space-2);
}

.skelett {
  display: block;
  min-height: var(--space-4);
  background: var(--skelett);
  border-radius: var(--radius-sm);
  animation: skelett-puls 1.4s ease-in-out infinite;
}

@keyframes skelett-puls {
  50% {
    opacity: 0.55;
  }
}

/* Ladehinweis im Inhalt, bis die Snapshots da sind (Audit U-11) */
.zustand-laden {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5) 0;
  color: var(--text-2);
}

.zustand-laden-balken {
  min-height: var(--space-7);
  border-radius: var(--radius-md);
}

.zustand-laden-balken:first-of-type {
  min-height: calc(var(--space-7) * 3);
}

/* ---------- Fuß: Impressum · Datenschutz (Login-Karte; im Inhalt nur unter 1024 px,
   ab 1024 px stehen die Links in der Seitenleiste) ---------- */

.geruest-fuss {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-5);
  padding: var(--space-3) var(--space-4);
  font-size: var(--fs-caption);
  color: var(--text-3);
  border-top: 1px solid var(--border-1);
}

.geruest-fuss a {
  color: inherit;
}

@media (min-width: 1024px) {
  .geruest-inhalt > .geruest-fuss {
    display: none;
  }
}

/* ---------- Schaukasten beispiele.html ---------- */

.beispiele {
  display: flex;
  flex-direction: column;
  gap: var(--space-7);
}

.beispiele-abschnitt {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.beispiele-abschnitt > h2 {
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  letter-spacing: 0;
  color: var(--text-2);
}

.beispiele-zustand {
  font-size: var(--fs-caption);
  color: var(--text-3);
}

.beispiele-reihe {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.beispiele-rollbar {
  overflow-x: auto;
}

.beispiele-buehne {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-top: var(--space-7);
  overflow: hidden;
  background: var(--abdunklung);
  border-radius: var(--radius-lg);
}

.beispiele-buehne .login {
  min-height: calc(var(--space-10) * 5);
  width: 100%;
}

.beispiele-buehne:has(.login) {
  padding-top: 0;
}

.beispiele-icons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(calc(var(--space-9) - var(--space-2)), 1fr));
  gap: var(--space-2);
}

.beispiele-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-1);
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  color: var(--text-2);
  background: var(--surface-card);
  border-radius: var(--radius-md);
  box-shadow: var(--schatten-karte);
}

.beispiele-icon .symbol {
  color: var(--text-1);
}

@media (min-width: 1024px) {
  .beispiele-buehne {
    align-items: center;
    padding: var(--space-7);
  }
}

/* ---------- Bewegung aus ---------- */

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

/* ---------- P4-Nachtrag ---------- */

/* Diagramme (svg.js): Füllung, Endpunkt, Gitter, Ausfall, Achsentexte, Treffer */

.svg-rahmen {
  position: relative;
}

.svg-fuellung-oben {
  stop-color: var(--linie);
  stop-opacity: 0.28;
}

.svg-fuellung-unten {
  stop-color: var(--linie);
  stop-opacity: 0;
}

.svg-punkt-ende {
  fill: var(--linie);
  stroke: var(--surface-card);
  stroke-width: 2;
}

.svg-raster {
  stroke: var(--gitter);
  stroke-width: 0.5;
  opacity: 0.55;
  fill: none;
}

.svg-gitter {
  stroke: var(--gitter);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.svg-schraffur {
  stroke: var(--schraffur);
  stroke-width: 2;
}

.svg-ausfall {
  stroke: none;
}

.svg-beschriftung {
  font-size: 6px;
  fill: var(--text-3);
}

/* Achsentext skaliert mit der viewBox (480 Einheiten); am Handy größer, sonst unlesbar */
@media (max-width: 639px) {
  .svg-beschriftung {
    font-size: 11px;
  }
}

/* Verlauf der Übersicht: 1 Einheit = 1 px bei jeder Breite (uebersicht.js), also überall 11 px (Audit U-22) */
.uebersicht-verlauf .svg-beschriftung {
  font-size: 11px;
}

.svg-treffer {
  fill: transparent;
  cursor: pointer;
}

.svg-treffer:focus-visible {
  fill: var(--brand-soft);
  stroke: var(--brand);
  stroke-width: 2;
  box-shadow: none;
}

/* Tooltip (tipp.js, svg.js) */

.tipp-inhalt {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.tipp-zeile {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.tipp-wert {
  margin-left: var(--space-2);
  font-weight: var(--fw-semibold);
}

/* Geschlossen: display none, damit der Tooltip weder Platz noch Überhang erzeugt (keine Scrollleiste bei 390 px).
   Offen: Mitte auf 25 bis 75 Prozent der Rahmenbreite begrenzt, damit er an den Rändern nicht herausragt. */
.svg-rahmen .tipp {
  display: none;
  top: var(--tipp-y, 0);
  bottom: auto;
  left: clamp(25%, var(--tipp-x, 25%), 75%);
  max-width: 100%;
  transform: translate(-50%, calc(-100% - var(--space-2)));
}

.svg-rahmen .tipp.offen {
  position: absolute;
  align-self: auto;
  display: flex;
  opacity: 1;
  transform: translate(-50%, calc(-100% - var(--space-2)));
}

.mit-tipp {
  position: relative;
}

.mit-tipp .tipp {
  display: none;
  /* Verschiebung: Werte setzt src/ui/tipp.js per --tipp-dx/--tipp-dy (R3-Ausnahme, PR #18 „Für L") */
  translate: var(--tipp-dx, 0) var(--tipp-dy, 0);
}

.mit-tipp:hover .tipp,
.mit-tipp:focus-within .tipp {
  display: flex;
  opacity: 1;
}

.mit-tipp .tipp.offen {
  position: absolute;
  align-self: auto;
  display: flex;
  opacity: 1;
  transform: translateX(-50%);
}

/* Letztes Ziel einer Zeile: Tooltip rechtsbündig statt mittig, damit er rechts nicht überhängt */
.mit-tipp:last-child .tipp,
.mit-tipp:last-child .tipp.offen {
  left: auto;
  right: 0;
  transform: none;
}

/* .zu schließt sichtbar, auch wenn das Ziel noch Fokus oder Zeiger hat (tipp.js). !important nur hier, damit Regeln
   mit höherer Spezifität (z. B. aus Sichten) das Schließen nicht aushebeln. */
.mit-tipp .tipp.zu {
  display: none !important;
  opacity: 0 !important;
}

/* Tabelle (tabelle.js): klickbare, ausgewählte, gedimmte Zeilen, breite Spalten */

.tabelle-zeile-klickbar {
  cursor: pointer;
}

.tabelle-zeile-klickbar:hover {
  background: var(--zeile-hover);
}

/* Fokusring als Linie auf der Zeile, nach innen, weil Tabellen seitlich scrollen (overflow) und ein Ring nach außen
   abgeschnitten würde. Eine Linie bleibt im Kontrastmodus, ein Schatten nicht (U-18); ein Schatten auf tr zeigte
   Safari in zusammengefassten Tabellen ohnehin nicht. */
.tabelle-zeile-klickbar:focus-visible {
  outline-offset: -2px;
  box-shadow: none;
}

.tabelle-zeile-klickbar:focus-visible > .tabelle-zelle {
  background: var(--zeile-hover);
}

.tabelle-zeile-ausgewaehlt > :first-child {
  box-shadow: inset 3px 0 0 var(--brand);
}

.tabelle-zeile-gedimmt > .tabelle-zelle {
  color: var(--text-3);
}

@media (max-width: 639px) {
  .tabelle-breit {
    display: none;
  }
}

/* Zeitraum-Schalter (zeitraum-schalter.js): ab 1024 px Segment-Leiste, darunter Auswahl-Knopf */

.zeitraum-schalter-kopf {
  position: relative;
}

.zeitraum-schalter .zeitraum-wahl {
  display: none;
}

.zeitraum-schalter .auswahl {
  position: relative;
  display: flex;
  width: 100%;
}

.zeitraum-schalter .auswahl-wert {
  flex: 1;
}

.auswahl-select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  font: inherit;
  opacity: 0;
  cursor: pointer;
}

.zeitraum-schalter .zeitraum-spanne {
  margin: var(--space-2) 0 0;
  font-size: var(--fs-caption);
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.zeitraum-schalter .auswahl:focus-within {
  box-shadow:
    inset 0 0 0 1px var(--border-feld),
    var(--shadow-focus);
}

@media (min-width: 1024px) {
  .zeitraum-schalter .zeitraum-wahl {
    display: flex;
  }

  .zeitraum-schalter .auswahl {
    display: none;
  }
}

.zeitraum-dialog {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  left: 0;
  z-index: 20;
  padding: var(--space-4);
  background: var(--dialog-flaeche);
  border: 1px solid var(--karte-linie);
  border-radius: var(--radius-lg);
  box-shadow: var(--schatten-dialog);
}

.zeitraum-dialog .zeitraum-dialog-felder {
  grid-template-columns: minmax(0, 1fr);
}

.zeitraum-dialog-fehler {
  margin-top: var(--space-3);
  font-size: var(--fs-small);
  color: var(--danger);
}

.zeitraum-dialog-aktionen {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

/* 300px: Breite des Popovers laut Auftrag P4-Nachtrag; es gibt dafür kein Token in tokens.css */
@media (min-width: 640px) {
  .zeitraum-dialog {
    left: auto;
    width: 300px;
  }
}

/* Blatt (blatt.js): Bottom-Sheet unter 1024 px fährt von unten ein */

@keyframes blatt-hoch {
  from {
    transform: translateY(100%);
  }
}

/* Breite: unter 1024 px volle Breite; ab 1024 px höchstens 640 px. Für 640 px gibt es kein Token
   (--blatt-breite ist 560 px und bleibt unverändert), deshalb steht der Wert hier roh. */
@media (max-width: 1023px) {
  dialog.blatt {
    width: 100%;
    max-width: 100%;
  }

  dialog.blatt[open] {
    animation: blatt-hoch var(--dur-base) var(--ease-out);
  }
}

@media (min-width: 1024px) {
  dialog.blatt {
    max-width: 640px;
  }
}

/* Schaukasten: dunkle Fläche für den Bogen, Platz unter dem offenen Popover */

.beispiele-dunkel {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
  padding: var(--space-5);
  background: var(--gradient-dark);
  border-radius: var(--radius-lg);
}

.beispiele-tipp-platz {
  padding-top: var(--space-7);
}

.beispiele-popover-platz {
  min-height: calc(var(--space-10) * 2 + var(--space-7));
}

/* A136: Datumsfelder im Zeitraum-Dialog (Doc 36 §1.3) — nur Feldoptik, Picker bleibt nativ */
.zeitraum-dialog-felder .feld {
  box-sizing: border-box;
  width: 100%;
  min-height: calc(var(--ziel) * 1.25);
  padding: var(--space-3) var(--space-4);
  font-size: 1.25rem;
  text-align: center;
}

/* Handy: Tabellenköpfe dürfen umbrechen, Zellen schmaler — Objekte-Liste bei 390 px lief auf 441 px (L-PR 3, 01.11.) */
@media (max-width: 639px) {
  .tabelle-knopf {
    padding: 0 var(--space-2);
    white-space: normal;
    hyphens: auto;
  }

  .tabelle-kopftext {
    padding-inline: var(--space-2);
    hyphens: auto;
  }

  .tabelle-zelle {
    padding: var(--space-3) var(--space-2);
  }

  /* Objektnamen umbrechen statt die Liste über den Rand zu schieben (Audit U-20, 320 px) */
  .tabelle-zelle:first-child {
    overflow-wrap: break-word;
    hyphens: auto;
  }
}

/* ---------- Fotos (ui/fotos.js, Spec 39 §6.1): Raster und Vollbild ---------- */

.fotos {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.fotos-tag {
  margin-top: var(--space-2);
  font-size: var(--fs-small);
  font-weight: var(--fw-semibold);
  color: var(--text-2);
}

.fotos-raster {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.fotos-kachel {
  min-width: 0;
}

.fotos-knopf {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  width: 100%;
  padding: 0;
  color: var(--text-2);
  font: inherit;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: var(--radius-md);
}

button.fotos-knopf {
  cursor: pointer;
}

button.fotos-knopf:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  box-shadow: var(--shadow-focus);
}

.fotos-bild,
.fotos-knopf .fotos-fehlt {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
}

.fotos-fehlt {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2);
  font-size: var(--fs-caption);
  color: var(--text-3);
  text-align: center;
  background: var(--surface-sunken);
  border-radius: var(--radius-md);
}

/* darf umbrechen: abgeschnitten fehlte in schmalen Kacheln die Uhrzeit („Mitarbeiter B · 12:4…“) */
.fotos-zeile {
  font-size: var(--fs-caption);
  overflow-wrap: anywhere;
}

.fotos-leer {
  color: var(--text-2);
}

/* Vollbild (Audit U-17, #71 N4): das Blatt hat seine volle Höhe (90dvh, am Handy 100dvh). Kopf, Leiste und Angaben
   sind so hoch wie ihr Inhalt, die Bühne bekommt den Rest (minmax(0, 1fr)) und das Bild passt sich darin ein. Keine
   Annahme, wie hoch die Angaben sind: brechen sie um, wird nur das Bild kleiner */
dialog.fotos-blatt {
  height: 90dvh;
}

dialog.fotos-blatt[open] {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.fotos-blatt .fotos-vollbild {
  grid-row: 3;
}

.fotos-vollbild {
  display: grid;
  grid-template-rows: minmax(0, 1fr) repeat(4, auto);
  gap: var(--space-2);
}

.fotos-buehne {
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-y pinch-zoom;
  background: var(--surface-sunken);
  border-radius: var(--radius-md);
}

.fotos-gross {
  display: block;
  width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.fotos-buehne .fotos-fehlt {
  min-height: min(240px, 100%);
}

.fotos-leiste {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* auch beim Darüberfahren bzw. nach dem Antippen (sonst gewinnt .knopf.sekundaer:hover) */
.fotos-zoom[aria-pressed='true'],
.fotos-zoom[aria-pressed='true']:hover {
  color: var(--text-on-brand);
  background: var(--brand);
}

.fotos-leiste-mitte {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* vergrößert: Bild in doppelter Breite, die Bühne scrollt in beide Richtungen; fotos.js scrollt den angetippten Punkt
   unter den Finger (ohne Punkt: Bildmitte in die Bühnenmitte) */
.fotos-buehne-zoom {
  display: block;
  overflow: auto;
  touch-action: pan-x pan-y pinch-zoom;
}

.fotos-buehne-zoom .fotos-gross {
  width: 200%;
  max-width: none;
  max-height: none;
}

/* Audit U-17: am Handy echtes Vollbild statt zweitem Blatt, Bild auf dunklem Grund bis an den Rand */
@media (max-width: 639px) {
  dialog.fotos-blatt {
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }

  dialog.fotos-blatt .blatt-griff {
    display: none;
  }

  /* die Bühne nimmt den freien Platz (Raster oben), Leiste und Angaben stehen unten (Daumen) */
  .fotos-blatt .fotos-buehne {
    margin-inline: calc(var(--space-4) * -1);
    background: var(--gradient-dark);
    border-radius: 0;
  }

  .fotos-blatt .fotos-gross {
    border-radius: 0;
  }
}

/* Wenig Höhe (Handy quer): Bild links, Leiste und Angaben rechts daneben, sonst bliebe für das Bild kaum Platz */
@media (max-height: 500px) {
  .fotos-blatt .fotos-vollbild {
    grid-template-columns: minmax(0, 1fr) minmax(180px, 34%);
    grid-template-rows: repeat(4, auto) minmax(0, 1fr);
    gap: var(--space-2) var(--space-4);
  }

  .fotos-blatt .fotos-buehne {
    grid-row: 1 / -1;
    grid-column: 1;
    margin-inline: 0;
  }
}

.fotos-zaehler {
  font-size: var(--fs-small);
  color: var(--text-2);
}

.fotos-pfeil-zurueck .symbol {
  transform: scaleX(-1);
}

.fotos-ort {
  font-weight: var(--fw-semibold);
}

.fotos-person,
.fotos-zeit {
  font-size: var(--fs-small);
  color: var(--text-2);
}

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

  dialog.fotos-blatt {
    max-width: min(960px, calc(100vw - var(--space-6)));
  }
}

/* Audit U-19: Sprunglink, außerhalb des Bilds bis er den Fokus hat */
.sprunglink {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 100;
  padding: var(--space-2) var(--space-3);
  color: var(--text-on-brand);
  background: var(--brand);
  border-radius: var(--radius-md);
  transform: translateY(-200%);
}

.sprunglink:focus {
  transform: none;
}
