:root {
  --bg: #050608;
  --bg-soft: #0b0d10;
  --panel: #12151a;
  --panel-2: #181c22;
  --line: rgba(255, 255, 255, 0.09);
  --text: #f4f7f2;
  --muted: #929a9b;
  --lime: #cdff3c;
  --lime-2: #9bdc1f;
  --red: #ff4646;
  --blue: #45a3ff;
  --orange: #ff9d2e;
  --good: #52e58a;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
  --radius: 24px;
  --radius-sm: 16px;
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 14% -8%, rgba(205, 255, 60, 0.15), transparent 28%),
    linear-gradient(180deg, #06070a 0%, #0a0c10 48%, #050608 100%);
  color: var(--text);
  font-size: 15px;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  width: min(100%, 560px);
  min-height: 100vh;
  margin: 0 auto;
  position: relative;
  padding-bottom: calc(90px + env(safe-area-inset-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  background: rgba(5, 6, 8, 0.82);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.topbar h1 {
  margin: 1px 0 0;
  font-size: 15px;
  line-height: 1.1;
  font-weight: 900;
  text-align: center;
}

.micro {
  margin: 0;
  color: var(--lime);
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 850;
  text-align: center;
}

.app {
  padding: 14px 14px 0;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 30;
  width: min(100%, 560px);
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: rgba(7, 8, 11, 0.92);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(22px);
}

.bottom-nav button {
  display: flex;
  min-width: 0;
  min-height: 58px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 18px;
  background: transparent;
  color: #7f8788;
  font-size: 10px;
  font-weight: 800;
}

.bottom-nav button.active {
  color: #111;
  background: var(--lime);
}

svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
}

.hero {
  position: relative;
  min-height: 320px;
  overflow: hidden;
  border-radius: 30px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  box-shadow: var(--shadow);
  background:
    radial-gradient(120% 90% at 85% 0%, rgba(205, 255, 60, 0.28), transparent 55%),
    linear-gradient(160deg, #1b2230 0%, #0b0e13 60%, #050608 100%);
}

.hero h2 {
  margin: 0;
  max-width: 12ch;
  font-size: clamp(36px, 12vw, 58px);
  line-height: 0.88;
  font-weight: 950;
  letter-spacing: 0;
}

.hero p {
  max-width: 26rem;
  margin: 12px 0 18px;
  color: rgba(244, 247, 242, 0.86);
  font-size: 15px;
  line-height: 1.45;
}

.onboarding-hero {
  min-height: 280px;
}

.hero-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.metric-tile,
.card,
.exercise-card,
.meal-row,
.setting-row {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
}

.metric-tile {
  padding: 14px;
}

.label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.value {
  font-size: 22px;
  font-weight: 950;
}

.value small {
  color: var(--muted);
  font-size: 12px;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin: 24px 2px 10px;
}

.section-title h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 930;
}

.section-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.onboarding-form {
  display: block;
}

.day-picker,
.quick-foods {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.day-chip {
  min-width: 48px;
  min-height: 44px;
  border-radius: 15px;
  background: #20252b;
  color: var(--text);
  border: 1px solid var(--line);
  font-weight: 900;
}

.day-chip.active {
  background: var(--lime);
  color: #10130f;
  border-color: var(--lime);
}

.quick-foods .secondary-button {
  flex: 1 1 calc(50% - 8px);
  min-width: 145px;
}

.card {
  padding: 16px;
}

.card.accent {
  background: linear-gradient(145deg, rgba(205, 255, 60, 0.2), rgba(18, 21, 26, 0.96));
  border-color: rgba(205, 255, 60, 0.25);
}

.card.red {
  border-color: rgba(255, 70, 70, 0.28);
}

.card.blue {
  border-color: rgba(69, 163, 255, 0.28);
}

.card.orange {
  border-color: rgba(255, 157, 46, 0.28);
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 52px;
  border-radius: 18px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 900;
}

.primary-button {
  background: var(--lime);
  color: #10130f;
}

.secondary-button {
  background: #20252b;
  color: var(--text);
  border: 1px solid var(--line);
}

.danger-button {
  background: rgba(255, 70, 70, 0.14);
  color: #ff8b8b;
  border: 1px solid rgba(255, 70, 70, 0.25);
}

.button-row {
  display: flex;
  gap: 10px;
}

.button-row > button,
.button-row > a {
  flex: 1;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(205, 255, 60, 0.12);
  color: var(--lime);
  font-size: 11px;
  font-weight: 900;
}

.status-pill.red {
  background: rgba(255, 70, 70, 0.13);
  color: #ff6969;
}

.status-pill.blue {
  background: rgba(69, 163, 255, 0.13);
  color: #74bbff;
}

.status-pill.orange {
  background: rgba(255, 157, 46, 0.13);
  color: #ffb765;
}

.progress-bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.progress-bar span {
  display: block;
  height: 100%;
  width: var(--w, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--lime), var(--lime-2));
}

.list {
  display: grid;
  gap: 10px;
}

.exercise-card {
  padding: 14px;
}

.exercise-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.exercise-head h4 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
}

.exercise-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.set-grid {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.set-row {
  display: grid;
  grid-template-columns: 36px 1fr 1fr 1fr 44px;
  gap: 7px;
  align-items: center;
}

.set-row strong {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.field {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 10px;
  background: #0c0f13;
  color: var(--text);
  outline: 0;
}

.field:focus {
  border-color: rgba(205, 255, 60, 0.58);
}

/* Phase 2b.1 — Check-Tab: Touch-Targets fuer Body-Metric-Inputs und Visual-Look-Dropdown auf 44px */
.check-metrics .field,
[data-visual] {
  min-height: 44px;
}

.check {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: #22272e;
  color: var(--muted);
  border: 1px solid var(--line);
}

.check.done {
  color: #111;
  background: var(--lime);
}

.textarea {
  width: 100%;
  min-height: 76px;
  margin-top: 10px;
  padding: 12px;
  resize: vertical;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #0c0f13;
  color: var(--text);
  outline: 0;
}

.backup-box {
  min-height: 150px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
}

.quick-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.quick-actions a,
.quick-actions button {
  min-height: 38px;
  border-radius: 13px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #20252b;
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
  font-weight: 850;
}

.history-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 12px;
}

.history-summary > div {
  padding: 12px;
  border-radius: 16px;
  background: #0c0f13;
  border: 1px solid var(--line);
}

.history-summary strong {
  display: block;
  line-height: 1.35;
}

.exercise-history {
  margin-top: 12px;
  border-radius: 18px;
  background: #0c0f13;
  border: 1px solid var(--line);
  overflow: hidden;
}

.exercise-history summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: var(--lime);
  font-weight: 900;
  cursor: pointer;
}

.exercise-history .empty {
  margin: 0 12px 12px;
}

.small-chart {
  height: 150px;
  margin: 4px 0;
}

.history-list {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.history-item p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.history-item span {
  color: var(--orange);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.meal-row,
.setting-row {
  min-height: 66px;
  padding: 13px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.meal-row p,
.setting-row p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.food-entry .icon-button {
  width: 38px;
  height: 38px;
  font-size: 24px;
  line-height: 1;
}

.toggle {
  width: 54px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 3px;
  background: #2a3037;
  border: 1px solid var(--line);
}

.toggle span {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #788083;
  transition: transform 0.18s ease, background 0.18s ease;
}

.toggle.on {
  background: rgba(205, 255, 60, 0.2);
}

.toggle.on span {
  transform: translateX(21px);
  background: var(--lime);
}

.range-row {
  display: grid;
  grid-template-columns: 1fr 48px;
  gap: 12px;
  align-items: center;
}

input[type="range"] {
  accent-color: var(--lime);
}

.chart {
  width: 100%;
  height: 170px;
  display: block;
}

.heatmap {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 5px;
}

.heat-day {
  aspect-ratio: 1;
  border-radius: 8px;
  background: #1a1f25;
  border: 1px solid var(--line);
}

.heat-day.done {
  background: var(--lime);
  border-color: var(--lime);
}

.timer-display {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 112px;
  border-radius: 26px;
  background: #090b0e;
  border: 1px solid var(--line);
  font-size: 46px;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.coach-score {
  display: grid;
  place-items: center;
  width: 150px;
  height: 150px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #151a1d 55%, transparent 56%),
    conic-gradient(var(--lime) var(--angle, 0deg), #242a2f 0);
  border: 1px solid var(--line);
}

.coach-score strong {
  font-size: 42px;
  font-weight: 950;
}

.coach-text {
  margin: 0;
  color: rgba(244, 247, 242, 0.9);
  line-height: 1.55;
}

.empty {
  padding: 20px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 98px;
  transform: translate(-50%, 16px);
  z-index: 50;
  width: min(calc(100% - 28px), 520px);
  padding: 13px 14px;
  border-radius: 17px;
  background: rgba(205, 255, 60, 0.95);
  color: #0d100c;
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 390px) {
  .app {
    padding-inline: 10px;
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 300px;
    padding: 18px;
  }

  .set-row {
    grid-template-columns: 30px 1fr 1fr 1fr 40px;
    gap: 5px;
  }

  .field {
    padding: 0 7px;
  }

  .bottom-nav span {
    font-size: 8px;
  }
}
