/* Arzttermine – gross, klar, wenig Text */
:root {
  --text: #1c1c1a;
  --grau: #5a5a55;
  --linie: #d6d4cc;
  --grund: #f4f3ef;
  --weiss: #fff;
  --blau: #1d4f7c;
  --gruen: #2f6b12;
  --rot: #a3262a;
  --uli: #1f6fb5;    --uli-hell: #e3effa;    --uli-dunkel: #0c447c;
  --barbara: #b3346b; --barbara-hell: #fbe6ef; --barbara-dunkel: #72243e;
  --beide: #5b4bb7;  --beide-hell: #ecebfb;  --beide-dunkel: #3c3489;
  --radius: 14px;
  font-size: 19px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--grund); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.4;
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
}
main { max-width: 760px; margin: 0 auto; padding: calc(14px + env(safe-area-inset-top)) 16px 24px; }
h1 { font-size: 1.6rem; margin: 6px 0 14px; }
h2 { font-size: 1.15rem; margin: 22px 0 10px; color: var(--grau); font-weight: 600; }
p { margin: 0 0 12px; }
a { color: var(--blau); }
.laden { color: var(--grau); text-align: center; margin-top: 40px; }
.klein { font-size: .85rem; color: var(--grau); }

/* Menüleiste unten (Handy) bzw. oben (PC) */
.leiste {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--weiss); border-top: 1px solid var(--linie);
  padding-bottom: env(safe-area-inset-bottom);
}
.leiste a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 72px; text-decoration: none; color: var(--grau); font-size: .85rem; font-weight: 600;
}
.leiste .sym { font-size: 1.5rem; line-height: 1; }
.leiste a.aktiv { color: var(--blau); background: #e8eff6; }
@media (min-width: 900px) {
  body { padding-bottom: 0; padding-top: 70px; }
  .leiste { top: 0; bottom: auto; border-top: 0; border-bottom: 1px solid var(--linie); grid-template-columns: repeat(4, 180px); justify-content: center; }
  .leiste a { flex-direction: row; gap: 10px; min-height: 64px; font-size: 1rem; }
  main { padding-top: 20px; }
}

/* Knöpfe */
button, .knopf {
  font: inherit; font-weight: 600; color: var(--text);
  min-height: 56px; padding: 10px 18px; border-radius: var(--radius);
  border: 2px solid var(--linie); background: var(--weiss); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
button:active, .knopf:active { transform: scale(.98); }
.haupt { background: var(--gruen); border-color: var(--gruen); color: #fff; width: 100%; min-height: 64px; font-size: 1.15rem; }
.gefahr { color: var(--rot); border-color: #e7b9ba; }
.breit { width: 100%; }
.reihe { display: flex; gap: 10px; flex-wrap: wrap; }
.reihe > * { flex: 1 1 0; }

/* Eingabefelder */
label.feld { display: block; margin-bottom: 14px; }
label.feld > span { display: block; font-weight: 600; margin-bottom: 6px; }
input, textarea, select {
  font: inherit; width: 100%; min-height: 56px; padding: 10px 14px;
  border: 2px solid var(--linie); border-radius: var(--radius); background: var(--weiss); color: var(--text);
}
input[type=date], input[type=time] { -webkit-appearance: none; appearance: none; text-align: left; }
textarea { min-height: 80px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--blau); }

/* Auswahl-Kacheln */
.kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.kacheln.drei { grid-template-columns: repeat(3, 1fr); }
.kachel {
  min-height: 64px; padding: 10px 12px; text-align: left; display: block;
  border: 2px solid var(--linie); border-radius: var(--radius); background: var(--weiss);
}
.kachel b { display: block; font-size: 1.05rem; }
.kachel small { display: block; font-weight: 400; color: var(--grau); font-size: .85rem; margin-top: 2px; }
.kachel.gewaehlt { border-color: var(--blau); background: #e8eff6; box-shadow: inset 0 0 0 2px var(--blau); }
.kachel.p-uli { text-align: center; color: var(--uli-dunkel); }
.kachel.p-barbara { text-align: center; color: var(--barbara-dunkel); }
.kachel.p-beide { text-align: center; color: var(--beide-dunkel); }
.kachel.p-uli.gewaehlt { background: var(--uli-hell); border-color: var(--uli); box-shadow: inset 0 0 0 2px var(--uli); }
.kachel.p-barbara.gewaehlt { background: var(--barbara-hell); border-color: var(--barbara); box-shadow: inset 0 0 0 2px var(--barbara); }
.kachel.p-beide.gewaehlt { background: var(--beide-hell); border-color: var(--beide); box-shadow: inset 0 0 0 2px var(--beide); }

/* Filter oben */
.filter { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.filter button { min-height: 48px; font-size: .95rem; }
.filter button.an { background: var(--blau); border-color: var(--blau); color: #fff; }

/* Terminkarten */
.monat { font-size: 1.1rem; margin: 22px 0 8px; color: var(--grau); }
.termin {
  display: block; width: 100%; text-align: left; font-weight: 400; color: var(--text);
  background: var(--weiss); border: 1px solid var(--linie); border-left: 8px solid var(--linie);
  border-radius: 6px var(--radius) var(--radius) 6px; padding: 12px 14px; margin-bottom: 10px; min-height: 0;
}
.termin.p-uli { border-left-color: var(--uli); }
.termin.p-barbara { border-left-color: var(--barbara); }
.termin.p-beide { border-left-color: var(--beide); }
.termin .wann { font-size: 1.2rem; font-weight: 700; }
.termin .zeit { font-size: 1.2rem; font-weight: 700; }
.termin .arzt { font-size: 1.05rem; margin-top: 2px; }
.termin .ort { color: var(--grau); font-size: .95rem; }
.termin .zeile { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.termin.vorbei { opacity: .6; }
.termin .notiz { font-size: .9rem; color: var(--grau); margin-top: 4px; font-style: italic; }
.wer { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .85rem; font-weight: 700; }
.wer.p-uli { background: var(--uli-hell); color: var(--uli-dunkel); }
.wer.p-barbara { background: var(--barbara-hell); color: var(--barbara-dunkel); }
.wer.p-beide { background: var(--beide-hell); color: var(--beide-dunkel); }
.bald { display: inline-block; background: #fff2cc; color: #6b4a00; border-radius: 999px; padding: 1px 10px; font-size: .85rem; font-weight: 700; margin-left: 6px; vertical-align: 2px; }
.bald.heute { background: #a3262a; color: #fff; }

.leer { background: var(--weiss); border: 1px dashed var(--linie); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--grau); }

/* Formular-Abschnitte */
.schritt { background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; }
.schritt > h2 { margin: 0 0 10px; color: var(--text); }
.schritt > h2 .nr { display: inline-flex; width: 30px; height: 30px; border-radius: 50%; background: var(--blau); color: #fff; align-items: center; justify-content: center; font-size: .9rem; margin-right: 8px; vertical-align: 2px; }
.datumzeile { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 8px; margin-bottom: 8px; align-items: center; }
.datumzeile .weg { min-height: 56px; width: 56px; padding: 0; font-size: 1.3rem; }
.datumzeile .tag { grid-column: 1 / -1; font-size: .9rem; color: var(--grau); margin: -4px 0 4px 4px; }
.fehler { color: var(--rot); font-weight: 600; margin: 8px 0 0; }
.hinweis { background: #fff6d6; border: 1px solid #e8d48a; border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; }
.hinweis img { max-width: 100%; max-height: 220px; border-radius: 8px; display: block; margin-top: 10px; }
.foto-knopf { width: 100%; min-height: 72px; font-size: 1.15rem; border-color: var(--blau); color: var(--blau); margin-bottom: 6px; }
.oder { text-align: center; color: var(--grau); margin: 8px 0 14px; }

/* Ärzteliste */
.arztzeile { display: block; width: 100%; text-align: left; font-weight: 400; background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px; min-height: 0; color: var(--text); }
.arztzeile b { font-size: 1.05rem; }

/* Warten beim Lesen */
.warten { position: fixed; inset: 0; background: rgba(20,20,20,.55); z-index: 50; display: flex; align-items: center; justify-content: center; }
.warten div { background: var(--weiss); border-radius: var(--radius); padding: 24px 28px; font-size: 1.15rem; font-weight: 600; text-align: center; max-width: 320px; }
.warten .rad { width: 44px; height: 44px; border: 5px solid #dde6ef; border-top-color: var(--blau); border-radius: 50%; margin: 0 auto 14px; animation: drehen 1s linear infinite; }
@keyframes drehen { to { transform: rotate(360deg); } }

.meldung { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(96px + env(safe-area-inset-bottom)); background: #1c1c1a; color: #fff; padding: 14px 22px; border-radius: 999px; font-weight: 600; z-index: 60; max-width: 90vw; text-align: center; }
@media (min-width: 900px) { .meldung { bottom: 30px; } }

/* Anmelden */
.anmelden { max-width: 420px; margin: 40px auto; text-align: center; }
.anmelden .logo { font-size: 3rem; }
.anmelden input { text-align: center; font-size: 1.6rem; letter-spacing: .3em; margin: 10px 0 14px; }

/* Druckblatt: Vorschau am Bildschirm */
.blatt { background: #fff; color: #000; border: 1px solid var(--linie); border-radius: 6px; padding: 22px 24px; margin-top: 16px; }
.blatt h1 { font-size: 1.5rem; margin: 0; }
.blatt .stand { font-size: .85rem; color: #444; margin: 2px 0 12px; }
.blatt h3 { font-size: 1.15rem; margin: 18px 0 4px; border-bottom: 2px solid #000; padding-bottom: 2px; }
.blatt table { width: 100%; border-collapse: collapse; font-size: .95rem; table-layout: fixed; }
.blatt td { padding: 7px 6px; border-bottom: 1px solid #999; vertical-align: top; overflow-wrap: anywhere; }
.blatt td.ab { width: 6%; }
.blatt .kaestchen { display: inline-block; width: 18px; height: 18px; border: 2px solid #000; border-radius: 3px; margin-top: 2px; }
.blatt td.tag { width: 16%; font-weight: 700; white-space: nowrap; }
.blatt td.uhr { width: 11%; font-weight: 700; }
.blatt td.person { width: 20%; font-weight: 700; }
.blatt td .fein { font-size: .8rem; color: #333; }
.blatt .leerblatt { padding: 20px 0; color: #444; }
.blatt .fuss { margin-top: 14px; font-size: .75rem; color: #555; }

@media print {
  @page { size: A4; margin: 14mm 14mm 16mm; }
  :root { font-size: 12pt; }
  body { background: #fff; padding: 0 !important; }
  .leiste, .nicht-drucken, .meldung { display: none !important; }
  main { max-width: none; padding: 0; margin: 0; }
  .blatt { border: 0; padding: 0; margin: 0; }
  .blatt h1 { font-size: 20pt; }
  .blatt table { font-size: 12.5pt; }
  .blatt tr { break-inside: avoid; }
  .blatt h3 { break-after: avoid; }
}
