/* Second Brain – "Nachtinstrument"
   Schwarzes Glas, warmweiße Schrift, Haarlinien wie bei einer Uhr.
   Farbe erscheint nur dort, wo sie etwas bedeutet: Sportart, Pulszone, Status. */

:root {
  color-scheme: dark;
  --bg: #0b0b0d;
  --panel: #131417;
  --panel-2: #1a1b1f;
  --line: rgba(255, 255, 255, 0.075);
  --line-2: rgba(255, 255, 255, 0.14);
  --ink: #f3f1ec;
  --ink-2: #b3b1ab;
  --muted: #7b7a76;
  --grid: #212226;
  --axis: #3a3b41;
  --band: rgba(57, 135, 229, 0.14);

  /* Feste Farb-Slots je Sportart – auf diesem Hintergrund farbenblind-geprüft */
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --series-5: #1fb5c9; /* Schwimmen (nur im Plan) */
  --other: #5c5b56;
  --accent: var(--ink);

  /* Geordnete Blautöne: Pulszonen und Schlafphasen */
  --seq-1: #9ec5f4;
  --seq-2: #6da7ec;
  --seq-3: #3987e5;
  --seq-4: #256abf;
  --seq-5: #184f95;
  --sleep-deep: #256abf;
  --sleep-light: #5598e7;
  --sleep-rem: #9ec5f4;
  --sleep-awake: #4a4a47;

  /* Status – immer mit Symbol + Text */
  --good: #0ca30c;
  --warning: #fab219;
  --critical: #d03b3b;
  --good-text: #3ec43e;
  --bad-text: #ef7373;
  --status: var(--other);

  /* Wochenziel-Ringe als Farbverläufe und Jahres-Heatmap (dunkel → hell = mehr Training) */
  --goal-1a: #ff5a5f;
  --goal-1b: #ffb347;
  --goal-2a: #3987e5;
  --goal-2b: #38d9ff;
  --goal-3a: #b6ff3b;
  --goal-3b: #2ee6a8;
  --heat-0: rgba(255, 255, 255, 0.05);
  --heat-1: #184f95;
  --heat-2: #256abf;
  --heat-3: #3987e5;
  --heat-4: #6da7ec;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.45, 0.5, 1);
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r-panel: 26px;
}

.status-good { --status: var(--good); }
.status-warning { --status: var(--warning); }
.status-critical { --status: var(--critical); }
.status-unknown { --status: var(--other); }

* { box-sizing: border-box; }
html, body { margin: 0; }
html { background: var(--bg); }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
/* Feines Korn – wie mattes Glas */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
#app { position: relative; z-index: 1; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
::selection { background: rgba(255, 255, 255, 0.18); }

/* ---------- Bewegung ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes draw { 0% { stroke-dashoffset: 1; opacity: 0; } 12% { opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 1; } }
@keyframes grow-y { from { transform: scaleY(0); } }
@keyframes grow-x { from { transform: scaleX(0); } }
@keyframes pop { from { transform: scale(0); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0% { transform: scale(1); opacity: 0.55; } 70%, 100% { transform: scale(2.6); opacity: 0; } }
@keyframes bezel { from { transform: rotate(-24deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes form-sweep { from { stroke-dasharray: 0 100; } }

/* Abschnitte fliegen herein, sobald sie ins Bild scrollen (fx.js setzt .rv / .in).
   Nach dem Auftritt bleibt kein transform hängen – sonst würden fest positionierte
   Elemente (Ausklapp-Fenster) am Abschnitt kleben. */
.rv {
  opacity: 0;
  transform: translateY(34px) scale(0.96);
  filter: blur(6px);
}
.rv.in {
  opacity: 1; transform: none; filter: none;
  transition: opacity 0.7s var(--ease), transform 0.95s var(--spring), filter 0.7s var(--ease);
  transition-delay: var(--d, 0s);
}

/* Seitenwechsel: neue Seite schiebt sich herein, alte kippt weg */
::view-transition-old(root) { animation: vt-out 0.32s var(--ease) both; }
::view-transition-new(root) { animation: vt-in 0.5s var(--spring) both; }
:root[data-dir="back"]::view-transition-old(root) { animation-name: vt-out-back; }
:root[data-dir="back"]::view-transition-new(root) { animation-name: vt-in-back; }
@keyframes vt-out { to { opacity: 0; transform: translateX(-12%) scale(0.94); filter: blur(4px); } }
@keyframes vt-in { from { opacity: 0; transform: translateX(16%) scale(1.02); } }
@keyframes vt-out-back { to { opacity: 0; transform: translateX(12%) scale(0.94); filter: blur(4px); } }
@keyframes vt-in-back { from { opacity: 0; transform: translateX(-16%) scale(1.02); } }
.dock { view-transition-name: dock; }
.toast { view-transition-name: toast; }

/* ---------- Laden ---------- */
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 18px; color: var(--muted); }
.boot-mark { width: 88px; height: 88px; }
.boot-mark path {
  fill: none; stroke: var(--ink); stroke-width: 34; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: draw 1.4s var(--ease) infinite alternate;
}
.boot p { font-size: 13px; }

/* ---------- Layout ---------- */
html { overflow-x: clip; }
.shell {
  overflow-x: clip; /* Leuchteffekte dürfen nicht über den Rand ragen – sonst zoomt Android heraus */
  max-width: 560px;
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 18px calc(118px + env(safe-area-inset-bottom));
}
.view { display: flex; flex-direction: column; gap: 18px; position: relative; }

h1, .view-head h1 {
  font-size: 34px;
  font-weight: 800;
  font-stretch: 125%;
  letter-spacing: -0.03em;
  line-height: 1;
}
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding-top: 6px; }
.view-head .sub { color: var(--ink-2); font-size: 14px; margin-top: 8px; }
.section-title {
  font-size: 22px; font-weight: 750; font-stretch: 118%; letter-spacing: -0.02em;
  margin: 14px 0 -4px;
}

.demo-banner {
  display: inline-flex; align-self: flex-start;
  font-size: 12px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 11px; margin: 0 0 14px;
}

/* ---------- Heute ---------- */
.aurora {
  position: absolute; z-index: -1; pointer-events: none;
  left: -40%; right: -40%; top: -160px; height: 620px;
  background:
    radial-gradient(42% 46% at 50% 52%, color-mix(in oklab, var(--status) 26%, transparent), transparent 72%),
    radial-gradient(30% 30% at 22% 30%, color-mix(in oklab, var(--status) 10%, transparent), transparent 70%);
  filter: blur(8px);
  animation: fade 1.6s ease both !important;
}
.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-top: 4px; }
.top h1 { font-size: clamp(26px, 8.2vw, 34px); white-space: nowrap; }
.kicker { font-size: 13px; color: var(--ink-2); margin-bottom: 10px; }
.kicker .err { color: var(--bad-text); }

.hero { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.dial { position: relative; width: min(100%, 330px); aspect-ratio: 1; }
.dial svg { width: 100%; height: 100%; display: block; overflow: visible; }
.dial .face { filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.55)); }
.dial .bezel { transform-origin: 170px 170px; animation: bezel 1.4s var(--ease) both; }
.dial .tick { stroke: var(--axis); stroke-width: 1.5; stroke-linecap: round; }
.dial .tick.major { stroke: var(--ink-2); stroke-width: 2.5; }
.dial .time-track { fill: none; stroke: rgba(255, 255, 255, 0.05); stroke-width: 12; }
.dial .seg {
  fill: none; stroke-width: 12; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: draw 1.3s var(--ease) both;
  animation-delay: calc(0.45s + var(--i, 0) * 0.18s);
}
.dial .hour { fill: var(--muted); font-size: 11px; font-weight: 600; font-stretch: 110%; }
.dial .form-track { fill: none; stroke: rgba(255, 255, 255, 0.06); stroke-width: 9; }
.dial .form-arc {
  fill: none; stroke: var(--status); stroke-width: 9; stroke-linecap: round;
  stroke-dasharray: var(--score) 100;
  filter: drop-shadow(0 0 10px color-mix(in oklab, var(--status) 70%, transparent));
  animation: form-sweep 1.5s var(--ease) 0.35s both;
}
.dial .now-dot { fill: var(--ink); stroke: var(--bg); stroke-width: 2.5; }
.dial .now-pulse {
  fill: var(--ink);
  transform-box: fill-box; transform-origin: center;
  animation: pulse 2.4s ease-out 1.6s infinite;
}
.dial-center { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; pointer-events: none; }
.dial-label { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.dial-score {
  font-size: 78px; font-weight: 800; font-stretch: 112%;
  letter-spacing: -0.045em; line-height: 0.95; margin: 2px 0 4px;
}
.dial-caption { font-size: 13px; font-weight: 650; color: var(--status); letter-spacing: 0.01em; }

.dial-legend {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
}
.dial-legend li {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--ink-2);
  padding: 5px 11px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line);
}
.dial-legend b { color: var(--ink); font-weight: 650; }
.key-dot { width: 8px; height: 8px; border-radius: 50%; }
.key-dot.now { background: var(--ink); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12); }


/* ---------- Panels ---------- */
.panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0) 38%), var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  padding: 16px 16px 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.panel-head h3, .card-head h3 { font-size: 16px; font-weight: 700; font-stretch: 108%; letter-spacing: -0.01em; }
.panel-head .sub { font-size: 12.5px; color: var(--muted); }
.panel.info p, .card.info p { color: var(--ink-2); font-size: 14px; }
.panel.info p + p, .card.info p + p { margin-top: 8px; }
.panel.info h3 { margin-bottom: 8px; }

.signals { list-style: none; margin: 0; padding: 0; }
.signals li {
  display: grid; grid-template-columns: 116px 1fr 48px; gap: 10px; align-items: center;
  padding: 9px 0; font-size: 13.5px;
}
.signals li + li { border-top: 1px solid var(--line); }
.sig-detail { color: var(--ink-2); line-height: 1.3; }
.meter { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.meter-fill {
  display: block; height: 100%; border-radius: 2px;
  transform-origin: left; animation: grow-x 1s var(--ease) both;
  animation-delay: calc(0.5s + var(--i, 0) * 0.07s);
}
.signals li { --i: 0; }
.meter-fill.good { background: var(--good); }
.meter-fill.warning { background: var(--warning); }
.meter-fill.critical { background: var(--critical); }

.status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--ink); }
.status-icon {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  display: inline-grid; place-items: center;
  font-size: 10.5px; font-weight: 900; color: #0b0b0d;
}
.status-good .status-icon { background: var(--good); }
.status-warning .status-icon { background: var(--warning); }
.status-critical .status-icon { background: var(--critical); color: #fff; }
.status-unknown .status-icon { background: var(--other); color: #fff; }

/* Woche */
.week-cols { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.wday { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.wbar {
  width: 100%; max-width: 30px; height: 74px;
  display: flex; flex-direction: column-reverse; gap: 2px;
  border-radius: 9px; padding: 0;
  background: rgba(255, 255, 255, 0.035);
  overflow: hidden;
}
.wseg {
  display: block; width: 100%; flex: none; border-radius: 2px;
  transform-origin: bottom; animation: grow-y 0.8s var(--spring) both;
  animation-delay: calc(0.5s + var(--i, 0) * 0.06s);
}
.wday:nth-child(1) .wseg { --i: 0; } .wday:nth-child(2) .wseg { --i: 1; } .wday:nth-child(3) .wseg { --i: 2; }
.wday:nth-child(4) .wseg { --i: 3; } .wday:nth-child(5) .wseg { --i: 4; } .wday:nth-child(6) .wseg { --i: 5; }
.wday:nth-child(7) .wseg { --i: 6; }
.wseg:last-child { border-radius: 7px 7px 2px 2px; }
.wval { font-size: 11px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.wlabel { font-size: 12px; font-weight: 600; color: var(--muted); }
.wday.today .wlabel {
  color: var(--bg); background: var(--ink);
  border-radius: 999px; padding: 1px 8px;
}
.wday.today .wbar { box-shadow: inset 0 0 0 1px var(--line-2); }
.wday.future { opacity: 0.4; }
.week .legend { margin: 12px 0 0; }

/* ---------- Kennzahlen: ein Instrumentenfeld ---------- */
.tiles {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--r-panel); overflow: hidden;
}
.tile {
  background: var(--panel);
  padding: 15px 15px 12px;
  display: flex; flex-direction: column; gap: 3px; min-width: 0;
  transition: background 0.2s ease;
}
.tile:last-child:nth-child(odd) { grid-column: span 2; }
.tile:active { background: var(--panel-2); }
.tile-label { font-size: 12.5px; color: var(--ink-2); }
.tile-value { font-size: 30px; font-weight: 750; font-stretch: 112%; letter-spacing: -0.03em; line-height: 1.1; }
.tile-unit { font-size: 13px; font-weight: 500; font-stretch: 100%; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.tile-sub { font-size: 12px; color: var(--muted); }
.delta { font-weight: 650; color: var(--ink-2); }
.delta.good { color: var(--good-text); }
.delta.bad { color: var(--bad-text); }
.spark { margin-top: 8px; }

/* ---------- Abschnitte (Diagramme ohne Kasten, getrennt durch Haarlinien) ---------- */
.card { margin: 0; padding: 20px 0 4px; border-top: 1px solid var(--line); min-width: 0; }
.card.info {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 16px;
}
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.card-head .sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.chart-card .legend { margin: 0 0 10px; }
.info ol { margin: 10px 0 0; padding-left: 20px; color: var(--ink-2); font-size: 14px; }
.info li + li { margin-top: 4px; }

/* ---------- Bedienelemente ---------- */
.btn {
  border: 0; border-radius: 999px; padding: 11px 20px;
  font-weight: 700; background: var(--ink); color: var(--bg);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform 0.15s var(--ease), opacity 0.2s;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.55; cursor: default; }
.ghost {
  background: transparent; border: 1px solid var(--line-2); border-radius: 999px;
  padding: 5px 12px; color: var(--ink-2); text-decoration: none;
  transition: background 0.2s, color 0.2s, transform 0.15s var(--ease);
}
.ghost:active { transform: scale(0.95); }
.ghost.small { font-size: 12.5px; }
.ghost[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.icon-btn {
  width: 46px; height: 46px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line-2); color: var(--ink);
  backdrop-filter: blur(10px);
  transition: transform 0.2s var(--spring), border-color 0.3s, box-shadow 0.5s, color 0.3s;
}
.icon-btn:active { transform: scale(0.88); }
.icon-btn.busy svg { animation: spin 0.9s linear infinite; }
.icon-btn.busy { cursor: progress; }
.icon-btn.done { color: var(--good-text); border-color: var(--good); box-shadow: 0 0 0 7px color-mix(in oklab, var(--good) 16%, transparent); }
.icon-btn.done svg { animation: pop 0.45s var(--spring) both; }
.icon-btn.error { border-color: var(--critical); }

.range {
  position: relative; align-self: flex-start;
  display: grid; grid-template-columns: repeat(var(--n), minmax(52px, auto));
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px;
}
.range-pill {
  position: absolute; top: 3px; bottom: 3px; left: 3px;
  width: calc((100% - 6px) / var(--n));
  transform: translateX(calc(var(--idx) * 100%));
  background: var(--ink); border-radius: 999px;
  transition: transform 0.45s var(--spring);
}
.range button {
  position: relative; z-index: 1; border: 0; background: transparent;
  border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600;
  color: var(--ink-2); transition: color 0.3s;
}
.range button.on { color: var(--bg); }

/* ---------- Diagramme ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; overflow: visible; touch-action: pan-y; outline: none; }
.chart svg:focus-visible { outline: 2px solid var(--ink-2); outline-offset: 3px; border-radius: 6px; }
.chart .grid { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .end-label, .chart .cap-label { fill: var(--ink); font-size: 12px; font-weight: 700; }
.chart .cap-label { animation: fade 0.6s ease 0.8s both; }
.chart .band { fill: var(--band); animation: fade 1s ease 0.2s both; }
.chart .area { animation: fade 1.1s ease 0.6s both; }
.chart .line {
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: draw 1.2s var(--ease) both;
  animation-delay: calc(0.15s + var(--i, 0) * 0.2s);
}
.chart .ring { stroke: var(--bg); stroke-width: 2; }
.chart .dot { transform-box: fill-box; transform-origin: center; animation: pop 0.5s var(--spring) 0.9s both; }
.chart .hot { filter: drop-shadow(0 0 7px currentColor); }
.chart .crosshair { stroke: var(--ink-2); stroke-width: 1; stroke-opacity: 0.45; }
.chart .hit { fill: transparent; outline: none; }
.chart .bars .col {
  transform-box: fill-box; transform-origin: 50% 100%;
  animation: grow-y 0.75s var(--spring) both;
  animation-delay: calc(0.1s + var(--i, 0) * 0.025s);
  transition: opacity 0.2s ease;
}
.chart-empty { color: var(--muted); font-size: 13px; padding: 22px 0; text-align: center; }
.spark .line { animation-duration: 1.4s; animation-delay: 0.6s; }
.spark .dot { animation-delay: 1.5s; }
.spark .ring { stroke: var(--panel); }

.tooltip {
  position: absolute; z-index: 5; pointer-events: none;
  background: rgba(26, 27, 31, 0.82);
  backdrop-filter: blur(14px) saturate(1.3);
  border: 1px solid var(--line-2);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
  border-radius: 14px; padding: 9px 12px;
  font-size: 12.5px; min-width: 126px; max-width: 230px;
  animation: fade 0.15s ease both;
}
.tt-title { color: var(--muted); margin-bottom: 5px; }
.tt-row { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.tt-row + .tt-row { margin-top: 2px; }
.tt-row strong { font-weight: 700; color: var(--ink); }
.tt-label { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; }
.tt-key { flex: none; }
.tt-line { width: 12px; height: 2px; border-radius: 1px; }
.tt-rect { width: 8px; height: 8px; border-radius: 2px; }

.legend { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 5px 14px; font-size: 12.5px; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.key { display: inline-block; flex: none; }
.key-rect { width: 10px; height: 10px; border-radius: 3px; }
.key-line { width: 14px; height: 2px; border-radius: 1px; }

.hbars { display: flex; flex-direction: column; gap: 11px; }
.hbar { display: grid; grid-template-columns: minmax(100px, 38%) 1fr auto; align-items: center; gap: 12px; font-size: 13px; }
.hbar-label { color: var(--ink); line-height: 1.2; }
.hbar-note { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.hbar-track { height: 10px; border-radius: 0 5px 5px 0; background: rgba(255, 255, 255, 0.035); }
.hbar-fill {
  height: 100%; border-radius: 0 5px 5px 0; min-width: 2px;
  transform-origin: left; animation: grow-x 0.9s var(--ease) both;
  animation-delay: calc(0.15s + var(--i, 0) * 0.05s);
}
.hbar-value { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 46px; text-align: right; }

.table-wrap { overflow-x: auto; max-height: 360px; overflow-y: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; animation: fade 0.3s ease both; }
th { text-align: left; font-weight: 600; color: var(--muted); padding: 7px 10px 7px 0; border-bottom: 1px solid var(--line-2); position: sticky; top: 0; background: var(--bg); }
td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; white-space: nowrap; }
td:first-child { white-space: normal; }
tr:last-child td { border-bottom: 0; }
.card.info table th, .panel table th { background: var(--panel); }

/* ---------- Aktivitäten ---------- */
.acts { list-style: none; margin: 0; padding: 0; }
.acts li + li { border-top: 1px solid var(--line); }
.act {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center;
  padding: 11px 4px 11px 0; text-decoration: none; color: inherit;
  border-radius: 14px; transition: background 0.2s, transform 0.15s var(--ease);
}
.act:active { transform: scale(0.98); background: rgba(255, 255, 255, 0.03); }
.act-badge {
  width: 40px; height: 40px; border-radius: 13px;
  display: grid; place-items: center;
  color: var(--sport);
  background: color-mix(in oklab, var(--sport) 16%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--sport) 30%, transparent);
}
.act-name { font-weight: 650; font-size: 14.5px; }
.act-meta { font-size: 12.5px; color: var(--muted); }
.act-right { text-align: right; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.more { margin-top: 10px; }

.chip {
  display: inline-flex; align-self: flex-start; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--ink-2);
  border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 12px;
}
.back { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; padding: 6px 12px 6px 8px; }
.fine { font-size: 12px; color: var(--muted); text-align: center; padding: 6px 10px; }

/* ---------- Login ---------- */
.login { max-width: 360px; margin: 16vh auto 0; display: flex; flex-direction: column; gap: 12px; }
.login .boot-mark { width: 64px; height: 64px; margin-bottom: 6px; }
.login .boot-mark path { animation: draw 1.6s var(--ease) both; }
.login h1 { font-size: 34px; }
.login p { color: var(--ink-2); margin-bottom: 8px; }
.login input {
  font: inherit; color: var(--ink);
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px;
  padding: 13px 14px; outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.login input:focus { border-color: var(--ink-2); box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.06); }
.login .error { color: var(--bad-text); font-size: 14px; }
.login .btn { margin-top: 6px; }

/* ---------- Schwebende Navigation ---------- */
.dock {
  position: fixed; z-index: 20;
  left: 0; right: 0; margin: 0 auto; bottom: calc(14px + env(safe-area-inset-bottom));
  width: min(430px, calc(100% - 24px)); height: 66px; padding: 6px;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(22, 23, 26, 0.72);
  backdrop-filter: blur(22px) saturate(1.5);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  border: 1px solid var(--line-2); border-radius: 24px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: rise 0.8s var(--ease) 0.2s both;
}
.dock-pill {
  position: absolute; top: 6px; bottom: 6px; left: 6px;
  width: calc((100% - 12px) / 5);
  transform: translateX(calc(var(--idx) * 100%));
  background: rgba(255, 255, 255, 0.09); border-radius: 18px;
  transition: transform 0.5s var(--spring), opacity 0.3s;
}
.dock-pill.hidden { opacity: 0; }
.dock a {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-decoration: none; color: var(--muted); font-size: 10.5px; font-weight: 600;
  transition: color 0.3s;
}
.dock a svg { transition: transform 0.35s var(--spring); }
.dock a.on { color: var(--ink); }
.dock a.on svg { transform: translateY(-1px) scale(1.08); }
.dock a:active svg { transform: scale(0.85); }

/* ---------- Hinweis oben ---------- */
.toast {
  position: fixed; z-index: 30; left: 50%; top: calc(12px + env(safe-area-inset-top));
  transform: translate(-50%, -160%);
  display: inline-flex; align-items: center; gap: 9px;
  padding: 10px 16px 10px 12px; border-radius: 999px;
  background: rgba(26, 27, 31, 0.86); backdrop-filter: blur(16px);
  border: 1px solid var(--line-2); box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  font-size: 13.5px; font-weight: 600; max-width: calc(100% - 32px);
  transition: transform 0.55s var(--spring);
}
.toast svg { color: var(--good-text); flex: none; }
.toast.error svg { color: var(--bad-text); }
.toast.show { transform: translate(-50%, 0); }

/* ---------- Unteransichten (Training: Woche · Plan · Jahr) ---------- */
.stack { display: flex; flex-direction: column; gap: 18px; }
.subtabs { align-self: stretch; grid-template-columns: repeat(var(--n), 1fr); }
.range a {
  position: relative; z-index: 1; text-align: center; text-decoration: none;
  border-radius: 999px; padding: 7px 12px; font-size: 13.5px; font-weight: 650;
  color: var(--ink-2); transition: color 0.3s;
}
.range a.on { color: var(--bg); }

/* ---------- Heute: Plan, Ringe, Woche ---------- */
/* ---------- Coach: Plakat-Karte im Sport-Werbespot-Stil ---------- */
.coach {
  --c1: #5b8cff; --c2: #9b6bff;
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: 28px; padding: 18px 18px 16px;
  background: #0f1013; border: 1px solid var(--line-2);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.coach.mode-push { --c1: #ff6a3d; --c2: #ff2e7e; }
.coach.mode-brake { --c1: #ffb020; --c2: #ff4d4d; }
.coach.mode-rehab { --c1: #2ee6c8; --c2: #3a86ff; }
.coach.mode-hold { --c1: #5b8cff; --c2: #9b6bff; }
.coach.mode-rest { --c1: #7c8cff; --c2: #c39bff; }
.coach-bg {
  position: absolute; inset: -45%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(38% 34% at 22% 18%, color-mix(in oklab, var(--c1) 70%, transparent), transparent 70%),
    radial-gradient(42% 38% at 82% 34%, color-mix(in oklab, var(--c2) 60%, transparent), transparent 70%);
  filter: blur(28px); opacity: 0.5;
  animation: drift 14s ease-in-out infinite alternate;
}
@keyframes drift { from { transform: translate(-5%, -3%) rotate(0deg); } to { transform: translate(5%, 4%) rotate(10deg); } }
.coach-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.coach-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px;
  background: linear-gradient(90deg, var(--c1), var(--c2)); color: #0b0b0d;
  font-size: 11.5px; font-weight: 850; text-transform: uppercase; letter-spacing: 0.07em;
  box-shadow: 0 6px 20px color-mix(in oklab, var(--c1) 40%, transparent);
}
.coach-by { font-size: 12px; color: var(--ink-2); }
.coach-headline {
  margin: 16px 0 10px;
  font-size: clamp(34px, 10.4vw, 46px); font-weight: 900; font-stretch: 70%;
  text-transform: uppercase; line-height: 0.94; letter-spacing: 0;
  text-shadow: 0 8px 40px color-mix(in oklab, var(--c1) 45%, transparent);
}
.coach-headline .w {
  display: inline-block; margin-right: 0.22em;
  animation: word 0.65s var(--spring) backwards;
  animation-delay: calc(0.25s + var(--i) * 0.07s);
}
@keyframes word { from { opacity: 0; transform: translateY(55%) rotate(5deg); filter: blur(6px); } }
.coach-text { color: var(--ink-2); font-size: 15px; line-height: 1.45; }
.coach-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.coach-list li {
  display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: start; font-size: 14px; line-height: 1.35;
  animation: rise 0.5s var(--ease) backwards; animation-delay: calc(0.6s + var(--i) * 0.06s);
}
.coach-list li svg { margin-top: 1px; }
.coach-list.do li svg { color: var(--c1); }
.coach-list.avoid { margin-top: 10px; }
.coach-list.avoid li { color: var(--ink-2); }
.coach-list.avoid li svg { color: #ff6b6b; }
.coach-why { margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.coach-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.coach .btn { background: linear-gradient(90deg, var(--c1), var(--c2)); color: #0b0b0d; }
.coach-fine { margin-top: 12px; font-size: 11.5px; color: var(--muted); }

.budget { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.budget-head { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-2); margin-bottom: 8px; }
.budget-head b { color: var(--ink); font-variant-numeric: tabular-nums; }
.budget-track { position: relative; height: 10px; border-radius: 5px; background: rgba(255, 255, 255, 0.07); }
.budget-fill {
  height: 100%; border-radius: 5px; transform-origin: left;
  animation: grow-x 1.2s var(--ease) 0.5s backwards;
}
.budget.ok .budget-fill { background: linear-gradient(90deg, #2ee6a8, #38d9ff); }
.budget.near .budget-fill { background: linear-gradient(90deg, #2ee6a8, #ffb020); }
.budget.over .budget-fill { background: linear-gradient(90deg, #ffb020, #ff4d4d); box-shadow: 0 0 16px rgba(255, 77, 77, 0.5); }
.budget-cap { position: absolute; top: -4px; bottom: -4px; width: 2px; border-radius: 1px; background: var(--ink); }
.budget small { display: block; margin-top: 8px; font-size: 12.5px; color: var(--ink-2); }
.budget.over small { color: #ff8a8a; font-weight: 650; }

.phases { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 14px; }
.phase { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); position: relative; }
.phase i {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-style: normal; font-weight: 800; font-size: 12px;
  background: rgba(255, 255, 255, 0.06); color: var(--ink-2);
}
.phase.done i { background: var(--c1); color: #0b0b0d; }
.phase.now { color: var(--ink); font-weight: 700; }
.phase.now i { background: linear-gradient(135deg, var(--c1), var(--c2)); color: #0b0b0d; box-shadow: 0 0 0 4px color-mix(in oklab, var(--c1) 25%, transparent); animation: breathe 2.4s ease-in-out infinite; }
.phase-goal { grid-column: 1 / -1; margin-top: 6px; font-size: 12.5px; color: var(--ink-2); }

/* Check-in */
.checkin .q { font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }
.feel-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.feel {
  --feel: #8a8f98;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 2px; border-radius: 16px; font-size: 12px; font-weight: 650; color: var(--ink-2);
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line);
  transition: transform 0.2s var(--spring), background 0.2s, border-color 0.2s, color 0.2s;
}
.feel:nth-child(1) { --feel: #ff4d4d; }
.feel:nth-child(2) { --feel: #ffb020; }
.feel:nth-child(3) { --feel: #c9ccd4; }
.feel:nth-child(4) { --feel: #2ee6a8; }
.feel:nth-child(5) { --feel: #38d9ff; }
.feel svg rect { fill: rgba(255, 255, 255, 0.12); transition: fill 0.2s; }
.feel svg rect.on { fill: var(--ink-2); }
.feel:active { transform: scale(0.92); }
.feel.on { color: var(--ink); border-color: var(--feel); background: color-mix(in oklab, var(--feel) 14%, transparent); }
.feel.on svg rect.on { fill: var(--feel); }
.feel.on svg { animation: pop 0.4s var(--spring) both; }
.pain { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; font-size: 13.5px; color: var(--ink-2); }
.pain b { color: var(--ink); }
.pain b.mid { color: #ffb020; }
.pain b.bad { color: #ff6b6b; }
.pain input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 4px; outline: none;
  background:
    linear-gradient(90deg, #2ee6a8, #ffb020 50%, #ff4d4d) 0 0 / var(--v, 0%) 100% no-repeat,
    rgba(255, 255, 255, 0.08);
}
.pain input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 26px; height: 26px; border-radius: 50%;
  background: var(--ink); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5), 0 0 0 4px rgba(255, 255, 255, 0.08);
}
.pain input[type="range"]::-moz-range-thumb { width: 26px; height: 26px; border: 0; border-radius: 50%; background: var(--ink); }
.pain-scale { display: flex; justify-content: space-between; color: var(--muted); }
.checkin .btn.wide { margin-top: 16px; }
.checkin-done {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 12px 14px; border-radius: 18px; text-align: left;
  background: var(--panel); border: 1px solid var(--line); color: var(--ink-2); font-size: 13.5px;
}
.checkin-done b { color: var(--ink); }
.checkin-done small { margin-left: auto; color: var(--muted); }
.checkin-ok { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: #0b0b0d; background: #2ee6a8; flex: none; }

/* Comeback starten */
.sheet-text { color: var(--ink-2); font-size: 14px; margin: -6px 0 14px; }
.area-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn {
  padding: 8px 13px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--ink-2);
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line);
  transition: transform 0.2s var(--spring), background 0.2s, color 0.2s;
}
.chip-btn:active { transform: scale(0.93); }
.chip-btn.on { color: #0b0b0d; border-color: transparent; background: linear-gradient(90deg, #2ee6c8, #3a86ff); }
.sev { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; font-size: 12.5px; color: var(--muted); }
.sev-range { align-self: stretch; grid-template-columns: repeat(3, 1fr); }

/* ---------- 3D: Zifferblatt neigt sich, Jahres-Skyline ---------- */
.dial {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d;
}
.dial-glare {
  position: absolute; inset: 6%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 32%), rgba(255, 255, 255, 0.14), transparent 42%);
  mix-blend-mode: screen;
}
.dial-center { transform: translateZ(40px); }
.skyline-stage {
  width: 100%; aspect-ratio: 1 / 0.8; border-radius: 18px; overflow: hidden;
  background: radial-gradient(60% 55% at 50% 45%, rgba(57, 135, 229, 0.14), transparent 70%);
}
.skyline-stage.loading { display: grid; place-items: center; }
.skyline-stage.loading::after { content: "Baue dein Jahr in 3D …"; color: var(--muted); font-size: 13px; }
.skyline-stage canvas { display: block; width: 100% !important; height: 100% !important; animation: fade 0.8s ease both; cursor: grab; }
.skyline-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; margin-top: 10px; font-size: 12.5px; color: var(--ink-2); }
.skyline-foot b { color: var(--ink); }

.goals-body { display: grid; grid-template-columns: 132px 1fr; gap: 16px; align-items: center; }
.rings { width: 132px; height: 132px; transform: rotate(0deg); }
.ring-track { fill: none; stroke: color-mix(in oklab, var(--ring) 16%, transparent); stroke-width: 11; }
.ring-fill {
  fill: none; stroke-width: 11; stroke-linecap: round;
  stroke-dasharray: var(--pct) 100;
  animation: form-sweep 1.4s var(--ease) both;
  animation-delay: calc(0.35s + var(--i, 0) * 0.15s);
}
.rings .closed .ring-fill { filter: drop-shadow(0 0 6px color-mix(in oklab, var(--ring) 70%, transparent)); }
.goal-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.goal-list li { display: grid; grid-template-columns: 14px 1fr auto; column-gap: 8px; align-items: center; font-size: 13px; }
.goal-label { font-weight: 650; }
.goal-value { grid-column: 2; color: var(--muted); font-size: 12px; }
.goal-value b { color: var(--ink-2); font-weight: 650; }
.goal-pct { grid-row: 1 / span 2; grid-column: 3; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.goal-pct.done { color: var(--good-text); display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: color-mix(in oklab, var(--good) 16%, transparent); }
.goal-list .key-line { grid-row: 1; }

.wplan {
  position: absolute; left: 3px; right: 3px; bottom: 3px; height: 44%;
  border-radius: 7px; border: 1.5px dashed color-mix(in oklab, var(--sport) 70%, transparent);
  color: var(--sport); display: grid; place-items: center; opacity: 0.85;
}
.wday.today .wplan { animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.45; } }
.wbar { position: relative; }
.key-plan { width: 12px; height: 10px; border-radius: 3px; border: 1.5px dashed var(--ink-2); }

/* ---------- Plan ---------- */
.plan-progress { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin: -2px 0 12px; }
.plan-progress i {
  height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.07);
  transform-origin: left; animation: grow-x 0.6s var(--ease) both;
  animation-delay: calc(0.2s + var(--i, 0) * 0.06s);
}
.plan-progress i.done, .plan-progress i.swapped, .plan-progress i.extra { background: var(--sport); }
.plan-progress i.missed { background: color-mix(in oklab, var(--critical) 55%, transparent); }
.plan-progress i.today { background: linear-gradient(90deg, var(--sport) 40%, rgba(255, 255, 255, 0.07) 40%); }
.plan-progress i.rest, .plan-progress i.rested { background: rgba(255, 255, 255, 0.03); }
.plan-days { list-style: none; margin: 0; padding: 0; }
.plan-day + .plan-day { border-top: 1px solid var(--line); }
.plan-day button {
  width: 100%; display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center;
  padding: 10px 2px; border: 0; background: transparent; text-align: left;
  border-radius: 14px; transition: background 0.2s, transform 0.15s var(--ease);
}
.plan-day button:active { transform: scale(0.98); background: rgba(255, 255, 255, 0.03); }
.plan-day .act-badge { color: var(--sport); background: color-mix(in oklab, var(--sport) 16%, transparent); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--sport) 30%, transparent); }
.plan-wd { font-weight: 750; font-stretch: 110%; display: flex; flex-direction: column; line-height: 1.15; }
.plan-wd small { color: var(--muted); font-weight: 500; font-size: 11.5px; font-stretch: 100%; }
.plan-what { display: flex; flex-direction: column; min-width: 0; }
.plan-what b { font-weight: 650; }
.plan-what small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-status { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.plan-day.done .plan-status, .plan-day.swapped .plan-status, .plan-day.extra .plan-status { color: var(--good-text); }
.plan-day.missed .plan-status { color: var(--bad-text); }
.plan-day.today .plan-status { color: var(--ink); font-weight: 650; }
.plan-day.rest .plan-what b, .plan-day.rested .plan-what b { color: var(--ink-2); font-weight: 500; }
.plan-day { animation: rise 0.5s var(--ease) backwards; animation-delay: calc(0.15s + var(--i, 0) * 0.04s); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); position: relative; }
.live-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--ink); animation: pulse 2s ease-out infinite; }
.plan-hint { font-size: 12.5px; color: var(--muted); margin-top: 10px; }

/* Plan: Wochen-Navigation, mehrere Einheiten pro Tag, Arbeitstage, Comeback-Anpassung */
.week-nav { display: grid; grid-template-columns: 36px 1fr 36px; gap: 10px; align-items: center; margin-bottom: 12px; }
.week-nav-title { text-align: center; display: flex; flex-direction: column; gap: 2px; }
.week-nav-title .sub { font-size: 12px; color: var(--muted); }
.week-nav .next svg { transform: rotate(180deg); }
.icon-btn:disabled { opacity: 0.3; cursor: default; }
.plan-sessions { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.plan-session { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: center; min-width: 0; }
.act-badge.small { width: 30px; height: 30px; border-radius: 10px; }
.plan-session.rest { --sport: var(--muted); }
.plan-session.adapted .plan-what small, .plan-trim { color: #5fe3cf; }
.plan-trim { font-size: 11.5px; }
.plan-session .plan-what small { white-space: normal; }
.work-chip {
  display: inline-flex; align-self: flex-start; align-items: center; gap: 5px; max-width: 100%;
  font-size: 11.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px 2px 7px;
}
.work-chip svg { flex: none; }
.work-chip.game { color: #ffd27a; border-color: rgba(255, 210, 122, 0.3); background: rgba(255, 210, 122, 0.08); }
.plan-banner { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; border-radius: 12px; padding: 8px 11px; margin: 0 0 10px; }
.plan-banner svg { flex: none; }
.plan-banner.rehab { color: #bff6ee; background: linear-gradient(90deg, rgba(46, 230, 200, 0.16), rgba(58, 134, 255, 0.12)); border: 1px solid rgba(46, 230, 200, 0.25); }
.plan-banner.work { color: var(--ink-2); background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); }
.plan-progress i.partial { background: linear-gradient(90deg, var(--sport) 50%, color-mix(in oklab, var(--critical) 55%, transparent) 50%); }
.plan-day.partial .plan-status { color: var(--warning); }
.wplan-n {
  position: absolute; top: -7px; right: -5px; min-width: 15px; height: 15px; border-radius: 8px;
  font-size: 10px; font-weight: 800; line-height: 15px; text-align: center; color: var(--bg); background: var(--sport);
}
.edit-work { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); margin: -6px 0 12px; }
.edit-sessions { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.edit-sessions li {
  display: flex; flex-direction: column; gap: 9px; padding: 10px; border-radius: 16px;
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); border-left: 3px solid var(--sport);
  animation: rise 0.35s var(--ease) both;
}
.edit-session-head { display: grid; grid-template-columns: 30px 1fr 36px; gap: 10px; align-items: center; }
.slot-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-btn.small { padding: 5px 10px; font-size: 12px; }
.session-note {
  font: inherit; font-size: 14px; color: var(--ink); outline: none;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 10px;
}
.session-note:focus { border-color: var(--ink-2); }
.add-session { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; }
.edit-warn { font-size: 12.5px; color: var(--warning); margin-top: 12px; }
.edit-info { font-size: 12.5px; color: #8eeee0; margin-top: 12px; }
.check-row { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 14px; color: var(--ink-2); }
.check-row input { width: 18px; height: 18px; accent-color: var(--ink); }
.sheet-actions .reset { margin-right: auto; }

.kind-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kind {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 12px 6px; border-radius: 16px; font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line);
  transition: transform 0.2s var(--spring), border-color 0.2s, background 0.2s, color 0.2s;
}
.kind .act-badge { color: var(--sport); background: color-mix(in oklab, var(--sport) 16%, transparent); }
.kind:active { transform: scale(0.94); }
.kind.on { color: var(--ink); border-color: var(--sport); background: color-mix(in oklab, var(--sport) 10%, transparent); }
.kind.on .act-badge { animation: pop 0.4s var(--spring) both; }
.field { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.field input {
  font: inherit; font-size: 15px; color: var(--ink);
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 11px 12px; outline: none;
}
.field input:focus { border-color: var(--ink-2); }
.sheet-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

.stepper { display: grid; grid-template-columns: 1fr 36px 92px 36px; gap: 8px; align-items: center; padding: 8px 0; }
.stepper + .stepper { border-top: 1px solid var(--line); }
.stepper-label { font-size: 14px; font-weight: 600; display: flex; flex-direction: column; }
.stepper-label small { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.stepper-value { text-align: center; font-weight: 750; font-stretch: 110%; font-variant-numeric: tabular-nums; }
.icon-btn.small { width: 36px; height: 36px; }
.btn.wide { width: 100%; margin-top: 12px; }

/* Ausklapp-Fenster */
.sheet-layer { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
.sheet-layer.open { pointer-events: auto; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55); opacity: 0; transition: opacity 0.35s ease; backdrop-filter: blur(2px); }
.sheet-layer.open .sheet-backdrop { opacity: 1; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 560px;
  max-height: 88vh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line-2); border-bottom: 0;
  border-radius: 28px 28px 0 0;
  padding: 10px 18px calc(22px + env(safe-area-inset-bottom));
  transform: translateY(105%); transition: transform 0.5s var(--spring);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.5);
}
.sheet-layer.open .sheet { transform: none; }
.sheet-grip { width: 42px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 0 auto 12px; }
.sheet-title { font-size: 20px; font-weight: 780; font-stretch: 118%; letter-spacing: -0.02em; margin-bottom: 14px; }
/* Sperre am Wurzelelement – nur dort wirkt sie auf das Scrollen der ganzen Seite */
html:has(> body.no-scroll) { overflow: hidden; }

/* ---------- Jahr ---------- */
.heat .cell {
  transform-box: fill-box; transform-origin: center;
  animation: pop 0.45s var(--spring) both;
  animation-delay: calc(0.1s + var(--m) * 70ms + var(--d) * 9ms);
}
.heat .cell.future { stroke: rgba(255, 255, 255, 0.07); stroke-width: 1; }
.heat .month-label { fill: var(--ink); font-size: 12px; font-weight: 700; font-stretch: 110%; }
.heat .cell-hot { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.heat svg { touch-action: pan-y; }
.heat-legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; font-size: 11.5px; color: var(--muted); margin-top: 10px; }
.heat-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.heat-legend span:first-child { margin-right: 4px; }
.heat-legend span:last-child { margin-left: 4px; }
.flame { color: var(--warning); display: inline-flex; margin-top: -2px; }
.flame svg { transform-origin: 50% 90%; animation: flicker 1.6s ease-in-out infinite; }
@keyframes flicker {
  0%, 100% { transform: scale(1) rotate(-2deg); }
  30% { transform: scale(1.08, 0.94) rotate(2deg); }
  60% { transform: scale(0.96, 1.06) rotate(-1deg); }
}

.records { list-style: none; margin: 0; padding: 0; }
.records li + li { border-top: 1px solid var(--line); }
.records li { animation: rise 0.5s var(--ease) backwards; animation-delay: calc(0.2s + var(--i, 0) * 0.05s); }
.records a { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; color: inherit; text-decoration: none; }
.record-label { display: flex; flex-direction: column; font-weight: 600; font-size: 14px; }
.record-label small { color: var(--muted); font-weight: 500; font-size: 12px; }
.records strong { font-size: 16px; font-weight: 750; font-stretch: 110%; font-variant-numeric: tabular-nums; }
.trophy {
  width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center;
  color: #f5c451; background: color-mix(in oklab, #f5c451 14%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, #f5c451 30%, transparent);
  position: relative; overflow: hidden;
}
.trophy::after {
  content: ""; position: absolute; inset: -50%;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.45) 50%, transparent 60%);
  transform: translateX(-100%); animation: shine 2.8s ease-in-out 1s infinite;
}
@keyframes shine { 0% { transform: translateX(-100%); } 35%, 100% { transform: translateX(100%); } }
.trophy.big { width: 52px; height: 52px; border-radius: 17px; flex: none; }

/* ---------- Kraft: Rekorde & Hantel ---------- */
.pr-banner { display: flex; gap: 14px; align-items: center; border-color: color-mix(in oklab, #f5c451 35%, transparent); background: linear-gradient(120deg, color-mix(in oklab, #f5c451 10%, var(--panel)), var(--panel) 60%); }
.pr-banner small { color: #f5c451; font-weight: 650; font-size: 12.5px; }
.pr-banner p { margin-top: 3px; font-size: 14.5px; }
.pr-banner b { font-weight: 750; }

.plates-figure svg { width: 100%; height: auto; display: block; overflow: visible; }
.plates .bar { fill: var(--ink-2); }
.plates .collar { fill: var(--ink); }
.plates .plate { fill: var(--series-2); stroke: color-mix(in oklab, var(--series-2) 60%, #000); stroke-width: 1; }
.plates .plate.left { animation: plate-left 0.7s var(--spring) both; animation-delay: calc(0.3s + var(--i) * 0.14s); }
.plates .plate.right { animation: plate-right 0.7s var(--spring) both; animation-delay: calc(0.3s + var(--i) * 0.14s); }
@keyframes plate-left { from { transform: translateX(-70px); opacity: 0; } }
@keyframes plate-right { from { transform: translateX(70px); opacity: 0; } }
.plates .lift { animation: lift 0.9s var(--spring) both; animation-delay: calc(0.5s + var(--n) * 0.14s); }
.plates svg .bar, .plates svg .collar { animation: lift 0.9s var(--spring) both; animation-delay: calc(0.5s + var(--n) * 0.14s); }
@keyframes lift { 0% { transform: translateY(0); } 40% { transform: translateY(-7px); } 100% { transform: translateY(0); } }
.plates-text { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; margin-top: 6px; }
.plates-text strong { font-size: 30px; font-weight: 800; font-stretch: 115%; letter-spacing: -0.03em; }
.plates-text span { color: var(--ink-2); font-size: 13.5px; }
.plates-text .delta { font-size: 12.5px; }

/* ---------- Hyrox: Rennen abspielen ---------- */
.replay-now { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 14px; }
.replay-seg { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.replay-seg strong { font-size: 22px; font-weight: 780; font-stretch: 115%; letter-spacing: -0.02em; line-height: 1.05; }
.replay-kind { align-self: flex-start; font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.replay-kind.run { color: var(--series-1); background: color-mix(in oklab, var(--series-1) 16%, transparent); }
.replay-kind.station { color: var(--series-3); background: color-mix(in oklab, var(--series-3) 16%, transparent); }
.replay-kind.finish { color: var(--bg); background: var(--ink); }
.replay-clock { font-size: 34px; font-weight: 800; font-stretch: 112%; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.replay-track { position: relative; height: 22px; margin: 6px 0 12px; }
.rseg { position: absolute; top: 7px; height: 8px; border-radius: 2px; background: rgba(255, 255, 255, 0.07); box-shadow: inset -2px 0 0 var(--panel); transition: background 0.25s; }
.rseg.run.past { background: var(--series-1); }
.rseg.station.past { background: var(--series-3); }
.rseg.live.run { background: color-mix(in oklab, var(--series-1) 45%, transparent); }
.rseg.live.station { background: color-mix(in oklab, var(--series-3) 45%, transparent); }
.runner { position: absolute; top: 11px; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; }
.runner.me { background: var(--ink); box-shadow: 0 0 0 3px var(--panel), 0 0 16px rgba(255, 255, 255, 0.55); z-index: 2; }
.runner.ghost { border: 2px dashed var(--ink-2); background: var(--panel); opacity: 0.85; z-index: 1; }
.replay-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.replay-foot .ahead { color: var(--good-text); font-weight: 650; }
.replay-foot .behind { color: var(--bad-text); font-weight: 650; }
.replay-keys { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.rkey { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-left: 6px; }
.rkey.me { background: var(--ink); }
.rkey.ghost { border: 1.5px dashed var(--ink-2); }
.replay-result {
  display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 10px 12px;
  border-radius: 14px; background: rgba(255, 255, 255, 0.04); font-weight: 650; font-size: 14px;
  animation: rise 0.5s var(--spring) both;
}
.replay-result.best { color: #f5c451; background: color-mix(in oklab, #f5c451 12%, transparent); }

/* ---------- Laufen: Reise ---------- */
.journey-km { display: flex; align-items: baseline; gap: 8px; }
.journey-km strong { font-size: 44px; font-weight: 800; font-stretch: 115%; letter-spacing: -0.04em; line-height: 1; }
.journey-km span { color: var(--ink-2); }
.journey-map { width: 100%; height: auto; display: block; overflow: visible; margin: 8px 0 2px; }
.journey .road { fill: none; stroke: rgba(255, 255, 255, 0.07); stroke-width: 9; stroke-linecap: round; }
.journey .road-done { fill: none; stroke: var(--series-1); stroke-width: 9; stroke-linecap: round; stroke-dasharray: 1; }
.journey .road-start { fill: var(--panel); stroke: var(--series-1); stroke-width: 2.5; }
.journey .road-flag circle { fill: var(--panel); stroke: var(--ink-2); stroke-width: 2; }
.journey .road-flag path { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.journey .road-runner { fill: var(--ink); stroke: var(--panel); stroke-width: 2.5; }
.journey .road-runner-halo { fill: color-mix(in oklab, var(--series-1) 35%, transparent); transform-box: fill-box; transform-origin: center; animation: pulse 2.2s ease-out 2s infinite; }
.journey-legs { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-2); }

/* ---------- Erholung: Nachthimmel & Schlafrhythmus ---------- */
.night-sky { position: absolute; z-index: -1; left: -18px; right: -18px; top: -60px; height: 280px; pointer-events: none; animation: fade 2s ease both !important;
  -webkit-mask-image: linear-gradient(180deg, #000 40%, transparent); mask-image: linear-gradient(180deg, #000 40%, transparent); }
.night-sky i { position: absolute; border-radius: 50%; background: #fff; opacity: 0.2; animation: twinkle 3s ease-in-out infinite; }
@keyframes twinkle { 50% { opacity: 0.85; transform: scale(1.3); } }
.night-sky .moon { position: absolute; right: 26px; top: 76px; width: 40px; height: 40px; }
.night-sky .moon path { fill: #f3efe0; filter: drop-shadow(0 0 14px rgba(243, 239, 224, 0.45)); }
.avg-line { stroke: var(--ink-2); stroke-width: 1; stroke-opacity: 0.5; }
.chart .night-bars .col { transform-origin: 50% 0%; }

/* ==========================================================================
   Persönlicher & lebendiger: Himmel, Begrüßung, Kopfbereiche, Gym-Modus …
   ========================================================================== */

/* ---------- Himmel nach Tageszeit (Heute) ---------- */
.sky {
  position: absolute; z-index: -2; pointer-events: none; overflow: hidden;
  left: -18px; right: -18px; top: -120px; height: 640px;
  -webkit-mask-image: linear-gradient(180deg, #000 45%, transparent);
  mask-image: linear-gradient(180deg, #000 45%, transparent);
  animation: fade 1.8s ease both;
}
.sky-gradient { position: absolute; inset: 0; animation: sky-breathe 12s ease-in-out infinite alternate; }
@keyframes sky-breathe { to { transform: scale(1.08) translateY(-10px); } }
.sky.morning .sky-gradient {
  background:
    radial-gradient(60% 45% at 82% 62%, rgba(255, 150, 90, 0.55), transparent 70%),
    radial-gradient(55% 45% at 18% 38%, rgba(255, 80, 140, 0.32), transparent 70%),
    linear-gradient(180deg, #241a3b 0%, #12101c 60%, transparent);
}
.sky.day .sky-gradient {
  background:
    radial-gradient(55% 45% at 80% 25%, rgba(120, 200, 255, 0.45), transparent 70%),
    radial-gradient(60% 50% at 15% 55%, rgba(46, 230, 200, 0.22), transparent 70%),
    linear-gradient(180deg, #10233d 0%, #0d1420 60%, transparent);
}
.sky.evening .sky-gradient {
  background:
    radial-gradient(60% 45% at 25% 70%, rgba(255, 110, 60, 0.5), transparent 70%),
    radial-gradient(55% 45% at 80% 35%, rgba(155, 90, 255, 0.4), transparent 70%),
    linear-gradient(180deg, #2a1640 0%, #140f22 60%, transparent);
}
.sky.night .sky-gradient {
  background:
    radial-gradient(60% 45% at 70% 30%, rgba(80, 110, 255, 0.28), transparent 70%),
    linear-gradient(180deg, #0c1230 0%, #0a0c16 60%, transparent);
}
.sky.night .night-sky { top: 40px; height: 360px; }
.sun { position: absolute; width: 110px; height: 110px; border-radius: 50%; }
.sun i {
  position: absolute; inset: -60%; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, 0.07) 0deg 6deg, transparent 6deg 18deg);
  -webkit-mask-image: radial-gradient(circle, #000 20%, transparent 65%);
  mask-image: radial-gradient(circle, #000 20%, transparent 65%);
  animation: spin 60s linear infinite;
}
.sky.morning .sun {
  right: 10%; top: 300px;
  background: radial-gradient(circle, #ffe2b0 0%, #ff9a5c 42%, rgba(255, 120, 80, 0) 70%);
  box-shadow: 0 0 120px 40px rgba(255, 140, 80, 0.35);
  animation: sunrise 3s var(--ease) both;
}
.sky.day .sun {
  right: -8%; top: 30px; opacity: 0.75;
  background: radial-gradient(circle, #ffffff 0%, #bfe6ff 40%, rgba(150, 210, 255, 0) 70%);
  box-shadow: 0 0 140px 40px rgba(140, 200, 255, 0.25);
  animation: fade 2s ease both;
}
.sky.evening .sun {
  left: 6%; top: 330px;
  background: radial-gradient(circle, #ffd0a0 0%, #ff6a3d 45%, rgba(255, 80, 60, 0) 70%);
  box-shadow: 0 0 120px 40px rgba(255, 90, 60, 0.35);
  animation: sunset 3s var(--ease) both;
}
@keyframes sunrise { from { transform: translateY(160px) scale(0.7); opacity: 0; } }
@keyframes sunset { from { transform: translateY(-120px) scale(1.2); opacity: 0; } }

/* ---------- Begrüßung ---------- */
.top-text { min-width: 0; }
.top-actions { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.greet { display: flex; flex-direction: column; font-size: clamp(30px, 9vw, 40px); line-height: 1; }
.greet .greet-line { white-space: nowrap; }
.greet .greet-name {
  font-size: 1.25em; font-weight: 900; font-stretch: 125%; letter-spacing: -0.035em;
  background: linear-gradient(100deg, #ffffff 10%, color-mix(in oklab, var(--status) 65%, #ffffff) 60%, #ffffff 90%);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: letter 0.9s var(--spring) 0.45s backwards, shimmer-text 6s ease-in-out 1.5s infinite;
  padding-bottom: 4px; align-self: flex-start;
}
.greet .ch { display: inline-block; animation: letter 0.7s var(--spring) backwards; animation-delay: calc(0.1s + var(--i) * 0.035s); }
@keyframes letter { from { opacity: 0; transform: translateY(70%) rotate(8deg) scale(0.8); filter: blur(8px); } }
@keyframes shimmer-text { 0%, 100% { background-position: 0% 0; } 50% { background-position: 100% 0; } }
.goal-chip {
  margin-top: 14px; display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  padding: 7px 13px 7px 10px; border-radius: 999px; font-size: 13px; color: var(--ink);
  background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line-2); backdrop-filter: blur(12px);
}
.goal-chip .goal-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goal-chip b { color: var(--bg); background: var(--ink); border-radius: 999px; padding: 2px 9px; font-size: 12px; white-space: nowrap; }
.goal-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--status); box-shadow: 0 0 0 4px color-mix(in oklab, var(--status) 25%, transparent); animation: breathe 2.4s ease-in-out infinite; }
.motto { margin-top: 10px; font-size: 14px; color: var(--ink-2); font-style: italic; }

.avatar { position: relative; width: 46px; height: 46px; border: 0; padding: 0; border-radius: 50%; background: transparent; display: grid; place-items: center; }
.avatar-ring {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, #ff6a3d, #ff2e7e, #9b6bff, #38d9ff, #2ee6a8, #ff6a3d);
  animation: spin 6s linear infinite;
  -webkit-mask: radial-gradient(circle, transparent 58%, #000 60%); mask: radial-gradient(circle, transparent 58%, #000 60%);
}
.avatar-letter {
  position: relative; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: #16171b; font-weight: 900; font-stretch: 115%; font-size: 17px;
}
.avatar:active { transform: scale(0.9); transition: transform 0.15s; }

/* ---------- Kopfbereiche je Seite ---------- */
.tab-hero {
  --h1: #6a5cff; --h2: #2ea8ff;
  position: relative; overflow: hidden; isolation: isolate;
  min-height: 150px; padding: 22px 20px 20px; border-radius: 30px;
  display: flex; align-items: flex-end;
  background: linear-gradient(135deg, color-mix(in oklab, var(--h1) 55%, #0b0b0d), color-mix(in oklab, var(--h2) 40%, #0b0b0d));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 60px color-mix(in oklab, var(--h1) 25%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.tab-hero.theme-run { --h1: #2a78d6; --h2: #38d9ff; }
.tab-hero.theme-strength { --h1: #ff5a1f; --h2: #ff2e7e; }
.tab-hero.theme-recovery { --h1: #3b2bb8; --h2: #6a5cff; }
.tab-hero-glow {
  position: absolute; inset: -40%; z-index: -1;
  background: radial-gradient(40% 40% at 25% 30%, rgba(255, 255, 255, 0.22), transparent 60%),
    radial-gradient(35% 35% at 85% 80%, color-mix(in oklab, var(--h2) 60%, transparent), transparent 70%);
  animation: drift 10s ease-in-out infinite alternate;
}
.tab-hero-text { position: relative; z-index: 1; }
.tab-hero h1 { font-size: 40px; text-shadow: 0 6px 30px rgba(0, 0, 0, 0.35); }
.tab-hero p { margin-top: 8px; color: rgba(255, 255, 255, 0.82); font-size: 14px; }
.hero-decor { position: absolute; right: -6px; top: 10px; width: 52%; max-width: 220px; opacity: 0.55; z-index: 0; }
.hero-decor.eq rect { fill: rgba(255, 255, 255, 0.85); transform-box: fill-box; transform-origin: bottom; animation: eq 1.6s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -0.23s); }
@keyframes eq { 0% { transform: scaleY(0.25); } 100% { transform: scaleY(1); } }
.hero-decor.track path { fill: none; stroke: rgba(255, 255, 255, 0.55); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 2 10; animation: lanes 1.2s linear infinite; }
@keyframes lanes { to { stroke-dashoffset: -24; } }
.hero-decor.track .dot { fill: #ffffff; filter: drop-shadow(0 0 8px #fff); }
.hero-decor.plate { width: 40%; right: -14px; top: -14px; animation: spin 24s linear infinite; }
.hero-decor.plate circle { fill: none; stroke: rgba(255, 255, 255, 0.6); stroke-width: 3; }
.tab-hero .night-sky { top: -30px; height: 200px; left: 0; right: 0; }

/* ---------- Karten reagieren auf Antippen ---------- */
.panel, .tile, .coach, .launch, .ex-card, .tab-hero { position: relative; }
.panel, .tile, .coach, .launch, .tab-hero { transition: transform 0.5s var(--spring); }
.pressed { transform: perspective(800px) rotateX(var(--prx, 0deg)) rotateY(var(--pry, 0deg)) scale(0.975) !important; transition: transform 0.12s ease-out !important; }
.pressed::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 3;
  background: radial-gradient(circle at var(--px, 50%) var(--py, 50%), rgba(255, 255, 255, 0.16), transparent 55%);
}

/* Glanz läuft über die Coach-Karte */
.coach-shine {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; border-radius: inherit; overflow: hidden;
}
.coach-shine::before {
  content: ""; position: absolute; top: -50%; bottom: -50%; width: 40%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.09), transparent);
  animation: sweep 5.5s ease-in-out 1.2s infinite;
}
@keyframes sweep { 0% { transform: translateX(-150%) rotate(8deg); } 40%, 100% { transform: translateX(350%) rotate(8deg); } }

/* Große Zahlen mit Metallglanz */
.dial-score, .journey-km strong, .plates-text strong, .replay-clock, .workout-clock, .summary-big b, .launch-clock {
  background: linear-gradient(180deg, #ffffff 35%, #aab3c5);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.dial-score { background: linear-gradient(180deg, #ffffff 30%, color-mix(in oklab, var(--status) 55%, #ffffff)); -webkit-background-clip: text; background-clip: text; }

/* Navigation: Icon hüpft beim Wechsel */
.dock a.on svg { animation: tab-pop 0.55s var(--spring); }
@keyframes tab-pop { 0% { transform: scale(0.6) translateY(4px); } 60% { transform: scale(1.2) translateY(-3px); } 100% { transform: translateY(-1px) scale(1.08); } }

/* Nach unten ziehen zum Aktualisieren – Chromes eigenes Neuladen abschalten.
   Muss am Wurzelelement stehen: am body würde es das Scrollen der Seite blockieren. */
html { overscroll-behavior-y: contain; }
.ptr {
  position: fixed; z-index: 25; left: 50%; top: calc(8px + env(safe-area-inset-top));
  width: 40px; height: 40px; margin-left: -20px; border-radius: 50%;
  display: grid; place-items: center; color: var(--ink);
  background: rgba(30, 31, 36, 0.9); border: 1px solid var(--line-2);
  opacity: 0; transform: translateY(-60px); pointer-events: none;
}
body.pulling .ptr { opacity: 1; transform: translateY(calc(var(--ptr, 0px) - 40px)); }
body.pulling .ptr svg { transform: rotate(calc(var(--ptr, 0px) * 4deg)); }
body.ptr-armed .ptr { background: var(--ink); color: var(--bg); }
body.pulling .shell { transform: translateY(calc(var(--ptr, 0px) * 0.6)); }
.shell { transition: transform 0.45s var(--spring); }
body.pulling .shell { transition: none; }

.toast.gold svg { color: #f5c451; }

/* ---------- Gym-Modus: Startkarte ---------- */
.launch {
  overflow: hidden; isolation: isolate; border-radius: 30px; padding: 22px 20px 20px;
  background: #160d0a; border: 1px solid rgba(255, 120, 70, 0.3);
  box-shadow: 0 24px 60px rgba(255, 90, 31, 0.18);
}
.launch-bg {
  position: absolute; inset: -40%; z-index: -1;
  background: radial-gradient(40% 40% at 20% 20%, rgba(255, 106, 61, 0.55), transparent 70%),
    radial-gradient(40% 40% at 85% 70%, rgba(255, 46, 126, 0.4), transparent 70%);
  filter: blur(24px); animation: drift 9s ease-in-out infinite alternate;
}
.launch-kicker { font-size: 11.5px; font-weight: 850; letter-spacing: 0.08em; text-transform: uppercase; color: #ffb38f; }
.launch-title { font-size: 40px; font-weight: 900; font-stretch: 72%; text-transform: uppercase; line-height: 0.95; margin: 8px 0 8px; }
.launch p { color: rgba(255, 255, 255, 0.8); font-size: 14px; }
.launch-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.btn.big { padding: 14px 22px; font-size: 16px; font-weight: 800; }
.launch .btn, .workout .btn, .welcome .btn { background: linear-gradient(90deg, #ff6a3d, #ff2e7e); color: #fff; box-shadow: 0 10px 30px rgba(255, 70, 90, 0.35); }
.launch .ghost { border-color: rgba(255, 255, 255, 0.3); color: #fff; }
.launch.live { text-align: left; }
.launch-live { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: #ff8a8a; }
.launch-live i { width: 9px; height: 9px; border-radius: 50%; background: #ff4d4d; animation: breathe 1.2s ease-in-out infinite; box-shadow: 0 0 12px #ff4d4d; }
.launch-clock { display: block; font-size: 56px; font-weight: 900; font-stretch: 110%; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; margin: 6px 0 2px; }

/* ---------- Gym-Modus: Vollbild ---------- */
.workout {
  position: fixed; inset: 0; z-index: 45; overflow-y: auto; overscroll-behavior: contain;
  background: #0b0b0d; animation: workout-in 0.55s var(--spring) both;
  padding-bottom: calc(120px + env(safe-area-inset-bottom));
}
@keyframes workout-in { from { transform: translateY(40px) scale(0.98); opacity: 0; } }
.workout-bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(60% 35% at 20% 0%, rgba(255, 106, 61, 0.28), transparent 70%),
    radial-gradient(50% 30% at 90% 10%, rgba(255, 46, 126, 0.22), transparent 70%);
}
.workout-top {
  position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: 46px 1fr auto; gap: 10px; align-items: center;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: rgba(11, 11, 13, 0.75); backdrop-filter: blur(18px); border-bottom: 1px solid var(--line);
}
.workout-name, .workout-name-input {
  font: inherit; font-size: 17px; font-weight: 800; font-stretch: 110%; color: var(--ink);
  background: transparent; border: 0; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.workout-name-input { border-bottom: 1px solid var(--line-2); outline: none; }
.btn.finish { padding: 10px 18px; }
.workout-hero { text-align: center; padding: 22px 16px 8px; max-width: 560px; margin: 0 auto; }
.workout-clock { display: block; font-size: 64px; font-weight: 900; font-stretch: 110%; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; line-height: 1; }
.workout-stats { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.workout-stats span {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 13px; color: var(--ink-2);
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line);
}
.workout-stats b { color: var(--ink); font-variant-numeric: tabular-nums; }
.workout-stats .has-pr { color: #f5c451; border-color: rgba(245, 196, 81, 0.45); background: rgba(245, 196, 81, 0.1); animation: pop 0.5s var(--spring); }
.workout-list { max-width: 560px; margin: 0 auto; padding: 10px 16px; display: flex; flex-direction: column; gap: 14px; }
.ex-card { background: var(--panel); border: 1px solid var(--line); border-radius: 24px; padding: 14px 12px 12px; animation: rise 0.5s var(--spring) backwards; }
.ex-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin: 0 4px 10px; }
.ex-head h3 { font-size: 18px; font-weight: 800; font-stretch: 110%; }
.ex-head small { color: var(--muted); font-size: 12px; }
.set-head, .set-row { display: grid; grid-template-columns: 30px 58px 1fr 54px 44px; gap: 6px; align-items: center; }
.set-head { font-size: 11px; color: var(--muted); padding: 0 4px 4px; }
.set-row { padding: 5px 4px; border-radius: 14px; transition: background 0.3s; }
.set-row.done { background: rgba(46, 230, 168, 0.1); }
.set-row.pr { background: linear-gradient(90deg, rgba(245, 196, 81, 0.2), rgba(245, 196, 81, 0.05)); }
.set-no { width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: rgba(255, 255, 255, 0.06); color: var(--ink-2); user-select: none; }
.set-row.done .set-no { background: #2ee6a8; color: #0b0b0d; }
.set-row.pr .set-no { background: #f5c451; color: #0b0b0d; }
.set-prev { border: 0; background: none; color: var(--muted); font-size: 12.5px; text-align: left; padding: 0; font-variant-numeric: tabular-nums; }
.set-weight { display: grid; grid-template-columns: 26px 1fr 26px; align-items: center; background: rgba(255, 255, 255, 0.05); border-radius: 12px; border: 1px solid var(--line); }
.set-weight input, .set-reps {
  width: 100%; min-width: 0; font: inherit; font-size: 17px; font-weight: 800; text-align: center; color: var(--ink);
  background: transparent; border: 0; padding: 9px 0; outline: none; font-variant-numeric: tabular-nums;
}
.set-reps { background: rgba(255, 255, 255, 0.05); border-radius: 12px; border: 1px solid var(--line); }
.nudge { border: 0; background: none; color: var(--ink-2); font-size: 18px; font-weight: 700; padding: 0; height: 40px; }
.nudge:active { color: #ff8a5c; transform: scale(1.3); }
.set-check {
  width: 42px; height: 42px; border-radius: 14px; border: 1px solid var(--line-2); display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.04); color: var(--muted); transition: transform 0.25s var(--spring), background 0.2s, color 0.2s;
}
.set-check:active { transform: scale(0.85); }
.set-row.done .set-check { background: #2ee6a8; color: #0b0b0d; border-color: transparent; }
.set-row.done .set-check svg { animation: pop 0.45s var(--spring); }
.set-row.pr .set-check { background: #f5c451; box-shadow: 0 0 20px rgba(245, 196, 81, 0.6); }
.add-set { margin: 10px 4px 0; display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: #ff9a6c; font-weight: 700; font-size: 14px; }
.add-ex {
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 18px; border-radius: 22px;
  border: 1.5px dashed rgba(255, 140, 90, 0.5); background: rgba(255, 106, 61, 0.06); color: #ffb38f; font-weight: 800; font-size: 15px;
}
.add-ex:active { transform: scale(0.98); }
.rest-choice { display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.rest-choice .range { align-self: stretch; grid-template-columns: repeat(var(--n), 1fr); }
.discard { border: 0; background: none; color: var(--muted); font-size: 13px; margin: 14px auto 0; text-decoration: underline; }

.rest-timer {
  position: fixed; z-index: 46; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom));
  max-width: 520px; margin: 0 auto; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 22px; background: rgba(28, 29, 34, 0.92); backdrop-filter: blur(18px);
  border: 1px solid var(--line-2); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  animation: rise 0.45s var(--spring) both;
}
.rest-timer svg { width: 46px; height: 46px; transform: rotate(-90deg); flex: none; }
.rest-track { fill: none; stroke: rgba(255, 255, 255, 0.08); stroke-width: 4; }
.rest-fill { fill: none; stroke: #ff6a3d; stroke-width: 4; stroke-linecap: round; transition: stroke-dasharray 0.25s linear; }
.rest-text { display: flex; flex-direction: column; flex: 1; }
.rest-text small { color: var(--muted); font-size: 11.5px; }
.rest-text b { font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; }
.rest-timer.over { border-color: #2ee6a8; animation: rest-over 0.6s var(--spring) both; }
.rest-timer.over .rest-fill { stroke: #2ee6a8; }
@keyframes rest-over { 0% { transform: scale(0.9); } 50% { transform: scale(1.05); } }

.search {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); padding: 12px 14px; border-radius: 14px;
  background: var(--panel-2); border: 1px solid var(--line-2); outline: none; margin-bottom: 12px;
}
.group-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
.group-chips .chip-btn { flex: none; }
.ex-list { list-style: none; margin: 0; padding: 0; }
.ex-list li + li { border-top: 1px solid var(--line); }
.ex-list button { width: 100%; display: grid; grid-template-columns: 1fr auto 20px; gap: 10px; align-items: center; padding: 13px 4px; border: 0; background: none; text-align: left; }
.ex-name { font-weight: 650; }
.ex-group { font-size: 12px; color: var(--muted); }
.ex-custom .ex-name { color: #ff9a6c; }

.workout-pill {
  position: fixed; z-index: 21; left: 0; right: 0; margin: 0 auto; bottom: calc(90px + env(safe-area-inset-bottom));
  width: min(430px, calc(100% - 24px)); display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: 18px; border: 0; color: #fff; font-size: 13.5px; text-align: left;
  background: linear-gradient(90deg, #ff6a3d, #ff2e7e); box-shadow: 0 14px 40px rgba(255, 70, 90, 0.4);
  animation: rise 0.5s var(--spring) both;
}
.workout-pill span:nth-of-type(1) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.workout-pill b { font-variant-numeric: tabular-nums; }
.workout-pill .pill-go { font-weight: 800; background: rgba(0, 0, 0, 0.2); border-radius: 999px; padding: 3px 10px; }
.workout-pill .live-dot, .workout-pill .live-dot::after { background: #fff; }

/* Abschluss */
.summary { display: grid; place-items: center; padding: 24px; }
.summary-inner { width: 100%; max-width: 420px; text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.summary-title { font-size: 54px; font-weight: 900; font-stretch: 72%; text-transform: uppercase; line-height: 0.95; animation: letter 0.8s var(--spring) 0.2s backwards; }
.summary-sub { color: var(--ink-2); }
.summary-big b { display: block; font-size: 76px; font-weight: 900; font-stretch: 110%; letter-spacing: -0.04em; line-height: 1; }
.summary-big span { color: var(--ink-2); }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
.summary-grid div { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 12px 6px; display: flex; flex-direction: column; animation: rise 0.6s var(--spring) 0.4s backwards; }
.summary-grid b { font-size: 26px; font-weight: 900; }
.summary-grid span { font-size: 12px; color: var(--muted); }
.summary-prs { list-style: none; margin: 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 8px; }
.summary-prs li { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; text-align: left; padding: 8px 12px; border-radius: 16px; background: rgba(245, 196, 81, 0.08); border: 1px solid rgba(245, 196, 81, 0.3); animation: rise 0.6s var(--spring) backwards; animation-delay: calc(0.6s + var(--i) * 0.12s); }
.summary .btn.big { width: 100%; margin-top: 8px; }

/* ---------- Profil & Abzeichen ---------- */
.profile-form { display: flex; flex-direction: column; gap: 2px; }
.profile-form .field { margin-top: 10px; }
.badges-head { display: flex; justify-content: space-between; align-items: baseline; margin: 22px 0 12px; }
.badges-head h4 { margin: 0; font-size: 18px; font-weight: 800; font-stretch: 110%; }
.badges-head span { color: var(--muted); font-size: 13px; }
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 8px; }
.medal { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; animation: rise 0.5s var(--spring) backwards; animation-delay: calc(var(--i) * 0.04s); }
.medal b { font-size: 12.5px; font-weight: 750; line-height: 1.15; }
.medal small { font-size: 11px; color: var(--muted); line-height: 1.2; }
.medal-disc {
  position: relative; width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; overflow: hidden;
  background: conic-gradient(#8a8f98 calc(var(--p) * 360deg), rgba(255, 255, 255, 0.07) 0);
}
.medal-disc span { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: #15161a; color: var(--muted); }
.medal.done .medal-disc { background: conic-gradient(from 200deg, #fff1b8, #f5c451, #b8862b, #ffe08a, #f5c451, #fff1b8); box-shadow: 0 8px 26px rgba(245, 196, 81, 0.35); }
.medal.done .medal-disc span { background: radial-gradient(circle at 35% 30%, #3a2d10, #16120a); color: #f5c451; }
.medal.done .medal-disc::after {
  content: ""; position: absolute; inset: -40%;
  background: linear-gradient(115deg, transparent 42%, rgba(255, 255, 255, 0.55) 50%, transparent 58%);
  animation: shine 3.4s ease-in-out infinite; animation-delay: calc(var(--i) * 0.2s);
}

/* ---------- Begrüßung beim ersten Start ---------- */
.welcome { position: fixed; inset: 0; z-index: 55; display: grid; place-items: center; padding: 24px; background: #08080a; overflow: hidden; }
.welcome-bg i { position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%; filter: blur(60px); opacity: 0.55; animation: blob 14s ease-in-out infinite alternate; }
.welcome-bg i:nth-child(1) { background: #ff6a3d; left: -30vmax; top: -20vmax; }
.welcome-bg i:nth-child(2) { background: #6a5cff; right: -35vmax; top: 10vmax; animation-delay: -4s; }
.welcome-bg i:nth-child(3) { background: #2ee6c8; left: -10vmax; bottom: -40vmax; animation-delay: -8s; }
@keyframes blob { 50% { transform: translate(8vmax, -6vmax) scale(1.15); } 100% { transform: translate(-6vmax, 8vmax) scale(0.9); } }
.welcome-steps { position: absolute; top: calc(20px + env(safe-area-inset-top)); left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.welcome-steps span { width: 28px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.2); transition: background 0.4s; }
.welcome-steps span.on { background: #fff; }
.welcome-card { position: relative; width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 16px; animation: welcome-step 0.7s var(--spring) both; }
@keyframes welcome-step { from { opacity: 0; transform: translateX(40px) scale(0.96); filter: blur(8px); } }
.welcome-mark { width: 96px; height: 96px; }
.welcome-mark path { fill: none; stroke: #fff; stroke-width: 34; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.6s var(--ease) 0.2s both; filter: drop-shadow(0 0 18px rgba(255, 255, 255, 0.5)); }
.welcome-title { font-size: clamp(40px, 12vw, 64px); font-weight: 900; font-stretch: 72%; text-transform: uppercase; line-height: 0.95; }
.welcome-card p { color: rgba(255, 255, 255, 0.8); font-size: 17px; line-height: 1.45; }
.welcome-input { font: inherit; font-size: 26px; font-weight: 800; color: #fff; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 18px; padding: 14px 16px; outline: none; }
.welcome-input:focus { border-color: #fff; }
.welcome-date { display: flex; flex-direction: column; gap: 6px; color: rgba(255, 255, 255, 0.7); font-size: 13px; }
.welcome-date input { font: inherit; color: #fff; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 14px; padding: 11px 12px; color-scheme: dark; }
.welcome-skip { border: 0; background: none; color: rgba(255, 255, 255, 0.6); font-size: 14px; }

/* Konfetti liegt über allem */
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 60; }

/* Wer weniger Bewegung möchte, bekommt sie nicht */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .chart .line, .dial .seg { stroke-dashoffset: 0; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
}
