/* Healthmanager – Optik nach dem Entwurf vom 21.11.2026: Kopf DKV-Grün, Barmer Petrol, Orange nur für einen Rest.
   Keine style-Attribute (CSP) – alles über Klassen. Felder ≥ 16 px, festes Gerüst, nichts läuft seitlich heraus. */

:root {
  --gruen: #00843D;
  --gruen-dunkel: #006B31;
  --gruen-hell: #E8F6EE;
  --barmer: #0E7C86;
  --barmer-hell: #7FD6D8;
  --barmer-zart: #E2F3F4;
  --orange: #B4531A;
  --orange-zart: #FBEDE4;
  --tinte: #14202B;
  --grau: #5B6875;
  --linie: #E1E6EB;
  --grund: #EEF2F5;
  --weiss: #FFFFFF;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--tinte); background: var(--grund);
  -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { font-size: max(16px, 1em); }
button { cursor: pointer; }
[hidden] { display: none !important; }
.unsichtbar { position: fixed; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.zahl { font-variant-numeric: tabular-nums; }

/* --- Tor --- */
.tor { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 32px 20px; text-align: center; overflow-y: auto; background: var(--gruen); color: #fff; }
.tor-bild { border-radius: 20px; box-shadow: 0 6px 22px rgba(0,0,0,.18); }
.tor-wort { font-size: 30px; font-weight: 800; letter-spacing: -.01em; }
.tor-unter { font-size: 15px; color: #E8F6EE; }
.tor-text { max-width: 320px; line-height: 1.45; }
.fehler { color: #FFE3D1; font-weight: 700; min-height: 1.2em; }
.tor-code { width: 100%; max-width: 320px; display: flex; flex-direction: column; gap: 8px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.35); }
.tor-code-name { font-weight: 700; font-size: 14px; }
.tor-code input { border: 0; border-radius: 12px; padding: 12px; background: #fff; color: var(--tinte); text-align: center; letter-spacing: .08em; }

/* --- Gerüst --- */
#app { position: fixed; inset: 0; display: flex; flex-direction: column; }
.inhalt { flex: 1; min-height: 0; width: 100%; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; outline: none; padding-bottom: 24px; }
.inhalt > * { max-width: 600px; margin-left: auto; margin-right: auto; }
.leiste { flex: none; display: flex; gap: 10px; align-items: center; background: var(--weiss); border-top: 1px solid var(--linie);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
body.tippt .leiste { display: none; }
.leiste-knopf { flex: 1; min-width: 0; min-height: 44px; background: none; border: 0; font-size: 13px; font-weight: 600; color: var(--grau); border-radius: 12px; }
.leiste-knopf.an { color: var(--tinte); background: var(--grund); }
.leiste-haupt { flex: 1.6; min-height: 48px; border: 0; border-radius: 14px; background: var(--gruen); color: #fff; font-weight: 700; font-size: 15px;
  display: flex; align-items: center; justify-content: center; gap: 8px; }

/* --- Kopf --- */
.kopf { background: var(--gruen); color: #fff; border-radius: 0 0 26px 26px; padding: calc(16px + env(safe-area-inset-top)) 20px 20px;
  display: flex; flex-direction: column; gap: 4px; }
.kopf-oben { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 32px; }
.kopf-marke { font-weight: 800; font-size: 17px; }
.kopf-klein { font-size: 13px; color: #E8F6EE; }
.kopf-titel { margin: 0; font-size: 27px; font-weight: 800; letter-spacing: -.01em; overflow-wrap: anywhere; }
.kopf-zahl { font-size: 42px; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; }
.zurueck { background: none; border: 0; color: #E8F6EE; font-size: 15px; padding: 6px 0; min-height: 36px; text-align: left; }
.rad { background: rgba(255,255,255,.16); border: 0; color: #fff; width: 36px; height: 36px; border-radius: 50%; font-size: 17px; }
.balken { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 2px; margin-top: 12px; background: rgba(255,255,255,.2); }
.balken span { display: block; min-width: 3px; }
.b-lose { background: rgba(255,255,255,.55); } .b-barmer { background: var(--barmer-hell); } .b-bereit { background: #BFEBD2; } .b-dkv { background: #fff; }
.legende { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: #E8F6EE; margin-top: 6px; }
.legende i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }

/* --- Linie mit Haltestellen --- */
.linie { display: flex; align-items: center; margin-top: 4px; }
.halt { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #CBD3DB; background: #fff; flex: none; }
.halt.b { background: var(--barmer); border-color: var(--barmer); } .halt.d { background: var(--gruen); border-color: var(--gruen); }
.halt.jetzt { width: 16px; height: 16px; border-width: 3px; background: #fff; box-shadow: 0 0 0 4px rgba(14,124,134,.16); }
.halt.jetzt.d { box-shadow: 0 0 0 4px rgba(0,132,61,.18); }
.strich { flex: 1; height: 3px; background: var(--linie); } .strich.b { background: var(--barmer); } .strich.d { background: var(--gruen); }
.kopf .halt { border-color: rgba(255,255,255,.6); background: var(--gruen); }
.kopf .halt.b { background: var(--barmer-hell); border-color: var(--barmer-hell); } .kopf .halt.d { background: #fff; border-color: #fff; }
.kopf .halt.jetzt { background: var(--gruen); box-shadow: 0 0 0 4px rgba(255,255,255,.3); }
.kopf .strich { background: rgba(255,255,255,.3); } .kopf .strich.b { background: var(--barmer-hell); } .kopf .strich.d { background: #fff; }
.halt-namen { display: flex; justify-content: space-between; font-size: 11px; color: #E8F6EE; margin-top: 6px; }

/* --- Inhalt --- */
.abschnitt { padding: 16px 16px 0; display: flex; flex-direction: column; gap: 10px; }
.ab-titel { margin: 4px 4px 0; font-size: 14px; font-weight: 700; color: var(--grau); display: flex; justify-content: space-between; gap: 8px; }
.karte { background: var(--weiss); border-radius: 18px; padding: 13px 15px; display: flex; flex-direction: column; gap: 8px; border: 0; text-align: left;
  width: 100%; box-shadow: 0 1px 2px rgba(20,32,43,.06), 0 4px 14px rgba(20,32,43,.05); color: var(--tinte); }
.karte.gestrichelt { background: #F5FBFB; box-shadow: none; border: 1.5px dashed var(--barmer-hell); }
.karte.warn { box-shadow: 0 0 0 1.5px #E8C4AC; }
.karte-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.karte-titel { font-weight: 700; font-size: 16px; min-width: 0; overflow-wrap: anywhere; }
.karte-betrag { font-weight: 700; white-space: nowrap; }
.was { font-size: 13px; color: var(--grau); line-height: 1.4; }
.was b { color: var(--gruen); } .was .barmer { color: var(--barmer); font-weight: 700; }
.leer { text-align: center; color: var(--grau); padding: 28px 18px; line-height: 1.45; }
.leer-titel { display: block; font-weight: 700; color: var(--tinte); margin-bottom: 4px; }

/* Zeilen */
.liste { background: var(--weiss); border-radius: 18px; padding: 2px 15px; box-shadow: 0 1px 2px rgba(20,32,43,.06), 0 4px 14px rgba(20,32,43,.05); }
.zeile { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid #EEF1F4;
  width: 100%; background: none; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; min-height: 48px; color: var(--tinte); }
.zeile:first-child { border-top: 0; }
.z-links { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.z-titel { font-size: 15px; overflow-wrap: anywhere; }
.z-unter { font-size: 12px; color: var(--grau); }
.z-rechts { text-align: right; white-space: nowrap; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.z-rechts .klein { font-size: 12px; color: var(--grau); }
.marke { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--grund); color: var(--grau); }
.marke.orange { background: var(--orange-zart); color: var(--orange); }
.marke.barmer { background: var(--barmer-zart); color: var(--barmer); }
.marke.gruen { background: var(--gruen-hell); color: var(--gruen); }
.orange { color: var(--orange); } .barmerfarbe { color: var(--barmer); } .gruenfarbe { color: var(--gruen); }
.person-kopf { margin: 10px 4px 0; font-size: 13px; font-weight: 700; color: var(--grau); }
.wahlzeile { display: flex; align-items: center; gap: 12px; }
.wahlzeile input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--gruen); flex: none; }

/* Je Person */
.p-zeile { display: flex; flex-direction: column; gap: 6px; padding: 11px 0; border-top: 1px solid #EEF1F4; width: 100%; background: none; border-left: 0;
  border-right: 0; border-bottom: 0; text-align: left; color: var(--tinte); }
.p-zeile:first-child { border-top: 0; }
.p-oben { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.p-balken { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 2px; background: #EEF1F4; }
.p-balken span { display: block; }
.p-z { background: var(--gruen); } .p-o { background: var(--barmer-hell); } .p-r { background: var(--orange); }
.jahre { display: flex; gap: 6px; flex-wrap: wrap; }

/* Knöpfe */
.knopf { border: 0; border-radius: 16px; padding: 14px 16px; font-weight: 700; font-size: 15px; min-height: 48px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-align: center; text-decoration: none; }
.knopf-gruen { background: var(--gruen); color: #fff; }
.knopf-dunkel { background: var(--tinte); color: #fff; }
.knopf-hell { background: var(--weiss); color: var(--tinte); border: 1.5px solid #CBD3DB; }
.knopf-weiss { background: #fff; color: var(--gruen); }
.knopf-rot { background: none; color: var(--orange); border: 1.5px solid #E8C4AC; }
.knopf-breit { width: 100%; }
.knopf[disabled] { opacity: .45; }
.knopf-reihe { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.knopf-reihe.drei { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.chip { min-height: 36px; padding: 0 12px; border-radius: 18px; border: 1.5px solid #CBD3DB; background: #fff; font-size: 14px; font-weight: 500; }
.chip.an { background: var(--gruen); border-color: var(--gruen); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.info { background: var(--barmer-zart); border-radius: 14px; padding: 12px 14px; font-size: 13px; line-height: 1.45; }
.info.warn { background: var(--orange-zart); }
.info.gruen { background: var(--gruen-hell); }

/* Blatt */
.blatt-grund { position: fixed; inset: 0; background: rgba(20,32,43,.45); z-index: 20; }
.blatt { position: fixed; left: 0; right: 0; bottom: 0; max-height: 94dvh; z-index: 21; background: var(--grund); border-radius: 22px 22px 0 0;
  display: flex; flex-direction: column; max-width: 640px; margin: 0 auto; }
.blatt-kopf { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 6px; gap: 10px; }
.blatt-titel { margin: 0; font-size: 20px; font-weight: 800; min-width: 0; overflow-wrap: anywhere; }
.blatt-zu { width: 44px; height: 44px; border-radius: 50%; border: 0; background: #fff; font-size: 17px; flex: none; }
.blatt-inhalt { overflow-y: auto; overflow-x: hidden; padding: 4px 16px calc(22px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; }
.feld { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.feld label, .feld-name { font-size: 12px; color: var(--grau); font-weight: 600; }
.feld input, .feld select, .feld textarea { width: 100%; min-width: 0; border: 1.5px solid #CBD3DB; border-radius: 12px; padding: 10px 12px; background: #fff; }
.felder2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.schalter { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: #fff; border-radius: 14px; padding: 10px 14px; min-height: 52px; }
.schalter input { width: 48px; height: 28px; accent-color: var(--gruen); }

/* Seiten des Originals */
.seiten { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.seiten img { height: 220px; width: auto; border-radius: 10px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.12); flex: none; }
.seite-gross img { width: 100%; height: auto; border-radius: 10px; background: #fff; }

/* Zeitleiste im Beleg */
.zeit { background: #fff; border-radius: 18px; padding: 14px 15px; }
.st { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; column-gap: 12px; position: relative; padding-bottom: 13px; }
.st:last-child { padding-bottom: 0; }
.st::before { content: ""; position: absolute; left: 9px; top: 16px; bottom: -2px; width: 2px; background: var(--linie); }
.st:last-child::before { display: none; }
.h { width: 12px; height: 12px; border-radius: 6px; margin: 3px 0 0 4px; background: #CBD3DB; }
.h.b { background: var(--barmer); } .h.d { background: var(--gruen); } .h.r { background: var(--orange); }
.h.offen { background: #fff; border: 2px solid #CBD3DB; }
.st-t { font-size: 14px; font-weight: 600; } .st-u { font-size: 12px; color: var(--grau); margin-top: 1px; overflow-wrap: anywhere; }
.st-b { font-size: 14px; font-weight: 600; text-align: right; } .st-r { font-size: 12px; color: var(--grau); text-align: right; }

/* Hinweis */
.hinweis { position: fixed; left: 12px; right: 12px; top: calc(12px + env(safe-area-inset-top)); z-index: 30; background: var(--tinte); color: #fff;
  border-radius: 14px; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px;
  max-width: 600px; margin: 0 auto; }
.hinweis button { background: none; border: 0; color: #9FE0BC; font-weight: 700; padding: 6px 4px; }
.fortschritt { height: 6px; border-radius: 3px; background: #EEF1F4; overflow: hidden; }
.fortschritt span { display: block; height: 100%; background: var(--gruen); width: 0; transition: width .4s; }
.w0 { width: 0; } .w10 { width: 10%; } .w20 { width: 20%; } .w30 { width: 30%; } .w40 { width: 40%; } .w50 { width: 50%; }
.w60 { width: 60%; } .w70 { width: 70%; } .w80 { width: 80%; } .w90 { width: 90%; } .w100 { width: 100%; }
code.schluessel { display: block; background: #fff; border-radius: 10px; padding: 10px; font-size: 13px; overflow-wrap: anywhere; user-select: all; }
