/* =====================================================================
   Magen-OP Gesundheitsdaten – Stylesheet
   Gleiche Gestaltung wie magen-op.com: Klinikrot, das blasse Kreuz der
   Karte, zweisprachige Beschriftung und DIN-Schrift wie auf Dokumenten.
   Schriften kommen aus dem Betriebssystem – keine externen Webfonts.
   ===================================================================== */

/* ---------- Tokens ---------- */
:root {
    --rot: #b4141b;
    --rot-tief: #8f0f15;
    --rot-zart: #f8dcdd;
    --rot-hauch: #fdf2f2;
    --band: #b4141b;
    --tinte: #1c2632;
    --tinte-2: #3a4551;
    --grau: #5b6570;
    --linie: #d6dbe1;
    --linie-zart: #e7eaee;
    --papier: #f2f3f5;
    --flaeche: #ffffff;
    --auf-rot: #ffffff;
    --gruen: #1b7447;
    --gruen-zart: #e2f2e9;
    --bernstein: #86520a;
    --bernstein-zart: #fbeed8;
    --fokus: #b4141b;

    --font-display: "DIN Condensed", "DIN Alternate", "Bahnschrift SemiCondensed", "Bahnschrift", "Roboto Condensed",
        "Arial Narrow", "DejaVu Sans Condensed", sans-serif-condensed, sans-serif;
    --font-text: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;

    --step--1: 0.875rem;
    --step-0: 1.0625rem;
    --step-1: 1.3125rem;
    --step-2: 1.625rem;
    --step-3: 2.0625rem;
    --step-4: clamp(2.2rem, 4.4vw, 2.75rem);
    --step-5: clamp(2.5rem, 6.2vw, 4.2rem);

    --radius: 6px;
    --radius-gross: 10px;
    --schatten-objekt: 0 1px 2px rgba(28, 38, 50, .10), 0 18px 36px -14px rgba(28, 38, 50, .38);
    --schatten-leise: 0 1px 2px rgba(28, 38, 50, .06), 0 6px 16px -10px rgba(28, 38, 50, .25);

    --gutter: clamp(16px, 4vw, 40px);

    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --rot: #ea4a50;
        --rot-tief: #ff7076;
        --rot-zart: #3a1f24;
        --rot-hauch: #2a1a1e;
        --band: #9d1218;
        --tinte: #e9edf1;
        --tinte-2: #c9d0d7;
        --grau: #9aa5b0;
        --linie: #34404c;
        --linie-zart: #29333d;
        --papier: #151b22;
        --flaeche: #1c242d;
        --gruen: #5fc792;
        --gruen-zart: #173327;
        --bernstein: #f0b45a;
        --bernstein-zart: #352914;
        --fokus: #ff8a8f;
        --schatten-objekt: 0 1px 2px rgba(0, 0, 0, .4), 0 18px 36px -14px rgba(0, 0, 0, .7);
        --schatten-leise: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 16px -10px rgba(0, 0, 0, .6);
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --rot: #ea4a50;
    --rot-tief: #ff7076;
    --rot-zart: #3a1f24;
    --rot-hauch: #2a1a1e;
    --band: #9d1218;
    --tinte: #e9edf1;
    --tinte-2: #c9d0d7;
    --grau: #9aa5b0;
    --linie: #34404c;
    --linie-zart: #29333d;
    --papier: #151b22;
    --flaeche: #1c242d;
    --gruen: #5fc792;
    --gruen-zart: #173327;
    --bernstein: #f0b45a;
    --bernstein-zart: #352914;
    --fokus: #ff8a8f;
    --schatten-objekt: 0 1px 2px rgba(0, 0, 0, .4), 0 18px 36px -14px rgba(0, 0, 0, .7);
    --schatten-leise: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 16px -10px rgba(0, 0, 0, .6);
    color-scheme: dark;
}

/* ---------- Grundlagen ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
    margin: 0;
    font-family: var(--font-text);
    font-size: var(--step-0);
    line-height: 1.6;
    color: var(--tinte);
    background: var(--flaeche);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}
body.is-portal { background: var(--papier); }

.site-main { flex: 1; }

img { max-width: 100%; height: auto; display: block; }

a { color: var(--rot); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--rot-tief); text-decoration-thickness: 2px; }

h1, h2, h3, h4 {
    overflow-wrap: break-word;
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: .005em;
    margin: 0 0 .5em;
    color: var(--tinte);
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }

p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.25em; }
address { font-style: normal; }
code { font-size: .9em; background: var(--papier); padding: .1em .35em; border-radius: 4px; }

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

.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.skip-link {
    position: absolute; left: 12px; top: -60px; z-index: 100;
    background: var(--tinte); color: var(--flaeche); padding: .6em 1em; border-radius: var(--radius);
}
.skip-link:focus { top: 12px; color: var(--flaeche); }

/* Volle Fensterbreite – nur der seitliche Rand bleibt */
.container { width: 100%; margin: 0; padding: 0 var(--gutter); }
.narrow { max-width: calc(46rem + 2 * var(--gutter)); }

.lead { font-size: var(--step-1); line-height: 1.5; color: var(--tinte-2); max-width: 38em; }
.muted { color: var(--grau); }
.small { font-size: var(--step--1); }
.nowrap { white-space: nowrap; }
.pre-line { white-space: pre-line; }
.num { font-variant-numeric: tabular-nums; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.spaced { margin-top: 1.25rem; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5em;
    min-height: 48px; padding: .7em 1.25em;
    font: inherit; font-weight: 650; line-height: 1.2;
    border-radius: var(--radius); border: 2px solid transparent;
    text-decoration: none; cursor: pointer; text-align: center;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--rot); color: var(--auf-rot); }
.btn-primary:hover { background: var(--rot-tief); color: var(--auf-rot); }
:root[data-theme="dark"] .btn-primary:hover { background: #c7343a; }
.btn-secondary { background: transparent; color: var(--tinte); border-color: var(--linie); }
.btn-secondary:hover { border-color: var(--tinte); color: var(--tinte); }
.btn-ghost { background: transparent; color: var(--rot); padding-inline: .2em; min-height: auto; }
.btn-ghost:hover { color: var(--rot-tief); text-decoration: underline; }
.btn-danger { background: transparent; color: var(--rot); border-color: var(--rot); }
.btn-danger:hover { background: var(--rot); color: var(--auf-rot); }
.btn-small { min-height: 38px; padding: .45em .9em; font-size: var(--step--1); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn svg { width: 1.15em; height: 1.15em; flex-shrink: 0; }

.link-button { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }
.button-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }

/* ---------- Kopfbereich ---------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: color-mix(in srgb, var(--flaeche) 94%, transparent);
    backdrop-filter: saturate(1.4) blur(10px);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--linie-zart);
}
.header-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 72px; }

.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--tinte); text-decoration: none; flex-shrink: 0; }
.brand:hover { color: var(--tinte); text-decoration: none; }
.brand-mark { width: 34px; height: 34px; color: var(--rot); flex-shrink: 0; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; line-height: 1; letter-spacing: .01em; padding-top: .08em; }
.brand-sub { color: var(--grau); font-weight: 600; }

.main-nav { display: flex; align-items: center; gap: 1.25rem; flex: 1; justify-content: flex-end; }
.main-nav ul { display: flex; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.main-nav ul a {
    display: block; padding: .5rem .7rem; color: var(--tinte-2); text-decoration: none; font-weight: 550; border-radius: var(--radius);
}
.main-nav ul a:hover { color: var(--tinte); background: var(--papier); }
.main-nav a[aria-current="page"] { color: var(--rot); box-shadow: inset 0 -2px 0 var(--rot); border-radius: 0; }
.nav-user { color: var(--grau); font-weight: 400; }
.nav-actions { display: flex; align-items: center; gap: .9rem; }
.nav-actions form { margin: 0; }
.nav-secondary { color: var(--tinte-2); font-weight: 550; text-decoration: none; }
.nav-secondary:hover { color: var(--rot); }

.theme-toggle {
    width: 40px; height: 40px; display: inline-grid; place-items: center; flex-shrink: 0;
    background: transparent; border: 1px solid var(--linie); border-radius: 50%; color: var(--tinte-2); cursor: pointer;
}
.theme-toggle:hover { border-color: var(--tinte-2); color: var(--tinte); }
.theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.theme-toggle .icon-moon { fill: currentColor; stroke: none; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
    :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: inline; }
}

.nav-toggle { display: none; }

/* Reiter des angemeldeten Bereichs */
.portal-tabs { display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: thin; }
.portal-tabs a {
    padding: .7rem .9rem; color: var(--tinte-2); text-decoration: none; font-weight: 600; white-space: nowrap;
    border-bottom: 3px solid transparent;
}
.portal-tabs a:first-child { padding-left: 0; }
.portal-tabs a:hover { color: var(--tinte); }
.portal-tabs a[aria-current="page"] { color: var(--rot); border-bottom-color: var(--rot); }

@media (max-width: 1020px) {
    .header-inner { justify-content: space-between; min-height: 64px; }
    .nav-toggle {
        display: inline-grid; place-items: center; width: 44px; height: 44px;
        background: transparent; border: 1px solid var(--linie); border-radius: var(--radius); cursor: pointer; color: var(--tinte);
    }
    .nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
        display: block; width: 20px; height: 2px; background: currentColor; position: relative; transition: transform .2s ease;
    }
    .nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
    .nav-toggle-bars::before { top: -6px; }
    .nav-toggle-bars::after { top: 6px; }
    .nav-open .nav-toggle-bars { background: transparent; }
    .nav-open .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
    .nav-open .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

    .main-nav {
        display: none; position: absolute; left: 0; right: 0; top: 64px;
        flex-direction: column; align-items: stretch; gap: 0;
        background: var(--flaeche); border-bottom: 1px solid var(--linie); padding: .5rem var(--gutter) 1.25rem;
        box-shadow: var(--schatten-leise);
    }
    .nav-open .main-nav { display: flex; }
    .main-nav ul { flex-direction: column; }
    .main-nav ul a { padding: .85rem 0; border-bottom: 1px solid var(--linie-zart); border-radius: 0; font-size: var(--step-1); }
    .main-nav a[aria-current="page"] { box-shadow: none; }
    .nav-actions { padding-top: 1rem; flex-wrap: wrap; }
    .nav-actions .btn, .nav-actions form { flex: 1; }
    .nav-actions form .btn { width: 100%; }
}
@media (max-width: 520px) {
    .brand-name { font-size: 1.4rem; }
    .brand-mark { width: 30px; height: 30px; }
}
@media (max-width: 400px) {
    .is-public .brand-sub { display: none; }
}

.demo-bar { background: var(--bernstein-zart); color: var(--tinte); border-bottom: 1px solid var(--linie); padding: .6rem 0; font-size: var(--step--1); }
.demo-bar a { color: inherit; font-weight: 650; }

/* ---------- Meldungen ---------- */
.notice {
    margin: 1.25rem 0; padding: .9rem 1.1rem; border-radius: var(--radius);
    border: 1px solid var(--linie); border-left-width: 4px; background: var(--flaeche);
}
.notice p:last-child, .notice ul:last-child { margin-bottom: 0; }
.notice ul { margin-top: .25em; }
.notice-error { border-color: var(--rot); background: var(--rot-hauch); }
.notice-success { border-color: var(--gruen); background: var(--gruen-zart); }
.notice-warn { border-color: var(--bernstein); background: var(--bernstein-zart); }
.notice-info { border-left-color: var(--tinte-2); background: var(--papier); }
.is-portal .notice-info { background: var(--flaeche); }
.flash-stack { padding-top: .5rem; }
.flash-stack .notice { margin-bottom: 0; }

/* ---------- Seitenkopf ---------- */
.page-head { padding: clamp(2rem, 5vw, 3.25rem) var(--gutter) clamp(1.25rem, 3vw, 2rem); }
.page-head h1 { font-size: var(--step-5); margin-bottom: .25em; }
.page-head .lead { margin-bottom: 0; }
.page-head-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem 2rem; }
.page-body { padding-bottom: clamp(3rem, 7vw, 5.5rem); }

.kicker {
    display: block; margin: 0 0 .6rem;
    font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--rot);
}

/* ---------- Karten / Panels ---------- */
.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 30rem), 1fr)); gap: 1.25rem; }
.panel { border: 1px solid var(--linie); border-radius: var(--radius-gross); padding: 1.4rem 1.5rem; background: var(--flaeche); min-width: 0; }
.panel-wide { grid-column: 1 / -1; }
.panel h2 { font-size: var(--step-2); margin-bottom: .75rem; }
.panel-accent { border-top: 5px solid var(--rot); }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .75rem; }
.panel-head h2 { margin: 0; }
.panel-head a { font-weight: 600; font-size: var(--step--1); white-space: nowrap; }
.panel > :last-child { margin-bottom: 0; }

.stack { display: grid; gap: 1.25rem; align-content: start; min-width: 0; }

/* Arbeitsbereich: Liste links, Formular rechts */
.workbench { display: grid; grid-template-columns: minmax(0, 1fr) minmax(18rem, 26rem); gap: 1.5rem; align-items: start; }
.workbench-side { position: sticky; top: 140px; }
@media (max-width: 960px) {
    .workbench { grid-template-columns: 1fr; }
    .workbench-side { position: static; }
}

.empty-state {
    padding: 2rem 1.5rem; text-align: center; border: 1px dashed var(--linie); border-radius: var(--radius-gross);
    color: var(--grau); background: var(--flaeche);
}
.empty-state p { margin: 0 auto .5rem; max-width: 30rem; }
.empty-state strong { display: block; color: var(--tinte); font-family: var(--font-display); font-size: var(--step-1); margin-bottom: .3rem; }

.data-list { margin: 0; }
.data-list div { display: grid; grid-template-columns: 11rem 1fr; gap: 1rem; padding: .55rem 0; border-top: 1px solid var(--linie-zart); }
.data-list div:first-child { border-top: 0; }
.data-list dt { color: var(--grau); }
.data-list dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { .data-list div { grid-template-columns: 1fr; gap: .1rem; } }

/* ---------- Zweisprachige Felder (wie auf der Karte) ---------- */
.field-sheet {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius-gross);
    border-top: 6px solid var(--rot);
}
.field-sheet > div { padding: 1.05rem 1.3rem 1.15rem; border-bottom: 1px solid var(--linie-zart); min-width: 0; }
.field-sheet > div:nth-child(odd) { border-right: 1px solid var(--linie-zart); }
.field-sheet > div:nth-last-child(-n+2) { border-bottom: 0; }
.field-sheet > div.full { grid-column: 1 / -1; border-right: 0; }
.field-sheet dt { font-family: var(--font-display); font-weight: 700; font-size: var(--step-1); line-height: 1.1; }
.field-sheet dt span { display: block; font-family: var(--font-text); font-weight: 400; font-size: var(--step--1); color: var(--grau); font-style: italic; margin-top: .15em; }
.field-sheet dd { margin: .5rem 0 0; color: var(--tinte); font-size: 1.02rem; line-height: 1.5; overflow-wrap: anywhere; }
.field-sheet dd.is-empty { color: var(--grau); font-style: italic; }
.field-sheet.flat { border-top-width: 1px; }
@media (max-width: 560px) {
    .field-sheet { grid-template-columns: 1fr; }
    .field-sheet > div:nth-child(odd) { border-right: 0; }
    .field-sheet > div:nth-last-child(2) { border-bottom: 1px solid var(--linie-zart); }
}

/* ---------- Ausweis (Übersicht) ---------- */
.ausweis { border: 1px solid var(--linie); border-radius: var(--radius-gross); background: var(--flaeche); overflow: hidden; box-shadow: var(--schatten-leise); }
.ausweis-band {
    display: flex; align-items: center; gap: .75rem; padding: .8rem 1.3rem; background: var(--band); color: #fff;
}
.ausweis-band svg { width: 26px; height: 26px; flex-shrink: 0; }
.ausweis-band strong { font-family: var(--font-display); font-size: 1.35rem; letter-spacing: .06em; text-transform: uppercase; line-height: 1; padding-top: .1em; }
.ausweis-band span { font-style: italic; opacity: .85; font-size: var(--step--1); }
.ausweis-band .kdnr { margin-left: auto; font-style: normal; font-variant-numeric: tabular-nums; opacity: .9; }
.ausweis-person { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 1.4rem; align-items: center; padding: 1.3rem; border-bottom: 1px solid var(--linie-zart); }
.ausweis-person h2 { font-size: var(--step-3); margin: 0 0 .2rem; }
.ausweis-person p { margin: 0; color: var(--tinte-2); }
.ausweis .field-sheet { border: 0; border-radius: 0; }
@media (max-width: 520px) {
    .ausweis-person { grid-template-columns: 5.5rem minmax(0, 1fr); gap: 1rem; }
    .ausweis-band .kdnr { display: none; }
}

.photo { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--linie); background: var(--papier); }
.photo-empty {
    width: 100%; aspect-ratio: 3 / 4; border-radius: var(--radius); border: 1px dashed var(--linie); background: var(--papier);
    display: grid; place-items: center; color: var(--grau); text-align: center; font-size: .8rem; padding: .5rem; line-height: 1.3;
}
.photo-empty svg { width: 42%; height: auto; opacity: .55; margin-bottom: .3rem; }

/* Checkliste */
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: grid; grid-template-columns: 1.5rem 1fr auto; gap: .6rem; align-items: center; padding: .55rem 0; border-top: 1px solid var(--linie-zart); }
.checklist li:first-child { border-top: 0; }
.checklist .dot { width: 1.25rem; height: 1.25rem; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 800; line-height: 1; }
.checklist .is-ok .dot { background: var(--gruen); color: #fff; }
.checklist .is-missing .dot { border: 2px solid var(--rot); }
.checklist .is-missing span:nth-child(2) { color: var(--tinte); font-weight: 600; }
.checklist a { font-size: var(--step--1); font-weight: 600; }

.progress-bar { height: 8px; border-radius: 999px; background: var(--linie-zart); overflow: hidden; margin: .25rem 0 1rem; }
.progress-bar span { display: block; height: 100%; background: var(--rot); border-radius: inherit; }
.progress-bar.is-complete span { background: var(--gruen); }

/* Kopierfeld */
.copy-field { display: flex; gap: .5rem; align-items: stretch; }
.copy-field input { flex: 1; min-width: 0; font-size: .9rem; color: var(--tinte-2); background: var(--papier); }
.copy-btn {
    font: inherit; font-size: .85rem; font-weight: 600; padding: .3rem .8rem; border-radius: var(--radius); cursor: pointer; white-space: nowrap;
    background: transparent; color: var(--tinte-2); border: 1px solid var(--linie);
}
.copy-btn:hover { border-color: var(--tinte-2); }
.copy-btn.is-copied { background: var(--gruen-zart); border-color: var(--gruen); color: var(--gruen); }

/* Kennzahlen */
.stat-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { padding: 1rem 1.15rem 1.1rem; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius-gross); min-width: 0; }
.stat-label { display: block; color: var(--grau); font-size: var(--step--1); font-weight: 600; }
.stat-value { display: block; font-family: var(--font-display); font-weight: 700; font-size: var(--step-4); line-height: 1; margin: .35rem 0 .3rem; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: .5em; font-weight: 700; margin-left: .15em; color: var(--tinte-2); }
.stat-note { display: block; font-size: var(--step--1); color: var(--tinte-2); }
.stat.is-good .stat-value { color: var(--gruen); }
.stat.is-alarm .stat-value { color: var(--rot); }
@media (max-width: 860px) { .stat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.trend { font-weight: 700; }
.trend-down { color: var(--gruen); }
.trend-up { color: var(--rot); }

/* ---------- Formulare ---------- */
fieldset { border: 0; padding: 0; margin: 0 0 1.75rem; min-width: 0; }
legend {
    display: flex; align-items: baseline; gap: .6rem; width: 100%;
    font-family: var(--font-display); font-weight: 700; font-size: var(--step-2); line-height: 1.1;
    padding: 0 0 .6rem; margin-bottom: 1.1rem; border-bottom: 2px solid var(--tinte);
}
.form-title { font-size: var(--step-2); margin-bottom: 1rem; }

.field { margin-bottom: 1.1rem; }
.field label, .field .label { display: block; font-weight: 650; margin-bottom: .35rem; }
.field .hint { display: block; color: var(--grau); font-size: var(--step--1); font-weight: 400; margin-top: .25rem; }
.field label .hint { margin-top: .1rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }
.optional { color: var(--grau); font-weight: 400; font-size: var(--step--1); }

input[type="text"], input[type="email"], input[type="tel"], input[type="date"], input[type="number"],
input[type="password"], input[type="search"], input[type="url"], select, textarea {
    width: 100%; min-height: 48px; padding: .65rem .8rem;
    font: inherit; color: var(--tinte); background: var(--flaeche);
    border: 1px solid var(--linie); border-radius: var(--radius);
    transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { min-height: 6.5rem; resize: vertical; line-height: 1.5; }
input:hover, select:hover, textarea:hover { border-color: var(--grau); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--rot); box-shadow: 0 0 0 3px var(--rot-zart); }
input[readonly] { background: var(--papier); color: var(--tinte-2); }
input[readonly]:hover { border-color: var(--linie); }
input[type="file"] { font: inherit; width: 100%; padding: .9rem; border: 1px dashed var(--linie); border-radius: var(--radius); background: var(--papier); }
input[aria-invalid="true"] { border-color: var(--rot); }

.check { display: flex; gap: .75rem; align-items: flex-start; margin-bottom: .9rem; cursor: pointer; }
.check input { width: 1.25rem; height: 1.25rem; margin: .2rem 0 0; accent-color: var(--rot); flex-shrink: 0; }

.input-unit { position: relative; }
.input-unit input { padding-right: 3rem; }
.input-unit span { position: absolute; right: .9rem; top: 50%; transform: translateY(-50%); color: var(--grau); pointer-events: none; }

.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Einnahme Morgens–Nachts */
.dose-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; }
.dose-grid label { font-weight: 600; font-size: var(--step--1); color: var(--tinte-2); margin-bottom: .25rem; text-align: center; }
.dose-grid input { text-align: center; font-variant-numeric: tabular-nums; font-size: 1.15rem; font-weight: 650; padding-inline: .3rem; }
.dose { display: inline-flex; gap: .2rem; font-variant-numeric: tabular-nums; }
.dose span {
    display: inline-grid; place-items: center; min-width: 1.8rem; height: 1.8rem; padding: 0 .3rem;
    border: 1px solid var(--linie); border-radius: 4px; font-weight: 650; font-size: .92rem; background: var(--flaeche);
}
.dose span.is-zero { color: var(--grau); font-weight: 400; border-style: dashed; }
.dose-legend { display: flex; gap: .2rem; font-size: .7rem; color: var(--grau); margin-top: .2rem; }
.dose-legend span { min-width: 1.8rem; text-align: center; padding: 0 .3rem; }

/* OP-Methoden als Auswahlkacheln */
.method-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .75rem; }
.method-choice {
    position: relative; display: flex; flex-direction: column; border: 2px solid var(--linie); border-radius: var(--radius-gross);
    background: var(--flaeche); cursor: pointer; overflow: hidden; transition: border-color .15s ease, background-color .15s ease;
}
.method-choice:hover { border-color: var(--grau); }
.method-choice:has(input:checked) { border-color: var(--rot); background: var(--rot-hauch); }
.method-choice:has(input:focus-visible) { outline: 3px solid var(--fokus); outline-offset: 2px; }
.method-choice input { position: absolute; top: .6rem; right: .6rem; width: 1.15rem; height: 1.15rem; margin: 0; accent-color: var(--rot); }
.method-choice img, .method-choice .method-noimg { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; padding: .45rem; background: var(--papier); border-bottom: 1px solid var(--linie-zart); }
.method-noimg { display: grid; place-items: center; color: var(--grau); }
.method-noimg svg { width: 40%; height: auto; opacity: .45; }
.method-choice .method-name { display: block; padding: .6rem .7rem .7rem; font-weight: 650; line-height: 1.25; font-size: .95rem; }
.method-choice .method-name small { display: block; font-weight: 400; color: var(--grau); font-style: italic; font-size: .78rem; margin-top: .15rem; }

.op-figure { margin: 0; border-radius: var(--radius-gross); overflow: hidden; border: 1px solid var(--linie); background: var(--papier); }
.op-figure img { width: 100%; max-height: 320px; object-fit: contain; padding: 1rem; }
.op-figure figcaption { padding: .55rem .8rem; font-size: var(--step--1); color: var(--grau); border-top: 1px solid var(--linie-zart); background: var(--flaeche); }

/* Profilbild-Bereich */
.photo-upload { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 1.25rem; align-items: start; }
@media (max-width: 480px) { .photo-upload { grid-template-columns: 5.5rem minmax(0, 1fr); gap: 1rem; } }

/* Gefahrenbereich */
.danger-zone { border-color: var(--rot); }
.danger-zone h2 { color: var(--rot); }

/* ---------- Anmeldung ---------- */
.auth-aside { max-width: 52rem; }
.auth-layout { display: grid; grid-template-columns: minmax(0, 30rem) minmax(0, 1fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; padding-top: clamp(2rem, 6vw, 4rem); padding-bottom: clamp(3rem, 7vw, 6rem); }
.auth-layout.single { grid-template-columns: minmax(0, 32rem); justify-content: center; }
@media (max-width: 900px) { .auth-layout { grid-template-columns: 1fr; } }
.login-card { padding: clamp(1.5rem, 4vw, 2.25rem); border: 1px solid var(--linie); border-top: 6px solid var(--rot); border-radius: var(--radius-gross); background: var(--flaeche); }
.login-card h1 { font-size: var(--step-4); margin-bottom: .3em; }
.login-card .btn-primary { width: 100%; margin-top: .25rem; }
.login-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; margin: 1.25rem 0 0; font-size: .95rem; }
.auth-aside h2 { font-size: var(--step-3); }
.auth-aside .lead { margin-bottom: 1.5rem; }
.feature-list { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: .1rem; }
.feature-list li { display: grid; grid-template-columns: 1.4rem 1fr; gap: .6rem; padding: .55rem 0; border-top: 1px solid var(--linie-zart); }
.feature-list li:first-child { border-top: 0; }
.feature-list li::before { content: ""; width: .7rem; height: .7rem; margin-top: .45rem; background: var(--rot); clip-path: polygon(35% 0, 65% 0, 65% 35%, 100% 35%, 100% 65%, 65% 65%, 65% 100%, 35% 100%, 35% 65%, 0 65%, 0 35%, 35% 35%); }
.feature-list strong { display: block; }
.feature-list span { color: var(--tinte-2); }

.credentials {
    display: grid; grid-template-columns: auto 1fr; gap: .35rem 1.25rem; margin: .75rem 0 1rem;
    padding: 1rem 1.25rem; background: var(--flaeche); border: 1px dashed var(--linie); border-radius: var(--radius);
    max-width: 24rem;
}
.credentials dt { color: var(--grau); }
.credentials dd { margin: 0; font-weight: 700; }

/* ---------- Tabellen ---------- */
.table-wrap { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius-gross); overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .97rem; }
.data-table th { text-align: left; font-size: var(--step--1); color: var(--grau); font-weight: 650; padding: .75rem 1rem; background: var(--papier); border-bottom: 1px solid var(--linie); white-space: nowrap; }
.data-table td { padding: .85rem 1rem; border-bottom: 1px solid var(--linie-zart); vertical-align: top; overflow-wrap: break-word; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .num { text-align: right; white-space: nowrap; }
.data-table tr.row-current > td { background: var(--rot-hauch); }
.data-table td.title-cell strong { display: block; }
.data-table .code { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }

.action-list { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem 1rem; }
.action-list form { margin: 0; }
.action-list a, .link-action {
    font: inherit; font-size: .92rem; color: var(--tinte-2); background: none; border: 0; padding: .15rem 0; cursor: pointer; text-decoration: none; font-weight: 600;
}
.action-list a:hover, .link-action:hover { color: var(--rot); text-decoration: underline; }
.link-action.danger { color: var(--rot); }
.action-col { width: 1%; white-space: nowrap; }

/* Tabellen schalten auf Karten um, sobald ihr eigener Kasten zu schmal ist –
   unabhängig von der Fensterbreite (z. B. neben dem Formular). */
.table-wrap, .panel { container-type: inline-size; }
@container (max-width: 640px) {
    .data-table.responsive thead { display: none; }
    .data-table.responsive, .data-table.responsive tbody, .data-table.responsive tr, .data-table.responsive td { display: block; width: 100%; }
    .data-table.responsive tr { border-bottom: 1px solid var(--linie); padding: .6rem 0; }
    .data-table.responsive tr:last-child { border-bottom: 0; }
    .data-table.responsive td { border: 0; padding: .35rem 1rem; }
    .data-table.responsive td[data-label]::before { content: attr(data-label); display: block; font-size: .78rem; color: var(--grau); font-weight: 650; margin-bottom: .1rem; }
    .data-table.responsive .num { text-align: left; }
    .data-table.responsive .action-col { width: auto; }
    .data-table.responsive .action-col .action-list { flex-direction: row; flex-wrap: wrap; gap: .35rem 1rem; }
    .panel .data-table.responsive td { padding-left: 0; padding-right: 0; }
    .data-table.responsive.compact tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 .6rem; padding: .5rem 0; }
    .data-table.responsive.compact td { padding: .3rem 0; }
    .data-table.responsive.compact td.action-col { grid-column: span 2; align-self: end; }
}
/* Ältere Browser ohne Container Queries: nach Fensterbreite */
@supports not (container-type: inline-size) {
    @media (max-width: 760px) {
        .data-table.responsive thead { display: none; }
        .data-table.responsive, .data-table.responsive tbody, .data-table.responsive tr, .data-table.responsive td { display: block; width: 100%; }
        .data-table.responsive tr { border-bottom: 1px solid var(--linie); padding: .6rem 0; }
        .data-table.responsive td { border: 0; padding: .35rem 1rem; }
        .data-table.responsive td[data-label]::before { content: attr(data-label); display: block; font-size: .78rem; color: var(--grau); font-weight: 650; }
        .data-table.responsive .num { text-align: left; }
        .data-table.responsive .action-col { width: auto; }
    }
}

/* ---------- Status-Pillen ---------- */
.pill {
    display: inline-block; padding: .2em .7em; border-radius: 999px; font-size: .82rem; font-weight: 650; line-height: 1.4;
    background: var(--papier); color: var(--tinte-2); border: 1px solid var(--linie); white-space: nowrap;
}
.pill-ok { background: var(--gruen-zart); color: var(--gruen); border-color: transparent; }
.pill-warn { background: var(--bernstein-zart); color: var(--bernstein); border-color: transparent; }
.pill-alarm { background: var(--rot-hauch); color: var(--rot); border-color: var(--rot-zart); }

/* ---------- Gewichtsverlauf: Diagramm ---------- */
.chart-panel { padding-bottom: 1rem; }
.chart-tools { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chips a {
    padding: .3rem .8rem; border: 1px solid var(--linie); border-radius: 999px; color: var(--tinte-2); text-decoration: none; font-size: .88rem; font-weight: 600;
}
.chips a:hover { border-color: var(--tinte-2); color: var(--tinte); }
.chips a[aria-current="true"] { background: var(--rot); border-color: var(--rot); color: var(--auf-rot); }
.chart-legend { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; font-size: .85rem; color: var(--grau); }
.chart-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.chart-legend i { display: inline-block; width: 18px; height: 0; border-top: 3px solid var(--rot); }
.chart-legend i.ziel { border-top: 2px dashed var(--gruen); }
.chart-legend i.start { border-top: 2px dotted var(--grau); }

.chart-figure { position: relative; margin: 0; }
.chart-figure svg { width: 100%; height: auto; display: block; overflow: visible; touch-action: pan-y; }
.chart-grid line { stroke: var(--linie-zart); stroke-width: 1; }
.chart-axis text { fill: var(--grau); font-size: 12px; font-family: var(--font-text); }
.chart-axis .bmi-label { fill: var(--grau); font-style: italic; }
.chart-area { fill: var(--rot); opacity: .08; }
.chart-line { fill: none; stroke: var(--rot); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart-point { fill: var(--flaeche); stroke: var(--rot); stroke-width: 2; }
.chart-ziel { stroke: var(--gruen); stroke-width: 1.6; stroke-dasharray: 6 5; }
.chart-ziel-text { fill: var(--gruen); font-size: 12px; font-weight: 700; font-family: var(--font-text); }
.chart-start { stroke: var(--grau); stroke-width: 1.4; stroke-dasharray: 2 4; }
.chart-start-text { fill: var(--grau); font-size: 12px; font-family: var(--font-text); }
.chart-cursor { stroke: var(--tinte-2); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-focus { fill: var(--rot); stroke: var(--flaeche); stroke-width: 2; }
.chart-tip {
    position: absolute; pointer-events: none; transform: translate(-50%, calc(-100% - 12px));
    background: var(--tinte); color: var(--flaeche); padding: .45rem .7rem; border-radius: var(--radius);
    font-size: .85rem; line-height: 1.35; white-space: nowrap; box-shadow: var(--schatten-leise);
}
.chart-tip strong { display: block; font-family: var(--font-display); font-size: 1.2rem; }
.chart-empty { padding: 3rem 1rem; text-align: center; color: var(--grau); }

/* ---------- Notfallseite ---------- */
.is-notfall { background: var(--papier); }
.notfall-header .header-inner { min-height: 64px; }
.lang-switch { display: inline-flex; border: 1px solid var(--linie); border-radius: 999px; padding: 3px; background: var(--flaeche); margin-left: auto; }
.lang-switch a { padding: .3rem .8rem; border-radius: 999px; text-decoration: none; color: var(--tinte-2); font-weight: 650; font-size: .9rem; }
.lang-switch a[aria-current="true"] { background: var(--tinte); color: var(--flaeche); }
.notfall-header .theme-toggle { margin-left: .5rem; }

.notfall-band { background: var(--band); color: #fff; padding: clamp(1.75rem, 5vw, 3rem) 0 clamp(1.75rem, 5vw, 3rem); position: relative; overflow: hidden; }
.notfall-band::after {
    content: ""; position: absolute; right: -40px; top: 50%; width: 260px; height: 260px; transform: translateY(-50%); opacity: .12; pointer-events: none;
    background:
        linear-gradient(#fff, #fff) center / 34% 100% no-repeat,
        linear-gradient(#fff, #fff) center / 100% 34% no-repeat;
}
.notfall-band .kicker { color: #fff; opacity: .9; }
.notfall-band h1 { color: #fff; font-size: var(--step-5); margin-bottom: .3em; max-width: 14em; }
.notfall-band p { color: rgba(255, 255, 255, .92); max-width: 40em; font-size: var(--step-1); line-height: 1.45; margin-bottom: 1.25rem; }
.btn-call { background: #fff; color: #8f0f15; font-size: 1.1rem; }
.btn-call:hover { background: #fde9ea; color: #8f0f15; }
.notfall-body { padding: clamp(1.5rem, 4vw, 2.5rem) var(--gutter) clamp(3rem, 6vw, 4.5rem); }
.notfall-grid { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.notfall-person { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius-gross); padding: 1rem; }
.notfall-person .photo, .notfall-person .photo-empty { margin-bottom: .9rem; }
.notfall-person dl { margin: 0; }
.notfall-person dt { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.notfall-person dt span { font-family: var(--font-text); font-weight: 400; font-style: italic; color: var(--grau); font-size: .8rem; margin-left: .3rem; }
.notfall-person dd { margin: 0 0 .7rem; font-size: 1.15rem; font-weight: 650; overflow-wrap: anywhere; }
.notfall-person dd:last-child { margin-bottom: 0; }
.method-big { font-family: var(--font-display); font-size: var(--step-3) !important; font-weight: 700; line-height: 1.05; }
.method-big small { display: block; font-family: var(--font-text); font-size: var(--step--1); font-weight: 400; color: var(--grau); font-style: italic; margin-top: .3rem; }
.tel-link { font-weight: 700; font-size: 1.15rem; white-space: nowrap; }
.doc-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 1rem; margin-top: 1.5rem; }
.doc-link {
    display: grid; grid-template-columns: 2.6rem 1fr; gap: .9rem; align-items: center; padding: 1rem 1.1rem;
    background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius-gross); text-decoration: none; color: var(--tinte);
}
.doc-link:hover { border-color: var(--rot); color: var(--tinte); }
.doc-link svg { width: 2.6rem; height: 2.6rem; color: var(--rot); }
.doc-link strong { display: block; font-family: var(--font-display); font-size: var(--step-1); line-height: 1.1; }
.doc-link span { color: var(--grau); font-size: var(--step--1); line-height: 1.35; display: block; margin-top: .2rem; }
.notfall-cta { border-top: 1px solid var(--linie); background: var(--flaeche); padding: clamp(2rem, 5vw, 3rem) 0; }
.notfall-cta-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 2rem; align-items: center; }
.notfall-cta h2 { font-size: var(--step-3); }
.notfall-cta p { color: var(--tinte-2); margin-bottom: 1rem; }
@media (max-width: 760px) {
    .notfall-grid { grid-template-columns: 1fr; }
    .notfall-person { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 1rem; align-items: start; }
    .notfall-person .photo, .notfall-person .photo-empty { margin-bottom: 0; }
    .doc-links { grid-template-columns: 1fr; }
    .notfall-cta-grid { grid-template-columns: 1fr; }
    .notfall-band::after { display: none; }
}

/* ---------- Admin ---------- */
.counters { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.5rem; }
.counter { display: flex; align-items: baseline; gap: .5rem; padding: .55rem .9rem; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); }
.counter strong { font-family: var(--font-display); font-size: var(--step-2); line-height: 1; }
.counter span { color: var(--grau); font-size: var(--step--1); }
.filter-bar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; margin-bottom: 1rem; }
.filter-bar .field { margin: 0; flex: 1 1 16rem; }
.secret {
    display: inline-block; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 1.25rem; font-weight: 700;
    letter-spacing: .06em; padding: .3rem .7rem; background: var(--flaeche); border: 1px dashed var(--linie); border-radius: var(--radius);
}
.admin-edit-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem; align-items: center; }

/* ---------- Fußbereich ---------- */
.site-footer { background: #18212b; color: #c8d0d8; margin-top: auto; }
.site-footer a { color: #e8ecf0; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.4fr; gap: 2rem; padding-top: 3.5rem; padding-bottom: 2.5rem; }
.site-footer h2 { font-family: var(--font-text); font-size: var(--step--1); font-weight: 700; color: #fff; margin-bottom: .9rem; letter-spacing: .02em; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .45rem; }
.footer-brand p { max-width: 20rem; margin-top: 1rem; }
.brand-footer, .brand-footer:hover { color: #fff; }
.brand-footer .brand-mark { color: #e0383f; }
.footer-bottom { position: relative; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding-top: 1.25rem; padding-bottom: 1.5rem; font-size: var(--step--1); }
.footer-bottom::before { content: ""; position: absolute; top: 0; left: var(--gutter); right: var(--gutter); border-top: 1px solid #2d3945; }
.footer-grid + .footer-bottom { margin-top: 0; }
.footer-bottom p { margin: 0; }
.footer-legal { display: flex; gap: 1.25rem; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Druck ---------- */
@media print {
    .site-header, .site-footer, .nav-toggle, .btn, .portal-tabs, .demo-bar, .chips, form { display: none !important; }
    body, body.is-portal { background: #fff; color: #000; }
    .panel, .stat, .ausweis { break-inside: avoid; }
}

/* Ergänzungen */
.dose-note { display: block; margin-top: .3rem; font-size: var(--step--1); color: var(--grau); }
.chart-mobile, .chart-wide { display: none; }
@media (max-width: 640px) {
    .chart-desktop { display: none; }
    .chart-mobile { display: block; }
}
@media (min-width: 1500px) {
    .chart-desktop { display: none; }
    .chart-wide { display: block; }
}
.kicker svg { display: inline-block; width: 1em; height: 1em; vertical-align: -.12em; margin-right: .35em; }
.optional { font-family: var(--font-text); }
legend .optional { margin-left: auto; text-align: right; }
.field-sheet > div.full:not(:last-child) { border-bottom: 1px solid var(--linie-zart); }
.doc-link > span { color: inherit; display: block; margin: 0; font-size: inherit; }
.doc-link > span > span { color: var(--grau); font-size: var(--step--1); }
.notfall-person dt span { display: block; margin: .05rem 0 .1rem; }
.lang-short { display: none; }
.brand { min-width: 0; }
@media (max-width: 600px) {
    .brand-name .brand-sub { display: block; font-family: var(--font-text); font-size: .5em; letter-spacing: 0; margin-top: .15em; }
    .is-portal .brand-name { line-height: .95; }
}
@media (max-width: 440px) {
    .lang-long { display: none; }
    .lang-short { display: inline; }
    .notfall-header .header-inner { gap: .75rem; }
}
.field-sheet dd.method-big { line-height: 1.05; }
@media (max-width: 520px) {
    .ausweis-person h2 { font-size: var(--step-2); }
    .btn-call { width: 100%; }
    .panel { padding: 1.15rem 1.1rem; }
    .panel .data-table th, .panel .data-table td { padding-left: .6rem; padding-right: .6rem; }
}
.action-col .action-list { flex-direction: column; align-items: flex-start; gap: .15rem; }
.compact .action-col .action-list { flex-direction: row; flex-wrap: nowrap; gap: .35rem 1rem; }

.method-choice .method-name { overflow-wrap: anywhere; }

/* Schmale Fenster: nichts darf über den Rand ragen */
.page-head-row > div { min-width: 0; }
.page-head h1, .ausweis-person h2, .panel h2, .login-card h1, .notfall-band h1 { hyphens: auto; overflow-wrap: break-word; }
.panel-head { flex-wrap: wrap; }
.panel-head h2 { min-width: 0; }
legend { flex-wrap: wrap; }
.doc-link > span { min-width: 0; overflow-wrap: break-word; hyphens: auto; }
@media (max-width: 480px) {
    .page-head h1 { font-size: clamp(2rem, 10vw, 2.5rem); }
    .stat-value { font-size: 1.65rem; }
}
@media (max-width: 360px) {
    .notfall-header .brand-name { font-size: 1.25rem; }
    .notfall-header .header-inner { gap: .5rem; }
    .notfall-header .theme-toggle { margin-left: 0; }
    .lang-switch a { padding: .3rem .55rem; }
}

/* Bildnachweis (Pflichtangabe der Lizenz CC BY-SA 4.0) */
.bildnachweis { display: block; margin: .6rem 0 0; font-size: .78rem; line-height: 1.45; color: var(--grau); }
.bildnachweis a { color: inherit; }
.op-figure .bildnachweis { margin-top: .35rem; }
