/* ==========================================================================
   Rettungshund Trainingstagebuch – Gestaltung
   Mobil zuerst: die App wird im Gelände auf dem Handy bedient.
   Farbwelt orientiert sich am gedruckten Heft (Salbeigrün, warmes Papierweiß).
   ========================================================================== */

:root {
  /* Hausfarbe des Bayerischen Roten Kreuzes. Das Rotkreuz-Emblem selbst ist
     nach den Genfer Abkommen geschuetzt und wird hier bewusst nicht verwendet. */
  --marke: #e30613;
  --marke-hell: #f2626b;
  --marke-blass: #fdecee;
  --marke-dunkel: #b3040f;
  --marke-text: #ffffff;
  --blau: #1d6fb8;
  --blau-flaeche: #1d6fb8; /* Fläche hinter weißer Schrift – bleibt in beiden Modi kräftig */
  --rot: #c0392b;       /* Fläche hinter weißer Schrift */
  --rot-text: #b8352a;  /* Schrift auf dem Seitengrund */
  /* Schrift auf fest weissem Grund. Bleibt im dunklen Modus absichtlich
     dunkel: --marke-dunkel und --rot-text kippen dort ins Helle, weil sie
     auf dem Seitengrund stehen – auf Weiss ergaebe das 2,7:1. */
  --auf-weiss: #b3040f;
  --orange: #c2761b;       /* Flaeche, z.B. Statuspunkt – nicht als Schrift */
  --warn-text: #7d5400;    /* Schrift auf hellem Grund (5,8:1) */

  --grund: #f5f5f6;
  --flaeche: #ffffff;
  --flaeche-2: #eeeff1;
  --text: #22252a;
  --text-leise: #666b73;
  --rand: #dcdee2;
  --rand-stark: #c2c6cc;

  --r: 12px;
  --r-gross: 16px;
  --schatten: 0 1px 2px rgba(31, 38, 32, .06), 0 4px 14px rgba(31, 38, 32, .05);
  --tap: 44px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --grund: #151618;
    --flaeche: #1e2023;
    --flaeche-2: #26292d;
    --text: #e9eaec;
    --text-leise: #a0a5ad;
    --rand: #34373c;
    --rand-stark: #474b52;
    /* Die Fläche bleibt kräftig, damit weiße Schrift darauf lesbar ist
       (4,9:1). Aufgehellt wird nur, was selbst als Schrift dient. */
    --marke: #e30613;
    --marke-hell: #f2545f;
    --marke-blass: #33191c;
    --marke-dunkel: #ff7079;
    --marke-text: #ffffff;
    --rot-text: #f2705f;
    --warn-text: #e8ab55;  /* auf dunklem Grund 7,2:1 */
    --blau: #6fa8e0;
    --blau-flaeche: #1d6fb8;
    --schatten: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
  background: var(--grund);
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}

body.laedt .inhalt > *:not(.start-laden) { display: none; }

h1, h2, h3 { margin: 0; font-weight: 650; line-height: 1.25; }
h1 { font-size: 1.35rem; }
p { margin: 0 0 .6rem; }
a { color: var(--marke-dunkel); }

/* ---------------- Kopfzeile & Navigation ---------------- */

.kopf {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--marke);
  color: #fff;
  padding-top: env(safe-area-inset-top);
  box-shadow: 0 1px 6px rgba(0, 0, 0, .18);
}

.kopf__inhalt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  min-width: 0;
  padding: .55rem .9rem .4rem;
  max-width: 1180px;
  margin: 0 auto;
}

.marke {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  color: #fff;
  min-width: 0;      /* sonst draengt der Schriftzug die rechte Seite hinaus */
  flex: 0 12 auto;   /* gibt vor der rechten Seite nach */
}
.marke__logo { width: 30px; height: 30px; color: #fff; flex: none; }
.marke__text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.marke__text strong,
.marke__text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.marke__text strong { font-size: 1rem; letter-spacing: -.01em; }
.marke__text small { font-size: .7rem; color: #fff; font-variant-numeric: tabular-nums; }

.sync-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .75rem;
  padding: .3rem .6rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, .2);
  border: 1px solid rgba(255, 255, 255, .55);
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}
.punkt { width: 8px; height: 8px; border-radius: 50%; background: var(--rand-stark); flex: none; }
.sync-chip--aktiv .punkt { background: #7ee081; }
.sync-chip--verbinde .punkt { background: #ffd166; animation: pulsieren 1.2s infinite; }
.sync-chip--offline .punkt { background: #ffd166; }
.sync-chip--fehler .punkt { background: var(--rot); }
.sync-chip--fehler { background: #fff; color: var(--auf-weiss); border-color: #fff; font-weight: 650; }
@keyframes pulsieren { 50% { opacity: .3; } }

.tabs {
  display: flex;
  gap: .15rem;
  padding: 0 .5rem;
  max-width: 1180px;
  margin: 0 auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  flex: none;
  padding: .55rem .7rem;
  font-size: .875rem;
  font-weight: 550;
  color: #fff;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}
.tabs a:hover { border-bottom-color: rgba(255, 255, 255, .45); }
.tabs a.tab--an { font-weight: 750; border-bottom-color: #fff; }

/* ---------------- Layout ---------------- */

.inhalt { max-width: 1180px; margin: 0 auto; padding: 1rem .9rem 6rem; }
.seite, .editor { display: flex; flex-direction: column; gap: 1rem; }

.seite__kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}
.seite__intro { color: var(--text-leise); font-size: .9rem; margin: -.4rem 0 0; max-width: 62ch; }
.zaehler {
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-leise);
  background: var(--flaeche-2);
  padding: .1rem .45rem;
  border-radius: 999px;
  vertical-align: middle;
}

.karte {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--r-gross);
  padding: .9rem 1rem 1rem;
  box-shadow: var(--schatten);
}
.karte--gefahr { border-color: color-mix(in srgb, var(--rot) 35%, var(--rand)); }
.karte__titel {
  font-size: 1rem;
  margin: 0 0 .2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  flex-wrap: wrap;
}
.karte__hint { font-size: .8rem; color: var(--text-leise); margin: .1rem 0 .7rem; }
.karte__inhalt > *:last-child { margin-bottom: 0; }
.karte__werkzeug { font-weight: 400; }

.raster { display: grid; gap: .75rem; }
.raster--2, .raster--3, .raster--4 { grid-template-columns: 1fr; }
.raster--karten { gap: 1rem; }

@media (min-width: 620px) {
  .raster--2 { grid-template-columns: 1fr 1fr; }
  .raster--3 { grid-template-columns: repeat(3, 1fr); }
  .raster--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .raster--4 { grid-template-columns: repeat(4, 1fr); }
  .inhalt { padding: 1.25rem 1.25rem 5rem; }
  h1 { font-size: 1.6rem; }
}

.gruppe { margin-bottom: .7rem; }
.gruppe h3, .unter {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-leise);
  margin: 1rem 0 .5rem;
  font-weight: 650;
}
.gruppe h3 { margin-top: 0; }

/* ---------------- Formularelemente ---------------- */

.feld { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .75rem; }
.feld__label { font-size: .82rem; font-weight: 600; color: var(--text-leise); }
.feld__label small { font-weight: 400; }

.input {
  width: 100%;
  min-height: var(--tap);
  padding: .55rem .7rem;
  font: inherit;
  font-size: 16px; /* verhindert Zoom auf iOS */
  color: var(--text);
  background: var(--flaeche);
  border: 1px solid var(--rand-stark);
  border-radius: var(--r);
  appearance: none;
}
.input:focus-visible { outline: 2px solid var(--marke); outline-offset: 1px; border-color: var(--marke); }
.input--area { min-height: 5rem; resize: vertical; line-height: 1.5; }
.input--schlank { min-height: 36px; padding: .3rem .5rem; font-size: .9rem; }
.input--code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; line-height: 1.45; }
select.input { background-image: none; padding-right: .7rem; }

.hinweis-inline { font-size: .85rem; color: var(--text-leise); padding: .5rem 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  min-height: var(--tap);
  padding: .5rem 1rem;
  font: inherit;
  font-weight: 600;
  font-size: .9rem;
  border-radius: var(--r);
  border: 1px solid var(--rand-stark);
  background: var(--flaeche);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  max-width: 100%;
  text-align: center;
  overflow-wrap: break-word;   /* Notnagel fuer ein einzelnes langes Wort */
}
.btn:hover { background: var(--flaeche-2); }
.btn--primaer { background: var(--marke); border-color: var(--marke); color: #fff; }
.btn--primaer:hover { background: var(--marke-dunkel); border-color: var(--marke-dunkel); }
.btn--still { background: var(--flaeche-2); }
.btn--hell { background: #fff; color: var(--auf-weiss); border-color: transparent; }
.btn--gefahr { background: var(--rot); border-color: var(--rot); color: #fff; }
.btn--gefahr-still { color: var(--rot-text); border-color: color-mix(in srgb, var(--rot) 30%, var(--rand)); background: transparent; }
.btn--mini { min-height: 32px; padding: .2rem .6rem; font-size: .8rem; border-radius: 8px; }
.btn-zeile { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: .6rem 0; }
.btn-zeile .input { width: auto; flex: 1 1 12rem; }

/* Chips (Mehrfachauswahl) */
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  min-height: 38px;
  padding: .35rem .75rem;
  font: inherit;
  font-size: .875rem;
  border-radius: 999px;
  border: 1.5px solid var(--rand-stark);
  background: var(--flaeche);
  color: var(--text);
  cursor: pointer;
}
.chip--an { background: var(--marke-blass); border-color: var(--marke); color: var(--marke-dunkel); font-weight: 600; }
.mini-chip {
  padding: .25rem .55rem;
  font: inherit;
  font-size: .78rem;
  border-radius: 999px;
  border: 1.5px solid var(--rand-stark);
  background: var(--flaeche);
  color: var(--text-leise);
  cursor: pointer;
}
.mini-chip--an { background: var(--marke-blass); border-color: var(--marke); color: var(--marke-dunkel); font-weight: 600; }
.mini-chip--rot { background: color-mix(in srgb, var(--rot) 12%, transparent); border-color: var(--rot); color: var(--rot-text); }

/* Checkliste (Problemverhalten) */
.checkliste { display: grid; gap: .4rem; margin-bottom: .7rem; }
@media (min-width: 620px) { .checkliste { grid-template-columns: 1fr 1fr; } }
.check {
  display: flex;
  align-items: center;
  gap: .6rem;
  min-height: var(--tap);
  padding: .4rem .6rem;
  font: inherit;
  font-size: .9rem;
  text-align: left;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--r);
  color: var(--text);
  cursor: pointer;
}
.check i {
  width: 20px; height: 20px; flex: none;
  border: 2px solid var(--rand-stark);
  border-radius: 6px;
  position: relative;
}
.check--an { border-color: var(--rot); background: color-mix(in srgb, var(--rot) 7%, var(--flaeche)); }
.check--an i { background: var(--rot); border-color: var(--rot); }
.check--an i::after {
  content: ""; position: absolute; left: 5px; top: 1px;
  width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}

/* ---------------- Bewertungsskala ---------------- */

.krit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--rand);
  flex-wrap: wrap;
}
.krit:last-of-type { border-bottom: none; }
.krit__label { display: flex; flex-direction: column; gap: .15rem; flex: 1 1 11rem; min-width: 0; }
.krit__label > span { font-size: .95rem; font-weight: 550; }
.krit__label small { font-size: .72rem; color: var(--text-leise); line-height: 1.3; }
.krit--eigen .krit__label { flex-direction: row; align-items: center; gap: .4rem; }

.skala { display: flex; gap: .45rem; flex: none; }
.dot {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--dot) 45%, transparent);
  background: color-mix(in srgb, var(--dot) 16%, transparent);
  cursor: pointer;
  padding: 0;
  transition: transform .1s ease;
}
.dot:hover { transform: scale(1.1); }
.dot--aktiv {
  background: var(--dot);
  border-color: var(--dot);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--dot) 25%, transparent);
}
.dot--aktiv::after { content: "✓"; color: #16181b; font-size: .8rem; line-height: 1; font-weight: 700; }
.skala--klein .dot { width: 24px; height: 24px; }

.ampel { display: inline-flex; gap: .25rem; margin-top: .2rem; }
.ampel__b {
  width: 30px; height: 26px;
  border-radius: 7px;
  border: 1.5px solid var(--rand-stark);
  background: var(--flaeche);
  color: var(--text-leise);
  cursor: pointer;
  font-size: .85rem;
  line-height: 1;
}
.ampel__b--ja { background: #45a049; border-color: #45a049; color: #fff; }
.ampel__b--nein { background: var(--rot); border-color: var(--rot); color: #fff; }
.radiustyp { display: inline-flex; gap: .3rem; margin-top: .25rem; flex-wrap: wrap; }

/* ---------------- Editor ---------------- */

.editor__kopf {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}
.editor__meta { font-size: .82rem; color: var(--text-leise); margin: .15rem 0 0; }
.editor__aktionen { display: flex; gap: .4rem; flex-wrap: wrap; }
.editor__aktionen .btn { min-height: 36px; padding: .35rem .75rem; font-size: .82rem; }
.editor__fuss { display: flex; justify-content: flex-end; padding-bottom: 1rem; }

.helfer-liste { display: flex; flex-direction: column; gap: .8rem; }
.helfer {
  border: 1px solid var(--rand);
  border-radius: var(--r);
  padding: .7rem .8rem .2rem;
  background: var(--flaeche-2);
}
.helfer__kopf { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .6rem; }
.helfer__kopf strong { font-size: .9rem; }
.helfer__gefunden { display: inline-flex; gap: .3rem; margin-left: auto; }
/* Erfasst, aber ohne gefunden/nicht gefunden – ohne Markierung waere bei
   mehreren Zeilen nicht erkennbar, welche der Suche noch fehlt. */
.helfer--offen { border-color: var(--orange); }
.helfer__fehlt { color: var(--warn-text); font-size: .74rem; font-weight: 600; }

/* ---------------- Skizze ---------------- */

.skizze { margin-top: .5rem; }
.skizze__werkzeuge { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; margin-bottom: .45rem; }
.skizze__spacer { flex: 1; }
.stift {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .25rem .6rem;
  font: inherit; font-size: .78rem;
  border-radius: 999px;
  border: 1.5px solid var(--rand-stark);
  background: var(--flaeche);
  color: var(--text-leise);
  cursor: pointer;
}
.stift i { width: 12px; height: 12px; border-radius: 50%; background: var(--stift); }
.stift--an { border-color: var(--stift); color: var(--text); font-weight: 600; }
.skizze__canvas {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--flaeche);
  border: 1px solid var(--rand-stark);
  border-radius: var(--r);
  touch-action: none;
  cursor: crosshair;
  display: block;
}
.skizze__hint { font-size: .74rem; color: var(--text-leise); margin: .35rem 0 0; }
.skizze-vorschau { width: 100%; height: auto; opacity: .85; }

/* ---------------- Suchliste ---------------- */

.such-liste { display: flex; flex-direction: column; gap: .6rem; }
.such-karte {
  display: flex;
  gap: .8rem;
  align-items: stretch;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--r-gross);
  padding: .8rem .9rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--schatten);
}
.such-karte:hover { border-color: var(--marke-hell); }
.such-karte__haupt { flex: 1; min-width: 0; }
.such-karte__zeile1 { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.such-karte__ort { color: var(--text-leise); font-size: .9rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.such-karte__zeile2 { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .35rem; }
.such-karte__noten { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: .45rem; }
.such-karte__ziel { font-size: .82rem; color: var(--text-leise); margin: .4rem 0 0; }
.such-karte__skizze { width: 92px; flex: none; display: none; align-items: center; }
@media (min-width: 560px) { .such-karte__skizze { display: flex; } }

.tag {
  font-size: .74rem;
  padding: .12rem .45rem;
  border-radius: 6px;
  background: var(--flaeche-2);
  color: var(--text-leise);
  border: 1px solid var(--rand);
  white-space: nowrap;
}
.tag--warn { color: var(--rot-text); border-color: color-mix(in srgb, var(--rot) 30%, var(--rand)); }
.mininote { display: inline-flex; align-items: center; gap: .3rem; font-size: .76rem; color: var(--text-leise); }
.mininote i { width: 9px; height: 9px; border-radius: 50%; }

.note {
  margin-left: auto;
  font-weight: 700;
  font-size: .85rem;
  color: #16181b;
  background: var(--n);
  padding: .1rem .5rem;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.note--klein { margin: 0; font-size: .78rem; padding: .05rem .4rem; }

/* ---------------- Dashboard ---------------- */

.kacheln { display: grid; gap: .6rem; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) { .kacheln { grid-template-columns: repeat(4, 1fr); } }
.kachel {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--r);
  padding: .65rem .8rem .7rem;
  display: flex;
  flex-direction: column;
  gap: .1rem;
  min-width: 0;
  box-shadow: var(--schatten);
}
.kachel__label { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-leise); font-weight: 650; }
.kachel__wert { font-size: 1.45rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kachel__sub { font-size: .72rem; color: var(--text-leise); }
.spark { width: 100%; height: 22px; margin-top: .25rem; }

.ch { width: 100%; height: auto; overflow: visible; display: block; }
.ch-grid { stroke: var(--rand); stroke-width: 1; }
.ch-tick { fill: var(--text-leise); font-size: 11px; font-family: var(--font); }
.ch-leer { color: var(--text-leise); font-size: .875rem; padding: 1.5rem 0; text-align: center; }
.ch-legende { display: flex; gap: .9rem; flex-wrap: wrap; font-size: .78rem; color: var(--text-leise); margin-bottom: .5rem; }
.ch-legende i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .3rem; vertical-align: -1px; }

.bars { display: flex; flex-direction: column; gap: .4rem; }
.bar { display: grid; grid-template-columns: minmax(6rem, 11rem) 1fr auto; align-items: center; gap: .5rem; font-size: .82rem; }
.bar__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-leise); }
.bar__track { background: var(--flaeche-2); border-radius: 999px; height: 14px; overflow: hidden; }
.bar__fill { display: block; height: 100%; border-radius: 999px; min-width: 3px; }
.bar__wert { font-variant-numeric: tabular-nums; font-weight: 600; font-size: .78rem; white-space: nowrap; }

.stapel { display: flex; height: 18px; border-radius: 999px; overflow: hidden; background: var(--flaeche-2); margin-bottom: .5rem; }
.stapel__teil { display: block; }
.bilder-uebersicht { margin-bottom: .5rem; }
.offen-liste { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .5rem; }
.gut { color: var(--marke-dunkel); font-size: .875rem; }

.tabelle-scroll { overflow-x: auto; margin: 0 -.4rem; padding: 0 .4rem; }
.tabelle { width: 100%; border-collapse: collapse; font-size: .84rem; }
.tabelle th {
  text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-leise); padding: .35rem .5rem; border-bottom: 1px solid var(--rand); white-space: nowrap;
}
.tabelle td { padding: .45rem .5rem; border-bottom: 1px solid var(--rand); white-space: nowrap; }
.tabelle tbody tr { cursor: pointer; }
.tabelle tbody tr:hover { background: var(--flaeche-2); }
.t-leer { color: var(--text-leise); }  /* --rand-stark waere nur 1,7:1 */

/* ---------------- Helfer:in-Bilder ---------------- */

.bilder-liste {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--r-gross);
  overflow: hidden;
  box-shadow: var(--schatten);
}
.bilder-kopf {
  display: grid;
  grid-template-columns: 1fr max-content 28px;
  gap: .5rem;
  align-items: center;
  padding: .5rem .8rem;
  background: var(--flaeche-2);
  border-bottom: 1px solid var(--rand);
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--text-leise);
  font-weight: 700;
}
.bilder-kopf b { width: 30px; text-align: center; font-size: .78rem; }
.bild-zeile {
  display: grid;
  grid-template-columns: 1fr max-content;
  gap: .5rem;
  align-items: center;
  padding: .5rem .8rem;
  border-bottom: 1px solid var(--rand);
}
.bild-zeile:last-child { border-bottom: none; }
.bild-zeile--key { background: color-mix(in srgb, var(--marke-blass) 55%, transparent); }
.bild-zeile--key .bild-zeile__label > span { font-weight: 650; }
.bild-zeile__label { min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.bild-zeile__label > span { font-size: .9rem; }
.bild-zeile__label small { display: flex; gap: .3rem; flex-wrap: wrap; }
.merkmal {
  font-size: .64rem; font-style: normal; text-transform: uppercase; letter-spacing: .04em;
  background: var(--marke); color: #fff; padding: .05rem .35rem; border-radius: 4px; font-weight: 700;
}
.merkmal--grau { background: var(--flaeche-2); color: var(--text-leise); border: 1px solid var(--rand); }
.bild-zeile__stufen { display: flex; gap: .35rem; align-items: center; justify-content: flex-start; min-width: 137px; }
.stufe {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 2px solid var(--rand-stark);
  background: var(--flaeche);
  cursor: pointer;
  padding: 0;
  display: grid;
  place-items: center;
}
.stufe--an { background: var(--marke); border-color: var(--marke); }
.stufe--an::after { content: "✓"; color: #fff; font-size: .8rem; line-height: 1; }

/* ---------------- Einstellungen ---------------- */

.sync-box {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .7rem .8rem;
  border: 1px solid var(--rand);
  border-radius: var(--r);
  background: var(--flaeche-2);
  margin-bottom: .8rem;
  flex-wrap: wrap;
}
.sync-box > div { display: flex; flex-direction: column; flex: 1; min-width: 10rem; }
.sync-box small { font-size: .74rem; color: var(--text-leise); }
.sync-box--aktiv .punkt { background: #45a049; }
.sync-box--fehler { border-color: var(--rot); }
.sync-box--fehler .punkt { background: var(--rot); }
.sync-box--offline .punkt, .sync-box--verbinde .punkt { background: var(--orange); }

.stamm-liste { display: flex; flex-direction: column; gap: .4rem; margin-bottom: .5rem; }
.stamm { display: flex; align-items: center; gap: .5rem; }
.stamm > span { flex: 1; font-size: .875rem; }
.stamm .input { flex: 1; }

.version { display: flex; flex-direction: column; margin-bottom: .3rem; }
.version span { font-size: .78rem; color: var(--text-leise); }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .85em;
  background: var(--flaeche-2);
  padding: .05rem .3rem;
  border-radius: 4px;
}

/* ---------------- Sonstiges ---------------- */

.filterleiste { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.filterleiste .input { flex: 1 1 10rem; width: auto; min-height: 40px; }

.leer {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-leise);
  border: 1.5px dashed var(--rand-stark);
  border-radius: var(--r-gross);
  background: var(--flaeche);
}
.leer p { max-width: 40ch; margin: 0 auto .8rem; }

.fab {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: calc(1rem + env(safe-area-inset-bottom));
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--marke);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .22);
  z-index: 25;
}
.fab:hover { background: var(--marke-dunkel); }

.update-bar {
  border-bottom: 1px solid rgba(0,0,0,.15);
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center; gap: .8rem;
  background: var(--marke); color: #fff;
  padding: .5rem .9rem; font-size: .875rem;
}

.toasts {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(5rem + env(safe-area-inset-bottom));
  z-index: 60;
  display: flex; flex-direction: column; gap: .4rem; align-items: center;
  pointer-events: none;
  width: min(92vw, 30rem);
}
.toast {
  background: var(--text); color: var(--grund);
  padding: .55rem .9rem; border-radius: var(--r);
  font-size: .875rem; box-shadow: var(--schatten);
  opacity: 0; transform: translateY(8px); transition: .25s ease;
  text-align: center;
}
.toast--an { opacity: 1; transform: none; }
.toast--fehler { background: var(--rot); color: #fff; }

.modal-back {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(0, 0, 0, .45);
  display: grid; place-items: center; padding: 1rem;
}
.modal {
  background: var(--flaeche);
  border-radius: var(--r-gross);
  padding: 1.2rem;
  max-width: 26rem; width: 100%;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .3);
}
.modal__text { margin-bottom: 1rem; }
.modal__aktionen { display: flex; gap: .5rem; justify-content: flex-end; }

.start-laden { display: flex; align-items: center; gap: .6rem; justify-content: center; padding: 4rem 1rem; color: var(--text-leise); }
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid var(--rand-stark); border-top-color: var(--marke);
  animation: dreh .8s linear infinite;
}
@keyframes dreh { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

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

@media print {
  .kopf, .fab, .tabs, .editor__aktionen, .editor__fuss, .toasts, .update-bar, .filterleiste { display: none !important; }
  body { background: #fff; }
  .karte { border: 1px solid #ccc; box-shadow: none; break-inside: avoid; page-break-inside: avoid; }
  .inhalt { padding: 0; max-width: none; }
  .input { border-color: #ccc; }
}

/* ==========================================================================
   Freigabe-Schranke, Einrichtungs-Assistent und Abgleich-Protokoll
   ========================================================================== */

/* --- Statusabzeichen Entwurf / abgeschlossen --- */
.abz {
  display: inline-block;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .15rem .5rem;
  border-radius: 999px;
  vertical-align: middle;
  white-space: nowrap;
}
.abz--entwurf { background: #fff3d4; color: #8a5d00; border: 1px solid #e8c877; }
.abz--fertig { background: var(--marke-blass); color: var(--marke-dunkel); border: 1px solid var(--marke-hell); }
.abz--klein { font-size: .62rem; padding: .1rem .4rem; }
@media (prefers-color-scheme: dark) {
  .abz--entwurf { background: #3a2f12; color: #f0cf7d; border-color: #6b5620; }
}

/* --- Abschluss-Karte im Editor --- */
.karte--abschluss { border-color: var(--marke-hell); border-width: 2px; }
.karte--fertig { border-color: var(--rand); background: var(--marke-blass); }
.abschluss__ok { color: var(--marke-dunkel); font-weight: 600; }
.abschluss__offen { font-weight: 600; margin-bottom: .3rem; }
.offen-punkte {
  margin: 0 0 .9rem;
  padding-left: 1.1rem;
  color: var(--text-leise);
  font-size: .875rem;
  line-height: 1.7;
}
.fortschritt-zeile { display: flex; align-items: center; gap: .7rem; margin-bottom: .7rem; }
.fortschritt-balken {
  /* Als <span> waere das Element inline und ignorierte Hoehe und Breite –
     ausserhalb von .fortschritt-zeile blieb der Balken deshalb unsichtbar. */
  display: block;
  width: 100%;
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: var(--flaeche-2);
  overflow: hidden;
}
.fortschritt-balken span { display: block; height: 100%; background: var(--marke); border-radius: 999px; transition: width .25s ease; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn[disabled]:hover { background: var(--marke); }

.freigabe-info {
  background: var(--flaeche-2);
  border-radius: var(--r);
  padding: .6rem .8rem;
  font-size: .875rem;
  margin-bottom: .8rem;
}
.freigabe-info small { display: block; color: var(--text-leise); font-size: .78rem; margin-top: .2rem; }

/* --- Assistent: Schrittleiste --- */
.schritte {
  display: flex;
  gap: .4rem;
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.schritte::-webkit-scrollbar { display: none; }
.schritte li {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex: none;
  font-size: .82rem;
  color: var(--text-leise);
  padding: .35rem .7rem .35rem .35rem;
  border-radius: 999px;
  background: var(--flaeche-2);
  border: 1px solid var(--rand);
}
.schritte li span {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--rand);
  color: var(--text);  /* --text-leise waere auf --rand nur 4,0:1 */
  font-size: .72rem;
  font-weight: 700;
}
.schritte .schritt--an { background: var(--marke-blass); border-color: var(--marke); color: var(--marke-dunkel); font-weight: 650; }
.schritte .schritt--an span { background: var(--marke); color: #fff; }
.schritte .schritt--fertig span { background: var(--marke); color: #fff; }

/* --- Assistent: Verfahrenswahl --- */
.wahlen { display: grid; gap: .7rem; margin-bottom: .8rem; }
@media (min-width: 700px) { .wahlen { grid-template-columns: 1fr 1fr; } }
.wahl {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  text-align: left;
  padding: .8rem .9rem;
  font: inherit;
  color: var(--text);
  background: var(--flaeche);
  border: 2px solid var(--rand);
  border-radius: var(--r);
  cursor: pointer;
}
.wahl:hover { border-color: var(--marke-hell); }
.wahl--an { border-color: var(--marke); background: var(--marke-blass); }
.wahl strong { font-size: .98rem; }
.wahl > span { font-size: .84rem; color: var(--text-leise); }
.wahl__liste { list-style: none; margin: .4rem 0 0; padding: 0; font-size: .8rem; display: grid; gap: .2rem; }
.wahl__liste li { padding-left: 1.3rem; position: relative; color: var(--text-leise); }
.wahl__liste li::before { position: absolute; left: 0; font-weight: 700; }
.wahl__liste .ja::before { content: "+"; color: #2e7d32; }
.wahl__liste .nein::before { content: "−"; color: var(--text-leise); }

/* --- Assistent: Anleitung --- */
.anleitung { margin: 0 0 1rem; padding-left: 1.2rem; font-size: .9rem; line-height: 1.6; }
.anleitung li { margin-bottom: .5rem; }
.anleitung em { color: var(--text-leise); font-style: normal; }

/* --- Assistent: Prüfliste --- */
.pruefliste { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .5rem; }
.pruef {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  padding: .6rem .7rem;
  border-radius: var(--r);
  border: 1px solid var(--rand);
  background: var(--flaeche-2);
  font-size: .875rem;
}
.pruef__zeichen {
  width: 20px; height: 20px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: .75rem; font-weight: 700; color: #fff;
  margin-top: .1rem;
}
.pruef__text em { display: block; color: var(--text-leise); font-style: normal; font-size: .82rem; margin-top: .15rem; }
.pruef--ok .pruef__zeichen { background: #2e7d32; }
.pruef--ok .pruef__zeichen::after { content: "✓"; }
.pruef--warnung { border-color: #e8c877; background: #fff9ec; }
.pruef--warnung .pruef__zeichen { background: #c88a00; }
.pruef--warnung .pruef__zeichen::after { content: "!"; }
.pruef--fehler { border-color: var(--marke); background: var(--marke-blass); }
.pruef--fehler .pruef__zeichen { background: var(--marke); }
.pruef--fehler .pruef__zeichen::after { content: "×"; }
@media (prefers-color-scheme: dark) {
  .pruef--warnung { background: #332c17; }
}
.pruef-laden { display: flex; align-items: center; gap: .6rem; padding: 1.5rem 0; color: var(--text-leise); }

/* --- Abgleich-Protokoll --- */
.protokoll { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; font-size: .82rem; }
.prot { display: flex; gap: .6rem; align-items: baseline; padding: .25rem .5rem; border-radius: 6px; }
.prot__zeit { color: var(--text-leise); font-variant-numeric: tabular-nums; flex: none; font-size: .78rem; }
.prot--fehler { background: var(--marke-blass); color: var(--marke-dunkel); }
.prot--gesendet, .prot--empfangen { background: var(--flaeche-2); }
.prot--info { color: var(--text-leise); }

/* --- Schnelleingabe des Zugangs-Tokens --- */
.token-kasten {
  border: 2px solid var(--marke);
  background: var(--marke-blass);
  border-radius: var(--r);
  padding: .8rem .9rem;
  margin-bottom: .8rem;
}
.token-kasten h3 { font-size: .95rem; margin-bottom: .3rem; }
.token-kasten p { font-size: .875rem; margin-bottom: .5rem; }
.token-kasten .btn-zeile { margin: .5rem 0; }
.token-kasten .input { flex: 1 1 14rem; }
.sync-box--kein-token { border-color: var(--marke); }
.sync-box--kein-token .punkt { background: var(--marke); }
.sync-chip--kein-token { background: #fff; color: var(--auf-weiss); border-color: #fff; font-weight: 650; }
.sync-chip--kein-token .punkt { background: #b3040f; }

/* --- Zweite Dokumentart: freie Dokumentation --- */
.abz--art {
  background: var(--flaeche-2);
  color: var(--text-leise);
  border: 1px solid var(--rand-stark);
}
.such-karte--frei { border-left: 4px solid var(--rand-stark); }
.btn-zeile--mitte { justify-content: center; }

/* --- Knopf zum manuellen Neuladen, neben der Statusanzeige --- */
.kopf__rechts { display: flex; align-items: center; gap: .4rem; min-width: 0; flex: 0 1 auto; }
/* Abgleich-Status und Neu-laden bleiben ganz; nur der Name gibt Platz ab. */
.kopf__rechts .sync-chip { flex: 0 0 auto; }
.marke__text { min-width: 3.5rem; }

/* Auf schmalen Geraeten passen Name, Status und Schriftzug nicht nebeneinander.
   Der farbige Punkt traegt die Lage des Abgleichs ohnehin – das Wort entfaellt,
   die Beschriftung bleibt ueber aria-label und title erhalten. */
@media (max-width: 400px) {
  .sync-chip__text { display: none; }
  .sync-chip { padding: .3rem .45rem; }
}
.kopf-knopf {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .55);
  background: rgba(0, 0, 0, .2);
  color: #fff;
  cursor: pointer;
}
.kopf-knopf:hover { background: rgba(0, 0, 0, .34); }
.kopf-knopf svg { width: 19px; height: 19px; }
.kopf-knopf--dreht { pointer-events: none; }
.kopf-knopf--dreht svg { animation: dreh .7s linear infinite; }

/* ==========================================================================
   Verbellen: Sitzung und Fortschrittskatalog
   ========================================================================== */

.such-karte--verbellen { border-left: 4px solid var(--marke-hell); }

/* --- Bearbeitete Stufen in der Sitzung --- */
.einheit {
  border: 1px solid var(--rand);
  border-radius: var(--r);
  background: var(--flaeche-2);
  padding: .7rem .8rem;
  margin-bottom: .8rem;
}
.einheit__kopf { display: flex; align-items: flex-start; gap: .6rem; margin-bottom: .6rem; }
.einheit__kopf > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .2rem; }
.einheit__kopf strong { font-size: .95rem; line-height: 1.3; }
.einheit__kopf small { font-size: .75rem; color: var(--text-leise); }
.einheit__kopf .abz { align-self: flex-start; }
.gesperrt { font-style: normal; color: var(--rot-text); }

.uebungen { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .6rem; }
.uebung {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .4rem .55rem;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: 8px;
}
.uebung--fertig { border-color: var(--marke-hell); background: var(--marke-blass); }
.uebung--zusatz { border-style: dashed; }
.uebung__text { flex: 1; min-width: 0; font-size: .85rem; line-height: 1.35; }
.uebung__text small { display: block; font-size: .72rem; color: var(--text-leise); }
.uebung__text .input { width: 100%; }
.uebung__wdh { display: flex; gap: .3rem; align-items: center; flex: none; }

.wdh {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid var(--rand-stark);
  background: var(--flaeche);
  padding: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
}
button.wdh:hover { border-color: var(--marke); }
.wdh--heute { background: var(--marke); border-color: var(--marke); }
.wdh--heute::after { content: "✓"; color: #fff; font-size: .72rem; font-weight: 700; }
.wdh--frueher { background: var(--marke-hell); border-color: var(--marke-hell); }
.wdh--frueher::after { content: "✓"; color: #16181b; font-size: .72rem; font-weight: 700; }
.wdh[disabled] { cursor: default; }
span.wdh { cursor: default; }

/* --- Stufenauswahl --- */
.modal--gross { max-width: 44rem; max-height: 82vh; display: flex; flex-direction: column; }
.stufenwahl__liste { overflow-y: auto; flex: 1; margin: .5rem 0; }
.stufenwahl__gruppe h3 {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-leise); margin: .8rem 0 .4rem;
}
.stufenwahl {
  display: flex; align-items: flex-start; gap: .6rem; width: 100%;
  text-align: left; padding: .5rem .6rem; margin-bottom: .25rem;
  font: inherit; color: var(--text);
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: 8px; cursor: pointer;
}
.stufenwahl:hover { border-color: var(--marke); }
.stufenwahl--empfohlen { border-color: var(--marke); background: var(--marke-blass); }
.stufenwahl--fertig { opacity: .62; }
.stufenwahl__n {
  width: 26px; height: 26px; flex: none; display: grid; place-items: center;
  border-radius: 50%; background: var(--flaeche-2); font-size: .75rem; font-weight: 700;
}
.stufenwahl__text { font-size: .86rem; line-height: 1.35; }
.stufenwahl__text small { display: block; font-size: .74rem; color: var(--text-leise); }

/* --- Fortschrittskatalog --- */
.kacheln--schlank { grid-template-columns: repeat(3, 1fr); margin: .7rem 0; }
.schalter { display: flex; align-items: center; gap: .5rem; font-size: .84rem; margin-top: .6rem; }
.schalter input { width: 20px; height: 20px; accent-color: var(--marke); flex: none; }

.stufen-liste { display: flex; flex-direction: column; gap: .5rem; }
.stufe-karte {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--schatten);
}
.stufe-karte--fertig { border-color: var(--marke-hell); }
.stufe-karte--gesperrt { opacity: .72; }
.stufe-karte__kopf {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .6rem;
  align-items: center;
  width: 100%;
  padding: .6rem .8rem;
  font: inherit; text-align: left; color: var(--text);
  background: none; border: none; cursor: pointer;
}
.stufe-karte__n {
  width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: 50%; background: var(--flaeche-2); font-weight: 700; font-size: .8rem;
}
.stufe-karte--fertig .stufe-karte__n { background: var(--marke); color: #fff; }
.stufe-karte__text { min-width: 0; }
.stufe-karte__text strong { display: block; font-size: .9rem; line-height: 1.3; }
.stufe-karte__text small { font-size: .74rem; color: var(--text-leise); }
.stufe-karte__balken {
  display: block;
  grid-column: 1 / -1;
  height: 5px; border-radius: 999px; background: var(--flaeche-2); overflow: hidden;
}
.stufe-karte__balken span { display: block; height: 100%; background: var(--marke); border-radius: 999px; }
.stufe-karte__inhalt { padding: 0 .8rem .8rem; display: flex; flex-direction: column; gap: .3rem; }

/* --- Dashboard-Block --- */
.verbellen-uebersicht { display: flex; flex-direction: column; gap: .9rem; }
.vb-zeile__kopf { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.vb-zeile__wert { font-weight: 700; font-variant-numeric: tabular-nums; }
.vb-zeile__wert small { font-weight: 500; color: var(--text-leise); margin-left: .3rem; }
.vb-zeile .fortschritt-balken { margin: .3rem 0; }
.vb-zeile__zeile2 { display: flex; gap: .3rem; flex-wrap: wrap; }
.vb-zeile__naechste { font-size: .82rem; color: var(--text-leise); margin: .35rem 0 0; }
.leer--schlank { padding: 1.2rem 1rem; }

/* --- Helfer:in-Bilder: Herkunft der Angabe sichtbar machen --- */
.bild-zeile--ungeuebt .bild-zeile__label > span { color: var(--text-leise); }
.merkmal--suche { background: var(--blau-flaeche); color: #fff; border: none; }
.merkmal--offen { background: transparent; color: var(--rot-text); border: 1px dashed currentColor; }
.stufe--auto { background: var(--marke-hell); border-color: var(--marke-hell); }
.stufe--auto::after { content: "✓"; color: #16181b; font-size: .8rem; line-height: 1; }

/* --- Programmstand in den Einstellungen --- */
.programmstand {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .2rem .7rem;
  margin: .6rem 0;
  font-size: .82rem;
}
.programmstand dt { color: var(--text-leise); }
.programmstand dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.notfall { margin-top: .8rem; border-top: 1px solid var(--rand); padding-top: .6rem; }
.notfall summary { font-size: .84rem; color: var(--text-leise); cursor: pointer; }
.notfall p { margin-top: .5rem; }

/* ==========================================================================
   Rollen und Bestätigung
   ========================================================================== */

.rollen-abz {
  font-size: .72rem;
  font-weight: 650;
  padding: .25rem .55rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, .2);
  border: 1px solid rgba(255, 255, 255, .55);
  color: #fff;
  white-space: nowrap;
  max-width: 9rem;
  min-width: 5rem;   /* "Ausbildung" bzw. ein erkennbarer Namensanfang */
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rollen-abz--ausbilder { background: #fff; color: var(--auf-weiss); border-color: #fff; }

.abz--bestaetigt { background: #dff0e3; color: #1f5c33; border: 1px solid #9ecdae; }
.abz--offen-best { background: #fff3d4; color: #7a5300; border: 1px solid #e8c877; }
@media (prefers-color-scheme: dark) {
  .abz--bestaetigt { background: #16301f; color: #8fd8a6; border-color: #2f5c3d; }
  .abz--offen-best { background: #3a2f12; color: #f0cf7d; border-color: #6b5620; }
}

.karte--bestaetigt { border-color: #9ecdae; background: color-mix(in srgb, #dff0e3 45%, var(--flaeche)); }
.karte--bestaetigen { border-color: var(--marke); border-width: 2px; }
.karte--wartet { border-style: dashed; }
.bestaetigung__bemerkung {
  font-style: italic;
  color: var(--text-leise);
  border-left: 3px solid var(--rand-stark);
  padding-left: .7rem;
  margin: .5rem 0;
}

.stamm--hund { flex-direction: column; align-items: stretch; gap: .35rem; padding-bottom: .5rem; border-bottom: 1px solid var(--rand); }
.stamm__zeile { display: flex; gap: .5rem; align-items: center; }
.stamm__zeile .input { flex: 1; }
.stamm__warnung { font-size: .74rem; color: var(--rot-text); }

/* --- Passwortabfrage --- */
.modal .input[type="password"] { margin-bottom: .5rem; }
.modal__fehler { color: var(--rot-text); font-size: .85rem; margin: 0 0 .5rem; font-weight: 600; }

/* --- Festes, nicht wählbares Feld (z.B. Hundeführer:in am eigenen Gerät) --- */
.feld-fest {
  min-height: var(--tap);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: .45rem .7rem;
  background: var(--flaeche-2);
  border: 1px dashed var(--rand-stark);
  border-radius: var(--r);
  font-size: .95rem;
}
.feld-fest small { color: var(--text-leise); font-size: .72rem; }

/* --- Einstiegs-Hinweis --- */
.hinweis-kasten {
  border: 2px solid var(--marke);
  background: var(--marke-blass);
  border-radius: var(--r-gross);
  padding: .9rem 1rem;
}
.hinweis-kasten strong { display: block; margin-bottom: .3rem; }
.hinweis-kasten p { margin: 0; font-size: .88rem; }

/* --- Zuordnung Hundeführer:in zu einem Hund --- */
.zuordnung {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  padding: .5rem .6rem;
  background: var(--flaeche-2);
  border: 1px solid var(--rand);
  border-left: 3px solid var(--marke);
  border-radius: var(--r);
}
.zuordnung__label { font-size: .82rem; color: var(--text-leise); }
.zuordnung__label strong { color: var(--text); }
.zuordnung__liste { display: flex; flex-wrap: wrap; gap: .35rem; }
.zuordnung__tag {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .2rem .3rem .2rem .6rem;
  font-size: .84rem;
  font-weight: 550;
  background: var(--marke-blass);
  border: 1px solid var(--marke-hell);
  border-radius: 999px;
  color: var(--marke-dunkel);
}
.zuordnung__tag button {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: .95rem;
  line-height: 1;
  cursor: pointer;
}
.zuordnung__tag button:hover { background: color-mix(in srgb, var(--marke) 20%, transparent); }
.zuordnung__auswahl { max-width: 22rem; }
.zuordnung__fertig { font-size: .76rem; color: var(--text-leise); }

/* --- Selbst angelegte Helfer:in-Bilder --- */
.merkmal--eigen { background: var(--blau-flaeche); color: #fff; border: none; }
.bild-zeile { grid-template-columns: 1fr max-content 28px; }
.bild-zeile__weg { display: grid; place-items: center; }
.schalter--knapp { font-size: .82rem; white-space: nowrap; }
.schalter--knapp input { width: 18px; height: 18px; }

/* --- Skala 0 bis 5 (Anzeige in der Trümmersuche) --- */
.skala--null .dot { width: 27px; height: 27px; }
@media (max-width: 420px) { .skala--null { gap: .3rem; } .skala--null .dot { width: 24px; height: 24px; } }

/* --- Zusätzliche Angaben zur Versteckperson (Trümmersuche) --- */
.versteck-raster { margin-bottom: .2rem; }
.mini-wahl { display: flex; flex-wrap: wrap; gap: .3rem; min-height: var(--tap); align-items: center; }
.krit--anzeige { border-top: 1px solid var(--rand); border-bottom: none; padding-top: .6rem; }

/* --- Sparte der Suche --- */
.abz--truemmer { background: #5a4632; color: #fff; border-color: #5a4632; }
.such-karte--truemmer { border-left: 4px solid #8a6d4d; }
@media (prefers-color-scheme: dark) {
  .abz--truemmer { background: #a8825c; color: #16181b; border-color: #a8825c; }
}

/* Trümmersuche: eigener Farbton, damit die beiden Sparten unterscheidbar sind
   und nicht zwei gleich starke rote Knöpfe nebeneinander stehen. */
.btn--truemmer { background: #6b533a; border-color: #6b533a; color: #fff; }
.btn--truemmer:hover { background: #55412d; border-color: #55412d; }

/* ==========================================================================
   Fotos
   ========================================================================== */

.fotos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: .6rem;
  margin-bottom: .6rem;
}
.foto {
  position: relative;
  margin: 0;
  border: 1px solid var(--rand);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--flaeche-2);
}
.foto__bild {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  background: var(--flaeche-2);
}
.foto__bild img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.foto__fehlt { font-size: .72rem; color: var(--text-leise); text-align: center; padding: .4rem; }
.foto figcaption {
  font-size: .7rem;
  color: var(--text-leise);
  padding: .25rem .4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.foto__weg {
  position: absolute;
  top: .3rem;
  right: .3rem;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, .62);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.foto__weg:hover { background: var(--rot); }

.foto-neu {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  aspect-ratio: 4 / 3;
  border: 2px dashed var(--rand-stark);
  border-radius: var(--r);
  color: var(--text-leise);
  font-size: .78rem;
  text-align: center;
  cursor: pointer;
  padding: .4rem;
}
.foto-neu:hover { border-color: var(--marke); color: var(--marke-dunkel); }
.foto-neu__zeichen { font-size: 1.6rem; line-height: 1; color: var(--marke); }

.foto-gross { padding: 1rem; flex-direction: column; gap: .8rem; }
.foto-gross img { max-width: 100%; max-height: 82vh; border-radius: var(--r); }

/* --- Schwierigkeit der Verstecke (Dashboard) --- */
.verstecke { display: flex; flex-direction: column; gap: 1.1rem; }
.vs-zeile__kopf { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.vs-zeile__summe { font-size: .8rem; color: var(--text-leise); }
.vs-zeile .stapel { margin: .35rem 0 .5rem; }
.vs-tabelle { width: 100%; border-collapse: collapse; font-size: .85rem; }
.vs-tabelle th {
  text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-leise); padding: .2rem .4rem; border-bottom: 1px solid var(--rand);
}
.vs-tabelle td { padding: .35rem .4rem; border-bottom: 1px solid var(--rand); }
.vs-tabelle tr:last-child td { border-bottom: none; }
.vs-zahl { font-variant-numeric: tabular-nums; font-weight: 650; }
.vs-punkt {
  display: inline-block; width: 10px; height: 10px; border-radius: 3px;
  margin-right: .45rem; vertical-align: -1px;
}
.vs-nie { color: var(--text-leise); }

/* --- Schnellzugriff: alle Eintragsarten --- */
.fab-bereich {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: calc(1rem + env(safe-area-inset-bottom));
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .6rem;
}
.fab-bereich .fab { position: static; border: none; font-family: inherit; }
.fab--offen { transform: rotate(45deg); }
.fab { transition: transform .18s ease; }

.fab-menue {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  align-items: flex-end;
}
.fab-menue a {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-height: var(--tap);
  padding: .55rem 1rem;
  border-radius: 999px;
  background: var(--flaeche);
  border: 1px solid var(--rand-stark);
  box-shadow: var(--schatten);
  color: var(--text);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 550;
  white-space: nowrap;
}
.fab-menue a:hover { border-color: var(--marke); }
.fab-menue__punkt { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.fab-menue__punkt--flaeche { background: var(--marke); }
.fab-menue__punkt--truemmer { background: #6b533a; }
.fab-menue__punkt--verbellen { background: var(--marke-hell); }
.fab-menue__punkt--frei { background: var(--rand-stark); }

/* --- Versteckperson je Helfer:in --- */
.person-wahl { display: flex; gap: .4rem; align-items: center; }
.person-wahl .input { flex: 1; }

/* --- Einrichtungsassistent --- */
.seite--start { max-width: 46rem; margin: 0 auto; }
.start-kopf { text-align: center; margin-bottom: .3rem; }
.start-kopf h1 { font-size: 1.6rem; }
.start-kopf p { color: var(--text-leise); font-size: .92rem; margin: .2rem 0 0; }
.seite--start .schritte { justify-content: center; }
.start-fuss { text-align: center; display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.seite--start .text { font-size: .92rem; }

/* ================================================================
   Nachweise: Führerscheinkontrollen und Impfungen
   Die Farbpaare sind in sich geschlossen (heller Grund, dunkle Schrift) –
   wie die übrigen Abzeichen. So kippt im dunklen Modus nichts um.
   ================================================================ */

/* --- Einblendung über dem Inhalt --- */
.hinweise-leiste {
  max-width: 1180px;
  margin: 0 auto;
  padding: .8rem .9rem 0;
  display: grid;
  gap: .4rem;
}
.hinweis {
  display: block;
  padding: .6rem .85rem;
  border-radius: var(--r);
  border: 1px solid;
  font-size: .88rem;
  line-height: 1.35;
  text-decoration: none;
}
.hinweis::after { content: ' →'; }
.hinweis--bald { background: #fff3d4; color: #6b4a00; border-color: #e8c877; }
.hinweis--abgelaufen { background: #fde2df; color: #8f1d12; border-color: #f0aaa2; font-weight: 600; }
.hinweis--wartet { background: var(--flaeche); color: var(--text); border-color: var(--rand-stark); }
.hinweis--ausbildung { background: var(--flaeche); color: var(--text); border-color: var(--rand-stark);
  border-left: 4px solid var(--marke); }

/* --- Abzeichen zur Lage eines Termins --- */
.abz--gueltig { background: #dff0e3; color: #1f5c33; border: 1px solid #9ecdae; }
.abz--bald { background: #fff3d4; color: #6b4a00; border: 1px solid #e8c877; }
.abz--abgelaufen { background: #fde2df; color: #8f1d12; border: 1px solid #f0aaa2; }
.abz--nicht-erfasst { background: var(--flaeche-2); color: var(--text-leise); border: 1px solid var(--rand-stark); }

/* --- Seite --- */
.nachweis-liste { display: grid; gap: .6rem; }
.nachweis {
  border: 1px solid var(--rand);
  border-radius: var(--r);
  padding: .7rem .8rem;
  background: var(--flaeche-2);
}
.nachweis__kopf { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.nachweis__daten { display: grid; grid-template-columns: 1fr; gap: .5rem; margin: .6rem 0 0; }
.nachweis__daten > div { min-width: 0; }
.nachweis__daten dt { font-size: .74rem; font-weight: 600; color: var(--text-leise); margin-bottom: .15rem; }
.nachweis__daten dd { margin: 0; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.nachweis__daten dd small { color: var(--text-leise); font-size: .78rem; }
.nachweis .btn-zeile { margin: .6rem 0 0; }
.nachweis .karte__hint { margin: .5rem 0 0; }
.input--datum { max-width: 11rem; }
@media (min-width: 560px) {
  .nachweis__daten { grid-template-columns: 1fr 1fr; }
}

.nachweis-hund + .nachweis-hund { margin-top: 1.1rem; }
.nachweis-hund h3 small { font-weight: 500; color: var(--text-leise); text-transform: none; letter-spacing: 0; }

.nachweis-offen { display: grid; gap: .4rem; margin-top: .6rem; }
.nachweis-offen__zeile {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  padding: .45rem .55rem; border-radius: 8px;
  background: var(--flaeche); border: 1px dashed var(--rand-stark);
}
.nachweis-offen__text { flex: 1 1 12rem; min-width: 0; font-size: .86rem; }
.nachweis-offen__text small { display: block; color: var(--text-leise); font-size: .76rem; }
.nachweis-offen__knoepfe { display: inline-flex; gap: .3rem; }
