/* ════════════════════════════════════════════
   FastLog – Stylesheet
   Optimiert für iPhone 16 Pro (393×852px)
   Desktop-Sidebar bleibt erhalten
════════════════════════════════════════════ */

:root {
  --bg:        #0d0d0d;
  --surface:   #181818;
  --surface2:  #222222;
  --border:    #2c2c2c;
  --green:     #c8f060;
  --blue:      #7dd3fc;
  --orange:    #f9a74b;
  --red:       #f87171;
  --text:      #f0f0f0;
  --muted:     #777;
  --sidebar-w: 220px;
  --radius:    18px;
  /* iPhone 16 Pro safe areas */
  --safe-top:    env(safe-area-inset-top, 59px);
  --safe-bottom: env(safe-area-inset-bottom, 34px);
  --tab-h:       56px;
}

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

html {
  height: 100%;
  /* prevent bounce scroll on iOS */
  overflow: hidden;
}

body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overflow: hidden;
}

.hidden { display: none !important; }

/* ════════════════════════════════════════════
   LOGIN SCREEN
════════════════════════════════════════════ */
.login-screen {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  padding: calc(var(--safe-top) + 16px) 28px calc(var(--safe-bottom) + 16px);
}
.login-inner {
  width: 100%; max-width: 400px;
  display: flex; flex-direction: column; align-items: center;
  gap: 0;
}
.login-logo { font-size: 64px; margin-bottom: 12px; }
.login-title {
  font-family: 'Syne', sans-serif; font-size: 42px; font-weight: 800;
  color: var(--green); letter-spacing: -1px; margin-bottom: 6px;
}
.login-sub { font-size: 15px; color: var(--muted); margin-bottom: 36px; }

.login-form { width: 100%; }

.login-pw-wrap { position: relative; }
.login-pw-wrap .field-input { padding-right: 52px; }
.pw-eye {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--muted); cursor: pointer;
  padding: 10px 12px; border-radius: 8px; transition: color 0.15s;
  display: flex; align-items: center;
}
.pw-eye:active { color: var(--green); }
.pw-eye svg { width: 20px; height: 20px; display: block; }

.login-error {
  display: flex; align-items: center; gap: 8px;
  background: rgba(248,113,113,0.1);
  border: 1px solid rgba(248,113,113,0.25);
  color: var(--red);
  border-radius: 12px; padding: 12px 16px;
  font-size: 14px; font-weight: 500;
  margin-bottom: 14px;
  animation: shake 0.35s ease;
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-8px); }
  40%      { transform: translateX(8px); }
  60%      { transform: translateX(-5px); }
  80%      { transform: translateX(5px); }
}
.login-hint {
  margin-top: 24px; font-size: 11px; color: var(--muted);
  text-align: center; line-height: 1.7;
}
.login-hint code {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 6px; padding: 2px 7px; font-size: 11px;
  color: var(--green); font-family: monospace;
}

/* login button shake on error */
.login-shake { animation: shake 0.35s ease; }

/* ════════════════════════════════════════════
   ONBOARDING
════════════════════════════════════════════ */
.onboarding {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--safe-top) + 16px) 24px calc(var(--safe-bottom) + 16px);
  background: var(--bg);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.ob-inner {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.ob-progress { display: flex; gap: 8px; }
.ob-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border); transition: all 0.3s;
}
.ob-dot.active { width: 24px; border-radius: 4px; background: var(--green); }

.ob-step { display: none; width: 100%; animation: fadeSlide 0.3s ease; }
.ob-step.active { display: block; }

@keyframes fadeSlide {
  from { opacity: 0; transform: translateX(18px); }
  to   { opacity: 1; transform: translateX(0); }
}

.ob-logo { font-size: 64px; text-align: center; margin-bottom: 4px; }
.ob-title {
  font-family: 'Syne', sans-serif;
  font-size: 44px; font-weight: 800;
  color: var(--green); text-align: center; letter-spacing: -1px;
}
.ob-subtitle { font-size: 18px; color: var(--muted); text-align: center; margin-top: 6px; }
.ob-features {
  margin-top: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex; flex-direction: column; gap: 13px;
}
.ob-feature { display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 500; }
.ob-feature span:first-child { font-size: 20px; }

.ob-label { font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 4px; }
.ob-step-title { font-family: 'Syne', sans-serif; font-size: 30px; font-weight: 700; margin-bottom: 6px; }
.ob-step-sub { color: var(--muted); margin-bottom: 22px; font-size: 14px; }

.ob-btn {
  width: 100%; padding: 16px;
  background: var(--green); color: #0d0d0d;
  border: none; border-radius: 14px;
  font-size: 17px; font-weight: 700;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  /* make tap targets comfortable on iPhone */
  min-height: 54px;
}
.ob-btn:active { transform: scale(0.97); opacity: 0.9; }
.ob-btn:disabled { background: var(--border); color: var(--muted); cursor: not-allowed; }

/* Fasting options */
.fasting-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fasting-option {
  background: var(--surface2); border: 2px solid var(--border);
  border-radius: 14px; padding: 16px 10px;
  cursor: pointer; text-align: center;
  display: flex; flex-direction: column; gap: 4px;
  transition: all 0.15s;
  font-family: 'DM Sans', sans-serif; color: var(--text);
  min-height: 76px;
}
.fasting-option.selected { border-color: var(--green); background: rgba(200,240,96,0.07); }
.fasting-option:active { transform: scale(0.96); }
.fo-title { font-size: 18px; font-weight: 700; }
.fo-sub   { font-size: 12px; color: var(--muted); }
.fasting-options.small .fasting-option { padding: 10px 6px; min-height: 52px; }
.fasting-options.small .fo-title { font-size: 15px; }

/* ════════════════════════════════════════════
   APP SHELL
════════════════════════════════════════════ */
.app {
  display: flex;
  height: 100%;
  overflow: hidden;
}

/* ════════════════════════════════════════════
   SIDEBAR (Desktop)
════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  flex-shrink: 0;
}
.sidebar-logo {
  font-family: 'Syne', sans-serif;
  font-size: 20px; font-weight: 800;
  color: var(--green);
  padding: 0 20px 28px;
  display: flex; align-items: center; gap: 8px;
}
.nav-links { flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 0 10px; }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 12px;
  border: none; background: transparent;
  color: var(--muted); font-family: 'DM Sans', sans-serif;
  font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all 0.15s; text-align: left;
}
.nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-link:hover { background: var(--surface2); color: var(--text); }
.nav-link.active { background: rgba(200,240,96,0.1); color: var(--green); }
.sidebar-footer { padding: 20px; font-size: 11px; color: var(--muted); }

/* ════════════════════════════════════════════
   MAIN CONTENT AREA
════════════════════════════════════════════ */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* scrollable inner */
.tab {
  display: none;
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 28px 32px 40px;
}
.tab.active { display: block; }

/* ── Page header ───── */
.page-header {
  display: flex; align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
}
.page-label { font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
.page-title { font-family: 'Syne', sans-serif; font-size: 34px; font-weight: 800; letter-spacing: -0.5px; margin-top: 2px; }

/* ════════════════════════════════════════════
   COMPONENTS
════════════════════════════════════════════ */

/* Buttons */
.btn-primary {
  background: var(--green); color: #0d0d0d;
  border: none; border-radius: 12px;
  padding: 11px 20px; font-size: 14px; font-weight: 700;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer; transition: opacity 0.15s, transform 0.1s;
  white-space: nowrap; min-height: 44px;
}
.btn-primary:active { transform: scale(0.96); opacity: 0.88; }
.btn-primary.full { width: 100%; padding: 15px; font-size: 16px; border-radius: 14px; }

.btn-ghost {
  background: transparent; color: var(--green);
  border: none; padding: 8px 14px;
  font-size: 14px; font-weight: 600;
  font-family: 'DM Sans', sans-serif; cursor: pointer;
}
.btn-ghost.full { width: 100%; padding: 14px; font-size: 15px; color: var(--muted); }

.btn-danger {
  background: rgba(248,113,113,0.1); color: var(--red);
  border: 1px solid rgba(248,113,113,0.25);
  border-radius: 12px; padding: 13px 18px;
  font-size: 14px; font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer; margin-top: 12px; width: 100%;
  min-height: 48px;
}
.btn-danger:active { background: rgba(248,113,113,0.2); }

/* Cards */
.section-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; margin-bottom: 14px;
}
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.section-title  { font-size: 16px; font-weight: 600; }
.section-header-simple {
  font-size: 10px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 14px;
}

/* Stat cards */
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 14px;
}
.stat-label { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 4px; }
.stat-value { font-family: 'Syne', sans-serif; font-size: 26px; font-weight: 700; margin-bottom: 3px; }
.stat-value.green { color: var(--green); }
.stat-value.orange { color: var(--orange); }
.stat-value.blue { color: var(--blue); }
.stat-sub { font-size: 11px; color: var(--muted); }

/* Form fields */
.field-group { margin-bottom: 14px; }
.field-label {
  font-size: 10px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.1em;
  display: block; margin-bottom: 8px;
}
.field-input {
  width: 100%; background: var(--surface2);
  border: 1px solid var(--border); border-radius: 12px;
  padding: 13px 16px; font-size: 16px; color: var(--text);
  font-family: 'DM Sans', sans-serif; outline: none;
  transition: border-color 0.2s;
  /* prevent iOS zoom on focus (needs font-size ≥16px) */
  min-height: 48px;
}
.field-input:focus { border-color: var(--green); }
.input-unit-wrap { position: relative; }
.input-unit-wrap .field-input { padding-right: 44px; }
.input-unit { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; pointer-events: none; }

/* ════════════════════════════════════════════
   HOME
════════════════════════════════════════════ */
.home-grid {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 14px; margin-bottom: 14px; align-items: start;
}

/* Fasting card */
.fasting-card {
  background: linear-gradient(135deg, #111f04, #0a1203);
  border: 1px solid rgba(200,240,96,0.22);
  border-radius: var(--radius); padding: 22px;
  position: relative; overflow: hidden;
}
.fasting-card::after {
  content: ''; position: absolute; top: -60px; right: -60px;
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(200,240,96,0.06), transparent 70%);
  pointer-events: none;
}
.fasting-header { margin-bottom: 10px; }
.fasting-status-row { display: flex; align-items: center; gap: 8px; }
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted); transition: all 0.3s;
}
.status-dot.active {
  background: var(--green); box-shadow: 0 0 8px var(--green);
  animation: blink 2s ease-in-out infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }
.status-text { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; transition: color 0.3s; }
.status-text.active { color: var(--green); }
.timer-display {
  font-family: 'Syne', sans-serif; font-size: 48px; font-weight: 800;
  color: var(--muted); letter-spacing: -2px; line-height: 1;
  margin-bottom: 6px; transition: color 0.3s;
}
.timer-display.active { color: var(--green); }
.timer-hint { font-size: 12px; color: rgba(200,240,96,0.5); margin-bottom: 14px; min-height: 18px; }
.timer-progress { background: rgba(200,240,96,0.1); border-radius: 4px; height: 5px; margin-bottom: 16px; overflow: hidden; }
.timer-bar { height: 100%; background: var(--green); border-radius: 4px; transition: width 1s linear; }
.fast-toggle-btn {
  width: 100%; padding: 13px; border-radius: 12px; border: none;
  font-size: 14px; font-weight: 700;
  font-family: 'DM Sans', sans-serif; cursor: pointer;
  transition: all 0.15s; background: var(--green); color: #0d0d0d;
  min-height: 48px;
}
.fast-toggle-btn.active {
  background: var(--surface2); color: var(--red);
  border: 1px solid rgba(248,113,113,0.35);
}
.fast-toggle-btn:active { transform: scale(0.97); }

/* Quick stats */
.quick-stats { display: flex; flex-direction: column; gap: 10px; }

/* Meals list */
.meals-list { display: flex; flex-direction: column; gap: 8px; }
.meal-row {
  display: flex; align-items: center; gap: 11px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 14px; padding: 12px 13px;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from{opacity:0;transform:translateY(5px)} to{opacity:1;transform:none} }
.meal-emoji {
  width: 38px; height: 38px; display: flex; align-items: center;
  justify-content: center; font-size: 20px;
  border-radius: 10px; flex-shrink: 0;
}
.meal-info { flex: 1; min-width: 0; }
.meal-name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meal-time-text { font-size: 12px; color: var(--muted); margin-top: 2px; }
.meal-badge { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 20px; white-space: nowrap; }
.meal-delete {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 16px; padding: 6px 8px; border-radius: 8px;
  transition: color 0.15s; margin-left: 2px; min-width: 32px; min-height: 32px;
}
.meal-delete:active { color: var(--red); }

.empty-state { text-align: center; padding: 28px 16px; color: var(--muted); line-height: 2; font-size: 14px; }

/* Meal type colours */
.type-gross { background: rgba(200,240,96,0.1); color: var(--green);  border: 1px solid rgba(200,240,96,0.2); }
.type-klein { background: rgba(249,167,75,0.1);  color: var(--orange); border: 1px solid rgba(249,167,75,0.2); }
.type-shake { background: rgba(125,211,252,0.1); color: var(--blue);   border: 1px solid rgba(125,211,252,0.2); }
.type-snack { background: rgba(248,113,113,0.1); color: var(--red);    border: 1px solid rgba(248,113,113,0.2); }

/* ════════════════════════════════════════════
   WEIGHT
════════════════════════════════════════════ */
.weight-hero-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; margin-bottom: 14px; text-align: center;
}
.weight-hero-num { font-family: 'Syne', sans-serif; font-size: 60px; font-weight: 800; letter-spacing: -2px; }
.weight-change-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 16px; border-radius: 20px;
  font-size: 13px; font-weight: 600; margin-top: 8px;
}
.weight-change-badge.down { background: rgba(200,240,96,0.1); color: var(--green); }
.weight-change-badge.up   { background: rgba(248,113,113,0.1); color: var(--red); }

.weight-list { display: flex; flex-direction: column; gap: 8px; }
.weight-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px; animation: fadeIn 0.2s ease;
}
.weight-row-left { display: flex; flex-direction: column; gap: 2px; }
.weight-date { font-size: 13px; font-weight: 500; }
.weight-time { font-size: 11px; color: var(--muted); }
.weight-right { display: flex; align-items: center; gap: 9px; }
.weight-val { font-family: 'Syne', sans-serif; font-size: 20px; font-weight: 700; }
.weight-diff { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 8px; }
.weight-diff.dn { background: rgba(200,240,96,0.1); color: var(--green); }
.weight-diff.up { background: rgba(248,113,113,0.1); color: var(--red); }
.weight-del { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 14px; transition: color 0.15s; padding: 4px 6px; min-width: 28px; min-height: 28px; }
.weight-del:active { color: var(--red); }

canvas { width: 100% !important; }
.empty-chart-msg { text-align: center; color: var(--muted); padding: 20px; font-size: 14px; }

/* ════════════════════════════════════════════
   STATS
════════════════════════════════════════════ */
.streak-hero {
  background: linear-gradient(135deg, #1c1200, #110d00);
  border: 1px solid rgba(249,167,75,0.2);
  border-radius: var(--radius); padding: 22px; margin-bottom: 14px;
}
.streak-label { font-size: 10px; font-weight: 700; color: rgba(249,167,75,0.6); text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 4px; }
.streak-num { font-family: 'Syne', sans-serif; font-size: 52px; font-weight: 800; color: var(--orange); line-height: 1; }
.streak-sub { font-size: 13px; color: rgba(249,167,75,0.6); margin-top: 4px; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }

.meal-type-bars { display: flex; flex-direction: column; gap: 13px; }
.type-bar-row { display: flex; align-items: center; gap: 10px; }
.type-bar-label { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 20px; width: 86px; text-align: center; flex-shrink: 0; }
.type-bar-track { flex: 1; background: var(--surface2); border-radius: 4px; height: 8px; overflow: hidden; }
.type-bar-fill { height: 100%; border-radius: 4px; transition: width 0.6s cubic-bezier(0.34,1.56,0.64,1); }
.type-bar-count { font-size: 13px; font-weight: 700; min-width: 24px; text-align: right; }

/* ════════════════════════════════════════════
   PROFILE
════════════════════════════════════════════ */
.profile-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; margin-bottom: 14px;
  display: flex; align-items: center; gap: 14px;
}
.profile-avatar {
  width: 56px; height: 56px; border-radius: 16px;
  background: linear-gradient(135deg, var(--green), var(--blue));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif; font-size: 24px; font-weight: 800;
  color: #0d0d0d; flex-shrink: 0;
}
.profile-name { font-family: 'Syne', sans-serif; font-size: 20px; font-weight: 700; }
.profile-since { font-size: 12px; color: var(--muted); margin-top: 2px; }
.settings-form { display: flex; flex-direction: column; gap: 4px; }
.info-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.info-row:last-of-type { border-bottom: none; }
.muted { color: var(--muted); }

/* ════════════════════════════════════════════
   MODALS
════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.78); backdrop-filter: blur(8px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeOverlay 0.2s ease;
}
@keyframes fadeOverlay { from{opacity:0} to{opacity:1} }
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 24px; padding: 26px;
  width: 100%; max-width: 540px; max-height: 90vh;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  animation: scaleIn 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes scaleIn { from{opacity:0;transform:scale(0.93)} to{opacity:1;transform:scale(1)} }
.modal-handle { width: 36px; height: 4px; background: var(--border); border-radius: 2px; margin: 0 auto 18px; }
.modal-title { font-family: 'Syne', sans-serif; font-size: 24px; font-weight: 700; margin-bottom: 18px; }
.modal-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }

/* Meal type picker */
.meal-type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.meal-type-btn {
  background: var(--surface2); border: 2px solid var(--border);
  border-radius: 14px; padding: 16px 10px; cursor: pointer;
  text-align: center; display: flex; flex-direction: column; gap: 5px;
  transition: all 0.15s; color: var(--text); font-family: 'DM Sans', sans-serif;
  min-height: 90px;
}
.meal-type-btn:active { transform: scale(0.95); }
.meal-type-btn.selected-gross { border-color: var(--green);  background: rgba(200,240,96,0.07); }
.meal-type-btn.selected-klein { border-color: var(--orange); background: rgba(249,167,75,0.07); }
.meal-type-btn.selected-shake { border-color: var(--blue);   background: rgba(125,211,252,0.07); }
.meal-type-btn.selected-snack { border-color: var(--red);    background: rgba(248,113,113,0.07); }
.mtb-emoji { font-size: 30px; }
.mtb-label { font-size: 13px; font-weight: 600; }
.mtb-sub   { font-size: 11px; color: var(--muted); }

/* Toast */
.toast {
  position: fixed; top: calc(var(--safe-top) + 8px); left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: var(--green); color: #0d0d0d;
  padding: 12px 22px; border-radius: 14px;
  font-weight: 700; font-size: 14px; z-index: 500;
  white-space: nowrap;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
  pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ════════════════════════════════════════════
   MOBILE – iPhone 16 Pro (393×852)
════════════════════════════════════════════ */
@media (max-width: 700px) {

  /* Hide desktop sidebar */
  .sidebar { display: none; }

  /* Full-height app */
  .app { flex-direction: column; }

  /* Main content fills all space */
  .main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* push content below Dynamic Island */
    padding-top: var(--safe-top);
  }

  /* ── iPhone tab bar (bottom) ───── */
  .mobile-tabbar {
    display: flex !important;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    /* exact height – no safe-area padding so bar is flush at screen edge */
    height: var(--tab-h);
    padding-bottom: 0;
    background: rgba(13,13,13,0.97);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid var(--border);
    z-index: 100;
  }
  .mobile-tab {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; border: none; background: transparent;
    color: var(--muted); font-family: 'DM Sans', sans-serif;
    font-size: 10px; font-weight: 500; cursor: pointer;
    transition: color 0.15s;
    padding: 0; height: var(--tab-h);
  }
  .mobile-tab svg { width: 22px; height: 22px; transition: transform 0.15s; }
  .mobile-tab.active { color: var(--green); }
  .mobile-tab.active svg { transform: scale(1.08); }
  .mobile-tab:active svg { transform: scale(0.92); }

  /* tabs scroll padding: just the tab bar height, no safe-area */
  .tab {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 16px calc(var(--tab-h) + 12px);
    overscroll-behavior: contain;
  }

  /* Page header */
  .page-header { margin-bottom: 16px; }
  .page-title  { font-size: 28px; }

  /* Home grid: single column on mobile */
  .home-grid { grid-template-columns: 1fr; gap: 12px; margin-bottom: 12px; }
  .quick-stats { flex-direction: row; }
  .quick-stats .stat-card { flex: 1; }

  /* Timer font smaller */
  .timer-display { font-size: 42px; }

  /* Fasting card */
  .fasting-card { padding: 18px; }

  /* Section card */
  .section-card { padding: 16px; margin-bottom: 12px; }

  /* Weight hero */
  .weight-hero-num { font-size: 52px; }
  .weight-hero-card { padding: 20px; }

  /* Stats grid full-width on very small */
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .streak-num { font-size: 44px; }

  /* Modal: slide up from bottom on mobile */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
    background: rgba(0,0,0,0.7);
  }
  .modal {
    border-radius: 24px 24px 0 0;
    max-width: 100%;
    width: 100%;
    max-height: 92vh;
    padding: 20px 20px calc(var(--safe-bottom) + 16px);
    animation: slideUp 0.3s cubic-bezier(0.32,0.72,0,1);
  }
  @keyframes slideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }

  /* Onboarding */
  .onboarding { align-items: flex-start; padding-top: calc(var(--safe-top) + 12px); }
  .ob-logo { font-size: 54px; }
  .ob-title { font-size: 38px; }

  /* Bigger tap targets on meal delete */
  .meal-delete { padding: 8px; }
}

/* Desktop: hide mobile tabbar */
.mobile-tabbar { display: none; }

/* scrollbar hidden everywhere */
::-webkit-scrollbar { width: 0; height: 0; }

/* ════════════════════════════════════════════
   GymLog Erweiterungen
════════════════════════════════════════════ */

/* Farb-Palette für Geräte */
.c0{--ac:#c8f060;--bg-ac:rgba(200,240,96,.12);--bd-ac:rgba(200,240,96,.25)}
.c1{--ac:#7dd3fc;--bg-ac:rgba(125,211,252,.12);--bd-ac:rgba(125,211,252,.25)}
.c2{--ac:#f9a74b;--bg-ac:rgba(249,167,75,.12);--bd-ac:rgba(249,167,75,.25)}
.c3{--ac:#f87171;--bg-ac:rgba(248,113,113,.12);--bd-ac:rgba(248,113,113,.25)}
.c4{--ac:#c084fc;--bg-ac:rgba(192,132,252,.12);--bd-ac:rgba(192,132,252,.25)}
.c5{--ac:#f472b6;--bg-ac:rgba(244,114,182,.12);--bd-ac:rgba(244,114,182,.25)}
.c6{--ac:#2dd4bf;--bg-ac:rgba(45,212,191,.12);--bd-ac:rgba(45,212,191,.25)}
.c7{--ac:#fbbf24;--bg-ac:rgba(251,191,36,.12);--bd-ac:rgba(251,191,36,.25)}

/* Day Selector */
.day-selector{display:flex;gap:8px;overflow-x:auto;padding-bottom:12px;
  margin-bottom:16px;scrollbar-width:none}
.day-selector::-webkit-scrollbar{display:none}
.day-sel-btn{flex-shrink:0;padding:8px 14px;min-height:auto;text-align:left;
  border-radius:12px;line-height:1.3;background:var(--surface2);border:1px solid var(--border);
  color:var(--text);font-family:'DM Sans',sans-serif;font-size:13px;font-weight:500;
  cursor:pointer;transition:all .15s}
.day-sel-btn.active{border-color:var(--green);color:var(--green)}
.day-sel-btn:active{transform:scale(.97)}

/* Device List */
.dev-list{display:flex;flex-direction:column;gap:10px}
.dev-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);
  display:flex;align-items:center;gap:14px;padding:16px;cursor:pointer;
  transition:border-color .15s,transform .1s;position:relative}
.dev-card:active{transform:scale(.98)}
.dev-card.done{opacity:.58;border-color:rgba(200,240,96,.3);background:rgba(200,240,96,.025)}

.num-badge{width:48px;height:48px;border-radius:13px;flex-shrink:0;
  display:flex;align-items:center;justify-content:center;
  font-family:'Syne',sans-serif;font-size:13px;font-weight:800;letter-spacing:.5px;
  background:var(--bg-ac,rgba(200,240,96,.12));color:var(--ac,#c8f060);
  border:1px solid var(--bd-ac,rgba(200,240,96,.25))}

.dev-info{flex:1;min-width:0}
.dev-name-t{font-size:15px;font-weight:600;margin-bottom:2px;white-space:nowrap;
  overflow:hidden;text-overflow:ellipsis}
.dev-meta{font-size:12px;color:var(--muted)}
.dev-tick{width:26px;height:26px;border-radius:50%;border:1.5px solid var(--border);
  display:flex;align-items:center;justify-content:center;flex-shrink:0;
  font-size:12px;transition:all .2s}
.dev-card.done .dev-tick{background:var(--green);border-color:var(--green);color:#0a0a0a}

/* Progress Ring */
.ring-wrap{position:relative;width:48px;height:48px;display:flex;
  align-items:center;justify-content:center;flex-shrink:0}
.ring-pct{position:absolute;font-size:10px;font-weight:700;color:var(--green)}

/* Plan */
.plan-list{display:flex;flex-direction:column;gap:12px}
.plan-day-card{background:var(--surface);border:1px solid var(--border);
  border-radius:var(--radius);overflow:hidden}
.plan-day-head{display:flex;align-items:center;justify-content:space-between;
  padding:14px 16px;cursor:pointer;transition:background .15s}
.plan-day-head:active{background:var(--surface2)}
.pd-tag{font-size:11px;font-weight:700;color:var(--green);
  text-transform:uppercase;letter-spacing:.08em;margin-bottom:2px}
.pd-name{font-size:15px;font-weight:600}
.pd-count{font-size:12px;color:var(--muted)}
.plan-day-body{padding:0 12px 12px;display:flex;flex-direction:column;gap:7px}
.pd-dev{display:flex;align-items:center;gap:10px;padding:9px 12px;
  background:var(--surface2);border-radius:12px;cursor:pointer;transition:background .15s}
.pd-dev:active{background:#2a2a2a}
.pd-dev .num-badge{width:36px;height:36px;font-size:11px}
.pd-dev-info{flex:1}
.pd-dev-name{font-size:13px;font-weight:600}
.pd-dev-meta{font-size:12px;color:var(--muted)}
.pd-del{background:none;border:none;color:#444;cursor:pointer;padding:6px;
  border-radius:8px;font-size:14px;display:flex;align-items:center;
  justify-content:center;min-width:32px;min-height:32px;transition:color .15s}
.pd-del:active{color:var(--red)}
.pd-rest{padding:10px 16px 14px;font-size:13px;color:var(--muted)}

/* Set rows in modal */
.set-row{display:flex;align-items:center;gap:10px;padding:10px 0;
  border-bottom:1px solid var(--border)}
.set-row:last-child{border-bottom:none}
.set-lbl{font-size:13px;color:var(--muted);min-width:52px}
.set-ctrl{display:flex;align-items:center;gap:8px;flex:1}
.wb{width:36px;height:36px;border-radius:50%;border:1px solid var(--border);
  background:var(--surface2);color:var(--text);font-size:20px;font-weight:300;
  cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0;
  transition:background .15s,border-color .15s}
.wb:active{background:var(--surface);border-color:var(--green)}
.wv{font-family:'Syne',sans-serif;font-size:17px;font-weight:700;
  min-width:70px;text-align:center}

/* A–M Settings */
.cfg-grid{display:flex;flex-direction:column;gap:6px}
.cfg-row{display:grid;grid-template-columns:22px 1fr 76px;gap:8px;align-items:center}
.cfg-letter{font-family:'Syne',sans-serif;font-size:14px;font-weight:800;
  color:var(--green);text-align:center}
.cfg-lbl-i,.cfg-val-i{background:var(--surface2);border:1px solid var(--border);
  color:var(--text);border-radius:9px;padding:8px 10px;font-size:13px;
  font-family:'DM Sans',sans-serif;outline:none;width:100%;transition:border-color .15s}
.cfg-lbl-i:focus,.cfg-val-i:focus{border-color:var(--green)}
.cfg-lbl-i::placeholder,.cfg-val-i::placeholder{color:var(--muted)}
.cfg-val-i{font-family:'Syne',sans-serif;font-weight:700;text-align:center;
  -webkit-appearance:none;appearance:none}

/* Color swatches */
.swatch-row{display:flex;gap:8px;flex-wrap:wrap;margin-top:4px}
.swatch{width:30px;height:30px;border-radius:50%;cursor:pointer;
  border:2px solid transparent;transition:transform .15s,border-color .15s;flex-shrink:0}
.swatch:active{transform:scale(.88)}
.swatch.sel{border-color:#fff;transform:scale(1.12)}

/* Gym stats */
.section-header-simple{font-size:10px;font-weight:700;color:var(--muted);
  text-transform:uppercase;letter-spacing:.12em;margin-bottom:14px}
.dp-item{display:flex;align-items:center;gap:12px;padding:11px 0;
  border-bottom:1px solid var(--border)}
.dp-item:last-child{border-bottom:none}
.dp-info{flex:1}
.dp-name{font-size:13px;font-weight:600;margin-bottom:1px}
.dp-meta{font-size:11px;color:var(--muted)}
.dp-vals{text-align:right}
.dp-kg{font-family:'Syne',sans-serif;font-size:16px;font-weight:800;color:var(--green)}
.dp-max{font-size:11px;color:var(--muted)}
.hist-row{display:flex;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid var(--border)}
.hist-row:last-child{border-bottom:none}

/* Gym modal inner tabs */
.m-tabs{display:flex;gap:4px;background:var(--surface2);border-radius:12px;
  padding:4px;margin-bottom:16px}
.m-tab{flex:1;padding:8px;border:none;background:transparent;color:var(--muted);
  font-size:13px;font-weight:600;border-radius:9px;cursor:pointer;
  font-family:'DM Sans',sans-serif;transition:all .15s}
.m-tab.active{background:var(--surface);color:var(--text)}
.modal-section-label{font-size:10px;font-weight:700;color:var(--muted);
  text-transform:uppercase;letter-spacing:.1em;margin:0 0 10px}

/* FastLog sub-tabs */
.fl-subtabs{display:flex;gap:4px;background:var(--surface2);border-radius:12px;
  padding:4px;margin-bottom:4px}
.fl-subtab{flex:1;padding:9px;border:none;background:transparent;color:var(--muted);
  font-size:13px;font-weight:600;border-radius:9px;cursor:pointer;
  font-family:'DM Sans',sans-serif;transition:all .15s}
.fl-subtab.active{background:var(--surface);color:var(--text)}
.fl-tab{display:block}
.fl-tab.hidden{display:none}

/* Btn sizes */
.btn-primary{background:var(--green);color:#0d0d0d;border:none;border-radius:12px;
  padding:11px 18px;font-size:14px;font-weight:700;font-family:'DM Sans',sans-serif;
  cursor:pointer;transition:opacity .15s,transform .1s;min-height:44px}
.btn-primary:active{transform:scale(.97);opacity:.9}
.btn-primary.full{width:100%;font-size:15px;padding:14px;min-height:52px;border-radius:14px}
.btn-primary.btn-sm{padding:9px 16px;font-size:13px;min-height:36px;border-radius:10px}
.btn-ghost{background:var(--surface2);color:var(--text);border:1px solid var(--border);
  border-radius:12px;padding:11px 18px;font-size:14px;font-weight:500;
  font-family:'DM Sans',sans-serif;cursor:pointer;transition:opacity .15s,transform .1s;min-height:44px}
.btn-ghost:active{transform:scale(.97)}
.btn-ghost.full{width:100%;font-size:15px;padding:13px;min-height:50px;border-radius:14px}
.btn-danger{width:100%;padding:12px;background:rgba(248,113,113,.08);color:var(--red);
  border:1px solid rgba(248,113,113,.2);border-radius:12px;font-size:14px;font-weight:600;
  font-family:'DM Sans',sans-serif;cursor:pointer;margin-top:10px}

/* Sidebar extra link */
.nav-link.fl-link{border-top:1px solid var(--border);margin-top:8px;padding-top:14px}

@media(max-width:700px){
  .mobile-tabbar{display:flex!important}
  .fl-subtabs{margin-top:0}
}
