/* TL Gold – Bausteine (docs/design.md §5/§6). Mobile zuerst; ab 900 px Seitenleiste. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--grund); color: var(--text); font: 400 14px/1.45 var(--schrift); }
h1, h2, h3 { font-family: var(--schrift-titel); font-weight: 500; margin: 0; letter-spacing: -.01em; }
h1 { font-size: 30px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; font-family: var(--schrift); font-weight: 600; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.zahl, table, .betrag { font-variant-numeric: tabular-nums; }
.leise { color: var(--text-2); }
.klein { font-size: 12px; }
.gold { color: var(--gold); }
.gut { color: var(--gut); }
.warn { color: var(--warn); }
.fehler { color: var(--fehler); }
.kursiv { font-style: italic; }
[hidden] { display: none !important; }
.unsichtbar { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.reihe { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.reihe-ende { margin-left: auto; }
.stapel { display: flex; flex-direction: column; gap: 14px; }
.stapel-gross { display: flex; flex-direction: column; gap: 24px; }
.raster-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; align-items: start; }

/* ---------- Grundaufbau */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.seitenleiste { display: none; }
.kopf { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--grund); position: sticky; top: 0; z-index: 5; }
.kopf .titel { display: flex; flex-direction: column; margin-right: auto; min-width: 0; }
.kopf .titel strong { font-family: var(--schrift-titel); font-weight: 600; font-size: 18px; display: block; overflow: hidden; text-overflow: ellipsis; }
.inhalt { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 8px 16px 110px; display: flex; flex-direction: column; gap: 22px; }
.unten { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around; align-items: center; gap: 4px;
  padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--flaeche); border-top: 1px solid var(--linie); z-index: 6; }
.unten a, .unten button { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 64px; min-height: 48px; justify-content: center;
  color: var(--text-2); font: 500 11px var(--schrift); background: none; border: 0; cursor: pointer; text-decoration: none; position: relative; }
.unten .aktiv { color: var(--text); font-weight: 600; }
.unten > * { flex: 1 1 0; min-width: 0; }
.unten .zaehler { position: absolute; top: 2px; left: calc(50% + 4px); right: auto; }
.unten .plus { flex: 0 0 56px; height: 56px; min-width: 56px; margin-top: -28px; border-radius: 28px; background: var(--knopf); color: var(--knopf-text); border: 4px solid var(--grund); }

@media (min-width: 900px) {
  .app { flex-direction: row; }
  .seitenleiste { display: flex; flex-direction: column; gap: 2px; width: 232px; flex: 0 0 232px; padding: 22px 14px; background: var(--flaeche);
    border-right: 1px solid var(--linie); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
  .hauptspalte { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .kopf { padding: 22px 36px 6px; }
  .kopf .nur-handy { display: none; }
  .inhalt { padding: 10px 36px 40px; }
  .unten { display: none; }
  .nur-handy { display: none !important; }
}
@media (max-width: 899px) { .nur-pc { display: none !important; } }

/* Zurück-Knopf nur in der installierten App (kein Browser-Zurück); dort ersetzt er das Logo im Kopf */
.zurueck-knopf { display: none; flex: 0 0 auto; margin-left: -6px; border-color: transparent; background: transparent; }
@media (display-mode: standalone), (display-mode: fullscreen) {
  .zurueck-knopf { display: inline-flex; }
  .kopf.mit-zurueck .kopf-logo { display: none !important; }
}

/* Menü-Blatt (Handy, Knopf „Menü“ unten): alle Bereiche nach Gruppen, 3 kompakte Kacheln je Reihe */
.menue-blatt .blatt-inhalt { padding-bottom: calc(18px + env(safe-area-inset-bottom)); max-height: calc(88vh - 64px); }
.menue-gruppe { display: flex; flex-direction: column; gap: 8px; }
.menue-gruppe .kachel-gruppe { margin: 4px 2px 0; font: 600 12px var(--schrift); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.menue-kacheln { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.menue-kachel { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 78px;
  padding: 10px 6px; border-radius: 14px; border: 1px solid var(--linie); background: var(--flaeche); color: var(--text);
  font-size: 12.5px; font-weight: 600; line-height: 1.2; text-align: center; overflow-wrap: anywhere; }
.menue-kachel svg { color: var(--gold); }
.menue-kachel:hover { text-decoration: none; border-color: var(--gold); }
.menue-kachel.aktiv { border: 2px solid var(--gold); background: var(--gold-grund); }
.menue-kachel.gedimmt { opacity: .55; }
.menue-kachel .zaehler { position: absolute; top: 6px; right: 6px; }

.marke { display: flex; align-items: center; gap: 12px; padding: 0 8px 18px; color: var(--text); }
.marke:hover { text-decoration: none; }
.marke .logo, .logo { width: 36px; height: 36px; border-radius: 10px; border: 1.5px solid var(--gold); display: inline-flex; align-items: center;
  justify-content: center; font: 600 15px var(--schrift-titel); color: var(--gold); flex: 0 0 auto; }
img.logo { border: 0; object-fit: contain; }                          /* Firmenlogo statt „TL“-Zeichen */
.logo-vorschau { width: 96px; height: 96px; object-fit: contain; border-radius: 12px; background: var(--flaeche-2); }
.marke strong { display: block; font: 600 18px var(--schrift-titel); }
.nav-punkt { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: 10px; color: var(--text-2); }
.nav-punkt:hover { background: var(--flaeche-2); text-decoration: none; }
.nav-punkt.aktiv { background: var(--gold-grund); color: var(--text); font-weight: 600; }
.nav-punkt .zaehler { margin-left: auto; }
.nav-punkt.gedimmt { opacity: .55; }   /* Admin auf einem Gerät ohne Admin-Freischaltung */
/* „Alle Seiten“ (10.11.2026): kleiner Link unter „Meldungen“ in der Seitenleiste */
.nav-alle { display: flex; align-items: center; gap: 12px; min-height: 36px; padding: 0 12px; border-radius: 10px; color: var(--text-2); font-size: .9em; }
.nav-alle:hover { background: var(--flaeche-2); text-decoration: none; }
.nav-alle.aktiv { background: var(--gold-grund); color: var(--text); font-weight: 600; }
.seitenleiste .luecke { flex: 1; min-height: 16px; }
/* Navigation in Gruppen (design.md §6): Gruppen-Überschrift klappt auf, Einträge leicht eingerückt */
.seitenleiste details.nav-gruppe { border: 0; border-radius: 0; background: none; }
.seitenleiste .nav-gruppe > summary.nav-gruppe-kopf { min-height: 44px; padding: 0 12px; margin-top: 6px; border-radius: 10px; gap: 8px;
  font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.seitenleiste .nav-gruppe > summary.nav-gruppe-kopf:hover { background: var(--flaeche-2); }
.seitenleiste .nav-gruppe > summary.nav-gruppe-kopf::after { margin-left: 0; font-size: 16px; }
.seitenleiste .nav-gruppe > .nav-gruppe-inhalt { padding: 0 0 4px 8px; display: flex; flex-direction: column; gap: 2px; }
.seitenleiste .nav-punkt { min-height: 38px; }               /* alle Gruppen offen: kompakt, damit alles auf einen Blick passt */
.seitenleiste .nav-gruppe > summary.nav-gruppe-kopf { min-height: 32px; margin-top: 8px; }
.person { display: flex; align-items: center; gap: 10px; padding: 14px 8px 0; margin-top: 8px; border-top: 1px solid var(--linie); }
.person a.wachsen { color: inherit; text-decoration: none; }
.zugang-daten { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; }
.zugang-daten dt { color: var(--text-2); }
.zugang-daten dd { margin: 0; overflow-wrap: anywhere; }
details.info-kurz > summary { gap: 8px; font-weight: 500; }
.avatar { width: 32px; height: 32px; border-radius: 16px; background: var(--flaeche-2); display: inline-flex; align-items: center;
  justify-content: center; font-weight: 600; font-size: 12px; flex: 0 0 auto; color: var(--text); }

/* ---------- Knöpfe und Felder */
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px;
  border: 1px solid var(--linie); background: var(--flaeche); color: var(--text); font: 500 14px var(--schrift); cursor: pointer; text-decoration: none; }
.knopf:hover { text-decoration: none; border-color: var(--text-2); }
.knopf-haupt { background: var(--knopf); color: var(--knopf-text); border-color: var(--knopf); font-weight: 600; }
.knopf-haupt:hover { border-color: var(--knopf); filter: brightness(1.06); }
.knopf-gefahr { color: var(--fehler); border-color: var(--fehler); background: transparent; }
.knopf-klein { min-height: 36px; padding: 0 12px; border-radius: 10px; font-size: 13px; }
.knopf-rund { width: 44px; height: 44px; padding: 0; border-radius: 22px; }
.knopf-breit { width: 100%; }
.knopf[disabled] { opacity: .5; cursor: not-allowed; }
.feld { display: flex; flex-direction: column; gap: 6px; }
.feld label, .feld .beschriftung { font-size: 13px; font-weight: 600; }
input, select, textarea { font: inherit; font-size: 16px; color: var(--text); background: var(--flaeche); border: 1px solid var(--linie); border-radius: 12px;
  min-height: 48px; padding: 0 14px; width: 100%; }
textarea { padding: 12px 14px; min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: var(--gold); }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; min-height: 20px; accent-color: var(--gold); }
.feld-fehler { color: var(--fehler); font-size: 13px; }
/* Passwort-Regeln (kern/teile/passwort_felder.html): offen = Kreis, erfüllt = grüner Haken */
.passwort-regeln { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.passwort-regeln li::before { content: "○"; display: inline-block; width: 1.4em; color: var(--text-2); }
.passwort-regeln li.erfuellt { color: var(--gut); }
.passwort-regeln li.erfuellt::before { content: "✓"; color: var(--gut); }
.passwort-block input[type="text"] { font-family: ui-monospace, Consolas, monospace; letter-spacing: .03em; }
.formular { display: flex; flex-direction: column; gap: 16px; max-width: 520px; }
.formular-raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.haken { display: flex; align-items: center; gap: 10px; min-height: 44px; }

/* ---------- Karten, Kennzahlen, Aufgaben */
.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 16px; padding: 18px 20px; }
.karte-kopf { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.karte-kopf .reihe-ende { font-size: 13px; }
.karte-kopf h2 { flex: 0 0 auto; }
.kennzahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.kennzahl { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.kennzahl .wert { font: 500 28px var(--schrift-titel); font-variant-numeric: tabular-nums; }
/* Server-Monitor / Tests & Prüfungen (13.11.2026): Balken als <meter> (keine Inline-Stile), lange Befehle umbrechen */
.kennzahl meter, .karte > meter, .liste meter { width: 100%; height: 8px; }
.liste meter { max-width: 160px; }
.umbruch { word-break: break-all; white-space: normal; }
.aufgaben { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.aufgabe { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.aufgabe.hervor { border-color: var(--gold); }
.aufgabe .art { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--warn); }
.aufgabe .titel { font-weight: 600; font-size: 15px; }
.aufgabe .text { font-size: 13px; color: var(--text-2); flex: 1; }
.ausrufe { width: 20px; height: 20px; border-radius: 10px; background: var(--warn-grund); display: inline-flex; align-items: center; justify-content: center; }
.zaehler { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--warn); color: var(--warn-text);
  font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.zaehler:empty { display: none; }
.glocke { position: relative; }
.glocke .zaehler { position: absolute; top: 4px; right: 2px; }

/* ---------- Befehlszeile */
.befehl { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 0 18px; border-radius: 16px; background: var(--flaeche);
  border: 1px solid var(--linie); box-shadow: var(--schatten); }
.befehl input { border: 0; min-height: 54px; padding: 0; background: transparent; outline: none; }
.befehl input:focus { outline: none; }
.taste { font-size: 12px; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--linie); color: var(--text-2); white-space: nowrap; }
.treffer { display: flex; flex-direction: column; gap: 2px; }
.treffer a { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; color: var(--text); }
.treffer a:hover, .treffer a:focus { background: var(--gold-grund); text-decoration: none; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 22px; border: 1px solid var(--linie);
  background: var(--flaeche); color: var(--text); font-weight: 600; }
.chip:hover { text-decoration: none; border-color: var(--text-2); }
.chip.haupt { background: var(--knopf); border-color: var(--knopf); color: var(--knopf-text); }
.chips:has(.chip-klein) { gap: 6px; }
.chip-klein { min-height: 36px; padding: 0 14px; border-radius: 18px; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; text-align: left; }

/* ---------- Kachelmenü (Handy) */
.kacheln { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 360px) { .kacheln.nur-handy { grid-template-columns: repeat(3, minmax(0, 1fr)); } }   /* Handy: 3 je Reihe, mehr auf einen Blick */
@media (min-width: 600px) { .kacheln { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 600px) and (max-width: 899px) { .kacheln.nur-handy { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kacheln.nur-handy .kachel:not(.haupt) { min-height: 84px; gap: 8px; padding: 10px; border-radius: 14px; }
.kacheln.nur-handy .kachel:not(.haupt) .name { font-size: 13px; line-height: 1.2; overflow-wrap: anywhere; }
.kacheln.nur-handy .kachel:not(.haupt) .info { font-size: 11px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kachel { display: flex; flex-direction: column; justify-content: space-between; gap: 18px; min-height: 104px; padding: 14px; border-radius: 18px;
  border: 1px solid var(--linie); background: var(--flaeche); color: var(--text); text-decoration: none; position: relative; }
.kachel:hover { text-decoration: none; border-color: var(--gold); }
.kachel .symbol { color: var(--gold); display: flex; justify-content: space-between; align-items: center; }
.kachel .name { font-weight: 600; font-size: 15px; }
.kachel .info { font-size: 12px; color: var(--text-2); }
.kachel.haupt { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: flex-start; gap: 14px; min-height: 84px;
  background: var(--knopf); border-color: var(--knopf); color: var(--knopf-text); }
.kachel.haupt .symbol, .kachel.haupt .info { color: var(--knopf-text); }
.kachel.haupt .name { font: 600 20px var(--schrift-titel); }
.kacheln .kachel-gruppe { grid-column: 1 / -1; margin: 10px 2px 0; font: 600 12px var(--schrift); letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-2); }

/* ---------- Erklärungen (design.md §6): ⓘ neben dem Titel, Erst-Banner, Info-Fenster */
.kopf-titel { display: flex; align-items: center; gap: 4px; margin-right: auto; min-width: 0; }
.kopf-titel .titel { margin-right: 0; }
.info-knopf { flex: 0 0 auto; border-color: transparent; background: transparent; color: var(--gold); }
.info-knopf:hover { border-color: var(--linie); }
.erst-banner { align-items: center; flex-wrap: wrap; border: 1px solid var(--linie); }
.erst-banner .icon { color: var(--gold); }
.erst-banner form { margin: 0; }
.erklaerung-fenster p { margin: 0; }
/* ---------- Reiter (z. B. Freigaben: Wartet auf dich · Code unterwegs · Erledigt) */
.reiter { display: flex; gap: 6px; overflow-x: auto; border-bottom: 1px solid var(--linie); }
.reiter-punkt { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 16px; white-space: nowrap;
  color: var(--text-2); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.reiter-punkt:hover { color: var(--text); text-decoration: none; }
.reiter-punkt.aktiv { color: var(--text); border-bottom-color: var(--gold); }
/* Einträge als ganze Sätze, große Knöpfe; Freigabe-Code groß im Fenster */
.satz { margin: 0; font-size: 15px; line-height: 1.5; }
.satz strong { font-weight: 600; }
.freigabe-eintrag { display: flex; flex-direction: column; gap: 14px; }
.knopf-gross { min-height: 48px; padding: 0 20px; font-size: 15px; }
.freigabe-eintrag form { margin: 0; }
.code-riesig { margin: 6px 0; text-align: center; font: 600 56px/1.1 var(--schrift-titel); letter-spacing: .12em; color: var(--gold);
  font-variant-numeric: tabular-nums; }
.code-satz { margin: 0; font-size: 16px; line-height: 1.5; }
.schritte.schritte-klein { gap: 14px; font-size: 15px; line-height: 1.45; }
.schritte.schritte-klein > li { padding-left: 40px; }
.schritte.schritte-klein > li::before { width: 28px; height: 28px; border-radius: 14px; font-size: 14px; top: -2px; }

/* ---------- Listen, Tabellen, Pillen */
.liste { display: flex; flex-direction: column; }
.liste > * { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 12px 0; border-top: 1px solid var(--linie); }
.liste > *:first-child { border-top: 0; }
.liste .wachsen { flex: 1 1 220px; min-width: 0; }
.tabelle { overflow-x: auto; }
.tabelle td input { min-width: 6.5em; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 500; color: var(--text-2); padding: 8px 12px; }
td { padding: 12px; border-top: 1px solid var(--linie); vertical-align: middle; }
td.rechts, th.rechts { text-align: right; }
.pille { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 11px; font-size: 12px; font-weight: 600;
  background: var(--flaeche-2); color: var(--text-2); white-space: nowrap; }
.pille::before { content: ""; width: 6px; height: 6px; border-radius: 3px; background: currentColor; }
.pille.gut { background: var(--gut-grund); color: var(--gut); }
.pille.warn { background: var(--warn-grund); color: var(--warn); }
.pille.fehler { background: var(--fehler-grund); color: var(--fehler); }
.pille.gold { background: var(--gold-grund); color: var(--gold); }
.punkt { width: 9px; height: 9px; border-radius: 5px; background: var(--linie); display: inline-block; flex: 0 0 auto; }
.punkt.gut { background: var(--gut); }
.punkt.fehler { background: var(--fehler); }

/* ---------- Hinweise */
.hinweis { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: 14px; background: var(--gold-grund); color: var(--text); }
.hinweis.warn { background: var(--warn-grund); }
.hinweis.fehler { background: var(--fehler-grund); }
.hinweis.gut { background: var(--gut-grund); }
.hinweis .icon { flex: 0 0 auto; margin-top: 1px; }
/* Live-Daten: ruhiger Hinweis, wenn gerade ein Formular bearbeitet wird („Neue Daten – neu laden“) */
.live-hinweis { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(88px + env(safe-area-inset-bottom)); z-index: 7; display: flex; align-items: center; gap: 12px;
  padding: 6px 6px 6px 16px; border-radius: 14px; background: var(--gold-grund); color: var(--text); border: 1px solid var(--linie); box-shadow: var(--schatten); white-space: nowrap; }
@media (min-width: 900px) { .live-hinweis { bottom: 24px; } }
.kurs-pille { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 14px; border-radius: 20px; border: 1px solid var(--linie);
  background: var(--flaeche); font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--text); flex-shrink: 0; }
.kurs-pille.veraltet { border-color: var(--fehler); color: var(--fehler); }
.kurs-kopf { display: inline-flex; align-items: center; flex-shrink: 0; }
.kurs-link { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.kurs-pille:has(.kurs-aktualisieren) { gap: 5px; }
.kurs-aktualisieren { margin: 0; display: inline-flex; }
/* nur die Pfeile, klein direkt nach „vor X Sek.“ (Kundenwunsch 14./15.11.2026); kein Rahmen, kein Hintergrund –
   Trefferfläche per ::before größer als das Symbol */
.kurs-mini { position: relative; display: inline-flex; align-items: center; width: auto; height: auto; min-height: 0; padding: 0;
  border: 0; background: none; box-shadow: none; color: var(--text-2); cursor: pointer; line-height: 1; }
.kurs-mini::before { content: ""; position: absolute; inset: -10px; }
.kurs-mini svg { width: 12px; height: 12px; stroke-width: 2.4; }
.kurs-mini:hover, .kurs-mini:focus-visible { color: var(--gold); background: none; }
.kurs-mini:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 3px; }
/* Mitarbeiter anlegen: Passwort-Felder nur bei „Selbst festlegen“ (15.11.2026) */
.profil-neu:not(:has(input[name="zugang"][value="eigen"]:checked)) .pw-eigen { display: none; }
.kurs-aktualisieren .nicht-geholt { color: var(--fehler); opacity: 1; }
.kurs-aktualisieren.htmx-request svg { animation: kurs-drehen 0.8s linear infinite; }
@keyframes kurs-drehen { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .kurs-aktualisieren.htmx-request svg { animation: none; opacity: 0.5; } }

/* ---------- Dialog (Handy: Blatt von unten) */
dialog { border: 0; padding: 0; border-radius: 22px; background: var(--grund); color: var(--text); width: min(560px, 100vw - 24px); max-height: 92vh; }
dialog::backdrop { background: rgba(20, 16, 10, .5); }
.blatt-kopf { display: flex; align-items: center; padding: 16px 18px 8px; }
.blatt-inhalt { padding: 6px 18px 18px; overflow-y: auto; }
.blatt-fuss { padding: 12px 18px 18px; border-top: 1px solid var(--linie); background: var(--flaeche); }
@media (max-width: 899px) {
  dialog { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: 22px 22px 0 0; }
}

/* ---------- Anmelden */
.zentriert { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.anmelde-karte { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 18px; }
.qr svg { width: 220px; height: 220px; background: #fff; border-radius: 12px; }
/* Kurs-Seite (03.11.2026): Kacheln je Metall als Auswahl, Diagramm (uPlot, wie im Modul analyse) */
a.kurs-kachel { color: inherit; text-decoration: none; border: 1px solid transparent; }
a.kurs-kachel.aktiv { border-color: var(--gold); }
a.kurs-kachel:hover { border-color: var(--linie); }
/* Volle Berechnungsformel (05.11.2026): Rechenweg in Vorschau/Detail, aufklappbar in der Ankaufliste */
.rechenweg.stapel { gap: 2px; }
.formel-details summary { cursor: pointer; color: var(--text-2); }
.formel-details .stapel { gap: 2px; text-align: left; white-space: normal; min-width: 14rem; }
.analyse-diagramm { width: 100%; min-height: 260px; }
.analyse-diagramm .uplot { font-family: var(--schrift); color: var(--text-2); font-variant-numeric: tabular-nums; }
.analyse-diagramm .u-legend { color: var(--text); font-size: 13px; }
.analyse-diagramm .u-select { background: var(--gold-grund); }
/* Mehrere QR-Codes nebeneinander (Einladung, Mein Konto), am Handy untereinander */
.qr-reihe { display: flex; flex-wrap: wrap; gap: 16px; }
.qr-karte { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; max-width: 240px; }
.qr-karte .qr svg { width: 180px; height: 180px; }
.qr-karte a { word-break: break-all; }
.code-gross { font: 600 28px var(--schrift); letter-spacing: .12em; font-variant-numeric: tabular-nums; }

/* ---------- Rechte-Matrix */
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.recht { min-width: 84px; }

@media print {
  .seitenleiste, .unten, .kopf, .nicht-drucken, .glocke-panel, .live-hinweis, dialog:not([open]) { display: none !important; }
  body { background: #fff; color: #000; }
  /* Tabellen auf Papier (Ankaufliste, Kundenauszug, Lieferliste – Kundenwunsch 03.11.2026): ganze Breite, Linien,
     Kopfzeile auf jeder Seite wiederholen, Zeilen nicht zerreißen, keine Schatten/Karten-Hintergründe */
  .karte { box-shadow: none !important; border: 0 !important; background: #fff !important; padding: 0 !important; }
  .tabelle-rahmen, .tabelle-scroll { overflow: visible !important; max-height: none !important; }
  table { width: 100%; border-collapse: collapse; font-size: 10pt; }
  thead { display: table-header-group; }
  tr { break-inside: avoid; }
  th, td { border-bottom: 0.5pt solid #999; padding: 3pt 4pt; color: #000 !important; }
  a { color: #000 !important; text-decoration: none; }
  .druck-kopf { display: block !important; margin-bottom: 8pt; }
  .nur-druck { display: block !important; }
  .tabelle { overflow: visible !important; }
}
.druck-kopf { display: none; }
/* Nur auf Papier bzw. als Kopiervorlage (z. B. Ankaufliste ohne Eingabefelder) */
.nur-druck { display: none; }
/* Kundenansicht (Kundenblatt, Kundenauszug): am Bildschirm/Tablet gut lesbar */
.kundenansicht table { font-size: 1.05rem; }
.kundenansicht .zwischensumme td { border-top: 1px solid var(--linie); }
.wachsen { flex: 1 1 auto; min-width: 0; }
@media (max-width: 899px) {
  .kopf h1 { font-size: 22px; line-height: 1.2; }
  .kopf .titel strong { font-size: 17px; }
}

/* Optionskarten (Radio/Checkbox als große Karte, z. B. Kundenart) */
.option { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--linie);
  background: var(--flaeche); cursor: pointer; }
.option:has(input:checked) { border: 2px solid var(--gold); background: var(--gold-grund); }
.option:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 2px; }
.option .rechts { margin-left: auto; font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; }
details { border: 1px solid var(--linie); border-radius: 14px; background: var(--flaeche); }
details > summary { min-height: 48px; padding: 0 14px; display: flex; align-items: center; cursor: pointer; font-weight: 600; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: "›"; margin-left: auto; transition: transform .15s; }
details[open] > summary::after { transform: rotate(90deg); }
details > :not(summary) { padding: 0 14px 14px; }

/* Fotos/Belege vor dem Senden verkleinern (bilder.js) */
.foto-leiste { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.foto-leiste figure { margin: 0; flex: 0 0 64px; display: flex; flex-direction: column; gap: 3px; }
.foto-leiste img, .foto-leiste-datei { width: 64px; height: 64px; border-radius: 10px; border: 1px solid var(--linie); object-fit: cover; }
.foto-leiste-datei { display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--text-2); background: var(--grund); }
.foto-leiste figcaption { font-size: 11px; color: var(--text-2); text-align: center; font-variant-numeric: tabular-nums; }
.foto-leiste figure { position: relative; }
.foto-weg { position: absolute; top: -4px; right: -4px; width: 26px; height: 26px; min-height: 26px; padding: 0; border-radius: 50%;
  border: 1px solid var(--linie); background: var(--flaeche, var(--grund)); color: var(--text); font-size: 16px; line-height: 1; cursor: pointer; }
.foto-fehlt { margin: 0; }
.foto-status { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.foto-status.gut { color: var(--gut); }
.foto-status.fehler { color: var(--fehler); }
.foto-warnung { color: var(--warn); }
/* Ankaufliste: Warnung Schmelze/Analyse > 2 % – volle Breite unter der Zeile, deutlich, Feld rot */
.warnung-pruefen { font-size: 16px; line-height: 1.4; border: 2px solid var(--warn); }
.warnung-pruefen:focus { outline: 3px solid var(--fehler); outline-offset: 2px; }
.warnung-pruefen .icon { color: var(--warn); }
.warnzeile td { padding-top: 0; white-space: normal; }
.zeile-warn td { background: var(--warn-grund); }
input.feld-warn, input[aria-invalid="true"] { border: 2px solid var(--fehler); background: var(--fehler-grund); }

/* Geräte-Anleitung /geraet/neu (Mobil zuerst: große Schrift, nummerierte Schritte, Kopierfeld untereinander) */
.warnung-gross { font-size: 16px; font-weight: 600; line-height: 1.4; border: 2px solid var(--fehler); color: var(--text); }
.warnung-gross .icon { color: var(--fehler); }
.anleitung-teil { scroll-margin-top: 16px; font-size: 16px; line-height: 1.5; }
.schritte { list-style: none; counter-reset: schritt; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 20px; }
.schritte > li { counter-increment: schritt; position: relative; padding-left: 46px; }
.schritte > li::before { content: counter(schritt); position: absolute; left: 0; top: -3px; width: 34px; height: 34px; border-radius: 17px;
  background: var(--knopf); color: var(--knopf-text); font: 600 16px var(--schrift); display: flex; align-items: center; justify-content: center; }
.schritte .knopf, .schritte .kopierfeld, .schritte .block { margin-top: 10px; }
.schritte .block { display: block; }
.kopierfeld { display: flex; flex-direction: column; gap: 8px; }
.kopierfeld .adresse { font-size: 18px; font-weight: 600; min-height: 56px; color: var(--gold); font-variant-numeric: tabular-nums; }
.nicht { color: var(--fehler); font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
/* Verbindungshilfe (Overlay aus basis.html und Offline-Seite /offline) */
.verbindungshilfe { position: fixed; inset: 0; z-index: 30; overflow-y: auto; background: var(--grund); display: flex; justify-content: center;
  padding: calc(32px + env(safe-area-inset-top)) 16px calc(32px + env(safe-area-inset-bottom)); }
.verbindungshilfe .verbindungshilfe-inhalt { width: 100%; max-width: 420px; margin: auto 0; }
.verbindungshilfe-inhalt { font-size: 16px; line-height: 1.5; }
.verbindungshilfe-inhalt h1 { font-size: 28px; line-height: 1.2; }
.verbindungshilfe-inhalt h1:focus { outline: none; }
.verbindungshilfe-inhalt p { margin: 0; }
.checkliste { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; }
.hilfe > summary { padding: 10px 14px; line-height: 1.35; gap: 10px; }
.hilfe > p { margin: 0; }
/* Verlauf/Protokoll (design.md §6, gemeinsamer Baustein kern/teile/verlauf.html): Tage, Symbol und Farbe je Art */
.verlauf-tag { margin: 18px 0 2px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.verlauf > .verlauf-tag:first-child { margin-top: 4px; }
.verlauf-liste { list-style: none; margin: 0; padding: 0; }
.verlauf-eintrag { align-items: flex-start; }
.verlauf-zeit { flex: 0 0 44px; padding-top: 7px; font-size: 13px; color: var(--text-2); }
.verlauf-symbol { flex: 0 0 32px; width: 32px; height: 32px; border-radius: 16px; display: inline-flex; align-items: center;
  justify-content: center; background: var(--flaeche-2); color: var(--text-2); }
.art-ankauf .verlauf-symbol, .art-freigabe .verlauf-symbol { background: var(--gold-grund); color: var(--gold); }
.art-korrektur .verlauf-symbol { background: var(--warn-grund); color: var(--warn); }
.art-geld .verlauf-symbol { background: var(--gut-grund); color: var(--gut); }
.art-admin .verlauf-symbol { background: var(--blau-grund); color: var(--blau); }
.art-sicherheit .verlauf-symbol { background: var(--fehler-grund); color: var(--fehler); }
.verlauf-eintrag.wichtig { box-shadow: inset 3px 0 0 var(--warn); padding-left: 10px; }
.verlauf-eintrag .betrag { margin-left: auto; padding-top: 6px; text-align: right; white-space: nowrap; }
.verlauf-mehr { padding-top: 12px; }
.verlauf-arten { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0 18px; margin: 0; padding: 0; border: 0; min-width: 0; }
.verlauf-arten legend { padding: 0; margin-bottom: 2px; }

/* Kurs-Kacheln und Schritte im neuen Ankauf (Kundenwünsche 07.11.2026) */
.kachel-raster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 900px) { .kachel-raster { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.kachel-kurs { display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 1px solid var(--linie); border-radius: 14px;
  background: var(--flaeche); min-width: 0; }
.kachel-kurs .wert { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.kachel-kurs .zahl { font-variant-numeric: tabular-nums; }
/* Live-Kurs − Abschlag = Ankaufkurs (12.11.2026) */
.kachel-rechnung { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; margin: 0; align-items: baseline; }
.kachel-rechnung dt { color: var(--text-2); font-size: .85rem; }
.kachel-rechnung dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.kachel-rechnung .summe { border-top: 1px solid var(--linie); padding-top: 4px; }
.kachel-rechnung dt.summe { font-weight: 600; color: inherit; }
.kachel-stand.warn, .kachel-stand.alt { border-color: var(--warn); }
.schritt-anzeige { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; }
.schritt-anzeige li { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--linie); font-size: .85rem; }
.schritt-anzeige li.aktiv { border-color: var(--gold); background: var(--gold-grund); font-weight: 600; }
.wahl-raster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 700px) { .wahl-raster { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.wahl-kachel { min-height: 64px; padding: 12px; border-radius: 14px; border: 1px solid var(--linie); background: var(--flaeche);
  color: var(--text); font: inherit; text-align: left; display: flex; flex-direction: column; gap: 4px; cursor: pointer; }
.wahl-kachel[aria-pressed="true"] { border: 2px solid var(--gold); background: var(--gold-grund); }
.wahl-kachel:hover { border-color: var(--gold); }
.schritt-knoepfe { display: flex; gap: 10px; }
.schritt-knoepfe .knopf { min-height: 48px; flex: 1; }
.schritt-feld input, .schritt-feld select { min-height: 48px; font-size: 1.1rem; }
/* Rechte je Metall (09.11.2026): nicht freigegebene Metalle ausgegraut */
.kachel-gesperrt, .wahl-kachel[disabled] { opacity: .45; cursor: not-allowed; }
.wahl-kachel[disabled]:hover { border-color: inherit; }

/* Lizenzen (10.11.2026): lange Lizenztexte umbrechen und begrenzen */
.lizenz-text { white-space: pre-wrap; word-break: break-word; max-height: 24rem; overflow: auto; font-size: .8rem; }
.nav-lizenz { padding-top: 0; }

/* „Verkauf jetzt?“ übersichtlich (Kundenwunsch 11.11.2026): Ampel + Satz, drei Kacheln, schlichtes Diagramm */
.vk-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.vk-ampel { font-size: 15px; padding: 6px 14px; border-radius: 16px; }
.vk-satz { font-size: 15px; margin: 0; }
.vk-kacheln { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.vk-kachel { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 14px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.vk-wert { font: 500 26px var(--schrift-titel); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.vk-fixiert .vk-satz { font-size: 14px; }
.vk-diagramm { min-height: 170px; }
.vk-knoepfe { flex-wrap: wrap; }
.vk-details > summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.vk-details h3 { font-size: 14px; margin: 10px 0 2px; }
.vk-tabelle { width: 100%; border-collapse: collapse; font-size: 14px; }
.vk-tabelle th { text-align: left; font-weight: 400; color: var(--text-2); padding: 4px 8px 4px 0; }
.vk-tabelle td { text-align: right; padding: 4px 0; font-variant-numeric: tabular-nums; }
.vk-tabelle tr + tr th, .vk-tabelle tr + tr td { border-top: 1px solid var(--linie); }
@media (max-width: 640px) { .vk-kacheln { grid-template-columns: 1fr; } .vk-wert { font-size: 22px; } }
/* ---------- Design-Rundgang 11.11.2026 (tests/design): Funde aus 677 Aufnahmen, 3 Breiten × hell/dunkel */
/* 1. Unsichtbare Beschriftungen (position:absolute) in waagerecht scrollenden Tabellen machten die ganze Seite breiter
      (Ankaufliste, Scheideanstalt, Planung, Metallrechte …): Scroll-Bereich ist jetzt ihr Bezugsrahmen. */
.tabelle, .tabelle-rahmen, .tabelle-scroll { position: relative; }
.tabelle-rahmen { overflow-x: auto; }
/* Scroll-Hinweis: weicher Schatten am Rand, solange es seitlich weitergeht */
.tabelle, .tabelle-rahmen {
  background:
    linear-gradient(to right, var(--flaeche) 30%, transparent) left / 32px 100% no-repeat local,
    linear-gradient(to left, var(--flaeche) 30%, transparent) right / 32px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, .16), transparent) left / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, .16), transparent) right / 12px 100% no-repeat scroll,
    var(--flaeche);
}
/* 2. Abzeichen „Meldungen“ unten auf dem Handy war ein langer roter Balken (.glocke .zaehler setzte right:2px) */
.unten .glocke .zaehler { right: auto; }
/* 3. Kopfzeile der Karten mit Knopf (CSV, Drucken) lief auf dem Handy über den Rand */
.karte-kopf { flex-wrap: wrap; }
.karte-kopf h2 { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
/* 4. Touch-Ziele: kleine Knöpfe auf Touch-Geräten mindestens 44 px hoch */
@media (pointer: coarse) {
  .knopf-klein, summary.knopf, .reiter-punkt, .chip-klein, .nav-alle { min-height: 44px; }
  .knopf-klein { padding: 0 14px; }
}
/* 5. Handy-Kopf: Titel quetschte sich zwischen Logo, Kurs und Glocke (Wortsalat) – er bekommt eine eigene Zeile darunter */
@media (max-width: 599px) {
  .kopf { flex-wrap: wrap; row-gap: 4px; }
  .kopf .kopf-titel { order: 10; flex: 1 0 100%; margin-right: 0; }
  .kopf .kurs-kopf { margin-left: auto; }
  /* 6. Schrittanzeige im neuen Ankauf: eine wischbare Zeile statt vier Zeilen Pillen */
  .schritt-anzeige { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .schritt-anzeige::-webkit-scrollbar { display: none; }
  .schritt-anzeige li { flex: 0 0 auto; white-space: nowrap; }
}
/* 7. Startseite: Panels laden eine eigene Karte – keine Karte in der Karte, kein doppelter Titel; langer Verlauf scrollt */
.karte > [hx-get] > .karte { border: 0; padding: 0; background: transparent; box-shadow: none; }
.karte > [hx-get] > .karte > .karte-kopf h2 { display: none; }
.karte > [hx-get] > .karte > .karte-kopf { justify-content: flex-end; margin-bottom: 0; }
.karte > [hx-get] #verlauf-heute .verlauf { max-height: 440px; overflow-y: auto; overscroll-behavior: contain; }

/* Schiebeschalter (13.11.2026): Checkbox mit role="switch" als Kippschalter, Tastatur wie Checkbox (Leertaste) */
.schiebe { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.schiebe input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.schiebe .bahn { width: 46px; height: 26px; border-radius: 13px; background: var(--linie); position: relative;
  transition: background .15s; flex: none; }
.schiebe .bahn::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--flaeche); box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.schiebe input:checked + .bahn { background: var(--gut, #2f7d4f); }
.schiebe input:checked + .bahn::after { transform: translateX(20px); }
.schiebe input:focus-visible + .bahn { outline: 2px solid var(--gold); outline-offset: 2px; }
.schiebe input:disabled + .bahn { opacity: .5; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) { .schiebe .bahn, .schiebe .bahn::after { transition: none; } }
