/* Stamiq – Dark Performance Dashboard */
:root {
  --bg: #080808;
  --surface: #141414;
  --surface-2: #1F1F1F;
  --surface-3: #2A2A2A;
  --accent: #FF5F1F;
  --accent-dim: rgba(255,95,31,0.12);
  --green: #00C878;
  --green-dim: rgba(0,200,120,0.12);
  --blue: #3B8DFF;
  --blue-dim: rgba(59,141,255,0.12);
  --text: #F0F0F0;
  --text-2: #888888;
  --text-3: #444444;
  --border: rgba(255,255,255,0.06);
  --r: 14px;
  --rs: 8px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  -webkit-text-size-adjust: none;
  overflow-x: hidden;
}

#app { min-height: 100dvh; }

/* Views */
.view { display: none; }
.view.active { display: block; }

/* ── Auth ─────────────────────────────────── */
/* Der Selektor braucht `.active`: Eine ID ist spezifischer als die Klasse
   `.view`, ein blankes `#view-auth { display:flex }` würde `.view {
   display:none }` also überstimmen und nach dem Login stehen bleiben. */
#view-auth.active {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
}

.auth-logo {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--accent);
  margin-bottom: 8px;
}

.auth-tagline {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 40px;
  text-align: center;
}

.auth-tabs {
  display: flex;
  background: var(--surface);
  border-radius: var(--r);
  padding: 4px;
  margin-bottom: 24px;
  width: 100%;
  max-width: 360px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: none;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all .15s;
  font-family: var(--font);
}

.auth-tab.active {
  background: var(--surface-2);
  color: var(--text);
}

.auth-form {
  width: 100%;
  max-width: 360px;
  display: none;
}

.auth-form.active { display: block; }

.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rs);
  padding: 13px 14px;
  color: var(--text);
  /* 16px ist Pflicht, nicht Geschmack: iOS Safari zoomt beim Antippen eines
     Eingabefelds automatisch hinein, wenn die Schrift kleiner ist — und zoomt
     danach nicht zurueck. Die Seite bleibt vergroessert und breiter als der
     Bildschirm. */
  font-size: 16px;
  font-family: var(--font);
  outline: none;
  transition: border-color .15s;
  -webkit-appearance: none;
}

.form-input:focus {
  border-color: var(--accent);
}

/* Automatisch ausgefüllte Felder: Chrome erzwingt einen hellen Hintergrund und
   ignoriert dabei `background`. Der einzige verlässliche Weg dagegen ist ein
   randloser Innenschatten, der die Fläche überdeckt. Die lange `transition`
   verhindert, dass die helle Farbe kurz aufblitzt. */
.form-input:-webkit-autofill,
.form-input:-webkit-autofill:hover,
.form-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--surface) inset;
  caret-color: var(--text);
  transition: background-color 9999s ease-out 0s;
}

/* Passwortfeld mit Umschalter: Der Button sitzt im Feld, deshalb braucht die
   Eingabe rechts Platz, damit langer Text nicht darunter verschwindet. */
.input-with-toggle {
  position: relative;
}

.input-with-toggle .form-input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--text-2);
  font-size: 16px;
  line-height: 1;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  color: var(--text);
}

.btn {
  display: block;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--rs);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  text-align: center;
  transition: opacity .1s;
  letter-spacing: .2px;
}

.btn:active { opacity: .75; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { background: var(--surface-2); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text-2); }

/* Unwiderrufliche Aktionen (Konto löschen): rot, der Einstieg bewusst leise */
.btn-gefahr { background: #d93a3a; color: #fff; }
.btn-gefahr:disabled { opacity: .6; cursor: default; }
.btn-gefahr-leise { background: transparent; color: #ff6b6b; border: 1px solid rgba(255,60,60,0.3); }
.karte-gefahr { border-color: rgba(255,60,60,0.3); }

/* Hinweiskarte mit Handlungsbedarf, z. B. veraltete Ziele auf „Heute" */
.karte-hinweis { border-color: rgba(255,95,31,0.35); }
/* Zusammensetzung des Kalorienziels unter Balken und Tagessumme */
.ziel-teile { font-size: 12px; color: var(--text-2); margin-top: 6px; font-variant-numeric: tabular-nums; }

.karte-hinweis-text { font-size: 14px; line-height: 1.5; color: var(--text-2); margin-bottom: 12px; }

.auth-error {
  background: rgba(255,60,60,0.1);
  border: 1px solid rgba(255,60,60,0.2);
  border-radius: var(--rs);
  padding: 10px 14px;
  font-size: 13px;
  color: #ff6b6b;
  margin-bottom: 14px;
  display: none;
}

.auth-error.visible { display: block; }

/* „Passwort vergessen?" und „Zurück": Textlink, aber mit 44 px Tippfläche */
.auth-link {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
  background: none;
  border: none;
  color: var(--text-2);
  font-family: var(--font);
  font-size: 14px;
  cursor: pointer;
}

.auth-link:active { opacity: .6; }

.auth-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-2);
  margin: 0 0 16px;
}

/* ── App Shell ────────────────────────────── */
#view-dashboard, #view-onboarding {
  padding-bottom: max(env(safe-area-inset-bottom), 80px);
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8,8,8,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: max(env(safe-area-inset-top), 0px) 16px 0;
}

.app-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 52px;
}

.app-logo {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.5px;
  color: var(--accent);
}

.header-date {
  font-size: 12px;
  color: var(--text-2);
}

/* Bottom Nav */
.app-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(8,8,8,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  padding-bottom: max(env(safe-area-inset-bottom), 4px);
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 4px;
  border: none;
  background: none;
  color: var(--text-3);
  font-size: 10px;
  font-family: var(--font);
  cursor: pointer;
  transition: color .15s;
}

.nav-btn.active { color: var(--accent); }
.nav-icon { font-size: 22px; line-height: 1; }

/* Content */
.page-content { padding: 16px; }

/* Cards */
.card {
  background: var(--surface);
  border-radius: var(--r);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}

.card-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 12px;
}

/* Progress Bars */
.progress-wrap { margin-bottom: 12px; }

.progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 13px;
}

.progress-header span:last-child { color: var(--text-2); }

.progress-track {
  height: 7px;
  background: var(--surface-3);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .4s ease;
}

/* Metrics Grid */

.metric-card {
  background: var(--surface-2);
  border-radius: var(--rs);
  padding: 14px;
  text-align: center;
}

.metric-value {
  font-size: 26px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
  line-height: 1;
}

.metric-label {
  font-size: 11px;
  color: var(--text-2);
  margin-top: 4px;
}

/* Dashboard: Training der Woche als Leiste Mo–So */
.woche-kopf {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
}

.woche-anzahl {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--accent);
  line-height: 1;
}

.woche-anzahl small { font-size: 14px; font-weight: 700; letter-spacing: 0; }

.woche-dauer { font-size: 14px; font-weight: 600; color: var(--text-2); }

.woche-leiste {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
}

.woche-tag {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;          /* Platz für den zweiten Ring, der über den Punkt hinausragt */
  font-size: 11px;
  color: var(--text-2);
}

.woche-tag.heute { color: var(--accent); font-weight: 700; }

/* Gefüllt = trainiert, gefüllt mit zweitem Ring = Doppeleinheit,
   grauer Ring = vergangen ohne Training, kleiner Punkt = offen */
.woche-punkt { width: 14px; height: 14px; border-radius: 50%; }
.woche-punkt.trainiert { background: var(--accent); }
.woche-punkt.doppelt {
  background: var(--accent);
  /* Innerer Schatten in Kartenfarbe = Abstand, äußerer = zweiter Ring */
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent);
}
.woche-punkt.frei { border: 2px solid var(--surface-3); }
.woche-punkt.offen { width: 6px; height: 6px; margin: 4px; background: var(--surface-3); }

/* AI Chat */
.ai-input-wrap {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.ai-input {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--rs);
  padding: 11px 14px;
  color: var(--text);
  font-size: 16px;   /* siehe .form-input: unter 16px zoomt iOS beim Antippen */
  font-family: var(--font);
  outline: none;
  -webkit-appearance: none;
}

.ai-input:focus { border-color: var(--accent); }

.ai-send {
  background: var(--accent);
  border: none;
  border-radius: var(--rs);
  padding: 11px 16px;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  transition: opacity .1s;
}

.ai-send:active { opacity: .7; }

/* Coach-Chat (js/coach-chat.js) */
.coach-kopf {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.coach-neu {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* Langer Verlauf scrollt innerhalb der Karte, die neueste Nachricht unten */
.coach-verlauf {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 55vh;
  overflow-y: auto;
  /* Sonst zeigt der Browser einen hellen Standard-Scrollbalken */
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}

.coach-verlauf:not(:empty) { margin-bottom: 12px; }

.coach-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: var(--r);
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.coach-user {
  align-self: flex-end;
  background: var(--accent-dim);
  color: var(--text);
  border-bottom-right-radius: 4px;
  white-space: pre-wrap;
}

.coach-bot {
  align-self: flex-start;
  background: var(--surface-2);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.coach-fehler { color: #ff6b6b; }

.coach-hinweis {
  align-self: center;
  font-size: 12px;
  color: var(--text-3);
}

/* Absätze und Listen aus coachTextHtml() */
.coach-bot p { margin: 0 0 8px; }
.coach-bot ul { margin: 0 0 8px; padding-left: 20px; }
.coach-bot li { margin-bottom: 4px; }
.coach-bot > :last-child { margin-bottom: 0; }
.coach-bot strong { color: #fff; }

/* Tags */
.tag {
  display: inline-block;
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 600;
}

.tag-orange { background: var(--accent-dim); color: var(--accent); }
.tag-green { background: var(--green-dim); color: var(--green); }
.tag-blue { background: var(--blue-dim); color: var(--blue); }

/* Quick Actions */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.quick-actions-2 { grid-template-columns: repeat(2, 1fr); }

.quick-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rs);
  padding: 14px 8px;
  color: var(--text);
  font-size: 12px;
  font-family: var(--font);
  cursor: pointer;
  text-align: center;
  transition: background .1s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.quick-btn:active { background: var(--surface-2); }
.quick-btn-icon { font-size: 22px; }

/* Section separator */
.sep { height: 1px; background: var(--border); margin: 16px 0; }

/* Greeting */
.greeting-name {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.5px;
}

.greeting-sub {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 2px;
}

/* Tagesumschalter unter der Seitenüberschrift (Essen, Training) */
.day-picker {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 2px 0 0 -10px;
}

/* 40 px Tippfläche, obwohl das Zeichen selbst klein ist */
.day-picker-pfeil {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.day-picker-pfeil:disabled { color: var(--text-3); cursor: default; }

.day-picker-tag {
  font-size: 13px;
  color: var(--text-2);
  text-align: center;
}

/* Nicht heute: auffällig, damit niemand versehentlich beim Vortag einträgt */
.day-picker-tag.vergangen { color: var(--accent); font-weight: 700; }

/* Toast */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--rs);
  padding: 12px 20px;
  font-size: 14px;
  z-index: 999;
  opacity: 0;
  transition: opacity .2s;
  white-space: nowrap;
}

.toast.visible { opacity: 1; }

/* Spinner */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--surface-3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Empty State */
.empty {
  text-align: center;
  color: var(--text-3);
  padding: 2rem 0;
  font-size: 14px;
}

/* Responsive: ≥ 480px zentriert auf Desktop */
@media (min-width: 480px) {
  #app { max-width: 480px; margin: 0 auto; }
  .app-nav { max-width: 480px; left: 50%; transform: translateX(-50%); }
}

/* ── Onboarding ───────────────────────────── */
/* Eigene Ansicht ohne untere Navigation: die Strecke soll nicht wegklickbar
   sein, solange die Pflichtangaben fehlen. Deshalb hier kein Platzhalter für
   die Navigationsleiste, anders als beim Dashboard. */
#view-onboarding, #view-einwilligung {
  padding-bottom: max(env(safe-area-inset-bottom), 24px);
}

/* ── Einwilligung ─────────────────────────── */
/* Ganze Zeile antippbar; das Kästchen groß genug für den Daumen */
.einw-check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 8px 0 16px;
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
}

.einw-check input {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  margin: 0;
  accent-color: var(--accent);
}

#einw-knopf:disabled { opacity: .5; cursor: default; }

.ob-wrap { padding: 24px 16px 32px; }

.ob-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.ob-progress { display: flex; gap: 6px; }

.ob-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--surface-3);
  transition: background .2s, width .2s;
}

.ob-dot.done { background: var(--accent-dim); }

.ob-dot.active {
  width: 20px;
  border-radius: 4px;
  background: var(--accent);
}

.ob-counter {
  font-size: 12px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.ob-title {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 8px;
  letter-spacing: -.3px;
}

.ob-hint {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.5;
  margin-bottom: 24px;
}

.ob-error {
  background: rgba(255,60,60,0.1);
  border: 1px solid rgba(255,60,60,0.2);
  border-radius: var(--rs);
  padding: 10px 14px;
  font-size: 13px;
  color: #ff6b6b;
  margin-bottom: 16px;
  display: none;
}

.ob-error.visible { display: block; }

/* Auswahlkarten */
.ob-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.ob-choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.ob-choice:active { opacity: .8; }

.ob-choice.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.ob-choice-note {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
}

/* Zahlenfelder */
.ob-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ob-unit-wrap { position: relative; }

.ob-unit {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: var(--text-2);
  pointer-events: none;
}

.ob-unit-wrap .form-input { padding-right: 52px; }

.ob-nav {
  display: flex;
  gap: 10px;
  margin-top: 28px;
}

.ob-nav .btn-secondary { flex: 0 0 35%; }
.ob-nav .btn-primary { flex: 1; }
.ob-nav .btn:disabled { opacity: .5; cursor: default; }

.ob-wrap .btn-ghost { margin-top: 10px; font-weight: 600; }

/* Schmale Auswahlknöpfe in einer Reihe, z. B. für Trainingstage 0–7 */
.ob-chips {
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
}

.ob-chip {
  flex: 1;
  padding: 12px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--rs);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.ob-chip.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
}

/* Herleitung der Tagesziele: Rechenweg offenlegen, statt eine Zahl zu behaupten */
.ob-rechnung { margin-bottom: 20px; }

.ob-zeile {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--text-2);
  padding: 6px 0;
}

.ob-zeile span:last-child {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ob-zeile-fett {
  border-top: 1px solid var(--border);
  margin-top: 4px;
  padding-top: 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.ob-zeile-fett span:last-child { color: var(--accent); }

.ob-fussnote {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-3);
  margin-top: 4px;
}

.ob-fussnote strong { color: var(--text-2); }

/* Mehrfachauswahl: Ein Haken macht sichtbar, dass mehrere Antworten erlaubt sind */
.ob-choice-multi { padding-right: 44px; position: relative; }

.ob-choice-multi::after {
  content: '';
  position: absolute;
  right: 16px;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  border: 1px solid var(--surface-3);
  border-radius: 5px;
  transition: border-color .15s, background .15s;
}

.ob-choice-multi.selected::after {
  border-color: var(--accent);
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 12px no-repeat;
}

/* Liste hinzugefügter Einträge, z. B. Rennen */
.ob-liste {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.ob-listeneintrag {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
}

.ob-listentitel { font-size: 15px; font-weight: 600; }

.ob-listenzeile {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 2px;
}

.ob-entfernen {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 14px;
  cursor: pointer;
}

.ob-entfernen:active { opacity: .7; }

.ob-hinweis {
  display: none;
  font-size: 13px;
  color: #ff6b6b;
  margin-top: 10px;
}

.ob-hinweis.visible { display: block; }

.ob-textarea {
  min-height: 84px;
  resize: vertical;
  line-height: 1.5;
  font-family: var(--font);
}

/* Ausweg aus dem Onboarding, wenn es nachträglich geöffnet wurde */
.ob-abbrechen {
  display: block;
  background: none;
  border: none;
  padding: 0 0 20px;
  color: var(--text-2);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.ob-abbrechen:active { opacity: .6; }

/* Angaben im Profil, mit sichtbaren Lücken */
.profil-zeile {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  font-size: 13px;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
}

.profil-zeile:last-child { border-bottom: none; }

.profil-zeile span:last-child {
  color: var(--text);
  text-align: right;
}

.profil-fehlt { color: var(--text-3) !important; font-style: italic; }

/* ── Training ─────────────────────────────── */
/* Sechs Sportarten passen nicht in eine Zeile: drei pro Reihe */
.tr-chips { flex-wrap: wrap; margin-bottom: 16px; }
.tr-chip { flex: 1 0 30%; font-size: 13px; font-weight: 600; }

/* Ausgeblendete Felder bleiben aus, egal was andere Regeln sagen */
[data-zeigen][hidden] { display: none !important; }

/* Dauer als Std / Min / Sek nebeneinander — in Handybreite eng, daher knappere Abstände */
.tr-dauer { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tr-dauer .form-input { padding-left: 12px; padding-right: 38px; }
.tr-dauer .ob-unit { right: 10px; }

/* ── Essen ────────────────────────────────── */
.nu-schaetzen { margin-bottom: 8px; }
.nu-schaetzen:disabled { opacity: .6; cursor: default; }

.nu-hinweis {
  display: none;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: var(--blue-dim);
  border-radius: var(--rs);
  font-size: 13px;
  line-height: 1.4;
  color: var(--blue);
}

.nu-hinweis.visible { display: block; }

/* „Frühstück" passt in 15 px nicht in ein Viertel der Handybreite */
.nu-chip { font-size: 13px; font-weight: 600; }

.nu-summe {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.nu-eintrag {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.nu-eintrag:last-child { border-bottom: none; }

/* min-width: 0 erlaubt dem Text zu kürzen, statt die Zeile zu sprengen */
.nu-eintrag-text { flex: 1; min-width: 0; }

/* Antippen öffnet den Eintrag zum Bearbeiten; kurzes Aufhellen als Rückmeldung */
.nu-eintrag-text.antippbar { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.nu-eintrag-text.antippbar:active { opacity: .6; }

.nu-eintrag-kopf,
.nu-eintrag-detail {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.nu-eintrag-kopf { font-size: 14px; font-weight: 700; }

.nu-eintrag-detail {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-2);
}

.nu-beschreibung {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nu-makros { flex-shrink: 0; font-variant-numeric: tabular-nums; }

.nu-loeschen {
  flex-shrink: 0;
  min-width: 44px;
  height: 36px;
  padding: 0 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--rs);
  color: var(--text-2);
  font-family: var(--font);
  font-size: 14px;
  cursor: pointer;
}

.nu-loeschen.bestaetigen {
  background: rgba(255,60,60,0.12);
  border-color: rgba(255,60,60,0.3);
  color: #ff6b6b;
  font-size: 12px;
  font-weight: 700;
}

/* ── Fixum ────────────────────────────────── */
/* Name links, Kalorien rechts; lange Namen kürzen statt umbrechen */
.fx-knopf {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  text-align: left;
}

.fx-knopf:disabled { opacity: .5; cursor: default; }

.fx-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fx-kcal {
  flex-shrink: 0;
  font-weight: 600;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.fx-merken { margin-top: 8px; font-weight: 600; }

/* ── Woche ────────────────────────────────── */
/* Wochenkarte auf „Heute" öffnet die Seite „Woche" */
.karte-link { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.karte-link:active { opacity: .6; }

.karte-kopf { display: flex; justify-content: space-between; }
.karte-mehr { color: var(--accent); letter-spacing: 0; text-transform: none; font-size: 12px; }

.wv-leer { font-size: 13px; color: var(--text-3); }

.wv-hinweis {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.4;
}

.wv-fehlt { color: var(--text-3); font-weight: 400; font-style: italic; }

/* Kalorien und Protein nicht kürzen, der Trainingstext darunter schon */
.wv-tage .nu-eintrag-kopf span:last-child { flex-shrink: 0; font-variant-numeric: tabular-nums; }
