/* Labor-Umrechner. Farben, Radien und Schriften kommen aus /design-system.css; Grundbausteine wie bei /htpasswd/ und /MD5-SHA-256-bcrypt/. */

/* Gedimmte Schrift heller als im Design-System, damit auch kleine Hinweise WCAG AA erreichen (etwa 5,6:1). */
.werkzeug-seite { --text-dim: #7d8aa0; }

/* Komponenten setzen display, das hidden-Attribut muss trotzdem gewinnen. */
.werkzeug-seite [hidden] { display: none !important; }
.werkzeug-seite h2 { font-size: clamp(1.25rem, 2.4vw, 1.6rem); margin: 0 0 .5rem; }
.werkzeug-seite h3 { font-size: 1.05rem; margin: 1.75rem 0 .75rem; }
.werkzeug-seite label { margin-bottom: 0; text-transform: none; letter-spacing: normal; }

/* ── Kopf ───────────────────────────────────────────────────────── */
.brotkrumen { font-size: .82rem; color: var(--text-dim); margin: -.5rem 0 1rem; display: flex; flex-wrap: wrap; gap: .35rem; }
.brotkrumen a { color: var(--text-muted); text-decoration: none; }
.brotkrumen a:hover { color: var(--accent); }
.stand { margin: .75rem 0 0; font-size: .8rem; color: var(--text-dim); }
/* Kopf nur mit Überschrift, damit die Werkzeuge sofort sichtbar sind; Erklärungen stehen unter den Werkzeugen (#anleitung). */
.werkzeug-seite .page-hero { margin-bottom: 1.25rem; }
.werkzeug-seite .page-hero__title { margin-bottom: .4rem; }
.kopf-hilfe { display: inline-flex; align-items: center; min-height: 44px; font-size: .9rem; color: var(--text-muted); text-decoration: underline; text-underline-offset: 3px; }
.kopf-hilfe:hover { color: var(--accent); }
.medizin-hinweis {
    margin: 0 0 1.25rem; padding: .85rem 1.1rem; border-radius: var(--radius-md); border: 1px solid rgba(251,191,36,.3);
    background: var(--warn-dim); color: var(--text-muted); font-size: .9rem; line-height: 1.55;
}
.medizin-hinweis strong { color: var(--warn); }

/* ── Angaben zur Person: eingeklappte Zeile unter den Reitern ─────── */
.person { margin-bottom: 1.25rem; border-radius: var(--radius-lg); border: 1px solid var(--glass-border); background: var(--glass-bg); }
.person > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .6rem; min-height: 48px; padding: .8rem 1.1rem; cursor: pointer; list-style: none; }
.person > summary::-webkit-details-marker { display: none; }
.person > summary::before { content: '▸'; color: var(--accent); transition: transform var(--t) var(--ease-soft); }
.person[open] > summary::before { transform: rotate(90deg); }
.person > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-lg); }
.person__titel { font-size: .95rem; font-weight: 600; color: var(--text); }
.person__kurz { font-size: .85rem; color: var(--text-dim); }
.person__felder { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem 1rem; padding: 0 1.1rem 1rem; }
.person__felder .feld { width: 150px; }
.person__felder .schalter { min-height: 44px; align-items: center; }

/* ── Reiter ─────────────────────────────────────────────────────── */
.tabbar {
    display: flex; gap: .4rem; padding: .35rem; margin-bottom: 1.25rem;
    background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 999px;
    overflow-x: auto; scrollbar-width: none;
}
.tabbar::-webkit-scrollbar { display: none; }
.tabbar [role="tab"] {
    flex: 1 0 auto; padding: .7rem 1.2rem; border-radius: 999px; min-height: 44px;
    background: transparent; color: var(--text-muted); box-shadow: none; white-space: nowrap;
}
.tabbar [role="tab"]:hover { color: var(--text); background: var(--glass-bg-hi); transform: none; }
.tabbar [role="tab"][aria-selected="true"] { background: var(--accent); color: #000; }
.tabbar [role="tab"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Arbeitsflächen (bewusst ohne .card: kein Kippen beim Tippen) ── */
.werkzeug {
    display: grid; gap: 1rem; padding: clamp(1.1rem, 3vw, 2rem); margin-bottom: 2rem; min-width: 0;
    background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--radius-xl);
    backdrop-filter: blur(var(--glass-blur)) saturate(150%); -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
}
.werkzeug > h2 { margin-bottom: -.5rem; }
.werkzeug > h2.abstand-oben { margin-top: 1.5rem; }
.werkzeug:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.werkzeug__intro { color: var(--text-muted); margin: 0; max-width: 75ch; }

/* ── Felder ─────────────────────────────────────────────────────── */
.feld { display: grid; gap: .4rem; min-width: 0; }
.feld > span, .feld > label { font-size: .78rem; font-weight: 600; color: var(--text-muted); letter-spacing: .02em; text-transform: uppercase; }
.feld small { font-weight: 400; color: var(--text-dim); text-transform: none; letter-spacing: normal; }
.feld input, .feld select, .feld textarea { margin: 0; }
.feld textarea { min-height: 140px; font-family: var(--font-mono); font-size: .88rem; resize: vertical; }
.feld-paar { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem 1rem; }
.feld-hinweis { margin: 0; font-size: .82rem; color: var(--text-dim); line-height: 1.5; }
.feld-hinweis--warnung { color: var(--warn); }
.optionen-raster { display: grid; gap: .9rem 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); align-items: end; }
.umrechnen { display: grid; gap: .9rem; max-width: 760px; }
.wert-mit-einheit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 9rem); gap: .4rem; }
.wert-mit-einheit input, .wert-mit-einheit select { margin: 0; }

.schalter { display: flex; align-items: flex-start; gap: .6rem; cursor: pointer; color: var(--text-muted); font-size: .88rem; font-weight: 500; line-height: 1.4; }
.schalter input { width: 18px; height: 18px; margin: .1rem 0 0; flex: none; accent-color: var(--accent); cursor: pointer; }
.schalter:hover { color: var(--text); }
.schalter:has(input:disabled) { opacity: .45; cursor: not-allowed; }

/* ── Knöpfe, Status, Meldung ────────────────────────────────────── */
.knopfreihe { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.knopfreihe button { padding: .6rem 1.1rem; min-height: 44px; }
.knopf-klein { padding: .45rem .9rem; min-height: 38px; font-size: .84rem; }
.status { min-height: 1.4em; margin: 0; color: var(--text-muted); font-size: .9rem; }
.status:empty { min-height: 0; }
.status--fehler { color: var(--danger); }
.icon-knopf {
    display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; flex: none;
    border-radius: var(--radius-sm); border: 1px solid transparent; background: transparent; color: var(--text-muted); box-shadow: none;
}
.icon-knopf::after { display: none; }
.icon-knopf:hover { color: var(--danger); background: var(--danger-dim); transform: none; }
.icon-knopf:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.icon-knopf svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.meldung {
    position: fixed; left: 50%; bottom: max(1.25rem, env(safe-area-inset-bottom)); z-index: 1000; margin: 0;
    padding: .75rem 1.2rem; border-radius: 99px; background: var(--bg-4); border: 1px solid var(--accent); color: var(--text);
    font-size: .9rem; box-shadow: 0 12px 32px -12px rgba(0,0,0,.7);
    transform: translate(-50%, 1rem); opacity: 0; pointer-events: none; transition: opacity .2s var(--ease-soft), transform .2s var(--ease-soft);
}
.meldung.ist-sichtbar { opacity: 1; transform: translate(-50%, 0); }

/* ── Wertkarte ──────────────────────────────────────────────────── */
.ergebnisse { display: grid; gap: 1rem; }
.karten { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); align-items: start; }
.wert-karte {
    --farbe: var(--text-muted);
    display: grid; gap: .55rem; padding: 1.1rem 1.2rem; border-radius: var(--radius-lg); min-width: 0;
    border: 1px solid var(--border-hover); border-left: 4px solid var(--farbe); background: rgba(0,0,0,.28);
}
.wert-karte--normal { --farbe: var(--accent); }
.wert-karte--hoch, .wert-karte--niedrig { --farbe: var(--warn); }
.wert-karte--kritisch { --farbe: var(--danger); background: linear-gradient(var(--danger-dim), var(--danger-dim)), rgba(0,0,0,.28); }
.wert-karte p { margin: 0; }
.wert-karte__kopf { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.werkzeug-seite .wert-karte__titel { margin: 0; font-size: 1.05rem; }
.marke { font-size: .74rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; padding: .2rem .6rem; border-radius: 99px; border: 1px solid currentColor; color: var(--farbe); white-space: nowrap; }
.wert-karte__wert { font: 700 1.55rem/1.2 var(--font-display); color: var(--text); font-variant-numeric: tabular-nums; }
.wert-karte__bereich { font-size: .86rem; color: var(--text-muted); }
.wert-karte__herkunft { color: var(--text-dim); }
.wert-karte__herkunft a, .stufe a, .abgeleitet__quelle a, .rechner-quelle a { color: inherit; text-decoration: underline; text-decoration-color: rgba(255,255,255,.2); text-underline-offset: 2px; }
.wert-karte__alarm { padding: .6rem .8rem; border-radius: var(--radius-sm); background: var(--danger-dim); border: 1px solid var(--danger); color: var(--text); font-size: .88rem; }
.wert-karte__text { display: grid; gap: .45rem; color: var(--text-muted); font-size: .9rem; line-height: 1.55; }
.wert-karte__text strong { color: var(--text); }
.wert-karte__hinweise { margin: 0; padding-left: 1.1rem; color: var(--text-dim); font-size: .82rem; display: grid; gap: .2rem; }
.wert-karte__umrechnung { font-family: var(--font-mono); font-size: .84rem; color: var(--text); padding: .45rem .65rem; border-radius: var(--radius-sm); background: var(--glass-bg-hi); overflow-wrap: anywhere; }
.wert-karte__fuss { font-size: .8rem; }
.wert-karte__fuss a { color: var(--text-dim); }
.wert-karte__fuss a:hover { color: var(--accent); }
.mehr summary { cursor: pointer; color: var(--text-dim); font-size: .84rem; }
.mehr summary:hover { color: var(--accent); }
.mehr[open] { display: grid; gap: .4rem; }
.phasen { margin: 0; padding-left: 1.1rem; font-size: .86rem; color: var(--text-muted); }
.faktor { margin: 0; font-size: .84rem; color: var(--text-dim); }

/* Skala: Referenzbereich als grünes Band, Wert als Marke */
.skala { position: relative; height: 10px; margin: .35rem 0 .2rem; border-radius: 99px; background: rgba(251,191,36,.18); }
.skala__bereich { position: absolute; top: 0; bottom: 0; border-radius: 99px; background: rgba(52,211,153,.45); }
.skala__marke {
    position: absolute; top: 50%; width: 16px; height: 16px; border-radius: 50%; transform: translate(-50%, -50%);
    background: var(--farbe); border: 2px solid var(--bg-1, #05060a); box-shadow: 0 0 0 1px var(--farbe);
}

/* Leitlinien-Stufe */
.stufe { padding: .45rem .7rem; border-radius: var(--radius-sm); font-size: .86rem; border: 1px solid var(--border-hover); color: var(--text); }
.stufe small { color: var(--text-dim); }
.stufe--gut { border-color: rgba(52,211,153,.4); background: var(--success-dim); }
.stufe--mittel { border-color: rgba(251,191,36,.4); background: var(--warn-dim); }
.stufe--hoch { border-color: rgba(251,113,133,.45); background: var(--danger-dim); }
.stufe--info { background: var(--glass-bg-hi); }

/* ── Befund ─────────────────────────────────────────────────────── */
.ablage {
    position: relative; display: grid; place-items: center; gap: .3rem; min-height: 140px; padding: 1.25rem;
    border: 1.5px dashed var(--border-hover); border-radius: var(--radius-lg); color: var(--text-muted); text-align: center; cursor: pointer;
    font-size: .95rem; font-weight: 500; transition: border-color var(--t) var(--ease-soft), background var(--t) var(--ease-soft);
}
.ablage strong { color: var(--accent); }
.ablage small { color: var(--text-dim); font-size: .8rem; }
.ablage input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.ablage:hover, .ablage.ist-aktiv { border-color: var(--accent); background: var(--accent-dim); color: var(--text); }
.ablage:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Quellen für den Befund, Mobile first: Kamera oben und groß, Daumenhöhe 56 px, darunter Datei und Ablage. */
.befund-quellen { display: grid; gap: .75rem; }
.foto-knopf, .kamera-knopf {
    position: relative; display: flex; align-items: center; justify-content: center; gap: .6rem; min-height: 56px; padding: .8rem 1.2rem;
    border-radius: var(--radius-lg); font: 700 1.05rem/1.2 var(--font-display); cursor: pointer; text-align: center;
}
.foto-knopf { background: var(--accent); color: #04120c; border: 0; }
.foto-knopf:hover { filter: brightness(1.08); }
.foto-knopf input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.foto-knopf:focus-within { outline: 3px solid var(--text); outline-offset: 2px; }
.foto-knopf svg, .kamera-knopf svg { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.kamera-knopf { min-height: 48px; font-size: .95rem; font-weight: 600; background: transparent; color: var(--text); border: 1px solid var(--border-hover); }
.kamera-knopf:hover { border-color: var(--accent); color: var(--accent); }
.kamera-knopf::after { display: none; }
.befund-quellen .ablage { min-height: 96px; }
.ablage__ziehen { display: none; }
/* Anleitung unter den Werkzeugen */
.anleitung { margin-top: 2.5rem; }
.anleitung h4 { font-size: .98rem; margin: 1.25rem 0 .5rem; color: var(--text); }
/* Mit Maus: Ablage zum Hineinziehen; der Knopf „Befund fotografieren“ öffnet am Computer nur die Dateiauswahl und entfällt. */
@media (hover: hover) and (pointer: fine) {
    .foto-knopf { display: none; }
    .ablage__ziehen { display: inline; }
    .befund-quellen .ablage { min-height: 130px; }
}
@media (min-width: 761px) {
    .befund-quellen:has(.kamera-knopf:not([hidden])) { grid-template-columns: 1fr auto; align-items: stretch; }
    .befund-quellen .ablage { grid-row: 1; grid-column: 1; }
    .befund-quellen .kamera-knopf { grid-row: 1; grid-column: 2; padding-inline: 1.4rem; }
}

/* Kamera im Browser: auf dem Handy bildschirmfüllend, ab Tablet als Fenster */
.kamera {
    width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0;
    background: #000; color: #fff; display: none; grid-template-rows: auto 1fr auto auto; overflow: hidden;
}
.kamera[open] { display: grid; }
.kamera::backdrop { background: rgba(0, 0, 0, .85); }
.kamera__kopf { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: max(.6rem, env(safe-area-inset-top)) 1rem .6rem; }
.kamera__kopf h3 { margin: 0; font-size: 1rem; }
.kamera__zu { width: 44px; height: 44px; min-height: 44px; padding: 0; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .12); border: 0; color: #fff; }
.kamera__zu svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.kamera__bild { position: relative; min-height: 0; overflow: hidden; }
.kamera__bild video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.kamera__rahmen { position: absolute; inset: 7% 8%; border: 2px solid rgba(255, 255, 255, .85); border-radius: 10px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .35); pointer-events: none; }
.kamera__hinweis { margin: 0; padding: .7rem 1rem 0; text-align: center; font-size: .92rem; color: #e6edf5; min-height: 2.6em; }
.kamera__leiste { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; padding: .8rem 1.2rem max(1.2rem, env(safe-area-inset-bottom)); }
.kamera__ausloeser { grid-column: 2; width: 76px; height: 76px; min-height: 76px; padding: 0; border-radius: 50%; border: 5px solid #fff; background: var(--accent); box-shadow: inset 0 0 0 4px #000; }
.kamera__ausloeser::after { display: none; }
.kamera__ausloeser:disabled { background: #555; cursor: not-allowed; }
.kamera__ausloeser:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.kamera__licht { grid-column: 1; justify-self: start; display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: .5rem .9rem; border-radius: 99px; background: rgba(255, 255, 255, .12); border: 0; color: #fff; font-weight: 600; }
.kamera__licht[aria-pressed="true"] { background: var(--warn); color: #000; }
.kamera__licht svg { width: 18px; height: 18px; fill: currentColor; }
@media (min-width: 761px) {
    .kamera { width: min(760px, 94vw); height: min(92dvh, 860px); margin: auto; border-radius: var(--radius-lg); }
}
@media (prefers-reduced-motion: reduce) { .foto-knopf:hover { filter: none; } }

.einfuegen summary { cursor: pointer; color: var(--text-muted); font-weight: 600; }
.einfuegen[open] { display: grid; gap: .75rem; }
.einfuegen[open] summary { margin-bottom: .25rem; }

.pruefung { display: grid; gap: .75rem; min-width: 0; }
.pruefung h3 { margin: .5rem 0 0; }
.pruef-tabelle { width: 100%; border-collapse: collapse; font-size: .88rem; }
.pruef-tabelle th { text-align: left; font-size: .74rem; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: .03em; padding: .4rem .5rem; border-bottom: 1px solid var(--border); }
.pruef-tabelle td { padding: .4rem .5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.pruef-tabelle select, .pruef-tabelle input { margin: 0; padding: .5rem .6rem; font-size: .88rem; min-height: 40px; }
.pruef-tabelle td:first-child { min-width: 210px; }
.pruef-tabelle .pruef-wert { width: 7.5rem; font-family: var(--font-mono); }
.pruef-tabelle .pruef-einheit { min-width: 7.5rem; }
.pruef-bereich { display: flex; align-items: center; gap: .35rem; color: var(--text-dim); }
.pruef-bereich input { width: 5.5rem; font-family: var(--font-mono); }
.pruef-zeile__quelle { display: block; margin-top: .3rem; color: var(--text-dim); font: .72rem/1.35 var(--font-mono); white-space: pre-wrap; overflow-wrap: anywhere; max-width: 32ch; }
.pruef-zeile--pruefen td { background: rgba(251,191,36,.06); }
.pruef-zeile--pruefen td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.pruef-zeile--fehler td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.nicht-erkannt summary { cursor: pointer; color: var(--text-dim); font-size: .86rem; }
.nicht-erkannt ul { margin: .5rem 0 0; padding-left: 1.1rem; font: .78rem/1.5 var(--font-mono); color: var(--text-dim); max-height: 220px; overflow: auto; }

.bericht { display: grid; gap: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--border); min-width: 0; }
.bericht__kopf { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; }
.bericht__kopf h3 { margin: 0; font-size: 1.3rem; }
.bericht__druckhinweis { display: none; }
.bericht__zusammenfassung { display: grid; gap: .9rem; }
.bericht__naechstes { margin: 0; color: var(--text-muted); max-width: 80ch; }
.bericht__titel { margin: .5rem 0 .75rem; font-size: 1.05rem; }
.werkzeug-seite h4 { font-size: 1rem; margin: 0 0 .6rem; }
.kennzahlen { display: flex; flex-wrap: wrap; gap: .6rem; }
.kennzahlen p { margin: 0; padding: .6rem 1rem; border-radius: var(--radius-md); border: 1px solid var(--border-hover); background: rgba(0,0,0,.25); color: var(--text-muted); font-size: .88rem; }
.kennzahlen strong { display: block; font: 700 1.4rem/1.2 var(--font-display); color: var(--text); }
.kennzahl--gut strong { color: var(--accent); }
.kennzahl--mittel strong { color: var(--warn); }
.kennzahl--hoch { border-color: var(--danger) !important; }
.kennzahl--hoch strong { color: var(--danger); }
.alarm { padding: .9rem 1.1rem; border-radius: var(--radius-md); border: 1px solid var(--danger); background: var(--danger-dim); color: var(--text); line-height: 1.55; }
.alarm strong { color: var(--danger); }
.muster { padding: .9rem 1.1rem; border-radius: var(--radius-md); border: 1px solid rgba(129,140,248,.35); background: rgba(129,140,248,.07); }
.muster ul { margin: 0; padding-left: 1.1rem; display: grid; gap: .45rem; color: var(--text-muted); line-height: 1.55; }
.abgeleitet { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.abgeleitet__eintrag, .rechner-ergebnis { padding: .8rem 1rem; border-radius: var(--radius-md); border: 1px solid var(--border-hover); display: grid; gap: .25rem; }
.abgeleitet__eintrag p, .rechner-ergebnis p { margin: 0; }
.abgeleitet__name, .rechner-ergebnis__name { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); }
.abgeleitet__wert, .rechner-ergebnis__wert { font: 700 1.2rem/1.3 var(--font-display); color: var(--text); font-variant-numeric: tabular-nums; }
.abgeleitet__text, .rechner-ergebnis__text { font-size: .86rem; color: var(--text-muted); line-height: 1.5; }
.abgeleitet__quelle { font-size: .76rem; color: var(--text-dim); }

/* ── Rechner ────────────────────────────────────────────────────── */
.rechner-raster { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); align-items: start; }
.rechner-karte { display: grid; gap: .75rem; padding: 1.1rem 1.2rem; border-radius: var(--radius-lg); border: 1px solid var(--border-hover); background: rgba(0,0,0,.25); min-width: 0; }
.werkzeug-seite .rechner-karte h3 { margin: 0; }
.rechner-felder { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); }
.rechner-felder .feld:has(.wert-mit-einheit) { grid-column: 1 / -1; }
.rechner-ausgabe { display: grid; gap: .6rem; }
.rechner-quelle { margin: 0; font-size: .76rem; color: var(--text-dim); }

/* ── Einheiten ──────────────────────────────────────────────────── */
.frei-ergebnis { margin: 0; padding: .9rem 1.1rem; border-radius: var(--radius-md); background: var(--glass-bg-hi); color: var(--text-muted); max-width: 760px; }
.frei-ergebnis strong { font: 700 1.2rem/1.4 var(--font-display); color: var(--text); }
.dosis-tabelle { max-width: 420px; }
.dosis-tabelle caption { text-align: left; color: var(--text-muted); font-size: .86rem; padding-bottom: .4rem; }

/* ── Inhalt und Tabelle aller Werte ─────────────────────────────── */
.wissen { margin: 1rem 0 2rem; max-width: 86ch; }
.wissen h2 { margin-top: 2.5rem; }
.wissen h3 { margin: 1.75rem 0 .5rem; font-size: 1.05rem; }
.wissen a { color: var(--accent); }
.werte-liste { display: grid; gap: .4rem; }
.wert-eintrag { border: 1px solid var(--border); border-radius: var(--radius-md); background: rgba(0,0,0,.18); scroll-margin-top: 90px; }
.wert-eintrag[open] { border-color: var(--border-hover); background: rgba(0,0,0,.3); }
.wert-eintrag summary {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: .25rem 1rem; padding: .7rem 1rem; cursor: pointer; list-style: none;
}
.wert-eintrag summary::-webkit-details-marker { display: none; }
.wert-eintrag summary:hover .wert-eintrag__name { color: var(--accent); }
.wert-eintrag summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-md); }
.wert-eintrag__name { font-weight: 600; color: var(--text); }
.wert-eintrag__name::before { content: '+'; display: inline-block; width: 1.1rem; color: var(--text-dim); font-family: var(--font-mono); }
.wert-eintrag[open] .wert-eintrag__name::before { content: '−'; }
.wert-eintrag__ref { color: var(--text-muted); font-size: .86rem; font-variant-numeric: tabular-nums; }
.wert-eintrag__inhalt { padding: 0 1rem .9rem 2.1rem; }
.wissen .wert-eintrag__inhalt p { margin: 0 0 .55rem; font-size: .92rem; line-height: 1.6; }
.wissen .wert-eintrag__meta { font-size: .8rem; color: var(--text-dim); }
.wissen .wert-eintrag__meta a { color: var(--text-muted); }
.quellen { display: grid; gap: .35rem; padding-left: 1.1rem; font-size: .9rem; }

@media (max-width: 760px) {
    .feld-paar { grid-template-columns: 1fr; }
    .tabbar { border-radius: var(--radius-md); }
    .tabbar [role="tab"] { padding: .6rem .9rem; font-size: .82rem; }
    .werkzeug-seite .page-hero { margin-bottom: 1.5rem; }
    .werkzeug-seite .page-hero__desc { font-size: .95rem; }
    .person__felder .feld { width: auto; flex: 1 1 130px; }
    .wert-eintrag summary { grid-template-columns: 1fr; }
    .wert-eintrag__inhalt { padding-left: 1rem; }
    /* Prüftabelle als gestapelte Karten */
    .pruef-tabelle thead { display: none; }
    .pruef-tabelle, .pruef-tabelle tbody, .pruef-tabelle tr, .pruef-tabelle td { display: block; width: 100%; }
    .pruef-tabelle tr { display: grid; grid-template-columns: 1fr 1fr auto; gap: .4rem; padding: .7rem; margin-bottom: .6rem; border: 1px solid var(--border-hover); border-radius: var(--radius-md); }
    .pruef-tabelle td { padding: 0; border: 0; }
    .pruef-tabelle td:first-child { grid-column: 1 / -1; min-width: 0; }
    .pruef-tabelle td:nth-child(4) { grid-column: 1 / 3; }
    .pruef-tabelle td:nth-child(5) { grid-column: 3; grid-row: 2 / 4; align-self: center; }
    .pruef-tabelle .pruef-wert, .pruef-tabelle .pruef-einheit { width: 100%; min-width: 0; }
    .pruef-bereich input { width: 100%; }
    .pruef-zeile--pruefen td { background: none; }
    .pruef-zeile--pruefen { border-color: var(--warn) !important; }
    .pruef-zeile__quelle { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
    .meldung, .ablage { transition: none; }
}

/* ── Druck: nur der Bericht ─────────────────────────────────────── */
@media print {
    body.druckt-bericht { background: #fff !important; color: #000; }
    body.druckt-bericht > *:not(main) { display: none !important; }
    body.druckt-bericht main > *:not(#panel-befund) { display: none !important; }
    body.druckt-bericht #panel-befund > *:not(#bericht) { display: none !important; }
    body.druckt-bericht #panel-befund { display: block !important; padding: 0; border: 0; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
    body.druckt-bericht .bericht { border: 0; padding: 0; }
    body.druckt-bericht .bericht__kopf .knopfreihe, body.druckt-bericht .wert-karte__fuss, body.druckt-bericht .mehr summary { display: none; }
    body.druckt-bericht .bericht__druckhinweis { display: block; margin: 0; font-size: 9pt; color: #333; }
    body.druckt-bericht * { color: #000 !important; background: none !important; box-shadow: none !important; text-shadow: none !important; }
    body.druckt-bericht .wert-karte, body.druckt-bericht .abgeleitet__eintrag, body.druckt-bericht .kennzahlen p, body.druckt-bericht .muster, body.druckt-bericht .alarm, body.druckt-bericht .stufe {
        border-color: #999 !important; break-inside: avoid;
    }
    body.druckt-bericht .wert-karte { border-left-width: 4px; }
    body.druckt-bericht .wert-karte--hoch, body.druckt-bericht .wert-karte--niedrig { border-left-color: #b7791f !important; }
    body.druckt-bericht .wert-karte--kritisch { border-left-color: #c53030 !important; }
    body.druckt-bericht .wert-karte--normal { border-left-color: #2f855a !important; }
    body.druckt-bericht .skala { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    body.druckt-bericht .skala__bereich { background: #9ae6b4 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    body.druckt-bericht .skala__marke { background: #000 !important; border-color: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    body.druckt-bericht .karten { grid-template-columns: 1fr 1fr; }
    body.druckt-bericht a { text-decoration: none; }
}

/* Legende zur gelben Markierung in der Prüftabelle */
.pruef-legende { padding: 0 .35rem; border-left: 3px solid var(--warn); background: rgba(251,191,36,.08); color: var(--text-muted); }
.pruef-tabelle select:disabled { opacity: .55; cursor: not-allowed; }

/* ── KI-Assistent ───────────────────────────────────────────────── */
.ki-einwilligung { display: grid; gap: .9rem; padding: 1rem 1.15rem; border-radius: var(--radius-md); border: 1px solid var(--border-hover); background: rgba(0,0,0,.22); }
.ki-fakten { margin: 0; padding-left: 1.1rem; display: grid; gap: .45rem; color: var(--text-muted); font-size: .9rem; line-height: 1.55; }
.ki-fakten strong { color: var(--text); }
.ki-einwilligung .schalter a { color: var(--accent); }
.ki-hinweis { margin: 0; font-size: .84rem; color: var(--warn); }
.ki-verlauf { display: grid; gap: .8rem; }
.ki-verlauf:empty { display: none; }
.ki-beitrag { display: grid; gap: .35rem; padding: .85rem 1.05rem; border-radius: var(--radius-md); border: 1px solid var(--border-hover); max-width: 85ch; }
.ki-beitrag--nutzer { justify-self: end; background: var(--accent-dim); border-color: rgba(52,211,153,.35); }
.ki-beitrag--ki { background: rgba(0,0,0,.28); }
.ki-beitrag__wer { margin: 0; font-size: .74rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--text-dim); }
.ki-beitrag__text { display: grid; gap: .55rem; color: var(--text); font-size: .94rem; line-height: 1.6; }
.ki-beitrag__text p, .ki-beitrag__text ul, .ki-beitrag__text ol { margin: 0; }
.ki-beitrag__text ul, .ki-beitrag__text ol { padding-left: 1.2rem; display: grid; gap: .3rem; }
.ki-titel { font-weight: 700; }
.ki-warten { color: var(--text-dim); font-style: italic; }
.ki-beitrag--laedt .ki-warten { animation: ki-puls 1.4s ease-in-out infinite; }
@keyframes ki-puls { 50% { opacity: .45; } }
.ki-grundlage { margin: .2rem 0 0; font-size: .78rem; color: var(--text-dim); }
.ki-grundlage a { color: var(--text-muted); }
.ki-vorschlaege { display: flex; flex-wrap: wrap; gap: .45rem; }
.ki-vorschlag { padding: .45rem .9rem; min-height: 38px; border-radius: 99px; border: 1px solid var(--border-hover); background: transparent; color: var(--text-muted); font-size: .84rem; box-shadow: none; }
.ki-vorschlag::after { display: none; }
.ki-vorschlag:hover { color: var(--accent); border-color: var(--accent); transform: none; }
.ki-eingabe { display: grid; gap: .6rem; }
.ki-eingabe textarea { min-height: 70px; font-family: var(--font-display); font-size: .95rem; }
@media (prefers-reduced-motion: reduce) { .ki-beitrag--laedt .ki-warten { animation: none; } }
@media print { .tabbar, #panel-ki { display: none !important; } }
