/* ==========================================================================
   Nährtakt – Design-System (mobile-first, offline, keine externen Assets)
   ========================================================================== */

:root {
  /* Palette – frisch, gesundheitsnah, nicht klinisch */
  --bg:        #f4f7f6;
  --bg-2:      #eef3f1;
  --surface:   #ffffff;
  --surface-2: #f7faf9;
  --ink:       #16241f;
  --ink-soft:  #33443e;
  --muted:     #5d6f69;
  --muted-2:   #849690;
  --line:      #e2eae7;
  --line-2:    #d3ded9;

  --primary:      #0f7268;
  --primary-600:  #0c6259;
  --primary-700:  #0a5049;
  --primary-050:  #e3f2ef;
  --primary-ink:  #ffffff;

  --accent:     #e08a1e;   /* warmes Amber für Highlights/CTA */
  --accent-600: #c9781a;
  --accent-050: #fbeed8;

  --ok:      #2f9e5f;   --ok-050:   #e5f5ec;
  --warn:    #cf7a12;   --warn-050: #fbeed6;
  --danger:  #c23a29;   --danger-050:#fbe6e2;
  --info:    #2f6fb0;   --info-050: #e6eff8;

  --radius:    16px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(16,40,34,.06), 0 1px 3px rgba(16,40,34,.05);
  --shadow:    0 2px 6px rgba(16,40,34,.07), 0 6px 20px rgba(16,40,34,.06);
  --shadow-lg: 0 10px 40px rgba(16,40,34,.16);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --tap: 44px;               /* Mindest-Touchgröße */
  --maxw: 720px;             /* App-Inhaltsbreite */
  --header-h: 56px;
  --tabbar-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #0e1613;
    --bg-2:      #121d19;
    --surface:   #16211d;
    --surface-2: #1b2925;
    --ink:       #eaf2ef;
    --ink-soft:  #cdd9d4;
    --muted:     #9db0aa;
    --muted-2:   #7d928c;
    --line:      #26332e;
    --line-2:    #33433d;

    --primary:      #35a99b;
    --primary-600:  #2c9084;
    --primary-700:  #247a70;
    --primary-050:  #16302b;
    --primary-ink:  #06110f;

    --accent:     #f0a53f;
    --accent-600: #d98f2c;
    --accent-050: #34260f;

    --ok:      #45b877;   --ok-050:   #12271b;
    --warn:    #e0982f;   --warn-050: #2c2110;
    --danger:  #e0604e;   --danger-050:#2e1512;
    --info:    #5a97d6;   --info-050: #101f2e;

    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow:    0 2px 8px rgba(0,0,0,.45);
    --shadow-lg: 0 12px 44px rgba(0,0,0,.55);
  }
}
:root[data-theme="dark"] {
  --bg:#0e1613; --bg-2:#121d19; --surface:#16211d; --surface-2:#1b2925;
  --ink:#eaf2ef; --ink-soft:#cdd9d4; --muted:#9db0aa; --muted-2:#7d928c;
  --line:#26332e; --line-2:#33433d;
  --primary:#35a99b; --primary-600:#2c9084; --primary-700:#247a70; --primary-050:#16302b; --primary-ink:#06110f;
  --accent:#f0a53f; --accent-600:#d98f2c; --accent-050:#34260f;
  --ok:#45b877; --ok-050:#12271b; --warn:#e0982f; --warn-050:#2c2110;
  --danger:#e0604e; --danger-050:#2e1512; --info:#5a97d6; --info-050:#101f2e;
  --shadow-sm:0 1px 2px rgba(0,0,0,.4); --shadow:0 2px 8px rgba(0,0,0,.45); --shadow-lg:0 12px 44px rgba(0,0,0,.55);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}
img, svg { max-width: 100%; vertical-align: middle; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3,h4 { line-height: 1.2; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 5vw, 2.3rem); }
h2 { font-size: clamp(1.25rem, 3.5vw, 1.6rem); }
h3 { font-size: 1.12rem; }
p  { margin: 0 0 .8em; }
small { font-size: .82rem; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 2px; border-radius: 6px; }

/* ---------- Layout-Helfer ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 16px; }
.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap-row { flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grow { flex: 1 1 auto; min-width: 0; }
.center { text-align: center; }
.muted { color: var(--muted); }
.tiny { font-size: .78rem; }
.nowrap { white-space: nowrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 11px 18px;
  border: 1px solid transparent; border-radius: var(--radius-pill);
  font-weight: 650; font-size: .98rem; line-height: 1;
  background: var(--surface-2); color: var(--ink);
  box-shadow: var(--shadow-sm); transition: transform .06s ease, background .15s ease, box-shadow .15s ease;
  text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary-600); }
.btn.primary:hover { background: var(--primary-600); }
.btn.accent { background: var(--accent); color: #2a1c05; border-color: var(--accent-600); }
.btn.accent:hover { background: var(--accent-600); }
.btn.ghost { background: transparent; box-shadow: none; border-color: var(--line-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.subtle { background: var(--primary-050); color: var(--primary-700); box-shadow: none; }
.btn.danger { background: var(--danger-050); color: var(--danger); box-shadow: none; }
.btn.block { width: 100%; }
.btn.sm { min-height: 38px; padding: 8px 14px; font-size: .9rem; }
.btn.lg { min-height: 52px; padding: 14px 26px; font-size: 1.05rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-icon {
  display:inline-flex; align-items:center; justify-content:center;
  width:var(--tap); height:var(--tap); border-radius:var(--radius-pill);
  background:transparent; border:1px solid transparent; color:var(--ink);
}
.btn-icon:hover { background: var(--surface-2); }

/* ---------- Cards & Surfaces ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 16px;
}
.card.pad-lg { padding: 20px; }
.card.flat { box-shadow: none; }
.card.accent-top { border-top: 3px solid var(--primary); }
.section-title { font-size: .82rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }

/* ---------- Badges / Pills / Chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: .76rem; font-weight: 650; line-height: 1.4;
  background: var(--surface-2); color: var(--ink-soft); border: 1px solid var(--line);
}
.badge.ok     { background: var(--ok-050);     color: var(--ok);     border-color: transparent; }
.badge.warn   { background: var(--warn-050);   color: var(--warn);   border-color: transparent; }
.badge.danger { background: var(--danger-050); color: var(--danger); border-color: transparent; }
.badge.info   { background: var(--info-050);   color: var(--info);   border-color: transparent; }
.badge.primary{ background: var(--primary-050);color: var(--primary-700); border-color: transparent; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.dot.ok{background:var(--ok);} .dot.warn{background:var(--warn);} .dot.danger{background:var(--danger);} .dot.info{background:var(--info);}

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; border-radius: var(--radius-pill);
  background: var(--surface); border: 1px solid var(--line-2);
  font-size: .9rem; font-weight: 550; cursor: pointer; user-select: none;
  transition: background .12s ease, border-color .12s ease;
}
.chip:hover { background: var(--surface-2); }
.chip[aria-pressed="true"], .chip.active {
  background: var(--primary-050); border-color: var(--primary); color: var(--primary-700); font-weight: 650;
}
.chip .x { opacity: .6; font-weight: 700; }

/* ---------- Inputs ---------- */
.field { display: block; margin-bottom: 14px; }
.field > label { display: block; font-size: .86rem; font-weight: 650; margin-bottom: 6px; color: var(--ink-soft); }
.input, .select, .textarea {
  width: 100%; min-height: var(--tap); padding: 11px 13px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  font-size: 1rem; transition: border-color .12s ease, box-shadow .12s ease;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent);
}
.textarea { min-height: 90px; resize: vertical; }
.input-hint { font-size: .8rem; color: var(--muted); margin-top: 5px; }
.input.mono { font-family: var(--mono); letter-spacing: .06em; text-transform: uppercase; }

.search {
  position: relative;
}
.search .input { padding-left: 40px; border-radius: var(--radius-pill); }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }

/* ---------- App-Shell ---------- */
.app-shell { min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }
.appbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--header-h); display: flex; align-items: center; gap: 10px;
  padding: 0 12px; background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.appbar .title { font-weight: 750; font-size: 1.05rem; letter-spacing: -.01em; }
.appbar .brand-mark { width: 30px; height: 30px; flex: 0 0 auto; }
.app-main { flex: 1 1 auto; padding: 16px 0 calc(var(--tabbar-h) + var(--safe-b) + 20px); }

/* Bottom Tab-Bar (mobil) */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: flex; background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(150%) blur(12px);
  border-top: 1px solid var(--line);
}
.tabbar button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: none; border: 0; color: var(--muted); font-size: .72rem; font-weight: 600;
  min-height: var(--tap); padding: 6px 2px;
}
.tabbar button svg { width: 24px; height: 24px; }
.tabbar button[aria-selected="true"] { color: var(--primary); }
.tabbar button[aria-selected="true"] svg { transform: translateY(-1px); }

.view { animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- List-Rows (Nachschlagewerk) ---------- */
.list { display: flex; flex-direction: column; gap: 8px; }
.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  text-align: left; width: 100%; box-shadow: var(--shadow-sm); cursor: pointer;
  transition: border-color .12s ease, transform .06s ease;
}
.list-row:hover { border-color: var(--line-2); }
.list-row:active { transform: scale(.995); }
.list-row .lead {
  width: 40px; height: 40px; flex: 0 0 auto; border-radius: 11px;
  display: grid; place-items: center; font-weight: 750; font-size: .95rem;
  background: var(--primary-050); color: var(--primary-700);
}
.list-row .lead.cat-vitamin-fett  { background:#fbeed8; color:#a56b12; }
.list-row .lead.cat-vitamin-wasser{ background:#e3f2ef; color:#0a5049; }
.list-row .lead.cat-mineralstoff  { background:#e6eff8; color:#2f6fb0; }
.list-row .lead.cat-spurenelement { background:#efe6f6; color:#7141a8; }
.list-row .lead.cat-omega         { background:#e5f5ec; color:#2f9e5f; }
.list-row .lead.cat-aminosaeure   { background:#fdeae2; color:#c0492f; }
.list-row .lead.cat-probiotikum   { background:#e7f3f6; color:#1d7a94; }
.list-row .lead.cat-sonstige      { background:#eef1f0; color:#5d6f69; }
.list-row .rr { color: var(--muted-2); flex: 0 0 auto; }
.list-row .name { font-weight: 650; }
.list-row .sub { font-size: .82rem; color: var(--muted); }

/* ---------- Detail-Sheet / Modal ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 60; background: rgba(8,16,13,.5);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .15s ease;
}
@media (min-width: 640px){ .sheet-backdrop { align-items: center; padding: 20px; } }
.sheet {
  background: var(--surface); width: 100%; max-width: var(--maxw);
  max-height: 92dvh; overflow-y: auto;
  border-radius: 22px 22px 0 0; box-shadow: var(--shadow-lg);
  animation: slideup .22s cubic-bezier(.2,.7,.3,1);
  -webkit-overflow-scrolling: touch;
}
@media (min-width: 640px){ .sheet { border-radius: 22px; } }
@keyframes slideup { from { transform: translateY(20px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet-handle { width: 40px; height: 4px; background: var(--line-2); border-radius: 99px; margin: 10px auto 2px; }
.sheet-head { position: sticky; top: 0; background: var(--surface); padding: 8px 18px 12px; border-bottom: 1px solid var(--line); z-index: 2; }
.sheet-body { padding: 16px 18px 26px; }

.datarow { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.datarow:last-child { border-bottom: 0; }
.datarow .k { flex: 0 0 40%; font-size: .86rem; color: var(--muted); font-weight: 600; }
.datarow .v { flex: 1; font-weight: 550; }

/* ---------- Timeline / Tagesplan ---------- */
.timeline { position: relative; margin-left: 8px; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--line-2); }
.tl-slot { position: relative; margin-bottom: 16px; }
.tl-slot::before {
  content: ""; position: absolute; left: -22px; top: 4px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--surface); border: 3px solid var(--primary);
}
.tl-slot.slot-morgens::before { border-color: var(--accent); }
.tl-slot.slot-mittags::before { border-color: var(--ok); }
.tl-slot.slot-abends::before  { border-color: var(--info); }
.tl-slot.slot-nacht::before   { border-color: var(--primary-700); }
.tl-time { font-weight: 750; font-size: .95rem; display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.tl-time .lbl { color: var(--muted); font-weight: 600; font-size: .82rem; }
.tl-items { display: flex; flex-direction: column; gap: 8px; }
.tl-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.tl-item .pill-cat { width: 8px; align-self: stretch; border-radius: 99px; background: var(--primary); flex: 0 0 auto; }

/* ---------- Banner / Hinweise ---------- */
.banner {
  display: flex; gap: 11px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--info-050); color: var(--ink-soft); border: 1px solid transparent;
  font-size: .9rem;
}
.banner svg { flex: 0 0 auto; margin-top: 1px; }
.banner.warn   { background: var(--warn-050); }
.banner.danger { background: var(--danger-050); }
.banner.ok     { background: var(--ok-050); }
.banner strong { color: var(--ink); }

.disclaimer {
  font-size: .82rem; color: var(--muted); line-height: 1.5;
  background: var(--surface-2); border: 1px dashed var(--line-2);
  border-radius: var(--radius-sm); padding: 12px 14px;
}

/* ---------- Empty states ---------- */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .ico { font-size: 2.4rem; margin-bottom: 8px; opacity: .7; }

/* ---------- Toast ---------- */
.toast-host { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px); z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  pointer-events: auto; background: var(--ink); color: var(--bg);
  padding: 11px 16px; border-radius: var(--radius-pill); box-shadow: var(--shadow-lg);
  font-size: .9rem; font-weight: 600; max-width: 90vw;
  animation: toastin .2s ease;
}
@keyframes toastin { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Loading overlay (PWA) ---------- */
.app-loading {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  background: var(--bg); gap: 14px; text-align: center;
}
.app-loading[hidden] { display: none !important; }  /* Falle: [hidden] muss display:grid überstimmen */
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--primary); animation: spin .8s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Segmented control ---------- */
.segmented { display: flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 4px; gap: 4px; }
.segmented button { flex: 1; border: 0; background: transparent; border-radius: var(--radius-pill); min-height: 38px; font-weight: 600; font-size: .9rem; color: var(--muted); }
.segmented button[aria-selected="true"] { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }

/* ---------- Utility ---------- */
.divider { height: 1px; background: var(--line); margin: 14px 0; border: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 380px){ .grid-2 { grid-template-columns: 1fr; } }

/* Fünf Tabs: etwas kompaktere Beschriftung, damit „Statistik" nicht umbricht */
.tabbar button { font-size: .7rem; padding-inline: 1px; }
.tabbar button span { white-space: nowrap; }
.chip-scroll { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; scrollbar-width: none; }
.chip-scroll::-webkit-scrollbar { display: none; }
.chip-scroll .chip { flex: 0 0 auto; }
.badge.tag-own { background: var(--surface-2); color: var(--muted); border-color: var(--line-2); font-size: .68rem; padding: 1px 7px; }

/* ---------- Heute: Fortschritts-Ring ---------- */
.ring-card { display: flex; justify-content: center; padding: 22px 16px; }
.ring-wrap { position: relative; width: 172px; height: 172px; }
.ring { width: 172px; height: 172px; display: block; }
.ring-bg { stroke: var(--line); }
.ring-fg { stroke: var(--primary); transition: stroke-dashoffset .55s cubic-bezier(.2,.7,.3,1); filter: drop-shadow(0 0 5px color-mix(in srgb, var(--primary) 45%, transparent)); }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-num { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; color: var(--ink); line-height: 1; }
.ring-den { color: var(--muted); font-weight: 700; }
.ring-cap { font-size: .84rem; color: var(--muted); margin-top: 4px; }
.streak-badge.streak-on { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: var(--radius-pill); background: var(--accent-050); color: var(--accent-600); font-weight: 750; font-size: .9rem; white-space: nowrap; }

/* ---------- Heute: Checkliste ---------- */
.ci-group { font-size: .78rem; font-weight: 700; color: var(--muted); margin-top: 8px; }
.ci-group:first-of-type { margin-top: 2px; }
.check-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); transition: background .15s ease, border-color .15s ease; }
.check-item .cbx { width: 30px; height: 30px; flex: 0 0 auto; border-radius: 9px; border: 2px solid var(--line-2); background: var(--surface); display: grid; place-items: center; color: transparent; transition: background .15s ease, border-color .15s ease, color .15s ease; }
.check-item .ci-main { cursor: pointer; }
.check-item .ci-name { font-weight: 650; }
.check-item .ci-sub { font-size: .78rem; color: var(--muted); margin-top: 1px; }
.check-item .ci-info { width: 34px; height: 34px; flex: 0 0 auto; border: 0; background: transparent; color: var(--muted-2); display: grid; place-items: center; border-radius: 8px; }
.check-item .ci-info:hover { background: var(--surface-2); }
.check-item.on { border-color: color-mix(in srgb, var(--primary) 35%, var(--line)); background: color-mix(in srgb, var(--primary-050) 55%, var(--surface)); }
.check-item.on .cbx { background: var(--primary); border-color: var(--primary); color: #fff; }
.check-item.on .ci-name { color: var(--muted); text-decoration: line-through; }

/* ---------- Statistik: Kennzahlen ---------- */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; box-shadow: var(--shadow-sm); }
.stat-v { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; color: var(--primary); line-height: 1.1; }
.stat-l { font-size: .76rem; color: var(--muted); margin-top: 3px; font-weight: 600; }

/* 7-Tage-Balken */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 120px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.bar-track { width: 100%; flex: 1; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; display: flex; align-items: flex-end; overflow: hidden; }
.bar-track.h { flex: none; height: 8px; border: 0; border-radius: 99px; background: var(--surface-2); }
.bar-fill { width: 100%; background: color-mix(in srgb, var(--primary) 55%, var(--surface)); border-radius: 6px 6px 0 0; transition: height .45s ease; min-height: 2px; }
.bar-fill.full { background: var(--primary); }
.bar-track.h .bar-fill { border-radius: 99px; background: var(--primary); }
.bar-lbl { font-size: .72rem; color: var(--muted); font-weight: 600; }

/* Heatmap */
.heat { display: flex; gap: 5px; }
.heat-col { display: flex; flex-direction: column; gap: 5px; flex: 1; }
.heat-cell { aspect-ratio: 1; border-radius: 5px; background: var(--line); }
.heat-cell.l0 { background: var(--surface-2); border: 1px solid var(--line); }
.heat-cell.l1 { background: color-mix(in srgb, var(--primary) 25%, var(--surface)); }
.heat-cell.l2 { background: color-mix(in srgb, var(--primary) 45%, var(--surface)); }
.heat-cell.l3 { background: color-mix(in srgb, var(--primary) 70%, var(--surface)); }
.heat-cell.l4 { background: var(--primary); }
.heat-cell.future { opacity: .4; }
.heat-legend { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; font-size: .76rem; color: var(--muted); }
.heat-legend .lg { display: inline-flex; align-items: center; gap: 5px; }
.heat-legend .sw { width: 14px; height: 14px; border-radius: 4px; display: inline-block; flex: 0 0 auto; }

/* ---------- Kompatibilitäts-Matrix ---------- */
.matrix-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; }
.matrix { border-collapse: separate; border-spacing: 4px; margin: 0 auto; }
.matrix th, .matrix td { text-align: center; }
.matrix .mh, .matrix .mr { font-size: .72rem; font-weight: 700; color: var(--muted); white-space: nowrap; padding: 2px 3px; }
.matrix .mr { text-align: right; }
.matrix .cell { width: 34px; height: 34px; border-radius: 8px; font-weight: 750; font-size: .95rem; color: #fff; cursor: default; }
.matrix .cell span { display: block; line-height: 34px; }
.mx-ok   { background: var(--ok); }
.mx-warn { background: var(--warn); }
.mx-info { background: var(--info); }
.mx-none { background: var(--surface-2); color: var(--muted-2) !important; border: 1px solid var(--line); }
.mx-self { background: transparent; color: var(--muted-2); }
