/* oi! – Design System */

/* ─── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ─── Custom Properties ──────────────────────────────────────── */
:root {
  --bg:            #0e0f0d;
  --surface:       #161813;
  --surface-2:     #1c1f19;
  --surface-3:     #232620;
  --border:        #2a2e26;
  --green:         #3a7d44;
  --green-bright:  #4e9e5a;
  --green-dim:     #2a5c32;
  --green-glow:    rgba(58, 125, 68, .19);
  --text:          #e8ead4;
  --text-muted:    #7a7d6e;
  --text-dim:      #4a4d3e;
  --amber:         #c97b2a;
  --red:           #8b3a3a;
  --red-bright:    #c0504a;
  --white:         #f0f2e0;

  --font-display:  'DM Serif Display', Georgia, serif;
  --font-ui:       'Instrument Sans', system-ui, sans-serif;
  --font-mono:     'DM Mono', 'Courier New', monospace;

  --radius:        12px;
  --radius-sm:     8px;
  --radius-lg:     20px;
  --nav-h:         68px;
  --safe-bottom:   env(safe-area-inset-bottom, 0px);

  --transition:    180ms ease;
}

/* ─── Base ───────────────────────────────────────────────────── */
html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.has-nav  { padding-bottom: calc(var(--nav-h) + var(--safe-bottom)); }
body.no-nav   { min-height: 100dvh; display: flex; align-items: center; justify-content: center; }

/* ─── Typography ─────────────────────────────────────────────── */
.display { font-family: var(--font-display); font-style: italic; font-size: clamp(2.5rem, 8vw, 4rem); line-height: 1; color: var(--white); }

h1, h2, h3 { font-family: var(--font-ui); font-weight: 600; }
h1 { font-size: 1.25rem; }
h2 { font-size: 1rem; }
h3 { font-size: .9rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }

small { font-size: .8em; }

/* ─── Logo ───────────────────────────────────────────────────── */
.logo-wordmark {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 2rem;
  color: var(--green-bright);
  line-height: 1;
}

/* ─── Bottom Nav ─────────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: var(--safe-bottom);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 10px 4px;
  color: var(--text-dim);
  min-height: 44px;
  transition: color var(--transition);
}
.nav-item svg    { width: 22px; height: 22px; }
.nav-item span   { font-size: .65rem; font-weight: 500; letter-spacing: .02em; }
.nav-item:active { opacity: .7; }
.nav-item.active { color: var(--green-bright); }

/* ─── Main ───────────────────────────────────────────────────── */
.main { max-width: 480px; margin: 0 auto; }

.page {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1rem 1rem 1.5rem;
}

/* ─── Page Header ────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 0 .25rem;
}
.page-header--dashboard { justify-content: space-between; }
.page-title   { font-family: var(--font-display); font-size: 1.25rem; font-weight: normal; }
.page-subtitle { font-size: .8rem; color: var(--text-muted); margin-left: auto; }

.back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-muted);
  flex-shrink: 0;
  transition: background var(--transition);
}
.back-btn:active { background: var(--surface-3); }

/* ─── Avatar ─────────────────────────────────────────────────── */
.avatar-btn { display: flex; align-items: center; }
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--green-dim);
  color: var(--green-bright);
  font-weight: 600;
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── Ring ───────────────────────────────────────────────────── */
.ring-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  padding: .5rem 0 .25rem;
}

.ring {
  position: relative;
  width: 180px; height: 180px;
  flex-shrink: 0;
}

.ring-svg {
  width: 100%; height: 100%;
}

.ring-track {
  fill: none;
  stroke: var(--surface-3);
  stroke-width: 12;
}

.ring-fill {
  fill: none;
  stroke: url(#ringGradient);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 490.1;
  stroke-dashoffset: 490.1;
  transform: rotate(-90deg);
  transform-origin: center;
  transition: stroke-dashoffset .8s cubic-bezier(.4,0,.2,1);
}

.ring-value--over {
  color: var(--amber);
}

.ring-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.ring-value {
  font-family: var(--font-display);
  font-size: 2.75rem;
  font-weight: 500;
  color: var(--white);
  line-height: 1;
}
.ring-label { font-size: .75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.ring-sub   { font-family: var(--font-mono); font-size: .7rem; color: var(--text-dim); }

.overflow-hint {
  font-size: .8rem;
  color: var(--amber);
  text-align: center;
  padding: 0 1rem;
}

/* ─── Tiles ──────────────────────────────────────────────────── */
.tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .75rem;
}
.tiles--3 { grid-template-columns: repeat(3, 1fr); }

.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem .75rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.tile-value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--white);
  line-height: 1;
}
.tile-value small { font-size: .85rem; color: var(--text-muted); }
.tile-value--green   { color: var(--green-bright); }
.tile-value--warn    { color: var(--amber); }
.tile-value--amber   { color: var(--amber); }
.tile-value--muted   { color: var(--text-dim); }

.tile-label {
  font-size: .7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.tile-sub {
  font-size: .7rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.section-label {
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .4rem;
}

.quick-access {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.quick-pill {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .3rem .75rem;
  font-size: .8rem;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}
.quick-pill span {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--text-dim);
}

.meal-divider {
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .15em;
  color: var(--green-bright);
  text-transform: uppercase;
  padding: .5rem 0 .25rem;
}

/* ─── Card ───────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

/* ─── Section Title ──────────────────────────────────────────── */
.section-title {
  font-size: .8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  font-weight: 500;
  margin-bottom: .5rem;
}

.log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ─── Log List ───────────────────────────────────────────────── */
.log-list { display: flex; flex-direction: column; gap: .5rem; }

.log-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .75rem;
  transition: background var(--transition);
}
.log-item:active { background: var(--surface-2); }

.log-item-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.log-item-main  { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.log-item-name  { font-size: .95rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log-item-meta  { font-size: .75rem; color: var(--text-muted); display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.log-item-points { flex-shrink: 0; }
.log-item-right  { flex-shrink: 0; display: flex; align-items: center; gap: .5rem; }

/* ─── Badge ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: .8rem;
  font-weight: 500;
  background: var(--surface-3);
  color: var(--text);
  border-radius: 6px;
  padding: 2px 8px;
  min-width: 28px;
}
.badge--zero  { background: var(--green-dim); color: var(--green-bright); }
.badge--green { background: var(--green-dim); color: var(--green-bright); }
.badge--amber { background: rgba(201,123,42,.2); color: var(--amber); }
.badge--off   { background: rgba(100,140,200,.15); color: #7aaad4; font-size: .65rem; }

/* ─── Tag (meal type) ────────────────────────────────────────── */
.tag {
  display: inline-flex;
  font-size: .68rem;
  font-weight: 500;
  border-radius: 4px;
  padding: 1px 6px;
  background: var(--surface-3);
  color: var(--text-muted);
}
.tag--breakfast { background: rgba(201,123,42,.15); color: var(--amber); }
.tag--lunch     { background: rgba(78,158,90,.15);  color: var(--green-bright); }
.tag--dinner    { background: rgba(58,125,68,.2);   color: var(--green-bright); }
.tag--snack     { background: var(--surface-3);     color: var(--text-muted); }

/* ─── NOVA Badge ─────────────────────────────────────────────── */
.nova-badge { display: inline-flex; font-size: .68rem; border-radius: 4px; padding: 1px 5px; }
.nova-1 { background: rgba(78,158,90,.15);  color: var(--green-bright); }
.nova-2 { background: rgba(78,158,90,.1);   color: var(--green-bright); }
.nova-3 { background: rgba(201,123,42,.15); color: var(--amber); }
.nova-4 { background: rgba(139,58,58,.2);   color: var(--red-bright); }

/* ─── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  font-size: .9rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-sm);
  padding: .7rem 1.25rem;
  cursor: pointer;
  min-height: 44px;
  transition: opacity var(--transition), background var(--transition);
  white-space: nowrap;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { opacity: .8; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

.btn-primary {
  background: var(--green);
  color: var(--white);
}
.btn-primary:hover { background: var(--green-bright); }

.btn-ghost {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--surface-3); }

.btn-secondary {
  background: var(--surface-3);
  color: var(--green-bright);
  border: 1px solid var(--green-dim);
}
.btn-secondary:hover { background: var(--surface-2); }

.btn-danger { color: var(--red-bright) !important; }

.btn-full { width: 100%; }
.btn-sm   { font-size: .8rem; padding: .5rem .9rem; min-height: 36px; }

/* ─── Delete Button ──────────────────────────────────────────── */
.delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  min-width: 32px; min-height: 32px;
  transition: color var(--transition);
}
.delete-btn:hover { color: var(--red-bright); }

/* ─── Forms ──────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: .4rem; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}
@media (max-width: 340px) { .form-row { grid-template-columns: 1fr; } }

.form-label {
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.input, .select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: .7rem .85rem;
  width: 100%;
  min-height: 44px;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  appearance: none;
}
.input:focus, .select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-glow);
}
.input::placeholder { color: var(--text-dim); }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; }
input[type="number"] { -moz-appearance: textfield; }
.input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }

.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237a7d6e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .7rem center;
  padding-right: 2.25rem;
}
.select option { background: var(--surface-2); }

input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(.5);
  cursor: pointer;
}

/* ─── Alert ──────────────────────────────────────────────────── */
.alert {
  border-radius: var(--radius-sm);
  padding: .75rem 1rem;
  font-size: .875rem;
}
.alert p + p { margin-top: .25rem; }
.alert-success { background: var(--green-dim); color: var(--green-bright); border: 1px solid var(--green); }
.alert-error   { background: rgba(139,58,58,.2); color: var(--red-bright); border: 1px solid rgba(139,58,58,.4); }
.alert-info    { background: rgba(201,123,42,.15); color: var(--amber); border: 1px solid rgba(201,123,42,.3); }

/* ─── Empty State ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  color: var(--text-dim);
  font-size: .9rem;
  padding: 2rem 1rem;
}

/* ─── Points Bar ─────────────────────────────────────────────── */
.points-bar {
  position: relative;
  height: 6px;
  background: var(--surface-3);
  border-radius: 3px;
  overflow: hidden;
}
.points-bar-fill {
  height: 100%;
  background: var(--green-bright);
  border-radius: 3px;
  transition: width .4s ease;
}
.points-bar-label {
  display: block;
  text-align: right;
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--text-muted);
  margin-top: .3rem;
}

/* ─── Points Preview ─────────────────────────────────────────── */
.points-preview {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem 0;
  font-size: .85rem;
  color: var(--text-muted);
}
.points-preview-value {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--white);
}

/* ─── Search ─────────────────────────────────────────────────── */
.search-box { position: relative; }

.search-input-wrap { position: relative; }

.search-input {
  width: 100%;
  padding-left: 2.25rem;
  padding-right: 2.75rem;
}

.scan-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .4rem;
  border-radius: 6px;
  min-width: 36px;
  min-height: 36px;
  transition: color var(--transition);
}
.scan-btn:hover  { color: var(--text-muted); }
.scan-btn:active { color: var(--green-bright); }
.scan-btn svg { width: 18px; height: 18px; }

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
  display: flex;
  align-items: center;
}
.search-icon svg { width: 16px; height: 16px; }

.search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  z-index: 50;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
  max-height: 280px;
  overflow-y: auto;
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .75rem 1rem;
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover,
.search-result-item:active { background: var(--surface-2); }

.search-result-name { font-size: .9rem; font-weight: 500; }
.search-result-meta { font-size: .75rem; color: var(--text-muted); display: flex; gap: .4rem; align-items: center; }

/* ─── Auth ───────────────────────────────────────────────────── */
.auth-page {
  width: 100%;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.auth-card--wide { max-width: 480px; }

.auth-logo   { margin-bottom: .25rem; }
.auth-title  { font-size: 1.5rem; font-weight: 600; }
.auth-subtitle { color: var(--text-muted); font-size: .9rem; }
.auth-switch { font-size: .875rem; color: var(--text-muted); text-align: center; }
.auth-switch a { color: var(--green-bright); font-weight: 500; text-decoration: underline; }

/* ─── Info Banner ────────────────────────────────────────────── */
.info-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--green-dim);
  border: 1px solid var(--green);
  border-radius: var(--radius-sm);
  padding: .75rem 1rem;
}
.info-banner-label { font-size: .8rem; color: var(--green-bright); text-transform: uppercase; letter-spacing: .05em; }
.info-banner-value { font-family: var(--font-display); font-size: 1.5rem; color: var(--white); font-weight: 500; }

/* ─── Profile Actions ────────────────────────────────────────── */
.profile-actions {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-top: .5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ─── Quick Actions ──────────────────────────────────────────── */
.quick-actions {
  display: flex;
  gap: .75rem;
}
.quick-actions .btn { flex: 1; }

/* ─── Weight ─────────────────────────────────────────────────── */
.weight-current {
  display: flex;
  align-items: baseline;
  gap: .4rem;
  padding: 1.25rem 0 .5rem;
}
.weight-current-val {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 500;
  color: var(--white);
  line-height: 1;
}
.weight-current-unit { font-size: 1.2rem; color: var(--text-muted); }
.weight-target {
  margin-left: auto;
  font-size: .8rem;
  color: var(--text-muted);
  text-align: right;
  line-height: 1.4;
}

/* ─── Week ───────────────────────────────────────────────────── */
/* ─── Ring klein (Woche) ─────────────────────────────────────── */
.ring--sm { width: 80px; height: 80px; }
.ring--sm .ring-track,
.ring--sm .ring-fill { stroke-width: 8; }
.ring-value--sm { font-family: var(--font-display); font-size: 1.3rem; font-weight: 500; color: var(--white); line-height: 1; }

/* ─── Wochenpunkte Layout ────────────────────────────────────── */
.week-points-wrap {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
  width: 100%;
}
.week-ring-wrap {
  flex: 0 0 33%;
  display: flex;
  justify-content: center;
  align-items: center;
  align-self: flex-start;
}

/* ─── Wochenpunkte Statistik ─────────────────────────────────── */
.week-stats { display: flex; flex-direction: column; gap: .4rem; flex: 0 0 calc(67% - 1rem); min-width: 0; }
.week-stat-row { display: flex; justify-content: space-between; align-items: center; }
.week-stat-label { font-family: var(--font-mono); font-size: .75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; }
.week-stat-val { font-family: var(--font-display); font-size: 1.4rem; }
.week-stat-val--white { color: var(--white); }
.week-stat-val--amber { color: var(--amber); }
.week-stat-val--green { color: var(--green-bright); }
.week-stat-divider { border: none; border-top: 1px solid var(--border); margin: .25rem 0; }

/* ─── Balkendiagramm ─────────────────────────────────────────── */
.week-chart-wrap { position: relative; }
.week-bars-area { position: relative; height: 72px; display: flex; align-items: flex-end; gap: .4rem; }
.week-chart-limit {
  position: absolute;
  left: 0; right: 0;
  border-top: 1px dashed var(--amber);
  opacity: .6;
  pointer-events: none;
}
.week-bar-labels { display: flex; gap: .4rem; margin-top: .35rem; }
.week-bar { flex: 1; border-radius: 4px 4px 0 0; min-height: 4px; }
.week-bar--dim    { background: var(--green-dim); }
.week-bar--over   { background: var(--amber); }
.week-bar--today  { background: var(--green-bright); box-shadow: 0 0 8px var(--green-glow); }
.week-bar--future { background: var(--surface-3); border: 1px solid var(--border); opacity: .4; }
.week-bar-label { flex: 1; text-align: center; font-family: var(--font-mono); font-size: .65rem; color: var(--text-dim); }
.week-bar-label--today { color: var(--green-bright); }

/* ─── Wiegetag-Banner ────────────────────────────────────────── */
.wiege-banner {
  display: flex; align-items: center; gap: .75rem;
  background: var(--green-dim);
  border: 1px solid var(--green);
  border-radius: var(--radius);
  padding: .875rem 1rem;
  text-decoration: none;
}
.wiege-banner--today { background: linear-gradient(135deg, var(--green-dim), #1a3d22); }
.wiege-title { font-size: .95rem; font-weight: 600; color: var(--white); }
.wiege-sub { font-family: var(--font-mono); font-size: .75rem; color: #7fb889; margin-top: .15rem; }
.wiege-arrow { margin-left: auto; font-size: 1.2rem; color: var(--green-bright); }

/* ─── Activity Templates ─────────────────────────────────────── */
.activity-week-summary {
  display: flex;
  gap: .75rem;
}
.summary-chip {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .75rem;
  display: flex;
  flex-direction: column;
  gap: .2rem;
  align-items: center;
}
.summary-chip-val { font-family: var(--font-display); font-size: 1.5rem; color: var(--white); font-weight: 500; }
.summary-chip-label { font-size: .7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }

.template-category { display: flex; flex-direction: column; gap: .5rem; }
.template-cat-label { font-size: .75rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .07em; margin-bottom: .25rem; }
.template-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .5rem;
}
.template-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .75rem;
  cursor: pointer;
  text-align: left;
  min-height: 64px;
  transition: border-color var(--transition), background var(--transition);
}
.template-btn:hover   { border-color: var(--green); }
.template-btn:active  { background: var(--surface-2); }
.template-btn.selected { border-color: var(--green-bright); background: var(--green-dim); }
.template-icon { font-size: 1.3rem; line-height: 1; }
.template-name { font-size: .85rem; font-weight: 500; color: var(--white); }
.template-met  { font-family: var(--font-mono); font-size: .75rem; color: var(--text-dim); }
.template-btn.selected .template-met { color: var(--green-bright); }

/* ─── Log Form Section ───────────────────────────────────────── */
.log-form-section { display: flex; flex-direction: column; gap: .75rem; }

.selected-food-name { font-weight: 600; font-size: 1rem; }
.selected-food-meta { font-size: .8rem; color: var(--text-muted); margin-top: .25rem; }

/* ─── Add Food Section ───────────────────────────────────────── */
.add-food-section { display: flex; flex-direction: column; gap: .75rem; }
.add-food-form { display: flex; flex-direction: column; gap: .75rem; }

/* ─── Templates / Search section ────────────────────────────── */
.templates-section { display: flex; flex-direction: column; gap: 1rem; }
.search-section     { position: relative; }

/* ─── Aktivitäten Log-Formular ───────────────────────────────── */
.activity-points-wrap { margin-left: auto; text-align: right; }
#activityLogBtn       { margin-top: .75rem; }
#addCustomActivity    { margin-top: 1rem; }
#customActivityForm   { margin-top: .75rem; }
#customActivityForm > .form-group { margin-bottom: .75rem; }
#saveCustomActivity   { margin-top: .75rem; }

/* ─── MET-Info ───────────────────────────────────────────────── */
.met-info-section { margin-top: 1rem; }
.met-info-section h3 {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--green-bright);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .4rem;
  margin-top: .75rem;
}
.met-info-section h3:first-of-type { margin-top: 0; }
.met-info-section p,
.met-info-section li { font-size: .85rem; color: var(--text-muted); line-height: 1.6; }
.met-info-section p strong { color: var(--text); }
.met-info-section em { font-style: italic; color: var(--text); }
.met-info-section ul { list-style: none; padding-left: 1rem; margin: .25rem 0; }
.met-info-section ul li { position: relative; padding-left: .75rem; }
.met-info-section ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: .45em;
  width: 6px;
  height: 6px;
  background: var(--green-bright);
}

/* ─── Modal ──────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: flex-end;
}
.modal.hidden { display: none !important; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(0, 0, 0, .7);
}

.modal-sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border-bottom: none;
  padding: 1.25rem 1rem calc(1.5rem + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 85dvh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title { font-size: 1rem; font-weight: 600; }

.modal-close {
  background: none; border: none;
  color: var(--text-muted); cursor: pointer;
  font-size: 1rem; line-height: 1;
  min-height: 44px; min-width: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
}

/* ─── Scanner ────────────────────────────────────────────────── */
.scanner-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
}

.scanner-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.scanner-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scanner-frame {
  width: 62%;
  aspect-ratio: 1;
  border: 2px solid var(--green-bright);
  border-radius: var(--radius-sm);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .45);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.scanner-frame--found {
  border-color: #6ddb7a;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .45), 0 0 24px var(--green-glow);
}

.scanner-status {
  text-align: center;
  font-size: .82rem;
  color: var(--text-muted);
  min-height: 1.2rem;
}

.scanner-manual { display: flex; flex-direction: column; gap: .4rem; }

.scanner-manual-label {
  font-size: .75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 500;
}

/* ─── Auth Form ──────────────────────────────────────────────── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-label-wrap {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .4rem;
}

.form-label-wrap .form-label { margin-bottom: 0; }

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 6px;
  min-width: 32px;
  min-height: 32px;
  color: var(--text-dim);
  transition: color var(--transition);
}
.icon-btn:hover { color: var(--text-muted); }
.icon-btn--danger { color: var(--red-bright); }
.icon-btn svg { width: 16px; height: 16px; }

.info-icon {
  background: none; border: none;
  color: var(--text-dim); cursor: pointer;
  padding: 0; line-height: 1;
  display: inline-flex; align-items: center;
  transition: color var(--transition);
}
.info-icon:hover { color: var(--text-muted); }
.info-icon svg { width: 16px; height: 16px; }

.info-box {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .6rem .8rem;
  font-size: .8rem; color: var(--text-muted);
  margin-bottom: .4rem;
}

/* ─── Gewichts-Chart ─────────────────────────────────────────── */
.weight-chart-wrap {
  width: 100%;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .5rem 0 .25rem;
}

.weight-chart {
  display: block;
  width: 100%;
  height: auto;
}

.chart-grid {
  stroke: var(--border);
  stroke-width: 1;
}

.chart-target {
  stroke: var(--green-dim);
  stroke-width: 1;
  stroke-dasharray: 4 3;
}

.chart-label {
  font-family: var(--font-mono);
  font-size: 9px;
  fill: var(--text-muted);
}

/* ─── Mahlzeiten ─────────────────────────────────────────────── */
.meals-section { display: flex; flex-direction: column; gap: .5rem; }

.meals-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .25rem;
}

.meal-list { display: flex; flex-direction: column; gap: .75rem; }

.meal-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.meal-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}

.meal-card-name {
  font-weight: 600;
  font-size: .95rem;
}

.meal-card-ingredients {
  font-size: .8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.meal-item-chip { white-space: nowrap; }

.meal-card-footer { display: flex; flex-direction: column; gap: .5rem; }

.meal-type-picker {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .5rem .75rem;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.meal-type-label {
  font-size: .75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.meal-type-btns { display: flex; flex-wrap: wrap; gap: .4rem; }

.meal-card-actions { display: flex; gap: .4rem; flex-wrap: wrap; }

.meal-card-controls {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .75rem;
  border-top: 1px solid var(--border);
  padding-top: .75rem;
}
.meal-card-controls .meal-type-select { flex: 1; min-width: 0; }
.meal-card-controls .btn-log          { flex-shrink: 0; }
.meal-card-controls .icon-btn         { flex-shrink: 0; }

/* Mahlzeit erstellen */
.meal-create-item .meal-amount-row {
  display: flex;
  align-items: center;
  gap: .35rem;
  margin-top: .25rem;
  font-size: .85rem;
  color: var(--text-muted);
}

.input--sm {
  padding: .25rem .5rem;
  font-size: .85rem;
  width: 5rem;
  border-radius: var(--radius-sm);
}

/* ─── Search Spinner ─────────────────────────────────────────── */
.search-spinner {
  position: absolute;
  right: 44px;
  top: 50%;
  margin-top: -8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--green-dim);
  border-top-color: var(--green-bright);
  animation: spin .7s linear infinite;
  display: none;
}
.search-spinner.visible { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Wizard ─────────────────────────────────────────────────── */
.wizard-steps { display: flex; align-items: flex-start; gap: 0; padding: .25rem 0 1rem; }
.wizard-step { display: flex; flex-direction: column; align-items: center; gap: .25rem; }
.wizard-dot { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-3); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: .8rem; color: var(--text-dim); }
.wizard-step.active .wizard-dot { background: var(--green); border-color: var(--green-bright); color: var(--white); }
.wizard-step.done .wizard-dot { background: var(--green-dim); border-color: var(--green); color: var(--green-bright); font-size: 1rem; }
.wizard-label { font-family: var(--font-mono); font-size: .65rem; color: var(--text-dim); letter-spacing: .06em; text-align: center; }
.wizard-step.active .wizard-label { color: var(--green-bright); }
.wizard-line { flex: 1; height: 1px; background: var(--border); margin-top: 13px; }
.wizard-line.done { background: var(--green-dim); }

.wizard-panel { display: flex; flex-direction: column; gap: .75rem; }
.wizard-panel.hidden { display: none; }

.chip-container { display: flex; flex-wrap: wrap; gap: .5rem; min-height: 2rem; }
.wizard-chip { display: flex; align-items: center; gap: .35rem; background: var(--surface-3); border: 1px solid var(--border); border-radius: 2rem; padding: .2rem .6rem .2rem .75rem; font-size: .8rem; color: var(--text); }
.wizard-chip-remove { background: none; border: none; cursor: pointer; color: var(--text-dim); font-size: 1rem; line-height: 1; padding: 0; display: flex; align-items: center; }
.wizard-chip-remove:hover { color: var(--red, #e55); }
.wizard-chips-empty { font-size: .8rem; color: var(--text-dim); align-self: center; }

.wizard-total { display: flex; align-items: center; justify-content: space-between; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem 1rem; }
.wizard-total-label { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .06em; color: var(--text-dim); text-transform: uppercase; }
.wizard-total-sub { font-size: .75rem; color: var(--text-muted); margin-top: .15rem; }
.wizard-total-right { display: flex; align-items: baseline; gap: .3rem; }
.wizard-total-pts { font-family: var(--font-mono); font-size: 1.5rem; color: var(--green-bright); }
.wizard-total-unit { font-size: .75rem; color: var(--text-dim); }

.wizard-nav { display: flex; gap: .5rem; justify-content: space-between; }
.wizard-nav .btn { flex: 1; }

.wizard-ing-list, .wizard-review-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; }
.wizard-ing-row, .wizard-review-row { display: flex; align-items: center; gap: .5rem; }
.wizard-ing-name, .wizard-review-name { flex: 1; font-size: .9rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wizard-ing-unit { font-size: .8rem; color: var(--text-dim); white-space: nowrap; }
.wizard-review-g { font-size: .85rem; color: var(--text-dim); white-space: nowrap; }
.wizard-review-pts { font-family: var(--font-mono); font-size: .85rem; color: var(--green-bright); white-space: nowrap; }

.wizard-meal-types { display: flex; flex-wrap: wrap; gap: .5rem; }
.pill { background: var(--surface-3); border: 1px solid var(--border); border-radius: 2rem; padding: .3rem .9rem; font-size: .8rem; color: var(--text-dim); cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.pill--active { background: var(--green-dim); border-color: var(--green); color: var(--green-bright); }

.wizard-yesterday-toggle {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .75rem;
  font-size: .85rem;
  color: var(--text-muted);
  cursor: pointer;
}
.wizard-yesterday-toggle input { accent-color: var(--green-bright); }

.wizard-actions { display: flex; flex-direction: column; gap: .5rem; }

/* ─── Gewicht ────────────────────────────────────────────────── */
.weight-entry-card {
  margin-bottom: .75rem;
}
.weight-entry-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: .75rem;
}
.weight-entry-label {
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: .2rem;
}
.weight-entry-goal {
  text-align: right;
}
.weight-goal-val {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--green-bright);
}
.weight-goal-lbl {
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .1em;
}
.weight-diff {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--amber);
  margin-top: .1rem;
}
.weight-input-row {
  display: flex;
  gap: .75rem;
  align-items: center;
}
.weight-input {
  width: 90px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.2rem;
  flex-shrink: 0;
}
.weight-btn {
  flex: 1;
}

/* ─── Profil ─────────────────────────────────────────────────── */
.profile-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--green-dim);
  color: var(--green-bright);
  font-weight: 700;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--green-bright);
}

.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  padding: .5rem 0 1rem;
}
.profile-name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--white);
}
.profile-pts {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--green-bright);
  letter-spacing: .08em;
}

.profile-data-table {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}
.profile-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .75rem 0;
  border-bottom: 1px solid var(--border);
}
.profile-row-label {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  display: flex;
  align-items: center;
  gap: .3rem;
}
.profile-row-val {
  font-size: .95rem;
  color: var(--text);
  font-weight: 500;
  text-align: right;
}

/* ─── Feedback ───────────────────────────────────────────────── */
.feedback-star {
  font-size: 1.1rem;
  color: var(--amber);
  line-height: 1;
  text-decoration: none;
  transition: opacity var(--transition);
}
.feedback-star:hover { opacity: .75; }

.feedback-btn-profile {
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--amber);
}
.feedback-btn-profile:hover {
  background: var(--surface-2);
}

.feedback-form,
.profile-edit-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ─── Form-Hints ─────────────────────────────────────────────── */
.form-hint {
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--text-dim);
  margin-top: .25rem;
}

/* ─── Utility ────────────────────────────────────────────────── */
.hidden { display: none !important; }

.page-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 100dvh;
  text-align: center;
  padding: 2rem;
}

/* ─── Push Opt-In (Sprint 9c) ──────────────────────────────── */
.push-optin {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin-top: 1rem;
}
.push-optin-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.push-optin-title { font-size: .95rem; color: var(--text); font-weight: 500; }
.push-optin-sub {
  font-size: .8rem; color: var(--text-muted); margin-top: .15rem;
}
.push-toggle {
  width: 48px; height: 28px; border-radius: 999px;
  background: var(--surface-3); border: 1px solid var(--border);
  position: relative; cursor: pointer; flex-shrink: 0;
  transition: background var(--transition);
}
.push-toggle[data-active="1"] { background: var(--green); }
.push-toggle-knob {
  position: absolute; top: 2px; left: 2px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--white); transition: transform var(--transition);
}
.push-toggle[data-active="1"] .push-toggle-knob { transform: translateX(20px); }
.push-optin-hint {
  font-size: .8rem; color: var(--amber); margin-top: .6rem;
  line-height: 1.5;
}
