/* ═══════════════════════════════════════════════════════════════
   Pépite — CSS commun
   Mobile-first, dark theme, police DM Serif Display + DM Sans
═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500&display=swap');

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

/* ── Variables ──────────────────────────────────────────────── */
:root {
  --bg:        #0e0f0c;
  --bg2:       #161714;
  --bg3:       #1e1f1b;
  --surface:   #252621;
  --surface2:  #2e2f2a;
  --border:    rgba(255,255,255,0.07);
  --border2:   rgba(255,255,255,0.13);
  --text:      #f0ede6;
  --text2:     #b8b5ae;
  --muted:     #7a7872;

  /* Or — palette Pépite */
  --gold:      #E8A82A;
  --gold2:     #F2C040;
  --gold3:     #C88018;
  --gold-dim:  rgba(232,168,42,0.12);
  --gold-bdr:  rgba(232,168,42,0.28);

  --danger:    #e85a4a;
  --warn:      #e8a84a;
  --good:      #4ae89a;
  --info:      #4a9ae8;

  --fd: 'DM Serif Display', Georgia, serif;
  --fb: 'DM Sans', system-ui, sans-serif;

  --r:    16px;
  --r-sm: 10px;
  --r-xs: 6px;

  /* Touch targets minimum 48px */
  --touch: 48px;

  /* Safe area iPhone */
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top:    env(safe-area-inset-top, 0px);
}

/* ── Base ───────────────────────────────────────────────────── */
html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--fb);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body { display: flex; flex-direction: column; min-height: 100dvh; }

/* ── Logo SVG ───────────────────────────────────────────────── */
.logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-diamond { flex-shrink: 0; }

.logo-text {
  font-family: var(--fd);
  font-size: 1.5rem;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1;
}

.logo-text em {
  color: var(--gold);
  font-style: italic;
}

/* ── Header ─────────────────────────────────────────────────── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(0.75rem + var(--safe-top)) 1.25rem 0.75rem;
  border-bottom: 0.5px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── Nav tabs ───────────────────────────────────────────────── */
.site-nav {
  display: flex;
  border-bottom: 0.5px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
  position: sticky;
  top: 60px;
  z-index: 99;
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 10px 6px;
  min-height: var(--touch);
  font-family: var(--fb);
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -0.5px;
  transition: color .15s;
  -webkit-tap-highlight-color: transparent;
}

.tab svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  flex-shrink: 0;
}

.tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* ── Pages ──────────────────────────────────────────────────── */
.page {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(1.5rem + var(--safe-bottom));
}

.page.active { display: flex; }

/* ── Badges & pills ─────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 500;
  border-radius: 20px;
  padding: 5px 12px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity .15s;
}

.badge:active { opacity: .75; }

.badge-gold {
  color: var(--gold);
  background: var(--gold-dim);
  border: 0.5px solid var(--gold-bdr);
}

.badge-good {
  color: var(--good);
  background: rgba(74,232,154,.1);
  border: 0.5px solid rgba(74,232,154,.25);
}

.badge-warn {
  color: var(--warn);
  background: rgba(232,168,74,.1);
  border: 0.5px solid rgba(232,168,74,.25);
}

.badge-danger {
  color: var(--danger);
  background: rgba(232,90,74,.1);
  border: 0.5px solid rgba(232,90,74,.25);
}

/* ── Banners ────────────────────────────────────────────────── */
.banner {
  padding: 10px 1.25rem;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.banner-warn {
  background: rgba(232,168,74,.08);
  border-bottom: 0.5px solid rgba(232,168,74,.2);
  color: var(--warn);
}

.banner-good {
  background: rgba(74,232,154,.06);
  border-bottom: 0.5px solid rgba(74,232,154,.18);
  color: var(--good);
}

.banner a { color: var(--gold); text-decoration: none; font-weight: 500; white-space: nowrap; }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 0.5px solid var(--border2);
  border-radius: var(--r);
  padding: 1.25rem;
}

.card-sm {
  background: var(--bg3);
  border: 0.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px 14px;
}

.card-title {
  font-family: var(--fd);
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: .75rem;
}

/* ── Sections ───────────────────────────────────────────────── */
.section { padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; }
.section-title {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--muted);
}

/* ── Metric cards ───────────────────────────────────────────── */
.metric-row { display: flex; gap: 8px; }

.metric-chip {
  flex: 1;
  background: var(--bg3);
  border: 0.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric-val {
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
  line-height: 1;
}

.metric-lbl {
  font-size: 11px;
  color: var(--muted);
}

/* ── Progress bar ───────────────────────────────────────────── */
.progress-wrap {
  background: var(--bg3);
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--gold);
  transition: width .8s cubic-bezier(.23,1,.32,1);
}

.progress-fill.near  { background: var(--warn); }
.progress-fill.over  { background: var(--danger); }

.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin-top: 5px;
}

/* ── Food items ─────────────────────────────────────────────── */
.food-list { display: flex; flex-direction: column; gap: 6px; }

.food-item {
  background: var(--bg3);
  border: 0.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fadeUp .3s ease both;
}

.food-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.food-dot.high { background: var(--good); }
.food-dot.mid  { background: var(--warn); }
.food-dot.low  { background: var(--danger); }

.food-info { flex: 1; min-width: 0; }
.food-name { font-size: 14px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.food-qty  { font-size: 12px; color: var(--muted); margin-top: 2px; }
.food-kcal { font-size: 14px; font-weight: 500; color: var(--gold); flex-shrink: 0; }

/* ── Info / advice blocks ───────────────────────────────────── */
.block-advice {
  background: var(--gold-dim);
  border: 0.5px solid var(--gold-bdr);
  border-radius: var(--r);
  padding: 1rem 1.25rem;
  font-size: 13px;
  line-height: 1.7;
  color: rgba(240,237,230,.85);
}
.block-advice strong { color: var(--gold); font-weight: 500; }

.block-error {
  background: rgba(232,90,74,.08);
  border: 0.5px solid rgba(232,90,74,.22);
  border-radius: var(--r);
  padding: 1rem 1.25rem;
  font-size: 13px;
  color: var(--danger);
  line-height: 1.65;
}

.block-warn {
  background: rgba(232,168,74,.08);
  border: 0.5px solid rgba(232,168,74,.22);
  border-radius: var(--r);
  padding: 1rem 1.25rem;
  font-size: 13px;
  color: var(--warn);
  line-height: 1.65;
}

.block-good {
  background: rgba(74,232,154,.06);
  border: 0.5px solid rgba(74,232,154,.2);
  border-radius: var(--r);
  padding: 1rem 1.25rem;
  font-size: 13px;
  color: var(--good);
  line-height: 1.65;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: var(--touch);
  padding: 0 1.25rem;
  border-radius: var(--r);
  border: none;
  font-family: var(--fb);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: transform .1s, opacity .15s;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(.97); }

.btn-gold  { background: var(--gold); color: #1a1208; }
.btn-gold:active { background: var(--gold3); }

.btn-ghost {
  background: transparent;
  border: 0.5px solid var(--border2);
  color: var(--text2);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }

.btn-danger-ghost {
  background: transparent;
  border: 0.5px solid var(--border2);
  color: var(--muted);
  font-size: 13px;
}
.btn-danger-ghost:hover { border-color: var(--danger); color: var(--danger); }

/* Spinner inside btn */
.btn .spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(26,29,14,.3);
  border-top-color: #1a1208;
  border-radius: 50%;
  animation: spin .8s linear infinite;
  display: none;
}
.btn.loading .spinner  { display: block; }
.btn.loading .btn-icon { display: none; }
.btn:disabled { background: var(--surface); color: var(--muted); cursor: not-allowed; transform: none; }

/* ── Forms ──────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }

.field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .07em;
}

.field label small { font-size: 11px; font-weight: 400; text-transform: none; letter-spacing: 0; }

.field input,
.field select,
.field textarea {
  background: var(--bg3);
  border: 0.5px solid var(--border2);
  border-radius: var(--r-sm);
  color: var(--text);
  font-family: var(--fb);
  font-size: 16px; /* 16px évite le zoom auto sur iOS */
  padding: 12px 14px;
  width: 100%;
  outline: none;
  min-height: var(--touch);
  transition: border-color .15s;
  -webkit-appearance: none;
  appearance: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--gold); }

.field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237a7872' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

.field select option { background: var(--bg3); }

/* ── Auth pages ─────────────────────────────────────────────── */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 1.5rem 1.25rem;
  padding-top: calc(1.5rem + var(--safe-top));
  padding-bottom: calc(1.5rem + var(--safe-bottom));
}

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

/* Logo centré sur auth */
.auth-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: .5rem;
}

.auth-logo .logo-text { font-size: 2rem; }

.auth-title {
  font-family: var(--fd);
  font-size: 1.5rem;
  color: var(--text);
  text-align: center;
}

.auth-sub {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin-top: -.5rem;
}

.auth-link {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.auth-link a { color: var(--gold); text-decoration: none; }

/* ── Plan card (upgrade) ────────────────────────────────────── */
.plan-card {
  background: var(--surface);
  border: 0.5px solid var(--gold-bdr);
  border-radius: var(--r);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.plan-price {
  font-family: var(--fd);
  font-size: 3rem;
  color: var(--gold);
  text-align: center;
  line-height: 1;
}

.plan-price span {
  font-size: 16px;
  font-family: var(--fb);
  color: var(--muted);
}

.plan-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
  color: var(--text2);
}

.plan-features li::before { content: '✦ '; color: var(--gold); font-size: 10px; }

/* ── Info block (calculs nutritionnels) ─────────────────────── */
.info-block {
  background: var(--bg3);
  border: 0.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 1rem;
  font-size: 13px;
  line-height: 1.8;
  color: rgba(240,237,230,.8);
}

.info-block .hl      { color: var(--gold); font-weight: 500; }
.info-block .danger  { color: var(--danger); font-weight: 500; }
.info-block .divider { border-top: 0.5px solid var(--border); margin: .6rem 0; padding-top: .6rem; }

/* ── History day ────────────────────────────────────────────── */
.history-day {
  background: var(--bg3);
  border: 0.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 14px;
  animation: fadeUp .3s ease both;
}

.hd-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.hd-date { font-size: 13px; font-weight: 500; color: var(--text); }
.hd-kcal { font-size: 15px; font-weight: 500; }
.hd-bar-wrap { background: var(--bg); border-radius: 3px; height: 5px; overflow: hidden; }
.hd-bar { height: 100%; border-radius: 3px; transition: width .6s ease; }
.hd-meta { font-size: 11px; color: var(--muted); margin-top: 6px; }

/* ── Chart ──────────────────────────────────────────────────── */
.chart-wrap { position: relative; height: 200px; }
.legend-row { display: flex; gap: 16px; justify-content: center; margin-top: 10px; }
.legend-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ── Empty states ───────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  gap: 12px;
  color: var(--muted);
  text-align: center;
  flex: 1;
}

.empty-icon { font-size: 44px; opacity: .3; }
.empty-text { font-size: 13px; line-height: 1.65; }

/* ── Camera ─────────────────────────────────────────────────── */
.camera-zone {
  position: relative;
  background: #000;
  aspect-ratio: 4/3;
  overflow: hidden;
  flex-shrink: 0;
}

#video { width: 100%; height: 100%; object-fit: cover; display: block; }
#canvas { display: none; }

.camera-overlay { position: absolute; inset: 0; pointer-events: none; }

.corner { position: absolute; width: 30px; height: 30px; border-color: var(--gold); border-style: solid; }
.corner-tl { top: 16px; left: 16px; border-width: 2.5px 0 0 2.5px; }
.corner-tr { top: 16px; right: 16px; border-width: 2.5px 2.5px 0 0; }
.corner-bl { bottom: 16px; left: 16px; border-width: 0 0 2.5px 2.5px; }
.corner-br { bottom: 16px; right: 16px; border-width: 0 2.5px 2.5px 0; }

.scan-line {
  position: absolute;
  left: 16px; right: 16px;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  top: 16px;
  animation: scanMove 2.5s ease-in-out infinite;
  opacity: 0;
  transition: opacity .3s;
}
.scan-line.active { opacity: 1; }

@keyframes scanMove { 0%{top:16px} 50%{top:calc(100% - 16px)} 100%{top:16px} }

.camera-hint {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: rgba(255,255,255,.65);
  background: rgba(0,0,0,.5);
  padding: 4px 12px;
  border-radius: 20px;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.no-camera {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; height: 100%; gap: 12px; color: var(--muted);
}
.no-camera svg { width: 40px; height: 40px; opacity: .35; }
.no-camera p { font-size: 13px; text-align: center; padding: 0 2rem; }

/* ── Donut meter ────────────────────────────────────────────── */
.donut { width: 76px; height: 76px; flex-shrink: 0; }
.donut svg { width: 100%; height: 100%; }

/* ── Total card ─────────────────────────────────────────────── */
.total-card {
  background: var(--surface);
  border: 0.5px solid var(--border2);
  border-radius: var(--r);
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.total-label { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.total-val {
  font-family: var(--fd);
  font-size: 2.4rem;
  color: var(--text);
  line-height: 1;
}
.total-val span { font-size: 14px; font-family: var(--fb); color: var(--muted); }
.total-conf { font-size: 12px; color: var(--muted); margin-top: 5px; }

/* ── Logout link ────────────────────────────────────────────── */
.logout-link {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 20px;
  border: 0.5px solid var(--border2);
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.logout-link:hover { color: var(--danger); border-color: var(--danger); }

/* ── Animations ─────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

/* ── Desktop tweaks (rare) ──────────────────────────────────── */
@media (min-width: 640px) {
  .auth-page { padding: 2rem; }
  .site-header { padding: 1rem 2rem; }
  .section { padding: 1.5rem 2rem; }
  .camera-zone { max-height: 480px; }
}

@media (min-width: 960px) {
  body { max-width: 480px; margin: 0 auto; border-left: 0.5px solid var(--border); border-right: 0.5px solid var(--border); }
}

/* ── Recettes ───────────────────────────────────────────────── */
.recipe-header {
  padding: 1.25rem;
  background: var(--surface2);
  border-bottom: 0.5px solid var(--border2);
}

.recipe-name {
  font-family: var(--fd);
  font-size: 1.3rem;
  color: var(--text);
  margin-bottom: .35rem;
}

.recipe-desc {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.55;
  margin-bottom: .85rem;
}

.recipe-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.recipe-macros {
  display: flex;
  border-bottom: 0.5px solid var(--border2);
}

.recipe-macro-cell {
  flex: 1;
  padding: 12px;
  text-align: center;
  border-right: 0.5px solid var(--border);
}

.recipe-macro-cell:last-child { border-right: none; }

.recipe-macro-val {
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
}

.recipe-macro-lbl {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.recipe-body { padding: 1rem 1.25rem; }

.recipe-ingredient-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 0.5px solid var(--border);
  font-size: 14px;
}

.recipe-ingredient-row:last-child { border-bottom: none; }
.recipe-ingredient-name  { color: var(--text); }
.recipe-ingredient-qty   { color: var(--muted); flex-shrink: 0; margin-left: 8px; }

.recipe-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 0.5px solid var(--border);
}

.recipe-step:last-child { border-bottom: none; }

.recipe-step-num {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--gold-dim);
  border: 0.5px solid var(--gold-bdr);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 12px; font-weight: 500;
  color: var(--gold);
}

.recipe-step-text {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.6;
  padding-top: 2px;
}

/* ── Tags ingrédients ───────────────────────────────────────── */
.ing-suggestion {
  background: var(--bg3);
  border: 0.5px solid var(--border2);
  color: var(--text2);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  font-family: var(--fb);
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

.ing-suggestion:hover,
.ing-suggestion:active {
  background: var(--gold-dim);
  border-color: var(--gold-bdr);
  color: var(--gold);
}

/* ── Bloquer le scroll horizontal ───────────────────────────── */
html, body {
  overflow-x: hidden;
  overscroll-behavior-x: none;
  touch-action: pan-y;
}

/* ── Logo texte image ───────────────────────────────────────── */
.logo-wrap img[alt="Kilo Bye Bye"] + img {
  height: 20px;
  width: auto;
  display: block;
}

/* ── Empêcher les graphiques de déborder horizontalement ────── */
.chart-wrap {
  overflow: hidden;
  max-width: 100%;
  width: 100%;
}

.chart-wrap canvas {
  max-width: 100% !important;
}

/* ── Empêcher les selects de déborder sur mobile ────────────── */
.field select {
  max-width: 100%;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Page settings — forcer le conteneur à ne pas déborder */
#page-settings {
  overflow-x: hidden;
  max-width: 100vw;
}

#page-settings .section {
  max-width: 100%;
  overflow-x: hidden;
}

/* ── Bloquer le rebond horizontal sur toutes les pages ──────── */
html, body, .page, .section, .settings-wrap {
  overscroll-behavior-x: none;
  overscroll-behavior: contain;
  touch-action: pan-y pinch-zoom;
}

/* ── Forcer le contenu dynamique à ne pas déborder ─────────── */
#goalInfo, #settingsResult, #dayDetail {
  overflow-x: hidden;
  max-width: 100%;
  word-break: break-word;
}

.info-block {
  overflow-x: hidden;
  max-width: 100%;
  word-break: break-word;
}

/* ── Verrou absolu scroll horizontal ────────────────────────── */
* {
  max-width: 100vw;
}

.legal-page{
    max-width:900px;
    margin:30px auto;
    padding:25px;
    background:#1b1b1b;
    border-radius:16px;
    color:#fff;
}

.legal-page h1{
    color:#55d66b;
    margin-bottom:25px;
}

.legal-page h2{
    color:#55d66b;
    margin-top:25px;
}

.legal-page p,
.legal-page li{
    line-height:1.7;
}