/* =====================================================================
   Performance – Weiß / Navy
   Hell ist Standard, dunkel ("Navy Night") per Mond-Button.
   Alle Farben stecken in diesen Tokens – im Rest der Datei nur var(...).
   Hinweis: Diagramm-Tokens müssen 6-stellige Hex-Werte sein (alpha() in app.js).
   ===================================================================== */
:root {
  color-scheme: light;
  --page: #f4f6fb;
  --page-glow-1: rgba(30, 58, 138, 0.10);
  --page-glow-2: rgba(59, 91, 219, 0.06);
  --surface: rgba(255, 255, 255, 0.86);
  --surface-solid: #ffffff;
  --surface-2: rgba(15, 35, 80, 0.035);
  --border: rgba(15, 35, 80, 0.08);
  --border-strong: rgba(15, 35, 80, 0.15);
  --sheen: rgba(255, 255, 255, 0.95);
  --ink: #0b1630; --ink-2: #44506a; --muted: #8590a6;
  --grid: #edf0f6; --axis: #d8dde8;

  /* Akzent: Navy */
  --accent: #1e3a8a; --accent-2: #3b5bdb; --accent-deep: #0b1f4b;
  --gloss: linear-gradient(150deg, #4a6bd6 0%, #1e3a8a 34%, #132a63 70%, #0a1a40 100%);
  --hero-bg: linear-gradient(135deg, #24438f 0%, #162f6e 42%, #0d1f4d 78%, #081431 100%);
  --hero-hi: #9db7ff;
  --on-accent: #ffffff;

  /* Diagramme – Navy-Töne, unterschieden über Helligkeit */
  --s1: #1e3a8a; --s2: #5b7be0; --s3: #0f1f47; --s4: #2f4fb0; --s5: #142c6b; --s7: #2a4aa8;
  --good: #2a4aa8; --warning: #1e3a8a; --critical: #c81e3c;
  --band: rgba(30, 58, 138, 0.08);
  /* Herzfrequenzzonen: hell → dunkel */
  --z1: #dbe4fb; --z2: #9fb4ee; --z3: #5a78d6; --z4: #2a4aa8; --z5: #0f1f47;
  /* Schlafphasen */
  --sl1: #142c6b; --sl2: #c9d5f5; --sl3: #4f6fd8; --sl4: #e2e6ee;

  --shadow: inset 0 1px 0 var(--sheen), 0 1px 2px rgba(15, 30, 70, 0.05), 0 16px 36px -22px rgba(15, 30, 70, 0.25);
  --shadow-hover: inset 0 1px 0 var(--sheen), 0 1px 2px rgba(15, 30, 70, 0.06), 0 24px 48px -22px rgba(15, 30, 70, 0.35);
  --radius: 22px;
  --blur: blur(18px) saturate(140%);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #060c1b;
  --page-glow-1: rgba(59, 91, 219, 0.22);
  --page-glow-2: rgba(30, 58, 138, 0.20);
  --surface: rgba(16, 26, 52, 0.66);
  --surface-solid: #0e1730;
  --surface-2: rgba(200, 215, 255, 0.04);
  --border: rgba(170, 190, 255, 0.09);
  --border-strong: rgba(170, 190, 255, 0.16);
  --sheen: rgba(255, 255, 255, 0.06);
  --ink: #eef2fb; --ink-2: #b4bfd6; --muted: #7883a0;
  --grid: #17213b; --axis: #26314f;
  --accent: #3b5bdb; --accent-2: #6d8cff; --accent-deep: #0b1f4b;
  --s1: #3b5bdb; --s2: #8aa4ff; --s3: #1d2f66; --s4: #5677e8; --s5: #2a44a8; --s7: #4a6ae0;
  --good: #8aa4ff; --warning: #4a6ae0; --critical: #ff5a72;
  --band: rgba(91, 123, 224, 0.13);
  --z1: #14224a; --z2: #1f3577; --z3: #2f4fb0; --z4: #4f6fd8; --z5: #8aa4ff;
  --sl1: #2a44a8; --sl2: #17254f; --sl3: #6d8cff; --sl4: #2a3350;
  --shadow: inset 0 1px 0 var(--sheen), 0 24px 48px -28px rgba(0, 0, 0, 0.95);
  --shadow-hover: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 30px 60px -28px rgba(0, 0, 0, 1), 0 0 0 1px rgba(109, 140, 255, 0.14);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(1200px 620px at 92% -12%, var(--page-glow-1), transparent 62%),
    radial-gradient(900px 520px at -10% 110%, var(--page-glow-2), transparent 60%),
    var(--page);
  background-attachment: fixed;
  color: var(--ink);
  font: 14px/1.55 Manrope, Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
h1, h2, h3, h4, h5, p { margin: 0; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent); color: #fff; }

.app { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }

/* ---------- Navigation ---------- */
.nav {
  position: sticky; top: 0; height: 100vh; padding: 28px 16px;
  display: flex; flex-direction: column; gap: 32px;
  background: var(--surface); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 17px; padding: 0 8px; letter-spacing: -0.02em; }
.brand-mark {
  position: relative; width: 34px; height: 34px; border-radius: 11px; overflow: hidden;
  background: var(--gloss);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 8px 22px -6px color-mix(in srgb, var(--accent) 70%, transparent);
}
.brand-mark::before { content: ""; position: absolute; inset: 0 0 55% 0; background: linear-gradient(rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0)); }
.brand-mark::after {
  content: ""; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M5 17h6l2.5-6 4 11 3-8 1.5 3H27' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
}
.tabs { display: flex; flex-direction: column; gap: 6px; }
.tabs button {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 0; border-radius: 14px;
  background: transparent; color: var(--ink-2); cursor: pointer; text-align: left; font-weight: 600;
  transition: background .2s, color .2s, box-shadow .2s;
}
.tabs button svg { width: 18px; height: 18px; fill: currentColor; flex: none; position: relative; }
.tabs button span { position: relative; }
.tabs button:hover { background: var(--surface-2); color: var(--ink); }
.tabs button[aria-selected="true"] {
  background: var(--gloss); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 12px 26px -12px color-mix(in srgb, var(--accent) 90%, transparent);
}
.tabs button[aria-selected="true"]::before { content: ""; position: absolute; inset: 0 0 52% 0; background: linear-gradient(rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0)); }
.theme-toggle {
  margin-top: auto; align-self: flex-start; width: 42px; height: 42px; border-radius: 13px;
  border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; display: grid; place-items: center;
  transition: background .2s, border-color .2s;
}
.theme-toggle:hover { background: var(--band); border-color: var(--border-strong); }
.theme-toggle svg { width: 18px; height: 18px; fill: var(--ink-2); }

/* ---------- Kopfzeile ---------- */
main { padding: 34px 38px 64px; min-width: 0; max-width: 1520px; width: 100%; }
.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.eyebrow { color: var(--accent-2); font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
h1 { font-size: 40px; font-weight: 800; letter-spacing: -0.04em; margin-top: 4px; line-height: 1.05; }
.top-meta {
  display: flex; align-items: center; gap: 9px; color: var(--ink-2); font-size: 12.5px; font-weight: 600;
  background: var(--surface); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border); padding: 8px 14px; border-radius: 99px; box-shadow: var(--shadow);
}
.dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 10px var(--accent-2); }
.dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--accent-2); opacity: 0; animation: ping 2s ease-out infinite; }
@keyframes ping { 0% { transform: scale(.4); opacity: .7; } 100% { transform: scale(1.6); opacity: 0; } }
.notice { display: none; border: 1px dashed var(--axis); color: var(--ink-2); border-radius: 12px; padding: 10px 14px; margin-bottom: 16px; }
.panel { display: flex; flex-direction: column; gap: 18px; animation: fade .45s cubic-bezier(.2,.8,.2,1); }
.panel[hidden] { display: none; }
@keyframes fade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Karten & Raster ---------- */
.card {
  background: var(--surface); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px;
  box-shadow: var(--shadow); min-width: 0; transition: box-shadow .3s, border-color .3s;
}
.card:hover { box-shadow: var(--shadow-hover); border-color: var(--border-strong); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head h3 { font-size: 16px; font-weight: 800; letter-spacing: -0.02em; display: flex; align-items: center; gap: 10px; }
.card-head h3::before { content: ""; width: 8px; height: 8px; border-radius: 3px; background: var(--gloss); box-shadow: 0 0 10px color-mix(in srgb, var(--accent-2) 55%, transparent); }
.card-head p { color: var(--muted); font-size: 12.5px; margin-top: 3px; padding-left: 18px; }
.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); }
.g-3-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.divider { height: 1px; background: var(--border); margin: 18px 0; }
.chart { position: relative; height: 260px; }
.chart.h-sm { height: 150px; }
.chart.h-lg { height: 400px; }

/* ---------- KPI-Kacheln ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 14px; }
.kpi {
  position: relative; overflow: hidden;
  background: var(--surface); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border); border-radius: 18px; padding: 16px 18px;
  box-shadow: var(--shadow); min-width: 0; transition: transform .25s, box-shadow .25s, border-color .25s;
}
.kpi::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-2), transparent); opacity: 0; transition: opacity .3s;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: var(--border-strong); }
.kpi:hover::before { opacity: 1; }
.kpi .label { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; display: flex; align-items: center; gap: 7px; }
.kpi .label i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.kpi .value { font-size: 30px; font-weight: 800; letter-spacing: -0.04em; margin-top: 8px; white-space: nowrap; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .unit { font-size: 13px; color: var(--muted); font-weight: 700; margin-left: 4px; letter-spacing: 0; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.kpi .bar { height: 6px; border-radius: 6px; background: var(--band); margin-top: 12px; overflow: hidden; }
.kpi .bar span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(180deg, var(--accent-2), var(--accent) 55%, var(--accent-deep)) !important; box-shadow: 0 0 10px color-mix(in srgb, var(--accent-2) 50%, transparent); }

/* ---------- Hero (Bereitschaft) – glänzendes Weinrot ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.4fr); gap: 32px; align-items: center; padding: 30px 32px;
  color: #fff; border: 1px solid color-mix(in srgb, var(--hero-hi) 18%, transparent);
  background:
    radial-gradient(560px 340px at 10% 0%, color-mix(in srgb, var(--hero-hi) 32%, transparent), transparent 60%),
    radial-gradient(700px 460px at 110% 130%, rgba(0, 0, 0, 0.45), transparent 60%),
    var(--hero-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 30px 60px -28px color-mix(in srgb, var(--accent) 90%, transparent);
}
.hero::before { /* Glanzkante oben */
  content: ""; position: absolute; inset: 0 0 58% 0; z-index: -1;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0));
}
.hero::after { /* Lichtreflex */
  content: ""; position: absolute; z-index: -1; top: -60%; left: -10%; width: 45%; height: 220%; opacity: .5;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.12) 45%, transparent 60%);
  transform: rotate(18deg);
}
.hero:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 34px 70px -28px color-mix(in srgb, var(--accent) 100%, transparent); }
.ring-wrap { position: relative; width: 164px; height: 164px; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; filter: drop-shadow(0 0 9px color-mix(in srgb, var(--hero-hi) 70%, transparent)); }
.ring circle { fill: none; stroke-width: 10; }
.ring-bg { stroke: rgba(255, 255, 255, 0.14); }
.ring-fg { stroke: url(#ringGrad); stroke-linecap: round; stroke-dasharray: 327; stroke-dashoffset: 327; transition: stroke-dashoffset 1.4s cubic-bezier(.2,.8,.2,1); }
.ring-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-value { font-size: 50px; font-weight: 800; letter-spacing: -0.05em; line-height: 1; }
.ring-label { font-size: 10.5px; color: rgba(255, 255, 255, 0.78); margin-top: 6px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; }
.pill { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 99px; background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.24); color: #fff; backdrop-filter: blur(6px); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; box-shadow: 0 0 8px var(--hero-hi); }
.hero-text h2 { font-size: 28px; font-weight: 800; letter-spacing: -0.035em; margin: 12px 0 8px; line-height: 1.15; }
.hero-text p { color: rgba(255, 255, 255, 0.8); }
.kpis-hero { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hero .kpi {
  background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14); backdrop-filter: blur(10px); color: #fff;
}
.hero .kpi::before { background: linear-gradient(90deg, transparent, #fff, transparent); }
.hero .kpi:hover { background: rgba(255, 255, 255, 0.12); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2); border-color: rgba(255, 255, 255, 0.22); }
.hero .kpi .label, .hero .kpi .unit, .hero .kpi .sub { color: rgba(255, 255, 255, 0.72); }
.hero .kpi .value { font-size: 28px; }
.hero .kpi .bar { background: rgba(255, 255, 255, 0.16); }
.hero .kpi .bar span { background: linear-gradient(180deg, #fff, var(--hero-hi)) !important; box-shadow: 0 0 10px color-mix(in srgb, var(--hero-hi) 80%, transparent); }

/* ---------- Coach-Bericht ---------- */
.coach { padding: 26px 28px; position: relative; overflow: hidden; }
.coach::before { /* zarter Weinschimmer oben links */
  content: ""; position: absolute; inset: -40% auto auto -10%; width: 60%; height: 120%; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 16%, transparent), transparent);
}
.coach-head { position: relative; display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 22px; }
.coach-head > div:first-child { max-width: 860px; }
.coach-badge {
  display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent-2);
}
.coach-badge svg { width: 16px; height: 16px; fill: currentColor; }
.coach-head h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.2; margin: 8px 0 8px; }
.coach-head p { color: var(--ink-2); line-height: 1.65; }
.coach-stamp { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface-2); }
.coach-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.coach-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: 18px; padding: 18px; min-width: 0; }
.coach-col h4 { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.signals { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.signals li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 8px 0; border-bottom: 1px solid var(--border); }
.signals li:last-child { border-bottom: 0; }
.signals .k { font-weight: 700; font-size: 13px; }
.signals .n { color: var(--muted); font-size: 12px; line-height: 1.45; }
.signals .v { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sig { width: 20px; height: 20px; border-radius: 7px; display: grid; place-items: center; font-size: 11px; font-weight: 900; margin-top: 1px; position: relative; overflow: hidden; }
.sig::after { content: ""; position: absolute; inset: 0 0 50% 0; background: linear-gradient(rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0)); }
.sig-good { background: color-mix(in srgb, var(--s2) 12%, transparent); color: var(--s2); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--s2) 30%, transparent); }
.sig-warn { background: linear-gradient(160deg, var(--s4), var(--s5)); color: #fff; }
.sig-bad { background: linear-gradient(160deg, color-mix(in srgb, var(--critical) 70%, #fff), var(--critical) 60%, color-mix(in srgb, var(--critical) 60%, #000)); color: #fff; box-shadow: 0 0 12px color-mix(in srgb, var(--accent-2) 55%, transparent); }
.focus { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: var(--band); color: var(--ink-2); font-size: 12.5px; line-height: 1.55; }
.focus b { color: var(--ink); display: block; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 2px; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; margin-top: 8px; }
.wk { display: grid; gap: 2px; text-align: center; padding: 7px 2px; border-radius: 10px; font-size: 11px; font-weight: 800; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--border); position: relative; overflow: hidden; }
.wk small { font-size: 10px; font-weight: 700; color: var(--muted); }
.wk-upper, .wk-lower { background: var(--gloss); color: #fff; border-color: color-mix(in srgb, var(--accent-2) 25%, transparent); }
.wk-lower { background: linear-gradient(150deg, var(--s5), var(--accent-deep)); }
.wk-upper::after, .wk-lower::after { content: ""; position: absolute; inset: 0 0 55% 0; background: linear-gradient(rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0)); }
.wk.is-today { outline: 2px solid var(--accent-2); outline-offset: -2px; box-shadow: 0 0 14px color-mix(in srgb, var(--accent-2) 50%, transparent); }
.wk.is-tomorrow { outline: 1px dashed var(--accent-2); outline-offset: -2px; }

.plan { display: flex; flex-direction: column; }
.plan.today {
  background:
    radial-gradient(420px 220px at 0% 0%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 70%),
    linear-gradient(160deg, color-mix(in srgb, var(--accent) 10%, transparent), color-mix(in srgb, var(--accent-deep) 4%, transparent));
  border-color: color-mix(in srgb, var(--accent-2) 30%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.plan-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.plan-top h4 { margin: 0; }
.lv { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; color: var(--ink); }
.lv-bars { display: inline-flex; gap: 3px; align-items: flex-end; }
.lv-bars i { width: 5px; border-radius: 2px; background: var(--axis); }
.lv-bars i:nth-child(1) { height: 7px; } .lv-bars i:nth-child(2) { height: 10px; } .lv-bars i:nth-child(3) { height: 13px; } .lv-bars i:nth-child(4) { height: 16px; }
.lv-bars i.on { background: linear-gradient(180deg, var(--accent-2), var(--accent) 60%, var(--accent-deep)); box-shadow: 0 0 8px color-mix(in srgb, var(--accent-2) 60%, transparent); }
.plan h3 { font-size: 21px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.2; }
.plan-meta { color: var(--muted); font-size: 12px; font-weight: 600; margin: 3px 0 12px; }
.plan-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.plan-list li { position: relative; padding-left: 18px; color: var(--ink-2); font-size: 13px; line-height: 1.5; }
.plan-list li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 7px; height: 7px; border-radius: 2px; transform: rotate(45deg); background: var(--accent-2); box-shadow: 0 0 6px color-mix(in srgb, var(--accent-2) 60%, transparent); }
.plan-sub { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.plan-sub h5 { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.plan-sub .plan-list li::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--accent-2); }
.plan-note { margin-top: 12px; font-size: 12.5px; color: var(--ink-2); padding: 10px 12px; border-radius: 12px; border: 1px dashed var(--border-strong); }
.budget { margin-top: 14px; }
.budget-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-weight: 600; }
.budget-row b { color: var(--ink); font-variant-numeric: tabular-nums; }
.budget-bar { height: 7px; border-radius: 7px; background: var(--band); margin: 6px 0 5px; overflow: hidden; }
.budget-bar span { display: block; height: 100%; border-radius: 7px; background: linear-gradient(180deg, var(--accent-2), var(--accent) 55%, var(--accent-deep)); box-shadow: 0 0 10px color-mix(in srgb, var(--accent-2) 50%, transparent); }
.budget small { color: var(--muted); font-size: 11.5px; line-height: 1.45; display: block; }

/* ---------- 3D-Szenen ---------- */
.span-2 { grid-column: span 1; }
.scene-card { display: flex; flex-direction: column; }
.scene {
  position: relative; flex: 1; min-height: 440px; border-radius: 18px; overflow: hidden; cursor: grab;
  background:
    radial-gradient(ellipse at 50% 30%, color-mix(in srgb, var(--accent-2) 12%, transparent), transparent 70%),
    linear-gradient(180deg, var(--surface-2), transparent);
  border: 1px solid var(--border);
}
.scene:active { cursor: grabbing; }
.scene canvas { display: block; }
.scene .lbl { font-size: 11px; color: var(--muted); font-weight: 700; pointer-events: none; white-space: nowrap; }
.tooltip3d {
  position: fixed; z-index: 50; pointer-events: none; background: var(--surface-solid); border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent-2); border-radius: 12px; padding: 9px 13px; font-size: 12px; color: var(--ink-2);
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.6);
}
.tooltip3d b { color: var(--ink); display: block; font-size: 13px; margin-bottom: 2px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; box-shadow: inset 0 3px 3px -1px rgba(255, 255, 255, 0.35); }
.scale-bar { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.scale-gradient { flex: 1; max-width: 280px; height: 6px; border-radius: 6px; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 5px 14px; border-radius: 9px; cursor: pointer; font-size: 12px; font-weight: 700; color: var(--ink-2); transition: background .15s, color .15s; }
.seg button[aria-pressed="true"] { background: var(--gloss); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 6px 14px -6px color-mix(in srgb, var(--accent) 80%, transparent); }

/* ---------- Listen ---------- */
.predictions, .records { display: grid; gap: 2px; }
.row { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--border); gap: 12px; }
.row:last-child { border-bottom: 0; }
.row .k { color: var(--ink-2); font-weight: 600; }
.row .v { font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.row .d { color: var(--muted); font-size: 12px; margin-left: 8px; font-weight: 500; }
.feed { display: grid; gap: 10px; }
.feed-item {
  display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 14px;
  border-radius: 16px; background: var(--surface-2); border: 1px solid transparent; transition: border-color .2s, transform .2s;
}
.feed-item:hover { border-color: var(--border-strong); transform: translateX(3px); }
.feed-icon { position: relative; overflow: hidden; width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 8px 18px -8px color-mix(in srgb, var(--accent) 80%, transparent); }
.feed-icon::after { content: ""; position: absolute; inset: 0 0 52% 0; background: linear-gradient(rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0)); }
.feed-icon svg { width: 19px; height: 19px; fill: #fff; position: relative; z-index: 1; }
.feed-item .t { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-item .s { color: var(--muted); font-size: 12px; }
.feed-item .m { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.feed-item .m small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }

.dynamics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.dyn { background: var(--surface-2); border-radius: 16px; padding: 14px; border: 1px solid var(--border); }
.dyn .label { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.dyn .value { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; }
.dyn .value small { font-size: 12px; color: var(--muted); font-weight: 600; margin-left: 3px; }
.dyn .spark { height: 44px; position: relative; margin-top: 6px; }

.exercises { display: grid; gap: 10px; }
.ex { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); }
.ex .n { font-weight: 700; }
.ex .mg { color: var(--muted); font-size: 12px; }
.ex .vol { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.ex .sets { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.ex .set { font-size: 12px; padding: 4px 9px; border-radius: 8px; background: var(--surface-solid); border: 1px solid var(--border); color: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-weight: 800; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; position: sticky; top: 0; background: var(--surface-solid); }
td:first-child { font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: var(--band); }
.zbar { display: flex; height: 8px; width: 120px; border-radius: 4px; overflow: hidden; gap: 1px; }

/* ---------- Leere Zustände & Hinweise ---------- */
.empty {
  display: grid; place-items: center; height: 100%; min-height: 140px; margin: 0; padding: 20px; text-align: center;
  color: var(--muted); font-size: 13px; font-weight: 500;
  background: repeating-linear-gradient(135deg, transparent 0 10px, var(--surface-2) 10px 11px); border-radius: 14px;
}
.scene > .empty { position: absolute; inset: 0; cursor: default; border-radius: 0; }
.hint-banner {
  display: flex; flex-direction: column; gap: 2px;
  background: linear-gradient(90deg, var(--band), transparent 70%), var(--surface);
  border: 1px solid var(--border); border-left: 3px solid var(--accent-2); border-radius: 18px;
  padding: 14px 18px; color: var(--ink-2); line-height: 1.6; font-size: 13.5px; box-shadow: var(--shadow);
}
.hint-banner b { color: var(--ink); }
.hint-banner ol { margin: 6px 0 0; padding-left: 20px; }

/* ---------- Training eintragen ---------- */
.log { display: flex; flex-direction: column; gap: 18px; }
.log-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 18px; position: sticky; top: 12px; z-index: 5; }
.log-date { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--muted); }
.log-info { color: var(--muted); font-size: 12px; margin-right: auto; }
.log input[type="number"], .log input[type="date"] {
  font: inherit; font-size: 16px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums;
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 11px; padding: 8px 10px; min-width: 0;
  transition: border-color .15s, box-shadow .15s;
}
.log input[type="date"] { font-size: 14px; color-scheme: inherit; }
.log input:focus { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-2) 22%, transparent); }
.log input::placeholder { color: var(--muted); font-weight: 500; opacity: .7; }
.btn, .btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; font-weight: 800; font-size: 13px;
  border-radius: 12px; padding: 9px 16px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--ink);
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { background: var(--band); }
.btn:active, .btn-primary:active { transform: scale(.97); }
.btn.sm { padding: 6px 11px; font-size: 12px; border-radius: 10px; }
.btn.ghost { background: transparent; }
.btn-primary { position: relative; overflow: hidden; border: 0; color: #fff; background: var(--gloss); padding: 11px 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 12px 26px -12px color-mix(in srgb, var(--accent) 90%, transparent); }
.btn-primary::before { content: ""; position: absolute; inset: 0 0 52% 0; background: linear-gradient(rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0)); }
.lifts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 14px; }
.lift {
  background: var(--surface); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border); border-radius: 20px; padding: 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 12px; min-width: 0;
}
.lift-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.lift-head b { font-size: 15px; letter-spacing: -0.01em; }
.lift-head small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.tag { font-size: 11px; font-weight: 800; padding: 4px 9px; border-radius: 99px; background: var(--band); color: var(--ink-2); white-space: nowrap; }
.tag.up { background: var(--gloss); color: #fff; box-shadow: 0 0 12px color-mix(in srgb, var(--accent-2) 45%, transparent); }
.set-rows { display: grid; gap: 7px; }
.set-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto minmax(0, 0.8fr) auto 28px; gap: 7px; align-items: center; }
.set-n { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--border); }
.set-row .u { font-size: 11px; color: var(--muted); font-weight: 700; }
.x { width: 28px; height: 28px; border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; font-size: 17px; line-height: 1; }
.x:hover:not(:disabled) { background: var(--band); color: var(--ink); }
.x:disabled { opacity: .25; cursor: default; }
.lift-foot { display: flex; align-items: center; gap: 8px; }
.lsp { flex: 1; height: 34px; position: relative; min-width: 60px; }
.lift.stabi { flex-direction: row; align-items: center; cursor: pointer; border-color: color-mix(in srgb, var(--accent-2) 30%, transparent); }
.lift.stabi input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.lift.stabi small { display: block; color: var(--muted); font-size: 12px; }
.log-tools { display: flex; gap: 8px; }
.link { border: 0; background: none; padding: 0; color: var(--accent-2); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 60; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--surface-solid); color: var(--ink); border: 1px solid var(--border-strong); border-left: 3px solid var(--accent-2);
  padding: 11px 18px; border-radius: 14px; font-weight: 700; font-size: 13px; box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.6);
  transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Klickbare Kacheln ---------- */
.is-link { cursor: pointer; }
.kpi.is-link::after {
  content: "›"; position: absolute; right: 14px; top: 12px; font-size: 18px; font-weight: 700; line-height: 1;
  color: var(--muted); transition: transform .2s, color .2s;
}
.hero .kpi.is-link::after { color: rgba(255, 255, 255, 0.6); }
.kpi.is-link:hover::after { transform: translateX(3px); color: var(--accent-2); }
.hero .kpi.is-link:hover::after { color: #fff; }
.kpi.is-link:focus-visible, .signals li.is-link:focus-visible, .ring-wrap:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }
.signals li.is-link { border-radius: 10px; transition: background .15s; margin: 0 -8px; padding-left: 8px; padding-right: 8px; }
.signals li.is-link:hover { background: var(--band); }
.ring-wrap.is-link { border-radius: 50%; transition: transform .25s; }
.ring-wrap.is-link:hover { transform: scale(1.03); }
.more { margin-left: auto; align-self: center; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--accent-2);
  font-weight: 800; font-size: 12px; padding: 5px 11px; border-radius: 99px; cursor: pointer; transition: background .15s; }
.more:hover { background: var(--band); }

/* ---------- Detailansicht (Sheet) ---------- */
body.sheet-open { overflow: hidden; }
.sheet { position: fixed; inset: 0; z-index: 80; display: flex; justify-content: flex-end; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(8, 15, 35, 0.45); backdrop-filter: blur(4px); opacity: 0; transition: opacity .3s; }
.sheet-panel {
  position: relative; width: min(760px, 100%); height: 100%; overflow-y: auto; overscroll-behavior: contain;
  background: var(--page); border-left: 1px solid var(--border); box-shadow: -30px 0 60px -30px rgba(8, 15, 35, 0.5);
  transform: translateX(40px); opacity: 0; transition: transform .35s cubic-bezier(.2,.8,.2,1), opacity .3s;
}
.sheet.open .sheet-backdrop { opacity: 1; }
.sheet.open .sheet-panel { transform: none; opacity: 1; }
.sheet-head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 14px 24px;
  background: color-mix(in srgb, var(--page) 85%, transparent); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--border);
}
.sheet-head .eyebrow { margin-right: auto; }
.sheet-back { display: none; border: 0; background: none; color: var(--accent-2); font-weight: 800; font-size: 15px; cursor: pointer; padding: 4px 0; }
.sheet-x { width: 36px; height: 36px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer; }
.sheet-x:hover { background: var(--band); }
.sheet-body { padding: 22px 28px 48px; display: flex; flex-direction: column; gap: 18px; }
.sheet-body h2 { font-size: 30px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.1; }
.d-hero { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.d-value { font-size: 56px; font-weight: 800; letter-spacing: -0.05em; line-height: 1; font-variant-numeric: tabular-nums;
  background: var(--gloss); -webkit-background-clip: text; background-clip: text; color: transparent; }
.d-value small { font-size: 20px; letter-spacing: 0; margin-left: 4px; }
.d-pill { font-size: 12px; font-weight: 800; padding: 6px 13px; border-radius: 99px; }
.d-good { background: color-mix(in srgb, var(--s2) 18%, transparent); color: var(--accent); }
.d-warn { background: var(--gloss); color: #fff; }
.d-bad { background: var(--critical); color: #fff; }
.d-info { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--border-strong); }
.d-verdict { color: var(--ink-2); font-size: 15px; line-height: 1.6; max-width: 640px; }
.d-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.d-stat { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow); }
.d-stat span { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.d-stat b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -0.03em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.d-stat b small { font-size: 12px; color: var(--muted); font-weight: 700; }
.d-stat em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.d-stat.up b { color: var(--accent-2); }
.d-stat.down b { color: var(--critical); }
.d-sec { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 18px 20px; box-shadow: var(--shadow); }
.d-sec h3 { font-size: 15px; font-weight: 800; letter-spacing: -0.02em; }
.d-sub { color: var(--muted); font-size: 12px; margin: 2px 0 12px; }
.d-sec h3 + .chart, .d-sec h3 + .d-bars, .d-sec h3 + .d-explain, .d-sec h3 + .table-wrap { margin-top: 12px; }
.d-bars { display: grid; gap: 14px; }
.d-bar-top { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; }
.d-bar-top b { font-variant-numeric: tabular-nums; }
.d-track { position: relative; height: 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); margin: 6px 0 4px; overflow: hidden; }
.d-track > span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 10px; background: var(--gloss); }
.d-range { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--accent-2) 22%, transparent); border-left: 2px solid var(--accent-2); border-right: 2px solid var(--accent-2); z-index: 1; }
.d-bar small { color: var(--muted); font-size: 12px; }
.d-explain { color: var(--ink-2); font-size: 14px; line-height: 1.65; }
.d-explain p { margin: 0 0 8px; }
.d-explain ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.d-cta { align-self: flex-start; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .coach-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .coach-grid .state { grid-column: 1 / -1; }
}
@media (max-width: 1100px) {
  .g-3-1 { grid-template-columns: 1fr; }
  .hero { grid-template-columns: auto minmax(0, 1fr); }
  .kpis-hero { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .nav {
    position: fixed; bottom: 0; top: auto; left: 0; right: 0; height: auto; z-index: 20; flex-direction: row; padding: 8px 10px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom)); /* iPhone: Home-Balken */
    border-right: 0; border-top: 1px solid var(--border); gap: 8px; align-items: center; box-shadow: 0 -10px 30px -18px rgba(0, 0, 0, 0.6);
    background: var(--surface-solid);
  }
  .brand { display: none; }
  .tabs { flex-direction: row; flex: 1; justify-content: space-around; gap: 4px; }
  .tabs button { flex-direction: column; gap: 3px; font-size: 11px; padding: 7px 10px; }
  .theme-toggle { margin: 0; }
  main { padding: calc(22px + env(safe-area-inset-top)) 16px calc(100px + env(safe-area-inset-bottom)); }
  h1 { font-size: 30px; }
  .hero { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 24px 16px; gap: 18px; }
  .kpis-hero { grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; text-align: left; }
  .kpis-hero .kpi { padding: 10px; }
  .kpis-hero .kpi .value, .hero .kpi .value { font-size: 20px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .value { font-size: 24px; }
  .scene { min-height: 330px; }
  .card { padding: 16px; }
  .coach { padding: 18px 16px; }
  .coach-head h2 { font-size: 20px; }
  .coach-grid { grid-template-columns: 1fr; }
  .sheet-panel { width: 100%; border-left: 0; transform: translateY(40px); }
  .sheet-head { padding: calc(10px + env(safe-area-inset-top)) 16px 10px; }
  .sheet-back { display: inline-block; }
  .sheet-x { display: none; }
  .sheet-body { padding: 18px 16px calc(40px + env(safe-area-inset-bottom)); }
  .d-value { font-size: 46px; }
  .d-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .log-bar { top: 8px; padding: 12px; gap: 10px; }
  .log-info { display: none; }
  .btn-primary { margin-left: auto; }
  .tabs button { padding: 7px 6px; }
  .toast { bottom: 84px; }
}
@media (prefers-reduced-motion: reduce) {
  .panel { animation: none; }
  .ring-fg { transition: none; }
  .dot::after { animation: none; }
  .kpi, .card, .feed-item { transition: none; }
}
