:root {
  --grund: #F4F6F5;
  --flaeche: #FFFFFF;
  --tinte: #16201E;
  --leise: #4F5B58;
  --linie: #DCE2E0;
  --linie-hell: #E8ECEA;
  --rand-feld: #B9C4C1;
  --akzent: #0B6B66;
  --akzent-dunkel: #084F4B;
  --akzent-hell: #E3F1EF;
  --akzent-text: #0A5752;
  --grau-hell: #ECEFEE;
  --grau-text: #3F4A47;
  --gefahr: #A33A1F;
  --gefahr-hell: #FBE9E4;
  --gefahr-text: #8E2F17;
  --warn-hell: #FDF1E7;
  --warn-text: #6E3508;
  --fokus: #7CC4BE;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--grund);
  color: var(--tinte);
  font-family: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.4;
}
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--fokus); outline-offset: 2px; }
h1 { margin: 0; }
p { margin: 0; }

svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.gross { width: 28px; height: 28px; }

.rahmen { max-width: 520px; min-height: 100%; margin: 0 auto; position: relative; display: flex; flex-direction: column; }

.leise { color: var(--leise); }
.dunkel { color: var(--tinte); }
.klein { font-size: 14px; }
.gross { font-size: 17px; }
.mitte { text-align: center; }
.stapel-2 { display: flex; flex-direction: column; gap: 2px; }
.stapel-4 { display: flex; flex-direction: column; gap: 4px; }
.stapel-8 { display: flex; flex-direction: column; gap: 8px; }
.stapel-12 { display: flex; flex-direction: column; gap: 12px; }
.stapel-16 { display: flex; flex-direction: column; gap: 16px; }
.polster { padding: 14px 16px; }

.seite { flex: 1; display: flex; flex-direction: column; gap: 24px; padding: 16px 24px 32px; }
.seite-start { padding-top: 56px; gap: 28px; }
.seite-mitte { justify-content: center; align-items: center; }
.fuss { margin-top: auto; font-size: 15px; }

.marke { display: flex; align-items: center; gap: 12px; }
.marke-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--akzent); color: #fff; display: flex; align-items: center; justify-content: center; }
.praxisname { font-weight: 700; font-size: 17px; }
.kachel-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--akzent-hell); color: var(--akzent-text); display: flex; align-items: center; justify-content: center; }
.titel-gross { font-size: 30px; line-height: 1.15; }
.titel { font-size: 26px; line-height: 1.2; }

.feld { display: flex; flex-direction: column; gap: 8px; }
.feld label { font-weight: 700; font-size: 15px; }
.feld input { height: 52px; padding: 0 14px; font-size: 17px; border: 1.5px solid var(--rand-feld); border-radius: 12px; background: var(--flaeche); }
.feld textarea { padding: 12px 14px; font: inherit; font-size: 17px; border: 1.5px solid var(--rand-feld); border-radius: 12px; background: var(--flaeche); resize: vertical; }
.zwischentitel { margin: 0; font-size: 18px; }
.tage { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin-bottom: 6px; }
.tage label { position: relative; cursor: pointer; }
.tage input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tage span { display: flex; align-items: center; justify-content: center; min-height: 48px; border: 1.5px solid var(--rand-feld); border-radius: 12px; background: var(--flaeche); font-weight: 700; }
.tage input:checked + span { background: var(--akzent); border-color: var(--akzent); color: #fff; }
.tage input:focus-visible + span { outline: 3px solid var(--fokus); outline-offset: 2px; }
.code-eingabe { font-size: 24px !important; letter-spacing: 6px; }
.fehler { font-size: 15px; color: var(--gefahr-text); }

.knopf {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 0 16px; border: 0; border-radius: 12px;
  background: var(--akzent); color: #fff; font-size: 17px; font-weight: 700; cursor: pointer; text-decoration: none;
}
.knopf:hover { background: var(--akzent-dunkel); }
.knopf:disabled { opacity: .6; cursor: progress; }
.knopf.zweit { background: var(--flaeche); color: var(--akzent); border: 1.5px solid var(--akzent); font-size: 16px; min-height: 52px; }
.knopf.zweit:hover { background: var(--akzent-hell); }
.knopf.gefahr { background: var(--gefahr); }
.knopf.gefahr:hover { background: #82301A; }
.knopf.gefahr-rand { background: var(--flaeche); color: var(--gefahr); border: 1.5px solid var(--gefahr); font-size: 16px; min-height: 52px; }
.knopf.gefahr-rand:hover { background: var(--gefahr-hell); }
.knopf.neutral-rand { background: var(--flaeche); color: var(--tinte); border: 1.5px solid var(--rand-feld); font-size: 16px; min-height: 52px; }
.knopf.neutral-rand:hover { background: var(--grau-hell); }

.zurueck, .link-knopf { border: 0; background: transparent; color: var(--akzent); font-size: 16px; font-weight: 700; cursor: pointer; }
.zurueck { align-self: flex-start; display: flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 8px 0 0; }
.link-knopf { min-height: 44px; padding: 0; text-decoration: underline; }

.app { flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 16px 14px 20px; background: var(--flaeche); border-bottom: 1px solid var(--linie); }
.kopf-name { font-size: 22px; font-weight: 700; }
.icon-knopf { width: 44px; height: 44px; border: 1px solid var(--linie); border-radius: 12px; background: var(--flaeche); color: var(--grau-text); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.inhalt { flex: 1; padding: 16px 16px 24px; }
.ansicht { display: flex; flex-direction: column; gap: 16px; }

.reiter { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 12px; background: #E4E9E7; }
.reiter button { min-height: 44px; border: 0; border-radius: 9px; background: transparent; color: var(--leise); font-size: 16px; font-weight: 700; cursor: pointer; }
.reiter button[aria-selected="true"] { background: var(--flaeche); color: var(--tinte); }

.liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.termin { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px; text-align: left; border: 1px solid var(--linie); border-radius: 14px; background: var(--flaeche); cursor: pointer; }
.termin:hover { border-color: var(--rand-feld); }
.datum-kachel { width: 58px; flex: none; display: flex; flex-direction: column; align-items: center; padding: 8px 0; border-radius: 10px; background: var(--akzent-hell); color: var(--akzent-text); }
.datum-kachel.grau { background: var(--grau-hell); color: var(--grau-text); }
.datum-kachel .wt, .datum-kachel .monat { font-size: 13px; }
.datum-kachel .wt { font-weight: 700; }
.datum-kachel .tag { font-size: 24px; font-weight: 700; line-height: 1.1; }
.termin-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.zeile-oben { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.zeit { font-size: 17px; }

.chip { align-self: flex-start; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--grau-hell); color: var(--grau-text); }
.chip.akzent { background: var(--akzent-hell); color: var(--akzent-text); }
.chip.gefahr { background: var(--gefahr-hell); color: var(--gefahr-text); }

.hinweis-zeile { display: flex; gap: 8px; }
.hinweis-zeile svg.i { width: 20px; height: 20px; }

.karte { border: 1px solid var(--linie); border-radius: 14px; background: var(--flaeche); }
.info-liste { display: flex; flex-direction: column; }
.info-zeile { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--linie-hell); }
.info-zeile:last-child { border-bottom: 0; }
.info-zeile > div { display: flex; flex-direction: column; font-size: 17px; }

.hinweis { display: flex; gap: 10px; padding: 14px; border-radius: 12px; font-size: 15px; }
.hinweis.warnung { background: var(--warn-hell); color: var(--warn-text); }
.hinweis.neutral { background: var(--grau-hell); color: var(--grau-text); }

fieldset { margin: 0; min-width: 0; }
legend { font-size: 16px; font-weight: 700; }
.gruppe { display: flex; flex-direction: column; padding: 4px 16px; border: 1px solid var(--linie); border-radius: 14px; background: var(--flaeche); }
.gruppe legend { padding: 0 4px; }
.gruppe-flach { display: flex; flex-direction: column; padding: 0; border: 0; }
.gruppe-flach legend { padding: 0; margin-bottom: 8px; }
.auswahl { display: flex; align-items: center; gap: 12px; min-height: 52px; font-size: 17px; cursor: pointer; }
.auswahl.trenner { border-bottom: 1px solid var(--linie-hell); }
.auswahl input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--akzent); }

.nav { position: sticky; bottom: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 6px 12px max(12px, env(safe-area-inset-bottom)); background: var(--flaeche); border-top: 1px solid var(--linie); }
.nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; border: 0; background: transparent; color: var(--leise); font-size: 14px; font-weight: 700; cursor: pointer; }
.nav button[aria-current="page"] { color: var(--akzent); }
.nav svg.i { width: 24px; height: 24px; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 96px; width: calc(100% - 32px); max-width: 488px; padding: 14px 16px; border-radius: 12px; background: var(--tinte); color: #fff; font-size: 15px; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); z-index: 10; }
