/* Élan : feuille de style unique. Mobile d'abord, clair et sombre, aucune dépendance externe.
   Identité : accent corail, eau bleue, feux doux (jamais de rouge d'alerte). */

:root {
  color-scheme: light;
  --fond: #faf6f1;
  --fond-haut: #fffcf9;
  --surface: #ffffff;
  --surface-2: #f6efe8;
  --surface-3: #ebe1d7;
  --encre: #231a16;
  --encre-2: #5c4f47;
  --encre-3: #7a6b61;
  --trait: #ece3da;
  --accent: #e0663a;
  --accent-fort: #b8441f;
  --accent-doux: #fdebe2;
  --bouton: #c9502a;
  --bouton-encre: #ffffff;
  --eau: #2a86d1;
  --eau-texte: #1d6fb3;
  --eau-doux: #e3f0fb;
  --leger: #3a9a5b;
  --equilibre: #d9a23a;
  --copieux: #c9766a;
  --bon: #2f8a5b;
  --bon-doux: #e3f3ea;
  --sable: #f8eedd;
  --ombre-1: 0 1px 2px rgba(60, 36, 20, .06), 0 1px 1px rgba(60, 36, 20, .03);
  --ombre-2: 0 10px 30px -12px rgba(60, 36, 20, .24), 0 2px 6px rgba(60, 36, 20, .05);
  --ombre-3: 0 24px 60px -20px rgba(30, 16, 8, .45);
  --rayon: 20px;
  --rayon-s: 14px;
  --police: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI",
    Inter, Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --police-titre: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display",
    "Segoe UI", Inter, Roboto, sans-serif;
  --haut-sur: env(safe-area-inset-top, 0px);
  --bas-sur: env(safe-area-inset-bottom, 0px);
  --largeur: 560px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="clair"]) {
    color-scheme: dark;
    --fond: #15110f;
    --fond-haut: #1b1613;
    --surface: #211b18;
    --surface-2: #2b2420;
    --surface-3: #3a312c;
    --encre: #f6efe9;
    --encre-2: #cdc1b7;
    --encre-3: #a3958a;
    --trait: #332a26;
    --accent: #f08a5d;
    --accent-fort: #f5a67f;
    --accent-doux: #3b2318;
    --bouton: #f08a5d;
    --bouton-encre: #2a1107;
    --eau: #5aa8e8;
    --eau-texte: #86bff0;
    --eau-doux: #172c3f;
    --leger: #5cc48a;
    --equilibre: #e3b05a;
    --copieux: #dd8f84;
    --bon: #5cc48a;
    --bon-doux: #183224;
    --sable: #3a2e18;
    --ombre-1: 0 1px 2px rgba(0, 0, 0, .4);
    --ombre-2: 0 12px 30px -12px rgba(0, 0, 0, .7), 0 2px 6px rgba(0, 0, 0, .3);
    --ombre-3: 0 24px 60px -20px rgba(0, 0, 0, .9);
  }
}

:root[data-theme="sombre"] {
    color-scheme: dark;
    --fond: #15110f;
    --fond-haut: #1b1613;
    --surface: #211b18;
    --surface-2: #2b2420;
    --surface-3: #3a312c;
    --encre: #f6efe9;
    --encre-2: #cdc1b7;
    --encre-3: #a3958a;
    --trait: #332a26;
    --accent: #f08a5d;
    --accent-fort: #f5a67f;
    --accent-doux: #3b2318;
    --bouton: #f08a5d;
    --bouton-encre: #2a1107;
    --eau: #5aa8e8;
    --eau-texte: #86bff0;
    --eau-doux: #172c3f;
    --leger: #5cc48a;
    --equilibre: #e3b05a;
    --copieux: #dd8f84;
    --bon: #5cc48a;
    --bon-doux: #183224;
    --sable: #3a2e18;
    --ombre-1: 0 1px 2px rgba(0, 0, 0, .4);
    --ombre-2: 0 12px 30px -12px rgba(0, 0, 0, .7), 0 2px 6px rgba(0, 0, 0, .3);
    --ombre-3: 0 24px 60px -20px rgba(0, 0, 0, .9);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--fond);
  color: var(--encre);
  font: 16px/1.45 var(--police);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--accent-fort); text-decoration: none; }
h1, h2, h3 { margin: 0; font-family: var(--police-titre); letter-spacing: -.01em; }
p { margin: 0 0 10px; }
.nombre { font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.cache { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
svg { flex: none; }

/* ---------------------------------------------------------------- coquille */

.appli { max-width: var(--largeur); margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
.entete {
  position: sticky; top: 0; z-index: 20;
  padding: calc(14px + var(--haut-sur)) 18px 12px;
  display: flex; align-items: center; gap: 12px;
  background: color-mix(in srgb, var(--fond) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
}
.entete h1 { font-size: 24px; font-weight: 750; flex: 1; min-width: 0; }
.entete .sous { display: block; font: 500 13px/1.2 var(--police); color: var(--encre-3); letter-spacing: 0; margin-bottom: 2px; }
.entete .retour {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); box-shadow: var(--ombre-1); flex: none;
}
.avatar-bouton { border-radius: 50%; min-width: 44px; min-height: 44px; display: grid; place-items: center; }
.contenu { flex: 1; padding: 4px 16px calc(120px + var(--bas-sur)); }
.vue { animation: apparait .28s cubic-bezier(.2, .8, .2, 1); }
@keyframes apparait { from { opacity: 0; transform: translateY(6px); } }

/* barre de navigation : collée au bas de l'écran sur téléphone */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: 1fr 1fr 76px 1fr 1fr; align-items: center;
  padding: 6px max(10px, calc((100% - 480px) / 2)) calc(6px + var(--bas-sur));
  border-radius: 22px 22px 0 0;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
  box-shadow: 0 -8px 24px -14px rgba(60, 36, 20, .25); border-top: 1px solid var(--trait);
}
.nav a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 7px 0 6px; border-radius: 18px; min-height: 52px;
  color: var(--encre-3); font-size: 11px; font-weight: 600;
  transition: color .15s, background .15s;
}
.nav a svg { width: 24px; height: 24px; }
.nav a.actif { color: var(--accent-fort); background: var(--accent-doux); }
.nav .plus {
  justify-self: center; width: 60px; height: 60px; margin-top: -26px; border-radius: 22px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(160deg, #f4986a, var(--accent) 55%, #c9502a);
  box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--accent) 70%, transparent), inset 0 1px 0 rgba(255, 255, 255, .3);
  transition: transform .15s;
}
.nav .plus svg { width: 30px; height: 30px; }
.nav .plus:active { transform: scale(.92); }

/* ---------------------------------------------------------------- briques */

.carte {
  background: var(--surface); border-radius: var(--rayon); padding: 18px;
  box-shadow: var(--ombre-1); margin-bottom: 14px; border: 1px solid color-mix(in srgb, var(--trait) 60%, transparent);
}
.carte > h2, .titre-section {
  font-size: 13px; font-weight: 700; color: var(--encre-3); text-transform: uppercase; letter-spacing: .06em;
  font-family: var(--police); margin: 0 0 12px; display: flex; align-items: center; justify-content: space-between;
}
.titre-section { margin: 22px 4px 10px; }
.mini-titre { font-size: 12.5px; font-weight: 700; color: var(--encre-3); text-transform: uppercase; letter-spacing: .05em; margin: 14px 2px 8px; }
.mini-titre.sans-marge { margin: 0 0 2px; }
.ligne { display: flex; align-items: center; gap: 12px; }
.ligne .etire, .etire { flex: 1; min-width: 0; }
.tete-carte { min-height: 48px; }
.titre { font-weight: 650; font-size: 15.5px; }
.detail { font-size: 13px; color: var(--encre-3); }
.muet { color: var(--encre-3); }
.doux { color: var(--encre-2); }
.petit { font-size: 13px; }
.centre { text-align: center; }
.espace { height: 10px; }
.pile { display: grid; gap: 8px; }
.sans-marge { margin: 0 !important; }

.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 16px;
  background: var(--bouton); color: var(--bouton-encre); font-weight: 650; font-size: 16px;
  transition: transform .12s, filter .15s, background .15s; user-select: none; text-align: center;
}
a.bouton { color: var(--bouton-encre); }
.bouton:active { transform: scale(.97); }
.bouton:disabled { opacity: .55; pointer-events: none; }
.bouton.plein { width: 100%; min-height: 56px; font-size: 17px; border-radius: 18px; }
.bouton.second { background: var(--surface-2); color: var(--encre); }
.bouton.leger { background: var(--accent-doux); color: var(--accent-fort); }
.bouton.petit { min-height: 44px; padding: 0 16px; font-size: 14.5px; border-radius: 14px; }
.bouton svg { width: 20px; height: 20px; }
.bouton.icone-seule { width: 56px; padding: 0; flex: none; }
.lien-discret {
  color: var(--encre-3); font-weight: 600; font-size: 14.5px; min-height: 44px; padding: 0 10px;
  display: inline-flex; align-items: center; gap: 6px; border-radius: 12px;
}
.lien-discret svg { width: 18px; height: 18px; }
.lien-discret:hover { color: var(--encre); }
.centre-bloc { justify-content: center; width: 100%; }
.icone-bouton { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--encre-3); flex: none; }
.icone-bouton svg { width: 20px; height: 20px; }
.rond-bouton {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--surface-2); color: var(--encre); transition: transform .12s;
}
.rond-bouton:active { transform: scale(.93); }
.rond-bouton:disabled { opacity: .35; }
.rond-bouton svg { width: 24px; height: 24px; }
.rond-bouton.grand { width: 72px; height: 72px; background: var(--bouton); color: var(--bouton-encre); }
.rond-bouton.grand svg { width: 32px; height: 32px; }

/* champs */
.champ { display: block; margin-bottom: 14px; }
.champ > span { display: block; font-size: 13px; font-weight: 600; color: var(--encre-2); margin: 0 4px 6px; }
.champ input, .champ select, .saisie-texte {
  width: 100%; min-height: 52px; padding: 0 16px; border-radius: 14px;
  background: var(--surface-2); border: 1.5px solid transparent; outline: none;
  font-size: 16px; transition: border-color .15s, background .15s;
}
.champ input:focus, .champ select:focus, .saisie-texte:focus { border-color: var(--accent); background: var(--surface); }
textarea.saisie-texte { padding: 12px 16px; resize: vertical; line-height: 1.4; }
.saisie-texte.court { width: 90px; flex: none; }
.saisie-texte.gros-champ { font: 800 34px var(--police-titre); text-align: center; min-height: 72px; }
.champ .aide, .aide { font-size: 13px; color: var(--encre-3); margin: 6px 4px 0; }
.grille-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* segments et pastilles de choix */
.segments { display: flex; padding: 4px; gap: 4px; border-radius: 16px; background: var(--surface-2); margin-bottom: 14px; }
.segments button {
  flex: 1; min-height: 44px; border-radius: 12px; font-weight: 600; font-size: 15px; color: var(--encre-2);
  transition: background .18s, color .18s, box-shadow .18s; padding: 0 6px;
}
.segments button.actif { background: var(--surface); color: var(--encre); box-shadow: var(--ombre-1); }
.segments.petits button { min-height: 36px; font-size: 13.5px; }
.puces { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.puces.sans-marge { margin-bottom: 0; }
.puce {
  min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--surface-2);
  font-size: 14.5px; font-weight: 600; color: var(--encre-2); display: inline-flex; align-items: center; gap: 7px;
  border: 1.5px solid transparent; transition: all .15s; max-width: 100%;
}
.puce svg { width: 16px; height: 16px; }
.puce .txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; }
.puce.actif { background: var(--accent-doux); color: var(--accent-fort); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.puce.refaire { background: var(--accent-doux); color: var(--accent-fort); }

/* avatars */
.avatar {
  --c: #888; width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 750; color: #fff; font-size: 16px;
  background: linear-gradient(150deg, color-mix(in srgb, var(--c) 75%, #fff), var(--c));
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25);
}
.avatar.grand { width: 72px; height: 72px; font-size: 30px; }

/* listes */
.liste { display: flex; flex-direction: column; }
.element {
  display: flex; align-items: center; gap: 12px; padding: 8px 4px; width: 100%; text-align: left; min-height: 56px;
  border-radius: 14px; transition: background .12s; color: inherit;
}
.element:active:not(.sans-action) { background: var(--surface-2); }
.element + .element, .ligne-reglage + .element, .element + .ligne-reglage, .ligne-reglage + .ligne-reglage { border-top: 1px solid var(--trait); border-radius: 0; }
.element .titre { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sans-action .titre { white-space: normal; }
.element .chevron { color: var(--encre-3); width: 18px; height: 18px; flex: none; }
.ico {
  width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; flex: none;
  background: var(--accent-doux); color: var(--accent-fort);
}
.ico svg { width: 22px; height: 22px; }
.ico.eau { background: var(--eau-doux); color: var(--eau-texte); }
.ico.bouger, .ico.bouge { background: var(--accent-doux); color: var(--accent-fort); }
.ico.repas { background: var(--bon-doux); color: var(--bon); }
.ico.poids { background: var(--sable); color: #8a5a12; }
.etiquette {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--encre-2);
}
.etiquette.bon { background: var(--bon-doux); color: var(--bon); }
.etiquette.neuf { background: var(--accent-doux); color: var(--accent-fort); margin-left: 8px; }

.encart { background: var(--accent-doux); color: var(--encre); border-radius: 16px; padding: 14px 16px; font-size: 14.5px; line-height: 1.5; margin-bottom: 14px; }
.encart.doux-alerte { background: var(--sable); }
.encart .ligne { align-items: flex-start; }
.encart svg { width: 22px; height: 22px; color: #8a5a12; margin-top: 1px; }
.vide { text-align: center; padding: 26px 10px; color: var(--encre-3); }
.vide .emoji { font-size: 40px; display: block; margin-bottom: 6px; }
.erreur { color: #a8402a; font-size: 14px; font-weight: 600; min-height: 22px; margin: 2px 0 10px; }

/* bloc replié : « Voir le détail » */
.detail-bloc { border-top: 1px solid var(--trait); margin-top: 6px; }
.detail-bloc summary {
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px;
  cursor: pointer; font-size: 14.5px; font-weight: 600; color: var(--accent-fort); user-select: none;
}
.detail-bloc summary::-webkit-details-marker { display: none; }
.detail-bloc summary svg { width: 18px; height: 18px; transition: transform .2s; }
.detail-bloc[open] summary svg { transform: rotate(180deg); }
.detail-corps { padding-bottom: 6px; animation: apparait .22s ease; }
.carte > .detail-bloc:first-child { border-top: 0; margin-top: 0; }

/* jauges */
.jauge { height: 10px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.jauge > i { display: block; height: 100%; border-radius: 99px; background: var(--accent); width: 0; transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.jauge.duo > i { background: linear-gradient(90deg, #d0607a, var(--accent), #3f7db8); }

/* interrupteur */
.ligne-reglage { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 4px; }
.interrupteur {
  width: 54px; height: 32px; border-radius: 99px; background: var(--surface-3); position: relative; flex: none;
  transition: background .2s; padding: 0;
}
.interrupteur i { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s; }
.interrupteur[aria-checked="true"] { background: var(--bouton); }
.interrupteur[aria-checked="true"] i { transform: translateX(22px); }
.interrupteur { min-height: 32px; }
.ligne-reglage::after { content: none; }

/* feux : jamais de rouge d'alerte */
.point-feu { --c: var(--surface-3); display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: var(--c); flex: none; }
.point-feu.leger { --c: var(--leger); }
.point-feu.equilibre { --c: var(--equilibre); }
.point-feu.copieux { --c: var(--copieux); }

.serie {
  display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 9px 0 7px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; background: var(--accent-doux); color: var(--accent-fort);
}
.serie svg { width: 14px; height: 14px; }

/* ---------------------------------------------------------------- Aujourd'hui */

.bandeaux { margin-bottom: 14px; display: grid; gap: 8px; }
.bandeau {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 18px;
  background: linear-gradient(120deg, var(--accent-doux), var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  animation: apparait .4s cubic-bezier(.2, .8, .2, 1);
}
.emoji-grand { font-size: 28px; line-height: 1; }
.emoji-grand.petit { font-size: 22px; width: 32px; text-align: center; }
.bandeau-suite { margin: 0 4px; }
.bandeau-ok { align-self: flex-end; min-height: 40px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; color: var(--accent-fort); font-weight: 700; font-size: 14px; }
.bandeau-ok svg { width: 18px; height: 18px; }
.bandeaux .bandeau-ok { margin-top: -2px; }

.hero-eau {
  position: relative; overflow: hidden; border: 0; color: #fff; box-shadow: var(--ombre-2); padding: 18px 18px 8px;
  background: radial-gradient(120% 90% at 100% 0%, rgba(255, 255, 255, .2), transparent 55%), linear-gradient(150deg, #3b9be0, #2a86d1 45%, #1d68ad);
}
.hero-eau::after { content: ""; position: absolute; right: -50px; bottom: -70px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255, 255, 255, .07); pointer-events: none; }
.hero-eau > * { position: relative; z-index: 1; }
.hero-eau .haut { display: flex; align-items: center; justify-content: space-between; min-height: 30px; }
.etiquette-hero { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; opacity: .95; }
.etiquette-hero svg { width: 20px; height: 20px; }
.hero-eau .serie { background: rgba(255, 255, 255, .22); color: #fff; }
.hero-eau .valeur { display: flex; align-items: baseline; gap: 8px; margin: 6px 0 10px; }
.hero-eau .gros { font: 800 46px/1 var(--police-titre); letter-spacing: -.02em; display: inline-block; }
.hero-eau .gros.pop { animation: pop .35s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes pop { 40% { transform: scale(1.12); } }
.hero-eau .sur { font-size: 18px; font-weight: 600; opacity: .85; }
.hero-eau .jauge { background: rgba(255, 255, 255, .28); height: 12px; }
.hero-eau .jauge > i { background: #fff; }
.hero-eau .phrase { font-size: 14px; opacity: .92; margin: 8px 0 14px; }
.hero-eau .actions { display: flex; gap: 10px; }
.hero-eau .bouton { background: #fff; color: #17588f; min-height: 56px; font-size: 17px; border-radius: 18px; }
.hero-eau .gros-ajout { flex: 1; font-size: 20px; }
.hero-eau .gros-ajout svg { width: 24px; height: 24px; }
.hero-eau .bouton.verre { background: rgba(255, 255, 255, .2); color: #fff; padding: 0 18px; font-size: 16px; }
.liens-hero { display: flex; justify-content: space-between; margin: 2px -6px 0; }
.liens-hero button { min-height: 44px; padding: 0 8px; font-size: 13.5px; font-weight: 600; color: rgba(255, 255, 255, .88); }
.hero-eau .detail-bloc { border-top-color: rgba(255, 255, 255, .22); margin-top: 0; }
.hero-eau .detail-bloc summary { color: rgba(255, 255, 255, .9); min-height: 44px; }
.hero-eau .element { border-color: rgba(255, 255, 255, .18) !important; }
.hero-eau .element .detail { color: rgba(255, 255, 255, .75); }
.hero-eau .icone-bouton { color: rgba(255, 255, 255, .85); }

.pastilles-repas { display: flex; justify-content: space-between; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.pastille-repas { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 56px; min-height: 64px; padding: 2px; border-radius: 14px; flex: 1; }
.pastille-repas .rond {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); color: var(--encre-3); border: 2px dashed var(--surface-3); transition: transform .12s;
}
.pastille-repas:active .rond { transform: scale(.92); }
.pastille-repas .rond svg { width: 20px; height: 20px; }
.pastille-repas.note .rond { border: 2px solid var(--surface-3); background: var(--surface); color: var(--bon); }
.pastille-repas .point-feu { width: 22px; height: 22px; }
.pastille-repas .nom { font-size: 12px; font-weight: 600; color: var(--encre-3); }
.ligne-kcal { margin-top: 1px; white-space: nowrap; }

.coche-ronde { width: 32px; height: 32px; border-radius: 50%; background: var(--bon-doux); color: var(--bon); display: grid; place-items: center; flex: none; }
.coche-ronde svg { width: 18px; height: 18px; }
.ligne.fait { margin-top: 4px; min-height: 40px; }
.minimum { margin-top: 6px; }
.liens-carte { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 6px; }
.liens-carte a { font-size: 14px; font-weight: 600; min-height: 36px; display: inline-flex; align-items: center; }
.lien-ligne { display: block; color: inherit; min-height: 44px; }
.bouton-clap {
  width: 52px; height: 52px; border-radius: 50%; font-size: 26px; background: var(--accent-doux); flex: none;
  display: grid; place-items: center; transition: transform .15s;
}
.bouton-clap:active { transform: scale(.88) rotate(-8deg); }
.bouton-clap.envoye { animation: pop .5s cubic-bezier(.2, .9, .3, 1.4); background: var(--bon-doux); }
.lien-envie { text-align: center; margin: 4px 0 8px; }
.lien-envie .lien-discret { font-size: 14px; }
.pente { color: var(--encre-3); font-weight: 600; }

/* ---------------------------------------------------------------- feuilles */

.voile {
  position: fixed; inset: 0; z-index: 50; background: rgba(24, 12, 6, .45);
  animation: fondu .2s ease; display: flex; align-items: flex-end; justify-content: center;
}
.voile.ferme { animation: fondu-sortie .2s ease forwards; }
.feuille {
  width: 100%; max-width: var(--largeur); max-height: calc(100dvh - 24px - var(--haut-sur));
  background: var(--fond-haut); border-radius: 28px 28px 0 0; box-shadow: var(--ombre-3);
  display: flex; flex-direction: column; animation: monte .34s cubic-bezier(.2, .9, .25, 1);
}
.voile.ferme .feuille { animation: descend .22s ease forwards; }
.feuille .poignee { width: 40px; height: 5px; border-radius: 9px; background: var(--surface-3); margin: 10px auto 4px; flex: none; }
.feuille .tete { display: flex; align-items: center; gap: 10px; padding: 6px 18px 10px; flex: none; }
.feuille .tete h2 { flex: 1; font-size: 20px; }
.feuille .fermer { width: 44px; height: 44px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; color: var(--encre-2); }
.feuille .corps { overflow-y: auto; padding: 4px 18px 16px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.feuille .pied { padding: 10px 18px calc(14px + var(--bas-sur)); flex: none; border-top: 1px solid var(--trait); background: var(--fond-haut); }
@media (min-width: 620px) {
  .voile { align-items: center; }
  .feuille { border-radius: 28px; max-height: min(860px, calc(100dvh - 60px)); }
  .feuille .poignee { display: none; }
}
@keyframes fondu { from { opacity: 0; } }
@keyframes fondu-sortie { to { opacity: 0; } }
@keyframes monte { from { transform: translateY(100%); } }
@keyframes descend { to { transform: translateY(100%); } }

.ligne-pied { display: flex; gap: 10px; }
.ligne-pied .bouton.plein { flex: 1; }

/* eau */
.grille-quantites { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.quantite {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 84px; border-radius: 18px;
  background: var(--eau-doux); color: var(--eau-texte); transition: transform .12s;
}
.quantite:active { transform: scale(.95); }
.quantite svg { width: 20px; height: 20px; }
.quantite strong { font: 750 17px var(--police-titre); }
.quantite small { font-size: 11.5px; opacity: .85; }
.quantite.phare { background: #2a86d1; color: #fff; }
.ligne-libre { display: flex; gap: 10px; }
.ligne-libre .bouton { flex: none; }

/* pesée */
.selecteur-poids { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 10px 0 8px; }
.selecteur-poids .boite { display: inline-flex; align-items: baseline; gap: 6px; }
.poids-saisie {
  width: 5.2ch; border: 0; outline: none; background: none; text-align: right; padding: 0;
  font: 800 54px/1.1 var(--police-titre); letter-spacing: -.03em; font-variant-numeric: tabular-nums; caret-color: var(--accent);
}
.selecteur-poids .unite { font: 700 26px var(--police-titre); color: var(--encre-3); }

/* repas */
.moments { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 4px; border-radius: 16px; background: var(--surface-2); margin-bottom: 8px; }
.moments button { min-height: 44px; border-radius: 12px; font-weight: 600; font-size: 13.5px; color: var(--encre-2); transition: background .18s; padding: 0 2px; }
.moments button.actif { background: var(--surface); color: var(--encre); box-shadow: var(--ombre-1); }
.suggestions .mini-titre { margin-top: 8px; }
.suggestions .puces { margin: 0 -18px 6px 0; padding-right: 18px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.suggestions .puces::-webkit-scrollbar { display: none; }
.suggestions .puce { flex: none; }
.feux { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.feu-bouton {
  --c: var(--leger); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 4px 10px; border-radius: 18px;
  background: var(--surface); border: 1.5px solid var(--trait); min-height: 112px; transition: border-color .15s, background .15s, transform .1s;
}
.feu-bouton.equilibre { --c: var(--equilibre); }
.feu-bouton.copieux { --c: var(--copieux); }
.feu-bouton:active { transform: scale(.96); }
.feu-bouton .rond-feu { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 20%, var(--surface)); }
.feu-bouton .point-feu { width: 18px; height: 18px; }
.feu-bouton strong { font-size: 15px; }
.feu-bouton small { font-size: 11.5px; line-height: 1.25; color: var(--encre-3); text-align: center; padding: 0 2px; }
.feu-bouton.actif { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, var(--surface)); }
.feux.compact .feu-bouton { min-height: 76px; flex-direction: column; }
.actions-repas { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.actions-repas .bouton { min-height: 48px; font-size: 14.5px; padding: 0 8px; }
.detail-repas { margin-top: 4px; }
.bloc-photo { display: grid; gap: 10px; margin-bottom: 8px; }
.apercu-photo { width: 100%; max-height: 240px; object-fit: cover; border-radius: 16px; display: block; }
.note-analyse { background: var(--surface-2); border-radius: 14px; padding: 10px 14px; }
.resultat-photo h3 { font-size: 19px; margin: 12px 0 4px; }
.kcal-grand { font: 750 20px var(--police-titre); color: var(--accent-fort); margin-bottom: 6px; }

/* compte à rebours (envie, séance) */
.compte-rebours { position: relative; display: grid; place-items: center; margin: 4px auto 6px; width: 140px; height: 140px; }
.compte-rebours.grand { width: 190px; height: 190px; margin: 10px auto; }
.anneau { width: 100%; height: 100%; }
.piste { stroke: var(--surface-3); }
.arc { stroke: var(--accent); transition: stroke-dashoffset .35s linear; }
.compte-rebours .temps { position: absolute; font: 800 32px var(--police-titre); }
.compte-rebours.grand .temps { font-size: 46px; }
.consigne-envie { text-align: center; color: var(--encre-2); margin: 4px 8px 14px; }
.aides-envie { margin-bottom: 4px; }
.plan-envie { background: var(--surface-2); border-radius: 16px; padding: 12px 14px; display: grid; gap: 10px; margin-top: 10px; }
.plan-envie .ligne { align-items: flex-start; }
.plan-envie .mini-titre { margin: 0 0 1px; }
.plan-envie svg { width: 20px; height: 20px; color: var(--accent-fort); margin-top: 2px; }

/* lecteur de séance */
.feuille.lecteur .corps { text-align: center; padding-bottom: 8px; }
.barres-etapes { display: flex; gap: 4px; margin: 2px 0 16px; }
.barres-etapes i { flex: 1; height: 5px; border-radius: 4px; background: var(--surface-3); }
.barres-etapes i.fait { background: var(--accent); }
.barres-etapes i.en-cours { background: color-mix(in srgb, var(--accent) 50%, var(--surface-3)); }
.nom-etape { font-size: 26px; font-weight: 800; min-height: 32px; }
.consigne-etape { color: var(--encre-2); margin: 4px 8px 6px; min-height: 44px; }
.controles { display: flex; align-items: center; justify-content: center; gap: 22px; margin: 12px 0 6px; }
.fin-seance { padding: 30px 0 10px; }
.fin-seance h3 { font-size: 24px; margin: 10px 0 6px; }
.fin-seance .emoji-grand { font-size: 56px; }

/* ---------------------------------------------------------------- Bouger */

.seance + .seance { border-top: 1px solid var(--trait); margin-top: 12px; padding-top: 12px; }
.seance h3 { font-size: 19px; }
.etapes { list-style: none; padding: 0; margin: 0; counter-reset: etape; }
.etapes li { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; padding: 8px 0; border-bottom: 1px solid var(--trait); counter-increment: etape; }
.etapes li:last-child { border-bottom: 0; }
.etapes .nom { font-weight: 650; }
.etapes .nom::before { content: counter(etape) ". "; color: var(--encre-3); font-weight: 600; }
.etapes .sec { color: var(--encre-3); font-size: 14px; }
.etapes small { grid-column: 1 / -1; color: var(--encre-3); font-size: 13px; }
.ligne-minutes { margin-bottom: 0; }

/* ---------------------------------------------------------------- Progrès */

.carte-tendance .gros-chiffre { font: 800 38px/1.1 var(--police-titre); letter-spacing: -.02em; }
.chip-pente { display: inline-block; margin-top: 4px; padding: 3px 11px; border-radius: 999px; background: var(--accent-doux); color: var(--accent-fort); font-size: 14px; font-weight: 700; }
.bloc-objectif { margin: 14px 0 12px; display: grid; gap: 8px; }
.bloc-objectif:empty { display: none; }
.estim { color: var(--encre-2); }
.courbe-bloc { margin-top: 2px; }
.lecture-courbe { min-height: 22px; font-size: 13.5px; font-weight: 600; color: var(--encre-2); margin-bottom: 2px; }
.courbe { width: 100%; height: auto; display: block; touch-action: pan-y; overflow: visible; }
.courbe .grille { stroke: var(--trait); stroke-width: 1; }
.courbe .axe, .histo-envies .axe { fill: var(--encre-3); font-size: 10.5px; font-family: var(--police); }
.courbe .brut { fill: var(--accent); opacity: .3; }
.courbe .tendance { stroke: var(--accent); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.courbe .marqueur { fill: var(--accent); stroke: var(--surface); stroke-width: 3; }
.courbe .reperage { stroke: var(--encre-3); stroke-width: 1; stroke-dasharray: 3 3; }
.courbe .objectif { stroke: var(--eau); stroke-width: 1.5; stroke-dasharray: 5 5; }
.courbe .objectif-txt { fill: var(--eau-texte); font-weight: 600; }
.legende { display: flex; gap: 16px; font-size: 12.5px; color: var(--encre-3); margin: 2px 0 0; }
.legende span { display: inline-flex; align-items: center; gap: 6px; }
.legende i { display: inline-block; border-radius: 99px; }
.l-brut { width: 8px; height: 8px; background: var(--accent); opacity: .3; }
.l-tend { width: 16px; height: 4px; background: var(--accent); }
.note-jokers { margin: 8px 4px 0; }
.minutes-semaine { text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--encre-2); }

.grille-semaine { display: grid; grid-template-columns: 62px repeat(7, 1fr); gap: 8px 4px; align-items: center; justify-items: center; }
.grille-semaine .lettre { font-size: 12px; font-weight: 700; color: var(--encre-3); }
.grille-semaine .lettre.auj { color: var(--accent-fort); }
.grille-semaine .rang { justify-self: start; font-size: 13px; font-weight: 600; color: var(--encre-2); }
.pt { --c: var(--accent); width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--surface-3); display: block; }
.pt.eau { --c: var(--eau); }
.pt.repas { --c: var(--bon); }
.pt.plein { background: var(--c); border-color: var(--c); }
.duo-chiffres { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chiffre { background: var(--surface-2); border-radius: 16px; padding: 12px; }
.chiffre .val { font: 750 20px var(--police-titre); }
.chiffre .lib { font-size: 12px; color: var(--encre-3); font-weight: 600; }
.liste-bilans .detail-bloc:first-child { border-top: 0; margin-top: 0; }
.bilan .detail-corps p { color: var(--encre-2); line-height: 1.55; }
.histo-envies { width: 100%; height: auto; display: block; margin: 6px 0 10px; }
.histo-envies .barre { fill: var(--surface-3); }
.histo-envies .barre.pic { fill: var(--accent); }

/* ---------------------------------------------------------------- Duo */

.emojis { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 12px; }
.emoji-bouton { min-height: 48px; border-radius: 14px; font-size: 24px; background: var(--surface-2); transition: transform .12s, background .15s; }
.emoji-bouton:active { transform: scale(.85); background: var(--accent-doux); }
.phrases { margin-bottom: 10px; }
.phrases .puce { min-height: 40px; font-size: 14px; }
.fil .element { min-height: 52px; }
.fil .titre { white-space: normal; }

/* ---------------------------------------------------------------- Réglages */

.carte-profil { display: flex; align-items: center; gap: 16px; }
.carte-profil strong { font: 750 20px var(--police-titre); }
.menu { padding: 6px 14px; }
.menu .ligne-reglage { padding-left: 0; padding-right: 0; }
.ligne-heures { display: flex; gap: 10px; padding: 0 0 8px 4px; }
.heure input { min-height: 44px; padding: 0 12px; border-radius: 12px; background: var(--surface-2); border: 1.5px solid transparent; width: auto; }
.heure input:focus { border-color: var(--accent); outline: none; }
.apercu-partage { background: var(--surface-2); border-radius: 16px; padding: 4px 16px 12px; margin-top: 10px; }
.apercu-partage ul, .liste-simple { margin: 0 0 8px; padding-left: 20px; color: var(--encre-2); }
.apercu-partage li, .liste-simple li { margin-bottom: 4px; }
.plan { border-bottom: 1px solid var(--trait); margin-bottom: 8px; }
code { background: var(--surface-2); padding: 2px 7px; border-radius: 7px; font-size: 13.5px; }

/* ---------------------------------------------------------------- connexion et bienvenue */

.connexion {
  min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 32px 22px calc(32px + var(--bas-sur)); max-width: 420px; margin: 0 auto; text-align: center;
}
.logo { width: 84px; height: 84px; border-radius: 26px; margin-bottom: 18px; box-shadow: 0 18px 40px -16px rgba(207, 77, 38, .7); }
.connexion h1 { font-size: 36px; font-weight: 800; }
.connexion .accroche { color: var(--encre-3); margin: 6px 0 28px; }
.qui { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; margin-bottom: 22px; }
.qui button {
  padding: 18px 10px 14px; border-radius: 22px; background: var(--surface); box-shadow: var(--ombre-1);
  border: 2px solid transparent; display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-weight: 700; font-size: 17px; transition: all .18s;
}
.qui button.actif { border-color: var(--accent); box-shadow: var(--ombre-2); transform: translateY(-2px); }
.connexion form { width: 100%; }

.bienvenue-ecran { max-width: 520px; margin: 0 auto; padding: calc(16px + var(--haut-sur)) 16px calc(32px + var(--bas-sur)); }
.haut-bienvenue { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.logo-petit { width: 40px; height: 40px; border-radius: 13px; }
.points-etapes { display: flex; gap: 8px; }
.points-etapes i { width: 28px; height: 6px; border-radius: 4px; background: var(--surface-3); transition: background .2s; }
.points-etapes i.actif { background: var(--accent); }
.points-etapes i.fait { background: color-mix(in srgb, var(--accent) 45%, var(--surface-3)); }
.bienvenue-ecran h2 { font-size: 24px; margin-bottom: 6px; }

/* ---------------------------------------------------------------- notifications, chargement */

.toast {
  position: fixed; left: 50%; bottom: calc(100px + var(--bas-sur)); transform: translateX(-50%); z-index: 80;
  background: var(--encre); color: var(--fond); padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: 15px;
  box-shadow: var(--ombre-2); animation: toast .3s cubic-bezier(.2, .9, .25, 1); max-width: calc(100% - 32px);
  display: flex; align-items: center; gap: 12px;
}
.toast button { color: #ffb08c; font-weight: 700; min-height: 36px; }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 14px); } }

.chargement { display: grid; place-items: center; padding: 60px 0; }
.chargement::before {
  content: ""; width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--surface-3); border-top-color: var(--accent); animation: tourne .8s linear infinite;
}
@keyframes tourne { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media (min-width: 620px) {
  .contenu { padding-left: 20px; padding-right: 20px; }
}
@media (max-width: 359px) {
  .feu-bouton small { display: none; }
  .feu-bouton { min-height: 84px; }
  .hero-eau .gros { font-size: 40px; }
}

/* ---------------------------------------------------------------- vue PC (grand écran)
   Téléphone : une colonne, barre en bas. À partir de 1024 px : colonne latérale fixe,
   contenu sur deux colonnes, survols, raccourci clavier N. */

.nav .marque, .nav .lien-reglages, .nav .lib-plus, .nav kbd { display: none; }
.colonnes > .col { min-width: 0; }

@media (hover: hover) {
  .element:hover:not(.sans-action) { background: var(--surface-2); }
  .puce:hover:not(.actif) { background: var(--surface-3); }
  .bouton:hover { filter: brightness(1.06); }
  .emoji-bouton:hover { background: var(--accent-doux); }
  .feu-bouton:hover:not(.actif) { border-color: var(--surface-3); }
  .pastille-repas:hover .rond { transform: scale(1.06); }
}

@media (min-width: 1024px) {
  .appli { max-width: none; margin: 0 0 0 256px; }
  .entete { padding: 30px 40px 18px; }
  .entete h1 { font-size: 30px; }
  .entete .sous { font-size: 14px; }
  .entete .avatar-bouton { display: none; }
  .contenu { padding: 2px 40px 56px; max-width: 1200px; }

  .colonnes { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 0 24px; align-items: start; }

  .nav {
    left: 0; right: auto; top: 0; bottom: 0; transform: none; width: 256px;
    display: flex; flex-direction: column; align-items: stretch; gap: 4px;
    padding: 26px 16px 18px; border-radius: 0; border: 0; border-right: 1px solid var(--trait);
    background: var(--surface); box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .nav .marque {
    order: -2; display: flex; align-items: center; gap: 11px; padding: 0 8px 22px;
    font: 800 23px var(--police-titre); color: var(--encre); background: none; min-height: 0;
  }
  .nav .marque:hover { background: none; }
  .nav .logo-mini { width: 38px; height: 38px; border-radius: 12px; box-shadow: 0 8px 18px -10px rgba(207, 77, 38, .8); }
  .nav a { flex-direction: row; gap: 12px; padding: 11px 12px; font-size: 15px; font-weight: 600; border-radius: 12px; min-height: 0; }
  .nav a svg { width: 22px; height: 22px; }
  .nav a:not(.actif):not(.marque):hover { background: var(--surface-2); color: var(--encre); }
  .nav .plus {
    order: -1; width: 100%; height: 50px; margin: 0 0 16px; border-radius: 15px;
    display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 700; font-size: 15px;
  }
  .nav .plus svg { width: 22px; height: 22px; }
  .nav .plus:active { transform: scale(.98); }
  .nav .lib-plus { display: inline; }
  .nav kbd {
    display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 6px;
    font: 700 12px var(--police); background: rgba(255, 255, 255, .22); color: inherit;
  }
  .nav .lien-reglages {
    display: flex; margin-top: auto; align-items: center; gap: 11px; padding: 10px 12px;
    border: 1px solid var(--trait); border-radius: 16px;
  }
  .nav .lien-reglages .avatar { width: 36px; height: 36px; font-size: 15px; }
  .nav .lien-reglages strong { display: block; color: var(--encre); font-size: 14.5px; }
  .nav .lien-reglages small { display: block; font-size: 12.5px; color: var(--encre-3); font-weight: 500; }
  .nav .lien-reglages svg { width: 18px; height: 18px; }

  .carte { padding: 20px 22px; }
  .toast { left: calc(50% + 128px); bottom: 32px; }
  .feuille { max-width: 600px; }
}

@media (min-width: 1440px) {
  .contenu { max-width: 1280px; }
}

/* Accueil : « ↘ 0,3 kg/sem · Pesée du jour… », séparateur seulement si la pente est connue. */
.pente:not(:empty) + .apres-pente::before { content: " · "; }
.pente:empty + .apres-pente { display: inline-block; }
.pente:empty + .apres-pente::first-letter { text-transform: uppercase; }
