/* ====================================================================
   NutriMax — tema claro estilo Eatwise
   ==================================================================== */
:root {
  --bg: #f5f6fa;
  --bg-card: #ffffff;
  --text: #1a1a1a;
  --text-dim: #6b7280;
  --text-soft: #9ca3af;
  --border: #e5e7eb;
  --border-soft: #f3f4f6;

  --green: #22c55e;
  --green-dark: #16a34a;
  --green-soft: #dcfce7;
  --green-soft-2: #f0fdf4;

  --orange: #f97316;
  --orange-soft: #ffedd5;
  --pink: #ec4899;
  --pink-soft: #fce7f3;
  --blue: #3b82f6;
  --blue-soft: #dbeafe;
  --purple: #a855f7;
  --purple-soft: #f3e8ff;
  --red: #ef4444;
  --red-soft: #fee2e2;
  --yellow: #facc15;

  --shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08);
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  /* IMPORTANTE: NÃO bloquear scroll vertical */
}

body {
  -webkit-overflow-scrolling: touch;
}

/* touch-action só em botões (evita double-tap zoom mas NÃO bloqueia scroll) */
button, .tab, .meal-register, .auth-tab {
  touch-action: manipulation;
}

/* User-select desativado SÓ em botões e tabs, não no body inteiro */
button, .tab {
  -webkit-user-select: none;
  user-select: none;
}

/* Inputs e textos selecionáveis */
input, textarea, p, h1, h2, h3, .meal-name, .meal-detail, .result-notes {
  -webkit-user-select: auto;
  user-select: auto;
}

/* Bounce universal nos botões — sensação de app nativo */
button, .meal-register, .auth-tab, .tab {
  transition: transform 0.12s ease;
}

button:active {
  transform: scale(0.97);
}

.tab-add:active {
  transform: translateY(-8px) scale(0.93);
}

body {
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
  /* Garante que body pode crescer e rolar */
  overflow-y: visible;
}

/* HEADER */
.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  padding: 14px 16px 10px;
  padding-top: calc(env(safe-area-inset-top) + 14px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.header-coach {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--green-soft);
  color: var(--green-dark);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.coach-avatar {
  font-size: 16px;
}

.header-streak {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--orange-soft);
  color: var(--orange);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
}

/* MAIN / SCREENS */
main {
  flex: 1;
  padding: 4px 16px 110px;
}

.screen {
  display: none;
  animation: fadeIn 0.2s ease;
}

.screen.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* DAY SELECTOR */
.day-selector {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 16px;
}

.day-nav {
  background: transparent;
  border: none;
  color: var(--text-soft);
  font-size: 28px;
  padding: 4px 12px;
  cursor: pointer;
}

.day-current {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
}

/* SECTION TITLE */
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 16px 0 12px;
}

.section-title h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.btn-edit {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.btn-icon {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
}

.link-green {
  color: var(--green);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

/* CALORIE CARD */
.calorie-card {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 18px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.calorie-stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-right: 130px;
}

.calorie-stat .stat-label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
}

.calorie-stat .stat-value {
  display: block;
  font-size: 17px;
  color: var(--text);
}

.calorie-stat .stat-value strong {
  font-size: 22px;
  font-weight: 800;
}

.calorie-ring {
  position: absolute;
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
  width: 130px;
  height: 130px;
  border-radius: 50%;
  border: 4px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ring-value strong {
  font-size: 28px;
  font-weight: 800;
}

.ring-label {
  font-size: 12px;
  color: var(--text-dim);
}

.calorie-formula {
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-soft);
}

/* MEALS LIST */
.meals-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.meal-item {
  background: var(--bg-card);
  border-radius: 18px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
}

.meal-icon {
  font-size: 28px;
  width: 40px;
  text-align: center;
}

.meal-info {
  flex: 1;
}

.meal-name {
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 2px;
}

.meal-detail {
  font-size: 13px;
  color: var(--text-soft);
}

.meal-register {
  background: var(--green-soft);
  color: var(--green-dark);
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ============================================
   BOTÃO PRETO PILL (Iniciar Jejum etc)
   ============================================ */
.btn-pill {
  border-radius: 999px !important;
  padding: 18px 28px !important;
  font-size: 17px !important;
  font-weight: 700 !important;
}

/* ============================================
   CARD ATIVIDADES (tela Calorias)
   ============================================ */
.activities-card {
  background: var(--bg-card);
  border-radius: 18px;
  padding: 16px;
  margin: 16px 0;
  box-shadow: var(--shadow);
}

.activities-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.activities-title { font-size: 18px; font-weight: 800; }

.activities-goal {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.activities-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: var(--bg);
  border-radius: 14px;
  margin-bottom: 12px;
}

.activities-icon {
  width: 56px; height: 56px;
  background: white;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.activities-name { font-weight: 700; font-size: 15px; }
.activities-stats { font-size: 13px; color: var(--text-dim); margin-top: 2px; }
.activities-kcal { color: var(--green-dark); font-weight: 700; }
.activities-health {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--blue);
  background: var(--blue-soft);
  padding: 4px 8px;
  border-radius: 999px;
}
.health-icon { font-size: 12px; }

.btn-register-activity {
  width: 100%;
  background: var(--green-soft);
  color: var(--green-dark);
  border: none;
  border-radius: 999px;
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

/* ============================================
   CARDS EXTRAS NO MEU PLANO
   ============================================ */
.plano-extra-card {
  background: var(--bg-card);
  border-radius: 22px;
  padding: 16px;
  display: grid;
  grid-template-columns: 28px 1fr 90px;
  gap: 12px;
  align-items: center;
  box-shadow: var(--shadow);
  margin-top: 12px;
  position: relative;
  overflow: hidden;
}

.plano-check-big {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: transparent;
}

.plano-check-big.done {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

.plano-extra-info h3 { font-size: 16px; font-weight: 700; margin-bottom: 2px; }
.plano-extra-sub { font-size: 13px; color: var(--text-dim); }
.plano-extra-ill { font-size: 40px; text-align: right; }

.weight-goal-bar {
  margin-top: 8px;
  height: 6px;
  background: var(--border-soft);
  border-radius: 3px;
  overflow: hidden;
}
.weight-goal-fill { height: 100%; background: var(--green); width: 100%; transition: width 0.4s; }

.meals-plan-skip {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(0,0,0,0.5);
  color: white;
  border: none;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

/* ============================================
   CARD PASSOS COM MASCOTE (Meu Progresso)
   ============================================ */
.steps-card {
  background: var(--bg-card);
  border-radius: 22px;
  padding: 18px;
  display: grid;
  grid-template-columns: 30px 130px 1fr;
  gap: 16px;
  align-items: center;
  box-shadow: var(--shadow);
}

.steps-prev {
  background: var(--bg);
  border: none;
  width: 30px; height: 30px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-dim);
}

.steps-ring-wrap {
  position: relative;
  width: 130px;
  height: 130px;
}

.steps-ring-svg {
  width: 100%; height: 100%;
  transform: rotate(-90deg);
}

.steps-ring-bg {
  fill: none;
  stroke: var(--border-soft);
  stroke-width: 8;
}

.steps-ring-fg {
  fill: none;
  stroke: var(--green);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 352;
  stroke-dashoffset: 88;
  transition: stroke-dashoffset 0.6s;
}

.steps-count {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
  color: var(--green-dark);
  margin-top: -10px;
}

.steps-mascot {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 32px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}

.steps-day { font-size: 16px; font-weight: 800; margin-bottom: 4px; }
.steps-msg { font-size: 13px; color: var(--text-dim); line-height: 1.4; margin-bottom: 10px; }
.steps-goal {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

/* ============================================
   IMC VISUAL CARD (Meu Progresso)
   ============================================ */
.bmi-visual-card {
  background: var(--bg-card);
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.bmi-visual-header { margin-bottom: 12px; }
.bmi-visual-label { font-size: 13px; color: var(--text-dim); }
.bmi-visual-value { font-size: 34px; font-weight: 800; display: flex; align-items: baseline; gap: 10px; }
.bmi-visual-tag { font-size: 16px; color: var(--green-dark); font-weight: 700; }

.bmi-bar {
  position: relative;
  height: 10px;
  border-radius: 999px;
  margin: 16px 0 18px;
}

.bmi-bar-fill {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: linear-gradient(to right,
    #3b82f6 0%,
    #22c55e 25%,
    #facc15 60%,
    #ef4444 100%
  );
}

.bmi-bar-knob {
  position: absolute;
  top: 50%;
  width: 18px;
  height: 18px;
  background: white;
  border: 3px solid var(--green);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  left: 35%;
  transition: left 0.4s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.bmi-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.bmi-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}
.bmi-dot-blue { background: #3b82f6; }
.bmi-dot-green { background: #22c55e; }
.bmi-dot-yellow { background: #facc15; }
.bmi-dot-red { background: #ef4444; }

.bmi-source { color: var(--text-dim); text-decoration: underline; font-size: 12px; }

/* ============================================
   NUTRIÇÃO GRÁFICO SEMANAL
   ============================================ */
.nutrition-card {
  background: var(--bg-card);
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.nutrition-header {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.nutrition-prev {
  background: var(--bg);
  border: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
}

.nutrition-label { font-size: 12px; color: var(--text-dim); }
.nutrition-range { font-size: 16px; font-weight: 700; }

.nutrition-totals {
  display: flex;
  gap: 16px;
  text-align: right;
}
.nutrition-totals div { display: flex; flex-direction: column; }
.nutrition-totals strong { font-size: 22px; font-weight: 800; }
.nutrition-totals span { font-size: 10px; color: var(--text-dim); }

.nutrition-chart { width: 100%; height: 200px; }

.nutrition-legend {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 6px;
  font-size: 12px;
  margin-top: 10px;
}

.nut-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}
.nut-prot { background: #ef4444; }
.nut-carb { background: #facc15; }
.nut-fat  { background: #3b82f6; }
.nut-fib  { background: #22c55e; }

/* ============================================
   ÁGUA — gráfico semanal/mensal
   ============================================ */
.water-progress-card {
  background: var(--bg-card);
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.water-progress-range { font-size: 16px; font-weight: 700; margin-bottom: 10px; }
.water-progress-chart { width: 100%; height: 160px; }
.water-progress-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}

.water-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
  margin-top: 14px;
}

.water-toggle-btn {
  background: transparent;
  border: none;
  padding: 10px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 999px;
  color: var(--text-dim);
  cursor: pointer;
}

.water-toggle-btn.active {
  background: var(--blue);
  color: white;
}

/* ============================================
   ÁGUA - 12 copos clicáveis (estilo Eatwise)
   ============================================ */
.water-progress {
  font-size: 14px;
  color: var(--text-dim);
  font-weight: 600;
}

.water-progress span:first-child {
  color: var(--blue);
  font-weight: 800;
}

.water-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  background: var(--bg-card);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.water-cup {
  position: relative;
  width: 100%;
  aspect-ratio: 0.7 / 1;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s;
}

.water-cup:active { transform: scale(0.92); }

.water-cup svg {
  width: 100%;
  height: 100%;
}

.water-cup .cup-outline {
  fill: none;
  stroke: var(--blue);
  stroke-width: 2;
}

.water-cup .cup-fill {
  fill: rgba(59, 130, 246, 0.15);
  transition: fill 0.2s;
}

.water-cup.filled .cup-fill {
  fill: rgba(59, 130, 246, 0.55);
}

.water-cup.filled .cup-outline {
  stroke: var(--blue);
}

.water-cup .cup-plus {
  position: absolute;
  font-size: 22px;
  color: var(--blue);
  font-weight: 300;
  pointer-events: none;
}

.water-cup.filled .cup-plus { display: none; }

/* ============================================
   GRÁFICO SEMANAL DE JEJUM (barras verticais)
   ============================================ */
.fasting-week-card {
  background: var(--bg-card);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.fasting-week-header {
  text-align: center;
  margin-bottom: 8px;
}

.fasting-week-label {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 600;
}

.fasting-week-range {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin-top: 2px;
}

.fasting-week-chart {
  display: grid;
  grid-template-columns: 30px 1fr;
  grid-template-rows: 140px 20px;
  column-gap: 6px;
}

.fasting-week-yaxis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-soft);
  text-align: right;
  padding-right: 4px;
}

.fasting-week-svg {
  width: 100%;
  height: 100%;
}

.fasting-week-days {
  grid-column: 2;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 600;
}

/* ============================================
   FREQUÊNCIA CARDÍACA
   ============================================ */
.section-subtitle {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin: 8px 0 10px;
}

.hr-card {
  background: var(--bg-card);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.hr-header {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 12px;
  align-items: start;
  margin-bottom: 10px;
}

.hr-icon {
  width: 36px;
  height: 36px;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.hr-info { min-width: 0; }
.hr-title { font-size: 14px; font-weight: 700; }
.hr-desc { font-size: 12px; color: var(--text-dim); margin-top: 2px; line-height: 1.4; }

.hr-chart { width: 100%; height: 100px; opacity: 0.4; }
.hr-xaxis {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 11px;
  color: var(--text-soft);
  margin-top: 4px;
}

/* ============================================
   TELA CONFIGURAÇÕES (modal full screen)
   ============================================ */
.settings-modal {
  background: #f5f6fa;
  display: flex;
  flex-direction: column;
}

.settings-header {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  padding: 14px 16px;
  padding-top: calc(env(safe-area-inset-top) + 14px);
  background: white;
  border-bottom: 1px solid var(--border);
}

.settings-close {
  background: transparent;
  border: none;
  width: 44px;
  height: 44px;
  font-size: 24px;
  cursor: pointer;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.settings-title {
  font-size: 18px;
  font-weight: 800;
  text-align: center;
}

.settings-spacer { width: 44px; }

.settings-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  padding-bottom: calc(40px + env(safe-area-inset-bottom));
}

.settings-section-label {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: capitalize;
  padding: 16px 4px 6px;
}

.settings-group {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.settings-item {
  width: 100%;
  background: transparent;
  border: none;
  padding: 16px 18px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-soft);
  font-family: inherit;
}

.settings-item:last-child { border-bottom: none; }
.settings-item:active { background: var(--bg); }

.settings-item-danger { color: var(--red); }

.settings-chev {
  color: var(--text-soft);
  font-size: 20px;
}

.settings-version {
  text-align: center;
  color: var(--text-soft);
  font-size: 12px;
  margin-top: 24px;
}

/* PLANO */
.plano-progress {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 600;
}

.plano-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.plano-item {
  background: var(--bg-card);
  border-radius: 22px;
  padding: 16px;
  display: grid;
  grid-template-columns: 28px 1fr 90px;
  gap: 12px;
  align-items: center;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.plano-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: transparent;
  transition: all 0.15s;
  cursor: pointer;
}

.plano-item.done .plano-check {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

.plano-info h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 2px;
}

.plano-info .plano-progress-label {
  font-size: 13px;
  color: var(--text-dim);
}

.plano-illustration {
  font-size: 40px;
  text-align: right;
}

/* FASTING (jejum) */
.fasting-card {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.fasting-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.fasting-label {
  font-size: 13px;
  color: var(--text-dim);
  background: var(--bg);
  padding: 4px 12px;
  border-radius: 999px;
}

.fasting-plan {
  background: var(--bg);
  border: none;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.fasting-ring {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 12px auto;
  border-radius: 50%;
  border: 3px solid var(--border-soft);
}

.ring-icon {
  position: absolute;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.ring-top    { top: -18px; left: 50%; transform: translateX(-50%); }
.ring-bottom { bottom: -18px; left: 50%; transform: translateX(-50%); }
.ring-left   { left: -18px; top: 50%; transform: translateY(-50%); }
.ring-right  { right: -18px; top: 50%; transform: translateY(-50%); }

.fasting-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.fasting-when {
  font-size: 22px;
  font-weight: 800;
}

.fasting-time {
  font-size: 17px;
  color: var(--text-dim);
}

.btn-dark {
  width: 100%;
  background: #111;
  color: white;
  border: none;
  padding: 16px;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
}

.stages-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--bg-card);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
  position: relative;
}

.stages-row::before {
  content: '';
  position: absolute;
  top: 30px;
  left: 14%;
  right: 14%;
  height: 1px;
  background: var(--border);
  z-index: 0;
}

.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.stage-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-soft);
}

.stage-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.tip-card {
  background: var(--bg-card);
  border-radius: 18px;
  padding: 16px;
  display: flex;
  gap: 14px;
  box-shadow: var(--shadow);
}

.tip-emoji {
  font-size: 56px;
  flex-shrink: 0;
}

.tip-list {
  list-style: disc;
  padding-left: 18px;
  font-size: 14px;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* PROGRESSO */
.score-card {
  background: var(--bg-card);
  border-radius: 22px;
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
}

.score-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #c4c4c4;
  color: white;
  font-size: 36px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}

.score-card h3 {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 6px;
}

.score-desc {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.score-scale {
  display: flex;
  align-items: center;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 12px;
}

.score-tier {
  flex: 1;
  padding: 6px 4px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  color: rgba(0, 0, 0, 0.7);
}

.tier-a-plus  { background: #86efac; }
.tier-b-plus  { background: #bbf7d0; }
.tier-b       { background: #fef9c3; }
.tier-b-minus { background: #fef08a; }
.tier-c-plus  { background: #fde68a; }
.tier-c       { background: #fed7aa; }
.tier-c-minus { background: #fdba74; }
.tier-d       { background: #fca5a5; }
.tier-current { background: #9ca3af; color: white; }

.score-source {
  color: var(--text-dim);
  font-size: 13px;
  text-decoration: underline;
}

.weight-card {
  background: var(--bg-card);
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.weight-info {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.weight-info .weight-label {
  font-size: 13px;
  color: var(--text-dim);
}

.weight-info strong {
  font-weight: 800;
  font-size: 17px;
}

.btn-green-soft {
  margin-left: auto;
  background: var(--green-soft);
  color: var(--green-dark);
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.weight-chart {
  width: 100%;
  height: 130px;
}

.weight-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.weight-day {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  margin: 0 auto;
}

/* BOTTOM TAB BAR */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr 80px 1fr 1fr;
  padding: 6px 4px;
  padding-bottom: calc(6px + env(safe-area-inset-bottom));
  z-index: 20;
  align-items: end;
}

.tab {
  background: transparent;
  border: none;
  color: var(--text-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  cursor: pointer;
  border-radius: 0;
}

.tab-icon {
  font-size: 20px;
  filter: grayscale(1) opacity(0.5);
}

.tab-label {
  font-size: 11px;
  font-weight: 600;
}

.tab.active {
  color: var(--text);
}

.tab.active .tab-icon {
  filter: none;
}

.tab-add {
  background: var(--green);
  border: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  color: white;
  font-size: 30px;
  font-weight: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
  margin: 0 auto;
  transform: translateY(-10px);
}

.tab-add:active {
  transform: translateY(-8px) scale(0.95);
}

/* MODAL */
.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  animation: fadeIn 0.2s;
}

.modal-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg);
  border-radius: 22px 22px 0 0;
  padding: 12px 16px 32px;
  padding-bottom: calc(32px + env(safe-area-inset-bottom));
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-sheet-tall {
  min-height: 80vh;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-handle {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 8px;
}

.modal-title {
  font-size: 19px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 4px;
}

.modal-desc {
  font-size: 14px;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 6px;
}

/* ACTION CARDS (modal +) */
.action-feature {
  background: var(--bg-card);
  border: none;
  border-radius: 20px;
  padding: 26px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.action-feature-icon {
  width: 56px;
  height: 56px;
  background: var(--green-soft);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
}

.action-feature-label {
  font-size: 18px;
  font-weight: 700;
}

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

.action-big {
  background: var(--bg-card);
  border: none;
  border-radius: 18px;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.action-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.action-emoji {
  font-size: 22px;
}

.action-label {
  font-size: 15px;
  font-weight: 700;
  text-align: center;
}

.action-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 8px;
}

.action-small {
  background: var(--bg-card);
  border: none;
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  box-shadow: var(--shadow);
}

.action-icon-mini {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.icon-bg-purple { background: var(--purple-soft); }
.icon-bg-blue   { background: var(--blue-soft); }
.icon-bg-pink   { background: var(--pink-soft); }
.icon-bg-red    { background: var(--red-soft); }
.icon-bg-green  { background: var(--green-soft); }
.icon-bg-yellow { background: #fef9c3; }

/* SCAN AREA (dentro do scan-modal) */
.scan-area {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--bg-card);
  border: 2px dashed var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scan-placeholder {
  text-align: center;
  color: var(--text-dim);
  padding: 24px;
}

.scan-icon-big {
  font-size: 56px;
  margin-bottom: 12px;
}

#preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* RESULT */
.result-card,
.loading-card,
.error-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.result-card h3 {
  font-size: 17px;
  color: var(--green-dark);
  font-weight: 800;
  margin-bottom: 14px;
}

.macros-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.macro {
  background: var(--bg);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
}

.macro-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.macro-value {
  font-size: 20px;
  font-weight: 800;
}

.macro-unit {
  font-size: 11px;
  color: var(--text-dim);
}

.result-notes {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 12px;
  font-style: italic;
}

.meal-picker {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.meal-picker select {
  font-family: inherit;
  font-size: 16px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
}

#simple-input {
  font-family: inherit;
  font-size: 18px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  text-align: center;
  font-weight: 700;
}

.loading-card {
  text-align: center;
  padding: 24px 16px;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  margin: 0 auto 12px;
  animation: spin 0.8s linear infinite;
}

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

.error-card {
  border: 1px solid var(--red);
  background: var(--red-soft);
}

.error-card p {
  color: var(--red);
  margin-bottom: 12px;
}

/* BUTTONS */
button {
  font-family: inherit;
}

.btn-primary {
  background: var(--green);
  color: white;
  border: none;
  padding: 14px 20px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s;
}

.btn-primary:active { transform: scale(0.97); }
.btn-primary:hover  { background: var(--green-dark); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 12px 20px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* ============================================
   TREINADOR DE NUTRIÇÃO (chat IA)
   ============================================ */
.header-coach {
  background: var(--green-soft);
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.12s, background 0.15s;
}
.header-coach:active { transform: scale(0.97); }
.header-coach:hover  { background: #c7f5d5; }

.coach-modal {
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.coach-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 12px 14px;
  padding-top: calc(env(safe-area-inset-top) + 12px);
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  gap: 10px;
}

.coach-close, .coach-clear {
  background: transparent;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
}
.coach-close:active, .coach-clear:active { background: var(--bg); }

.coach-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.coach-avatar-big {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--green-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.coach-name {
  font-weight: 700;
  font-size: 15px;
}

.coach-status {
  font-size: 11px;
  color: var(--green);
  font-weight: 600;
}

.coach-chat {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overscroll-behavior: contain;
}

.coach-bubble {
  max-width: 80%;
  padding: 12px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
  animation: bubbleIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(8px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.coach-bubble-bot {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-bottom-left-radius: 6px;
  align-self: flex-start;
}

.coach-bubble-user {
  background: var(--green);
  color: white;
  border-bottom-right-radius: 6px;
  align-self: flex-end;
}

.coach-bubble-typing {
  background: var(--bg-card);
  border: 1px solid var(--border);
  align-self: flex-start;
  display: inline-flex;
  gap: 4px;
  padding: 14px 16px;
  border-bottom-left-radius: 6px;
}

.coach-bubble-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
  animation: typing 1.2s infinite ease-in-out;
}

.coach-bubble-typing span:nth-child(2) { animation-delay: 0.15s; }
.coach-bubble-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}

.coach-suggestions {
  padding: 8px 16px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  border-top: 1px solid var(--border-soft);
}

.coach-suggestions::-webkit-scrollbar { display: none; }

.coach-suggestion {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
}

.coach-form {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}

#coach-input {
  flex: 1;
  font-family: inherit;
  font-size: 15px;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
}

#coach-input:focus {
  outline: none;
  border-color: var(--green);
}

.coach-send {
  background: var(--green);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: white;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.coach-send:disabled {
  background: var(--border);
  cursor: not-allowed;
  box-shadow: none;
}

/* ============================================
   SETTINGS (rows na tela Meu Progresso)
   ============================================ */
.settings-card {
  background: var(--bg-card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.settings-row {
  width: 100%;
  background: transparent;
  border: none;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 36px 1fr 20px;
  gap: 14px;
  align-items: center;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  border-bottom: 1px solid var(--border-soft);
}

.settings-row:last-child { border-bottom: none; }
.settings-row:active { background: var(--bg); }

.settings-icon {
  width: 36px;
  height: 36px;
  background: var(--bg);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.settings-label {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 2px;
}

.settings-desc {
  font-size: 12px;
  color: var(--text-dim);
}

.settings-chevron {
  color: var(--text-soft);
  font-size: 22px;
  font-weight: 300;
}

/* ============================================
   DEBUG PANEL (dev only)
   ============================================ */
.debug-panel {
  position: fixed;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.85);
  color: #a3e635;
  font-family: monospace;
  font-size: 11px;
  padding: 8px 10px;
  border-radius: 8px;
  z-index: 300;
  max-width: 220px;
  pointer-events: none;
}

.debug-panel strong {
  color: white;
  display: block;
  margin-bottom: 4px;
}

#dbg-last {
  color: #facc15;
  margin-top: 4px;
  word-break: break-all;
}

/* ============================================
   ONBOARDING WIZARD v0.8 — estilo Eatwise
   ============================================ */
.onboard-overlay {
  position: fixed;
  inset: 0;
  background: #f4f7f2;
  z-index: 200;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  overscroll-behavior: contain;
  /* Padrão sutil de ícones de comida no fundo */
  background-image:
    radial-gradient(circle at 10% 20%, rgba(34, 197, 94, 0.04) 0%, transparent 30%),
    radial-gradient(circle at 80% 75%, rgba(34, 197, 94, 0.04) 0%, transparent 30%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'><g fill='%23000' fill-opacity='0.025' font-size='28' font-family='sans-serif'><text x='10' y='35'>🍎</text><text x='80' y='25'>🥑</text><text x='150' y='40'>🥦</text><text x='30' y='80'>🍞</text><text x='110' y='80'>🥚</text><text x='170' y='90'>🥕</text><text x='5' y='130'>🍌</text><text x='75' y='130'>🥗</text><text x='140' y='140'>🍅</text><text x='30' y='180'>🌶</text><text x='100' y='180'>🍇</text><text x='160' y='185'>🥒</text></g></svg>");
}

.onboard-top {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 12px;
  padding: 12px 16px 6px;
}

.onboard-back {
  background: transparent;
  border: none;
  font-size: 26px;
  font-weight: 400;
  color: #111;
  cursor: pointer;
  padding: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.onboard-skip {
  background: transparent;
  border: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  padding: 8px 4px;
  text-align: right;
  white-space: nowrap;
}

.onboard-progress {
  height: 4px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.onboard-progress-bar {
  height: 100%;
  background: #111;
  width: 0%;
  border-radius: 2px;
  transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.onboard-stage {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.onboard-track {
  display: flex;
  width: 1500%; /* 15 steps × 100% */
  height: 100%;
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
  will-change: transform;
}

.onboard-step {
  width: calc(100% / 15);
  height: 100%;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-top: 24px;
}

/* Steps com título à esquerda (estilo Eatwise) */
.onboard-title-left {
  font-size: 26px;
  font-weight: 800;
  text-align: left;
  width: 100%;
  line-height: 1.15;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.onboard-subtitle-left {
  font-size: 14px;
  color: var(--text-dim);
  text-align: left;
  width: 100%;
  line-height: 1.4;
  margin-bottom: 8px;
}

.onboard-emoji {
  font-size: 72px;
  line-height: 1;
  margin-bottom: 6px;
  animation: bounceIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bounceIn {
  from { transform: scale(0.3); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.onboard-title {
  font-size: 26px;
  font-weight: 800;
  text-align: center;
  line-height: 1.2;
  letter-spacing: -0.5px;
}

.onboard-subtitle {
  font-size: 14px;
  color: var(--text-dim);
  text-align: center;
  max-width: 320px;
  line-height: 1.4;
}

.onboard-choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 380px;
  margin-top: 4px;
}

.onboard-choice {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform 0.12s, background 0.15s, border-color 0.15s;
  font-family: inherit;
  width: 100%;
}

.onboard-choice:active { transform: scale(0.97); }

.onboard-choice .choice-emoji {
  font-size: 28px;
  flex-shrink: 0;
  line-height: 1;
}

.onboard-choice small {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  margin-top: 2px;
}

.onboard-choice.selected {
  border-color: var(--green);
  background: var(--green-soft-2);
}

/* Cards estilo Eatwise — avatar quadrado + texto */
.onboard-choices-card .choice-card {
  background: white;
  border: 2px solid transparent;
  border-radius: 18px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 14px;
  align-items: center;
  width: 100%;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  text-align: left;
  transition: transform 0.12s, border-color 0.15s, box-shadow 0.15s;
}

.onboard-choices-card .choice-card.selected {
  border-color: var(--green);
  background: #f0fdf4;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.15);
}

.choice-avatar {
  width: 56px;
  height: 56px;
  background: #f4f7f2;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  flex-shrink: 0;
}

.choice-card.selected .choice-avatar {
  background: rgba(34, 197, 94, 0.12);
}

.choice-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.choice-text strong {
  font-size: 16px;
  font-weight: 700;
  color: #111;
  line-height: 1.25;
}

.choice-text small {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  line-height: 1.3;
}

.meal-icons {
  font-size: 18px;
  letter-spacing: 2px;
  margin-bottom: 4px;
  display: block;
}

.onboard-input {
  font-family: inherit;
  font-size: 32px;
  font-weight: 800;
  text-align: center;
  width: 220px;
  padding: 18px 12px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 18px;
  color: var(--text);
  margin-top: 8px;
}

/* Campo de texto (nome) — menor que os números */
.onboard-input-text {
  font-size: 18px;
  font-weight: 600;
  width: min(320px, 100%);
  padding: 14px 16px;
}

.onboard-input:focus {
  outline: none;
  border-color: var(--green);
}

.onboard-input-suffix {
  font-size: 16px;
  color: var(--text-dim);
  margin-top: -4px;
  font-weight: 600;
}

.onboard-next {
  margin: 12px 20px;
  margin-bottom: calc(20px + env(safe-area-inset-bottom));
  padding: 18px;
  background: #111;
  color: white;
  border: none;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s, opacity 0.15s;
  letter-spacing: 0.3px;
}

.onboard-next:active { transform: scale(0.97); }
.onboard-next:hover  { opacity: 0.9; }
.onboard-next:disabled {
  background: rgba(0, 0, 0, 0.15);
  color: rgba(255, 255, 255, 0.85);
  cursor: not-allowed;
}

/* Wheel picker pra ano de nascimento */
.year-wheel-wrap {
  position: relative;
  width: 100%;
  max-width: 380px;
  height: 280px;
  margin-top: 12px;
  overflow: hidden;
}

.year-wheel {
  position: absolute;
  inset: 0;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  padding: 120px 0;
}

.year-wheel::-webkit-scrollbar { display: none; }

.year-item {
  scroll-snap-align: center;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.25);
  transition: color 0.15s, font-size 0.15s, opacity 0.15s;
}

.year-item.year-near {
  color: rgba(0, 0, 0, 0.55);
  font-size: 30px;
}

.year-item.year-selected {
  color: #111;
  font-size: 34px;
  background: rgba(34, 197, 94, 0.15);
  border-radius: 999px;
  margin: 0 30px;
  font-weight: 800;
}

.year-wheel-mask {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, #f4f7f2 0%, transparent 30%, transparent 70%, #f4f7f2 100%);
}

/* Tela LOADING "Personalizando sua jornada" */
.onboard-step-loading {
  justify-content: flex-start;
  align-items: center;
  gap: 18px;
  padding-top: 50px;
}

.loading-ring {
  position: relative;
  width: 180px;
  height: 180px;
  margin-bottom: 12px;
}

.loading-ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.loading-ring-bg {
  fill: none;
  stroke: rgba(0, 0, 0, 0.1);
  stroke-width: 8;
}

.loading-ring-fg {
  fill: none;
  stroke: var(--green);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 326.7; /* 2π·52 */
  stroke-dashoffset: 326.7;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.loading-ring-pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  font-weight: 800;
  color: #111;
}

.loading-checks {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.loading-check {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.4);
  transition: color 0.3s;
}

.loading-check.done { color: #111; }

.check-bullet {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background 0.3s, color 0.3s;
  flex-shrink: 0;
}

.loading-check.done .check-bullet {
  background: var(--green);
  color: white;
}

.testimonial-card {
  background: white;
  border-radius: 18px;
  padding: 14px 16px;
  width: 100%;
  max-width: 380px;
  margin-top: 18px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  animation: bubbleIn 0.4s;
}

.testimonial-stars {
  font-size: 14px;
  margin-bottom: 6px;
}

.testimonial-author {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
  text-align: right;
  margin-top: -22px;
}

.testimonial-text {
  font-size: 14px;
  line-height: 1.45;
  color: #111;
  margin-top: 6px;
}

/* IMC card no resultado */
.bmi-card {
  background: var(--bg-card);
  border-radius: 18px;
  padding: 14px 18px;
  width: 100%;
  max-width: 320px;
  text-align: center;
  box-shadow: var(--shadow);
}

.bmi-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}

.bmi-value {
  font-size: 36px;
  font-weight: 800;
  color: var(--green-dark);
  line-height: 1.1;
  margin: 2px 0 6px;
}

.bmi-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  color: white;
  background: var(--green);
}

.bmi-tag.bmi-low    { background: #3b82f6; }
.bmi-tag.bmi-normal { background: var(--green); }
.bmi-tag.bmi-over   { background: var(--orange); }
.bmi-tag.bmi-obese  { background: var(--red); }

/* Resultado final */
.macro-target {
  background: var(--bg-card);
  border-radius: 22px;
  padding: 20px 18px;
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow);
}

.macro-target-big {
  text-align: center;
  font-size: 14px;
  color: var(--text-dim);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-soft);
}

.macro-target-big span {
  display: block;
  font-size: 48px;
  font-weight: 800;
  color: var(--green-dark);
  line-height: 1;
  margin-bottom: 4px;
}

.macro-target-big small {
  font-size: 13px;
  color: var(--text-dim);
}

.macro-target-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--text-dim);
  padding: 4px 0;
}

.macro-target-row strong {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}

/* OVERLAYS (auth + paywall) */
.overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  padding-top: calc(env(safe-area-inset-top) + 20px);
  overflow-y: auto;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 28px 22px;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  font-size: 28px;
  font-weight: 800;
  text-align: center;
  color: var(--text);
}

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

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
}

.auth-tab {
  background: transparent;
  color: var(--text-dim);
  padding: 10px;
  font-size: 14px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
}

.auth-tab.active {
  background: var(--bg-card);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-form input {
  font-family: inherit;
  font-size: 16px;
  padding: 13px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
}

.auth-form input:focus {
  outline: none;
  border-color: var(--green);
}

.auth-note {
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  margin-top: 2px;
}

.auth-error {
  font-size: 13px;
  color: var(--red);
  text-align: center;
  padding: 8px;
  background: var(--red-soft);
  border-radius: 8px;
}

/* PAYWALL */
.paywall-card { max-width: 420px; position: relative; }

.paywall-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--bg);
  border: none;
  color: var(--text-dim);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
}

.paywall-title { text-align: center; font-size: 22px; font-weight: 800; }
.paywall-desc { text-align: center; color: var(--text-dim); font-size: 13px; }
.paywall-price { text-align: center; font-size: 36px; font-weight: 800; color: var(--green-dark); margin: 4px 0; }
.paywall-price span { font-size: 14px; color: var(--text-dim); font-weight: 500; }
.paywall-step { font-size: 12px; color: var(--text-dim); margin-top: 6px; }

.pix-qr-wrap {
  display: flex;
  justify-content: center;
  background: white;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 6px 0;
}

#pix-qr-canvas {
  display: block;
  width: 200px !important;
  height: 200px !important;
}

.pix-info {
  background: var(--bg);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

.pix-info-row { display: flex; justify-content: space-between; }
.pix-info-row span { color: var(--text-dim); }
.pix-info-row strong { color: var(--text); font-weight: 700; }

.pix-help {
  background: var(--bg);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-dim);
}

.pix-help summary { cursor: pointer; font-weight: 600; color: var(--text); }
.pix-help ol { margin: 8px 0 0 20px; display: flex; flex-direction: column; gap: 4px; }

.saved-msg {
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}
