/* HealthHub (App 2. Version, Paket P9): Befunde, Detailseite je Blutwert, Tracker, Übersicht.
   Vorlage Prototyp befunde.py (Website-Befundkarte). Nur Tokens, Dunkelmodus über dieselben
   Selektoren wie app.css. Rot nur für Werte außerhalb des Referenzbereichs. */
:root {
  --bw-ref:#E6E9F0; --bw-spur:#F2F4F7; --bw-opt:#6FCE78; --bw-kicker:#B0304A;
  --bw-rot:#E0303A; --bw-rot-t:#C41C1C; --bw-rot-100:#FDE9E9;
  --bw-gelb:#F0A93B; --bw-gelb-t:#8F5600; --bw-gelb-100:#FEF3DF;
  --bw-gruen:#3F7E44; --bw-gruen-t:#3F7E44; --bw-gruen-100:#E9F5EA;
  --bw-grau:#8A91A3;
  /* Themenverlauf Blutwerte (Bordeaux), Fahrplan, Gene: in beiden Modi gleich (weiße Schrift). */
  --bw-verlauf:linear-gradient(140deg,#5E1233,#C2394E);
  --hh-fahrplan:linear-gradient(140deg,#2F3C99,#62C3DC);
  --hh-gene:linear-gradient(140deg,#261A68,#7454C9);
}
html[data-theme="dark"] {
  --bw-ref:#343C70; --bw-spur:#1F2650; --bw-kicker:#F08AA0;
  --bw-rot:#FF6B6B; --bw-rot-t:#FF9A9A; --bw-rot-100:rgba(255,107,107,.16);
  --bw-gelb:#F5B54E; --bw-gelb-t:#F5C26B; --bw-gelb-100:rgba(245,181,78,.16);
  --bw-gruen:#6FCE78; --bw-gruen-t:#8EDB95; --bw-gruen-100:rgba(111,206,120,.16);
  --bw-grau:#7C83A3;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --bw-ref:#343C70; --bw-spur:#1F2650; --bw-kicker:#F08AA0;
    --bw-rot:#FF6B6B; --bw-rot-t:#FF9A9A; --bw-rot-100:rgba(255,107,107,.16);
    --bw-gelb:#F5B54E; --bw-gelb-t:#F5C26B; --bw-gelb-100:rgba(245,181,78,.16);
    --bw-gruen:#6FCE78; --bw-gruen-t:#8EDB95; --bw-gruen-100:rgba(111,206,120,.16);
    --bw-grau:#7C83A3;
  }
}

/* ---- Übersicht: Blut- und Genkarte, nächster Schritt am Ring ---- */
.v1-hubcard__zahl:empty { display:none; }
.hh-next { font-size:10.5px; font-weight:800; color:#fff; background:rgba(255,255,255,.2); border-radius:10px; padding:3px 8px; }
.hh-next[hidden] { display:none; }
.hh-weg { display:flex; flex-direction:column; gap:10px; margin-top:4px; }
.hh-weg[hidden] { display:none; }
.hh-schritt { display:flex; align-items:center; gap:12px; }
.hh-schritt > span:last-child { min-width:0; }
.hh-schritt b { display:block; font-size:14px; font-weight:800; color:var(--navy); }
.hh-schritt small { display:block; font-size:12px; font-weight:600; color:var(--muted); }
.hh-schritt__p { width:30px; height:30px; border-radius:50%; flex:none; display:grid; place-items:center; font-size:13px; font-weight:900;
  background:var(--card2); color:var(--muted); }
.hh-schritt__p .hji { width:16px; height:16px; }
.hh-schritt--jetzt .hh-schritt__p { background:var(--bw-verlauf); color:#fff; }
.hh-schritt--fertig .hh-schritt__p { background:var(--bw-gruen-100); color:var(--bw-gruen-t); }
.hh-schritt--offen b { color:var(--muted); }
.hh-knopf { align-self:flex-start; margin-top:4px; min-height:44px; display:inline-flex; align-items:center; gap:8px; border:0; color:#fff; }
.hh-knopf[hidden] { display:none; }
.hh-knopf .hji { width:18px; height:18px; }
.hh-knopf--blut { background:var(--bw-verlauf); }
.hh-knopf--gen { background:var(--hh-gene); }
.v1-hubcard__link[hidden] { display:none; }
.v1-hubcard__text[hidden] { display:none; }

/* ---- Vorschau-Karten (Vorlagen von der Website) ---- */
.hh-vorschau { position:relative; margin-top:12px; opacity:.92; pointer-events:none; }
.hh-vorschau[hidden] { display:none; }
.hh-vorschau__tag { position:absolute; top:12px; right:14px; z-index:1; font-size:11px; font-weight:800; letter-spacing:.06em;
  text-transform:uppercase; color:var(--muted); background:var(--card2); border-radius:10px; padding:4px 9px; }
.hh-vorschau > .bw-karte, .hh-vorschau > .bw-dkarte { margin-top:0; }
.hh-kicker { font-size:12px; font-weight:800; letter-spacing:.1em; text-transform:uppercase; color:var(--muted-2); }
.hh-bio { border-radius:24px; padding:18px; }
.hh-bio__kopf { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:flex-end; gap:6px 12px; margin-bottom:14px; padding-right:80px; }
.hh-bio__kopf b { display:block; white-space:nowrap; font-size:20px; font-weight:900; color:var(--navy); }
.hh-bio__quelle { display:flex; align-items:center; gap:6px; font-size:12px; font-weight:700; color:var(--muted); white-space:nowrap; }
.hh-bio__quelle i { width:8px; height:8px; border-radius:50%; background:var(--bw-opt); }
.hh-bio__zeile { display:grid; grid-template-columns:80px minmax(0,1fr) 54px; align-items:end; gap:10px; margin-top:10px; }
.hh-bio__zeile span { font-size:13px; font-weight:700; color:var(--muted); }
.hh-bio__zeile b { font-size:13px; font-weight:800; color:var(--navy); text-align:right; }
.hh-bio__balken { display:flex; gap:5px; align-items:flex-end; height:34px; }
.hh-bio__balken i { flex:1; border-radius:4px; background:linear-gradient(180deg,#62C3DC,#2F3C99); }
.hh-bio__tage { display:grid; grid-template-columns:80px repeat(7,minmax(0,1fr)) 54px; gap:5px; margin-top:6px; font-size:10.5px;
  font-weight:700; color:var(--muted-2); text-align:center; }
.hh-bio__tage span:first-child { grid-column:2; }
.hh-tracker { cursor:default; }

/* ---- Befunde: Fokuskarte, Verteilung, Wertzeilen ---- */
.bw-karte { background:var(--card); border:1px solid var(--line); border-radius:28px; padding:22px 20px 18px; margin-top:12px; }
.bw-karte--fokus { margin-top:14px; box-shadow:var(--shadow-card); }
.bw-kopf { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.bw-kicker { font-size:12px; font-weight:800; letter-spacing:.1em; text-transform:uppercase; color:var(--bw-kicker); }
.bw-titel { font-size:24px; font-weight:900; color:var(--navy); letter-spacing:-.5px; margin-top:4px; line-height:1.1; }
.bw-legende { display:flex; flex-direction:column; gap:6px; font-size:11.5px; font-weight:700; color:var(--muted); flex:none; }
.bw-legende span, .bw-zahlen span { display:flex; align-items:center; gap:6px; white-space:nowrap; }
.bw-lg { width:18px; height:8px; border-radius:4px; background:var(--bw-ref); flex:none; display:inline-block; }
.bw-lg--opt { background:var(--bw-opt); }
.bw-vt { display:flex; gap:4px; height:12px; margin-top:18px; }
.bw-vt i { border-radius:6px; min-width:6px; }
.bw-vt i[style*="flex:0"] { display:none; }
.bw-vt .gruen { background:var(--bw-opt); } .bw-vt .gelb { background:var(--bw-gelb); } .bw-vt .rot { background:var(--bw-rot); }
.bw-vt-zahl { display:flex; gap:14px; flex-wrap:wrap; margin-top:8px; font-size:12.5px; font-weight:700; color:var(--muted); }
.bw-vt-zahl b { font-size:15px; font-weight:900; }
.bw-vt-zahl .gruen b { color:var(--bw-gruen-t); } .bw-vt-zahl .gelb b { color:var(--bw-gelb-t); } .bw-vt-zahl .rot b { color:var(--bw-rot-t); }
.bw-unter { font-size:12px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; color:var(--muted-2); margin:20px 0 2px; }
.bw-liste { display:flex; flex-direction:column; }
.bw { display:grid; grid-template-columns:minmax(86px,104px) minmax(0,1fr) auto; align-items:center; gap:12px;
  padding:14px 0 12px; border-top:1px solid var(--line-2); cursor:pointer; }
.bw[hidden] { display:none; }
.bw-karte:not(.bw-karte--fokus) .bw-liste .bw:first-child { border-top:0; }
.bw-name { min-width:0; }
.bw-name b { display:block; font-size:15px; font-weight:800; color:var(--navy); line-height:1.2; overflow-wrap:anywhere; }
.bw-name span { display:block; font-size:13px; font-weight:800; margin-top:3px; }
.bw-spur { position:relative; height:10px; border-radius:5px; background:var(--bw-spur); margin:5px 0; }
.bw-spur i { position:absolute; top:0; bottom:0; border-radius:5px; }
.bw-ref { background:var(--bw-ref); } .bw-opt { background:var(--bw-opt); }
.bw-spur .bw-mark { top:-6px; bottom:auto; width:22px; height:22px; margin-left:-11px; border-radius:50%;
  background:var(--card); border:5px solid currentColor; box-sizing:border-box; box-shadow:0 3px 8px rgba(16,21,95,.18); }
.bw-zahlen { display:flex; gap:10px; flex-wrap:wrap; margin-top:9px; font-size:11px; font-weight:700; color:var(--muted); font-variant-numeric:tabular-nums; }
.bw-zahlen .bw-lg { width:12px; height:6px; }
.bw-pille { font-size:12px; font-weight:800; padding:6px 10px; border-radius:12px; min-width:62px; text-align:center; }
.bw-pille--leer { min-width:0; padding:0; }
.bw--rot { color:var(--bw-rot); } .bw--rot .bw-name span, .bw--rot .bw-pille { color:var(--bw-rot-t); } .bw--rot .bw-pille { background:var(--bw-rot-100); }
.bw--gelb { color:var(--bw-gelb); } .bw--gelb .bw-name span, .bw--gelb .bw-pille { color:var(--bw-gelb-t); } .bw--gelb .bw-pille { background:var(--bw-gelb-100); }
.bw--gruen { color:var(--bw-gruen); } .bw--gruen .bw-name span, .bw--gruen .bw-pille { color:var(--bw-gruen-t); } .bw--gruen .bw-pille { background:var(--bw-gruen-100); }
.bw--grau { color:var(--bw-grau); } .bw--grau .bw-name span { color:var(--muted); }
@media (hover:hover) { .bw[data-bw-code]:hover .bw-name b { text-decoration:underline; text-underline-offset:3px; } }
.bw:focus-visible { outline:2px solid var(--navy); outline-offset:2px; border-radius:12px; }
/* Unter 380 px rückt die Spur unter Name und Pille. */
@media (max-width:380px) { .bw { grid-template-columns:minmax(0,1fr) auto; } .bw-mitte { grid-column:1 / -1; grid-row:2; } }
.bw-reiter { display:flex; gap:8px; overflow-x:auto; scrollbar-width:none; margin:0 -16px; padding:2px 16px 4px; }
.bw-reiter::-webkit-scrollbar { display:none; }
.bw-reiter button { flex:none; min-height:38px; padding:0 16px; border-radius:19px; border:1px solid var(--line); background:var(--card);
  color:var(--muted); font:inherit; font-size:14px; font-weight:800; white-space:nowrap; cursor:pointer; }
.bw-reiter button.on { background:var(--navy); border-color:var(--navy); color:var(--card); }
.bw-leer { margin:6px 0; font-size:14px; font-weight:700; color:var(--muted); }
.bw-leer[hidden] { display:none; }
.bw-video { display:flex; align-items:center; gap:14px; width:100%; margin-top:16px; padding:16px; border-radius:22px; background:var(--bw-spur); }
.bw-play { width:58px; height:26px; border-radius:13px; flex:none; display:grid; place-items:center; color:#fff; background:linear-gradient(90deg,#10155F,#3E6E98); }
.bw-play .hji { width:16px; height:16px; }
.bw-video b { display:block; font-size:15px; font-weight:800; color:var(--navy); }
.bw-video small { display:block; font-size:13px; font-weight:700; color:var(--muted); margin-top:2px; }

/* ---- Detailseite je Blutwert ---- */
[data-hj="bw-detail"] { display:flex; flex-direction:column; gap:12px; will-change:transform; touch-action:pan-y; }
.bw-dkopf { padding:16px 22px 26px; color:#fff; background:radial-gradient(120% 90% at 100% 0%,rgba(255,255,255,.16),transparent 60%),var(--bw-verlauf);
  border-radius:28px; }
.bw-dkopf .skel { background:rgba(255,255,255,.25); }
.bw-doben { display:flex; justify-content:flex-end; min-height:8px; margin-bottom:10px; }
.bw-blaettern { display:flex; align-items:center; gap:4px; background:rgba(255,255,255,.14); border-radius:20px; padding:3px; }
.bw-blaettern span { font-size:13px; font-weight:800; min-width:64px; text-align:center; font-variant-numeric:tabular-nums; }
.bw-blaettern button { width:34px; height:34px; border-radius:17px; border:0; background:rgba(255,255,255,.2); color:#fff; font:inherit;
  font-size:22px; line-height:1; cursor:pointer; padding-bottom:3px; }
.bw-blaettern button:disabled { opacity:.3; cursor:default; }
.bw-dkicker { font-size:12px; font-weight:800; letter-spacing:.1em; text-transform:uppercase; color:rgba(255,255,255,.75); }
.bw-dname { font-size:30px; font-weight:900; letter-spacing:-.6px; line-height:1.1; margin-top:4px; text-wrap:balance; overflow-wrap:anywhere; }
.bw-dwert { display:flex; align-items:baseline; gap:8px; flex-wrap:wrap; margin-top:14px; }
.bw-dwert b { font-size:46px; font-weight:900; letter-spacing:-1px; line-height:1; font-variant-numeric:tabular-nums; }
.bw-dwert span { font-size:16px; font-weight:800; color:rgba(255,255,255,.8); }
.bw-dpille { font-style:normal; font-size:13px; font-weight:900; padding:6px 12px; border-radius:14px; margin-left:auto; align-self:center; background:#fff; }
.bw-dpille--rot { color:#C41C1C; } .bw-dpille--gelb { color:#8F5600; } .bw-dpille--gruen { color:#3F7E44; } .bw-dpille--grau { color:#5A6275; }
.bw-ddatum { font-size:13px; font-weight:700; color:rgba(255,255,255,.75); margin-top:10px; }
.bw-dkarte { background:var(--card); border:1px solid var(--line); border-radius:24px; padding:18px; }
.bw-dkarte p { margin:6px 0 0; font-size:15px; line-height:1.55; color:var(--ink); }
.bw-dt { font-size:12px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; color:var(--muted-2); }
.bw-spur--gross { height:14px; border-radius:7px; margin:22px 0 18px; }
.bw-spur--gross i { border-radius:7px; }
.bw-spur--gross .bw-mark { width:30px; height:30px; margin-left:-15px; top:-8px; border-width:7px; }
.bw-dbereiche { display:flex; flex-direction:column; gap:10px; }
.bw-dbereiche div { display:flex; align-items:center; gap:10px; font-size:14px; font-weight:700; color:var(--muted); }
.bw-dbereiche b { margin-left:auto; color:var(--navy); font-weight:900; font-variant-numeric:tabular-nums; text-align:right; }
.bw-dbereiche b.leise { color:var(--muted-2); font-weight:700; }
.bw-kurve { display:block; width:100%; height:auto; margin-top:6px; overflow:visible; }
.bw-kurve .k-ref { fill:var(--bw-ref); opacity:.7; } .bw-kurve .k-opt { fill:var(--bw-opt); opacity:.45; }
.bw-kurve .k-hilf { stroke:var(--line); stroke-dasharray:2 4; }
.bw-kurve .k-tick { font-size:11px; font-weight:800; fill:var(--muted-2); text-anchor:start; font-variant-numeric:tabular-nums; }
.bw-kurve .k-datum { font-size:12px; font-weight:800; fill:var(--muted); text-anchor:middle; }
.bw-kurve .k-linie { fill:none; stroke:var(--navy); stroke-width:3; stroke-linejoin:round; stroke-linecap:round; opacity:.35; }
.bw-kurve .k-pkt { fill:var(--card); stroke-width:5; }
.bw-kurve .k-rot { stroke:var(--bw-rot); } .bw-kurve .k-gelb { stroke:var(--bw-gelb); } .bw-kurve .k-gruen { stroke:var(--bw-gruen); } .bw-kurve .k-grau { stroke:var(--bw-grau); }
.bw-kurve .k-wert { font-size:13px; font-weight:800; fill:var(--muted); text-anchor:middle; font-variant-numeric:tabular-nums; }
.bw-kurve .k-letzt { font-size:15px; font-weight:900; fill:var(--navy); }
.bw-dleise { font-size:13px !important; color:var(--muted) !important; }
.bw-dzeile { box-sizing:border-box; display:flex; align-items:center; gap:14px; width:100%; padding:14px 16px; border-radius:20px; border:1px solid var(--line);
  background:var(--card); font:inherit; text-align:left; color:inherit; cursor:pointer; }
.bw-dzeile > span:nth-child(2) { flex:1; min-width:0; }
.bw-dzeile small { display:block; font-size:12px; font-weight:800; color:var(--muted-2); text-transform:uppercase; letter-spacing:.06em; }
.bw-dzeile b { display:block; font-size:15px; font-weight:800; color:var(--navy); margin-top:2px; }
.bw-dzeile .chev { font-size:22px; color:var(--muted-2); }
.bw-dzic { width:36px; height:36px; border-radius:12px; flex:none; display:grid; place-items:center; color:var(--bw-kicker); background:var(--bw-rot-100); }
.bw-dzic .hji { width:18px; height:18px; }
.bw-dfrage { margin-top:4px; min-height:52px; border-radius:26px; border:0; font:inherit; font-size:15px; font-weight:800; color:#fff; cursor:pointer;
  background:var(--bw-verlauf); box-shadow:0 10px 24px rgba(194,57,78,.28); padding:0 18px; }
