/* RangeTally – Farben siehe marketing/markenbuch */
:root {
  --bg: #f9f9fb;
  --flaeche: #ffffff;
  --flaeche-2: #f0f1f3;
  --text: #111518;
  --text-2: #555b61;
  --rand: #e0e5eb;
  --akzent: #D99A1E;
  --akzent-text: #111518;
  --akzent-hell: #f6e7c8;
  --link: #8a5d08;
  --dunkel: #0E1A24;
  --gruen: #7cc45c;
  --warn: #c0392b;
  --warn-hell: #fcf2f0;
  --ok: #3d8b1f;
  --gelb: #a8761b;
  --gelb-hell: #f7ecd4;
  --schatten: 0 1px 2px rgba(0,0,0,.04), 0 4px 14px rgba(0,0,0,.05);
  --radius: 12px;
  --schrift-titel: "Barlow Semi Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111518;
    --flaeche: #1a1f24;
    --flaeche-2: #242a30;
    --text: #f2f3f5;
    --text-2: #a3abb3;
    --rand: #2f363d;
    --akzent: #D99A1E;
    --akzent-text: #111518;
    --akzent-hell: #3a2d12;
    --link: #F0B84A;
    --dunkel: #000000;
    --warn: #ef7a63;
    --warn-hell: #3a221c;
    --ok: #7cc45c;
    --gelb: #e0b45c;
    --gelb-hell: #3a301b;
    --schatten: 0 1px 2px rgba(0,0,0,.4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111518;
  --flaeche: #1a1f24;
  --flaeche-2: #242a30;
  --text: #f2f3f5;
  --text-2: #a3abb3;
  --rand: #2f363d;
  --akzent: #D99A1E;
  --akzent-text: #111518;
  --akzent-hell: #3a2d12;
  --link: #F0B84A;
  --dunkel: #000000;
  --warn: #ef7a63;
  --warn-hell: #3a221c;
  --ok: #7cc45c;
  --gelb: #e0b45c;
  --gelb-hell: #3a301b;
  --schatten: 0 1px 2px rgba(0,0,0,.4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
h1, h2, h3 { font-family: var(--schrift-titel); font-weight: 700; letter-spacing: .01em; }
h1 { font-size: 1.75rem; margin: 0 0 1rem; text-transform: uppercase; }
h2 { font-size: 1.3rem; margin: 0 0 .75rem; }
h3 { font-size: 1.1rem; margin: 0 0 .5rem; }
.leise { color: var(--text-2); }
.klein { font-size: .875rem; }
.zahl { font-variant-numeric: tabular-nums; }

/* Kopfzeile */
header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .6rem 16px; padding-top: max(.6rem, env(safe-area-inset-top));
  background: var(--flaeche); border-bottom: 3px solid var(--akzent);
}
.marke { display: flex; align-items: center; gap: .6rem; font-family: var(--schrift-titel); font-weight: 700; font-size: 1.25rem; letter-spacing: .02em; }
.marke img { height: 52px; width: auto; }
/* Kopfzeile zweizeilig: Logo + Benutzer oben, Navigation darunter */
header .marke { order: 1; }
header .benutzer { order: 2; margin-left: auto; }
header nav { order: 3; flex-basis: 100%; }
@media (max-width: 600px) { .marke img { height: 40px; } .marke span { display: none; } }
/* Logo hat dunkle Schrift: im Dunkelmodus auf hellem Untergrund */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .marke img { background: #fff; border-radius: 8px; padding: 3px 6px; } }
:root[data-theme="dark"] .marke img { background: #fff; border-radius: 8px; padding: 3px 6px; }
nav { display: flex; gap: .25rem; flex-wrap: wrap; flex: 1; }
nav a {
  padding: .5rem .8rem; border-radius: 8px; color: var(--text); text-decoration: none; font-weight: 500;
}
nav a:hover { background: var(--flaeche-2); }
nav a.aktiv { background: var(--akzent); color: var(--akzent-text); font-weight: 700; }
.benutzer { display: flex; align-items: center; gap: .75rem; font-size: .9rem; color: var(--text-2); }

main { max-width: 1200px; margin: 0 auto; padding: 20px 16px 60px; }

/* Bausteine */
.karte {
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius);
  padding: 1rem; box-shadow: var(--schatten);
}
.karte + .karte { margin-top: 1rem; }
.zeile { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.zeile.ende { justify-content: flex-end; }
.zeile.zwischen { justify-content: space-between; }
.raster { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.zwei-spalten { display: grid; gap: 1rem; grid-template-columns: minmax(280px, 380px) 1fr; align-items: start; }
@media (max-width: 820px) { .zwei-spalten { grid-template-columns: 1fr; } }

button, .knopf {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: 999px;
  padding: .65rem 1.1rem; border: 1px solid var(--rand); background: var(--flaeche); color: var(--text);
  min-height: 44px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
}
button:hover, .knopf:hover { background: var(--flaeche-2); }
button.primaer, .knopf.primaer { background: var(--akzent); color: var(--akzent-text); border-color: var(--akzent); }
button.primaer:hover { filter: brightness(1.08); }
button.gefahr { color: var(--warn); border-color: var(--warn); }
button.link { border: 0; background: none; padding: .25rem; min-height: 0; color: var(--link); font-weight: 500; border-radius: 6px; }
a { color: var(--link); }
nav a, a.chip, a.knopf { color: inherit; }
button:disabled { opacity: .5; cursor: default; }
button.gross { font-size: 1.15rem; padding: .9rem 1.4rem; min-height: 56px; }

label { display: block; font-size: .875rem; font-weight: 600; color: var(--text-2); margin-bottom: .3rem; }
input, select, textarea {
  font: inherit; width: 100%; padding: .65rem .75rem; min-height: 44px;
  border: 1px solid var(--rand); border-radius: 10px; background: var(--flaeche); color: var(--text);
}
input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--akzent) 35%, transparent); outline-offset: 1px; border-color: var(--akzent);
}
input[type="checkbox"] { width: 22px; height: 22px; min-height: 0; accent-color: var(--akzent); }
.feld { margin-bottom: .9rem; }
.felder { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; color: var(--text); }

.suche { font-size: 1.2rem; padding: .9rem 1rem; min-height: 56px; }

.badge {
  display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600;
  background: var(--flaeche-2); color: var(--text-2);
}
.badge.offen { background: var(--gelb-hell); color: var(--gelb); }
.badge.erledigt { background: var(--akzent-hell); color: var(--ok); }
.badge.inaktiv { background: var(--warn-hell); color: var(--warn); }

/* Listen */
.liste { list-style: none; margin: 0; padding: 0; }
.liste > li { border-bottom: 1px solid var(--rand); }
.liste > li:last-child { border-bottom: 0; }
.eintrag {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem; width: 100%;
  padding: .85rem .5rem; background: none; border: 0; border-radius: 8px; text-align: left; min-height: 56px;
  font-weight: 500;
}
.eintrag:hover { background: var(--flaeche-2); }
.eintrag.gewaehlt { background: var(--akzent-hell); }
.eintrag .titel { font-weight: 600; }

/* Nennungskarten am Stand */
.nennung {
  border: 1px solid var(--rand); border-radius: var(--radius); padding: 1rem; background: var(--flaeche);
  display: flex; flex-direction: column; gap: .5rem;
}
.nennung.offen { border-left: 5px solid var(--gelb); }
.nennung.erledigt { border-left: 5px solid var(--ok); }
.nennung .ergebnis { font-size: 1.6rem; font-weight: 700; }

.werteingabe { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); margin: 1rem 0; }
.werteingabe input { font-size: 1.4rem; text-align: center; min-height: 58px; }
.dartblock {
  padding: .75rem 1rem; margin-bottom: .75rem; border: 1px solid var(--rand); border-radius: 10px; background: var(--flaeche-2);
}
.darttabelle { margin-top: .5rem; }
.ipscblock {
  padding: .75rem 1rem; margin-bottom: .75rem; border: 1px solid var(--rand); border-radius: 10px; background: var(--flaeche-2);
}
.ipscblock .zaehler:last-of-type { margin-bottom: .4rem; }
.darttabelle th, .darttabelle td { padding: .2rem .4rem; text-align: center; border-bottom: 1px solid var(--rand); }
.darttabelle tbody th { font-size: 1.05rem; color: var(--text); width: 4.5rem; text-transform: none; letter-spacing: 0; }
.darttabelle select { min-height: 42px; padding: .3rem .5rem; text-align: center; font-size: 1.05rem; }
.darttabelle select.gesetzt { background: var(--akzent-hell); border-color: var(--akzent); font-weight: 700; }
.warnung { color: var(--warn); font-weight: 600; }
.zaehler {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: .75rem 1rem; margin-bottom: .75rem; border: 1px solid var(--rand); border-radius: 10px; background: var(--flaeche-2);
}
.zaehler label { color: var(--text); font-size: 1rem; }
.zaehler .stepper { margin: 0; }
.zaehler .stepper button { width: 56px; min-height: 56px; font-size: 1.6rem; }
.zaehler .stepper input { width: 72px; text-align: center; font-size: 1.4rem; min-height: 56px; }
.gesamt {
  display: flex; justify-content: space-between; align-items: baseline; padding: .9rem 1rem;
  background: var(--akzent-hell); border-radius: 10px; font-weight: 600;
}
.gesamt .wert { font-size: 2rem; }

/* Vorlagen-Kacheln beim Buchen */
.kachel {
  border: 2px solid var(--rand); border-radius: var(--radius); padding: .9rem; background: var(--flaeche);
  display: flex; flex-direction: column; gap: .4rem;
}
.kachel.gewaehlt { border-color: var(--akzent); background: var(--akzent-hell); }
.stepper { display: flex; align-items: center; gap: .5rem; margin-top: auto; }
.stepper button { width: 44px; padding: 0; font-size: 1.3rem; }
.stepper .anzahl { min-width: 2ch; text-align: center; font-size: 1.2rem; font-weight: 700; }

/* Tabellen */
.tabelle-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { padding: .55rem .6rem; border-bottom: 1px solid var(--rand); text-align: left; vertical-align: middle; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--text-2); font-weight: 600; }
td.r, th.r { text-align: right; }
tbody tr.klickbar { cursor: pointer; }
tbody tr.klickbar:hover { background: var(--flaeche-2); }
.feldtabelle input, .feldtabelle select { min-height: 40px; padding: .4rem .5rem; }

.zeitraumwahl { margin-bottom: 1rem; }
.zeitraumwahl label { margin-bottom: .2rem; }
.fortschritt { flex: 1; min-width: 80px; height: 10px; border-radius: 99px; background: var(--flaeche-2); overflow: hidden; }
.fortschritt > div { height: 100%; background: var(--ok); border-radius: 99px; }
tfoot .gesamtzeile th, tfoot .gesamtzeile td { font-weight: 700; border-top: 2px solid var(--text-2); }
@media print { .fortschritt { border: 1px solid #999; } .fortschritt > div { background: #555 !important; print-color-adjust: exact; } }

/* Kennzahlen */
.kennzahlen { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); margin-bottom: 1rem; }
.kennzahl { background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); padding: .9rem 1rem; }
.kennzahl .wert { font-size: 1.8rem; font-weight: 700; }
.kennzahl .bez { color: var(--text-2); font-size: .85rem; }

/* Dialog */
dialog {
  border: 0; border-radius: 16px; padding: 0; width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 40px);
  background: var(--flaeche); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
dialog::backdrop { background: rgba(0,0,0,.45); }
dialog form, dialog .dialog-inhalt { padding: 1.25rem; }
.dialog-fuss { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; flex-wrap: wrap; }

/* Login */
.login { max-width: 420px; margin: 8vh auto 0; }
.login .marke { justify-content: center; font-size: 1.4rem; margin-bottom: 1rem; }
.login .marke { flex-direction: column; gap: .4rem; }
.login .marke img { height: 120px; width: auto; }
.meldung { padding: .7rem .9rem; border-radius: 10px; background: var(--warn-hell); color: var(--warn); margin-bottom: 1rem; }
.hinweis { padding: .7rem .9rem; border-radius: 10px; background: var(--akzent-hell); margin-bottom: 1rem; }

#toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); padding: .8rem 1.2rem; border-radius: 10px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: .2s; max-width: calc(100vw - 32px); z-index: 100;
}
#toast.zeigen { opacity: 1; transform: translateX(-50%); }
#toast.fehler { background: var(--warn); color: #fff; }

.leer { padding: 1.5rem; text-align: center; color: var(--text-2); }

@media (max-width: 1000px) {
  header { row-gap: .4rem; }
  .marke { order: 1; }
  .benutzer { order: 2; margin-left: auto; }
  nav { order: 3; flex: 1 0 100%; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  nav a { white-space: nowrap; }
}
@media (max-width: 600px) {
  header { gap: .5rem; }
  .benutzer #benutzerName { display: none; }
  h1 { font-size: 1.3rem; }
}

@media print {
  header, .nicht-drucken, #toast { display: none !important; }
  body { background: #fff; color: #000; }
  .karte { box-shadow: none; border: 0; padding: 0; break-inside: avoid; }
  main { padding: 0; max-width: none; }
}

/* ---------- Bestenliste ---------- */
:root { --gold: #b8860b; --gold-hell: #f6ead0; --silber: #6f7a80; --silber-hell: #e7eaec; --bronze: #9a5b2e; --bronze-hell: #f2e2d5; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --gold: #e6c15a; --gold-hell: #3a3218; --silber: #c3cbd0; --silber-hell: #2c3236; --bronze: #d99a6c; --bronze-hell: #3a281c; }
}
:root[data-theme="dark"] { --gold: #e6c15a; --gold-hell: #3a3218; --silber: #c3cbd0; --silber-hell: #2c3236; --bronze: #d99a6c; --bronze-hell: #3a281c; }
.besten-kopf h1 { margin-bottom: .75rem; }
.besten-filter .zeile { gap: .4rem; align-items: center; }
.besten-filter .leise.klein { margin-right: .25rem; }
.chip {
  display: inline-block; padding: .35rem .8rem; border-radius: 999px; text-decoration: none;
  border: 1px solid var(--rand); background: var(--flaeche); color: var(--text); font-size: .9rem;
}
.chip:hover { border-color: var(--akzent); }
.chip.aktiv { background: var(--akzent); border-color: var(--akzent); color: var(--akzent-text); font-weight: 600; }
.disziplin-titel { margin: 1.5rem 0 .75rem; font-size: 1.25rem; border-left: 4px solid var(--akzent); padding-left: .6rem; }
.besten-raster { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.besten-raster .karte { margin: 0; }
.bewerb-kopf h3 { margin: 0; font-size: 1.1rem; }
.bestwert {
  display: flex; align-items: center; gap: 1rem; margin: .8rem 0 .6rem; padding: .75rem 1rem;
  border-radius: 10px; background: var(--gold-hell);
}
.bestwert-zahl { font-size: 2rem; font-weight: 800; color: var(--gold); line-height: 1; white-space: nowrap; }
.einheit { font-size: .6em; font-weight: 600; opacity: .8; }
.bestentabelle td { vertical-align: top; }
.bestentabelle td.wert { font-weight: 700; white-space: nowrap; }
.rang {
  display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%;
  font-weight: 800; font-size: .9rem; background: var(--flaeche-2); color: var(--text-2);
}
.rang-1 { background: var(--gold-hell); color: var(--gold); box-shadow: inset 0 0 0 2px var(--gold); }
.rang-2 { background: var(--silber-hell); color: var(--silber); box-shadow: inset 0 0 0 2px var(--silber); }
.rang-3 { background: var(--bronze-hell); color: var(--bronze); box-shadow: inset 0 0 0 2px var(--bronze); }
@media (max-width: 600px) { .nur-breit { display: none; } .bestwert-zahl { font-size: 1.6rem; } }

/* Großanzeige (Bildschirm im Schützenheim) */
body.grossanzeige header { display: none; }
body.grossanzeige main { max-width: none; padding: 24px 32px; }
body.grossanzeige .besten-filter, body.grossanzeige .nicht-gross { display: none; }
body.grossanzeige h1 { font-size: 2.4rem; }
body.grossanzeige .disziplin-titel { font-size: 2rem; }
body.grossanzeige .bewerb-kopf h3 { font-size: 1.5rem; }
body.grossanzeige .bestentabelle { font-size: 1.35rem; }
body.grossanzeige .rang { width: 2.4rem; height: 2.4rem; font-size: 1.1rem; }
body.grossanzeige .bestwert-zahl { font-size: 3rem; }
body.grossanzeige .besten-raster { grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); }
.grossanzeige-info { text-align: right; margin-top: 1rem; }
@media print { .besten-raster { display: block; } .besten-raster .karte + .karte { margin-top: 1rem; } }

/* ---------- Version 2.0 ---------- */
.marke span { line-height: 1.05; }
.marke small { display: block; font-size: .72em; font-weight: 600; color: var(--link); letter-spacing: .06em; text-transform: uppercase; }
.login .marke span { text-align: center; }
.rechte { margin: .25rem 0 1rem; padding: .75rem; border-radius: 10px; background: var(--flaeche-2); display: grid; gap: .5rem; }
.rechte p { margin: 0; }
.belegung { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: 0 0 .75rem; }
.belegung:empty { display: none; }
.frei { padding: .2rem .6rem; border-radius: 999px; background: var(--akzent-hell); font-weight: 600; }
.frei.knapp { background: var(--gelb-hell); color: var(--gelb); }
.frei.voll { background: var(--warn-hell); color: var(--warn); }
.ueberbuchung .warn-kopf {
  margin: -1.25rem -1.25rem 1rem; padding: 1rem 1.25rem; background: var(--warn); color: #fff;
  font-family: var(--schrift-titel); font-size: 1.5rem; font-weight: 800; text-transform: uppercase; letter-spacing: .02em;
}
.warnung-karte.aus { border-color: var(--warn); background: var(--warn-hell); }
.eingabetabelle td { vertical-align: middle; }
.eingabetabelle input { min-height: 40px; padding: .35rem .5rem; }
.nur-druck { display: none; }
@media print {
  .nur-druck { display: block; }
  .seitenumbruch { break-before: page; }
  .marke small { color: #000; }
}

/* ---------- Version 2.1 ---------- */
.benutzer .link { white-space: nowrap; }
#btnTimer.timer-an { background: var(--akzent); color: var(--akzent-text); border-radius: 999px; padding: .25rem .7rem; font-weight: 700; }
.stand-leiste { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1rem; }
.timer-leiste {
  display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between;
  margin: .75rem 0; padding: .6rem .8rem; border-radius: 10px; background: var(--akzent-hell);
}
.timer-leiste button { min-height: 38px; padding: .3rem .9rem; }
input.vom-timer { border-color: var(--akzent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--akzent) 30%, transparent); font-weight: 700; }
.timer-anzeige { font-family: var(--schrift-titel); font-size: 3rem; font-weight: 800; color: var(--link); line-height: 1.1; margin: .25rem 0 .75rem; }
.timer-log { max-height: 220px; overflow: auto; font-size: .75rem; background: var(--flaeche-2); padding: .5rem; border-radius: 8px; white-space: pre-wrap; }
.qr-video { width: 100%; max-height: 60vh; border-radius: 10px; background: #000; object-fit: cover; }
.bezahlt-zeile td { color: var(--text-2); }
.disz-auswahl { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; padding: .5rem .75rem; border-radius: 10px; background: var(--flaeche-2); }
.anleitung { padding-left: 1.2rem; display: grid; gap: .45rem; }
.anleitung code, .karte code { background: var(--flaeche-2); padding: .1rem .35rem; border-radius: 6px; font-size: .85em; word-break: break-all; }
.staffel-box input { min-height: 38px; padding: .3rem .5rem; }
.protokoll td { vertical-align: top; }
.badge.art-buchung { background: var(--akzent-hell); color: var(--link); }
.badge.art-ergebnis { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.badge.art-storno, .badge.art-zahlung { background: var(--gelb-hell); color: var(--gelb); }
.badge.art-einstellungen, .badge.art-system { background: var(--flaeche-2); color: var(--text-2); }
textarea { width: 100%; font: inherit; padding: .5rem; border-radius: 10px; border: 1px solid var(--rand); background: var(--flaeche); color: var(--text); }
[hidden] { display: none !important; }

/* ---------- Version 2.2: Unterschrift, Widerspruch, Auslastung ---------- */
.unterschrift-karte { border: 2px solid var(--akzent); }
.unterschrift-gruppe { padding: .75rem 0; border-top: 1px solid var(--rand); }
.unterschrift-gruppe:first-of-type { border-top: 0; }
.unterschrift-feld { position: relative; margin-top: .5rem; border: 2px dashed var(--rand); border-radius: 12px; background: #fff; }
.unterschrift-feld canvas { display: block; width: 100%; height: 220px; touch-action: none; cursor: crosshair; border-radius: 10px; }
.unterschrift-feld .linie { position: absolute; left: 1rem; right: 1rem; bottom: 2.2rem; border-top: 1px solid #b9c0c8;
  padding-top: .2rem; font-size: .75rem; color: #6b7480; pointer-events: none; }
.erklaerung { margin: .75rem 0 .25rem; font-size: .9rem; }
.badge.widerspruch, .badge.art-widerspruch { background: var(--warn-hell); color: var(--warn); }
.badge.art-unterschrift { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.widerspruch-karte { border-left: 4px solid var(--warn); }
.widerspruch-karte.geklaert { border-left-color: var(--ok); opacity: .85; }
.unterschrift-bild { margin: 0; }
.unterschrift-bild img { display: block; max-width: 320px; width: 100%; background: #fff; border: 1px solid var(--rand); border-radius: 8px; }
.nav-zahl { display: inline-block; min-width: 1.3em; padding: 0 .35em; margin-left: .2em; border-radius: 99px;
  background: var(--warn); color: #fff; font-size: .75em; font-weight: 700; text-align: center; line-height: 1.4; }
.balken-zeile { display: flex; align-items: center; gap: .5rem; justify-content: flex-end; }
.balken { width: 90px; height: 10px; border-radius: 99px; background: var(--flaeche-2); overflow: hidden; }
.balken > span { display: block; height: 100%; background: var(--akzent); border-radius: 99px; }
.warn-text { color: var(--warn); }
.ok-text { color: var(--ok); }
@media print { .balken { border: 1px solid #999; } .balken > span { background: #555 !important; print-color-adjust: exact; } }

/* ---------- Version 2.3 ---------- */
.alle-ergebnisse { white-space: normal; line-height: 1.5; min-width: 12rem; }
.darttabelle .daneben-zeile th, .darttabelle .daneben-zeile td { border-top: 2px solid var(--rand); padding-top: .5rem; }
.darttabelle .daneben-zeile th { text-align: left; }

/* ---------- System: linke Spalte mit Unterpunkten ---------- */
.system-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.system-menue { position: sticky; top: 1rem; display: flex; flex-direction: column; gap: .25rem; padding: .5rem;
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); box-shadow: var(--schatten); }
.system-menue button { display: flex; align-items: center; gap: .6rem; width: 100%; text-align: left; border: 0; background: transparent;
  padding: .7rem .8rem; border-radius: 10px; font-weight: 500; color: var(--text); min-height: 44px; }
.system-menue button:hover { background: var(--flaeche-2); }
.system-menue button.aktiv { background: var(--akzent); color: var(--akzent-text); font-weight: 700; }
.system-menue .sym { width: 1.4rem; text-align: center; flex: none; }
.system-menue { grid-column: 1; grid-row: 1; order: 0; flex: none; }
.system-inhalt { grid-column: 2; grid-row: 1; }
.system-menue button { justify-content: flex-start; }
.system-inhalt > section > .karte:first-child, .system-inhalt > section > .kennzahlen:first-child { margin-top: 0; }
@media (max-width: 900px) {
  .system-layout { grid-template-columns: minmax(0, 1fr); }
  .system-menue, .system-inhalt { grid-column: 1; grid-row: auto; }
  .system-menue { position: static; flex-direction: row; overflow-x: auto; padding: .35rem; }
  .system-menue button { width: auto; white-space: nowrap; flex: none; }
}
@media print { .system-menue { display: none; } .system-layout { display: block; } }

/* ---- 2.5: Testbetrieb, Betreuung, QR, Unterschriften im Profil, Pakete ---- */
.test-banner { position: relative; z-index: 60; padding: .55rem 1rem; text-align: center; font-size: .95rem;
  background: repeating-linear-gradient(-45deg, #f7d23e 0 18px, #ffe36e 18px 36px); color: #111518; border-bottom: 2px solid #111518; }
.test-banner b { letter-spacing: .08em; }
.test-banner a { color: #111518; font-weight: 700; margin-left: .5rem; }
.karte.test-aktiv { border: 2px solid #e3b400; }
.qr-erkannt { font-size: 1.6rem; font-weight: 700; padding: 1.5rem 0; text-align: center; color: var(--ok); }
.betreut-hinweis { padding: .9rem 1rem; border-radius: 10px; background: var(--gelb-hell); color: var(--text); margin: .5rem 0 .75rem; font-size: 1.05rem; }
.us-liste { display: grid; gap: .6rem; }
.us-eintrag { border: 1px solid var(--rand); border-radius: 10px; padding: .6rem .8rem; background: var(--flaeche); }
.us-eintrag.widerspruch { border-left: 4px solid var(--warn); }
.us-eintrag.ok { border-left: 4px solid var(--ok); }
.us-eintrag ul { margin: .4rem 0 .2rem; padding-left: 1.1rem; }
.us-bild-knopf { padding: 0; border: 1px solid var(--rand); background: #fff; border-radius: 8px; cursor: zoom-in; min-height: 0; }
.us-bild-knopf img { display: block; width: 170px; height: 60px; object-fit: contain; }
.us-gross { display: block; width: 100%; max-height: 50vh; object-fit: contain; background: #fff; border-radius: 10px; border: 1px solid var(--rand); }
.pakete { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .25rem 0 .5rem; }
.paket-knopf { border: 2px solid var(--akzent); background: var(--akzent-hell); font-weight: 600; }
.paket-zeile { padding: .25rem 0; border-bottom: 1px solid var(--rand); }
@media print { .test-banner { display: none; } }

/* ---- 2.6: Stepper statt Auswahllisten, Fotos, Bedenklich, Testeintraege ---- */
.mini-stepper { display: inline-flex; align-items: center; gap: .25rem; }
.mini-stepper button { width: 40px; min-height: 40px; padding: 0; font-size: 1.25rem; font-weight: 700; border-radius: 10px; }
.ms-wert { display: inline-block; min-width: 2.2rem; padding: .35rem .2rem; text-align: center; font-size: 1.1rem; font-weight: 600;
  border-radius: 8px; border: 1px solid var(--rand); background: var(--flaeche); color: var(--text-2); opacity: .55; }
.ms-wert.gesetzt { opacity: 1; }
.ms-wert.gesetzt { background: var(--akzent-hell); border-color: var(--akzent); color: var(--text); font-weight: 800; }
.darttabelle td { white-space: nowrap; }
@media (max-width: 560px) { .mini-stepper button { width: 32px; min-height: 36px; font-size: 1.05rem; } .ms-wert { min-width: 1.7rem; } }
.badge.beta { background: #7c3aed; color: #fff; font-weight: 800; letter-spacing: .05em; font-size: .7rem; vertical-align: middle; }
.badge.test { background: #f7d23e; color: #111518; font-weight: 800; letter-spacing: .05em; }
.intern-block { margin-top: 1rem; padding: .75rem; border: 1px dashed var(--rand); border-radius: 10px; }
.bedenklich-check { margin: 0; }
.bedenklich-check.rot { color: var(--warn); font-weight: 700; background: var(--warn-hell); border: 2px solid var(--warn);
  border-radius: 8px; padding: .35rem .6rem; }
.bedenklich-check.rot .leise { color: var(--warn); }
.bedenklich-check.rot input { accent-color: var(--warn); }
.bedenklich-frueher { margin-top: .6rem; padding: .6rem .8rem; border-radius: 8px; background: var(--warn-hell);
  color: var(--warn); border-left: 4px solid var(--warn); font-size: .92rem; }
.bedenklich-frueher ul { margin: .3rem 0 0; padding-left: 1.2rem; color: var(--text); }
.bedenklich-hinweis { color: var(--gelb); font-weight: 600; }
.foto-knopf.laedt { opacity: .6; pointer-events: none; }
.foto-knopf.laedt::after { content: ' …'; }
.foto-liste { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.foto-liste:empty { display: none; }
.foto-mini { position: relative; }
.foto-mini img { display: block; width: 96px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--rand); background: #000; }
.foto-mini-bild { padding: 0; border: 0; background: none; min-height: 0; cursor: zoom-in; }
.foto-liste.gross .foto-mini img { width: 200px; height: 150px; }
.foto-liste.klein-fotos .foto-mini img { width: 64px; height: 48px; }
.foto-weg { position: absolute; top: -8px; right: -8px; width: 26px; height: 26px; min-height: 0; padding: 0; border-radius: 50%;
  font-size: .8rem; background: var(--warn); color: #fff; border: 2px solid var(--flaeche); }
.foto-gross { display: block; width: 100%; max-height: 72vh; object-fit: contain; background: #000; border-radius: 10px; }
.test-wahl { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .75rem; margin-top: .5rem; }
.test-option { border: 1px solid var(--rand); border-radius: 12px; padding: .8rem 1rem; display: flex; flex-direction: column; gap: .4rem; }
.test-option h3 { margin: 0; }
.test-option button { align-self: flex-start; margin-top: auto; }

/* Kamera in der App (Foto der Scheibe) */
.foto-knoepfe { display: inline-flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.foto-datei { cursor: pointer; }
.kamera-bild { position: relative; background: #000; border-radius: 10px; overflow: hidden; }
.kamera-bild video, .kamera-bild img { display: block; width: 100%; max-height: 62vh; object-fit: contain; background: #000; }

/* nur auf schmalen Bildschirmen (Handy) sichtbar */
.nur-handy { display: none; }
@media (max-width: 820px) { .nur-handy { display: inline-block; } }

/* RangeTally: System → Verein & Logo */
.marke-bilder { display: grid; gap: .75rem; margin-top: .75rem; }
.marke-bild { display: flex; gap: 1rem; align-items: flex-start; padding: .75rem; border: 1px solid var(--rand); border-radius: 10px; }
.mb-vorschau { flex: 0 0 auto; width: 72px; height: 72px; display: grid; place-items: center; background: repeating-conic-gradient(#e9ecef 0 25%, #fff 0 50%) 0 0 / 12px 12px; border-radius: 8px; border: 1px solid var(--rand); overflow: hidden; }
.mb-vorschau.breit { width: 160px; }
.mb-vorschau img { max-width: 100%; max-height: 100%; object-fit: contain; }
.mb-mass { margin: .2rem 0; font-weight: 600; color: var(--link); }
.mb-status.ok { color: var(--ok); }
.mb-status.warnung { color: var(--warn); font-weight: 600; }
@media (max-width: 600px) { .marke-bild { flex-direction: column; } }
/* Offline-Betrieb (offline.js) */
.offline-knopf { white-space: nowrap; }
.offline-knopf.offline-aus { color: #fff; background: var(--warn); border-radius: 6px; padding: .15rem .5rem; font-weight: 700; text-decoration: none; }
.offline-knopf.offline-warten { color: var(--warn); font-weight: 700; }
.offline-hinweis { color: var(--warn); font-weight: 600; margin-top: .25rem; }
.offline-liste { margin: .25rem 0 .75rem; padding-left: 1.2rem; }
.offline-liste li { margin: .2rem 0; }
