@import url('https://fonts.googleapis.com/css2?family=Anton&family=IBM+Plex+Mono:wght@400;500;600&family=Inter:wght@400;500;600&display=swap');

/* ---------------------------------------------------------------
   DESIGN TOKENS
   Near-black + Acid-Lime / Hot-Pink Duotone. Kondensierte Anton-
   Headlines, angeschnittene Ecken (Notch-Cuts) statt border-radius
   fuer den Sport-/Performance-Edge-Look. Amber als dritte,
   neutrale Datenfarbe fuer Pace (weder "gut" noch "schlecht" an sich).
   --------------------------------------------------------------- */
:root {
  --bg: #08080a;
  --surface: #131316;
  --surface-raised: #1b1b1f;
  --line: #2c2c33;
  --line-bright: #3d3d47;
  --text: #f4f4f0;
  --text-dim: #8b8b94;

  --lime: #c8ff3d;
  --lime-dim: #7fa832;
  --pink: #ff2e63;
  --amber: #ffb020;

  --notch: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 15% 0%, rgba(200,255,61,0.05), transparent 40%),
    radial-gradient(circle at 100% 30%, rgba(255,46,99,0.05), transparent 40%);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, .brand {
  font-family: 'Anton', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  font-weight: 400;
}

h2 { font-size: 22px; margin: 0 0 4px; }

.mono { font-family: 'IBM Plex Mono', monospace; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
#app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  padding-left: max(18px, env(safe-area-inset-left));
  padding-right: max(18px, env(safe-area-inset-right));
  border-bottom: 2px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(8, 8, 10, 0.92);
  backdrop-filter: blur(6px);
  z-index: 10;
}

.brand { font-size: 19px; display: flex; align-items: center; gap: 9px; }
.brand .pulse-dot {
  width: 9px; height: 9px; background: var(--lime);
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.4); }
}

.logout-btn {
  background: none; border: 1px solid var(--line-bright); color: var(--text-dim);
  padding: 7px 14px; font-size: 12px; cursor: pointer;
  text-transform: uppercase; letter-spacing: 0.05em;
  clip-path: polygon(0 0, 100% 0, 100% 70%, 92% 100%, 0 100%);
}
.logout-btn:hover { color: var(--pink); border-color: var(--pink); }

main { flex: 1; padding: 22px 18px 70px; max-width: 760px; width: 100%; margin: 0 auto; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 20px;
  margin-bottom: 16px;
  clip-path: polygon(0 0, calc(100% - var(--notch)) 0, 100% var(--notch), 100% 100%, var(--notch) 100%, 0 calc(100% - var(--notch)));
  position: relative;
}

.hint { color: var(--text-dim); font-size: 13px; line-height: 1.55; }

label {
  display: block; font-size: 11px; color: var(--text-dim);
  margin-bottom: 6px; margin-top: 16px;
  text-transform: uppercase; letter-spacing: 0.07em;
}
input, textarea {
  width: 100%;
  background: #0d0d10;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 11px 13px;
  /* 16px: darunter zoomt iOS-Safari beim Antippen eines Feldes die ganze Seite heran */
  font-size: 16px;
  font-family: inherit;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}
input:focus, textarea:focus, button:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 1px;
}
textarea { resize: vertical; min-height: 70px; }

button.primary {
  width: 100%;
  margin-top: 20px;
  background: var(--lime);
  color: #0a0f00;
  border: none;
  font-family: 'Anton', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 13px;
  font-size: 15px;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 100%, 10px 100%);
}
button.primary:hover { filter: brightness(1.12); }
button.primary:disabled { opacity: 0.4; cursor: default; }

button.secondary {
  background: none;
  border: 1px solid var(--line-bright);
  color: var(--text);
  padding: 10px 16px;
  cursor: pointer;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
button.secondary:hover { border-color: var(--lime); color: var(--lime); }
button.icon-btn {
  background: var(--surface-raised); border:1px solid var(--line); color: var(--text-dim);
  width:26px; height:26px; cursor:pointer; font-size:14px; line-height:1;
}
button.icon-btn:hover { color: var(--pink); border-color: var(--pink); }

.error-box {
  background: rgba(255,46,99,0.08);
  border: 1px solid rgba(255,46,99,0.4);
  color: var(--pink);
  padding: 11px 13px;
  font-size: 13px;
  margin-top: 12px;
}

.link-btn {
  background: none; border: none; color: var(--lime); font-size: 13px; cursor: pointer;
  padding: 0; margin-top: 12px; text-transform: uppercase; letter-spacing: 0.04em;
}

.athlete-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-bright);
  margin-bottom: 10px;
  cursor: pointer;
  background: var(--surface);
  transition: border-color 0.15s;
}
.athlete-row:hover { border-left-color: var(--lime); }
.athlete-name { font-weight: 500; }
.status-dot { width: 8px; height: 8px; display: inline-block; margin-right: 8px; }
.status-connected { background: var(--lime); clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); }
.status-disconnected { background: var(--text-dim); border-radius: 50%; }

.section-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-dim); margin: 26px 0 10px;
  display: flex; align-items: center; gap: 8px;
}
.section-title::before { content: ""; width: 14px; height: 2px; background: var(--lime); display: inline-block; }

.tag-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.tag-good { color: var(--lime); font-size: 14px; }
.tag-warn { color: var(--pink); font-size: 14px; }

.pulse-loader { width: 100%; height: 40px; margin: 20px 0; }
.pulse-loader path {
  stroke: var(--lime); stroke-width: 2; fill: none;
  stroke-dasharray: 300; stroke-dashoffset: 300;
  animation: draw 1.4s ease-in-out infinite;
}
@keyframes draw {
  0% { stroke-dashoffset: 300; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -300; }
}

/* ---------------------------------------------------------------
   TREND CHARTS
   --------------------------------------------------------------- */
.chart-block { margin-top: 10px; margin-bottom: 8px; }
.chart-block canvas { width: 100% !important; max-height: 160px; }
.chart-label {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 4px;
}
.chart-label .name { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); }
.chart-label .latest { font-family: 'IBM Plex Mono', monospace; font-size: 15px; }
.latest-lime { color: var(--lime); }
.latest-pink { color: var(--pink); }
.latest-amber { color: var(--amber); }

/* ---------------------------------------------------------------
   ZIEL-KARTE: Fortschrittsring + Aktuell -> Ziel
   --------------------------------------------------------------- */
.goal-card {
  display: flex; align-items: center; gap: 18px; margin-top: 12px;
  padding: 16px; background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--tone, var(--line-bright));
}
.goal-card.tone-far { --tone: var(--pink); }
.goal-card.tone-mid { --tone: var(--amber); }
.goal-card.tone-near { --tone: var(--lime); }
.goal-ring { position: relative; width: 76px; height: 76px; flex: 0 0 auto; }
.goal-ring svg { width: 100%; height: 100%; display: block; }
.ring-bg { fill: none; stroke: var(--line); stroke-width: 6; }
.ring-fg {
  fill: none; stroke: var(--tone, var(--text-dim)); stroke-width: 6; stroke-linecap: round;
  transition: stroke-dasharray 1s cubic-bezier(0.16, 1, 0.3, 1);
}
.goal-ring-num {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: 'IBM Plex Mono', monospace; font-size: 22px; font-weight: 600; color: var(--tone, var(--text));
}
.goal-main { min-width: 0; flex: 1; }
.goal-title { font-family: 'Anton', sans-serif; font-size: 15px; text-transform: uppercase; overflow-wrap: anywhere; }
.goal-values {
  display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 6px;
  font-family: 'IBM Plex Mono', monospace; font-size: 15px;
}
.goal-values em {
  display: block; font-style: normal; font-family: inherit; font-size: 10px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim);
}
.goal-arrow { color: var(--text-dim); padding-bottom: 1px; }
.goal-gap { margin-top: 8px; font-size: 12px; color: var(--tone, var(--text-dim)); font-family: 'IBM Plex Mono', monospace; }
.goal-comment {
  margin-top: 10px; padding: 12px 14px; background: var(--surface-raised);
  font-size: 14px; line-height: 1.5; color: var(--text);
}

/* ---------------------------------------------------------------
   LEISTUNGS-KACHELN (FTP, Schwelle, VO2max, Prognose)
   --------------------------------------------------------------- */
.perf-card { margin-bottom: 6px; }
.perf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
.perf-tile {
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--lime-dim);
  padding: 12px 14px; min-width: 0; color: var(--lime);
}
.perf-tile-wide { grid-column: 1 / -1; }
.perf-label { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim); }
.perf-value { margin-top: 4px; font-family: 'IBM Plex Mono', monospace; font-size: 26px; font-weight: 600; color: var(--text); line-height: 1.1; }
.perf-unit { font-size: 13px; font-weight: 400; color: var(--text-dim); margin-left: 4px; }
.perf-sub { margin-top: 3px; font-size: 12px; color: var(--text-dim); min-height: 1.2em; }
.perf-spark { display: block; width: 100%; height: 30px; margin-top: 8px; color: var(--lime); }
.perf-delta { margin-top: 2px; font-size: 11px; font-family: 'IBM Plex Mono', monospace; color: var(--text-dim); }
.perf-delta.up { color: var(--lime); }
.perf-delta.down { color: var(--pink); }
.perf-race { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 6px; font-family: 'IBM Plex Mono', monospace; font-size: 15px; color: var(--text); }
.perf-race em { display: block; font-style: normal; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); }
.perf-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; font-size: 11px; color: var(--text-dim); }
.perf-foot .link-btn { padding: 12px 0 12px 12px; margin: -10px 0; white-space: nowrap; }
.perf-note { font-size: 12px; color: var(--text-dim); }

/* kompakt: Chips unter dem Athleten-Namen in der Coach-Liste */
.perf-strip { flex: 1 0 100%; margin-top: 10px; }
.perf-chips { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.perf-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px;
  background: var(--surface-raised); border: 1px solid var(--line);
  font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--text);
}
.perf-chip b { font-weight: 500; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); }
.perf-chip .perf-spark { width: 38px; height: 14px; margin: 0 0 0 2px; }

.hidden { display: none !important; }

/* ---------------------------------------------------------------
   TABS (Athlet-Detailansicht Coach, Athlet-Eigenansicht)
   --------------------------------------------------------------- */
.tabbar {
  display:flex; gap:6px; margin-bottom:18px; overflow-x:auto;
  scrollbar-width:none; -webkit-overflow-scrolling:touch;
}
.tabbar::-webkit-scrollbar { display:none; }
.tabbar button {
  flex:1 0 auto; background: var(--surface-raised); border:1px solid var(--line);
  color: var(--text-dim); padding:12px 14px; min-height:44px; font-size:12px; cursor:pointer;
  white-space:nowrap; text-transform:uppercase; letter-spacing:0.04em;
  font-family:'IBM Plex Mono',monospace;
}
.tabbar button.active { border-color: var(--lime); color: var(--lime); background: rgba(200,255,61,0.06); }

/* ---------------------------------------------------------------
   CHAT (Coach <-> Athlet, sowie KI-Sparring / KI-Coach)
   --------------------------------------------------------------- */
.chat-window {
  display:flex; flex-direction:column; gap:8px; max-height:min(62vh, 560px); max-height:min(62dvh, 560px);
  min-height:80px; overflow-y:auto; margin-bottom:12px; padding:4px 2px;
  overscroll-behavior:contain; -webkit-overflow-scrolling:touch;
}
.msg { max-width:88%; padding:10px 13px; font-size:15px; line-height:1.5; white-space:pre-wrap; overflow-wrap:anywhere; }
.msg.me { align-self:flex-end; background: var(--lime); color:#0a0f00; }
.msg.them { align-self:flex-start; background: var(--surface-raised); border:1px solid var(--line); }
.msg.ai { align-self:flex-start; background: var(--surface-raised); border:1px solid var(--lime-dim); color:#e2ffb0; }
.msg .meta { white-space:normal; font-size:11px; opacity:0.65; margin-top:4px; text-transform:uppercase; letter-spacing:0.04em; }
.chat-input-row { display:flex; gap:8px; align-items:flex-end; }
.chat-input-row input, .chat-input-row textarea { flex:1; }
.chat-input-row button { width:auto; margin-top:0; padding:11px 18px; white-space:nowrap; }

/* Auto-wachsende Chat-/KI-Eingabefelder (ersetzen die vorherigen einzeiligen
   <input>-Felder) - vor allem auf Mobilgeraeten war der sichtbare Text in
   einem einzeiligen Feld zu klein, um den eigenen Text vor dem Absenden
   vollstaendig zu ueberblicken. */
.chat-textarea {
  min-height: 44px;
  max-height: 160px;
  resize: none;
  overflow-y: auto;
  line-height: 1.4;
}

.mic-btn {
  width: 44px; height: 44px; min-width: 44px;
  background: var(--surface-raised); border: 1px solid var(--line);
  color: var(--text-dim); cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}
.mic-btn:hover { border-color: var(--lime); color: var(--lime); }
.mic-btn.listening {
  border-color: var(--pink); color: var(--pink);
  animation: mic-pulse 1s infinite;
}
.mic-btn:disabled { opacity: 0.3; cursor: not-allowed; }
@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,46,99,0.5); }
  50% { box-shadow: 0 0 0 6px rgba(255,46,99,0); }
}

/* ---------------------------------------------------------------
   TRAININGSPLAN
   --------------------------------------------------------------- */
.plan-day { border:1px solid var(--line); padding:11px 13px; margin-bottom:9px; }
.plan-day-title {
  font-size:12px; text-transform:uppercase; letter-spacing:0.05em; color: var(--lime);
  margin-bottom:7px; display:flex; justify-content:space-between; align-items:center;
}
.exercise-row {
  display:flex; justify-content:space-between; align-items:center;
  font-size:14px; padding:6px 0; border-bottom:1px solid var(--line);
}
.exercise-row:last-child { border-bottom:none; }
.exercise-meta { color: var(--text-dim); font-size:12px; }
.exercise-row .plan-name { display:flex; align-items:center; gap:10px; min-width:0; }
/* Plan-Zeilen: Kopfzeile (Haken/Name/Buttons) + Details darunter, mobil ohne Ueberlagerung */
.exercise-row.plan-row { flex-direction:column; align-items:stretch; gap:4px; }
.plan-row-head { display:flex; justify-content:space-between; align-items:flex-start; gap:10px; }
.plan-row .plan-name { flex:1 1 auto; align-items:flex-start; }
.plan-row .plan-name-text { flex:1 1 auto; min-width:0; overflow-wrap:anywhere; line-height:1.35; padding-top:2px; }
.plan-row .plan-actions { flex:0 0 auto; display:flex; align-items:center; gap:8px; }
.plan-row .plan-details { line-height:1.45; overflow-wrap:anywhere; }
.plan-row .plan-details.with-check { padding-left:34px; }
.exercise-row.is-done .plan-name-text { color: var(--text-dim); text-decoration: line-through; text-decoration-color: var(--lime-dim); }

/* "Einheit vollbracht"-Haekchen (Athlet + Coach) */
button.plan-check {
  flex: 0 0 auto; width:24px; height:24px; padding:0; cursor:pointer;
  background: transparent; border:1.5px solid var(--line-bright); color: transparent;
  font-size:15px; line-height:1; display:inline-flex; align-items:center; justify-content:center;
}
button.plan-check:hover:not(:disabled) { border-color: var(--lime); }
button.plan-check:disabled { opacity:.35; cursor:default; }
button.plan-check.done { background: var(--lime); border-color: var(--lime); color: #08080a; }
button.plan-check.done.auto { background: transparent; border-color: var(--lime); color: var(--lime); }
.plan-week-hint { color: var(--text-dim); font-size:12px; margin: 0 0 10px; }
button.icon-btn.export-btn { width:auto; padding:0 7px; font-size:11px; letter-spacing:.03em; }

.loading-dots::after { content:'...'; animation: dots 1.2s infinite steps(4); }
@keyframes dots { 0%,20%{content:'.'} 40%{content:'..'} 60%,100%{content:'...'} }

.ob-dot { flex:1; height:4px; background: var(--line); }
.ob-dot.done { background: var(--lime-dim); }
.ob-dot.active { background: var(--lime); }

.pw-wrapper { position: relative; }
.pw-wrapper input { padding-right: 74px; }
.pw-toggle-btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: 1px solid var(--line-bright); color: var(--text-dim);
  padding: 5px 10px; font-size: 11px; cursor: pointer;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.pw-toggle-btn:hover { color: var(--lime); border-color: var(--lime); }

/* ---------------------------------------------------------------
   COMPOSER (Chat-/KI-Eingabe): Textfeld ueber die volle Breite, darunter
   links Mikrofon/Anhang, rechts der Senden-Button. Vorher standen alle
   Elemente in EINER Zeile - das Textfeld wurde auf Handys auf ~140px
   zusammengedrueckt (Text abgeschnitten, Platzhalter umgebrochen).
   --------------------------------------------------------------- */
.chat-input-row.composer {
  display:grid; grid-template-columns:auto auto 1fr auto; gap:8px 8px; align-items:center;
}
.composer .chat-textarea {
  grid-column:1 / -1; min-height:56px; padding:14px 15px; line-height:1.45;
}
.composer .mic-btn, .composer .attach-btn { width:48px; height:48px; min-width:48px; padding:0; }
.composer .attach-btn { font-size:18px; display:flex; align-items:center; justify-content:center; }
.composer .send-btn {
  grid-column:4; justify-self:end; min-height:48px; padding:0 28px;
  background: var(--lime); border:1px solid var(--lime); color:#0a0f00;
  font-family:'Anton', sans-serif; font-size:15px; letter-spacing:0.05em;
  clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 8px 100%);
}
.composer .send-btn:hover { background: var(--lime); color:#0a0f00; filter:brightness(1.1); }

.journal-row { flex-direction:column; align-items:stretch; gap:4px; padding:11px 0; }
.journal-row .journal-text { line-height:1.5; overflow-wrap:anywhere; }

/* Touch-Geraete: Mindest-Tippflaeche ~44px (Apple HIG / Material) */
@media (pointer: coarse) {
  button.secondary, .logout-btn { min-height:44px; }
  button.icon-btn { width:40px; height:40px; font-size:17px; }
  button.icon-btn.export-btn { width:auto; min-width:44px; padding:0 12px; font-size:12px; }
  button.plan-check { width:28px; height:28px; position:relative; }
  button.plan-check::after { content:""; position:absolute; inset:-9px; }
  .link-btn { padding:10px 0; }
  button.primary { min-height:48px; }
}

/* Kleine Bildschirme (Handy hochkant) */
@media (max-width: 560px) {
  main {
    padding: 16px max(14px, env(safe-area-inset-right)) calc(88px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  }
  .card { padding:16px; }
  h2 { font-size:24px; }
  /* Tabs als 2x2-Raster: alle sichtbar, keine abgeschnittenen Beschriftungen */
  .tabbar { display:grid; grid-template-columns:1fr 1fr; overflow:visible; }
  .tabbar button { padding:12px 8px; white-space:normal; line-height:1.2; }
  /* Einfache Eingabezeilen (Notiz, Limit ...): Feld volle Breite, Button darunter */
  .chat-input-row:not(.composer) { flex-wrap:wrap; }
  .chat-input-row:not(.composer) input { flex:1 1 100%; min-width:0; }
  .chat-input-row:not(.composer) button { flex:1 1 auto; min-height:44px; }
  .exercise-row:not(.plan-row) { flex-wrap:wrap; gap:4px 12px; }
  .exercise-row:not(.plan-row) > * { min-width:0; overflow-wrap:anywhere; }
  .exercise-row.journal-row { flex-wrap:nowrap; }
  .msg { max-width:92%; }
  .section-title { margin-top:22px; }
}

@media (prefers-reduced-motion: reduce) {
  .brand .pulse-dot, .pulse-loader path { animation: none; }
  .ring-fg { transition: none; }
}

/* ---------- Rad-Export: Vorschau-Dialog ---------- */
.bike-modal-backdrop {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.72);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0;
}
.bike-modal {
  position: relative;
  width: 100%; max-width: 760px; max-height: 94vh;
  background: var(--surface); border: 1px solid var(--line-bright);
  border-radius: 14px 14px 0 0;
  display: flex; flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 700px) {
  .bike-modal-backdrop { align-items: center; padding: 24px; }
  .bike-modal { border-radius: 14px; max-height: 90vh; }
}
.bike-close {
  position: absolute; top: 8px; right: 8px; z-index: 1;
  width: 44px; height: 44px; padding: 0;
  background: transparent; border: 0; color: var(--text-dim);
  font-size: 28px; line-height: 1; cursor: pointer;
}
.bike-close:hover { color: var(--text); }
.bike-body { overflow-y: auto; padding: 18px 16px 20px; -webkit-overflow-scrolling: touch; }
.bike-body h3 { margin: 0 44px 6px 0; font-size: 20px; }
.bike-dim { color: var(--text-dim); font-size: 13px; line-height: 1.45; margin: 6px 0; }
.bike-warn { color: var(--pink); font-size: 14px; line-height: 1.45; }
.bike-wahoo { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 14px; }

.bike-ftp {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  margin: 12px 0; padding: 10px 12px;
  background: var(--surface-raised); border: 1px solid var(--line);
}
.bike-ftp input { width: 84px; }
.bike-ftp .secondary { min-height: 40px; }

.bike-hints { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 6px; }
.bike-hints li { font-size: 13px; line-height: 1.4; padding: 8px 10px; border-left: 3px solid var(--line-bright); background: var(--surface-raised); }
.bike-hints li.warn { border-left-color: var(--amber); }
.bike-hints li.info { border-left-color: var(--lime-dim); color: var(--text-dim); }

.bike-tree { display: grid; gap: 8px; margin: 12px 0; }
.bike-block { display: grid; gap: 6px; }
.bike-block.repeated {
  padding: 8px 8px 8px 12px;
  border: 1px solid var(--line-bright); border-left: 4px solid var(--lime);
  background: rgba(200,255,61,0.04);
}
.bike-block .bike-block.repeated { border-left-color: var(--pink); background: rgba(255,46,99,0.04); }
.bike-block-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 14px; font-weight: 600; }
.bike-block-head input { width: 64px; }
.bike-skip { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-dim); font-weight: 400; }
.bike-skip input { width: auto; }

.bike-step {
  display: grid; grid-template-columns: 1fr; gap: 6px;
  padding: 8px 10px; background: var(--surface-raised); border: 1px solid var(--line);
}
.bike-step.estimated { border-color: var(--amber); background: rgba(255,176,32,0.07); }
.bike-step-label { font-weight: 600; font-size: 14px; }
.bike-step label { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--text-dim); }
.bike-step input { width: 72px; min-height: 38px; padding: 6px 8px; }
.bike-step-calc { font-size: 12px; color: var(--lime); min-height: 1em; }
@media (min-width: 560px) {
  .bike-step { grid-template-columns: minmax(110px, 1.1fr) auto 1.6fr auto; align-items: center; gap: 6px 12px; }
}

.bike-formats { display: grid; gap: 10px; margin: 16px 0 4px; }
.bike-format { padding: 10px 12px; border: 1px solid var(--line); background: var(--surface-raised); }
.bike-format .bike-dl { width: 100%; margin-bottom: 4px; }
.bike-format button:disabled { opacity: .45; cursor: not-allowed; }
.bike-notes { margin: 6px 0 0; padding-left: 18px; font-size: 12px; color: var(--text-dim); line-height: 1.4; }
.bike-notes li { margin: 2px 0; }
.bike-modal label { margin: 0; text-transform: none; letter-spacing: 0; font-size: 13px; }
.bike-modal button.primary { margin-top: 0; }
.bike-modal input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; padding: 0; -webkit-appearance: checkbox; appearance: auto; }

/* ---------- Kraft-Export: Vorschlags-Dialog ---------- */
.str-list { display: grid; gap: 8px; margin: 12px 0; }
.str-row { display: grid; gap: 6px; padding: 8px 10px; background: var(--surface-raised); border: 1px solid var(--line); }
.str-row.suggested { border-color: var(--amber); background: rgba(255,176,32,0.07); }
.str-head { display: flex; align-items: center; gap: 8px; }
.str-head input { flex: 1; min-width: 0; font-weight: 600; }
.str-badge { font-size: 12px; color: var(--amber); white-space: nowrap; }
.str-del { flex: none; width: 40px; height: 40px; }
.str-fields { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 8px; }
.str-fields label { display: grid; gap: 4px; }
.str-row input, .str-notes-label textarea { min-height: 38px; padding: 6px 8px; }
.str-row input[type="number"] { width: 100%; }
.str-notes-label { display: grid; gap: 6px; margin-top: 14px; color: var(--text-dim); }
#strAdd { margin-top: 4px; min-height: 44px; }

/* ---------- Trainingsplan: 2-Wochen-Block mit KW + Datum ---------- */
.plan-week { margin-bottom: 18px; }
.plan-week-title {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px;
  margin: 14px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line-bright);
  font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; font-size: 13px; color: var(--lime);
}
.plan-week-range { font-weight: 400; font-size: 12px; color: var(--text-dim); letter-spacing: 0; text-transform: none; }
.plan-block-bar {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 16px; margin: 4px 0 8px;
  padding: 10px 12px; background: var(--surface-raised); border: 1px solid var(--line);
}
.plan-block-bar label { margin: 0; }
.plan-block-bar input[type="date"] { width: auto; min-width: 170px; }
.plan-expired { margin: 8px 0; padding: 10px 12px; border-left: 3px solid var(--amber); background: rgba(255,176,32,0.08); font-size: 13px; line-height: 1.4; }

/* Einheiten-Liste und Detail */
.act-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 11px 12px; margin: 0 0 8px; background: var(--surface-raised); border: 1px solid var(--line); border-radius: 10px; color: var(--text); cursor: pointer; }
.act-row:hover { border-color: var(--line-bright); }
.act-main { display: grid; gap: 2px; flex: 1; min-width: 0; }
.act-name { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-meta { color: var(--text-dim); font-size: 12px; }
.act-stats { color: var(--text-dim); font-size: 12px; text-align: right; max-width: 42%; }
.act-raw { font-size: 14px; }
.act-plan { border-left: 3px solid var(--lime-dim); background: var(--surface-raised); padding: 8px 10px; font-size: 13px; line-height: 1.45; margin: 10px 0; }
.act-plan-none { border-left-color: var(--line-bright); color: var(--text-dim); }
.act-stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 10px 0; }
.act-stat { background: var(--surface-raised); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; display: grid; gap: 2px; }
.act-stat span { color: var(--text-dim); font-size: 11px; }
.act-stat b { font-size: 15px; }
.act-canvas { position: relative; height: 150px; }
.act-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.act-table { border-collapse: collapse; font-size: 12px; width: 100%; }
.act-table th, .act-table td { padding: 5px 7px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.act-table th { color: var(--text-dim); font-weight: 500; }
.act-feat { display: grid; gap: 4px; }
.act-feat div { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.act-feat span { color: var(--text-dim); }
.act-ai-text { white-space: pre-wrap; font-size: 14px; line-height: 1.5; background: var(--surface-raised); border-left: 3px solid var(--lime); padding: 10px 12px; margin-bottom: 8px; }
.act-ai-h { display: block; margin-top: 8px; color: var(--lime); }
.act-ai-h:first-child { margin-top: 0; }

/* Benachrichtigungen */
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.bell-btn { position: relative; background: none; border: 1px solid var(--line-bright); color: var(--text); min-width: 44px; min-height: 44px; font-size: 18px; cursor: pointer; padding: 0 10px; }
.bell-btn:hover { border-color: var(--lime); }
.bell-badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--pink); color: #fff; font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; }
.notif-panel { position: fixed; z-index: 900; top: 64px; right: 8px; left: 8px; max-width: 420px; margin-left: auto; max-height: 70vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--line-bright); box-shadow: 0 10px 30px rgba(0,0,0,0.6); }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); }
.notif-item { display: flex; gap: 10px; width: 100%; text-align: left; padding: 11px 12px; background: none; border: 0; border-bottom: 1px solid var(--line); color: var(--text); cursor: pointer; }
.notif-item.unread { background: var(--surface-raised); border-left: 3px solid var(--lime); }
.notif-ico { font-size: 18px; line-height: 1.2; }
.notif-main { display: grid; gap: 2px; flex: 1; min-width: 0; }
.notif-title { font-weight: 600; font-size: 14px; }
.notif-count { color: var(--lime); font-size: 12px; }
.notif-body { color: var(--text-dim); font-size: 13px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.notif-time { color: var(--text-dim); font-size: 11px; }
