/*
 * FahrerPass – lokaler Prototyp.
 *
 * Design-Grundwerte kommen aus der zentralen Werksnorm
 * (main-appstudio-website/design-norm.css, als letzte Stildatei geladen).
 *
 * WICHTIG: Keine style="..."-Attribute im App-Code — die
 * Content-Security-Policy (style-src 'self') blockiert Inline-Stile.
 * Gestaltung ausschließlich über die Klassen dieser Datei.
 */

:root {
  color-scheme: light;

  /* Farben, Höhen und Radien kommen aus der Werksnorm (design-norm.css, als
     letzte Stildatei geladen; Design-Review 15.09.2026). Hier nur Aliasse der
     App auf Norm-Variablen – keine eigenen Farbwerte mehr. */
  --gelb-flaeche: var(--ampel-gelb);
  --feld-radius: var(--ma-field-radius);
  --feld-hoehe: var(--ma-control-height);
  --karten-innen: var(--ma-card-padding);
  /* Kartenschatten bewusst weicher als der Norm-Bühnenschatten (--shadow). */
  --schatten: 0 8px 30px rgba(7, 27, 54, .10);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
}

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

/* ---------- App-Rahmen ---------- */

.fp-app { min-height: 100vh; display: flex; flex-direction: column; }

.fp-kopf {
  background: var(--navy);
  color: var(--white);
  padding: 20px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  justify-content: space-between;
}

.fp-kopf h1 { margin: 0; font-size: 22px; }
.fp-kopf-untertitel { margin: 4px 0 0; color: rgba(255, 255, 255, .78); font-size: 14px; }
.fp-prototyp-hinweis {
  background: rgba(255, 255, 255, .12);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
}

.fp-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 10px 16px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.fp-nav-link {
  display: inline-block;
  padding: 10px 14px;
  border-radius: var(--feld-radius);
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}

.fp-nav-link--aktiv { background: var(--aqua-soft); color: var(--aqua-text); }

.fp-inhalt {
  flex: 1;
  padding: 20px 24px 60px;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  min-width: 0;
}

.fp-inhalt > * { min-width: 0; }

/* Breite Tabellen scrollen im Rahmen statt die Seite zu sprengen. */
.fp-tabelle-rahmen {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

/* Am Bildschirm nicht buchstabenweise umbrechen, sondern im Rahmen scrollen. */
@media screen {
  .fp-tabelle-rahmen .fp-tabelle { min-width: 640px; }
}

/* ---------- Karten, Leerzustände ---------- */

.fp-karte {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--ma-card-radius);
  padding: var(--karten-innen);
  margin-bottom: 18px;
  /* Kein overflow auf der Karte: sonst schneidet sie aufklappende
     Auswahllisten ab. Breite Tabellen rollen im .fp-tabelle-rahmen. */
}

.fp-karte h2 { margin-top: 0; }

/* Einklappbare Karte für lange Listen (UI-Regel: standardmäßig zu,
   Titel + Anzahl im Kopf). */
details.fp-karte > summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 19px;
  color: var(--ink);
  list-style: none;
}
details.fp-karte > summary::-webkit-details-marker { display: none; }
details.fp-karte > summary::after { content: " ⌄"; color: var(--muted); font-size: 15px; }
details.fp-karte[open] > summary::after { content: " ⌃"; }
details.fp-karte > summary .fp-anzahl { color: var(--muted); font-weight: 400; font-size: 15px; }

.fp-leer {
  text-align: center;
  color: var(--muted);
  padding: 42px 16px;
  background: var(--white);
  border: 1px dashed var(--line);
  border-radius: var(--ma-card-radius);
}

.fp-lade { text-align: center; color: var(--muted); padding: 42px 16px; }

/* ---------- Kennzahlen ---------- */

.fp-kachel-raster {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.fp-kachel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--ma-card-radius);
  padding: var(--karten-innen);
}

.fp-kachel-wert { font-size: 28px; font-weight: 700; color: var(--navy); }
.fp-kachel-label { color: var(--ink); font-size: 14px; }

/* Farbige Kacheln: Flächen und Ränder aus den Norm-Statusfarben gemischt,
   Zahl in der Statusfarbe – keine eigenen Hex-Werte (Werksnorm-Regel). */
.fp-kachel--bestand { background: var(--aqua-soft); border-color: color-mix(in srgb, var(--aqua-text) 35%, transparent); }
.fp-kachel--bestand .fp-kachel-wert { color: var(--aqua-text); }
.fp-kachel--ok { background: color-mix(in srgb, var(--green) 14%, var(--white)); border-color: color-mix(in srgb, var(--green) 45%, transparent); }
.fp-kachel--ok .fp-kachel-wert { color: var(--green); }
.fp-kachel--warnung { background: color-mix(in srgb, var(--gelb-flaeche) 18%, var(--white)); border-color: color-mix(in srgb, var(--gelb-flaeche) 55%, transparent); }
.fp-kachel--warnung .fp-kachel-wert { color: var(--amber); }
.fp-kachel--kritisch { background: color-mix(in srgb, var(--red) 12%, var(--white)); border-color: color-mix(in srgb, var(--red) 45%, transparent); }
.fp-kachel--kritisch .fp-kachel-wert { color: var(--red); }

/* ---------- Status-Ampel (immer Text + Farbe, nie Farbe allein) ---------- */

.fp-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}

.fp-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* Helle Status-Hintergründe werden aus den Norm-Statusfarben gemischt –
   keine eigenen Hex-Werte (Werksnorm-Regel). */
.fp-status--ok { background: color-mix(in srgb, var(--green) 12%, var(--white)); color: var(--green); border-color: color-mix(in srgb, var(--green) 25%, transparent); }
.fp-status--bald { background: color-mix(in srgb, var(--gelb-flaeche) 16%, var(--white)); color: var(--amber); border-color: color-mix(in srgb, var(--gelb-flaeche) 45%, transparent); }
.fp-status--ueberfaellig { background: color-mix(in srgb, var(--red) 10%, var(--white)); color: var(--red); border-color: color-mix(in srgb, var(--red) 25%, transparent); }
.fp-status--gesperrt { background: var(--navy); color: var(--white); border-color: var(--navy); }
.fp-status--info { background: color-mix(in srgb, var(--blue) 10%, var(--white)); color: var(--blue); border-color: color-mix(in srgb, var(--blue) 25%, transparent); }
.fp-status--neutral { background: var(--paper); color: var(--muted); border-color: var(--line); }

/* ---------- Tabellen und Zeilenkarten ---------- */

.fp-tabelle {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--ma-card-radius);
  overflow: hidden;
}

.fp-tabelle th, .fp-tabelle td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.fp-tabelle th { background: var(--paper); color: var(--muted); font-weight: 600; }

.fp-zeile {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--ma-card-radius);
  padding: 14px 16px;
  margin-bottom: 10px;
}

.fp-zeile--klickbar { cursor: pointer; }
.fp-zeile--klickbar:hover, .fp-zeile--klickbar:focus-within { border-color: var(--aqua); }

.fp-zeile-haupt { min-width: 220px; flex: 1 1 auto; }
.fp-zeile-titel { font-weight: 700; color: var(--navy); }
.fp-zeile-neben { color: var(--muted); font-size: 14px; }

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

.fp-btn {
  /* inline-flex zentriert die Beschriftung auch bei Link-Knöpfen (<a>),
     die sonst – anders als <button> – oben ausgerichtet wären. */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  border: none;
  border-radius: var(--feld-radius);
  min-height: var(--feld-hoehe);
  padding: 0 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  background: var(--white);
  color: var(--navy);
  font-family: inherit;
}

.fp-btn--primaer { background: var(--aqua); color: var(--navy); }
.fp-btn--primaer:hover, .fp-btn--primaer:focus-visible { color: color-mix(in srgb, var(--navy) 70%, var(--aqua-text)); }
.fp-btn--sekundaer { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.fp-btn--gefahr { background: var(--red); color: var(--white); }
.fp-btn--klein { min-height: 36px; padding: 0 12px; font-size: 13px; }
.fp-btn:disabled { opacity: .55; cursor: not-allowed; }
.fp-btn:focus-visible { outline: 3px solid var(--aqua); outline-offset: 2px; }

.fp-knopfzeile { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.fp-knopfzeile--rechts { justify-content: flex-end; }
/* Schiebt in einer Knopfzeile alles Folgende nach rechts (Gefahr links,
   Bestaetigen rechts - raeumlich getrennt gegen Fehlklicks). */
.fp-knopfzeile-schub { flex: 1 1 auto; }

/* ---------- Formulare (Maß-Norm) ---------- */

.fp-formular input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
.fp-filterleiste input {
  min-height: var(--feld-hoehe);
  border-radius: var(--feld-radius);
  border: 1px solid var(--line);
  padding: 0 12px;
  font-size: 15px;
  font-family: inherit;
  background-color: var(--white);
  color: var(--ink);
  -webkit-appearance: none;
  appearance: none;
}

.fp-formular input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]) {
  width: 100%;
}

.fp-formular textarea {
  width: 100%;
  border-radius: var(--feld-radius);
  border: 1px solid var(--line);
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
  background-color: var(--white);
  color: var(--ink);
}

.fp-formular input:disabled,
.fp-formular textarea:disabled { background-color: var(--paper); color: var(--muted); cursor: not-allowed; }

.fp-feld { display: block; margin-bottom: 14px; }
.fp-feld-titel { display: block; font-weight: 600; margin-bottom: 6px; }
.fp-hilfetext { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }
.fp-hinweis { color: var(--muted); font-size: 14px; }

.fp-formular-raster {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  /* stretch statt start: alle Zellen einer Reihe gleich hoch, damit die
     Eingabefelder unten auf einer Linie liegen (UI-Regel: buendig). */
  align-items: stretch;
}

/* Bricht ein Feldtitel zweizeilig um, druecken die Nachbarn ihre Eingabe
   nicht mehr nach oben: Der Titel darf wachsen, das Eingabefeld sitzt in
   jeder Zelle unten buendig. */
.fp-formular-raster .fp-feld {
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}
.fp-formular-raster .fp-feld-titel { flex: 1 0 auto; }

.fp-filterleiste {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  align-items: center;
}

.fp-filterleiste input { flex: 1 1 170px; }
.fp-filterleiste .ma-combobox { flex: 1 1 170px; }

.fp-kontrollzeile { display: flex; align-items: flex-start; gap: 10px; margin: 10px 0; }
.fp-kontrollzeile input { margin-top: 4px; }

/* ---------- Dialog (UI-Regel: immer im Vordergrund) ---------- */

.fp-dialog-hintergrund {
  position: fixed;
  inset: 0;
  background: rgba(7, 27, 54, .5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  padding: 16px;
}

.fp-dialog {
  background: var(--white);
  border-radius: var(--ma-card-radius);
  padding: 22px;
  width: 100%;
  max-width: 620px;
  max-height: 92vh;
  overflow-y: auto;
}

.fp-dialog h2 { margin-top: 0; }

/* ---------- Aufzählungen: hängende Einrückung ---------- */

.fp-liste { margin: 0; padding: 0; list-style: none; }
.fp-liste li { position: relative; padding-left: 20px; margin-bottom: 6px; }
.fp-liste li::before { content: "–"; position: absolute; left: 0; color: var(--muted); }

/* Nummerierte Schritte (Anleitungen): hängende Einrückung mit Zähler */
.fp-schritte { margin: 0; padding: 0; list-style: none; counter-reset: schritt; }
.fp-schritte li { position: relative; padding-left: 30px; margin-bottom: 10px; counter-increment: schritt; }
.fp-schritte li::before {
  content: counter(schritt) ".";
  position: absolute;
  left: 0;
  color: var(--aqua-text);
  font-weight: 700;
}

/* Checkliste im Prüfdialog: Haken statt Strich (reine Gedächtnisstütze) */
.fp-checkliste { margin: 0 0 14px; padding: 0; list-style: none; }
.fp-checkliste li { position: relative; padding-left: 26px; margin-bottom: 8px; }
.fp-checkliste li::before { content: "✓"; position: absolute; left: 0; color: var(--aqua-text); font-weight: 700; }

/* ---------- QR-Muster (Platzhalter-Grafik im Prototyp) ---------- */

.fp-qr {
  display: block;
  width: 96px;
  height: 96px;
  background: var(--white);
}

.fp-qr--gross { width: 140px; height: 140px; }

.fp-qr-kachel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: var(--feld-radius);
  background: var(--white);
}

.fp-qr-code-text { font-family: ui-monospace, Menlo, monospace; font-size: 13px; color: var(--ink); }
.fp-qr-marke { font-size: 11px; color: var(--muted); }

/* Scan-Simulation: klickbare Code-Kacheln */
.fp-scan-raster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}

.fp-scan-kachel {
  border: 1px solid var(--line);
  border-radius: var(--feld-radius);
  background: var(--white);
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-family: inherit;
}

.fp-scan-kachel:hover, .fp-scan-kachel:focus-visible { border-color: var(--aqua); }
.fp-scan-kachel:focus-visible { outline: 3px solid var(--aqua); outline-offset: 2px; }
.fp-scan-kachel .fp-qr { width: 72px; height: 72px; }

/* ---------- Fahrerakte ---------- */

.fp-akte-kopf {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: flex-start;
  justify-content: space-between;
}

.fp-akte-eigenschaften { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 18px; }
.fp-akte-eigenschaften dt { color: var(--muted); font-size: 14px; }
.fp-akte-eigenschaften dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; }

.fp-warnkasten {
  border: 1px solid color-mix(in srgb, var(--red) 35%, transparent);
  background: color-mix(in srgb, var(--red) 6%, var(--white));
  border-radius: var(--feld-radius);
  padding: 14px 16px;
  margin: 14px 0;
}

.fp-warnkasten h3 { margin: 0 0 6px; color: var(--red); font-size: 15px; }

.fp-foto-vorschau {
  max-width: 220px;
  max-height: 160px;
  border-radius: var(--feld-radius);
  border: 1px solid var(--line);
  display: block;
  margin-top: 8px;
}

/* ---------- Kontrollprotokoll (Druckansicht) ---------- */

.fp-protokoll { max-width: 760px; margin: 0 auto; }

.fp-protokoll-kopf {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  border-bottom: 2px solid var(--navy);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.fp-protokoll-kopf h2 { margin: 0; }
.fp-protokoll-firma { text-align: right; color: var(--muted); font-size: 14px; }

/* ---------- Hilfsklassen ---------- */

.fp-gedaempft { color: var(--muted); }
.fp-rechts { text-align: right; }
.fp-mt-8 { margin-top: 8px; }
.fp-mb-8 { margin-bottom: 8px; }
.fp-mt-16 { margin-top: 16px; }
.fp-mb-16 { margin-bottom: 16px; }
.fp-mb-24 { margin-bottom: 24px; }
.fp-versteckt { display: none; }
.fp-block { display: block; }
/* Vollbreiter Knopf (Handy-Ansichten): .fp-btn ist inline-flex, deshalb hier
   ausdruecklich Breite und Ausrichtung setzen. */
.fp-btn.fp-block { display: flex; width: 100%; }
.fp-code {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 13px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  word-break: break-all;
  display: inline-block;
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  background: var(--navy);
  color: var(--white);
  padding: 12px 20px;
  border-radius: var(--feld-radius);
  box-shadow: var(--schatten);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 100001;
  max-width: calc(100vw - 32px);
}

.toast--sichtbar { opacity: 1; transform: translate(-50%, 0); }
.toast--kritisch { background: var(--red); }
.toast--info { background: var(--blue); }

/* ---------- Druck ---------- */

@media print {
  @page { size: A4; margin: 12mm; }
  .mainapp-global-header, .mainapp-account-slot, .fp-kopf, .fp-nav, .toast, .fp-dialog-hintergrund, .fp-nicht-drucken { display: none !important; }
  .fp-inhalt { padding: 0; max-width: none; }
  .fp-karte { border: none; box-shadow: none; padding: 0; }
  body { background: var(--white); }
  .fp-qr-kachel { break-inside: avoid; }
}

/* ================================================================
   FahrerPass-eigene Bausteine
   ================================================================ */

/* ---------- Betrieb und Rolle im Kopf (Cloud-Fassung) ---------- */

.fp-rolle {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  background: rgba(255, 255, 255, .12);
  border-radius: 14px;
  padding: 8px 14px;
  font-size: 13px;
  color: rgba(255, 255, 255, .85);
  min-width: 0;
  max-width: 100%;
  text-align: right;
}

.fp-rolle > span {
  overflow-wrap: anywhere;
}

.fp-rolle-name {
  color: var(--white);
  font-weight: 700;
}

/* ---------- Führerscheinklassen als antippbare Kacheln ---------- */

.fp-klassen-raster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
  gap: 8px;
  margin: 6px 0 4px;
}

.fp-klasse {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: var(--feld-radius);
  background: var(--white);
  color: var(--ink);
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 4px;
}

.fp-klasse-hinweis { font-size: 11px; font-weight: 500; color: var(--muted); line-height: 1.2; }

.fp-klasse:hover, .fp-klasse:focus-visible { border-color: var(--aqua); }
.fp-klasse:focus-visible { outline: 3px solid var(--aqua); outline-offset: 2px; }

.fp-klasse--gewaehlt {
  background: var(--aqua-soft);
  border-color: var(--aqua);
  color: var(--aqua-text);
}
.fp-klasse--gewaehlt .fp-klasse-hinweis { color: var(--aqua-text); }

/* Befristete Klassen: Datumsfeld erscheint erst bei Auswahl */
.fp-klassen-fristen { margin-top: 10px; }
.fp-klassen-fristen:empty { display: none; }

.fp-fristzeile {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.fp-fristzeile-name { font-weight: 700; min-width: 54px; }
.fp-fristzeile input { flex: 0 1 190px; }

/* Klassenmarken in Listen und Akte */
.fp-klassenmarken { display: flex; flex-wrap: wrap; gap: 6px; }

.fp-marke {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 8px;
  padding: 2px 9px;
  font-size: 13px;
  font-weight: 700;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
  white-space: nowrap;
}

.fp-marke-frist { font-weight: 400; font-size: 12px; color: var(--muted); }
.fp-marke--bald { background: color-mix(in srgb, var(--gelb-flaeche) 16%, var(--white)); border-color: color-mix(in srgb, var(--gelb-flaeche) 50%, transparent); color: var(--amber); }
.fp-marke--bald .fp-marke-frist { color: var(--amber); }
.fp-marke--abgelaufen { background: color-mix(in srgb, var(--red) 10%, var(--white)); border-color: color-mix(in srgb, var(--red) 35%, transparent); color: var(--red); }
.fp-marke--abgelaufen .fp-marke-frist { color: var(--red); }

/* ---------- Einladung: QR und Link ---------- */

.fp-einladung {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-start;
}

.fp-einladung-qr { flex: 0 0 auto; text-align: center; }
.fp-einladung-qr .fp-qr { width: 168px; height: 168px; border: 1px solid var(--line); border-radius: var(--feld-radius); padding: 8px; }
.fp-einladung-text { flex: 1 1 260px; min-width: 240px; }

/* ---------- Zwei Führerscheinseiten nebeneinander ---------- */

.fp-bildpaar { display: flex; flex-wrap: wrap; gap: 14px; margin: 12px 0; }
.fp-bildpaar figure { margin: 0; flex: 1 1 200px; display: flex; flex-direction: column; }
/* Bricht eine Überschrift um, wächst die Überschrift der Nachbarspalte mit – Fotofelder und Knöpfe bleiben auf einer Linie. */
.fp-bildpaar figcaption { font-size: 13px; color: var(--muted); margin-bottom: 6px; flex: 1 0 auto; }
.fp-bildpaar img {
  width: 100%;
  max-width: 320px;
  border-radius: var(--feld-radius);
  border: 1px solid var(--line);
  display: block;
}

.fp-bildplatzhalter {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 120px;
  max-width: 320px;
  border: 1px dashed var(--line);
  border-radius: var(--feld-radius);
  color: var(--muted);
  font-size: 13px;
  padding: 12px;
  background: var(--white);
}

/* Aufnahme-Knopf: verdeckt das Dateifeld, damit die Höhe der Norm folgt */
.fp-aufnahme { position: relative; display: block; margin-bottom: 14px; }
.fp-aufnahme input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.fp-aufnahme .fp-btn { width: 100%; pointer-events: none; }
.fp-aufnahme:focus-within .fp-btn { outline: 3px solid var(--aqua); outline-offset: 2px; }

/* ---------- Kästen für Hinweise ---------- */

.fp-infokasten {
  border: 1px solid color-mix(in srgb, var(--blue) 30%, transparent);
  background: color-mix(in srgb, var(--blue) 6%, var(--white));
  border-radius: var(--feld-radius);
  padding: 14px 16px;
  margin: 14px 0;
}
.fp-infokasten h3 { margin: 0 0 6px; color: var(--blue); font-size: 15px; }

.fp-warnkasten h3 { color: var(--red); }

.fp-erfolgkasten {
  border: 1px solid color-mix(in srgb, var(--green) 35%, transparent);
  background: color-mix(in srgb, var(--green) 8%, var(--white));
  border-radius: var(--feld-radius);
  padding: 14px 16px;
  margin: 14px 0;
}
.fp-erfolgkasten h3 { margin: 0 0 6px; color: var(--green); font-size: 15px; }

/* ---------- Mitarbeiterseite: reine Handy-Ansicht ---------- */

.fp-ma-seite {
  max-width: 520px;
  margin: 0 auto;
  padding: 18px 16px 60px;
}

.fp-ma-kopf {
  background: var(--navy);
  color: var(--white);
  padding: 20px 16px;
  text-align: center;
}
.fp-ma-kopf h1 { margin: 0; font-size: 20px; }
.fp-ma-kopf p { margin: 6px 0 0; color: rgba(255, 255, 255, .8); font-size: 14px; }

.fp-ma-schritt { counter-increment: fp-ma; }
.fp-ma-schritt h2 { display: flex; align-items: baseline; gap: 10px; font-size: 18px; }
.fp-ma-schritt h2::before {
  content: counter(fp-ma);
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--aqua);
  color: var(--navy);
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.fp-ma-seite { counter-reset: fp-ma; }

/* ---------- Kontrollhistorie ---------- */

.fp-historie { margin: 0; padding: 0; list-style: none; }
.fp-historie li {
  position: relative;
  padding: 10px 0 10px 22px;
  border-bottom: 1px solid var(--line);
}
.fp-historie li:last-child { border-bottom: none; }
.fp-historie li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 17px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
}
.fp-historie li.fp-historie--beanstandet::before { background: var(--red); }
.fp-historie li.fp-historie--vermerk::before { background: var(--muted); }
.fp-historie li.fp-historie--sperre::before { background: var(--navy); }
.fp-historie-kopf { font-weight: 600; }
.fp-historie-neben { color: var(--muted); font-size: 13px; }

/* ---------- Schmale Bildschirme ---------- */

@media (max-width: 640px) {
  .fp-kopf { padding: 16px; }
  .fp-inhalt { padding: 16px 14px 60px; }
  .fp-knopfzeile .fp-btn { flex: 1 1 auto; }
  .fp-einladung-qr { margin: 0 auto; }
}

/* ---------- Fußzeile der Mitarbeiterseite (Datenschutz/Impressum) ---------- */

.fp-ma-fusszeile {
  display: flex;
  justify-content: center;
  gap: 18px;
  padding: 18px 16px 24px;
}

.fp-ma-fusszeile a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-decoration: underline;
}

.fp-ma-fusszeile a:hover,
.fp-ma-fusszeile a:focus-visible {
  color: var(--navy);
}

/* Adresse der Code-Eingabeseite in der Zugangskarte: bleibt am Stück (kein Umbruch am Bindestrich), bricht nur, wenn sie breiter als die Spalte ist. */
.fp-einladung-adresse { font-weight: 600; display: inline-block; max-width: 100%; overflow-wrap: anywhere; }
