/* NFC-Notfallkarte – Gestaltung: groß, kontrastreich, Handy zuerst. Keine externen Schriften. */
:root {
  --rot: #c4161c;
  --rot-dunkel: #8f0f14;
  --rot-hell: #fdecec;
  --text: #111;
  --grau: #4a4a4a;
  --linie: #8a8a8a;
  --hell: #f4f4f4;
  --gruen: #0b6b2b;
  --gruen-hell: #e6f4ea;
  --gelb-hell: #fff6d6;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: #fff; color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 20px; line-height: 1.5;
}
main { max-width: 760px; margin: 0 auto; padding: 0 16px 24px; }
a { color: var(--rot-dunkel); text-underline-offset: 3px; }
h1 { font-size: 1.6rem; line-height: 1.25; margin: 20px 0 12px; }
h2 { font-size: 1.3rem; margin: 28px 0 10px; }
p { margin: 0 0 12px; }
:focus-visible { outline: 4px solid #1a4fd6; outline-offset: 3px; }
[hidden] { display: none !important; }

.sprung { position: absolute; left: -9999px; top: 0; background: #fff; padding: 12px; z-index: 9; }
.sprung:focus { left: 8px; }

/* Kopf */
.kopf { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 6px solid var(--rot); max-width: 760px; margin: 0 auto; }
.kopf .herz { width: 52px; height: 48px; flex: none; fill: var(--rot); }
.kopf-titel { font-size: 1.5rem; font-weight: 800; color: var(--rot); margin: 0; letter-spacing: .02em; }
.kopf-unter { margin: 0; color: var(--grau); font-size: 1rem; }

/* Fortschritt */
.schritte { list-style: none; display: flex; gap: 6px; padding: 0; margin: 16px 0 0; font-size: 1rem; }
.schritte li { flex: 1; text-align: center; padding: 8px 4px; border-radius: 8px; background: var(--hell); color: var(--grau); border: 2px solid transparent; }
.schritte li.aktiv { background: var(--rot); color: #fff; font-weight: 700; }
.schritte li.erledigt { background: var(--gruen-hell); color: var(--gruen); border-color: var(--gruen); }

/* Kästen */
.kasten { border: 2px solid var(--linie); border-radius: 12px; padding: 16px; margin: 16px 0; background: #fff; }
.kasten-ruhig { background: var(--hell); border-color: var(--hell); }
.kasten.warnung { background: var(--gelb-hell); border-color: #b58900; }
.kasten > summary, .mehr > summary { cursor: pointer; font-weight: 700; padding: 6px 0; min-height: 44px; }
.hinweis-gross { font-size: 1.1rem; }
.liste { padding-left: 1.2em; margin: 0; }
.liste li { margin-bottom: 8px; }

/* Formular */
form { display: flex; flex-wrap: wrap; gap: 0 16px; }
.feld { width: 100%; margin: 0 0 20px; border: 0; padding: 0; min-width: 0; }
.feld-halb { width: calc(50% - 8px); }
@media (max-width: 420px) { .feld-halb { width: 100%; } }
label, legend { display: block; font-weight: 700; margin-bottom: 6px; }
fieldset.kontakt { border: 2px solid var(--linie); border-radius: 12px; padding: 12px 14px 4px; }
fieldset.kontakt legend { padding: 0 6px; }
fieldset.kontakt label { font-weight: 600; }
fieldset.kontakt input { margin-bottom: 12px; }
input[type=text], input[type=tel], select, textarea {
  width: 100%; font: inherit; font-size: 1.1rem; color: var(--text); background: #fff;
  border: 2px solid #555; border-radius: 10px; padding: 12px; min-height: 56px;
}
textarea { resize: vertical; line-height: 1.4; }
input:focus, select:focus, textarea:focus { border-color: #1a4fd6; }
.hilfe { color: var(--grau); font-size: 1rem; margin: 6px 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chips button {
  font: inherit; font-size: 1rem; padding: 8px 14px; min-height: 44px; border-radius: 22px;
  border: 2px solid var(--rot); background: #fff; color: var(--rot-dunkel); cursor: pointer;
}
.chips button::before { content: "+ "; font-weight: 700; }
.chips button:active { background: var(--rot-hell); }
.wahl { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; margin: 10px 0; }
.wahl input { width: 28px; height: 28px; flex: none; margin: 2px 0 0; accent-color: var(--rot); }
.mehr { border: 2px dashed var(--linie); border-radius: 12px; padding: 8px 14px; }
.mehr fieldset { border: 0; padding: 0; margin: 8px 0; }
body.chip-klein .nur-gross { display: none; }

/* Speicheranzeige */
.speicher { margin: 8px 0 4px; }
.balken { height: 18px; border-radius: 9px; background: var(--hell); border: 2px solid var(--linie); overflow: hidden; }
.balken-voll { height: 100%; width: 0; background: var(--gruen); transition: width .2s; }
.speicher.knapp .balken-voll { background: #b58900; }
.speicher.voll .balken-voll { background: var(--rot); }
.speicher p { margin: 6px 0 0; font-size: 1rem; }
.speicher.voll p { color: var(--rot-dunkel); font-weight: 700; }

/* Knöpfe */
.knopf {
  display: block; width: 100%; text-align: center; text-decoration: none; cursor: pointer;
  font: inherit; font-size: 1.2rem; font-weight: 700; line-height: 1.3;
  padding: 16px 18px; min-height: 64px; border-radius: 14px; margin: 16px 0 8px;
  border: 3px solid var(--rot); background: #fff; color: var(--rot-dunkel);
}
.knopf-haupt { background: var(--rot); color: #fff; }
.knopf-haupt:hover { background: var(--rot-dunkel); border-color: var(--rot-dunkel); }
.knopf:disabled { opacity: .55; cursor: wait; }
.knopfreihe { display: flex; gap: 12px; flex-wrap: wrap; }
.knopfreihe .knopf { flex: 1 1 220px; }

/* Status */
.status { min-height: 1.5em; font-weight: 600; }
.status-gross { font-size: 1.15rem; }
.status-ok { color: var(--gruen); background: var(--gruen-hell); padding: 12px; border-radius: 10px; }
.status-fehler { color: var(--rot-dunkel); background: var(--rot-hell); padding: 12px; border-radius: 10px; }
.status-warten { color: #333; background: var(--gelb-hell); padding: 12px; border-radius: 10px; }

/* Anleitung */
.anleitung { padding-left: 1.4em; }
.anleitung li { margin-bottom: 10px; padding-left: 4px; }
.anleitung-gross li { font-size: 1.1rem; }
.link {
  width: 100%; font-family: ui-monospace, "DejaVu Sans Mono", monospace; font-size: .95rem;
  word-break: break-all; border: 2px solid #555; border-radius: 10px; padding: 10px; background: var(--hell); min-height: 0;
}
.bild { margin: 12px 0; text-align: center; }
.bild svg { width: 100%; max-width: 360px; height: auto; }
.bild figcaption { font-size: 1.05rem; }
.g-handy { fill: #2b2b2b; }
.g-schirm { fill: #dfe7f1; }
.g-karte { fill: #fff; stroke: var(--rot); stroke-width: 5; }
.g-herz { fill: var(--rot); }
.g-text { font: 700 12px system-ui, Arial, sans-serif; fill: var(--rot); }
.g-wellen { fill: none; stroke: var(--rot); stroke-width: 5; stroke-linecap: round; }

/* Vorschau */
.vorschau-rahmen { border: 3px solid var(--rot); border-radius: 14px; overflow: hidden; margin-bottom: 8px; }
.vorschau-rahmen .nf-hinweis, .vorschau-rahmen .nf-daten { margin-left: 12px; margin-right: 12px; }

/* ===== Notfallanzeige (/k und Vorschau) ===== */
.nf-balken { display: flex; align-items: center; justify-content: center; gap: 12px; background: var(--rot); color: #fff; padding: 14px 16px; }
.nf-balken h1, .nf-balken p { margin: 0; font-size: 2rem; font-weight: 900; letter-spacing: .06em; }
.nf-balken .herz { width: 40px; height: 36px; fill: #fff; flex: none; }
.nf-balken-klein p { font-size: 1.4rem; }
.nf-hinweis { background: var(--gelb-hell); border-left: 6px solid #b58900; padding: 10px 12px; margin: 14px 0; font-size: 1.05rem; }
.nf-daten { margin: 8px 0 16px; }
.nf-kopf { border-bottom: 3px solid var(--text); margin-bottom: 12px; }
.nf-name { font-size: 1.9rem; font-weight: 800; line-height: 1.2; margin: 4px 0; overflow-wrap: anywhere; }
.nf-jahr { font-size: 1.2rem; margin: 0 0 8px; }
.nf-feld { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--hell); }
.nf-wichtig { background: var(--rot-hell); border-left: 8px solid var(--rot); }
.nf-titel { font-size: 1rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--grau); margin: 0 0 4px; }
.nf-wichtig .nf-titel { color: var(--rot-dunkel); }
.nf-wert { font-size: 1.45rem; font-weight: 700; margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.nf-kontakte { background: var(--gruen-hell); border-left: 8px solid var(--gruen); }
.nf-kontakt { margin-bottom: 10px; }
.nf-leer { color: var(--grau); font-style: italic; }
.nf-fehler { background: var(--rot-hell); color: var(--rot-dunkel); padding: 14px; border-radius: 10px; font-weight: 700; }
.nf-klein { font-size: 1rem; color: var(--grau); }
.knopf-anruf { background: var(--gruen); border-color: var(--gruen); color: #fff; margin: 8px 0 4px; }
.knopf-112 { background: var(--rot); color: #fff; font-size: 1.4rem; }
body.notfall main { padding-top: 4px; }

/* Fuß */
.fuss { max-width: 760px; margin: 0 auto; padding: 16px; border-top: 2px solid var(--hell); font-size: 1rem; color: var(--grau); text-align: center; }
.hilfe-anruf .knopf { margin-top: 4px; }

/* Ausdruck */
.druck { display: none; }
@media print {
  body { font-size: 12pt; }
  body > *:not(.druck) { display: none !important; }
  .druck { display: block; }
  .druck-anleitung { font-size: 11pt; margin: 0 0 4mm; }
  .druck-karte {
    width: 85.6mm; min-height: 54mm; border: 1px dashed #000; border-top: 4mm solid var(--rot);
    padding: 2mm 3mm; font-size: 7.5pt; line-height: 1.25; overflow: hidden;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .druck-kopf { font-weight: 900; font-size: 10pt; color: var(--rot); margin: 0 0 1mm; letter-spacing: .05em; }
  .druck-zeile { margin: 0 0 .6mm; }
  .druck-klein { font-size: 7pt; margin: 1mm 0 0; color: #333; }
  .druck-voll { margin-top: 10mm; }
  .druck-voll h2 { font-size: 16pt; margin: 0 0 4mm; }
  .druck-voll .druck-klein { font-size: 10pt; }
  .druck .nf-feld { background: none; border: 1px solid #999; padding: 2mm 3mm; margin: 0 0 3mm; }
  .druck .nf-wert { font-size: 13pt; }
  .druck .nf-name { font-size: 18pt; }
  @page { size: A4; margin: 15mm; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
h1[tabindex="-1"]:focus { outline: none; }
.kasten > h2:first-child { margin-top: 0; }
