/* =====================================================================
   app.css — MyRx UI-Gerüst Block 1 · APP-UI
   Tokens: Design-Tokens-Entscheid A3 v1-0 (03.07.) — „Frisch + Kachel"
   Regeln: System-Schrift, Dynamic Type (rem, -apple-system-body),
   Touch-Ziele ≥ 3rem, Mindesthöhen statt Fixhöhen, kein Inline-Nichts.
   ===================================================================== */

:root {
  --papier:      #FAFCFB;
  --tinte:       #16302B;
  --gruen:       #0E8560;
  --gruen-hell:  #E4F5EE;
  --linie:       #DBE5E1;
  --rot:         #C24E2E;
  --grau:        #5A6B67;
  --grau-hell:   #9AA8A4;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
@supports (font: -apple-system-body) {
  html { font: -apple-system-body; } /* folgt iOS „größerer Text" */
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--papier); color: var(--tinte);
  min-height: 100vh; padding-bottom: 6rem;
}
button, input, textarea, label { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------------- Kopf ---------------- */
.apphead {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.9rem 1rem 0.6rem;
}
.marke { font-weight: 800; font-size: 1.35rem; letter-spacing: -0.01em; }
.marke span { color: var(--gruen); }
.zurueck {
  border: none; background: none; color: var(--gruen);
  font-size: 1.05rem; font-weight: 700; min-height: 3rem; padding: 0 0.3rem;
}
.personpille {
  margin-left: auto;
  font-size: 0.95rem; font-weight: 600; background: #fff;
  border: 1px solid var(--linie); border-radius: 99rem;
  padding: 0.35rem 0.9rem; min-height: 2.75rem;
}
.mehrknopf {
  border: none; background: #fff; border: 1px solid var(--linie);
  border-radius: 99rem; width: 2.75rem; min-height: 2.75rem;
  font-size: 1.2rem; font-weight: 800; color: var(--grau);
}
.personpille + .mehrknopf { margin-left: 0; }
.mehrknopf:only-of-type { margin-left: auto; }

/* ---------------- Knöpfe ---------------- */
.knopf {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  width: 100%; min-height: 3.4rem; border: none; border-radius: 0.9rem;
  font-size: 1.1rem; font-weight: 700; margin-top: 0.6rem;
}
.knopf.primaer { background: var(--gruen); color: #fff; }
.knopf.sekundaer { background: #fff; color: var(--tinte); border: 2px solid var(--linie); }
.knopf.schmal { width: auto; padding: 0 1rem; margin-top: 0; min-height: 3rem; }
.knopf:active { transform: scale(0.99); }

/* ---------------- Zuhause: Listen ---------------- */
.abschnittslabel {
  padding: 0.9rem 1.1rem 0.25rem; font-size: 0.8rem; font-weight: 800;
  color: var(--grau); text-transform: uppercase; letter-spacing: 0.05em;
}
.listenkarte {
  display: flex; align-items: center; gap: 0.7rem; text-align: left;
  background: #fff; border: 1px solid var(--linie); border-radius: 0.8rem;
  margin: 0.18rem 0.9rem; padding: 0.46rem 0.95rem; min-height: 3.05rem;
  width: calc(100% - 1.8rem);
} /* wb-16: THOs Mittelweg, Feinstufe 07.07. — zwei Zeilen bleiben, Polster enger */
.listenkarte:active { background: var(--gruen-hell); }
.listenkarte .zeichen {
  width: 2.6rem; height: 2.6rem; border-radius: 0.7rem; flex-shrink: 0;
  display: grid; place-items: center; font-size: 1.1rem; font-weight: 800;
  background: var(--gruen-hell); color: var(--gruen);
}
.listenkarte .text { flex: 1; min-width: 0; }
.listenkarte .titel { font-size: 1.08rem; font-weight: 700; }
.listenkarte .unter { font-size: 0.85rem; color: var(--grau); margin-top: 0.1rem; }
.listenkarte .anzahl { font-size: 1rem; font-weight: 700; color: var(--grau); }
.listenkarte .pfeil { color: var(--grau-hell); font-size: 1.3rem; font-weight: 700; }
.listenkarte.gedimmt { opacity: 0.62; }
.listenkarte.gedimmt .zeichen {
  background: var(--papier); border: 1.5px dashed var(--grau-hell); color: var(--grau-hell);
}
.karten-merker {
  display: inline-block; margin-top: 0.15rem;
  font-size: 0.78rem; color: var(--rot); font-weight: 600;
}

/* ---------------- Leer-Zustand ---------------- */
.leer {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  justify-content: center; gap: 1rem; padding: 3rem 1.4rem 1rem; min-height: 60vh;
}
.leer-viereck {
  width: 5.4rem; height: 5.4rem; border: 2.5px dashed var(--gruen); border-radius: 1.1rem;
  display: grid; place-items: center; color: var(--gruen); font-size: 2.2rem;
}
.leer h1 { font-size: 1.45rem; line-height: 1.25; }
.leer p { font-size: 1.05rem; color: var(--grau); max-width: 18rem; line-height: 1.45; }
.leer .knopf { max-width: 20rem; }

/* ---------------- Einzelplan ---------------- */
.plankopf { padding: 0 1.1rem 0.4rem; }
.plantitel { font-size: 1.3rem; font-weight: 800; }
.planuntertitel { font-size: 0.9rem; color: var(--grau); margin-top: 0.1rem; }
.planhinweis {
  margin: 0.4rem 0.9rem; padding: 0.6rem 0.9rem;
  background: #fff; border: 1.5px dashed var(--linie); border-radius: 0.8rem;
  font-size: 0.88rem; color: var(--grau);
}
.reiter {
  display: grid; grid-template-columns: 1fr 1fr; margin: 0.3rem 0.9rem 0.4rem;
  background: #fff; border: 2px solid var(--tinte); border-radius: 0.8rem; overflow: hidden;
}
.reiter button {
  border: none; background: #fff; font-size: 1.02rem; font-weight: 700; min-height: 2.9rem;
}
.reiter button.an { background: var(--tinte); color: #fff; }
.spaltenkopf { display: flex; justify-content: flex-end; padding: 0.35rem 1.35rem 0.1rem; }
.spaltenkopf .zellen { display: grid; grid-template-columns: repeat(4, 2rem); gap: 0.2rem; }
.spaltenkopf .zellen span {
  font-size: 0.62rem; color: var(--grau); font-weight: 800; text-align: center;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.planliste {
  background: #fff; border: 1px solid var(--linie); border-radius: 0.9rem;
  margin: 0.1rem 0.9rem 0.8rem; overflow: hidden;
}
.gruppenkopf {
  padding: 0.55rem 1.1rem 0.25rem; font-size: 0.78rem; font-weight: 800;
  color: var(--grau); text-transform: uppercase; letter-spacing: 0.05em;
  background: var(--papier); border-top: 1px solid var(--linie);
}
.planliste .gruppenkopf:first-child { border-top: none; }
.zeile {
  display: flex; align-items: center; justify-content: space-between; gap: 0.7rem;
  width: 100%; text-align: left; background: #fff; border: none;
  border-top: 1px solid var(--papier);
  padding: 0.55rem 0.9rem 0.55rem 1.1rem; min-height: 3.25rem;
}
.planliste .zeile:first-child { border-top: none; }
.zeile:active { background: var(--gruen-hell); }
.zeile .name { font-size: 1.02rem; font-weight: 700; min-width: 0; line-height: 1.25; }
.zeile .name .stift { color: var(--grau-hell); font-weight: 400; }
.zeile .name small { display: block; font-size: 0.78rem; color: var(--grau); font-weight: 500; margin-top: 0.05rem; }
.zeile.pausiert { opacity: 0.55; }
.zeile.pausiert .name::after { content: " · pausiert"; font-size: 0.78rem; color: var(--grau); font-weight: 600; }

/* Kachel-Regel (A3): belegte Zellen = satte Kacheln, weiße Ziffer */
.quartett {
  display: grid; grid-template-columns: repeat(4, 2rem); gap: 0.2rem;
  flex-shrink: 0; font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.q {
  background: var(--papier); border: 1px solid var(--linie); border-radius: 0.35rem;
  text-align: center; padding: 0.2rem 0 0.14rem; font-size: 0.8rem; font-weight: 700;
  color: var(--grau-hell); overflow: hidden;
}
.q.an { background: var(--gruen); border-color: var(--gruen); color: #fff; font-weight: 800; }

/* ---------------- Mehr ---------------- */
.mehrtitel { font-size: 1.3rem; font-weight: 800; padding: 0.4rem 1.1rem 0.3rem; }
.mehrtitel.klein { font-size: 0.95rem; color: var(--grau); padding-top: 1rem; }
.wbchip {
  font-size: 0.7rem; font-weight: 800; color: #8a6d00; background: #FFF3D6;
  border: 1px solid #D6A94E; border-radius: 0.5rem; padding: 0.1rem 0.45rem;
  vertical-align: 0.1rem;
}
.mehrliste {
  background: #fff; border: 1px solid var(--linie); border-radius: 1rem;
  margin: 0.3rem 0.9rem; overflow: hidden;
}
.mehrzeile {
  display: block; width: 100%; text-align: left; background: #fff; border: none;
  border-top: 1px solid var(--papier); padding: 0.85rem 1.1rem; min-height: 3.4rem;
  font-size: 1.02rem; font-weight: 700;
}
.mehrliste .mehrzeile:first-child { border-top: none; }
.mehrzeile:active { background: var(--gruen-hell); }
.mehrzeile.gefahr { color: var(--rot); }
.mehrzeile.still:active { background: #fff; }
.mehrsub { display: block; font-size: 0.8rem; color: var(--grau); font-weight: 500; margin-top: 0.1rem; }

/* ---------------- Scan-Knopf ---------------- */
.fab {
  position: fixed; right: 1.1rem; bottom: 1.3rem; z-index: 40;
  width: 3.8rem; height: 3.8rem; border-radius: 50%;
  background: var(--gruen); color: #fff; border: none; font-size: 1.5rem;
  box-shadow: 0 0.3rem 1rem rgba(14, 133, 96, 0.4);
}

/* ---------------- Eintrag-Sheet (B14) ---------------- */
.schleier {
  position: fixed; inset: 0; background: rgba(22, 48, 43, 0.45); z-index: 60;
}
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  background: #fff; border-radius: 1.4rem 1.4rem 0 0;
  padding: 0.7rem 1.1rem calc(1rem + env(safe-area-inset-bottom));
  box-shadow: 0 -0.5rem 1.8rem rgba(0, 0, 0, 0.28);
  max-height: 88vh; overflow-y: auto;
}
.griff { width: 2.75rem; height: 0.32rem; background: var(--linie); border-radius: 99rem; margin: 0 auto 0.7rem; }
.sheetkopf { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; }
.sheettitel { font-size: 1.2rem; font-weight: 800; }
.sheetuntertitel { font-size: 0.85rem; color: var(--grau); margin-top: 0.1rem; }
.pausiertchip {
  margin-top: 0.5rem; display: inline-block;
  font-size: 0.8rem; font-weight: 700; color: var(--grau);
  background: var(--papier); border: 1px dashed var(--grau-hell);
  border-radius: 0.6rem; padding: 0.25rem 0.6rem;
}
.feldlabel { display: block; font-size: 0.9rem; font-weight: 800; margin-top: 1rem; }
.feldsub { display: block; font-size: 0.78rem; color: var(--grau); font-weight: 500; margin-top: 0.05rem; }
textarea, input[type="number"] {
  width: 100%; margin-top: 0.4rem; padding: 0.6rem 0.7rem;
  border: 1.5px solid var(--linie); border-radius: 0.7rem; background: var(--papier);
  font-size: 1rem; line-height: 1.4;
}
textarea:focus, input:focus { outline: 2px solid var(--gruen); border-color: var(--gruen); background: #fff; }
.vorratzeile { display: flex; gap: 0.5rem; align-items: stretch; margin-top: 0.4rem; }
.vorratzeile input { margin-top: 0; flex: 1; }
.vorratstand { font-size: 0.82rem; color: var(--grau); margin-top: 0.3rem; }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 6rem; transform: translateX(-50%);
  background: var(--tinte); color: #fff; font-size: 0.92rem; font-weight: 600;
  padding: 0.7rem 1.1rem; border-radius: 0.8rem; z-index: 90;
  max-width: 88vw; text-align: center;
}

@media (prefers-reduced-motion: no-preference) {
  .sheet { animation: hoch 0.22s ease-out; }
  @keyframes hoch { from { transform: translateY(30%); opacity: 0.6; } to { transform: none; opacity: 1; } }
}

/* ============ v0-2: Scan-Fluss + Alte (N3') ============ */
.wbbanner {
  margin: 0.4rem 0.9rem; padding: 0.6rem 0.9rem;
  background: #FFF3D6; border: 1px solid #D6A94E; border-radius: 0.8rem;
  font-size: 0.85rem; color: #6b5106;
}
.scanpanel { padding: 0 0.9rem; }
.knopf.geist { background: transparent; border: none; color: var(--grau); font-size: 0.95rem; min-height: 2.8rem; }

.zeile.alt { opacity: 0.55; }
.zeile.alt .name::after { content: " · nicht mehr auf dem Plan"; font-size: 0.78rem; color: var(--grau); font-weight: 600; }
.chip {
  display: inline-block; margin-left: 0.35rem; vertical-align: 0.1rem;
  font-size: 0.7rem; font-weight: 800; border-radius: 0.5rem; padding: 0.08rem 0.4rem;
}
.chip.neu { background: var(--gruen-hell); color: var(--gruen); border: 1px solid var(--gruen); }
.chip.geaendert { background: var(--papier); color: var(--grau); border: 1px solid var(--linie); }

/* Bestätigen-Moment */
.scan-titel { font-size: 1.2rem; font-weight: 800; display: flex; align-items: center; gap: 0.5rem; }
.scan-titel .ok { color: var(--gruen); font-size: 1.35rem; }
.fakten { margin: 0.6rem 0 0.2rem; }
.fakten div { display: flex; justify-content: space-between; gap: 0.8rem; padding: 0.4rem 0; border-bottom: 1px solid var(--papier); font-size: 0.98rem; }
.fakten .k { color: var(--grau); }
.fakten .v { font-weight: 700; text-align: right; }
.seitenpunkte { display: flex; gap: 0.4rem; justify-content: center; margin: 0.6rem 0 0.2rem; }
.punkt { width: 2.2rem; height: 0.5rem; border-radius: 99rem; background: var(--linie); }
.punkt.da { background: var(--gruen); }
.personwahl {
  display: flex; align-items: center; gap: 0.7rem; width: 100%; text-align: left;
  border: 2px solid var(--linie); border-radius: 0.9rem; background: #fff;
  padding: 0.7rem 0.9rem; margin-top: 0.55rem; min-height: 3.4rem;
  font-size: 1.05rem; font-weight: 700;
}
.personwahl:active { background: var(--gruen-hell); }
.personwahl.neuanlage { border-style: dashed; border-color: var(--gruen); color: var(--gruen); }
.personwahl .kreis {
  width: 2.2rem; height: 2.2rem; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 0.9rem; font-weight: 800;
  background: var(--gruen-hell); color: var(--gruen);
}

/* ============ v0-3: Echte Kamera — Draufhalten pur (B6/B7) ============ */
.kamera {
  position: fixed; inset: 0; z-index: 50; background: #22332F;
  display: flex; flex-direction: column; padding-top: env(safe-area-inset-top);
}
.kamera-x {
  position: absolute; top: calc(0.8rem + env(safe-area-inset-top)); right: 0.9rem; z-index: 5;
  width: 3rem; height: 3rem; border-radius: 50%; border: none;
  background: rgba(0,0,0,0.3); color: #fff; font-size: 1.2rem; font-weight: 800;
}
.kamera-status {
  margin: 0.9rem auto 0; background: rgba(0,0,0,0.35); color: #DDE7E4;
  font-size: 0.88rem; font-weight: 700; padding: 0.35rem 0.9rem; border-radius: 99rem;
}
.kamera-hinweis { color: #DDE7E4; text-align: center; font-size: 0.95rem; padding: 0.7rem 1.6rem 0; line-height: 1.4; }
.kamera-hinweis b { color: #fff; }
.sucher {
  position: relative; margin: 1rem auto 0; width: min(78vw, 22rem); aspect-ratio: 1;
  border-radius: 0.8rem; overflow: hidden; background: #000;
}
.sucher video { width: 100%; height: 100%; object-fit: cover; display: block; }
.sucher-rahmen { position: absolute; inset: 0; pointer-events: none; }
.sucher-rahmen::before, .sucher-rahmen::after,
.sucher-rahmen { --ecke: 2.2rem; --dicke: 4px; --farbe: rgba(255,255,255,0.92); }
.sucher-rahmen::before, .sucher-rahmen::after {
  content: ""; position: absolute; width: var(--ecke); height: var(--ecke);
  border: var(--dicke) solid var(--farbe);
}
.sucher-rahmen::before { top: 0.5rem; left: 0.5rem; border-right: none; border-bottom: none; border-radius: 0.5rem 0 0 0; }
.sucher-rahmen::after  { bottom: 0.5rem; right: 0.5rem; border-left: none; border-top: none; border-radius: 0 0 0.5rem 0; }
.sucher-rahmen.treffer { --farbe: #4FC08D; }
.kruecke-zeile { text-align: center; padding: 1rem 0 0; min-height: 3rem; }
.kruecke-link {
  border: none; background: none; color: rgba(255,255,255,0.7);
  font-size: 0.95rem; font-weight: 700; min-height: 2.75rem; padding: 0 0.8rem;
  border-bottom: 1px dotted rgba(255,255,255,0.45);
}
.kruecke-link.klein { font-size: 0.8rem; min-height: 2.2rem; color: rgba(255,255,255,0.5); }
.kamera-wbzeile {
  margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 0.8rem;
  padding: 0.6rem 1rem calc(1rem + env(safe-area-inset-bottom));
}
.kamera-wbchip {
  font-size: 0.72rem; font-weight: 800; color: #FFE9AE;
  background: rgba(0,0,0,0.3); border: 1px solid rgba(255,233,174,0.5);
  border-radius: 0.5rem; padding: 0.15rem 0.5rem;
}

/* ============ 1a: Sortier-Modus, Personen-Sheet, Lizenzen, Detail ============ */
.zuhauswerkzeug { display: flex; justify-content: flex-end; padding: 0 1rem; min-height: 0; }
.sortknopf {
  border: 1.5px solid var(--linie); background: #fff; color: var(--grau);
  border-radius: 0.7rem; font-size: 0.88rem; font-weight: 700;
  min-height: 2.4rem; padding: 0 0.8rem;
}
.sortknopf.an { background: var(--tinte); color: #fff; border-color: var(--tinte); }
.sortpfeile { display: flex; gap: 0.35rem; flex-shrink: 0; }
.sortpfeile button {
  width: 2.75rem; min-height: 2.75rem; border-radius: 0.6rem;
  border: 2px solid var(--linie); background: #fff; font-size: 1rem; font-weight: 800; color: var(--tinte);
}
.sortpfeile button:disabled { opacity: 0.25; }
.listenkarte.sortier { border-style: dashed; }

.personzeile {
  display: flex; align-items: center; gap: 0.8rem; width: 100%; text-align: left;
  background: #fff; border: 2px solid var(--linie); border-radius: 0.9rem;
  padding: 0.7rem 0.9rem; margin-top: 0.55rem; min-height: 3.6rem;
  font-size: 1.05rem; font-weight: 700;
}
.personzeile:active { background: var(--gruen-hell); }
.personzeile .kreis {
  width: 2.4rem; height: 2.4rem; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 0.95rem; font-weight: 800;
  background: var(--gruen-hell); color: var(--gruen);
}
.personzeile .haken { margin-left: auto; color: var(--gruen); font-size: 1.2rem; }
.personzeile.anlegen { border-style: dashed; border-color: var(--gruen); color: var(--gruen); }
.sheet .kleinlink {
  display: block; width: 100%; text-align: center; border: none; background: none;
  color: var(--grau); font-size: 0.92rem; font-weight: 700; min-height: 2.6rem; margin-top: 0.3rem;
}
.feldhinweis { font-size: 0.8rem; color: var(--grau); margin-top: 0.25rem; }
.knopf.gefahrrand { background: #fff; color: var(--rot); border: 2px solid var(--rot); }

.verlauf { margin-top: 0.9rem; }
.verlauf .vtitel { font-size: 0.9rem; font-weight: 800; }
.verlauf .vzeile { display: flex; justify-content: space-between; gap: 0.6rem; padding: 0.35rem 0; border-bottom: 1px solid var(--papier); font-size: 0.92rem; }
.verlauf .vzeile .vd { color: var(--grau); }

.lizenztext { padding: 0 1.1rem; font-size: 0.95rem; line-height: 1.5; }
.lizenztext h3 { font-size: 1.02rem; margin-top: 0.9rem; }
.lizenztext p { margin-top: 0.3rem; color: #33453F; }
.lizenzfuss { font-size: 0.82rem; color: var(--grau); margin-top: 1rem; }

/* ============ B1: Listen-Mitgliedschaft im Eintrag-Sheet ============ */
.listentoggle {
  display: flex; align-items: center; gap: 0.6rem; width: 100%; text-align: left;
  background: #fff; border: 2px solid var(--linie); border-radius: 0.8rem;
  padding: 0.55rem 0.9rem; margin-top: 0.45rem; min-height: 3rem;
  font-size: 1rem; font-weight: 700;
}
.listentoggle .zeichen { font-size: 1.1rem; color: var(--grau-hell); font-weight: 800; }
.listentoggle.an { border-color: var(--gruen); background: var(--gruen-hell); }
.listentoggle.an .zeichen { color: var(--gruen); }

/* ============ B2: Plan-Kopf-Optionen, Aussteller ============ */
.plankopfzeile { display: flex; align-items: center; gap: 0.6rem; }
.plankopfzeile .plantitel { flex: 1; min-width: 0; }
.mehrknopf.klein { width: 2.4rem; min-height: 2.4rem; font-size: 1rem; flex-shrink: 0; }

/* ============ P2: „+ Medikament" (Katalog-Suche + Frei-Erfassen) ============ */
#infoSheetInhalt input {
  width: 100%; margin-top: 0.4rem; padding: 0.6rem 0.7rem;
  border: 1.5px solid var(--linie); border-radius: 0.7rem; background: var(--papier);
  font-size: 1rem; line-height: 1.4;
}
.trefferliste { margin-top: 0.4rem; max-height: 38vh; overflow-y: auto; }
.trefferzeile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.1rem;
  width: 100%; text-align: left; background: #fff; border: 2px solid var(--linie);
  border-radius: 0.8rem; padding: 0.55rem 0.9rem; margin-top: 0.45rem;
  min-height: 3rem; font-weight: 700;
}
.trefferzeile:active { background: var(--gruen-hell); }
.trefferzeile .treffersub { font-size: 0.82rem; color: var(--grau); font-weight: 500; }
.trefferleer { margin-top: 0.7rem; font-size: 0.92rem; color: var(--grau); }
.quartettfelder { display: flex; gap: 0.5rem; margin-top: 0.4rem; }
#infoSheetInhalt .quartettfelder input { margin-top: 0; text-align: center; font-variant-numeric: tabular-nums; }

/* ============ Suche v2: Gruppen-Trefferliste (Kontrakt v0-7) ============ */
.gruppenzeile {
  display: flex; align-items: center; gap: 0.5rem;
  width: 100%; text-align: left; background: #fff; border: 2px solid var(--linie);
  border-radius: 0.8rem; padding: 0.55rem 0.9rem; margin-top: 0.45rem;
  min-height: 3rem; font-weight: 700;
}
.gruppenzeile:active { background: var(--gruen-hell); }
.gruppenname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gruppensub { flex: none; font-size: 0.78rem; color: var(--grau); font-weight: 600; }
.packungsklappe { margin-left: 0.9rem; }
.packungszeile {
  display: block; width: calc(100% - 0.0rem); text-align: left;
  background: var(--papier); border: 1.5px solid var(--linie);
  border-radius: 0.7rem; padding: 0.5rem 0.8rem; margin-top: 0.35rem;
  font-size: 0.92rem; font-weight: 600; min-height: 2.6rem;
}
.packungszeile:active { background: var(--gruen-hell); }

/* ============ Such-Vollbild (iOS-Tastatur-Befund THO 06.07.) ============ */
.sheet.suchmodus {
  top: 0; border-radius: 0; max-height: none;
  display: flex; flex-direction: column; overflow: hidden;
  padding-bottom: 0.4rem;
}
.suchmodus #infoSheetInhalt { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.suchmodus .trefferliste {
  flex: 1 1 auto; min-height: 0; max-height: none;
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding-bottom: 0.6rem;
}
.suchlinks { display: flex; gap: 1.4rem; align-items: center; margin-top: 0.5rem; flex: none; }

/* ============ wb-14: Sofa-Beschlüsse (Kapsel · H3 · Türen · dichte Zeilen) ============ */
/* G3-Kapsel: geteilte Pille, Flüsterton, Daumen-Zone */
.kapsel { position: fixed; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom, 0px));
          display: flex; border-radius: 99px; overflow: hidden;
          box-shadow: 0 2px 6px rgba(0,0,0,.14); z-index: 40; }
.kammer { width: 3.75rem; padding: 0.375rem 0; text-align: center; font-weight: 800; /* wb-18/D8: rem statt px — waechst mit iOS-Schrift */
          font-size: 0.95rem; border: 2px solid var(--gruen); background: #fff; color: var(--gruen); }
/* wb-16: Kapsel flacher + breiter — weniger Klotz, größere Tippfläche je Kammer */
.kscan { background: var(--tinte); color: #fff; border-color: var(--tinte);
         border-radius: 99px 0 0 99px; }
.kliste { border-left: none; border-right: 1px dashed var(--gruen); }
.kmedi { background: var(--gruen); color: #fff; border-left: none; border-radius: 0 99px 99px 0; }
.kammer:active { filter: brightness(1.08); }

/* H3: Ordnen wohnt in den Überschriften */
.abschnittszeile { display: flex; align-items: baseline; }
.abschnittszeile .abschnittslabel { margin: 0; }
.ordnenwerk { margin-left: auto; display: flex; gap: 0.4rem; }
.ordnenknopf { font-size: 0.95rem; font-weight: 800; color: var(--grau);
               background: none; border: none; padding: 0.15rem 0.45rem; border-radius: 0.5rem; }
.ordnenknopf.an { color: var(--gruen); background: var(--gruen-hell); }

/* J2-Türen: Einstellungen */
.tuer { display: flex; align-items: center; gap: 0.9rem; width: 100%; text-align: left;
        background: #fff; border: 2px solid var(--linie); border-radius: 1.1rem;
        padding: 1rem; margin-bottom: 11px; }
.tuer:active { background: var(--gruen-hell); }
.tbild { font-size: 1.7rem; flex: none; }
.tmitte { flex: 1; min-width: 0; }
.twort { display: block; font-weight: 800; font-size: 1.05rem; }
.tsub { display: block; color: var(--grau-hell); font-weight: 600; font-size: 0.78rem; }
.tpfeil { color: var(--grau-hell); font-size: 1.2rem; flex: none; }
.tuersatz { font-size: 0.88rem; color: var(--grau); margin: 0 2px 14px; line-height: 1.45; }
.fussleiste { display: flex; justify-content: space-between; align-items: center;
              margin-top: 18px; font-size: 0.74rem; color: var(--grau-hell); font-weight: 600; }
.werklink { color: var(--warnfarbe, #B8860B); background: #FBF4E4; border: 1px solid #B8860B;
            border-radius: 99px; padding: 4px 11px; font-weight: 800; font-size: 0.78rem; }

/* D-Basis: dichte einzeilige Treffer (Pillen folgen mit v0-7b) */
.gruppenzeile.dicht { min-height: 2.5rem; padding: 0.42rem 0.6rem; margin-top: 0.3rem;
                      border-width: 1.5px; border-radius: 0.6rem;
                      flex-direction: row; align-items: baseline; gap: 0.45rem;
                      font-weight: 600; font-size: 0.82rem; }
.zg-name { font-weight: 800; font-size: 0.86rem; color: var(--tinte);
           overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-shrink: 1; }
.zg-w { color: var(--grau); white-space: nowrap; }
.zg-d { color: var(--gruen); font-weight: 800; white-space: nowrap; }
.zg-f { color: var(--grau); white-space: nowrap; }
.zg-m { white-space: nowrap; }
.zg-h { margin-left: auto; color: var(--grau-hell); white-space: nowrap; flex: none; }

/* ▦ am Suchfeld */
.suchzeile { display: flex; gap: 0.5rem; align-items: stretch; }
.suchzeile input { flex: 1; }
.suchscan { flex: none; width: 52px; border: 2px solid var(--tinte); background: var(--tinte);
            color: #fff; border-radius: 0.7rem; font-size: 1.1rem; font-weight: 800; margin-top: 0.4rem; }

/* ============ wb-15: Filter-Pillen (v0-7b, Schaubild D) ============ */
.pillenzeile { display: flex; gap: 5px; margin-top: 0.5rem; flex: none; }
.fpille { flex: 1; min-width: 0; text-align: center; border: 1.5px solid var(--linie);
          border-radius: 99px; padding: 4px 2px; background: var(--papier); }
.fpille .fpwort { display: block; font-size: 0.7rem; font-weight: 800; color: var(--grau); white-space: nowrap; }
.fpille .fpwert { display: block; font-size: 0.66rem; font-weight: 700; color: var(--grau-hell);
                  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fpille.an { background: var(--gruen-hell); border-color: var(--gruen); }
.fpille.an .fpwort, .fpille.an .fpwert { color: var(--gruen); }
.fpille.auf { border-color: var(--gruen); }
.fklappe { border: 1.5px solid var(--gruen); border-radius: 0.9rem; background: #fff;
           box-shadow: 0 6px 18px rgba(0,0,0,.14); padding: 4px; margin-top: 6px;
           max-height: 34vh; overflow-y: auto; overscroll-behavior: contain; flex: none; }
.fkzeile { display: flex; justify-content: space-between; gap: 0.6rem; width: 100%;
           text-align: left; padding: 0.55rem 0.75rem; font-size: 0.92rem; font-weight: 700; /* wb-18/D8 */
           border-radius: 0.6rem; background: none; border: none; }
.fkzeile.an { background: var(--gruen-hell); color: var(--gruen); }
.fkzeile .fkzahl { color: var(--grau-hell); font-weight: 600; font-size: 0.84rem; }

/* wb-16: Such-Kopf mit ✕ (Abbrechen-Fehltipp-Falle entschärft) */
.suchkopf { display: flex; align-items: center; gap: 0.6rem; }
.suchkopf .sheettitel { flex: 1; }
.xknopf { flex: none; width: 40px; height: 40px; border-radius: 11px;
          border: 2px solid var(--linie); background: var(--papier); color: var(--grau);
          font-size: 1.05rem; font-weight: 800; }
.xknopf:active { background: var(--gruen-hell); }

/* ============ wb-17: J1-Kacheln · Riesel-Balken ============ */
.tuergitter { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kachel { background: #fff; border: 2px solid var(--linie); border-radius: 1.2rem;
          padding: 1.05rem 0.6rem 0.9rem; text-align: center; }
.kachel:active { background: var(--gruen-hell); }
.kachel .tbild { font-size: 2rem; display: block; margin-bottom: 0.45rem; }
.kachel .twort { display: block; font-weight: 800; font-size: 0.98rem; }
.kachel .tsub { display: block; color: var(--grau-hell); font-weight: 600; font-size: 0.74rem;
                margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ladebalken { position: relative; height: 2rem; border: 2px solid var(--linie);
              border-radius: 99px; overflow: hidden; background: var(--papier); margin-top: 0.6rem; }
.ladefuellung { position: absolute; inset: 0 auto 0 0; width: 0%; background: var(--gruen-hell);
                border-right: 2px solid var(--gruen); transition: width .25s ease; }
.ladepillen { position: absolute; inset: 0; display: flex; align-items: center;
              justify-content: center; gap: 0.6rem; font-size: 0.95rem;
              animation: rieseln 1.2s ease-in-out infinite alternate; }
@keyframes rieseln { from { transform: translateY(-2px); } to { transform: translateY(2px); } }

/* ================= wb-18: Praxis-Karte (Schaubild P, Dichte-Stufe 2, rem) ================= */
.kzeile { display: flex; align-items: center; gap: 0.55rem; width: 100%;
  padding: 0.28rem 1.1rem; border-top: 1px solid var(--linie);
  min-height: 2.4rem; background: none; text-align: left; }
.kzeile:active { background: var(--gruen-hell); }
.kzeile .medi { flex: 1; min-width: 0; }
.kzeile .kzname { font-weight: 700; font-size: 0.95rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kzeile .kzunter { font-size: 0.72rem; color: var(--grau); margin-top: 0.03rem; }
.kzeile .kzunter b { font-weight: 700; }
.kzeile .quartett { flex: none; }
.kzeile.kz-gelb { background: #FFF8E1; }
.kzeile.kz-gelb .kzunter b { color: #B07C1E; }
.kzeile.kz-gruen { background: #EDF8F1; }
.kzeile.kz-gruen .kzunter b { color: var(--gruen); }
.kzeile.kz-grau { background: #F2F4F3; }
.kzeile.kz-grau .kzname { text-decoration: line-through; color: var(--grau); font-weight: 600; }
.kzeile.kz-grau .q { opacity: 0.45; }
/* Absetzen-Dialog (Schaubild Q, Moment 2) */
.absetzhaken { display: flex; align-items: center; gap: 0.5rem;
  width: 100%; background: none; text-align: left;
  padding: 0.5rem 0.2rem; font-size: 0.95rem; }
.absetzhaken .kasten { width: 1.25rem; height: 1.25rem; border-radius: 0.3rem;
  border: 2px solid var(--linie); flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; color: var(--gruen); }
.absetzhaken.an .kasten { border-color: var(--gruen); background: var(--gruen-hell); }

/* ===== a3a: Einwurf (Ziegel wb-18-einwurf) ===== */
#einwurfSchleier { position:fixed; inset:0; background:rgba(22,48,43,0.35); z-index:80; }
#einwurfBlatt { position:fixed; left:0.6rem; right:0.6rem; bottom:0; z-index:81; background:#fff;
  border-radius:20px 20px 0 0; box-shadow:0 -10px 40px rgba(0,0,0,0.3); padding:1.1rem 1rem 1.5rem; text-align:center; }
#einwurfBlatt .ewIkon { font-size:2.4rem; }
#einwurfBlatt .ewTitel { font-size:1.05rem; margin:0.3rem 0 0; }
#einwurfBlatt .ewText { color:var(--grau, #5A6B67); font-size:0.92rem; margin:0.45rem 0 0; line-height:1.45; }
.ewPunkte { display:flex; justify-content:center; gap:0.45rem; margin-top:0.4rem; }
.ewPunkte i { width:0.6rem; height:0.6rem; border-radius:50%; background:var(--gruen, #0E8560); }
.ewPunkte i:nth-child(1){ opacity:0.35; } .ewPunkte i:nth-child(2){ opacity:0.65; }
.ewKnopf { display:block; width:100%; margin-top:0.9rem; padding:0.7rem; border:none; border-radius:13px;
  background:var(--gruen, #0E8560); color:#fff; font:inherit; font-weight:800; font-size:0.98rem; cursor:pointer; }
.ewKnopf.zweit { background:#fff; color:var(--gruen, #0E8560); border:1.5px solid var(--gruen, #0E8560); }
#btnEinwerfen { display:block; width:calc(100% - 1.6rem); margin:0.9rem 0.8rem 0; padding:0.75rem; border:none;
  border-radius:13px; background:var(--gruen, #0E8560); color:#fff; font:inherit; font-weight:800; font-size:1rem; cursor:pointer; }
.bestellhaken { color:var(--gruen, #0E8560); font-weight:700; font-size:0.8rem; white-space:nowrap; }

/* =====================================================================
   a3a-Nachtrag 16.08.: Konto-Sphäre (Schaubild R, Gesetz B3 — hinter
   der EINEN blauen Tür ist ALLES blau: Kopf, Grund). Farbe trägt nie
   allein: die Sphäre spricht zusätzlich über Titel und Wortlaut.
   ===================================================================== */
:root { --konto: #3B4C63; --konto-tief: #2E3C4F; --konto-hell: #A9B8CE; }
.tuerblau { margin-top: 1.4rem; }
.mehrzeile.konto { border-left: 4px solid var(--konto); color: var(--konto); font-weight: 600; }
.mehrzeile.konto .mehrsub { color: var(--grau); font-weight: 400; }
.kontopunkt { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%;
  background: var(--konto); margin-right: .5rem; vertical-align: .08rem; }
body.kontoSphaere { background: var(--konto); }
body.kontoSphaere .apphead { background: var(--konto); border-color: var(--konto-tief); }
body.kontoSphaere .zurueck { color: #fff; }
.ansicht.konto { background: var(--konto); color: #fff; min-height: calc(100vh - 4rem); }
.ansicht.konto .mehrtitel { color: #fff; }
.ansicht.konto .tuersatz { color: var(--konto-hell); }
.ansicht.konto .feldlabel { color: #fff; margin-top: .4rem; }
.ansicht.konto .feldsub { color: var(--konto-hell); }
.ansicht.konto input { width: 100%; min-height: 3rem; border: 2px solid var(--konto-tief);
  border-radius: .7rem; padding: 0 .8rem; background: #fff; color: var(--tinte); margin-bottom: 1rem; }
.knopf.kontoprimaer { background: #fff; color: var(--konto); }
.knopf.kontogeist { background: none; color: var(--konto-hell); border: 2px solid var(--konto-tief); }
.kontofehler { background: var(--konto-tief); border-left: 4px solid var(--rot); color: #fff;
  padding: .7rem .8rem; border-radius: .5rem; margin-bottom: 1rem; }
.kontokarte { background: var(--konto-tief); border-radius: .9rem; padding: 1rem; margin-bottom: 1rem; }
.kontozeile { font-weight: 600; font-size: 1.05rem; }
.kontosub { color: var(--konto-hell); margin-top: .35rem; }
