/* fuelfit – Design-System
   Heller iOS-Look, Akzent #FFD801, Schwarz als Kontrastfarbe.
   Mobile first (iPhone), iPad ab 768px. */

:root {
  --accent: #FFD801;
  --accent-ink: #0A0A0A;
  --accent-soft: rgba(255, 216, 1, .18);
  --ink: #0A0A0A;
  --bg: #F3F2EE;
  --card: #FFFFFF;
  --card-2: #F0EFEA;
  --card-3: #E5E3DD;
  --line: rgba(0, 0, 0, .07);
  --text: #0A0A0A;
  --muted: #86857F;
  --muted-2: #B9B7B0;
  --danger: #E5484D;
  --success: #2FA84F;
  --water: #3B9BF0;
  --protein: #E2574C;
  --carbs: #4A8FE2;
  --fat: #E3A62B;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .05);
  --shadow-float: 0 10px 34px rgba(0, 0, 0, .16), 0 1px 3px rgba(0, 0, 0, .08);
  --glass: rgba(255, 255, 255, .74);

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --round: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --radius: 24px;
  --radius-sm: 14px;
  --gutter: 16px;
  --tabbar-h: 60px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; background: var(--bg); }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overscroll-behavior-y: none;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }

.icon { width: 22px; height: 22px; flex: none; }
.num { font-family: var(--round); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.accent { color: var(--ink); background: var(--accent); padding: 0 .2em; border-radius: .25em; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------------ Layout */

.screen {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: calc(var(--safe-top) + 10px) var(--gutter) calc(var(--tabbar-h) + var(--safe-bottom) + 40px);
  /* iOS: Auf Seiten, die nicht scrollen, rechnet Safari mit ausgeklappter Browser-Leiste –
     fixierte Elemente (Tab-Leiste) rutschen dann nach oben. 1px höher als der große
     Viewport hält jede Seite scrollbar und die Tab-Leiste unten. */
  min-height: calc(100vh + 1px);
  min-height: calc(100lvh + 1px);
}
.screen.with-fab { padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 100px); }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 2px 18px;
}
.page-head .eyebrow { color: var(--muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.page-head h1 { font-family: var(--round); font-size: 34px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }

.back-link { display: inline-flex; align-items: center; gap: 2px; color: var(--text); font-weight: 600; margin: 4px 0 6px -6px; padding: 6px; }

.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 4px 10px; }
.section-title h2 { font-family: var(--round); font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.section-title a, .section-title span { color: var(--muted); font-size: 15px; }
.section-title a { color: var(--text); font-weight: 600; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stack > * + * { margin-top: 12px; }

/* ------------------------------------------------------------------ Cards */

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  position: relative;
  box-shadow: var(--shadow);
}
.card-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: var(--muted); margin-bottom: 12px; }
.card-title .icon { width: 18px; height: 18px; }
.card-link { display: block; transition: transform .15s ease; }
.card-link:active { transform: scale(.98); }

/* ------------------------------------------------------------------ Heute */

.day-head { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; height: 44px; margin-bottom: 8px; }
.day-head .title { display: flex; justify-content: center; align-items: center; gap: 7px; font-size: 17px; font-weight: 600; }
.day-nav { width: 44px; height: 44px; display: grid; place-items: center; }
.day-nav .icon { width: 22px; height: 22px; stroke-width: 2.1; }
.day-nav.disabled { opacity: .2; pointer-events: none; }
.streak { display: inline-flex; align-items: center; gap: 2px; background: var(--accent); border-radius: 99px; padding: 2px 8px 2px 6px; font-size: 13px; font-weight: 700; }
.streak .icon { width: 13px; height: 13px; }

/* Ring ≈ 63 % der Bildschirmbreite wie in der Vorlage; Schrift skaliert mit dem Ring (cqw). */
.kcal-ring { position: relative; width: min(63vw, 262px); aspect-ratio: 1; margin: 4px auto 26px; container-type: inline-size; }
.kcal-ring .ring { width: 100%; height: 100%; }
.kcal-ring .ring-track, .kcal-ring .ring-fill { stroke-width: 3.4; }
.kcal-ring .ring-track { stroke: var(--card-3); }
.kcal-ring .ring-fill { stroke: var(--ink); }
.kcal-ring .center { position: absolute; inset: 9%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.kcal-ring .big { font-family: var(--round); font-size: 17vw; font-size: 26cqw; font-weight: 800; line-height: 1; letter-spacing: -.035em; white-space: nowrap; }
.kcal-ring .sub { color: #3A3A38; font-size: 14px; margin-top: 6px; }
.kcal-ring.over .big, .kcal-ring.over .sub { color: var(--danger); }
.kcal-ring.over .ring-fill { stroke: var(--danger); }
.pill-training { display: inline-flex; align-items: center; gap: 5px; margin-top: 10px; background: var(--accent); border-radius: 99px; padding: 3px 10px 3px 9px; font-size: 13px; font-weight: 600; }
.pill-training .icon { width: 15px; height: 15px; stroke-width: 2.4; }
.pill-training.add { background: var(--card-2); color: var(--muted); }

.ring { transform: rotate(-90deg); overflow: visible; }
.ring-track, .ring-fill { fill: none; stroke-width: 9; }
.ring-track { stroke: var(--card-3); }
.ring-fill { stroke: var(--ink); stroke-linecap: round; stroke-dasharray: 100 100; transition: stroke-dashoffset .7s cubic-bezier(.2, .8, .2, 1), stroke .2s; }

.macro-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 0 0 20px; }
.macro-row .top { display: flex; justify-content: space-between; font-size: 12px; color: #55544F; }
.macro-row .top .p { color: var(--muted); }
.macro-row .bar { height: 7px; margin: 4px 0 5px; }
.macro-row .val { color: var(--muted); font-size: 14px; white-space: nowrap; }

.bar { height: 6px; border-radius: 99px; background: var(--card-3); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--ink); transition: width .7s cubic-bezier(.2, .8, .2, 1); }
.bar.protein > i { background: var(--protein); }
.bar.carbs > i { background: var(--carbs); }
.bar.fat > i { background: var(--fat); }
.bar.over > i { background: var(--danger); }

.quick-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.qcard { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 16px; padding: 9px 11px; box-shadow: var(--shadow); min-width: 0; transition: transform .1s; }
.qcard:active { transform: scale(.97); }
.qcard .dot { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; flex: none; }
.qcard .dot .icon { width: 16px; height: 16px; }
.qcard .t { font-size: 15px; font-weight: 600; line-height: 1.2; }
.qcard .s { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qcard > div:last-child { min-width: 0; }

.track { padding: 16px 16px 18px; border-radius: 22px; }
.track + .track { margin-top: 12px; }
.track-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; min-height: 28px; }
.track-head h3 { display: flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 600; }
.track-head h3 .icon { width: 16px; height: 16px; }
.track-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.track .value { font-family: var(--round); font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.track .of { color: var(--muted); font-size: 15px; margin-left: 4px; font-family: var(--sans); font-weight: 400; letter-spacing: 0; }
.track .rest { color: var(--muted); font-size: 13px; white-space: nowrap; }
.track .bar { height: 8px; margin-top: 14px; }
.track .icon-btn { width: 30px; height: 30px; margin: -4px -4px -4px 0; display: grid; place-items: center; color: var(--muted); border-radius: 50%; }
.track .icon-btn:active { background: var(--card-2); }
.track .icon-btn .icon { width: 18px; height: 18px; }
.water-drop { color: var(--water); }
.water-actions { display: flex; gap: 6px; align-items: center; flex: none; }
.pill-btn { height: 34px; padding: 0 13px; border-radius: 99px; background: var(--card-2); font-size: 15px; font-weight: 600; transition: transform .1s, background .15s; white-space: nowrap; }
.pill-btn:active { transform: scale(.94); background: var(--card-3); }
.track.done .bar > i { background: var(--success); }

/* ------------------------------------------------------------------ Wasser-Animation */

.water-card { overflow: hidden; isolation: isolate; }
.water-fill { position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: inherit; overflow: hidden; }
.water-body {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: var(--level, 0%);
  background: linear-gradient(180deg, rgba(110, 190, 255, .20) 0%, rgba(59, 155, 240, .30) 100%);
  transition: height 1.1s cubic-bezier(.25, 1.35, .45, 1);
}
.water-fill.empty .water-body { opacity: 0; }
.wave { position: absolute; left: 0; bottom: calc(100% - 1px); width: 200%; height: 12px; animation: wave 7s linear infinite; transition: height .4s; }
.wave.w1 { fill: rgba(110, 190, 255, .20); }
.wave.w2 { fill: rgba(110, 190, 255, .14); height: 9px; animation-duration: 11s; animation-direction: reverse; }
@keyframes wave { to { transform: translateX(-50%); } }
.water-card .pill-btn { background: rgba(255, 255, 255, .72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 1px 3px rgba(0, 0, 0, .06); }
.water-card .pill-btn:active { background: #fff; }
.water-card.splash .wave { animation-duration: 1.6s; height: 20px; }
.water-card.splash .wave.w2 { animation-duration: 2.2s; height: 16px; }

.bubble { position: absolute; bottom: 0; border-radius: 50%; background: rgba(255, 255, 255, .85); box-shadow: inset 0 0 0 1px rgba(59, 155, 240, .35); pointer-events: none; }

.water-icon { position: relative; display: inline-grid; place-items: center; }
.water-icon .ripple { position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; border: 2px solid var(--water); pointer-events: none; }

.fly-drop { position: fixed; left: 0; top: 0; width: 22px; height: 22px; margin: -11px 0 0 -11px; z-index: 70; color: var(--water); pointer-events: none; filter: drop-shadow(0 3px 6px rgba(59, 155, 240, .45)); }
.fly-drop svg { width: 100%; height: 100%; }
.float-label { position: fixed; z-index: 70; pointer-events: none; transform: translate(-50%, -50%); font-family: var(--round); font-weight: 800; font-size: 16px; color: var(--water); white-space: nowrap; }
.burst-drop { position: fixed; left: 0; top: 0; width: 10px; height: 10px; margin: -5px 0 0 -5px; z-index: 70; color: var(--water); pointer-events: none; }
.burst-drop svg { width: 100%; height: 100%; }
.water-card.goal { animation: waterGlow 1.6s ease-out; }
@keyframes waterGlow {
  0% { box-shadow: var(--shadow), 0 0 0 0 rgba(59, 155, 240, .55); }
  100% { box-shadow: var(--shadow), 0 0 0 22px rgba(59, 155, 240, 0); }
}

/* Mahlzeiten */
.meal { padding: 0; overflow: hidden; }
.meal + .meal { margin-top: 12px; }
.meal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 14px 16px; }
.meal-head h3 { font-size: 16px; font-weight: 600; }
.meal-head .kcal { color: var(--muted); font-size: 13px; margin-top: 1px; display: flex; align-items: center; gap: 5px; }
.meal-head .tick { width: 15px; height: 15px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; }
.meal-head .tick .icon { width: 10px; height: 10px; stroke-width: 3.4; }
.add-btn {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  transition: transform .1s;
}
.add-btn:active { transform: scale(.9); }
.add-btn .icon { width: 18px; height: 18px; stroke-width: 2.4; }

.entry {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left; font-size: 15px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
}
.entry:active { background: var(--card-2); }
.entry .info { flex: 1; min-width: 0; }
.entry .name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry .meta { color: var(--muted); font-size: 13px; }
.entry .kcal { font-family: var(--round); font-weight: 700; white-space: nowrap; }

/* Körper-/Gewichtskarte */
.body-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.body-row .k { color: var(--muted); font-size: 12px; }
.body-row .v { font-family: var(--round); font-weight: 700; font-size: 17px; }

/* Nährstoff-Details */
.nutrient-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: baseline; padding: 10px 0; }
.nutrient-row + .nutrient-row { border-top: 1px solid var(--line); }
.nutrient-row .label { font-weight: 500; font-size: 15px; }
.nutrient-row .label .tag { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; margin-left: 6px; vertical-align: 1px; }
.nutrient-row .val { font-family: var(--round); font-size: 14px; color: var(--muted); }
.nutrient-row .val b { color: var(--text); font-weight: 700; }
.nutrient-row .bar { grid-column: 1 / -1; height: 6px; }
.nutrient-row.over .val b { color: var(--danger); }

/* Schwebender Plus-Button */
.fab {
  position: fixed; z-index: 45;
  right: max(16px, calc(50% - 280px + 16px));
  bottom: calc(var(--safe-bottom) + 10px + var(--tabbar-h) + 14px);
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: var(--shadow-float), inset 0 0 0 1px rgba(255, 255, 255, .7);
  transition: transform .12s;
}
.fab:active { transform: scale(.92); }
.fab .icon { width: 24px; height: 24px; stroke-width: 2.2; }

.action-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.action-tile { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 6px; border-radius: 18px; background: var(--card-2); font-size: 14px; font-weight: 600; text-align: center; }
.action-tile:active { background: var(--card-3); }
.action-tile .dot { width: 44px; height: 44px; border-radius: 50%; background: var(--card); display: grid; place-items: center; }
.action-tile.primary .dot { background: var(--accent); }

/* Hinweis-Banner */
.banner { display: flex; gap: 12px; align-items: flex-start; background: var(--card); box-shadow: var(--shadow); border-left: 4px solid var(--accent); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 16px; font-size: 14px; }
.banner strong { display: block; margin-bottom: 2px; }
.alert { background: #FDECEC; border: 1px solid #F6C9CA; color: #B42328; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 14px; }
.notice { background: #E8F6EC; border: 1px solid #BFE6CB; color: #1C7A37; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 14px; }

/* ------------------------------------------------------------------ Formulare */

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; color: var(--muted); font-weight: 600; margin: 0 4px 6px; }
.input, select.input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--card-2);
  color: var(--text);
  font: inherit;
  font-size: 17px; /* ≥16px verhindert Zoom auf iOS */
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .15s, background .15s;
}
.card .input, .sheet .input { background: var(--card-2); }
.input:focus { border-color: var(--ink); background: var(--card); }
.input::placeholder { color: var(--muted-2); }
input[type="date"].input { line-height: 52px; }
input[type="date"]::-webkit-date-and-time-value { text-align: left; }
.auth .input, .ob .input { background: var(--card); box-shadow: var(--shadow); }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 54px;
  border-radius: 16px;
  font-weight: 700; font-size: 17px;
  background: var(--ink); color: #fff;
  transition: transform .1s, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .3; }
.btn.yellow { background: var(--accent); color: var(--accent-ink); }
.btn.secondary { background: var(--card-2); color: var(--text); }
.btn.ghost { background: transparent; color: var(--text); height: 44px; }
.btn.danger { background: transparent; color: var(--danger); }
.btn .icon { width: 20px; height: 20px; }

.check { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 15px; margin: 4px 4px 18px; }
.check input { width: 20px; height: 20px; accent-color: var(--ink); }

.segmented { display: flex; background: var(--card-2); border-radius: 12px; padding: 3px; gap: 2px; }
.segmented label { flex: 1; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
  display: block; text-align: center; padding: 8px 4px;
  border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--muted);
  transition: background .15s, color .15s;
}
.segmented input:checked + span { background: var(--card); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }

/* Gruppierte iOS-Liste */
.list { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.list-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-height: 54px; }
.list-item + .list-item { border-top: 1px solid var(--line); }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .sub { color: var(--muted); font-size: 13px; }
.list-item .chev { color: var(--muted-2); width: 18px; height: 18px; }
.list-item .lead { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--accent); }
.list-item .lead .icon { width: 18px; height: 18px; }
.list-item.muted .lead { background: var(--card-2); }
a.list-item:active, button.list-item:active { background: var(--card-2); }
button.list-item { width: 100%; text-align: left; }

.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; background: var(--card-3); border-radius: 99px; transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch input:checked + i { background: var(--success); }
.switch input:checked + i::after { transform: translateX(20px); }

.range { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 99px; background: var(--card-3); outline: none; margin: 18px 0; }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); border: 4px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
.range::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); border: 4px solid #fff; }

/* ------------------------------------------------------------------ Tab-Bar (schwebende Kapsel) */

.tabbar {
  position: fixed; z-index: 40;
  left: 12px; right: 12px;
  bottom: calc(var(--safe-bottom) + 10px);
  max-width: 520px; margin: 0 auto;
  padding: 6px;
  border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  box-shadow: var(--shadow-float), inset 0 0 0 1px rgba(255, 255, 255, .7);
}
.tabbar nav { display: flex; }
.tabbar, .fab { transition: opacity .2s, transform .2s; }
body.kb-open .tabbar, body.kb-open .fab { opacity: 0; transform: translateY(16px); pointer-events: none; }
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 6px 0 5px; border-radius: 999px;
  font-size: 10px; font-weight: 600; color: var(--text);
  transition: background .2s;
}
.tabbar .icon { width: 23px; height: 23px; stroke-width: 2.3; }
.tabbar a.active { background: rgba(0, 0, 0, .07); }

/* ------------------------------------------------------------------ Bottom-Sheet */

/* bottom = Tastaturhöhe (--kb aus app.js): Sheet sitzt auf der iOS-Tastatur statt darunter */
.sheet { position: fixed; inset: 0 0 var(--kb, 0px) 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; visibility: hidden; }
.sheet.open { visibility: visible; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .35); opacity: 0; transition: opacity .25s; }
.sheet.open .sheet-backdrop { opacity: 1; }
.sheet-panel {
  position: relative; width: 100%; max-width: 560px;
  max-height: 92dvh; max-height: calc(var(--vvh, 100dvh) - 16px); overflow-y: auto;
  background: var(--card); border-radius: 28px 28px 0 0;
  padding: 10px 20px calc(var(--safe-bottom) + 20px);
  transform: translateY(100%); transition: transform .32s cubic-bezier(.2, .9, .2, 1);
}
.sheet.open .sheet-panel { transform: none; }
body.kb-open .sheet-panel { padding-bottom: 16px; }
.sheet-grip { width: 38px; height: 5px; border-radius: 99px; background: var(--card-3); margin: 0 auto 14px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.sheet-head h2 { font-family: var(--round); font-size: 22px; font-weight: 800; }
.sheet-close { width: 32px; height: 32px; border-radius: 50%; background: var(--card-2); display: grid; place-items: center; color: var(--muted); flex: none; }
.sheet-close .icon { width: 16px; height: 16px; }
.sheet .btn + .btn { margin-top: 10px; }

.stepper { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 8px 0 22px; }
.stepper button { width: 52px; height: 52px; border-radius: 50%; background: var(--card-2); display: grid; place-items: center; }
.stepper button:active { background: var(--card-3); }
.stepper .big-input {
  width: 170px; background: transparent; border: 0; outline: 0; color: var(--text); text-align: center;
  font-family: var(--round); font-size: 52px; font-weight: 900; letter-spacing: -.03em;
}
.stepper .unit { display: block; text-align: center; color: var(--muted); font-size: 14px; margin-top: -4px; }

.quick { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.quick button { flex: 1 0 auto; height: 40px; padding: 0 14px; border-radius: 99px; background: var(--card-2); font-weight: 600; font-size: 14px; }
.quick button.on { background: var(--accent); color: var(--accent-ink); }

.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 26px); transform: translate(-50%, 20px); opacity: 0; z-index: 80; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 99px; font-size: 14px; font-weight: 600; transition: opacity .2s, transform .2s; pointer-events: none; white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); }

/* ------------------------------------------------------------------ Auth */

.auth { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: calc(var(--safe-top) + 24px) 24px calc(var(--safe-bottom) + 24px); max-width: 440px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 36px; }
.brand-mark { width: 48px; height: 48px; border-radius: 14px; background: var(--accent); display: grid; place-items: center; color: var(--accent-ink); }
.brand-mark .icon { width: 28px; height: 28px; }
.brand-name { font-family: var(--round); font-size: 28px; font-weight: 800; letter-spacing: -.03em; }
.auth h1 { font-family: var(--round); font-size: 32px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; margin-bottom: 8px; }
.auth .lead { color: var(--muted); margin-bottom: 28px; }
.auth .switch-link { text-align: center; color: var(--muted); margin-top: 22px; font-size: 15px; }
.auth .switch-link a { color: var(--text); font-weight: 700; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; text-underline-offset: 3px; }

/* ------------------------------------------------------------------ Onboarding */

.ob { min-height: 100dvh; display: flex; flex-direction: column; max-width: 520px; margin: 0 auto; padding: calc(var(--safe-top) + 14px) 24px calc(var(--safe-bottom) + 20px); overflow-x: hidden; }
.ob-top { display: flex; align-items: center; gap: 12px; height: 40px; }
.ob-back { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--card); box-shadow: var(--shadow); transition: opacity .2s; }
.ob-back[hidden] { display: grid; visibility: hidden; }
.ob-dots { flex: 1; display: flex; gap: 6px; }
.ob-dots i { flex: 1; height: 4px; border-radius: 99px; background: var(--card-3); transition: background .3s; }
.ob-dots i.on { background: var(--ink); }
.ob-steps { flex: 1; position: relative; display: flex; flex-direction: column; }
.ob-step {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  padding-top: 6vh;
  opacity: 0; transform: translateX(40px); pointer-events: none; visibility: hidden;
  transition: opacity .35s ease, transform .45s cubic-bezier(.2, .9, .2, 1), visibility 0s .45s;
}
/* Aktiver Schritt liegt im Fluss, damit lange Schritte normal scrollen. */
.ob-step.active { position: relative; inset: auto; flex: 1; opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition-delay: 0s; }
.ob-step.left { transform: translateX(-40px); }
.ob-step h1 { font-family: var(--round); font-size: 34px; font-weight: 800; letter-spacing: -.025em; line-height: 1.1; margin-bottom: 10px; }
.ob-step .lead { color: var(--muted); font-size: 17px; margin-bottom: 30px; }
.ob-step .spacer { flex: 1; }
.ob-step .input { height: 60px; font-size: 22px; font-family: var(--round); font-weight: 600; }

.ob-hello { text-align: center; align-items: center; justify-content: center; padding-top: 0; }
.ob-hello .logo-pulse { width: 108px; height: 108px; border-radius: 32px; background: var(--accent); display: grid; place-items: center; color: var(--accent-ink); margin-bottom: 30px; animation: pop .9s cubic-bezier(.2, 1.4, .3, 1) both; }
.ob-hello .logo-pulse .icon { width: 56px; height: 56px; }
.ob-hello.active .logo-pulse { animation: pop .9s cubic-bezier(.2, 1.4, .3, 1) both, glow 2.6s 1s ease-out infinite; }
.ob-hello h1 { font-size: 40px; }
@keyframes pop { from { transform: scale(.4) rotate(-12deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes glow { 0% { box-shadow: 0 0 0 0 rgba(255, 216, 1, .6); } 100% { box-shadow: 0 0 0 36px rgba(255, 216, 1, 0); } }
.fade-up { animation: fadeUp .7s .25s cubic-bezier(.2, .9, .2, 1) both; }
.fade-up.d2 { animation-delay: .4s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice { position: relative; display: block; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .box {
  display: flex; flex-direction: column; gap: 6px;
  padding: 18px; border-radius: 20px; background: var(--card);
  border: 2px solid transparent; box-shadow: var(--shadow);
  transition: border-color .15s, background .15s, transform .1s;
}
.choice .box:active { transform: scale(.98); }
.choice input:checked + .box { border-color: var(--ink); }
.choice .box .t { font-family: var(--round); font-weight: 700; font-size: 18px; }
.choice .box .h { color: var(--muted); font-size: 14px; }
.choice .box .emoji { font-size: 34px; line-height: 1; margin-bottom: 6px; }
.choice-list { display: flex; flex-direction: column; gap: 10px; }
.choice-list .box { flex-direction: row; align-items: center; justify-content: space-between; padding: 16px 18px; }
.choice-list .box .tick { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--card-3); display: grid; place-items: center; flex: none; }
.choice-list .box .tick .icon { width: 14px; height: 14px; stroke-width: 3; opacity: 0; color: var(--accent-ink); }
.choice input:checked + .box .tick { background: var(--accent); border-color: var(--accent); }
.choice input:checked + .box .tick .icon { opacity: 1; }

.measure { text-align: center; margin: 20px 0 6px; }
.measure .val { font-family: var(--round); font-size: 76px; font-weight: 900; letter-spacing: -.045em; line-height: 1; }
.measure .unit { color: var(--muted); font-size: 20px; font-weight: 600; margin-left: 4px; }
.measure-input { display: flex; align-items: center; justify-content: center; gap: 22px; }
.measure-input button { width: 56px; height: 56px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); display: grid; place-items: center; }
.measure-input button:active { background: var(--card-2); }

.tempo { margin-top: 22px; padding: 18px; border-radius: 20px; background: var(--card); box-shadow: var(--shadow); }
.tempo .row { display: flex; justify-content: space-between; align-items: baseline; }
.tempo .speed { font-family: var(--round); font-size: 28px; font-weight: 800; }
.tempo .speed small { font-size: 15px; color: var(--muted); font-weight: 600; }
.tempo .tag { font-size: 13px; font-weight: 700; background: var(--accent); padding: 2px 9px; border-radius: 99px; }
.tempo .scale { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: -8px; }
.tempo .note { color: var(--muted); font-size: 14px; margin-top: 12px; }

.plan-hero { text-align: center; padding: 26px 18px; }
.plan-hero .kcal { font-family: var(--round); font-size: 68px; font-weight: 900; letter-spacing: -.045em; line-height: 1; }
.plan-macros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.plan-macros .card { text-align: center; padding: 14px 8px; }
.plan-macros .v { font-family: var(--round); font-size: 22px; font-weight: 800; }

/* ------------------------------------------------------------------ Bibliothek */

.searchbar { display: flex; gap: 10px; margin-bottom: 18px; }
.searchbar .field-wrap { position: relative; flex: 1; }
.searchbar .field-wrap .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 20px; height: 20px; }
.searchbar .input { padding-left: 44px; height: 50px; background: var(--card); box-shadow: var(--shadow); }
.scan-btn { width: 50px; height: 50px; border-radius: var(--radius-sm); background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.scan-btn .icon { stroke-width: 2.2; }

.food-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.food-item + .food-item { border-top: 1px solid var(--line); }
.food-item:active { background: var(--card-2); }
.thumb { width: 52px; height: 52px; border-radius: 12px; background: #fff; border: 1px solid var(--line); flex: none; overflow: hidden; display: grid; place-items: center; }
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb.empty { background: var(--card-2); color: var(--muted); }
.food-item .info { flex: 1; min-width: 0; }
.food-item .name { font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.25; }
.food-item .meta { color: var(--muted); font-size: 13px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.food-item .kcal { font-family: var(--round); font-weight: 700; text-align: right; white-space: nowrap; }
.food-item .kcal small { display: block; color: var(--muted); font-weight: 500; font-size: 11px; }

.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state > .icon { width: 44px; height: 44px; margin: 0 auto 14px; color: var(--muted-2); }
.empty-state h3 { color: var(--text); font-family: var(--round); font-size: 19px; margin-bottom: 6px; }

.loading-bar { position: fixed; top: 0; left: 0; height: 3px; background: var(--ink); width: 0; z-index: 90; transition: width 4s cubic-bezier(.1, .7, .2, 1); }
.loading-bar.on { width: 85%; }

.product-hero { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; }
.product-hero .thumb { width: 92px; height: 92px; border-radius: 18px; }
.product-hero h1 { font-family: var(--round); font-size: 24px; font-weight: 800; line-height: 1.15; letter-spacing: -.01em; }
.product-hero .brand { color: var(--muted); margin-top: 4px; }
.badges { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.badge { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 7px; background: var(--card-2); color: var(--muted); }
.badge.ns-a { background: #038141; color: #fff; } .badge.ns-b { background: #85BB2F; color: #000; }
.badge.ns-c { background: #FECB02; color: #000; } .badge.ns-d { background: #EE8100; color: #000; }
.badge.ns-e { background: #E63E11; color: #fff; }

.amount-row { display: flex; gap: 10px; align-items: stretch; }
.amount-row .input { text-align: center; font-family: var(--round); font-weight: 700; font-size: 22px; }
.amount-row .unit-box { display: grid; place-items: center; padding: 0 16px; border-radius: var(--radius-sm); background: var(--card-2); color: var(--muted); font-weight: 600; }
.amount-row .unit-toggle { flex: none; width: 112px; align-items: stretch; border-radius: var(--radius-sm); }
.amount-row .unit-toggle span { height: 100%; display: grid; place-items: center; font-size: 16px; }

.live-macros { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0; }
.live-macros div { background: var(--card-2); border-radius: 14px; padding: 10px 6px; text-align: center; }
.live-macros b { display: block; font-family: var(--round); font-size: 19px; font-weight: 800; }
.live-macros span { font-size: 11px; color: var(--muted); font-weight: 600; }
.live-macros .k { background: var(--accent); }
.live-macros .k span { color: var(--accent-ink); opacity: .7; }

.facts { width: 100%; border-collapse: collapse; font-size: 15px; }
.facts th { text-align: left; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 0 0 8px; }
.facts th:not(:first-child), .facts td:not(:first-child) { text-align: right; }
.facts td { padding: 9px 0; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.facts tr.group td { color: var(--text); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding-top: 18px; border-top: 0; }
.facts td.sub { padding-left: 14px; color: var(--muted); }

.sticky-cta { position: sticky; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 22px); z-index: 5; margin-top: 18px; }
.sticky-cta .btn { box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }

/* Scanner (bleibt dunkel – Kamerabild) */
.scanner { position: fixed; inset: 0; z-index: 100; background: #000; color: #fff; display: none; flex-direction: column; }
.scanner.open { display: flex; }
.scanner-head { display: flex; justify-content: space-between; align-items: center; padding: calc(var(--safe-top) + 12px) 16px 12px; }
.scanner-head h2 { font-family: var(--round); font-size: 20px; font-weight: 800; }
.scanner .sheet-close { background: #2A2A2A; color: #ccc; }
.scanner-view { flex: 1; position: relative; overflow: hidden; }
.scanner-view video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scanner-frame { position: absolute; left: 50%; top: 45%; width: min(78vw, 340px); height: 170px; transform: translate(-50%, -50%); border-radius: 22px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .55); pointer-events: none; transition: box-shadow .2s; }
.scanner.found .scanner-frame::before { border-color: var(--success); }
.scanner.found .scanner-frame::after { display: none; }
.scanner-frame::before { content: ""; position: absolute; inset: 0; border: 3px solid var(--accent); border-radius: inherit; }
.scanner-frame::after { content: ""; position: absolute; left: 14px; right: 14px; height: 2px; background: var(--accent); box-shadow: 0 0 12px var(--accent); top: 50%; animation: scan 1.8s ease-in-out infinite alternate; }
@keyframes scan { from { top: 18%; } to { top: 82%; } }
.scanner-foot { padding: 16px 20px calc(var(--safe-bottom) + 18px); }
.scanner-foot p { color: #9a9a9a; text-align: center; font-size: 14px; margin-bottom: 12px; }
.scanner-foot form { display: flex; gap: 10px; }
.scanner-foot .input { background: #1E1E1E; color: #fff; }

/* Verlauf */
.chart { width: 100%; height: auto; display: block; }
.chart .line { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: url(#chartFill); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--sans); }
.chart .dot { fill: var(--accent); stroke: var(--ink); stroke-width: 2; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kpi { background: var(--card); border-radius: 18px; padding: 14px; box-shadow: var(--shadow); }
.kpi .k { color: var(--muted); font-size: 12px; font-weight: 600; }
.kpi .v { font-family: var(--round); font-size: 20px; font-weight: 800; margin-top: 2px; white-space: nowrap; }
.kpi .v small { font-size: 13px; color: var(--muted); font-weight: 600; }
.est { font-size: 11px; color: var(--muted); }

/* ------------------------------------------------------------------ Coach */

.screen.coach-screen { padding-bottom: calc(var(--safe-bottom) + 230px); }
.coach[data-state="compose"] [data-show]:not([data-show~="compose"]),
.coach[data-state="loading"] [data-show]:not([data-show~="loading"]),
.coach[data-state="result"] [data-show]:not([data-show~="result"]),
.coach[data-state="answer"] [data-show]:not([data-show~="answer"]),
.coach[data-state="error"] [data-show]:not([data-show~="error"]) { display: none !important; }
.coach[data-state="compose"] [data-coach-reset] { visibility: hidden; }

.coach-top { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; height: 44px; margin-bottom: 6px; }
.coach-top .title { text-align: center; font-size: 17px; font-weight: 600; }
.coach-top .day-nav .icon { width: 20px; height: 20px; }

.coach-intro { text-align: center; padding: 6vh 8px 0; }
.coach-orb { width: 72px; height: 72px; margin: 0 auto 20px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; animation: glow 2.8s ease-out infinite; }
.coach-orb .icon { width: 34px; height: 34px; }
.coach-orb.small { width: 32px; height: 32px; margin: 0; flex: none; animation: none; }
.coach-orb.small .icon { width: 16px; height: 16px; }
.coach-intro h1 { font-family: var(--round); font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; margin-bottom: 10px; }
.coach-intro p { color: var(--muted); font-size: 15px; max-width: 320px; margin: 0 auto; }
.coach-examples { display: flex; flex-direction: column; gap: 8px; margin-top: 28px; align-items: center; }
.coach-example { background: var(--card); box-shadow: var(--shadow); border-radius: 14px; padding: 10px 14px; font-size: 14px; color: #3A3A38; text-align: left; transition: transform .1s; }
.coach-example:active { transform: scale(.97); }

.coach-sentence { font-size: 20px; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; margin: 10px 2px 26px; animation: fadeUp .4s both; }
.coach-label { display: flex; justify-content: space-between; color: #55544F; font-size: 13px; margin: 0 4px 8px; }
.coach-items { display: flex; flex-direction: column; gap: 10px; }

.coach-item { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 18px; padding: 12px 12px 12px 12px; box-shadow: var(--shadow); width: 100%; text-align: left; animation: itemIn .45s cubic-bezier(.2, .9, .3, 1.2) both; }
.coach-item:active { transform: scale(.985); }
.coach-item .emo { width: 42px; height: 42px; flex: none; border-radius: 12px; background: #FFF3B5; display: grid; place-items: center; font-size: 22px; line-height: 1; }
.coach-item .info { flex: 1; min-width: 0; }
.coach-item .name { display: block; font-size: 16px; font-weight: 600; line-height: 1.2; }
.coach-item .meta { display: block; font-size: 13px; color: var(--muted); margin-top: 3px; }
.coach-item .qty { flex: none; background: var(--card-2); border-radius: 10px; padding: 6px 10px; font-family: var(--round); font-size: 15px; font-weight: 700; white-space: nowrap; }
@keyframes itemIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }

.coach-item.skeleton { pointer-events: none; animation: none; }
.coach-item.skeleton .emo, .coach-item.skeleton .line, .coach-item.skeleton .qty { background: linear-gradient(90deg, var(--card-2) 0%, #F8F7F3 50%, var(--card-2) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; color: transparent; }
.coach-item.skeleton .line { height: 12px; border-radius: 6px; }
.coach-item.skeleton .line + .line { margin-top: 8px; width: 55%; }
.coach-item.skeleton .qty { width: 64px; height: 30px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.coach-answer { display: flex; gap: 12px; align-items: flex-start; background: var(--card); box-shadow: var(--shadow); border-radius: 18px; padding: 14px; font-size: 15px; line-height: 1.45; animation: itemIn .45s both; }
.coach[data-state="error"] .coach-answer { background: #FDECEC; box-shadow: none; color: #B42328; }
.coach[data-state="error"] .coach-answer .coach-orb { background: #F6C9CA; }

.coach-bar {
  position: fixed; left: 0; right: 0; z-index: 40;
  bottom: var(--kb, 0px);
  padding: 12px var(--gutter) calc(var(--safe-bottom) + 12px);
  background: linear-gradient(180deg, rgba(243, 242, 238, 0) 0%, var(--bg) 26%);
}
.coach-bar > * { max-width: 528px; margin-left: auto; margin-right: auto; }
.coach-meal { margin-bottom: 12px; }
.coach-totals { display: flex; justify-content: center; gap: 14px; color: #55544F; font-size: 14px; margin-bottom: 12px; }
.coach-cta { height: 56px; border-radius: 18px; font-weight: 600; font-size: 17px; box-shadow: 0 8px 24px rgba(255, 216, 1, .35); }
.coach-compose { display: flex; align-items: flex-end; gap: 8px; background: var(--card); border-radius: 26px; padding: 6px 6px 6px 16px; box-shadow: var(--shadow-float); }
.coach-compose textarea { flex: 1; min-width: 0; min-height: 41px; border: 0; outline: 0; resize: none; background: transparent; font: inherit; font-size: 17px; line-height: 1.35; padding: 9px 0; max-height: 140px; color: var(--text); }
/* Platzhalter immer einzeilig – auf schmalen Geräten lieber mit … abschneiden als halb anzeigen */
.coach-compose textarea::placeholder { color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coach-send { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; flex: none; transition: transform .1s, opacity .15s; }
.coach-send:active { transform: scale(.9); }
.coach-send:disabled { opacity: .35; }
.coach-send .icon { width: 20px; height: 20px; stroke-width: 2.5; }

/* Schritte-Sheet: Umschalter Schritte / Laufband */
.steps-form[data-mode="set"] [data-mode-panel="treadmill"],
.steps-form[data-mode="treadmill"] [data-mode-panel="set"] { display: none; }
[data-mode-panel] { animation: fadeUp .25s both; }
[data-treadmill-preview] b { color: var(--text); }

/* Schritte-Verlauf */
.steps-readout { margin: 0 2px 10px; min-height: 44px; }
.steps-readout b { font-family: var(--round); font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.steps-readout span { color: var(--muted); font-size: 14px; }
.steps-readout .muted { font-size: 13px; }
.steps-chart .sbar { fill: #CBC8C0; transition: fill .15s; }
.steps-chart .sbar.hit { fill: var(--ink); }
.steps-chart .hit-area { fill: transparent; cursor: pointer; }
.steps-chart .bar-group.sel .sbar { fill: var(--accent); }
.steps-chart .goal-line { stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 4 4; opacity: .5; }
.steps-chart .goal-label { fill: var(--text); font-size: 10.5px; font-weight: 700; }
.hit-badge { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); vertical-align: -3px; margin-left: 4px; }
.hit-badge .icon { width: 11px; height: 11px; stroke-width: 3.2; }

/* Admin: Registrierungen freischalten */
.pending-count { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; background: var(--danger); color: #fff !important; font-size: 13px !important; font-weight: 700; display: inline-grid; place-items: center; }
.list-item.request { gap: 8px; }
.list-item.request form { flex: none; }
.pill-btn.approve { display: inline-flex; align-items: center; gap: 4px; background: var(--accent); font-size: 14px; height: 34px; padding: 0 12px; }
.pill-btn.approve .icon { width: 15px; height: 15px; stroke-width: 2.6; }
.pill-btn.decline { width: 34px; height: 34px; padding: 0; display: grid; place-items: center; color: var(--muted); }
.pill-btn.decline .icon { width: 15px; height: 15px; }
.tabbar a { position: relative; }
.tab-dot { position: absolute; top: 6px; left: calc(50% + 8px); width: 9px; height: 9px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px #fff; }

/* Platzhalter (Rezepte) */
.soon { text-align: center; padding: 44px 24px; }
.soon .orb { width: 92px; height: 92px; margin: 0 auto 22px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; color: var(--accent-ink); animation: glow 2.6s ease-out infinite; }
.soon .orb .icon { width: 42px; height: 42px; }
.soon h2 { font-family: var(--round); font-size: 26px; font-weight: 800; margin-bottom: 10px; }
.chat-preview { margin-top: 28px; text-align: left; }
.bubble { max-width: 82%; padding: 10px 14px; border-radius: 18px; font-size: 15px; margin-bottom: 8px; }
.bubble.me { margin-left: auto; background: var(--ink); color: #fff; border-bottom-right-radius: 6px; }
.bubble.bot { background: var(--card-2); border-bottom-left-radius: 6px; }

/* ------------------------------------------------------------------ iPad */

@media (min-width: 768px) {
  :root { --gutter: 28px; }
  .screen { max-width: 1000px; }
  .dash { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 28px; align-items: start; }
  .dash > div:first-child { position: sticky; top: calc(var(--safe-top) + 10px); }
  .fab { right: max(28px, calc(50% - 500px + 28px)); }
  .sheet { align-items: center; }
  .sheet-panel { border-radius: 28px; max-width: 480px; transform: translateY(30px) scale(.97); opacity: 0; transition: transform .25s, opacity .25s; padding-bottom: 24px; }
  .sheet.open .sheet-panel { transform: none; opacity: 1; }
  .sheet-grip { display: none; }
  .narrow { max-width: 720px; margin: 0 auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
