/* =====================================================================
   PAPERSIM DESIGN-SYSTEM
   ---------------------------------------------------------------------
   Gemeinsam für App, Anmeldung, Einrichtung und Admin.
   Farben und Schrift wie die Website (07-Website): Navy #0e2135,
   Blau #65adef aus dem Logo. Für Touch gebaut: Tippflächen ab 44 px.
   Die Dokumente selbst (Arztbrief, BMP, Formulare) haben eigene Stile
   in module/module.css und index.html und bleiben realistisch.
   ===================================================================== */
@font-face {
  font-family: "Outfit";
  src: url("schrift/outfit.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --ps-navy: #0e2135;
  --ps-navy-2: #1c3a5c;
  --ps-blau: #65adef;
  --ps-blau-stark: #1d6fc4;
  --ps-blau-hell: #e8f3fd;
  --ps-blau-mittel: #cfe6fb;
  --ps-text: #2b3b4f;
  --ps-grau: #5b6b80;
  --ps-grau-hell: #8a98aa;
  --ps-linie: #e2e8f0;
  --ps-papier: #f5f8fb;
  --ps-weiss: #ffffff;
  --ps-rot: #c4373c;
  --ps-rot-hell: #fdecec;
  --ps-gruen: #2f9e6e;
  --ps-gruen-hell: #e6f6ef;
  --ps-gelb: #f5b83d;
  --ps-gelb-hell: #fff4dc;
  --ps-schrift-titel: "Outfit", ui-sans-serif, system-ui, sans-serif;
  --ps-schrift: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ps-radius: 18px;
  --ps-radius-m: 12px;
  --ps-radius-s: 9px;
  --ps-schatten: 0 1px 2px rgba(14, 33, 53, .05), 0 4px 14px rgba(14, 33, 53, .06);
  --ps-schatten-hoch: 0 2px 6px rgba(14, 33, 53, .06), 0 18px 40px -12px rgba(14, 33, 53, .22);
  --ps-kopf-h: 60px;
  --ps-tabs-h: 66px;
  --ps-unten: env(safe-area-inset-bottom, 0px);
}

/* ---------- Wortmarke wie im Logo: Paper (Navy) SIM (Blau) ---------- */
.ps-wortmarke { font-family: var(--ps-schrift-titel); font-weight: 700; letter-spacing: -.01em; color: var(--ps-navy); white-space: nowrap; }
.ps-wortmarke b { color: var(--ps-blau); font-weight: 700; }

/* ---------- Icons (Sprite bilder/icons.svg) ---------- */
.ps-i { width: 22px; height: 22px; flex: none; display: inline-block; vertical-align: middle; }
.ps-i.klein { width: 18px; height: 18px; }
.ps-i.gross { width: 26px; height: 26px; }
.ps-ico { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; background: var(--ps-blau-hell); color: var(--ps-blau-stark); }
.ps-ico.navy { background: var(--ps-navy); color: #fff; }
.ps-ico.klein { width: 36px; height: 36px; border-radius: 10px; }

/* ---------- Knöpfe ---------- */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 18px; border: 0; border-radius: 12px;
  background: var(--ps-weiss); color: var(--ps-navy); box-shadow: inset 0 0 0 1.5px var(--ps-linie);
  font: 600 15.5px/1.2 var(--ps-schrift); text-decoration: none; cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: background .15s, box-shadow .15s, transform .1s;
}
.knopf:hover { box-shadow: inset 0 0 0 1.5px var(--ps-blau); }
.knopf:active { transform: scale(.98); }
.knopf.primaer { background: var(--ps-navy); color: #fff; box-shadow: 0 8px 18px -10px rgba(14, 33, 53, .7); }
.knopf.primaer:hover { background: var(--ps-navy-2); }
.knopf.blau { background: var(--ps-blau); color: var(--ps-navy); box-shadow: 0 8px 18px -10px rgba(101, 173, 239, .9); }
.knopf.leise { background: transparent; box-shadow: none; color: var(--ps-blau-stark); }
.knopf.leise:hover { background: var(--ps-blau-hell); }
.knopf.gefahr { color: var(--ps-rot); box-shadow: inset 0 0 0 1.5px #f1c4c6; }
.knopf.klein { min-height: 38px; padding: 7px 13px; font-size: 14px; border-radius: 10px; }
.knopf.rund { width: 46px; padding: 0; border-radius: 50%; }
.knopf.rund.klein { width: 38px; }
.knopf.breit { width: 100%; }
.knopf:disabled { opacity: .45; cursor: default; transform: none; }
.knopf:focus-visible, .ps-chip-wahl input:focus-visible + span, .ps-tab:focus-visible { outline: 3px solid var(--ps-blau); outline-offset: 2px; }

/* ---------- Karten und Abschnitte ---------- */
.ps-karte { background: var(--ps-weiss); border-radius: var(--ps-radius); box-shadow: var(--ps-schatten); padding: 20px; }
.ps-karte + .ps-karte { margin-top: 16px; }
.ps-karte-kopf { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.ps-karte-kopf h2 { flex: 1; margin: 0; font: 600 20px/1.2 var(--ps-schrift-titel); color: var(--ps-navy); }
.ps-karte-kopf h2 small { display: block; margin-top: 2px; font: 400 13.5px/1.3 var(--ps-schrift); color: var(--ps-grau); }
.ps-karte-kopf .ps-aktionen { display: flex; gap: 8px; flex-wrap: wrap; }
.ps-seitentitel { margin: 6px 0 18px; }
.ps-seitentitel h1 { margin: 0; font: 600 28px/1.15 var(--ps-schrift-titel); letter-spacing: -.01em; color: var(--ps-navy); }
.ps-seitentitel p { margin: 4px 0 0; color: var(--ps-grau); font-size: 15px; }
.ps-eyebrow { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 6px; color: var(--ps-blau-stark); font: 700 12px/1 var(--ps-schrift); letter-spacing: .12em; text-transform: uppercase; }
.ps-leise { color: var(--ps-grau); font-size: 14px; }
.ps-trenner { height: 1px; margin: 16px 0; background: var(--ps-linie); border: 0; }

/* ---------- Formularfelder ---------- */
.ps-felder { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px 14px; }
.ps-feld { display: flex; flex-direction: column; gap: 6px; min-width: 0; font: 600 13px/1.2 var(--ps-schrift); color: var(--ps-grau); }
.ps-feld.breit { grid-column: 1 / -1; }
.ps-feld input, .ps-feld select, .ps-feld textarea, .ps-eingabe {
  width: 100%; min-width: 0; min-height: 46px; padding: 10px 13px; box-sizing: border-box;
  border: 1.5px solid var(--ps-linie); border-radius: 12px; background: var(--ps-weiss);
  font: 400 16px/1.3 var(--ps-schrift); color: var(--ps-navy);
  -webkit-appearance: none; appearance: none;
}
.ps-feld select { padding-right: 38px; background: var(--ps-weiss) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6b80' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 18px; }
.ps-feld input:focus, .ps-feld select:focus, .ps-feld textarea:focus, .ps-eingabe:focus { outline: none; border-color: var(--ps-blau); box-shadow: 0 0 0 4px var(--ps-blau-hell); }
.ps-feld .wert { min-height: 46px; display: flex; align-items: center; font: 600 18px var(--ps-schrift); color: var(--ps-navy); }

/* Suchfeld mit Lupe */
.ps-suche { position: relative; }
.ps-suche .ps-i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ps-grau-hell); pointer-events: none; }
.ps-suche input { padding-left: 42px; }

/* ---------- Auswahl-Chips (Checkbox oder Radio, versteckt) ---------- */
.ps-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ps-chip-wahl { position: relative; display: inline-flex; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.ps-chip-wahl input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.ps-chip-wahl > span {
  display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 9px 15px;
  border-radius: 999px; background: var(--ps-weiss); box-shadow: inset 0 0 0 1.5px var(--ps-linie);
  font: 500 15px/1.2 var(--ps-schrift); color: var(--ps-text); cursor: pointer; user-select: none; transition: background .12s, box-shadow .12s;
}
.ps-chip-wahl > span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ps-linie); transition: background .12s; }
.ps-chip-wahl input:checked + span { background: var(--ps-blau-hell); box-shadow: inset 0 0 0 2px var(--ps-blau); color: var(--ps-navy); font-weight: 600; }
.ps-chip-wahl input:checked + span::before { background: var(--ps-blau-stark); }
.ps-chip-wahl input:disabled + span { opacity: .4; cursor: not-allowed; }
.ps-chip-wahl.gefiltert { display: none; }

/* gewählte Einträge als entfernbare Chips */
.ps-gewaehlt { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 42px; }
.ps-gewaehlt .leer { color: var(--ps-grau-hell); font-size: 14px; }
.ps-pille {
  display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 4px 6px 4px 13px;
  border-radius: 999px; background: var(--ps-navy); color: #fff; font: 500 14px/1.2 var(--ps-schrift);
}
.ps-pille button { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; cursor: pointer; touch-action: manipulation; }
.ps-pille button .ps-i { width: 14px; height: 14px; }
.ps-pille.hell { background: var(--ps-blau-hell); color: var(--ps-navy); }
.ps-pille.hell button { background: rgba(14, 33, 53, .08); color: var(--ps-navy); }

/* ---------- Segment-Schalter (Radio) ---------- */
.ps-segment { display: inline-flex; flex-wrap: wrap; padding: 4px; gap: 4px; border-radius: 14px; background: var(--ps-papier); box-shadow: inset 0 0 0 1px var(--ps-linie); }
.ps-segment label { position: relative; flex: 1 1 auto; display: flex; }
.ps-segment input { position: absolute; opacity: 0; pointer-events: none; }
.ps-segment span { flex: 1; display: grid; place-items: center; min-height: 40px; padding: 8px 14px; border-radius: 10px; font: 500 15px/1.2 var(--ps-schrift); color: var(--ps-grau); text-align: center; cursor: pointer; user-select: none; touch-action: manipulation; }
.ps-segment input:checked + span { background: var(--ps-weiss); color: var(--ps-navy); font-weight: 600; box-shadow: 0 1px 3px rgba(14, 33, 53, .14); }
.ps-segment input:focus-visible + span { outline: 3px solid var(--ps-blau); }
.ps-segment.voll { display: flex; }

/* ---------- Schalter (Checkbox als Toggle) ---------- */
.ps-schalter { display: flex; align-items: center; gap: 14px; min-height: 48px; cursor: pointer; font: 500 15.5px/1.35 var(--ps-schrift); color: var(--ps-navy); touch-action: manipulation; }
.ps-schalter small { display: block; font-weight: 400; font-size: 13px; color: var(--ps-grau); }
.ps-schalter input {
  flex: none; position: relative; width: 52px; height: 32px; margin: 0; border-radius: 999px;
  -webkit-appearance: none; appearance: none; background: #d5dde7; cursor: pointer; transition: background .15s;
}
.ps-schalter input::after { content: ""; position: absolute; left: 3px; top: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.ps-schalter input:checked { background: var(--ps-blau-stark); }
.ps-schalter input:checked::after { transform: translateX(20px); }
.ps-schalter input:disabled { opacity: .45; }

/* ---------- Aufklapp-Gruppen ---------- */
.ps-aufklapp { border-radius: var(--ps-radius-m); background: var(--ps-papier); }
.ps-aufklapp + .ps-aufklapp { margin-top: 8px; }
.ps-aufklapp > summary {
  display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 8px 16px;
  list-style: none; cursor: pointer; font: 600 16px/1.2 var(--ps-schrift); color: var(--ps-navy); touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.ps-aufklapp > summary::-webkit-details-marker { display: none; }
.ps-aufklapp > summary .titel { flex: 1; }
.ps-aufklapp > summary .zahl { min-width: 28px; height: 28px; padding: 0 9px; display: grid; place-items: center; border-radius: 999px; background: var(--ps-weiss); color: var(--ps-grau); font-size: 13px; box-shadow: inset 0 0 0 1px var(--ps-linie); }
.ps-aufklapp > summary .zahl.an { background: var(--ps-blau-stark); color: #fff; box-shadow: none; }
.ps-aufklapp > summary .pfeil { width: 20px; height: 20px; color: var(--ps-grau); transition: transform .2s; }
.ps-aufklapp[open] > summary .pfeil { transform: rotate(180deg); }
.ps-aufklapp > .inhalt { padding: 4px 16px 16px; }
.ps-aufklapp.weiss { background: var(--ps-weiss); box-shadow: inset 0 0 0 1.5px var(--ps-linie); }

/* ---------- Kacheln (Dokumente) ---------- */
.ps-kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.ps-kachel {
  position: relative; display: flex; flex-direction: column; gap: 12px; min-height: 150px; padding: 18px;
  border-radius: var(--ps-radius); background: var(--ps-weiss); box-shadow: var(--ps-schatten);
  color: var(--ps-text); text-decoration: none; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: transform .15s, box-shadow .15s;
}
.ps-kachel:hover { transform: translateY(-2px); box-shadow: var(--ps-schatten-hoch); }
.ps-kachel:active { transform: scale(.99); }
.ps-kachel b { font: 600 18px/1.25 var(--ps-schrift-titel); color: var(--ps-navy); }
.ps-kachel small { font-size: 13.5px; line-height: 1.4; color: var(--ps-grau); }
.ps-kachel .ps-status { position: absolute; right: 14px; top: 14px; }
.ps-kachel.gesperrt { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ps-linie); }
.ps-kachel.gesperrt .ps-ico { background: #eef2f6; color: var(--ps-grau-hell); }
.ps-kachel.gesperrt b { color: var(--ps-grau); }

/* ---------- Statusmarken ---------- */
.ps-status { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font: 600 12px/1.2 var(--ps-schrift); white-space: nowrap; }
.ps-status.ok { background: var(--ps-gruen-hell); color: #1d6b49; }
.ps-status.leer { background: var(--ps-papier); color: var(--ps-grau); }
.ps-status.zusatz { background: var(--ps-blau-hell); color: var(--ps-blau-stark); }
.ps-status.bald { background: var(--ps-gelb-hell); color: #8a5a00; }
.ps-status.warn { background: var(--ps-rot-hell); color: #8a1f23; }

/* ---------- Hinweise ---------- */
.ps-hinweis { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--ps-blau-hell); color: var(--ps-navy); font-size: 14.5px; line-height: 1.45; }
.ps-hinweis.warn { background: var(--ps-gelb-hell); color: #6b4a00; }
.ps-hinweis.ok { background: var(--ps-gruen-hell); color: #1d6b49; }
.ps-hinweis .ps-i { margin-top: 1px; }

/* =====================================================================
   App-Rahmen: Kopfleiste oben, Tab-Leiste unten
   ===================================================================== */
body.ps-app { margin: 0; background: var(--ps-papier); color: var(--ps-text); font: 16px/1.5 var(--ps-schrift); -webkit-text-size-adjust: 100%; }
body.ps-app { padding-bottom: calc(var(--ps-tabs-h) + var(--ps-unten)); }
.ps-kopf {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px;
  height: var(--ps-kopf-h); padding: 0 max(16px, env(safe-area-inset-left)) 0 max(16px, env(safe-area-inset-left));
  background: rgba(255, 255, 255, .92); -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--ps-linie);
}
.ps-kopf .ps-marke { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; font-size: 21px; }
.ps-kopf .ps-marke img { width: 30px; height: 30px; }
.ps-kopf .ps-patient {
  flex: 1; min-width: 0; display: flex; justify-content: center; align-items: center; gap: 8px;
  font: 600 15px/1.2 var(--ps-schrift); color: var(--ps-navy); white-space: nowrap; overflow: hidden;
}
.ps-kopf .ps-patient span { overflow: hidden; text-overflow: ellipsis; }
.ps-kopf .ps-patient small { font-weight: 400; color: var(--ps-grau); }
.ps-kopf .ps-patient .ps-pille { min-height: 28px; padding: 3px 11px; font-size: 12.5px; background: var(--ps-gruen); }
.ps-sim-marke { padding: 4px 9px; border-radius: 7px; background: var(--ps-rot-hell); color: #8a1f23; font: 700 11px/1 var(--ps-schrift); letter-spacing: .1em; }
@media (max-width: 700px) { .ps-kopf .ps-patient { justify-content: flex-start; } .ps-sim-marke, .ps-kopf .lang { display: none; } }
@media (max-width: 480px) { .ps-kopf .ps-patient .ps-pille, .ps-kopf .ps-patient small { display: none; } }

.ps-tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; justify-content: center; gap: 4px;
  height: calc(var(--ps-tabs-h) + var(--ps-unten)); padding: 6px 12px var(--ps-unten);
  background: rgba(255, 255, 255, .95); -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px);
  border-top: 1px solid var(--ps-linie);
}
.ps-tab {
  flex: 0 1 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border-radius: 14px; color: var(--ps-grau); text-decoration: none; font: 600 12.5px/1 var(--ps-schrift);
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.ps-tab .ps-i { width: 26px; height: 26px; padding: 3px 14px; box-sizing: content-box; border-radius: 999px; transition: background .15s; }
.ps-tab.aktiv { color: var(--ps-navy); }
.ps-tab.aktiv .ps-i { background: var(--ps-blau-mittel); color: var(--ps-navy); }

.ps-inhalt { max-width: 1080px; margin: 0 auto; padding: 18px max(16px, env(safe-area-inset-left)) 32px; }
.ps-inhalt.schmal { max-width: 860px; }

/* Kopfleiste eines Dokuments (unter der Kopfleiste der App) */
.ps-dokleiste {
  position: sticky; top: var(--ps-kopf-h); z-index: 30; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 0 0 16px; padding: 10px max(16px, env(safe-area-inset-left));
  background: rgba(245, 248, 251, .94); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ps-linie);
}
.ps-dokleiste h1 { flex: 1; min-width: 140px; margin: 0; font: 600 21px/1.2 var(--ps-schrift-titel); color: var(--ps-navy); }
.ps-dokleiste .ps-aktionen { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 700px) { .ps-dokleiste .knopf .lang { display: none; } .ps-dokleiste .knopf { padding: 10px 13px; } }

/* Unterleiste (Bottom Sheet) für Einstellungen und Auswahl */
.ps-sheet-hinter { position: fixed; inset: 0; z-index: 900; background: rgba(14, 33, 53, .4); opacity: 0; transition: opacity .2s; }
.ps-sheet-hinter.offen { opacity: 1; }
.ps-sheet {
  position: fixed; left: 50%; bottom: 0; z-index: 901; width: min(760px, 100%); max-height: 86vh; overflow: auto;
  padding: 10px 20px calc(20px + var(--ps-unten)); box-sizing: border-box;
  border-radius: 22px 22px 0 0; background: var(--ps-weiss); box-shadow: 0 -10px 40px rgba(14, 33, 53, .25);
  transform: translate(-50%, 100%); transition: transform .25s ease;
}
.ps-sheet.offen { transform: translate(-50%, 0); }
.ps-sheet::before { content: ""; display: block; width: 44px; height: 5px; margin: 0 auto 12px; border-radius: 3px; background: var(--ps-linie); }
.ps-sheet-kopf { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.ps-sheet-kopf h2 { flex: 1; margin: 0; font: 600 21px/1.2 var(--ps-schrift-titel); color: var(--ps-navy); }

/* Liste (Mehr, Fälle) */
.ps-liste { display: flex; flex-direction: column; border-radius: var(--ps-radius); background: var(--ps-weiss); box-shadow: var(--ps-schatten); overflow: hidden; }
.ps-zeile {
  display: flex; align-items: center; gap: 14px; min-height: 62px; padding: 10px 16px; width: 100%; box-sizing: border-box;
  border: 0; background: none; text-align: left; color: var(--ps-navy); text-decoration: none; font: 500 16px/1.3 var(--ps-schrift);
  cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.ps-zeile + .ps-zeile { border-top: 1px solid var(--ps-linie); }
.ps-zeile:hover { background: #fafcfe; }
.ps-zeile .text { flex: 1; min-width: 0; }
.ps-zeile .text small { display: block; margin-top: 2px; color: var(--ps-grau); font-size: 13.5px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; }
.ps-zeile .pfeil { color: var(--ps-grau-hell); }
.ps-zeile.gefahr { color: var(--ps-rot); }
.ps-zeile.aktiv { box-shadow: inset 4px 0 0 var(--ps-blau-stark); background: var(--ps-blau-hell); }

/* Fortschritts-/Belegungsbalken */
.ps-balken { height: 10px; border-radius: 6px; background: var(--ps-linie); overflow: hidden; }
.ps-balken i { display: block; height: 100%; border-radius: 6px; background: var(--ps-blau-stark); }
.ps-balken.voll i { background: var(--ps-rot); }

/* Toast */
.ps-toast { position: fixed; left: 50%; bottom: calc(var(--ps-tabs-h) + var(--ps-unten) + 14px); z-index: 2000; transform: translateX(-50%); padding: 12px 18px; border-radius: 14px; background: var(--ps-navy); color: #fff; box-shadow: var(--ps-schatten-hoch); font: 500 15px/1.3 var(--ps-schrift); }
.ps-toast.fehler { background: var(--ps-rot); }

/* Druck: nur die Dokumente */
@media print {
  .ps-kopf, .ps-tabs, .ps-dokleiste, .ps-sheet, .ps-sheet-hinter, .ps-toast { display: none !important; }
  body.ps-app { padding: 0 !important; background: #fff !important; }
}

/* =====================================================================
   Anmeldung und Einrichtung
   ===================================================================== */
body.konto-seite {
  margin: 0; min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; box-sizing: border-box;
  background: radial-gradient(900px 520px at 85% -10%, rgba(101, 173, 239, .35), transparent 60%), radial-gradient(700px 500px at -10% 110%, rgba(101, 173, 239, .18), transparent 60%), var(--ps-navy);
  font: 16px/1.55 var(--ps-schrift); color: var(--ps-text);
}
.konto-box { width: 100%; max-width: 420px; padding: 34px 30px 26px; box-sizing: border-box; border-radius: 24px; background: #fff; box-shadow: 0 30px 70px -20px rgba(0,0,0,.55); text-align: center; }
.konto-logo { display: block; width: 132px; height: auto; margin: 0 auto 10px; }
.konto-box .ps-sim-marke { display: inline-block; margin-bottom: 18px; }
.konto-box h1 { margin: 0 0 6px; font: 600 26px/1.2 var(--ps-schrift-titel); color: var(--ps-navy); }
.konto-box > p { margin: 0 0 20px; color: var(--ps-grau); font-size: 15px; }
.konto-form, .ps-form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.konto-form label, .ps-form label { display: flex; flex-direction: column; gap: 6px; font: 600 13.5px/1.2 var(--ps-schrift); color: var(--ps-navy); }
.konto-form input, .ps-form input:not([type=checkbox]), .ps-form select, .ps-form textarea {
  width: 100%; min-height: 48px; padding: 11px 14px; box-sizing: border-box; border: 1.5px solid var(--ps-linie); border-radius: 12px;
  font: 16px var(--ps-schrift); color: var(--ps-navy); background: #fff;
}
.ps-form textarea { min-height: 130px; resize: vertical; }
.konto-form input:focus, .ps-form input:focus, .ps-form select:focus, .ps-form textarea:focus { outline: none; border-color: var(--ps-blau); box-shadow: 0 0 0 4px var(--ps-blau-hell); }
.konto-form .knopf, .ps-form .knopf { margin-top: 4px; }
.konto-meldung { margin: 0 0 16px; padding: 11px 13px; border-radius: 12px; background: var(--ps-rot-hell); color: #8a1f23; font-size: 14px; text-align: left; }
.konto-meldung.ok { background: var(--ps-gruen-hell); color: #1d6b49; }
.konto-meldung.info { background: var(--ps-blau-hell); color: var(--ps-navy); }
.konto-fuss { margin: 22px 0 0; padding-top: 16px; border-top: 1px solid var(--ps-linie); font-size: 13px; color: var(--ps-grau); }
.konto-fuss a { color: var(--ps-blau-stark); }

/* ---------- Dialoge (Bestätigung, Passwort, Fehler melden) ---------- */
.ps-dialog-hinter { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: rgba(14, 33, 53, .55); }
.ps-dialog {
  width: 100%; max-width: 540px; max-height: calc(100vh - 32px); overflow: auto; box-sizing: border-box;
  padding: 28px 26px 22px; border-radius: 22px; background: #fff; box-shadow: 0 30px 60px -20px rgba(0,0,0,.45);
  font: 15.5px/1.55 var(--ps-schrift); color: var(--ps-text);
}
@media (max-width: 600px) { .ps-dialog-hinter { place-items: end center; padding: 0; } .ps-dialog { border-radius: 22px 22px 0 0; max-height: 92vh; padding-bottom: calc(22px + var(--ps-unten)); } }
.ps-dialog h2 { margin: 0 0 10px; font: 600 23px/1.25 var(--ps-schrift-titel); color: var(--ps-navy); }
.ps-dialog p { margin: 0 0 12px; }
.ps-dialog ul { margin: 0 0 16px; padding-left: 20px; }
.ps-dialog-icon { width: 48px; height: 48px; margin-bottom: 10px; }
.ps-check { display: flex; margin: 0 0 12px; flex-direction: row !important; align-items: flex-start; gap: 12px !important; padding: 14px; border-radius: 14px; background: var(--ps-blau-hell); font-weight: 400 !important; cursor: pointer; }
.ps-check input { flex: none; width: 24px !important; min-height: 0 !important; height: 24px; margin: 0; accent-color: var(--ps-navy); }
.ps-fehler { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--ps-rot-hell); color: #8a1f23; font-size: 14px; }
.ps-ok { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--ps-gruen-hell); color: #1d6b49; font-size: 14px; }
.ps-knopfreihe { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 6px; }

/* =====================================================================
   App: Tab "Fall", "Dokumente", "Fälle", "Mehr"
   ===================================================================== */
.ps-abstand { margin-top: 14px; }
.ps-zwischentitel { margin: 26px 4px 10px; font: 600 15px/1.2 var(--ps-schrift); color: var(--ps-grau); letter-spacing: .02em; }
.ps-fall { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
.ps-fall-links, .ps-fall-rechts { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ps-fall .ps-karte + .ps-karte { margin-top: 0; }
@media (min-width: 1000px) { .ps-fall { grid-template-columns: minmax(340px, 400px) 1fr; } .ps-fall-links { position: sticky; top: calc(var(--ps-kopf-h) + 16px); } }
.ps-patient-held { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.ps-avatar { flex: none; display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: linear-gradient(135deg, var(--ps-blau), var(--ps-blau-stark)); color: #fff; font: 600 21px var(--ps-schrift-titel); }
.ps-patient-name { flex: 1; min-width: 0; }
.ps-patient-name b { display: block; font: 600 22px/1.2 var(--ps-schrift-titel); color: var(--ps-navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-patient-name small { display: block; margin-top: 3px; color: var(--ps-grau); font-size: 14px; }
@media (max-width: 480px) { .ps-patient-held { flex-wrap: wrap; } .ps-patient-held .knopf { width: 100%; } }
.ps-weiter { margin-top: 4px; }
.ps-weiter .ps-i.klein { margin-left: auto; }

/* Patientenverfügung: Auswahl je Maßnahme */
.pv-auswahl { display: flex; flex-direction: column; gap: 8px; }
.pv-zeile { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--ps-linie); }
.pv-name { font: 500 15px var(--ps-schrift); color: var(--ps-navy); }
.pv-knoepfe { display: inline-flex; padding: 3px; gap: 3px; border-radius: 12px; background: var(--ps-papier); box-shadow: inset 0 0 0 1px var(--ps-linie); }
.pv-k { min-height: 38px; padding: 6px 14px; border: 0; border-radius: 9px; background: transparent; color: var(--ps-grau); font: 500 14px var(--ps-schrift); cursor: pointer; touch-action: manipulation; }
.pv-k.an.ja { background: var(--ps-gruen-hell); color: #1d6b49; font-weight: 600; box-shadow: 0 1px 3px rgba(14,33,53,.12); }
.pv-k.an.nein { background: var(--ps-rot-hell); color: #8a1f23; font-weight: 600; box-shadow: 0 1px 3px rgba(14,33,53,.12); }
.pv-vorauswahl { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.pv-auswahl .sk-hinweis { margin: 4px 0 0; color: var(--ps-grau); font-size: 13.5px; }

/* Fälle */
.ps-belegung { margin: 0 0 16px; }
.ps-belegung .zeile { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 14.5px; color: var(--ps-navy); }
.ps-liste .ps-zeile { gap: 6px; }
.ps-zeile-haupt { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0; border: 0; background: none; text-align: left; font: 500 16px/1.3 var(--ps-schrift); color: var(--ps-navy); cursor: pointer; }
.ps-zeile-haupt .text small { display: block; margin-top: 2px; color: var(--ps-grau); font-size: 13.5px; font-weight: 400; }
label.ps-zeile { cursor: pointer; }

/* Dokumente */
.ps-paket { margin-top: 22px; }
.ps-seitentitel .ps-eyebrow .ps-i { width: 16px; height: 16px; }

/* =====================================================================
   Dokumentansichten: Einstellungen in der Unterleiste "Anpassen"
   (die Module nutzen noch ihre alten Klassen .einst-grid, .sf, .schalter)
   ===================================================================== */
body.sim-dokument .sim-wrap.doc-wrap { padding-top: 0; }
.ps-sheet .doc-einst { padding: 0; box-shadow: none; background: none; }
.ps-sheet .einst-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; align-items: end; }
.ps-sheet .sf { display: flex; flex-direction: column; gap: 6px; font: 600 13px/1.2 var(--ps-schrift); color: var(--ps-grau); }
.ps-sheet .sf.breit { grid-column: 1 / -1; }
.ps-sheet .sf input, .ps-sheet .sf select {
  min-height: 46px; padding: 10px 13px; border: 1.5px solid var(--ps-linie); border-radius: 12px; background-color: #fff;
  font: 16px var(--ps-schrift); color: var(--ps-navy);
}
.ps-sheet .schalter { display: flex; align-items: center; gap: 12px; min-height: 48px; font: 500 15px/1.35 var(--ps-schrift); color: var(--ps-navy); cursor: pointer; }
.ps-sheet .schalter input, .ps-sheet .cb-zeile input {
  flex: none; position: relative; width: 52px; height: 32px; margin: 0; border-radius: 999px; -webkit-appearance: none; appearance: none; background: #d5dde7; cursor: pointer; transition: background .15s;
}
.ps-sheet .schalter input::after, .ps-sheet .cb-zeile input::after { content: ""; position: absolute; left: 3px; top: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.ps-sheet .schalter input:checked, .ps-sheet .cb-zeile input:checked { background: var(--ps-blau-stark); }
.ps-sheet .schalter input:checked::after, .ps-sheet .cb-zeile input:checked::after { transform: translateX(20px); }
.ps-sheet .cb-zeile { display: flex; align-items: center; gap: 12px; min-height: 46px; font-size: 15px; color: var(--ps-navy); }
.ps-sheet .sk-hinweis { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--ps-papier); color: var(--ps-grau); font-size: 13.5px; }
.ps-sheet .sk-hinweis.warn { background: var(--ps-gelb-hell); color: #6b4a00; }
.ps-sheet .dx-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 14px; font-size: 14px; color: var(--ps-grau); }
.ps-sheet .dx-chips .chip { padding: 5px 11px; border-radius: 999px; background: var(--ps-blau-hell); color: var(--ps-navy); }
.ps-sheet .einst-infekt { margin-top: 16px; }
.ps-sheet .btn, .ps-sheet .sk-btns .btn { min-height: 40px; padding: 8px 14px; border: 0; border-radius: 10px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--ps-linie); color: var(--ps-navy); font: 600 14px var(--ps-schrift); }
.ps-sheet .btn.primary { background: var(--ps-navy); color: #fff; box-shadow: none; }
.ps-sheet .sk-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.ps-sheet h3 { font: 600 16px var(--ps-schrift-titel); color: var(--ps-navy); }
.ps-sheet .ue-checkliste { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 4px 14px; }

/* =====================================================================
   Medikamentenplan: Leisten und Karten-Editor im Design-System
   ===================================================================== */
body.ps-app #toolbar, body.ps-app #viewbar {
  position: sticky; top: var(--ps-kopf-h); z-index: 30; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 10px max(16px, env(safe-area-inset-left)); background: rgba(245, 248, 251, .94); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ps-linie); justify-content: flex-start;
}
body.ps-app #toolbar .app-title { margin-right: auto; font: 600 21px/1.2 var(--ps-schrift-titel); color: var(--ps-navy); }
body.ps-app #toolbar .app-title small { display: none; }
body.ps-app #toolbar .btn, body.ps-app #viewbar .btn {
  min-height: 38px; padding: 7px 13px; border: 0; border-radius: 10px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--ps-linie);
  color: var(--ps-navy); font: 600 14px var(--ps-schrift); opacity: 1;
}
body.ps-app #toolbar .btn.primary, body.ps-app #viewbar .btn.primary { background: var(--ps-navy); color: #fff; box-shadow: none; }
body.ps-app #toolbar .btn.danger { color: var(--ps-rot); box-shadow: inset 0 0 0 1.5px #f1c4c6; }
body.ps-app #viewbar::before { content: "Medikamentenplan"; margin-right: auto; order: 1; font: 600 21px/1.2 var(--ps-schrift-titel); color: var(--ps-navy); }
body.ps-app #viewbar .ps-zurueck { order: 0; }
body.ps-app #viewbar .btn { order: 2; }
body.ps-app #toolbar .hint { order: 10; }
@media (pointer: coarse) { body.ps-app #toolbar .hint { display: none; } }
body.ps-app .stage { padding-top: 16px; }
body.ps-app .mobil { max-width: 720px; }
body.ps-app .m-card, body.ps-app .m-sec { border-radius: var(--ps-radius); box-shadow: var(--ps-schatten); padding: 18px; }
body.ps-app .m-card h2, body.ps-app .m-sec-title { font: 600 19px var(--ps-schrift-titel); color: var(--ps-navy); }
body.ps-app .m-field { font: 600 13px var(--ps-schrift); color: var(--ps-grau); }
body.ps-app .m-field input, body.ps-app .m-pick select { min-height: 46px; border: 1.5px solid var(--ps-linie); border-radius: 12px; font-family: var(--ps-schrift); }
body.ps-app .m-pick select { background: var(--ps-blau-hell); border-color: var(--ps-blau-mittel); color: var(--ps-navy); }
body.ps-app .m-med { border: 0; border-radius: 14px; background: var(--ps-papier); padding: 12px; }
body.ps-app .m-nr { background: var(--ps-navy); }
body.ps-app .m-dose { border: 0; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px var(--ps-linie); }
body.ps-app .m-dose button { width: 46px; height: 46px; border: 0; border-radius: 12px; background: var(--ps-blau-hell); color: var(--ps-navy); font-size: 22px; }
body.ps-app .m-dose button.half { background: #fff; box-shadow: inset 0 0 0 1.5px var(--ps-blau-mittel); color: var(--ps-blau-stark); }
body.ps-app .m-seg { border: 0; border-radius: 12px; background: var(--ps-papier); padding: 3px; gap: 3px; box-shadow: inset 0 0 0 1px var(--ps-linie); }
body.ps-app .m-seg button { border-radius: 9px; background: transparent; color: var(--ps-grau); min-height: 40px; }
body.ps-app .m-seg button.on { background: #fff; color: var(--ps-navy); font-weight: 600; box-shadow: 0 1px 3px rgba(14,33,53,.14); }
body.ps-app .m-chip { min-height: 38px; border: 0; box-shadow: inset 0 0 0 1.5px var(--ps-linie); }
body.ps-app .m-add { min-height: 54px; border: 2px dashed var(--ps-blau-mittel); border-radius: 14px; color: var(--ps-blau-stark); }
body.ps-app .m-del { border: 0; border-radius: 12px; background: var(--ps-rot-hell); color: var(--ps-rot); }
body.ps-app #busy { background: rgba(245, 248, 251, .8); }
body.ps-app .busy-box { border-radius: 16px; font-family: var(--ps-schrift); box-shadow: var(--ps-schatten-hoch); }

/* =====================================================================
   Tab "Start": Begrüßung, Uhr, aktueller Fall, Kacheln
   ===================================================================== */
.ps-held {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px; margin: 4px 0 16px; padding: 28px 28px 26px;
  border-radius: 24px; color: #fff;
  background: radial-gradient(700px 320px at 95% -30%, rgba(101, 173, 239, .5), transparent 62%), radial-gradient(500px 260px at -10% 120%, rgba(101, 173, 239, .18), transparent 60%), var(--ps-navy);
}
.ps-held .ps-eyebrow { color: var(--ps-blau); }
.ps-held .ps-eyebrow .ps-i { width: 16px; height: 16px; }
.ps-held h1 { margin: 4px 0 4px; font: 600 clamp(28px, 4vw, 38px)/1.1 var(--ps-schrift-titel); letter-spacing: -.01em; }
.ps-held p { margin: 0; color: #b9c8da; font-size: 15.5px; }
.ps-uhr { display: flex; align-items: baseline; gap: 8px; font: 600 clamp(40px, 6vw, 58px)/1 var(--ps-schrift-titel); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ps-uhr small { font: 500 18px var(--ps-schrift); color: #b9c8da; }
.ps-avatar.klein { width: 46px; height: 46px; font-size: 17px; }
.ps-aktuell { margin-bottom: 16px; }
.ps-aktuell .ps-leise { margin: -6px 0 4px; }
.ps-start-kacheln { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.ps-start-kachel { min-height: 160px; }
.ps-start-kachel.haupt { background: var(--ps-blau-hell); box-shadow: inset 0 0 0 2px var(--ps-blau-mittel); }
@media (max-width: 480px) { .ps-held { padding: 22px 20px; } .ps-uhr { font-size: 36px; } }

/* Anmeldung mit Aktivierungscode */
.code-eingabe { text-align: center; font: 600 24px/1.2 ui-monospace, "SF Mono", Menlo, monospace !important; letter-spacing: .12em; text-transform: uppercase; }
.konto-hinweis { margin: 14px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--ps-papier); color: var(--ps-grau); font-size: 13px; line-height: 1.45; text-align: left; }
.konto-team { margin: 18px 0 0; font-size: 12.5px; }
.konto-team a { color: var(--ps-grau); }

/* ---------- KI-Fallprüfung und Bildgenerator ---------- */
.ps-klein { font-size: 12.5px; }
.ps-karte.gesperrt-karte { opacity: .7; }
.ps-ki-probleme { display: flex; flex-direction: column; gap: 10px; }
.ps-ki-problem { padding: 12px 14px; border-radius: 12px; background: var(--ps-rot-hell); color: #7d1f23; box-shadow: inset 0 0 0 1.5px #f1c4c6; }
.ps-ki-problem.niedrig { background: var(--ps-gelb-hell); color: #6b4a00; box-shadow: inset 0 0 0 1.5px #f3dfa6; }
.ps-ki-problem .kopf { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ps-ki-problem .kopf b { flex: 1; font-size: 15.5px; }
.ps-ki-problem .marke { padding: 3px 9px; border-radius: 999px; background: var(--ps-rot); color: #fff; font: 600 12px/1.2 var(--ps-schrift); }
.ps-ki-problem.mittel .marke { background: #d9822b; }
.ps-ki-problem.niedrig .marke { background: #b8860b; }
.ps-ki-problem .betrifft { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ps-ki-problem .betrifft span { padding: 3px 9px; border-radius: 999px; background: rgba(255,255,255,.7); font-size: 13px; font-weight: 600; }
.ps-ki-problem p { margin: 8px 0 0; font-size: 14.5px; line-height: 1.45; }
.ps-bilder { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.ps-bild { margin: 0; overflow: hidden; border-radius: 18px; background: var(--ps-weiss); box-shadow: 0 1px 3px rgba(14, 33, 53, .08), 0 8px 24px rgba(14, 33, 53, .06); }
.ps-bild .rahmen { position: relative; background: var(--ps-papier); }
.ps-bild img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.ps-bild .sim { position: absolute; top: 10px; left: 10px; padding: 4px 10px; border-radius: 999px; background: rgba(196, 55, 60, .92); color: #fff; font: 700 11.5px/1.2 var(--ps-schrift); letter-spacing: .06em; }
.ps-bild figcaption { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; font-size: 14px; color: var(--ps-navy); }
.ps-bild figcaption span { color: var(--ps-grau); }
