/* Herzspur – Gestaltung.
   Leitbild: Schreiberpapier. Die Kurve („Spur“) ist das Bild, alles andere sind ruhige Textzeilen.
   – Papier mit grünlichem Raster wie bei einem Messschreiber, Spur in Kopierstift-Violett: bewusst kein Rot und keine
     Ampelfarben, denn die App misst und wertet nicht (AGENTS.md).
   – Eine Schrift: Atkinson Hyperlegible (für eingeschränktes Sehen entworfen).
   – Große Ziele, eine Hauptaktion je Bildschirm, im Dunkeln echtes Schwarz.
   Kurvenfarben geprüft mit dem Farb-Prüfskript (hell auf #EEF3EE, dunkel auf #050806): Helligkeit, Buntheit,
   Unterscheidbarkeit bei Farbfehlsichtigkeit, Kontrast – alle bestanden. */

@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-display: swap;
    src: url("../schrift/atkinson-hyperlegible-400-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-display: swap;
    src: url("../schrift/atkinson-hyperlegible-400-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 700; font-display: swap;
    src: url("../schrift/atkinson-hyperlegible-700-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 700; font-display: swap;
    src: url("../schrift/atkinson-hyperlegible-700-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
    color-scheme: light dark;
    --papier: #EEF3EE;
    --papier-tief: #E1EAE3;
    --raster: #C3D3C7;
    --raster-fein: #DAE5DC;
    --tinte: #14211C;
    --tinte-2: #43544C;
    --tinte-3: #5C6C64;
    --spur: #5743C9;
    --spur-2: #B86200;
    --spur-3: #008F73;
    --aktion: #4636B0;
    --aktion-tinte: #FFFFFF;
    --rand: 20px;
    --ziel: 56px;                     /* kleinste Höhe eines Tippziels */
    --rund: 14px;
    --schrift: "Atkinson Hyperlegible", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-thema="hell"]) {
        --papier: #050806; --papier-tief: #0E1511; --raster: #223129; --raster-fein: #131B16;
        --tinte: #DCE7DF; --tinte-2: #A6B6AC; --tinte-3: #84958B;
        --spur: #8474F2; --spur-2: #C97F26; --spur-3: #2AA688;
        --aktion: #8474F2; --aktion-tinte: #0A0714;
    }
}
:root[data-thema="dunkel"] {
    --papier: #050806; --papier-tief: #0E1511; --raster: #223129; --raster-fein: #131B16;
    --tinte: #DCE7DF; --tinte-2: #A6B6AC; --tinte-3: #84958B;
    --spur: #8474F2; --spur-2: #C97F26; --spur-3: #2AA688;
    --aktion: #8474F2; --aktion-tinte: #0A0714;
}
:root[data-thema="hell"] { color-scheme: light; }
:root[data-thema="dunkel"] { color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
    margin: 0; background: var(--papier); color: var(--tinte);
    font: 400 17px/1.45 var(--schrift); font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--spur); outline-offset: 3px; border-radius: 4px; }

/* ── Aufbau: Kopf, Inhalt, Fuß ───────────────────────────── */
/* Die Spalte darf nie breiter werden als der Bildschirm – sonst schneidet der rechte Rand Text ab (minmax(0, 1fr)). */
.app { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; grid-template-columns: minmax(0, 1fr); max-width: 760px; margin: 0 auto; }

.kopf { display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
    padding: calc(14px + env(safe-area-inset-top)) var(--rand) 10px; background: var(--kopf-grund, none); color: var(--kopf-tinte, inherit); }
.kopf-name { font-weight: 700; font-size: 18px; letter-spacing: 0.01em; flex: none; display: flex; align-items: center; gap: 8px; }
.zeichen-spur { color: var(--kopf-spur, var(--spur)); flex: none; }
.kopf-stand { color: var(--kopf-tinte, var(--tinte-2)); font-size: 15px; text-align: right; min-width: 0; overflow-wrap: anywhere; }   /* bricht um, statt abzuschneiden */

.inhalt { padding: 6px 0 28px; min-width: 0; }      /* oben etwas mehr Luft, seit der Kopf farbig sein kann (siehe Dateiende) */
.block { padding: 0 var(--rand); }
.block:not(:first-child) { margin-top: 22px; }

.fuss { position: sticky; bottom: 0; background: var(--papier); border-top: 1px solid var(--raster);
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding-bottom: env(safe-area-inset-bottom); }
.fuss button { min-height: 62px; border: 0; background: none; color: var(--tinte-2); font-size: 14px; cursor: pointer;
    border-top: 3px solid transparent; margin-top: -1px; display: grid; justify-items: center; align-content: center; gap: 2px; padding: 6px 4px; }
.fuss .symbol { display: block; }
.fuss button[aria-current="page"] { color: var(--tinte); font-weight: 700; border-top-color: var(--spur); }
.fuss button[aria-current="page"] .symbol { color: var(--spur); }

/* ── Schrift-Rollen ──────────────────────────────────────── */
.titel { font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; }
.unter { font-size: 21px; line-height: 1.25; font-weight: 700; }
.lauf { max-width: 34em; }
.lauf + .lauf { margin-top: 10px; }
.leise { color: var(--tinte-2); }
.klein { font-size: 15px; }

/* ── Knöpfe ──────────────────────────────────────────────── */
.knopf { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 64px; padding: 12px 20px;
    border: 0; border-radius: var(--knopf-rund, var(--rund)); background: var(--aktion); color: var(--aktion-tinte);
    font-weight: 700; font-size: 19px; cursor: pointer; text-align: center; }
.knopf:active { transform: translateY(1px); }
.knopf[disabled] { opacity: 0.55; cursor: default; }
.knopf.still { background: none; color: var(--tinte); border: 2px solid var(--tinte); min-height: var(--ziel); font-size: 17px; }
.knopf.schmal { width: auto; min-height: var(--ziel); font-size: 17px; padding: 8px 18px; }
.knopfreihe { display: grid; gap: 12px; }

/* ── Die Spur: Zahl und Papierstreifen ───────────────────── */
.zahlzeile { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 12px; padding: 0 var(--rand); }
.zahl { font-size: clamp(88px, 27vw, 148px); line-height: 0.86; font-weight: 700; letter-spacing: -0.03em; min-width: 1.75em; color: var(--zahl, var(--tinte)); }
.zahl.leer { color: var(--tinte-3); }
.zahl-einheit { color: var(--tinte-2); font-size: 17px; line-height: 1.25; }

.streifen { position: relative; margin-top: 10px; border-top: 1px solid var(--raster); border-bottom: 1px solid var(--raster);
    background: var(--papier); touch-action: pan-y; }
.streifen canvas { display: block; width: 100%; height: 100%; }
.streifen.puls { height: clamp(190px, 34vh, 300px); }
.streifen.ekg { height: 150px; }
.streifen-leer { position: absolute; inset: 0; display: grid; place-items: center; color: var(--tinte-3); padding: 0 var(--rand); text-align: center; pointer-events: none; }
.zeiger { position: absolute; top: 8px; transform: translateX(-50%); pointer-events: none; white-space: nowrap;
    background: var(--tinte); color: var(--papier); padding: 4px 10px; border-radius: 8px; font-size: 15px; }
.zeiger b { font-weight: 700; }
.streifen-fuss { display: flex; justify-content: space-between; color: var(--tinte-3); font-size: 15px; padding: 6px var(--rand) 0; }

/* ── Zeilen mit Messwerten ───────────────────────────────── */
.zeilen { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--raster); }
.zeilen > li { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 13px 0;
    border-bottom: 1px solid var(--raster); min-height: 52px; }
.zeilen .was { color: var(--tinte-2); flex: 1 1 0; min-width: 0; }      /* die Beschriftung bricht um, der Wert bleibt beisammen */
.zeilen .wert { font-weight: 700; text-align: right; flex: 0 1 auto; max-width: 62%; overflow-wrap: break-word; }
.zeilen .wert small { font-weight: 400; font-size: 15px; color: var(--tinte-2); margin-left: 4px; white-space: nowrap; }
.zeilen .wert:has(small) { white-space: nowrap; max-width: none; flex-shrink: 0; }
.zeilen li.mit-knopf { align-items: center; padding: 8px 0; flex-wrap: wrap; }
.zeilen li.mit-knopf .was { flex: 1 1 auto; }

/* ── Hinweise (technisch, nie wertend) ───────────────────── */
.meldungen { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 0 var(--rand); margin-bottom: 14px; }
.meldungen:empty { display: none; }
.meldung { border-left: 5px solid var(--tinte); background: var(--papier-tief); padding: 12px 14px; border-radius: 0 10px 10px 0; min-width: 0; overflow-wrap: anywhere; }
.meldung strong { display: block; }
.meldung button { margin-top: 8px; background: none; border: 0; padding: 6px 0; min-height: 44px; text-decoration: underline; cursor: pointer; color: var(--tinte); }

.uebung-marke { display: inline-block; border: 2px dashed var(--tinte-2); border-radius: 8px; padding: 2px 10px; font-size: 15px; color: var(--tinte-2); }

/* ── Auswahl (Sprache, Ansicht) ──────────────────────────── */
.wahl { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 2px solid var(--betont, var(--tinte)); border-radius: var(--rund); overflow: hidden; }
.wahl button { min-height: var(--ziel); border: 0; background: none; cursor: pointer; min-width: 0; padding: 4px 6px; overflow-wrap: anywhere; }
.wahl button + button { border-left: 2px solid var(--betont, var(--tinte)); }
.wahl button[aria-pressed="true"] { background: var(--betont, var(--tinte)); color: var(--betont-tinte, var(--papier)); font-weight: 700; }

.nur-vorleser { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (min-width: 620px) {
    :root { --rand: 32px; }
    .knopfreihe.zwei { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ── Aufzeichnung: Stand und Bedienung ───────────────────── */
.aufz-stand { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.aufz-stand .laeuft { font-weight: 700; display: flex; align-items: center; gap: 10px; }
.aufz-stand .laeuft::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--spur); flex: none; }
.aufz-stand .uhr { font-weight: 700; font-size: 21px; }
.aufz-knoepfe { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
.aufz-knoepfe .knopf.still { width: auto; min-height: 64px; padding: 12px 22px; }

/* ── Blatt: Eingaben von unten (Marke, Beenden, Ändern, Löschen) ── */
dialog.blatt { border: 0; padding: 22px var(--rand) calc(22px + env(safe-area-inset-bottom)); margin: auto auto 0; width: 100%; max-width: 760px; max-height: 92dvh;
    background: var(--papier); color: var(--tinte); border-top: 3px solid var(--tinte); border-radius: var(--rund) var(--rund) 0 0; overflow-y: auto; }
dialog.blatt::backdrop { background: rgb(5 8 6 / 0.55); }
dialog.blatt > * + * { margin-top: 16px; }
@media (min-width: 620px) { dialog.blatt { margin: auto; border: 3px solid var(--tinte); border-radius: var(--rund); } }

.feld { display: grid; gap: 6px; }
.feld > span { font-weight: 700; }
.feld input, .feld textarea { font: inherit; color: var(--tinte); background: var(--papier); border: 2px solid var(--tinte); border-radius: var(--rund);
    padding: 12px 14px; min-height: var(--ziel); width: 100%; }
.feld textarea { min-height: 96px; resize: vertical; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.feld-titel { font-weight: 700; }
/* Bild „Puls je Tag“ im Bericht über einen Zeitraum (ui/tage-bild.js) */
.bild-tage { margin: 22px 0 8px; break-inside: avoid; }
.tage-bild { display: block; width: 100%; height: auto; margin-top: 10px; max-height: 320px; }
/* Zwei Felder nebeneinander (eigener Zeitraum: von – bis); auf sehr schmalen Bildschirmen untereinander. */
.zwei-felder { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-top: 14px; }
/* Filter im Verlauf: eine Zeile Chips, seitlich schiebbar statt vieler Zeilen; reicht bis an den Bildschirmrand. */
.chips.leiste { flex-wrap: nowrap; overflow-x: auto; padding: 2px var(--rand) 14px; scrollbar-width: none; }
.chips.leiste::-webkit-scrollbar { display: none; }
.chips.leiste .chip { flex: none; white-space: nowrap; }
.feld-mit-knopf { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.feld-mit-knopf .knopf { width: auto; padding: 8px 18px; }
/* Schlagworte in der Einzelansicht: ruhige Wörter mit dünnem Rand, nicht antippbar (anders als die Chips zum Wählen). */
.woerter { display: flex; flex-wrap: wrap; gap: 6px 8px; margin-top: 10px; }
.woerter span { border: 1px solid var(--tinte-3); border-radius: 999px; padding: 1px 10px; font-size: 15px; color: var(--tinte-2); }
.chip { min-height: var(--ziel); padding: 8px 18px; border: 2px solid var(--tinte); border-radius: 999px; background: none; cursor: pointer; font-size: 17px; }
.chip[aria-pressed="true"] { background: var(--tinte); color: var(--papier); font-weight: 700; }
.textknopf { background: none; border: 0; padding: 6px 0; min-height: var(--ziel); text-decoration: underline; cursor: pointer; color: var(--tinte); text-align: left; }

/* ── Verlauf: eine Zeile je Aufzeichnung ─────────────────── */
.liste { margin: 0 var(--liste-rand, 0); padding: 0; list-style: none; border-top: 1px solid var(--liste-linie, var(--raster)); background: var(--liste-grund, none); border-radius: var(--liste-rund, 0); overflow: hidden; }
.liste > li:last-child { border-bottom-color: var(--liste-linie, var(--raster)); }
.liste > li { border-bottom: 1px solid var(--raster); }
.liste button { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; width: 100%; padding: 14px var(--rand); min-height: 72px;
    background: none; border: 0; text-align: left; cursor: pointer; }
.liste button:active { background: var(--papier-tief); }
.liste .name { font-weight: 700; font-size: 19px; min-width: 0; overflow-wrap: anywhere; }
.liste .name.ohne { font-weight: 400; color: var(--tinte-2); }
.liste .rechts { font-weight: 700; text-align: right; white-space: nowrap; }
.liste .unten { color: var(--tinte-2); font-size: 15px; }
.liste .unten.rechts { font-weight: 400; }
.zusatzwort { display: inline-block; margin-left: 8px; border: 1px dashed var(--tinte-2); border-radius: 6px; padding: 0 7px; font-size: 14px; font-weight: 400; color: var(--tinte-2); vertical-align: 2px; }

.streifen.verlauf { height: clamp(220px, 40vh, 340px); }
.marken-liste { margin: 10px 0 0; padding: 0; list-style: none; counter-reset: marke; border-top: 1px solid var(--raster); }
.marken-liste > li { counter-increment: marke; display: grid; grid-template-columns: 30px auto 1fr; gap: 12px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--raster); }
.marken-liste > li::before { content: counter(marke); background: var(--tinte); color: var(--papier); font-size: 14px; text-align: center; border-radius: 3px; padding: 1px 0; }
.marken-liste .zeit { color: var(--tinte-2); }
.marken-liste .text { font-weight: 700; overflow-wrap: anywhere; }
.notiz { white-space: pre-wrap; overflow-wrap: anywhere; }


/* Text-Code der Sicherung: lange Zeichenfolge, darf überall umbrechen */
textarea.code { font: 400 14px/1.4 ui-monospace, monospace; color: var(--tinte); background: var(--papier); border: 2px solid var(--tinte); border-radius: var(--rund);
    padding: 10px 12px; width: 100%; overflow-wrap: anywhere; word-break: break-all; margin-top: 10px; }
.feld textarea.code { margin-top: 0; }
.zeilen .was .dazu { display: block; font-size: 14px; color: var(--tinte-3); }

/* ── Geführte Messung ────────────────────────────────────── */
.punkte { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; max-width: 34em; }
.knopf.riesig { min-height: 120px; font-size: 26px; }

/* ── Bericht: sachlich, auf Papier lesbar ────────────────── */
.bericht section { margin-top: 22px; break-inside: avoid; }
.bericht section.bricht { break-inside: auto; }      /* lange Tabellen und EKG-Streifen laufen über den Seitenrand weiter */
.bericht h2 { break-after: avoid; }
.bericht h2 { margin-bottom: 8px; }
.bericht dl { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); border-top: 1px solid var(--raster); }
.bericht dt, .bericht dd { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--raster); overflow-wrap: break-word; }
.bericht dt { color: var(--tinte-2); padding-right: 12px; }
.bericht dd { font-weight: 700; }
.bericht table { border-collapse: collapse; width: 100%; margin-top: 8px; }
.tabelle-rahmen { overflow-x: auto; }
.tabelle-rahmen td { font-size: 15px; white-space: nowrap; }
.tabelle-rahmen td.lang { white-space: normal; min-width: 13em; }
.tabelle-rahmen th { min-width: 4.5em; }
@media print { .tabelle-rahmen { overflow: visible; } .tabelle-rahmen td, .tabelle-rahmen td.lang { white-space: normal; min-width: 0; } .tabelle-rahmen th { min-width: 0; } .bericht th, .bericht td { font-size: 9.5pt; } .bericht tr { break-inside: avoid; } }
.bericht th, .bericht td { text-align: left; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--raster); vertical-align: top; }
.bericht th { font-weight: 400; color: var(--tinte-2); font-size: 15px; }
.bericht td { font-weight: 700; }
.bericht section > p { margin-top: 8px; }
.bericht .streifen { margin-left: calc(-1 * var(--rand)); margin-right: calc(-1 * var(--rand)); }

@media print {
    :root, :root[data-thema] { --papier: #fff; --papier-tief: #eee; --raster: #bbb; --raster-fein: #ddd; --tinte: #000; --tinte-2: #333; --tinte-3: #444; --spur: #3a2a9c; color-scheme: light; }
    .nicht-drucken, .fuss, .meldungen { display: none !important; }
    body { font-size: 11pt; }
    .app { max-width: none; display: block; }
    .inhalt { padding: 0; }
    .block { padding: 0; }
    .bericht .streifen { margin-left: 0; margin-right: 0; }
    @page { margin: 12mm; }      /* der Bericht setzt Ausrichtung und Rand selbst (ansicht-bericht.js: setzePapier) */
}
.tag { font-size: 17px; font-weight: 700; padding: 18px var(--rand) 8px; color: var(--tinte-2); }
.tag:first-child { padding-top: 0; }

/* ── EKG-Streifen im Bericht: Papier in Millimetern ──────── */
.ekg-bild { margin: 14px 0 0; }
.ekg-bild figcaption { margin-bottom: 2px; color: var(--tinte-2); break-after: avoid; }
.ekg-zeilen { overflow-x: auto; }
.ekg-streifen { display: block; width: max(100%, var(--breite-px)); height: auto; break-inside: avoid; }
.ekg-linie-fein { fill: none; stroke: var(--raster-fein); stroke-width: 0.12; }
.ekg-linie-grob { fill: none; stroke: var(--raster); stroke-width: 0.22; }
.ekg-spur { fill: none; stroke: var(--tinte); stroke-width: 0.28; stroke-linejoin: round; stroke-linecap: round; }
.ekg-eich { fill: none; stroke: var(--tinte-2); stroke-width: 0.28; }
.ekg-zeit { font-size: 2px; fill: var(--tinte-2); font-family: inherit; }
@media print { .ekg-zeilen { overflow: visible; } .ekg-streifen { width: var(--breite-mm); max-width: 100%; } .ekg-bild { margin-top: 2mm; } .ekg-bild figcaption { font-size: 8.5pt; margin-bottom: 0.5mm; } }

/* ── Dunkler Ruhe-Bildschirm: fast nur Schwarz ───────────── */
.ruhebild { position: fixed; inset: 0; z-index: 1000; background: #000; color: #3a3f3b; touch-action: none; user-select: none; cursor: pointer; }
.ruhebild-zeile { position: absolute; left: 0; right: 0; text-align: center; font-size: 30px; font-weight: 700; white-space: pre; transition: none; }
.ruhebild-hinweis { position: absolute; left: 0; right: 0; bottom: 12%; text-align: center; font-size: 17px; color: #6a726c; opacity: 0; }
.ruhebild-hinweis.sichtbar { opacity: 1; }

/* ── Geführte Meditation: der gerade gesprochene Satz ────── */
.meditation-satz { font-size: 23px; line-height: 1.45; min-height: 7.5em; transition: opacity 1.2s ease; }
.meditation-satz.still { opacity: 0.45; }
@media (prefers-reduced-motion: reduce) { .meditation-satz { transition: none; } }

/* ── Kalender im Verlauf: ein Monatsblatt ────────────────── */
.kalender-kopf { display: grid; grid-template-columns: var(--ziel) 1fr var(--ziel); align-items: center; text-align: center; margin-bottom: 8px; }
.kalender-pfeil { min-height: var(--ziel); background: none; border: 0; font-size: 30px; line-height: 1; cursor: pointer; color: var(--tinte); }
.kalender { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.kalender-wochentag { text-align: center; font-size: 14px; color: var(--tinte-2); padding-bottom: 4px; }
.kalender-tag { display: grid; grid-template-rows: 1fr 12px; place-items: center; min-height: var(--ziel); padding: 4px 0 2px; border: 2px solid transparent; border-radius: var(--rund);
    background: none; color: var(--tinte-3); font: inherit; font-variant-numeric: tabular-nums; }
button.kalender-tag { background: var(--papier-tief); color: var(--tinte); font-weight: 700; cursor: pointer; }
button.kalender-tag[aria-pressed="true"] { background: var(--betont, var(--tinte)); color: var(--betont-tinte, var(--papier)); }
.kalender-tag.heute { border-color: var(--raster); }
button.kalender-tag.heute { border-color: var(--tinte); }
.kalender-punkte { font-size: 13px; line-height: 12px; letter-spacing: 1px; }

/* ── „Holt Messwerte nach“: der Bildschirm war aus, die gestauten Werte laufen ein ── */
.nachholen { display: grid; gap: 8px; margin: 0 var(--rand) 16px; padding: 12px 14px; border: 2px solid var(--tinte); border-radius: var(--rund); font-weight: 700; }
.nachholen.fertig { border-color: var(--raster); font-weight: 400; }
.nachholen-balken { display: block; height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--raster) 0 40%, var(--tinte) 40% 60%, var(--raster) 60% 100%); background-size: 250% 100%; animation: nachholen 1.4s linear infinite; }
@keyframes nachholen { from { background-position: 100% 0; } to { background-position: -66% 0; } }
@media (prefers-reduced-motion: reduce) { .nachholen-balken { animation: none; } }
@media print { .nachholen { display: none; } }

/* ── EKG-Betrachter der Einzelansicht ────────────────────── */
.ekg-betrachter .ekg-zeilen { overflow: hidden; margin: 6px 0 0; }
.ekg-betrachter .ekg-streifen { width: 100%; }
.ekg-betrachter-zeit { font-weight: 700; font-variant-numeric: tabular-nums; }
.ekg-betrachter input[type="range"] { width: 100%; min-height: var(--ziel); margin-top: 6px; accent-color: var(--tinte); }
.ekg-betrachter-marken { display: grid; }
.knopfreihe.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ── Herzspur der Startseite: Papierstreifen, auf den sich einmal eine Spur zeichnet ── */
.herzspur-bild { display: block; width: 100%; height: 112px; margin: 2px 0 22px; border-top: 1px solid var(--raster); border-bottom: 1px solid var(--raster); }
.herzspur-fein { fill: none; stroke: var(--raster-fein); stroke-width: 1; }
.herzspur-grob { fill: none; stroke: var(--raster); stroke-width: 1; }
.herzspur-linie { fill: none; stroke: var(--spur); stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round;
    stroke-dasharray: 1; stroke-dashoffset: 1; animation: herzspur 2.2s cubic-bezier(0.3, 0, 0.3, 1) 0.15s forwards; }
@keyframes herzspur { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .herzspur-linie { animation: none; stroke-dashoffset: 0; } }
@media print { .herzspur-bild { display: none; } }

/* ── Wege: Zeilen, die irgendwohin führen ────────────────── */
.liste.wege button { min-height: 68px; align-items: center; }
.liste.wege .name { font-size: 18px; }
.liste.wege .rechts { grid-row: 1 / span 2; grid-column: 2; align-self: center; color: var(--tinte-3); }
.liste.wege .unten { grid-column: 1; }
.pfeil { display: block; }

/* ── Einstellungen: Gruppen und Schalter-Zeilen ──────────── */
.gruppe { display: grid; gap: 16px; }
.teil { margin-top: 32px; }
.teil + .block, .gruppe + .block { margin-top: 32px; }
.gruppe .feld > span { font-weight: 400; color: var(--tinte-2); font-size: 15px; }
.schalt-liste { margin: 0 var(--liste-rand, 0); padding: 0; list-style: none; border-top: 1px solid var(--liste-linie, var(--raster)); background: var(--liste-grund, none); border-radius: var(--liste-rund, 0); overflow: hidden; }
.schalt-liste > li:last-child { border-bottom-color: var(--liste-linie, var(--raster)); }
.schalt-liste > li { border-bottom: 1px solid var(--raster); }
.schalt-liste > li.schalt-mehr { padding: 0 var(--rand) 14px; margin-top: -1px; border-top: 1px solid var(--liste-grund, var(--papier)); }
.schalt-zeile { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; width: 100%; min-height: 68px; padding: 12px var(--rand);
    background: none; border: 0; text-align: left; cursor: pointer; }
div.schalt-zeile { cursor: default; }
.schalt-zeile:active { background: var(--papier-tief); }
.schalt-text { display: grid; gap: 2px; min-width: 0; }
.schalt-text > span { font-weight: 700; }
.schalt-text > small { font-size: 15px; color: var(--tinte-2); }
.schalt-knopf { position: relative; width: 54px; height: 32px; border-radius: 16px; border: 2px solid var(--tinte-2); flex: none; transition: background 0.14s ease, border-color 0.14s ease; }
.schalt-knopf::after { content: ""; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--tinte-2); transition: transform 0.14s ease, background 0.14s ease; }
.schalt-zeile[aria-checked="true"] .schalt-knopf { background: var(--aktion); border-color: var(--aktion); }
.schalt-zeile[aria-checked="true"] .schalt-knopf::after { transform: translateX(22px); background: var(--aktion-tinte); }
@media (prefers-reduced-motion: reduce) { .schalt-knopf, .schalt-knopf::after { transition: none; } }

/* ── Aufklapp-Erklärung (Startseite: Uhren und Geräte, die nicht erscheinen) ── */
.aufklapp summary { min-height: var(--ziel); display: flex; align-items: center; cursor: pointer; text-decoration: underline; list-style: none; }
.aufklapp summary::-webkit-details-marker { display: none; }
.aufklapp[open] summary { font-weight: 700; text-decoration: none; }

/* ── Stil-Auswahl: Kacheln mit kleiner Vorschau (Farben des Stils stehen als Eigenschaften an der Kachel) ── */
.stil-wahl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stil-kachel { display: grid; gap: 6px; padding: 0 0 8px; border: 2px solid var(--raster); border-radius: 14px; background: none; cursor: pointer; overflow: hidden; text-align: center; font-size: 15px; }
.stil-kachel[aria-pressed="true"] { border-color: var(--tinte); font-weight: 700; box-shadow: 0 0 0 2px var(--tinte); }
.stil-bild { display: block; width: 100%; height: 54px; }
.inhalt { padding-top: 14px; }      /* Luft unter dem Kopf, der in manchen Stilen farbig ist */

/* ── Ganzes EKG verkleinert: ein Blatt je Stunde als Bild (ui/ekg-ganz.js) ── */
.ekg-ganz { margin-top: 26px; }
.ekg-ganz-blatt { margin: 14px 0 0; }
.ekg-ganz-blatt figcaption { margin-bottom: 4px; color: var(--tinte-2); }
.ekg-ganz-blatt img { display: block; width: 100%; height: auto; background: #fff; border: 1px solid var(--raster); }
@media print {
    .ekg-ganz { margin-top: 0; }
    .ekg-ganz-blatt { margin: 0; break-before: page; break-inside: avoid; }
    .ekg-ganz-blatt figcaption { font-size: 8.5pt; margin-bottom: 1mm; }
    .ekg-ganz-blatt img { width: var(--breite-mm); max-width: 100%; border: 0; }
}

