/* Kenk.io – Design aus v1 (Datahub) übernommen: Dark first, Light per Toggle / OS. Ergänzungen für Kenk.io ganz unten. */
:root {
  color-scheme: dark;
  --page: #0b0b0b;
  --surface: #161615;
  --surface-2: #1d1d1c;
  --surface-3: #252524;
  --ink: #ffffff;
  --ink-2: #c3c2b7;
  --muted: #898781;
  --grid: #2c2c2a;
  --baseline: #383835;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --s1: #3987e5;           /* series blue */
  --s1-wash: rgba(57, 135, 229, 0.14);
  --s2: #d95926;           /* series orange */
  --deep: #9085e9;         /* Schlafphasen – validiert (CVD) */
  --rem: #199e70;
  --core: #3987e5;
  --awake: #d95926;
  --good: #0ca30c;
  --good-text: #3ccf3c;
  --bad: #e66767;
  --warn: #fab219;
  --warn-text: #fab219;
  --glow-a: rgba(57, 135, 229, 0.20);
  --glow-b: rgba(144, 133, 233, 0.14);
  --shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 12px 32px -18px rgba(0,0,0,0.8);
  --radius: 18px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: light) {
  :root:where(:not([data-theme="dark"])) {
    color-scheme: light;
    --page: #f4f4f1; --surface: #fcfcfb; --surface-2: #f5f5f2; --surface-3: #ecebe6;
    --ink: #0b0b0b; --ink-2: #52514e; --muted: #7a7873; --grid: #e7e6e0; --baseline: #c3c2b7;
    --border: rgba(11,11,11,0.08); --border-strong: rgba(11,11,11,0.14);
    --s1: #2a78d6; --s1-wash: rgba(42,120,214,0.10); --s2: #eb6834;
    --deep: #4a3aa7; --rem: #1baf7a; --core: #2a78d6; --awake: #eb6834;
    --good-text: #006300; --bad: #d03b3b; --warn-text: #8a5a00;
    --glow-a: rgba(42,120,214,0.12); --glow-b: rgba(74,58,167,0.08);
    --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 12px 32px -20px rgba(0,0,0,0.25);
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --page: #f4f4f1; --surface: #fcfcfb; --surface-2: #f5f5f2; --surface-3: #ecebe6;
  --ink: #0b0b0b; --ink-2: #52514e; --muted: #7a7873; --grid: #e7e6e0; --baseline: #c3c2b7;
  --border: rgba(11,11,11,0.08); --border-strong: rgba(11,11,11,0.14);
  --s1: #2a78d6; --s1-wash: rgba(42,120,214,0.10); --s2: #eb6834;
  --deep: #4a3aa7; --rem: #1baf7a; --core: #2a78d6; --awake: #eb6834;
  --good-text: #006300; --bad: #d03b3b; --warn-text: #8a5a00;
  --glow-a: rgba(42,120,214,0.12); --glow-b: rgba(74,58,167,0.08);
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 12px 32px -20px rgba(0,0,0,0.25);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  background: var(--page);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto 0; height: 520px; pointer-events: none; z-index: 0;
  background:
    radial-gradient(600px 300px at 18% -60px, var(--glow-a), transparent 70%),
    radial-gradient(520px 280px at 78% -80px, var(--glow-b), transparent 70%);
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--s1); text-decoration: none; }

/* ---------- Layout ---------- */
.shell { position: relative; z-index: 1; display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 22px 14px; display: flex; flex-direction: column; gap: 4px;
  border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--page) 70%, transparent);
  backdrop-filter: blur(20px);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; font-weight: 650; font-size: 16px; letter-spacing: -0.01em; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--s1), var(--deep)); color: #fff;
  box-shadow: 0 6px 18px -6px var(--s1);
}
.brand small { display: block; font-weight: 450; font-size: 11.5px; color: var(--muted); letter-spacing: 0; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--ink-2);
  cursor: pointer; border: 0; background: none; width: 100%; text-align: left; font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-item svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { background: var(--surface-3); color: var(--ink); }
.nav-item .pill { margin-left: auto; }
.nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 18px 12px 6px; }
.sidebar-foot { margin-top: auto; padding: 10px 12px; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 10px; }

main { padding: 28px 36px 60px; max-width: 2000px; width: 100%; min-width: 0; }
main:has(.cal-wrap) { max-width: none; }  /* Kalender: volle Breite */
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.topbar h1 { font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: -0.025em; margin: 0; }
.topbar .sub { color: var(--muted); margin-top: 4px; }
.controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border); }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; cursor: pointer; color: var(--ink-2); font-weight: 550; font-size: 13px; }
.seg button.on { background: var(--surface-3); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; display: grid; place-items: center; color: var(--ink-2); }
.icon-btn:hover { color: var(--ink); border-color: var(--border-strong); }
.icon-btn svg { width: 17px; height: 17px; }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 16px; }
.g-kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); min-width: 0; position: relative;
}
.card h3 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: -0.005em; }
.card .card-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.section-title { font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 30px 0 12px; display: flex; align-items: center; gap: 8px; }

/* Stat tile */
.tile { cursor: pointer; transition: transform .18s ease, border-color .18s; }
.tile:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.tile .label { color: var(--ink-2); font-size: 12.5px; font-weight: 500; }
.tile .value { font-family: var(--font-display); font-size: 28px; font-weight: 650; letter-spacing: -0.03em; margin-top: 6px; line-height: 1.1; }
.tile .value .u { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.tile .meta { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; font-size: 12px; color: var(--muted); gap: 6px; }
.tile .spark { margin-top: 10px; height: 38px; }
.delta { font-weight: 600; font-size: 12px; white-space: nowrap; }
.delta.good { color: var(--good-text); }
.delta.bad { color: var(--bad); }
.delta.flat { color: var(--muted); }

/* Hero */
.stagebar { display: flex; gap: 2px; height: 14px; margin-top: 22px; }
.stagebar div { border-radius: 4px; min-width: 3px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--ink-2); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend i.line { height: 2px; width: 14px; border-radius: 2px; }

/* Panel-Kopf: Ø im Zeitraum + Veränderung */
.pstat { text-align: right; flex: none; }
.pstat-v { font-family: var(--font-display); font-size: 22px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.1; white-space: nowrap; }
.pstat-l { font-size: 13px; color: var(--muted); font-weight: 500; margin-right: 4px; }
.pstat-u { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 3px; }
.pstat .delta { display: inline-block; margin-top: 3px; }
.pstat-c { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
a.plink { color: inherit; }
a.plink:hover { color: var(--s1); }

/* Chart */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .axis text { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--baseline); stroke-width: 1; }
.chart .goal { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 4; }
.chart .goal-label { fill: var(--muted); font-size: 11px; }
.chart .target-band { fill: var(--good); opacity: 0.09; }
.chart .band-label { fill: var(--good-text); font-size: 11px; font-weight: 600; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.chart .gap-band { fill: var(--muted); opacity: 0.07; }
.chart .gap-label { fill: var(--muted); font-size: 11px; letter-spacing: .02em; }
.chart .hover-line { stroke: var(--ink-2); stroke-width: 1; opacity: .5; }
.single { padding: 34px 8px 30px; text-align: center; }
.single-v { font-family: var(--font-display); font-size: 46px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.single-v span { font-size: 18px; color: var(--muted); font-weight: 550; margin: 0 6px; letter-spacing: 0; }
.single-d { color: var(--muted); font-size: 12.5px; margin-top: 8px; }
.single-bar { height: 10px; border-radius: 5px; background: var(--surface-3); margin: 18px auto 0; max-width: 360px; overflow: hidden; display: flex; }
.single-bar div { border-radius: 5px; }
.single-bar.stack { gap: 2px; background: none; }
.single-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; font-size: 12px; color: var(--ink-2); margin-top: 10px; }
.single-legend span { display: inline-flex; align-items: center; gap: 6px; }
.single-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.tooltip {
  position: absolute; pointer-events: none; z-index: 20; min-width: 140px;
  background: color-mix(in srgb, var(--surface-3) 92%, transparent); backdrop-filter: blur(12px);
  border: 1px solid var(--border-strong); border-radius: 12px; padding: 9px 11px; font-size: 12px;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.5); opacity: 0; transition: opacity .12s; white-space: nowrap;
}
.tooltip.show { opacity: 1; }
.tooltip .tt-date { color: var(--muted); margin-bottom: 5px; font-weight: 500; }
.tooltip .tt-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tooltip .tt-row + .tt-row { margin-top: 3px; }
.tooltip .tt-k { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.tooltip .tt-k i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.tooltip .tt-v { font-weight: 600; font-variant-numeric: tabular-nums; }

/* Tables */
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; background: var(--surface); }
table.data td { padding: 9px 10px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data td.num, table.data th.num { text-align: right; }
table.data tr.click { cursor: pointer; }
table.data tr.click:hover td { background: var(--surface-2); }
.table-wrap { overflow: auto; max-height: 560px; border-radius: 12px; }

/* Pills & badges */
.pill { white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--surface-3); color: var(--ink-2); }
.pill.good { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good-text); }
.pill.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.pill.bad { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
.pill.info { background: var(--s1-wash); color: var(--s1); }
:root[data-theme="light"] .pill.warn { color: #8a5a00; }

/* Buttons */
.btn { white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 11px; border: 1px solid var(--border-strong); background: var(--surface-2); cursor: pointer; font-weight: 600; transition: all .15s; }
.btn:hover { background: var(--surface-3); }
.btn.primary { background: var(--s1); border-color: transparent; color: #fff; box-shadow: 0 8px 20px -10px var(--s1); }
.btn.primary:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 16px; height: 16px; }

/* Import */
.dropzone {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius); padding: 38px 20px; text-align: center;
  background: var(--surface); transition: all .2s; cursor: pointer;
}
.dropzone:hover, .dropzone.drag { border-color: var(--s1); background: var(--s1-wash); }
.dropzone .dz-icon { width: 52px; height: 52px; border-radius: 16px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--surface-3); color: var(--s1); }
.dropzone .dz-icon svg { width: 24px; height: 24px; }
.dropzone h3 { margin: 0 0 4px; font-size: 16px; }
.dropzone p { margin: 0; color: var(--muted); }
.result-list { display: flex; flex-direction: column; gap: 8px; }
.result { display: grid; grid-template-columns: 24px 1fr auto; gap: 10px; align-items: start; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.result .ic { font-size: 15px; line-height: 20px; }
.result .nm { font-weight: 600; }
.result .ds { color: var(--muted); font-size: 12.5px; }
.result ul { margin: 6px 0 0; padding-left: 16px; font-size: 12.5px; color: var(--ink-2); }
ul.issues { margin: 12px 0 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); }
ul.issues li { margin-top: 4px; }
details.more summary { cursor: pointer; margin-top: 10px; font-size: 12.5px; color: var(--s1); font-weight: 600; }
details.more ul.issues { margin-top: 6px; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.kv .k { font-size: 12px; color: var(--muted); }
.kv .v { font-size: 22px; font-weight: 650; font-family: var(--font-display); letter-spacing: -0.02em; }

/* Drawer */
.drawer-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); backdrop-filter: blur(3px); z-index: 50; opacity: 0; pointer-events: none; transition: opacity .2s; }
.drawer-bg.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); z-index: 51; background: var(--surface);
  border-left: 1px solid var(--border-strong); transform: translateX(100%); transition: transform .28s cubic-bezier(.2,.8,.2,1);
  overflow-y: auto; padding: 24px 26px 40px;
}
.drawer.show { transform: none; }
.drawer h2 { margin: 0; font-family: var(--font-display); font-size: 24px; letter-spacing: -0.02em; }
.drawer .cat { margin-top: 22px; }
.drawer .cat h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }
.mrow { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.mrow .mv { font-weight: 600; font-variant-numeric: tabular-nums; }
.mrow .mv .u { color: var(--muted); font-weight: 500; margin-left: 3px; }

/* Heatmap */

/* Metric picker */
.picker { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 6px 11px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.chip:hover { border-color: var(--border-strong); color: var(--ink); }
.chip.on { background: var(--s1); border-color: var(--s1); color: #fff; }
.picker-group { margin-bottom: 12px; }
.picker-group .gl { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 6px; font-weight: 600; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state h2 { color: var(--ink); font-family: var(--font-display); }
.muted { color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.fade-in { animation: fade .35s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--surface-3); border: 1px solid var(--border-strong); padding: 11px 18px; border-radius: 12px; font-weight: 550; opacity: 0; transition: all .25s; z-index: 60; box-shadow: 0 12px 30px -12px rgba(0,0,0,.6); }
.toast.show { opacity: 1; transform: translateX(-50%); }

/* ---------- Labor ---------- */
a.back { display: inline-block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
a.back:hover { color: var(--s1); }
.btn.sm { padding: 4px 10px; font-size: 12px; border-radius: 8px; }
.chart .ref-band, svg .ref-band { fill: var(--good); opacity: 0.11; }
svg .lab-line { fill: none; stroke: var(--ink-2); stroke-opacity: .45; stroke-width: 2; stroke-linejoin: round; }
svg .lab-line.mini { stroke-width: 1.4; }
svg .lab-dot { stroke: var(--surface); stroke-width: 2; }
svg .val-label { fill: var(--ink-2); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }

svg .axis-t { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
svg .gridline { stroke: var(--grid); stroke-width: 1; }
.rbar { position: relative; height: 8px; border-radius: 4px; background: var(--surface-3); }
.rbar.empty { background: none; }
.rbar .rb-band { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--good) 38%, transparent); border-radius: 4px; }
.rbar .rb-target { position: absolute; top: -3px; bottom: -3px; border: 1.5px dashed var(--warn); border-radius: 6px; }
.rbar b { position: absolute; top: 50%; width: 12px; height: 12px; border-radius: 50%; transform: translate(-50%, -50%); border: 2px solid var(--surface); }
.g-flag { grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); }
.tile.flag .value { font-size: 26px; }
.tile .value .u, .lv .u, .kv .v .u, table.data .u { font-size: 12.5px; font-weight: 500; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.tile.flag .label { font-weight: 600; color: var(--ink); }
.lrows { display: flex; flex-direction: column; }
.lrow { display: grid; grid-template-columns: minmax(120px, 1.9fr) 86px minmax(64px, 1fr) 64px 52px 44px; gap: 10px; align-items: center; padding: 8px 6px; border-bottom: 1px solid var(--border); cursor: pointer; border-radius: 8px; }
.lrow:last-child { border-bottom: 0; }
.lrow:hover { background: var(--surface-2); }
.lrow .ln { min-width: 0; font-weight: 500; line-height: 1.25; }
.lrow .ln small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.lrow .lv { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lrow .lsp { height: 26px; }
.lrow .ld { text-align: right; }
.lrow .lt { text-align: right; color: var(--muted); font-size: 12px; white-space: nowrap; }
.lrow.stale { opacity: .55; }
.lab-matrix .stick { position: sticky; left: 0; background: var(--surface); z-index: 1; }
.lab-matrix th.stick { z-index: 3; }
table.data tr.grp td { background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; padding: 6px 10px; }
.lab-matrix td.lc.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 11%, transparent); font-weight: 600; }
.lab-matrix td.lc.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 11%, transparent); font-weight: 600; }
:root[data-theme="light"] .lab-matrix td.lc.warn { color: #8a5a00; }
.lab-matrix td.lc.info { color: var(--s1); }
.lab-matrix td.empty { color: var(--baseline); }
.lab-matrix sup { font-size: 9px; margin-left: 1px; }
.rep-list { display: flex; flex-direction: column; gap: 12px; }
.rep { display: grid; grid-template-columns: 90px 1fr; gap: 18px; cursor: pointer; transition: border-color .15s, transform .15s; }
.rep:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.rep-date .d { font-family: var(--font-display); font-size: 24px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.rep-date .y { color: var(--muted); font-weight: 600; }
.lab-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.pdf-col { position: sticky; top: 20px; }
.pdf-pane iframe { width: 100%; height: calc(100vh - 150px); border: 0; border-radius: 10px; background: #fff; display: block; }
.note-card.warn { border-color: color-mix(in srgb, var(--warn) 55%, transparent); }
.note-card.bad { border-color: color-mix(in srgb, var(--bad) 55%, transparent); }
.note-card ul { margin: 6px 0 0; padding-left: 18px; }
.md { font-size: 13.5px; color: var(--ink-2); line-height: 1.55; }
.md p { margin: 6px 0; }
.md ul { margin: 6px 0; padding-left: 18px; }
.md li { margin: 5px 0; }
.md b { color: var(--ink); }
a.pg { font-size: 10.5px; font-weight: 600; padding: 1px 6px; border-radius: 6px; background: var(--s1-wash); margin-left: 4px; cursor: pointer; }
table.lab-res td { white-space: normal; }
@media (max-width: 1100px) { .lab-split { grid-template-columns: 1fr; } .pdf-col { position: static; } .pdf-pane iframe { height: 75vh; } }
@media (max-width: 760px) {
  .lrow { grid-template-columns: 1fr auto 44px; }
  .lrow .rbar, .lrow .lsp, .lrow .ld { display: none; }
}

/* ---------- Ernährung ---------- */
.cov { display: grid; grid-template-columns: auto 1fr; gap: 6px 24px; align-items: center; }
.cov-v { font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.cov-v span { font-size: 15px; color: var(--muted); font-weight: 550; letter-spacing: 0; }
.cov-bar { display: flex; gap: 3px; flex-wrap: wrap; justify-content: flex-end; }
.cov-bar i { width: 12px; height: 22px; border-radius: 3px; background: var(--surface-3); }
.cov-bar i.c { background: var(--good); }
.cov-bar i.p { background: color-mix(in srgb, var(--good) 35%, var(--surface-3)); }
.cov-h { grid-column: 1 / -1; font-size: 12.5px; }
.nrows { display: flex; flex-direction: column; }
.nrow { display: grid; grid-template-columns: minmax(110px, 1.3fr) 92px minmax(70px, 1fr) 84px 86px; gap: 10px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--border); }
.nrow:last-child { border-bottom: 0; }
.nrow .nl { font-weight: 500; line-height: 1.25; }
.nrow .nl small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.nrow .nl sup { color: var(--muted); }
.nrow .nv small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; }
.nrow .nv { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nrow .nt { text-align: right; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nrow .nt small { display: block; font-size: 11px; }
.nrow .ns { text-align: right; }
.nv .u, .nc .v .u { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 3px; }
.nbar { position: relative; height: 8px; border-radius: 4px; background: var(--surface-3); }
.nbar i { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--good) 38%, transparent); border-radius: 4px; }
.nbar b { position: absolute; top: 50%; width: 12px; height: 12px; border-radius: 50%; transform: translate(-50%, -50%); border: 2px solid var(--surface); }
table.ntable td.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); font-weight: 600; }
table.ntable td.warn { color: var(--warn-text); background: color-mix(in srgb, var(--warn) 10%, transparent); font-weight: 600; }
table.ntable td.unc { color: var(--muted); }
table.ntable tr.partial td { color: var(--muted); }
table.ntable td .pill + .pill { margin-left: 4px; }
.toplist { display: flex; flex-direction: column; gap: 9px; }
.trow { display: grid; grid-template-columns: minmax(120px, 1.4fr) 1fr 92px; gap: 12px; align-items: center; font-size: 13px; }
.trow .tn { line-height: 1.25; }
.trow .tn small, .trow .tv small { color: var(--muted); font-size: 11px; margin-left: 5px; }
.trow .tb { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.trow .tb i { display: block; height: 100%; background: var(--s1); border-radius: 4px; }
.trow .tv { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
a.ncard { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; color: inherit; transition: border-color .15s; }
a.ncard:hover { border-color: var(--border-strong); }
.nc .k { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.nc .v { font-family: var(--font-display); font-size: 24px; font-weight: 650; letter-spacing: -0.02em; margin: 4px 0 10px; }
.foot-note { font-size: 12px; margin-top: 18px; line-height: 1.5; }
@media (max-width: 1100px) { a.ncard { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .nrow { grid-template-columns: 1fr auto 76px; }
  .nrow .nbar, .nrow .nt { display: none; }
  .cov { grid-template-columns: 1fr; }
  .cov-bar { justify-content: flex-start; }
}

@media (max-width: 1100px) { .g-kpi { grid-template-columns: repeat(2, minmax(0,1fr)); } .g-2 { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; z-index: 10; height: auto; flex-direction: row; padding: 10px 12px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .brand, .nav-section, .sidebar-foot { display: none; }
  .nav-item { width: auto; white-space: nowrap; }
  main { padding: 20px 16px 50px; }
}

/* ---------- Trends: Zusammenhänge, Wochentage, Atmung ---------- */
.chart .axis-r { fill: var(--s2); font-size: 11px; font-variant-numeric: tabular-nums; opacity: .85; }
.chart .axis-title { fill: var(--muted); font-size: 11px; font-weight: 600; }
.chart .fit-line { stroke: var(--ink-2); stroke-width: 1.5; stroke-dasharray: 5 4; opacity: .7; }
.chart .bar-value { fill: var(--ink-2); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tabs-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.cmp-controls { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 12px; align-items: end; }
.cmp-controls label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.cmp-controls select { width: 100%; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--ink); font: inherit; font-size: 13.5px; }
.cmp-controls .arrow { font-size: 20px; color: var(--muted); padding-bottom: 6px; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.presets .gl { font-size: 11px; color: var(--muted); align-self: center; margin-right: 4px; }
.cmp-headline { font-size: 17px; line-height: 1.45; font-weight: 500; }
.cmp-headline b { font-weight: 700; }
.cmp-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.cmp-note { font-size: 12px; color: var(--muted); margin-top: 10px; line-height: 1.45; }
.grp { display: grid; grid-template-columns: minmax(130px, 1.2fr) 3fr 90px 70px; gap: 12px; align-items: center; padding: 9px 2px; border-bottom: 1px solid var(--border); }
.grp:last-child { border-bottom: 0; }
.grp .gl2 { font-weight: 500; line-height: 1.25; }
.grp .gl2 small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.grp .gbar { height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.grp .gbar i { display: block; height: 100%; border-radius: 999px; background: var(--s1); }
.grp .gv { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.grp .gd { text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; }
.zone-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
@media (max-width: 760px) {
  .cmp-controls { grid-template-columns: 1fr; }
  .cmp-controls .arrow { display: none; }
  .grp { grid-template-columns: 1fr 70px 60px; }
  .grp .gbar { display: none; }
}

/* ---------- Supplemente ---------- */
.sup-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.sup-title { font-family: var(--font-display); font-size: 22px; font-weight: 650; letter-spacing: -0.02em; }
.sup-title .muted { font-size: 15px; font-weight: 500; letter-spacing: 0; }
.sup-status { font-size: 13px; margin-top: 4px; display: flex; align-items: center; gap: 6px; color: var(--ink-2); }
.sup-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--baseline); }
.sup-status.t::before { background: var(--s1); }
.sup-status.n::before { background: var(--muted); }
.wkstrip { display: flex; align-items: center; gap: 4px; }
.wkstrip .icon-btn { width: 30px; height: 44px; }
.wd { width: 42px; padding: 6px 0 7px; border-radius: 11px; border: 1px solid transparent; background: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--ink-2); }
.wd:hover:not(:disabled) { background: var(--surface-2); }
.wd.on { background: var(--surface-3); border-color: var(--border-strong); color: var(--ink); }
.wd:disabled { opacity: .3; cursor: default; }
.wd-n { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.wd-d { font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }
.wd-dot { width: 6px; height: 6px; border-radius: 50%; margin-top: 2px; }
.wd-dot.t { background: var(--s1); }
.wd-dot.n { background: var(--muted); }
.wd-dot.u { box-shadow: inset 0 0 0 1.5px var(--baseline); }

.st-check { flex: none; width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--border-strong); display: grid; place-items: center; color: #fff; }

.st-check svg { width: 14px; height: 14px; }

.st-b { width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-2); cursor: pointer; font-size: 15px; line-height: 1; }
.st-b:hover { color: var(--ink); background: var(--surface-3); }

.btn:disabled { opacity: .45; cursor: default; }
.linkbtn { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 12.5px; text-decoration: underline; text-underline-offset: 3px; }
.linkbtn:hover { color: var(--ink-2); }
@media (max-width: 760px) { .wd { width: 34px; } }
.smatrix { font-size: 11px; }
.smatrix th.mc { font-weight: 500; color: var(--muted); padding: 4px 1px; white-space: nowrap; font-size: 10.5px; text-align: left; }
.smatrix td.mc { padding: 3px 1px; }
.smatrix td.stick, .smatrix th.stick { position: sticky; left: 0; background: var(--surface); z-index: 1; padding-right: 10px; white-space: nowrap; font-size: 12.5px; }
.smatrix i, .legend i.lg { display: block; width: 100%; min-width: 7px; height: 16px; border-radius: 3px; }
.legend i.lg { display: inline-block; width: 12px; min-width: 12px; height: 12px; vertical-align: -1px; }
.smatrix i.t, .legend i.t { background: var(--s1); }
.smatrix i.f, .legend i.f { background: var(--s2); opacity: .7; }
.smatrix i.n, .legend i.n { background: var(--surface-3); }
.smatrix i.u, .legend i.u { background: repeating-linear-gradient(135deg, transparent 0 3px, var(--grid) 3px 5px); }
.supp-split { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.scard { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; cursor: pointer; transition: border-color .15s; align-items: start; }
.scard:hover { border-color: var(--border-strong); }
.scard .v { font-size: 20px; }
.scard .btn.sm { margin-top: 2px; }
.sflags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
@media (max-width: 900px) { .scard { grid-template-columns: 1fr; } }
.sprog { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.sprog i { display: block; height: 100%; background: var(--s1); border-radius: 3px; }

/* ---------- Alltag → Tag ---------- */
.sup-status.p::before { background: var(--warn); }
.wd-dot.p { background: color-mix(in srgb, var(--s1) 45%, transparent); }
.tg-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 34px; }
.tg-sec + .tg-sec { margin-top: 20px; }
.tg-h { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 650; margin-bottom: 10px; }
.tg-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; align-items: center; margin-bottom: 8px; }
.tg-row.sub { margin-top: -2px; margin-bottom: 12px; }
.tg-l { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.tg-row { align-items: start; }
.tg-row > .tg-l { padding-top: 2px; }
.tg-l small { display: block; font-size: 11px; font-weight: 500; }
.tg-row.off .tg-sl { opacity: .45; }
.tg-sl { --tone: var(--muted); display: grid; gap: 4px; }
.tg-sl.set.g { --tone: var(--good); } .tg-sl.set.m { --tone: var(--s1); } .tg-sl.set.w { --tone: #d9960f; } .tg-sl.set.b { --tone: var(--bad); }
.tg-sl-top { display: flex; align-items: center; justify-content: space-between; min-height: 20px; }
.tg-sl-v { font-size: 13px; font-weight: 650; color: var(--tone); }
.tg-sl:not(.set) .tg-sl-v { color: var(--muted); font-weight: 500; font-style: italic; }

.tg-sl input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; margin: 0; background: transparent; cursor: pointer; }
.tg-sl input[type=range]:focus-visible { outline: 2px solid var(--s1); outline-offset: 3px; border-radius: 6px; }
.tg-sl input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--tone) var(--p), var(--surface-3) var(--p)); }
.tg-sl:not(.set) input[type=range]::-webkit-slider-runnable-track { background: repeating-linear-gradient(90deg, var(--surface-3) 0 6px, transparent 6px 9px); }
.tg-sl input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -7px; border-radius: 50%; background: #fff; border: 3px solid var(--tone); box-shadow: 0 1px 4px rgba(0,0,0,.35); transition: transform .1s; }
.tg-sl input[type=range]:active::-webkit-slider-thumb { transform: scale(1.12); }
.tg-sl:not(.set) input[type=range]::-webkit-slider-thumb { background: var(--surface-3); border-color: var(--border-strong); box-shadow: none; }
.tg-sl input[type=range]::-moz-range-track { height: 6px; border-radius: 3px; background: var(--surface-3); }
.tg-sl input[type=range]::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--tone); }
.tg-sl:not(.set) input[type=range]::-moz-range-progress { background: transparent; }
.tg-sl input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--tone); }
.tg-ticks { position: relative; height: 20px; }
.tg-ticks button { position: absolute; top: 0; transform: translateX(-50%); border: 0; background: none; padding: 2px 4px; cursor: pointer; font-size: 11.5px; color: var(--muted); border-radius: 6px; white-space: nowrap; }
.tg-ticks button.l { transform: translateX(calc(-10px - 4px)); }
.tg-ticks button.r { transform: translateX(calc(-100% + 10px + 4px)); }
.tg-ticks button:hover { color: var(--ink); }
.tg-ticks button.on { color: var(--tone); font-weight: 650; }
.tg-flags { display: flex; flex-wrap: wrap; gap: 6px; }
.tg-flags .chip { padding: 4px 10px; font-size: 12px; }

#tg-note { width: 100%; box-sizing: border-box; resize: vertical; min-height: 44px; font: inherit; font-size: 13.5px; color: var(--ink); background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
#tg-note:focus { outline: none; border-color: var(--s1); }
.smatrix i.a, .legend i.a { background: color-mix(in srgb, var(--s1) 55%, transparent); }
@media (max-width: 1150px) { .tg-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; } }
@media (max-width: 760px) {
  
  .tg-row { grid-template-columns: 1fr; gap: 4px; }
}
.smatrix { table-layout: fixed; width: 100%; }
.smatrix th.stick { width: 170px; }
.smatrix th.mc { overflow: visible; }
.smatrix { min-width: 560px; }

/* ---------- Eingaben: „+“, Menü, Dialog (entry.js) ---------- */

main { padding-bottom: 110px; }
.fab { position: fixed; right: 28px; bottom: 28px; z-index: 55; width: 58px; height: 58px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--s1), var(--deep));
  box-shadow: 0 12px 28px -10px var(--s1), 0 2px 6px rgba(0,0,0,.3); transition: transform .15s, box-shadow .15s; }
.fab svg { width: 26px; height: 26px; transition: transform .2s; }
.fab:hover { transform: translateY(-2px) scale(1.04); }
.fab[aria-expanded="true"] svg { transform: rotate(45deg); }
.fab:focus-visible { outline: 3px solid var(--s1); outline-offset: 3px; }
.fab.dot::after { content: ""; position: absolute; top: 5px; right: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 2.5px var(--page); }

.fab-i { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--s1-wash); color: var(--s1); flex: none; }
.fab-i svg { width: 20px; height: 20px; }
body.ent-open { overflow: hidden; }
.ent-bg { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.55); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .18s; }
.ent-bg.show { opacity: 1; pointer-events: auto; }
.ent { position: fixed; z-index: 71; left: 50%; top: max(24px, 5vh); width: min(1000px, calc(100vw - 48px)); max-height: calc(100vh - max(48px, 10vh));
  transform: translate(-50%, 12px) scale(.98); opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s;
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 22px;
  box-shadow: 0 40px 80px -24px rgba(0,0,0,.75); }
.ent.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.ent-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0; }
.ent-body { padding: 18px 24px 8px; overflow-y: auto; flex: 1; min-height: 240px; }
.ent-load { padding: 60px 0; text-align: center; }
.ent-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px 18px; border-top: 1px solid var(--border); font-size: 12.5px; }
.ent .tg-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 32px; }

.tg-plus { color: var(--s1); text-decoration: none; font-weight: 600; font-size: inherit; padding: 0; }
.tg-plus:hover { color: var(--s1); text-decoration: underline; }
@media (max-width: 900px) { .ent .tg-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; } }
@media (max-width: 760px) {
  .fab { right: 18px; bottom: 18px; }
  .ent { left: 0; right: 0; top: auto; bottom: 0; width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0; transform: translateY(24px); }
  .ent.show { transform: none; }
  .ent-head { padding: 12px 14px 0; }
  .ent-body { padding: 14px 16px 8px; }
  .ent-foot { padding: 12px 16px 16px; }
  .ent-foot .muted { display: none; }
  .ent-foot .btn { width: 100%; justify-content: center; }
}

/* ---------- Dialog-Titel, Tagebuch-Seite, Kataloge ---------- */
#ent-title { margin: 0; display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-size: 20px; font-weight: 650; letter-spacing: -0.015em; }
#ent-title .fab-i { width: 34px; height: 34px; border-radius: 10px; }
#ent-title .fab-i svg { width: 18px; height: 18px; }
.in-field input, .kf-ing input, .kf-ing select {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 14px; color: var(--ink); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 11px; padding: 9px 12px; }
.jn-notes { display: flex; flex-direction: column; }
.jn-note { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; padding: 9px 4px; border: 0; border-bottom: 1px solid var(--border); background: none; text-align: left; cursor: pointer; font: inherit; font-size: 13.5px; color: var(--ink); border-radius: 0; }
.jn-note:last-child { border-bottom: 0; }
.jn-note:hover { background: var(--surface-2); }
.jn-note span:last-child { white-space: pre-wrap; overflow-wrap: anywhere; }
.section-title .btn { font-size: 12px; }
/* Medikamente */
.md-kpis { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.md-kpi .k { font-size: 13px; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.md-kpi .v { font-family: var(--font-display); font-size: 28px; font-weight: 650; letter-spacing: -0.02em; margin: 6px 0 10px; }
.md-kpi .v .u { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.md-sub { font-size: 12.5px; margin-top: 10px; line-height: 1.5; }
/* Kataloge */
.kt-table { table-layout: fixed; width: 100%; }
.kt-table th:nth-child(1) { width: 36%; } .kt-table th:nth-child(2) { width: 120px; } .kt-table th:nth-child(4) { width: 110px; } .kt-table th:nth-child(5) { width: 96px; }
.kt-table td { white-space: normal; vertical-align: top; overflow-wrap: anywhere; }
.kt-table td b { font-weight: 600; }
.kt-note { display: block; font-size: 11.5px; margin-top: 2px; }
.kt-ing { font-size: 12.5px; color: var(--ink-2); }
tr.kt-off td { opacity: .55; }
.kt-form { margin-bottom: 8px; border-color: var(--s1); }
.kt-form h3 { margin: 0; font-size: 16px; }
.kt-form code { font-size: 12px; }
.kt-warn { margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; font-size: 12.5px; line-height: 1.45; color: var(--ink-2); background: color-mix(in srgb, var(--warn) 10%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }
.kf-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.kf-wide { grid-column: 1 / -1; }
.kf-ings { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.kf-ing { display: grid; grid-template-columns: minmax(180px, 1.4fr) auto minmax(90px, 0.6fr) auto; gap: 8px; align-items: center; width: 100%; }
.kf-ing:has(input[data-f=label]) { grid-template-columns: minmax(160px, 1.1fr) minmax(120px, 1fr) 80px minmax(90px, 0.6fr) auto; }
.kf-ing .muted { font-size: 12.5px; min-width: 24px; }
.kf-ing .icon-btn { width: 34px; height: 34px; }
.kf-u { text-align: center; }
@media (max-width: 760px) {
  .jn-note { grid-template-columns: 1fr; gap: 2px; }
  .kf-grid { grid-template-columns: 1fr; }
  .kf-ing, .kf-ing:has(input[data-f=label]) { grid-template-columns: 1fr 1fr auto; }
  .kf-ing select { grid-column: 1 / -1; }
  .kt-table th:nth-child(3), .kt-table td:nth-child(3), .kt-table th:nth-child(4), .kt-table td:nth-child(4) { display: none; }
  .kt-table th:nth-child(1) { width: auto; }
}

/* ---------- Formularfelder (Kataloge) ---------- */
.in-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.in-field .tg-h { margin-bottom: 0; }

/* ---------- Tagebuch (Abendmaske) ---------- */
.tb-banner { margin: -4px 0 16px; padding: 9px 12px; border-radius: 10px; font-size: 13px; color: var(--ink-2);
  background: color-mix(in srgb, var(--warn) 10%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 32%, transparent); }
.tb-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.tb-list { display: flex; flex-direction: column; gap: 6px; }
.tb-item { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); padding: 4px 6px 4px 4px; transition: border-color .15s, background .15s; }
.tb-item.on { border-color: color-mix(in srgb, var(--s1) 55%, transparent); background: var(--s1-wash); }
.tb-tog { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; border: 0; background: none; cursor: pointer; text-align: left; color: var(--ink); font: inherit; padding: 6px 8px; border-radius: 9px; }
.tb-tog:focus-visible { outline: 2px solid var(--s1); outline-offset: 1px; }
.tb-tog .st-check { flex: none; width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--border-strong); display: grid; place-items: center; color: #fff; }
.tb-tog .st-check svg { width: 14px; height: 14px; opacity: 0; }
.tb-item.on .st-check { background: var(--s1); box-shadow: none; }
.tb-item.on .st-check svg { opacity: 1; }
.tb-name { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.tb-name b { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.tb-name small { color: var(--muted); font-size: 12px; }
.tb-item.on .tb-name small { color: var(--ink-2); font-weight: 600; }
.tb-step { flex: none; display: flex; gap: 6px; }
.tb-step .st-b { width: 32px; height: 32px; font-size: 16px; }
.tb-step .st-b:disabled { opacity: .35; cursor: default; }
.tb-cat { font-size: 12.5px; margin-top: 10px; }
.ent-foot #ent-hint { font-size: 12.5px; }

/* ---------- Scores (Ringe) ---------- */
.sc-card { display: flex; flex-direction: column; gap: 14px; min-height: 170px; }
.sc-top { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: center; }
.sc-side { display: grid; gap: 4px; border-left: 1px solid var(--border); padding-left: 18px; }
.sc-lvrow { display: inline-flex; align-items: baseline; gap: 10px; }
.sc-now { font-size: 12px; color: var(--ink-2); font-weight: 600; display: inline-flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.sc-loading { min-height: 196px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: 13.5px; }
.sc-ring .sc-track { fill: none; stroke: var(--surface-3); }
.sc-ring .sc-arc { fill: none; stroke-linecap: round; transition: stroke-dasharray .6s ease; }
.sc-arc.good { stroke: var(--good); } .sc-arc.ok { stroke: var(--s1); } .sc-arc.warn { stroke: var(--warn); } .sc-arc.bad { stroke: var(--bad); }
.sc-rw { position: relative; display: inline-grid; place-items: center; flex: none; }
.sc-num { position: absolute; font-family: var(--font-display); font-weight: 700; font-size: 21px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.sc-num small { font-size: 11px; font-weight: 600; color: var(--muted); margin-left: 1px; }
.sc-num.big { font-size: 38px; }
.sc-num.big small { font-size: 16px; }
.sc-main, .sc-cell { display: flex; align-items: center; gap: 16px; border: 0; background: none; cursor: pointer; text-align: left; color: var(--ink); font: inherit; padding: 8px; border-radius: 14px; min-width: 0; }
.sc-main:hover, .sc-cell:hover { background: var(--surface-2); }
.sc-main:focus-visible, .sc-cell:focus-visible { outline: 2px solid var(--s1); outline-offset: 2px; }
.sc-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sc-main .sc-txt { min-width: 150px; }
.sc-txt b { font-size: 14px; font-weight: 650; }
.sc-txt .k { font-family: var(--font-display); font-size: 19px; font-weight: 650; letter-spacing: -0.01em; }
.sc-txt small { font-size: 12px; line-height: 1.35; }
.sc-lv { font-size: 12.5px; font-weight: 650; text-transform: capitalize; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.sc-lv::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--baseline); }
.sc-lv.good::before { background: var(--good); } .sc-lv.ok::before { background: var(--s1); } .sc-lv.warn::before { background: var(--warn); } .sc-lv.bad::before { background: var(--bad); }
.sc-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; border-top: 1px solid var(--border); padding-top: 12px; }
.sc-cell { flex-direction: column; align-items: flex-start; gap: 10px; }
.sc-head { display: flex; align-items: center; gap: 20px; margin: 16px 0 6px; }
.sc-part { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(60px, 1fr) 52px; gap: 12px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--border); }
.sc-part:last-child { border-bottom: 0; }
.sc-part.click { cursor: pointer; border-radius: 8px; }
.sc-part.click:hover { background: var(--surface-2); }
.sc-pl { display: flex; flex-direction: column; min-width: 0; font-size: 13.5px; }
.sc-pl small { font-size: 11.5px; }
.sc-bar { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.sc-bar i { display: block; height: 100%; border-radius: 4px; background: var(--baseline); }
.sc-bar i.good { background: var(--good); } .sc-bar i.ok { background: var(--s1); } .sc-bar i.warn { background: var(--warn); } .sc-bar i.bad { background: var(--bad); }
.sc-pv { text-align: right; white-space: nowrap; font-weight: 650; font-variant-numeric: tabular-nums; font-size: 13px; }
.sc-note { margin-top: 8px; font-size: 12.5px; color: var(--ink-2); border-left: 3px solid var(--warn); padding: 4px 10px; background: var(--surface-2); border-radius: 0 8px 8px 0; }
.sc-method { font-size: 12.5px; line-height: 1.55; margin: 6px 0 0; }
.dr-sc { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.dr-sci { border: 1px solid var(--border); background: var(--surface-2); border-radius: 10px; padding: 8px; cursor: pointer; color: var(--ink); font: inherit; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.dr-sci:hover { border-color: var(--border-strong); }
.dr-sci b { font-size: 16px; font-variant-numeric: tabular-nums; }
.dr-sci small { font-size: 11px; color: var(--muted); }
@media (max-width: 900px) { .sc-top { grid-template-columns: 1fr; } .sc-side { border-left: 0; padding-left: 0; border-top: 1px solid var(--border); padding-top: 10px; } }
@media (max-width: 900px) { .tb-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .sc-grid { grid-template-columns: 1fr; }
  .sc-cell { flex-direction: row; align-items: center; }
  .sc-main .sc-rw.big svg { width: 118px; height: 118px; }
  .sc-num.big { font-size: 30px; }
  .dr-sc { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Habits-Tabelle (journal.js) */
.tg-hrow { grid-template-columns: minmax(170px, 1.3fr) 3fr 56px 104px 86px 64px; }
.tg-hrow .gd { white-space: nowrap; }
.tg-hrow small { font-size: 11.5px; }
@media (max-width: 760px) { .tg-hrow { grid-template-columns: 1fr 60px 70px; } .tg-hrow .gbar, .tg-hrow .gd:nth-child(n+5) { display: none; } }

.sc-mini { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; border: 0; background: none; cursor: pointer; text-align: left; color: var(--ink); font: inherit; font-size: 13.5px; padding: 8px; border-radius: 12px; min-width: 0; }
.sc-mini:hover { background: var(--surface-2); }
.sc-mini:focus-visible { outline: 2px solid var(--s1); outline-offset: 2px; }
.sc-mini b { font-variant-numeric: tabular-nums; }
.sc-mini .delta { font-size: 12px; }
.sc-mini small { font-size: 12px; flex-basis: 100%; }
.sc-num-plain { font-family: var(--font-display); font-size: 40px; font-weight: 700; letter-spacing: -0.02em; }
.sc-num-plain small { font-size: 16px; color: var(--muted); font-weight: 600; }
@media (max-width: 1250px) { .sc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .sc-grid { grid-template-columns: 1fr; } }

/* ---------- Tagebuch-Seite (tagebuch.js): Kacheln + Tag-für-Tag-Matrix ---------- */
.tj-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1350px) { .tj-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .tj-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .tj-tiles { grid-template-columns: 1fr; } }
.tj-tile { display: flex; flex-direction: column; gap: 4px; }
.tj-h { font-size: 13.5px; font-weight: 650; }
.tj-big { font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tj-big .u { font-size: 15px; font-weight: 600; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.tj-lbl { font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-top: -2px; }
.tj-sub { font-size: 12px; line-height: 1.4; min-height: 2.8em; margin-top: 2px; }
.tj-bar { display: flex; gap: 2px; height: 12px; border-radius: 6px; overflow: hidden; margin-top: 8px; background: var(--surface-3); }
.tj-bar i { display: block; min-width: 4px; }
.tj-leg { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--ink-2); margin-top: 8px; }
.tj-leg span { display: inline-flex; align-items: center; gap: 5px; }
.tj-leg span.zero { color: var(--muted); }
.tj-leg b { font-variant-numeric: tabular-nums; }
.tj-matrix tr.tj-grp td { padding: 10px 0 2px; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.tj-legends { display: flex; flex-wrap: wrap; gap: 8px 26px; margin-top: 12px; }
.tj-legends .legend b { font-size: 12px; margin-right: 2px; }
/* Stärke 0–3: eine Farbe, hell → kräftig */
.sv0 { background: var(--surface-3) !important; }
.sv1 { background: color-mix(in srgb, var(--s2) 28%, var(--surface-3)) !important; }
.sv2 { background: color-mix(in srgb, var(--s2) 60%, var(--surface-3)) !important; }
.sv3 { background: var(--s2) !important; }
/* Bristol: hart (blau) ↔ normal (neutral) ↔ weich (orange) */
.bt1 { background: var(--s1) !important; }
.bt2 { background: color-mix(in srgb, var(--s1) 50%, var(--surface-3)) !important; }
.bt3, .bt4, .br-n { background: color-mix(in srgb, var(--muted) 45%, var(--surface-3)) !important; }
.bt5 { background: color-mix(in srgb, var(--s2) 28%, var(--surface-3)) !important; }
.bt6 { background: color-mix(in srgb, var(--s2) 60%, var(--surface-3)) !important; }
.bt7 { background: var(--s2) !important; }
.br-h { background: color-mix(in srgb, var(--s1) 75%, var(--surface-3)) !important; }
.br-s { background: color-mix(in srgb, var(--s2) 75%, var(--surface-3)) !important; }
.br-0 { background: transparent !important; box-shadow: inset 0 0 0 1.5px var(--baseline); }
/* Peak Flow: Zonen (GINA/NHLBI) */
.pf-g { background: var(--good) !important; }
.pf-y { background: var(--warn) !important; }
.pf-r { background: var(--bad) !important; }
.smatrix i.e, .legend i.e { background: transparent; box-shadow: inset 0 0 0 1px var(--grid); }
.tj-matrix th.mc { position: relative; overflow: visible !important; text-overflow: clip; background: none; }
.tj-matrix .tj-m { position: absolute; left: 1px; bottom: 4px; white-space: nowrap; z-index: 3; }
.smatrix i .sh-t { display: block; font-style: normal; font-size: 10px; font-weight: 600; line-height: 16px; text-align: center; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.smatrix i .sh-t.on { color: #fff; }

/* ---------- Kalender (calendar.js) ---------- */
.cal-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 16px; align-items: start; }
.cal-wrap.solo { grid-template-columns: minmax(0, 720px); }
.cal-main > .card { padding: 0; overflow: hidden; }
.cal-setup { padding: 22px !important; }
.cal-setup .in-field { display: block; margin-top: 12px; }
.cal-setup input { width: 100%; }
.cal-err { margin-bottom: 14px; border-left: 3px solid var(--bad); }
.icon-btn.spin svg { animation: cal-spin 1s linear infinite; }
@keyframes cal-spin { to { transform: rotate(360deg); } }
/* Konten & Kalender */
.cal-side { padding: 16px; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
.cal-acc { margin-bottom: 16px; }
.cal-acc-h { font-size: 12px; color: var(--muted); margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-acc-err { font-size: 12px; color: var(--ink-2); margin-bottom: 6px; line-height: 1.5; }
.cal-k { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 5px 4px; border-radius: 8px; cursor: pointer; color: var(--muted); font: inherit; font-size: 13.5px; text-align: left; }
.cal-k:hover { background: var(--surface-2); }
.cal-k i { flex: none; width: 14px; height: 14px; border-radius: 4px; border: 2px solid var(--c); opacity: .55; }
.cal-k.on { color: var(--ink); }
.cal-k.on i { background: var(--c); opacity: 1; }
.cal-k span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-k.busy i { background: none; border-color: var(--c); border-top-color: transparent; border-radius: 50%; animation: cal-spin .7s linear infinite; }
.cal-k.busy::after { content: "lädt …"; margin-left: auto; font-size: 11.5px; color: var(--muted); }
@keyframes cal-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .cal-k.busy i { animation: none; } }
.cal-off { font-size: 11.5px; margin: 4px 0 0 2px; }
/* Tag / Woche */
.cal-row { display: grid; grid-template-columns: 54px minmax(0, 1fr); }
.cal-days { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); position: relative; }
.cal-gut { font-size: 10.5px; color: var(--muted); text-align: right; padding-right: 8px; }
.cal-head { border-bottom: 1px solid var(--border); }
.cal-dh { border: 0; background: none; cursor: pointer; padding: 10px 4px 8px; color: var(--ink-2); font: inherit; display: flex; flex-direction: column; align-items: center; gap: 2px; border-left: 1px solid var(--border); }
.cal-dh span { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.cal-dh b { font-family: var(--font-display); font-size: 19px; font-weight: 650; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; }
.cal-dh.today b { background: var(--s1); color: #fff; }
.cal-dh:hover b { background: var(--surface-3); } .cal-dh.today:hover b { background: var(--s1); }
.cal-allday { border-bottom: 1px solid var(--border); align-items: center; }
.cal-allday .cal-gut { padding: 0 6px 0 2px; font-size: 10px; line-height: 1.15; hyphens: manual; }
.cal-bars { grid-auto-rows: 22px; grid-auto-flow: row dense; gap: 2px; padding: 4px 0; min-height: 30px; background: repeating-linear-gradient(to right, var(--border) 0 1px, transparent 1px calc(100% / var(--n))); }
.cal-bar { border: 0; cursor: pointer; margin: 0 3px; padding: 0 7px; border-radius: 6px; font: inherit; font-size: 12px; font-weight: 600; line-height: 22px; text-align: left; color: var(--ink);
  background: color-mix(in srgb, var(--c) 30%, var(--surface)); border-left: 3px solid var(--c); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cal-bar small { font-weight: 500; color: var(--ink-2); }
.cal-scroll { overflow-y: auto; max-height: max(420px, calc(100vh - 290px)); }
.cal-body { position: relative; }
.cal-hours { position: relative; }
.cal-hours span { position: absolute; right: 8px; transform: translateY(-50%); font-variant-numeric: tabular-nums; }
.cal-col { position: relative; border-left: 1px solid var(--border); background: repeating-linear-gradient(to bottom, var(--border) 0 1px, transparent 1px var(--hour)); }
.cal-col.today { background-color: color-mix(in srgb, var(--s1) 5%, transparent); }
.cal-ev { position: absolute; border: 0; cursor: pointer; padding: 3px 6px; border-radius: 6px; font: inherit; text-align: left; color: var(--ink); overflow: hidden;
  background: color-mix(in srgb, var(--c) 26%, var(--surface)); border-left: 3px solid var(--c); display: flex; flex-direction: column; gap: 1px; min-height: 16px; }
.cal-ev:hover, .cal-bar:hover, .cal-me:hover, .cal-li:hover { filter: brightness(1.12); z-index: 3; }
.cal-ev b { font-size: 12px; font-weight: 650; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; }
.cal-ev small { font-size: 11px; color: var(--ink-2); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev.short { flex-direction: row; gap: 6px; align-items: baseline; padding-top: 1px; padding-bottom: 1px; }
.cal-ev.short b { white-space: nowrap; }
.declined { opacity: .5; } .declined b, .declined span { text-decoration: line-through; }
.cal-ev.open, .cal-bar.open { background: color-mix(in srgb, var(--c) 10%, var(--surface)); outline: 1px dashed var(--c); outline-offset: -1px; }
.cal-ev.free { background: color-mix(in srgb, var(--c) 12%, var(--surface)); }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--bad); z-index: 4; pointer-events: none; }
.cal-now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
/* Monat */
.cal-mh { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--border); }
.cal-mh span { padding: 8px 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.cal-mg { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-mc { min-height: 118px; padding: 4px 4px 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-mc:nth-child(7n) { border-right: 0; }
.cal-mc.out { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.cal-mc.out .cal-mn { color: var(--muted); }
.cal-mn { align-self: flex-end; border: 0; background: none; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink-2); width: 26px; height: 26px; border-radius: 50%; }
.cal-mn:hover { background: var(--surface-3); }
.cal-mc.today .cal-mn { background: var(--s1); color: #fff; }
.cal-me { display: flex; align-items: center; gap: 5px; border: 0; background: none; cursor: pointer; font: inherit; font-size: 11.5px; color: var(--ink); padding: 1px 5px; border-radius: 5px; text-align: left; min-width: 0; }
.cal-me i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.cal-me small { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.cal-me span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-me.bar { background: color-mix(in srgb, var(--c) 30%, var(--surface)); border-left: 3px solid var(--c); font-weight: 600; }
.cal-more { font-size: 11px; text-align: left; padding-left: 5px; }
/* Liste */
.cal-list { padding: 6px 18px !important; }
.cal-ld { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.cal-ld:last-child { border-bottom: 0; }
.cal-lh { border: 0; background: none; cursor: pointer; font: inherit; font-weight: 650; color: var(--ink-2); text-align: left; align-self: start; padding: 4px 0; }
.cal-ld.today .cal-lh { color: var(--ink); }
.cal-li { display: grid; grid-template-columns: 96px 10px minmax(0, 1fr); gap: 10px; align-items: baseline; width: 100%; border: 0; background: none; cursor: pointer; font: inherit; color: var(--ink); text-align: left; padding: 5px 6px; border-radius: 8px; }
.cal-li:hover { background: var(--surface-2); filter: none; }
.cal-li > small { color: var(--ink-2); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.cal-li i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); align-self: center; }
.cal-li span { display: flex; flex-direction: column; min-width: 0; }
.cal-li span small { font-size: 12px; }
/* Termin-Detail */
.cal-dcal { font-size: 12px; display: flex; align-items: center; gap: 7px; margin-bottom: 4px; }
.cal-dcal i { width: 10px; height: 10px; border-radius: 3px; }
.cal-when { margin: 12px 0 0; font-size: 14.5px; color: var(--ink-2); line-height: 1.7; }
.cal-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.cal-acts .btn { text-decoration: none; color: var(--ink); } .cal-acts .btn.primary { color: #fff; }
.cal-desc { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; color: var(--ink-2); line-height: 1.55; }
@media (max-width: 1100px) { .cal-wrap { grid-template-columns: 1fr; } .cal-side { position: static; max-height: none; } }
@media (max-width: 760px) { .cal-mc { min-height: 84px; } .cal-me small { display: none; } .cal-ld { grid-template-columns: 1fr; gap: 2px; } .cal-row { grid-template-columns: 44px minmax(0, 1fr); } }
.cal-ev.multi, .cal-bar.multi, .cal-me.bar.multi { box-shadow: inset -4px 0 0 var(--c2); }
.cal-me.multi:not(.bar) i { box-shadow: 5px 0 0 var(--c2); margin-right: 5px; }
.cal-li.multi i { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c2); }


/* =====================================================================
   Kenk.io – Ergänzungen (Anmeldung, Import, Konto, „bald“-Bereiche)
   ===================================================================== */
[hidden] { display: none !important; }
.link { color: var(--s1); background: none; border: 0; padding: 0; cursor: pointer; font-weight: 550; font: inherit; }
.link:hover { text-decoration: underline; }
.btn.block { width: 100%; justify-content: center; padding: 12px 16px; }
.btn .spinner + * { margin-left: 0; }
.field { display: block; margin-bottom: 14px; }
.field-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 650; margin-bottom: 8px; }
.input { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface-2); font-size: 15px; outline: none; transition: border-color .15s, box-shadow .15s; color: var(--ink); font-family: inherit; }
.input:focus { border-color: var(--s1); box-shadow: 0 0 0 3px var(--s1-wash); }
.input.code { font-size: 22px; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }
select.input { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.msg { border-radius: 12px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px; border: 1px solid var(--border); }
.msg.error { color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.msg.info { color: var(--ink-2); background: var(--surface-2); }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .8s linear infinite; }
.btn:not(.primary) .spinner { border-color: var(--border-strong); border-top-color: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { min-height: 100vh; display: grid; place-items: center; color: var(--muted); }
.loading-inline { color: var(--muted); padding: 40px 0; }

/* Anmeldung */
.auth-wrap { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 32px 18px; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 30px 28px 26px; box-shadow: var(--shadow); }
.auth-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; margin-bottom: 24px; }
.auth-head h1 { font-family: var(--font-display); font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.auth-head p { margin: 0; color: var(--muted); }
.auth-head .who { color: var(--ink-2); font-weight: 550; }
.auth-alt { margin-top: 18px; text-align: center; color: var(--muted); font-size: 13px; display: flex; flex-direction: column; gap: 8px; }
.auth-foot { margin-top: 22px; text-align: center; font-size: 12px; color: var(--muted); }
.brand-mark svg { width: 17px; height: 17px; }
.brand-mark.lg { width: 48px; height: 48px; border-radius: 14px; }
.brand-mark.lg svg { width: 26px; height: 26px; }
.passkey-art { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--s1-wash); color: var(--s1); border: 1px solid color-mix(in srgb, var(--s1) 25%, transparent); }
.passkey-art svg { width: 32px; height: 32px; }
.benefits { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 10px; }
.benefits li { display: flex; gap: 10px; align-items: flex-start; color: var(--ink-2); }
.benefits svg { width: 18px; height: 18px; flex: none; color: var(--good-text); margin-top: 1px; }

/* Seitenleiste: künftige Bereiche, Konto */
.nav-item.soon { opacity: .4; cursor: default; }
.nav-item.soon:hover { background: none; color: var(--ink-2); }
.nav-item .soon-tag { margin-left: auto; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
a.nav-item:hover { text-decoration: none; }
.sidebar-user { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-weight: 550; padding: 6px 0; }
.sidebar-user:hover { color: var(--ink); text-decoration: none; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--s1), var(--deep)); flex: none; }
.sidebar-actions { display: flex; gap: 8px; }

/* Konto */
.g-2 > .span-2 { grid-column: 1 / -1; }
.dl-kv { display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; margin: 0; }
.dl-kv dt { color: var(--muted); }
.dl-kv dd { margin: 0; color: var(--ink); font-weight: 550; overflow-wrap: anywhere; }
.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status.ok { color: var(--good-text); } .status.ok::before { background: var(--good); }
.card-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; align-items: start; }
.form-grid .field { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.form-grid small { font-size: 12px; }
.form-actions { grid-column: 1 / -1; }

/* Import */
.dropzone { border: 1.5px dashed var(--border-strong); border-radius: 16px; padding: 30px 20px; text-align: center; background: var(--surface-2); transition: border-color .15s, background .15s; outline: none; cursor: default; }
.dropzone.over, .dropzone:focus-visible { border-color: var(--s1); background: var(--s1-wash); }
.dropzone.disabled { opacity: .6; pointer-events: none; }
.dropzone-icon { width: 44px; height: 44px; margin: 0 auto 12px; border-radius: 12px; display: grid; place-items: center; color: var(--s1); background: var(--s1-wash); }
.dropzone-icon svg { width: 22px; height: 22px; }
.dropzone-title { font-weight: 650; font-size: 15px; }
.dropzone-sub { color: var(--muted); margin-top: 4px; }
.dropzone-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.progress { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; margin-top: 18px; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--s1), var(--deep)); transition: width .2s; }
.progress-text { color: var(--ink-2); font-size: 13px; margin-top: 8px; font-variant-numeric: tabular-nums; }
.import-results { margin-top: 16px; }
.import-results .msg { margin-bottom: 10px; }
.problem-list { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 13px; display: grid; gap: 4px; }
.plain-list { margin: 0; padding-left: 18px; color: var(--ink-2); display: grid; gap: 8px; }

/* Scores: Platzhalter für Bereiche, die noch kommen */

@media (max-width: 760px) {
  .form-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 26px 20px 22px; }
  .sidebar .nav-item.soon { display: none; }
  .sidebar .sidebar-mobile { display: flex; }
}
.sidebar-mobile { display: none; margin-left: auto; gap: 6px; }
/* Abschnittstitel am Handy sauber umbrechen (Untertitel unter den Titel statt daneben) */
.section-title { flex-wrap: wrap; }
@media (max-width: 760px) { .section-title > .muted { flex-basis: 100%; } }

/* Trends (Kenk.io): Spalten als Klassen statt fest im HTML – auf dem Handy untereinander, die Metrik-Auswahl über
   der Grafik (in v1 lag sie dort über der Grafik). */
.trend-split { grid-template-columns: minmax(0, 1fr) 300px; }
.trend-picker { align-self: start; max-height: calc(100vh - 140px); overflow: auto; position: sticky; top: 20px; }
.trend-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.trend-2.wide-left { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
@media (max-width: 900px) {
  .trend-split, .trend-2, .trend-2.wide-left { grid-template-columns: minmax(0, 1fr); }
  .trend-picker { position: static; max-height: 240px; order: -1; }
}

/* Ladeanzeige (Kenk.io): Seite lädt bzw. Scores werden berechnet – Kreisel in der Akzentfarbe, erst nach 0,3 s sichtbar */
.page-loading { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13.5px; padding: 48px 4px;
  opacity: 0; animation: fade .3s ease .3s forwards; }
.page-loading .spinner, .sc-loading .spinner { border-color: var(--surface-3); border-top-color: var(--s1); width: 18px; height: 18px; }

/* Konto: Export */
.export-list { margin: 4px 0 14px; padding-left: 18px; color: var(--muted); font-size: 13.5px; line-height: 1.6; }
