/* Pflegegrad-Selbsttest: ruhig, gut lesbar, zuerst fürs Handy. Nur Systemschriften. */
:root {
  --text: #1a1f24;
  --text-leise: #3d4650;
  --grund: #fbfaf7;
  --flaeche: #ffffff;
  --linie: #8a939c;
  --linie-leise: #d5d9dd;
  --akzent: #0b5a6e;
  --akzent-dunkel: #073f4e;
  --akzent-hell: #e3f0f3;
  --hinweis: #fff4d6;
  --hinweis-rand: #8a6100;
  --fehler: #a4161a;
  --fehler-hell: #fdecec;
  --fokus: #c75000;
  --radius: 10px;
  font-size: 112.5%; /* 18 px */
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
}
.rahmen { max-width: 44rem; margin: 0 auto; padding: 0 16px; }
@media (min-width: 60rem) { .rahmen { padding: 0 24px; } }
main { padding-bottom: 2rem; }
main:focus { outline: none; }

h1, h2, h3 { line-height: 1.25; margin: 1.4em 0 0.5em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }
h1:focus, h2:focus { outline: none; }
p { margin: 0.6em 0; }
a { color: var(--akzent-dunkel); text-decoration-thickness: 2px; text-underline-offset: 3px; }

:focus-visible { outline: 3px solid var(--fokus); outline-offset: 3px; }

.skiplink { position: absolute; left: -9999px; top: 0; background: var(--flaeche); padding: 12px; z-index: 10; }
.skiplink:focus { left: 8px; top: 8px; }

.kopf { background: var(--akzent-dunkel); color: #fff; }
.kopf .marke { margin: 0; padding: 14px 0; font-weight: 700; font-size: 1.1rem; }

.fuss { border-top: 1px solid var(--linie-leise); color: var(--text-leise); font-size: 1rem; padding: 1rem 0 2rem; }

/* Kästen */
.hinweis, .kasten {
  background: var(--flaeche);
  border: 1px solid var(--linie-leise);
  border-left: 6px solid var(--akzent);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 1rem 0;
}
.hinweis.gelb { background: var(--hinweis); border-left-color: var(--hinweis-rand); }
.hinweis > strong:first-child { display: block; }
.warteliste > h2:first-child { margin-top: 0.3em; }
/* Mindestens 18 px: leise/klein ändern nur Farbe und Abstand, nicht die Größe. */
.leise { color: var(--text-leise); }
.klein { margin-top: 0.3em; }

ul.punkte { padding-left: 1.2em; }
ul.punkte li { margin: 0.3em 0; }

/* Buttons */
.knopf {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 10px 22px;
  font: inherit; font-weight: 600;
  border-radius: var(--radius); border: 2px solid var(--akzent-dunkel);
  background: var(--akzent-dunkel); color: #fff; cursor: pointer;
  text-decoration: none; text-align: center; line-height: 1.3;
}
.knopf:hover { background: var(--akzent); }
.knopf.zweit { background: var(--flaeche); color: var(--akzent-dunkel); }
.knopf.zweit:hover { background: var(--akzent-hell); }
.knopfleiste { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.5rem 0; }
.knopfleiste .knopf { flex: 1 1 12rem; }

/* Fortschritt */
.fortschritt { margin-top: 1.2rem; }
.fortschritt p { margin: 0 0 6px; font-weight: 600; color: var(--text-leise); }
.fortschritt p.restzeit { margin: 6px 0 0; font-weight: 400; }
progress { width: 100%; height: 14px; accent-color: var(--akzent); }

/* Fragen */
fieldset.frage {
  border: 1px solid var(--linie-leise); border-radius: var(--radius);
  background: var(--flaeche); margin: 1.2rem 0; padding: 14px 16px 16px;
  min-width: 0;
}
fieldset.frage.fehlt { border: 2px solid var(--fehler); background: var(--fehler-hell); }
fieldset.frage legend { font-weight: 700; font-size: 1.05rem; padding: 0 4px; float: left; width: 100%; margin-bottom: 4px; }
fieldset.frage legend + * { clear: both; }
.knr { color: var(--text-leise); font-weight: 600; margin-right: 0.3em; }
.erl { margin: 0.3em 0; }
.bsp { margin: 0.3em 0 0.8em; color: var(--text-leise); font-style: italic; }
.fehlertext { color: var(--fehler); font-weight: 700; margin: 0.4em 0 0; }
.fehlertext::before { content: "⚠ "; }

.optionen { display: grid; gap: 8px; }
.option {
  display: flex; align-items: center; gap: 12px;
  min-height: 52px; padding: 10px 14px;
  border: 2px solid var(--linie); border-radius: var(--radius);
  background: var(--flaeche); cursor: pointer;
}
.option:hover { border-color: var(--akzent); }
.option input { width: 26px; height: 26px; margin: 0; flex: none; accent-color: var(--akzent-dunkel); }
.option:has(input:checked) { border-color: var(--akzent-dunkel); background: var(--akzent-hell); font-weight: 600; }
.option:has(input:focus-visible) { outline: 3px solid var(--fokus); outline-offset: 2px; }
.optionen.zwei { grid-template-columns: 1fr 1fr; }

details.skala { margin: 1rem 0; background: var(--flaeche); border: 1px solid var(--linie-leise); border-radius: var(--radius); padding: 10px 16px; }
details.skala summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
details.skala dl { margin: 0.5rem 0; }
details.skala dt { font-weight: 700; margin-top: 0.6em; }
details.skala dd { margin: 0.1em 0 0; }

/* Modul 5: Häufigkeiten */
.haeufigkeit { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--linie-leise); }
.haeufigkeit > p { margin-top: 0; font-weight: 600; }
.zaehler { display: grid; gap: 10px; }
.zaehler-zeile { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.zaehler-zeile label { min-width: 7.5em; }
.stepper { display: inline-flex; align-items: stretch; }
.stepper button {
  width: 52px; height: 52px; font: inherit; font-size: 1.4rem; font-weight: 700;
  border: 2px solid var(--linie); background: var(--flaeche); color: var(--akzent-dunkel); cursor: pointer;
}
.stepper button:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.stepper button:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.stepper input {
  width: 4em; height: 52px; text-align: center; font: inherit; font-weight: 700;
  border: 2px solid var(--linie); border-left: 0; border-right: 0; background: #fff; color: var(--text);
  -moz-appearance: textfield; appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.checkzeile { display: flex; align-items: center; gap: 12px; min-height: 52px; cursor: pointer; }
.checkzeile input { width: 26px; height: 26px; flex: none; margin: 0; accent-color: var(--akzent-dunkel); }
.gruppensumme { font-weight: 600; color: var(--akzent-dunkel); }

/* Fehlerübersicht */
.fehlerliste { border: 2px solid var(--fehler); background: var(--fehler-hell); border-radius: var(--radius); padding: 12px 16px; margin: 1rem 0; }
.fehlerliste:focus { outline: 3px solid var(--fokus); }
.fehlerliste h2 { margin-top: 0; font-size: 1.1rem; color: var(--fehler); }

/* Ergebnis */
.ergebnis-karten { display: grid; gap: 14px; margin: 1rem 0; }
@media (min-width: 40rem) { .ergebnis-karten { grid-template-columns: 1fr 1fr; } }
.karte { background: var(--flaeche); border: 2px solid var(--akzent-dunkel); border-radius: var(--radius); padding: 16px; }
.karte.geplant { border-style: dashed; }
.karte h3 { margin: 0 0 4px; }
.karte .stand { margin: 0 0 10px; color: var(--text-leise); }
.karte .grad { font-size: 1.7rem; font-weight: 800; margin: 0.2em 0; color: var(--akzent-dunkel); }
.karte .grad-zusatz { display: block; font-size: 1rem; font-weight: 600; color: var(--text, inherit); }
.karte .punkte { font-size: 1.1rem; font-weight: 600; margin: 0; }
.karte .grund { border-left: 4px solid var(--hinweis-rand); padding-left: 10px; }
.rueckfrage { margin-top: 0.5rem; }
.etikett { display: inline-block; font-size: 1rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; border: 2px solid currentColor; }

.tabelle-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: var(--flaeche); }
caption { text-align: left; font-weight: 700; padding: 8px 0; }
th, td { border: 1px solid var(--linie-leise); padding: 8px 10px; text-align: left; vertical-align: top; }
td.zahl, th.zahl { text-align: right; white-space: nowrap; }
thead th.zahl { white-space: normal; hyphens: manual; }
@media (max-width: 30rem) { th, td { padding: 6px 6px; } }
tr.summe td, tr.summe th { font-weight: 800; border-top: 2px solid var(--text); }
.nicht-gezaehlt { color: var(--text-leise); }

/* Angaben-Liste */
.angaben h3 { margin-top: 1.2em; }
.angaben ul { list-style: none; padding: 0; margin: 0; }
.angaben li { padding: 6px 0; border-bottom: 1px solid var(--linie-leise); }
.angaben .wert { font-weight: 600; }

/* Formular */
.feld { margin: 1rem 0; }
.feld label, .feld .label { display: block; font-weight: 600; margin-bottom: 4px; }
input[type="email"], .summenfeld input, .kontakt-form input[type="text"], .kontakt-form textarea {
  width: 100%; min-height: 52px; padding: 10px 12px; font: inherit;
  border: 2px solid var(--linie); border-radius: var(--radius); background: #fff; color: var(--text);
}
/* Kontaktformular */
.kontakt-form textarea { min-height: 10rem; resize: vertical; line-height: 1.45; }
.kontakt-form [aria-invalid="true"] { border-color: var(--fehler); background: var(--fehler-hell); }
.kontakt-form .knopf:disabled { opacity: 0.6; cursor: progress; }
/* Honeypot: für Menschen unsichtbar, für Screenreader per aria-hidden ausgeblendet */
.honig { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.platzhalter { background: var(--hinweis); border: 2px dashed var(--hinweis-rand); padding: 2px 6px; }
.status { font-weight: 700; }

/* Startseite */
.start-titel { font-size: 1.85rem; margin-top: 0.9em; }
.start-satz { font-size: 1.1rem; }
ul.nutzen { list-style: none; padding: 0; margin: 0.8rem 0; display: grid; gap: 6px; }
ul.nutzen li { padding-left: 1.6em; position: relative; line-height: 1.45; }
ul.nutzen li::before { content: "✓"; position: absolute; left: 0.2em; font-weight: 800; color: var(--akzent-dunkel); }
ul.nutzen strong { color: var(--akzent-dunkel); }
.einstiege { display: grid; gap: 14px; margin: 1.1rem 0 1.4rem; }
@media (min-width: 40rem) { .einstiege { grid-template-columns: 1fr 1fr; } }
.einstieg { display: flex; flex-direction: column; }
.einstieg .knopf { width: 100%; min-height: 64px; flex: 1 0 auto; }
.einstieg p { margin: 6px 2px 0; }
.vertrauen { border-top: 1px solid var(--linie-leise); margin-top: 1.6rem; }
.vertrauen h2 { font-size: 1.1rem; margin-top: 1rem; }
.vertrauen ul { padding-left: 1.1em; margin: 0.4rem 0; }
.vertrauen li { margin: 0.35em 0; color: var(--text-leise); }
.vertrauen li strong { color: var(--text); }

/* Schnellrechner */
.summenfeld { padding: 10px 0; border-bottom: 1px solid var(--linie-leise); margin: 0; }
.summenfeld label { margin-bottom: 0; }
.summenfeld .modulname { font-weight: 600; }
.summenfeld .feldhilfe { margin: 2px 0 8px; }
.summenfeld input { width: 7em; font-size: 1.2rem; font-weight: 700; }
.summenfeld.fehlt input { border-color: var(--fehler); background: var(--fehler-hell); }
.schnell-form fieldset.frage { margin-top: 1.4rem; }
.klein-knopf { min-height: 48px; padding: 8px 16px; margin-top: 6px; }
.schnell-ergebnis { border-top: 3px solid var(--akzent-dunkel); margin-top: 2rem; }
.schnell-ergebnis > h2 { font-size: 1.5rem; }

/* Teilen */
.teilen { margin: 1.5rem 0; }
.teilen .knopf { width: 100%; }
@media (min-width: 40rem) { .teilen .knopf { width: auto; } }
.etikett-zeile { margin-top: -0.2em; }

.nur-druck { display: none; }

@page { margin: 15mm 14mm; }
@media print {
  :root { font-size: 11pt; }
  body { background: #fff; color: #000; }
  .kopf, .fuss, .knopfleiste, .skiplink, .nicht-drucken, .warteliste, .teilen, #fehlerbox { display: none !important; }
  .nur-druck { display: block !important; }
  .druckkopf { border-bottom: 1px solid #000; padding-bottom: 6px; margin-bottom: 8px; }
  .druckkopf p { margin: 2px 0; }
  .angaben[hidden] { display: block !important; }
  .karte, fieldset, table, .hinweis, tr { break-inside: avoid; }
  h1, h2, h3 { break-after: avoid; }
  h1 { margin-top: 0.4em; }
  .schnell-ergebnis { border-top: 0; margin-top: 0; }
  .ergebnis-karten { grid-template-columns: 1fr 1fr; }
  .hinweis, .kasten, .karte { border-color: #555; }
  a { color: inherit; text-decoration: none; }
  .rahmen { max-width: none; padding: 0; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
.anm { display: block; white-space: normal; }
tbody th[scope="row"] { hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }
@media (max-width: 30rem) { th, td { padding: 6px 5px; } }
