/* Le Bon Compromis · Objectifs
   Charte : noir OLED + bleu du logo LBC. Une seule apparence (sombre), pensée pour les écrans OLED. */
:root {
  --bg: #000000;
  --surface: #0D0F14;
  --surface-2: #171A21;
  --surface-3: #20242D;
  --ink: #F4F6FA;
  --muted: #8B93A2;
  --line: #23272F;
  --brand: #2F6BFF;
  --brand-2: #5B8CFF;
  --brand-deep: #0040E6;
  --brand-ink: #FFFFFF;
  --brand-soft: #0E1D47;
  --gold: #F2B544;
  --gold-2: #FFD978;
  --gold-soft: #2A1F07;
  --flame: #FF7A2F;
  --flame-soft: #2C1408;
  --good: #34C77B;
  --good-soft: #0D2A1B;
  --danger: #FF5A4F;
  /* Courbes des graphiques : Débutant (corail, pointillé), Moyen (blanc), Expert (or) */
  --line-beg: #FF6B8A;
  --line-avg: #E9EDF3;
  --line-exp: #F2B544;
  --shadow: 0 12px 40px rgb(0 0 0 / 0.7);
  --glow: 0 0 0 1px rgb(47 107 255 / 0.35), 0 8px 30px rgb(47 107 255 / 0.35);
  --bar-bg: rgb(0 0 0 / 0.86);
  --plan-from: #0B1A44;
  --plan-border: #1A2C5E;
  --plan-big: #FFFFFF;
  --plan-big-shadow: 0 0 24px rgb(47 107 255 / 0.6);
  --placeholder: #5C6575;
  --font-display: "Montserrat", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --radius: 18px;
  --tabbar-h: 64px;
  color-scheme: dark;
}
/* Thème clair (au choix dans Objectif → Préférences) */
:root[data-theme="light"] {
  --bg: #F3F5F9;
  --surface: #FFFFFF;
  --surface-2: #EEF1F6;
  --surface-3: #E1E6EE;
  --ink: #0B1220;
  --muted: #5A6475;
  --line: #DCE2EB;
  --brand: #2F6BFF;
  --brand-2: #2556E8;
  --brand-deep: #0040E6;
  --brand-soft: #E2EAFF;
  --gold: #C98A0B;
  --gold-2: #F4C54F;
  --gold-soft: #FFF2D2;
  --flame: #EE6317;
  --flame-soft: #FFE8DA;
  --good: #1B9A57;
  --good-soft: #DCF4E7;
  --danger: #DC3F35;
  --line-beg: #E0466A;
  --line-avg: #1B2433;
  --line-exp: #D08C00;
  --shadow: 0 12px 40px rgb(15 30 60 / 0.18);
  --glow: 0 6px 20px rgb(47 107 255 / 0.3);
  --bar-bg: rgb(255 255 255 / 0.88);
  --plan-from: #E6EEFF;
  --plan-border: #C8D7FF;
  --plan-big: #0B1220;
  --plan-big-shadow: none;
  --placeholder: #A3ACBA;
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 15px; line-height: 1.5;
  overscroll-behavior-y: none;
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; text-wrap: balance; margin: 0; font-weight: 800; }
p { margin: 0; }
img { max-width: 100%; }
a, button, input, select, label, summary { touch-action: manipulation; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.gutter {
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.hint { font-size: 13.5px; color: var(--muted); }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

/* ---------- Barre du haut ---------- */
.appbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--bar-bg); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
}
.appbar-inner { max-width: 1080px; margin: 0 auto; display: flex; align-items: center; gap: 12px; min-height: 60px; padding-block: 8px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand-mark { width: 38px; height: 38px; flex: none; border-radius: 9px; box-shadow: 0 0 18px rgb(47 107 255 / 0.45); }
.wordmark { font-family: var(--font-display); font-weight: 800; font-size: 15.5px; letter-spacing: 0.01em; white-space: nowrap; }
.wordmark .wm-le { font-weight: 300; }
.wordmark i { font-style: normal; color: var(--brand); }
.icon-btn {
  flex: none; width: 44px; height: 44px; margin-right: -6px; border-radius: 12px; display: grid; place-items: center;
  color: var(--muted); text-decoration: none;
}
.icon-btn svg { width: 23px; height: 23px; }
.icon-btn[aria-current="page"] { color: var(--brand-2); background: var(--brand-soft); }
.icon-btn:active { transform: scale(0.94); }
.demo-pill { margin-left: auto; font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand-2); border: 1px solid var(--brand-soft); background: var(--brand-soft); padding: 3px 9px; border-radius: 99px; }

/* ---------- Barre d'onglets (en bas sur téléphone) ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--bar-bg); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: var(--tabbar-h); text-decoration: none; color: var(--muted);
  font-size: 11.5px; font-weight: 600; user-select: none; -webkit-user-select: none;
}
.tabbar .ico { display: grid; place-items: center; width: 56px; height: 30px; border-radius: 15px; transition: background .2s; }
.tabbar svg { width: 23px; height: 23px; }
.tabbar a[aria-current="page"] { color: var(--ink); }
.tabbar a[aria-current="page"] .ico { background: var(--brand); color: #fff; }

main { max-width: 1080px; margin: 0 auto; padding-top: 18px; padding-bottom: calc(var(--tabbar-h) + 32px + env(safe-area-inset-bottom, 0px)); }
.view { display: flex; flex-direction: column; gap: 16px; }
.foot { text-align: center; font-size: 12px; color: var(--muted); margin-top: 24px; opacity: 0.7; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2, .card > h2 { font-size: 17px; font-weight: 700; }
.source { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.source .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.source .dot.manual { background: var(--gold); }
.section-intro { display: flex; flex-direction: column; gap: 4px; }
.section-intro h1, .hello h1 { font-size: clamp(24px, 6.4vw, 32px); letter-spacing: -0.02em; }
.hello { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.hello-text { min-width: 0; }
.hello p { color: var(--muted); font-size: 14px; }

/* ---------- Boutons ---------- */
button:active, .streak-chip:active { transform: scale(0.97); }
.btn-primary {
  width: 100%; min-height: 54px; border: 0; border-radius: 14px;
  background: linear-gradient(135deg, var(--brand-2), var(--brand-deep)); color: #fff; font-weight: 700; font-size: 16px;
  box-shadow: 0 6px 24px rgb(47 107 255 / 0.35);
}
.btn-ghost { min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); font-weight: 600; }
.btn-danger { min-height: 44px; padding: 0 16px; border: 0; border-radius: 12px; background: var(--danger); color: #fff; font-weight: 600; }
.btn-link { min-height: 44px; border: 0; background: none; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; font-size: 14px; }

/* ---------- Série (puce) ---------- */
.streak-chip {
  flex: none; display: inline-flex; align-items: center; gap: 5px; min-height: 40px; padding: 0 14px 0 10px;
  border-radius: 99px; background: var(--flame-soft); color: var(--flame); text-decoration: none;
  font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; border: 1px solid rgb(255 122 47 / 0.25);
}
.streak-chip svg { width: 19px; height: 19px; }
.streak-chip.off { background: var(--surface-2); color: var(--muted); border-color: var(--line); }

/* ---------- Accueil ---------- */
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.today { display: flex; flex-direction: column; }
.ring-wrap { position: relative; width: min(210px, 62vw); aspect-ratio: 1; max-width: 100%; margin: 2px auto 0; }
.ring-wrap svg { width: 100%; height: 100%; transform: rotate(-90deg); display: block; overflow: visible; }
.ring-track { stroke: var(--surface-3); }
.ring-fill { stroke: url(#ring-grad); filter: drop-shadow(0 0 6px rgb(47 107 255 / 0.6)); transition: stroke-dashoffset .45s cubic-bezier(.2,.8,.2,1); }
.ring-wrap.done .ring-fill { stroke: var(--good); filter: drop-shadow(0 0 6px rgb(52 199 123 / 0.6)); }
.ring-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-center b { font-family: var(--font-display); font-weight: 800; font-size: clamp(46px, 14vw, 60px); line-height: 1; letter-spacing: -0.03em; display: inline-block; }
.ring-center span { font-size: 14px; color: var(--muted); font-weight: 500; margin-top: 4px; }
.bump { animation: bump .28s ease; }
@keyframes bump { 45% { transform: scale(1.15); } }
.today-msg { margin-top: 12px; text-align: center; font-size: 14.5px; color: var(--muted); min-height: 1.5em; }
.today-msg.done { color: var(--good); font-weight: 600; }
.today-msg b { color: var(--flame); }
.stepper { display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 10px; margin-top: 14px; }
.btn-minus, .btn-plus { min-height: 64px; border-radius: 16px; user-select: none; -webkit-user-select: none; }
.btn-minus { background: var(--surface-2); border: 1px solid var(--line); font-size: 28px; font-weight: 500; line-height: 1; }
.btn-plus { background: linear-gradient(135deg, var(--brand-2), var(--brand-deep)); color: #fff; border: 0; font-size: 18px; font-weight: 700; box-shadow: var(--glow); }

.bar { height: 10px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-deep), var(--brand-2)); border-radius: 99px; transition: width .4s ease; }
.bar.done i { background: var(--good); }
.goals { display: flex; flex-direction: column; gap: 18px; }
.goal-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 7px; }
.goal-top .name { font-weight: 600; min-width: 0; }
.goal-top .val { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.goal-top .val small { color: var(--muted); font-weight: 500; font-size: 13px; }
.goal-foot { display: flex; justify-content: space-between; gap: 4px 10px; margin-top: 6px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }

/* Valider la journée */
.btn-validate {
  margin-top: 10px; min-height: 52px; border-radius: 14px; border: 1.5px solid var(--line); background: transparent;
  color: var(--ink); font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-validate svg { width: 18px; height: 18px; color: var(--good); }
.closed-row {
  margin-top: 10px; min-height: 52px; border-radius: 14px; background: var(--good-soft); color: var(--good);
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 6px 0 14px; font-weight: 700;
}
.closed-row span { display: inline-flex; align-items: center; gap: 8px; }
.closed-row svg { width: 18px; height: 18px; }
.closed-row .btn-link { color: var(--good); }
.stepper.locked button { opacity: 0.35; pointer-events: none; box-shadow: none; }

/* Mois : bascule Réalisé / Restant */
.month-head { align-items: flex-start; }
.month-head h2 { font-size: 17px; font-weight: 700; }
.seg { display: flex; background: var(--surface-2); padding: 3px; border-radius: 11px; border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; color: var(--muted); min-height: 36px; padding: 0 12px; border-radius: 8px; font-weight: 600; font-size: 13px; }
.seg button[aria-pressed="true"] { background: var(--brand); color: #fff; }
.goal-top .val.big { font-family: var(--font-display); font-weight: 800; font-size: 17px; }
.goal-top .val.ok { color: var(--good); }
/* Vue « Restant » : teinte orange pour la distinguer de « Réalisé » (bleu) */
.seg button[data-view="left"][aria-pressed="true"] { background: var(--flame); }
#m-goals.left .bar i { background: linear-gradient(90deg, #D9480F, var(--flame)); }
#m-goals.left .bar.done i { background: var(--good); }
#m-goals.left .val.big:not(.ok) { color: var(--flame); }
#m-goals.left .val.big small { color: var(--muted); font-family: var(--font-body); font-weight: 500; }

.demo-card { border-style: dashed; display: flex; flex-direction: column; gap: 4px; }
.demo-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.demo-actions .btn-ghost { min-height: 50px; }

/* ---------- Progression ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 16px; height: 0; border-top: 2.5px solid; flex: none; }
.sw.beg { border-color: var(--line-beg); border-top-style: dashed; border-top-width: 3px; }
.sw.avg { border-color: var(--line-avg); }
.sw.exp { border-color: var(--line-exp); }
.sw.you { width: 11px; height: 11px; border: 0; border-radius: 3px; background: var(--brand); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chips button {
  flex: none; min-height: 42px; padding: 0 16px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 14px; white-space: nowrap;
}
.chips button[aria-selected="true"] { background: var(--brand); color: #fff; border-color: var(--brand); }
.carousel {
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; overscroll-behavior-x: contain; scroll-behavior: smooth;
}
.carousel::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: start; scroll-snap-stop: always; }
.slide h2 { font-size: 17px; font-weight: 700; }
.chart-wrap { margin-top: 10px; min-height: 200px; }
.chart-wrap svg { display: block; width: 100%; height: auto; user-select: none; -webkit-user-select: none; }
.hit { cursor: pointer; }
.ax { fill: var(--muted); font-family: var(--font-body); }
.grid { stroke: var(--line); stroke-width: 1; }
.detail-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 12px; font-weight: 600; flex-wrap: wrap; }
.detail { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.detail > div { background: var(--surface-2); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.detail .k { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.detail .v { font-weight: 700; font-size: 14.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: var(--brand-soft); color: var(--brand-2); }
.chip.good { background: var(--good-soft); color: var(--good); }
.chip.acc { background: var(--gold-soft); color: var(--gold); }
.verdict { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }
.verdict b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- Trophées ---------- */
.trophy-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.streak-top { display: flex; align-items: center; gap: 14px; }
.flame-big { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; background: var(--flame-soft); color: var(--flame); flex: none; box-shadow: 0 0 24px rgb(255 122 47 / 0.25); }
.flame-big svg { width: 34px; height: 34px; }
.flame-big.off { background: var(--surface-2); color: var(--muted); box-shadow: none; }
.streak-text { display: flex; flex-direction: column; }
.streak-text b { font-family: var(--font-display); font-weight: 800; font-size: 24px; letter-spacing: -0.02em; }
.streak-text span { color: var(--muted); font-size: 13.5px; }
.week-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin: 16px 0 10px; }
.day { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.day i { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); font-style: normal; font-size: 11px; }
.day i svg { width: 16px; height: 16px; }
.day.met i { background: var(--flame); color: #fff; box-shadow: 0 0 12px rgb(255 122 47 / 0.45); }
.day.today i { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--brand); }
.day.future i { background: transparent; border: 1.5px dashed var(--line); }
.day.rest i { background: transparent; border: 1.5px solid var(--line); }
.day.met.today i { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--flame); }

.badges { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.badge {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  min-height: 112px; padding: 12px 6px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2);
  font-size: 12.5px; font-weight: 600; line-height: 1.25;
}
.badge .b-ico { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, var(--gold-2), var(--gold) 70%); color: #2A1B03; box-shadow: 0 0 18px rgb(242 181 68 / 0.35); }
.badge .b-ico svg { width: 24px; height: 24px; }
.badge.locked { color: var(--muted); background: var(--surface); }
.badge.locked .b-ico { background: var(--surface-3); color: var(--muted); box-shadow: none; }

/* ---------- Objectif (formulaire + plan) ---------- */
.onb { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.onb-form { display: flex; flex-direction: column; gap: 20px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label, .field > legend, .label { font-weight: 600; font-size: 14px; padding: 0; }
fieldset.field > legend { margin-bottom: 7px; }
.legend-note { font-weight: 500; color: var(--muted); margin-left: 4px; }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
input[type="text"], select, .money input {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; width: 100%; min-height: 50px;
}
input[type="text"]:focus, select:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px rgb(47 107 255 / 0.25); }
input::placeholder { color: var(--placeholder); }
select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 40px; }
.money { position: relative; }
.money input { padding-right: 96px; font-family: var(--font-display); font-weight: 800; font-size: 24px; min-height: 58px; }
.money span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; pointer-events: none; }
.regimes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.regime, .rate, .dayopt { position: relative; }
.regime input, .rate input, .dayopt input { position: absolute; opacity: 0; pointer-events: none; }
.regime label {
  display: flex; flex-direction: column; gap: 2px; min-height: 70px; justify-content: center;
  border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; cursor: pointer; height: 100%; background: var(--bg);
}
.regime label strong { font-size: 15px; }
.regime label span { font-size: 13px; color: var(--muted); }
.regime input:checked + label { border-color: var(--brand); background: var(--brand-soft); }
.rates, .days { display: grid; gap: 6px; }
.rates { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.days { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.rate label, .dayopt label {
  display: flex; align-items: center; justify-content: center; min-height: 50px; border: 1.5px solid var(--line); border-radius: 12px;
  font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; cursor: pointer; user-select: none; -webkit-user-select: none; background: var(--bg);
}
.rate label small { font-size: 11px; font-weight: 600; margin-left: 1px; }
.rate input:checked + label, .dayopt input:checked + label { background: var(--brand); border-color: var(--brand); color: #fff; }
.regime input:focus-visible + label, .rate input:focus-visible + label, .dayopt input:focus-visible + label { outline: 2px solid var(--brand-2); outline-offset: 2px; }

.plan-card { display: flex; flex-direction: column; gap: 14px; background: linear-gradient(160deg, var(--plan-from), var(--surface) 60%); border-color: var(--plan-border); }
.plan-big { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.plan-big b { font-family: var(--font-display); font-weight: 800; font-size: 52px; line-height: 1; letter-spacing: -0.03em; color: var(--plan-big); text-shadow: var(--plan-big-shadow); }
.plan-big span { color: var(--muted); }
.chain { display: grid; grid-template-columns: minmax(0, 1fr); }
.step {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; grid-template-areas: "n l v" "n r v";
  column-gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line);
}
.step .n { grid-area: n; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.step .l { grid-area: l; font-weight: 600; }
.step .r { grid-area: r; font-size: 12.5px; color: var(--muted); }
.step .v { grid-area: v; font-family: var(--font-display); font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.step.key .v { color: var(--brand-2); }
.warn { font-size: 13px; background: var(--gold-soft); color: var(--gold-2); border-radius: 10px; padding: 10px 12px; }
.hyp summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted); min-height: 32px; display: flex; align-items: center; }
.params { display: grid; grid-template-columns: minmax(0, 1fr); margin-top: 4px; }
.param { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.param span { color: var(--muted); }
.param b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.onb-submit { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.reset { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.reset-confirm { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; text-align: center; font-size: 14px; }
.reset-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* Réglages */
.back-btn {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 2px; min-height: 40px; margin-left: -8px; padding: 0 10px 0 4px;
  border: 0; background: none; color: var(--brand-2); font-weight: 600; font-size: 15px;
}
.back-btn svg { width: 22px; height: 22px; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.install-card { display: flex; flex-direction: column; gap: 14px; }
.install-head { display: flex; align-items: center; gap: 14px; }
.install-head img { border-radius: 12px; flex: none; }
.install-head h2 { font-size: 17px; font-weight: 700; }
.install-steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; counter-reset: s; }
.install-steps li { display: flex; align-items: center; gap: 12px; font-size: 14.5px; }
.install-steps li::before {
  counter-increment: s; content: counter(s); flex: none; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface-3); color: var(--muted); font-size: 12px; font-weight: 700;
}
.install-steps svg { width: 18px; height: 18px; vertical-align: -3px; color: var(--brand-2); }
.installed { display: flex; align-items: center; gap: 8px; color: var(--good); font-weight: 600; }
.installed svg { width: 18px; height: 18px; }

/* Préférences */
.prefs { display: flex; flex-direction: column; gap: 4px; }
.prefs h2 { font-size: 16px; margin-bottom: 4px; }
.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 56px; cursor: pointer; }
.switch-row + .switch-row { border-top: 1px solid var(--line); }
.switch-row span { display: flex; flex-direction: column; }
.switch-row small { color: var(--muted); font-size: 12.5px; }
input[role="switch"] {
  appearance: none; -webkit-appearance: none; flex: none; width: 50px; height: 30px; border-radius: 99px; margin: 0;
  background: var(--surface-3); border: 1px solid var(--line); position: relative; cursor: pointer; transition: background .2s;
}
input[role="switch"]::after { content: ""; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 0.4); transition: transform .2s; }
input[role="switch"]:checked { background: var(--brand); border-color: var(--brand); }
input[role="switch"]:checked::after { transform: translateX(20px); }

/* ---------- Feuille de célébration ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center;
  background: rgb(0 0 0 / 0.72); animation: fade .2s ease;
}
.sheet {
  width: 100%; max-width: 480px; background: var(--surface); border: 1px solid var(--line); border-bottom: 0; border-radius: 26px 26px 0 0;
  padding: 30px max(20px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
  box-shadow: var(--shadow); animation: rise .38s cubic-bezier(.2,.9,.25,1.15);
}
.sheet h2 { font-size: 25px; letter-spacing: -0.02em; }
.sheet .eyebrow { color: var(--brand-2); margin-top: 10px; }
.sheet-text { color: var(--muted); max-width: 34ch; }
.sheet .btn-primary { margin-top: 18px; }
.medal {
  width: 100px; height: 100px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, var(--gold-2), var(--gold) 70%); color: #2A1B03;
  box-shadow: 0 0 0 8px rgb(242 181 68 / 0.15), 0 0 50px rgb(242 181 68 / 0.45);
  animation: pop .55s cubic-bezier(.2,.9,.3,1.4);
}
.medal svg { width: 48px; height: 48px; }
.medal.flame { background: radial-gradient(circle at 35% 30%, #FFB27A, var(--flame) 70%); color: #fff; box-shadow: 0 0 0 8px rgb(255 122 47 / 0.15), 0 0 50px rgb(255 122 47 / 0.5); }
.medal.blue { background: radial-gradient(circle at 35% 30%, var(--brand-2), var(--brand-deep) 75%); color: #fff; box-shadow: 0 0 0 8px rgb(47 107 255 / 0.18), 0 0 50px rgb(47 107 255 / 0.55); }
.medal.locked { background: var(--surface-3); color: var(--muted); box-shadow: none; animation: none; }
@keyframes rise { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { 0% { transform: scale(0.3) rotate(-20deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 70; }

/* ---------- Bandeau d'installation et notification ---------- */
.install {
  position: fixed; z-index: 40;
  left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px));
  bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 12px; padding: 12px 8px 12px 12px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
  max-width: 520px; margin: 0 auto;
}
.install-icon img { display: block; border-radius: 10px; }
.install-text { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.4; }
.install-text b { display: block; font-size: 14.5px; }
.btn-install { min-height: 40px; padding: 0 14px; border: 0; border-radius: 10px; background: var(--brand); color: #fff; font-weight: 700; }
.install-close { width: 40px; height: 40px; border: 0; background: none; font-size: 24px; color: var(--muted); flex: none; }
.toast {
  position: fixed; z-index: 50; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + 20px + env(safe-area-inset-bottom, 0px));
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 14px;
  box-shadow: var(--shadow); max-width: calc(100% - 32px);
}

/* ---------- Écrans larges (ordinateur, tablette) ---------- */
@media (min-width: 900px) {
  .tabbar {
    position: sticky; top: calc(60px + env(safe-area-inset-top, 0px)); bottom: auto;
    display: flex; justify-content: center; gap: 6px; padding: 8px 16px;
    border-top: 0; border-bottom: 1px solid var(--line);
  }
  .tabbar a { flex-direction: row; min-height: 42px; padding: 0 14px 0 6px; border-radius: 12px; font-size: 14px; gap: 4px; }
  .tabbar .ico { width: 32px; height: 30px; }
  .tabbar svg { width: 20px; height: 20px; }
  .tabbar a[aria-current="page"] { background: var(--brand); color: #fff; }
  .tabbar a[aria-current="page"] .ico { background: none; }
  main { padding-bottom: 48px; padding-top: 24px; }
  .home-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); }
  .chips { display: none; }
  .carousel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; overflow: visible; }
  .trophy-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: start; }
  .settings-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .badges { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .onb { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-areas: "form plan" "submit plan"; align-items: start; }
  .onb-form { grid-area: form; }
  .plan-card { grid-area: plan; position: sticky; top: 140px; }
  .onb-submit { grid-area: submit; }
  .sheet-backdrop { align-items: center; }
  .sheet { border-radius: 26px; border-bottom: 1px solid var(--line); padding-bottom: 24px; }
  .install, .toast { bottom: 24px; }
}
@media (max-width: 899px) {
  .detail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail > div { flex-direction: row; justify-content: space-between; align-items: center; padding: 10px 12px; }
}
@media (max-width: 400px) {
  .card { padding: 16px; }
  .rates, .days { gap: 5px; }
  .rate label, .dayopt label { font-size: 14px; }
  .wordmark { font-size: 14px; }
}
@media (max-width: 350px) {
  .regimes { grid-template-columns: minmax(0, 1fr); }
  .rates { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .badges { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wordmark .wm-le { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
