/* =============================================================
   style.css – le "maquillage" de Buddy
   Tout le look du site est ici : couleurs, tailles, formes, animations.
   L'identité de la marque : claire, légère, menthe + navy, beaucoup d'air,
   des coins bien ronds, des ombres très douces. Pas de lueurs ni d'effets "magiques".
   ============================================================= */

/* ---------- 1. LES COULEURS ET LA TYPO (variables) ----------
   On définit les couleurs UNE fois ici, avec un nom.
   Partout ailleurs on écrit var(--accent) au lieu du code couleur :
   pour changer une couleur sur tout le site, on la change juste ici.
   La palette de la marque Buddy : Primary (menthe), Deep Navy, Mint, Sky, Slate, Snow. */
:root {
  /* La marque */
  --primary: #5fe2c3;                    /* menthe (la bulle de Buddy) : boutons, états actifs, surlignages */
  --primary-hover: #4dd6b6;
  --navy: #14284b;                       /* navy de la marque : texte, logo, bulles de l'utilisateur, fonds sombres */
  --mint: #e8f4f0;                       /* menthe très clair : fonds, étiquettes, bulles de Buddy */
  --sky: #60a5fa;                        /* actions secondaires, liens, progression */
  --slate: #94a3b8;                      /* icônes, bordures */
  --snow: #f8fafc;                       /* fond principal */
  --cream: #fffdf7;                      /* le blanc chaud des illustrations */
  /* Les couleurs "qui veulent dire quelque chose" (avec parcimonie) */
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  --neutral: #cbd5e1;

  /* Le rôle de chaque couleur dans l'interface (thème clair = la référence) */
  --bg: var(--snow);
  --sidebar: #ffffff;
  --card: #ffffff;
  --card-strong: #f1f5f9;                /* fond des champs, puces, lignes survolées */
  --card-hover: #eaf0f5;
  --border: #e6ebf1;                     /* bordures très fines */
  --border-strong: #cfd8e3;
  /* 4 niveaux de texte : titre, texte, secondaire, discret */
  --text: var(--navy);
  --text-2: #334155;
  --muted: #64748b;                      /* texte secondaire (assez contrasté pour se lire) */
  --faint: var(--slate);
  --accent: var(--primary);
  --accent-ink: #0c8a70;                 /* la menthe, plus foncée : pour du TEXTE menthe bien lisible */
  --accent-soft: var(--mint);
  --on-accent: var(--navy);              /* texte posé sur la menthe : navy (lisible) */
  --link: #2f7fe0;                       /* liens (Sky, un peu plus foncé pour la lecture) */
  /* Les couleurs des catégories */
  --green: var(--success);
  --orange: #f97316;
  --teal: var(--primary);
  --blue: var(--sky);
  --violet: #8b5cf6;
  --yellow: #eab308;
  --red: #f43f5e;
  /* Les fonds illustrés (bannière, page d'accueil) */
  --scene-a: var(--cream);
  --scene-b: #f1faf7;
  --scene-c: var(--mint);
  --blob: rgba(95, 226, 195, 0.16);
  --blob-2: rgba(96, 165, 250, 0.10);
  /* Des ombres très douces et courtes */
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 14px rgba(15, 23, 42, 0.05);
  --shadow-lift: 0 2px 4px rgba(15, 23, 42, 0.05), 0 12px 28px rgba(15, 23, 42, 0.09);
  /* Les arrondis : 3 tailles seulement, partout les mêmes */
  --radius: 20px;       /* les cartes */
  --radius-md: 14px;    /* les éléments dans une carte (lignes, boutons, champs) */
  --radius-sm: 10px;    /* les petits éléments (badges, icônes) */
  /* Les espacements : toujours des multiples de 4 */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-soft: cubic-bezier(0.22, 1, 0.36, 1);
  /* La typographie : Calistoga pour les grands titres, Plus Jakarta Sans pour tout le reste */
  --font-display: "Nunito", "Plus Jakarta Sans", system-ui, sans-serif; /* arrondie, comme le mot « Buddy » */
  --font-ui: "Plus Jakarta Sans", system-ui, sans-serif;
  --fs-h1: 3rem;        --lh-h1: 3.5rem;    /* 48 / 56 */
  --fs-h2: 2rem;        --lh-h2: 2.5rem;    /* 32 / 40 */
  --fs-h3: 1.25rem;     --lh-h3: 1.75rem;   /* 20 / 28 */
  --fs-body: 1rem;      --lh-body: 1.5rem;  /* 16 / 24 */
  --fs-small: 0.875rem; --lh-small: 1.25rem; /* 14 / 20 */
  color-scheme: light;
}

/* Le thème sombre : même marque, sur un fond Deep Navy */
:root[data-theme="dark"] {
  --bg: #0d1b33;
  --sidebar: #11223f;
  --card: #152a4d;
  --card-strong: #1b3459;
  --card-hover: #203c66;
  --border: #243f69;
  --border-strong: #37537f;
  --text: #f1f5f9;
  --text-2: #cbd5e1;
  --muted: #94a3b8;
  --faint: #64748b;
  --accent-ink: #4fd8bb;
  --accent-soft: rgba(95, 226, 195, 0.14);
  --link: var(--sky);
  --scene-a: #152a4d;
  --scene-b: #132c4a;
  --scene-c: #123447;
  --blob: rgba(95, 226, 195, 0.10);
  --blob-2: rgba(96, 165, 250, 0.07);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 6px 18px rgba(0, 0, 0, 0.25);
  --shadow-lift: 0 2px 6px rgba(0, 0, 0, 0.3), 0 14px 32px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

/* ---------- 2. LES BASES ---------- */
* { box-sizing: border-box; }
/* Rien ne dépasse sur les côtés : sur iPhone, un élément caché hors de l écran (ex. : le panneau de Buddy)
   élargissait la page, qu on pouvait alors faire glisser de gauche à droite. "clip" coupe sans créer de barre de défilement. */
html, body { overflow-x: clip; }

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.3s, color 0.3s;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.15; }
/* Calistoga SEULEMENT pour les vrais titres (titres de page, "Salut …", titres de la page d'accueil, Premium).
   Tout le reste (titres de cartes, sous-titres, chiffres, fenêtres) : Plus Jakarta Sans, en gras. */
h1 { font-family: var(--font-display); font-weight: 900; letter-spacing: -0.02em; }
h2 { font-weight: 800; letter-spacing: -0.02em; }
h3, h4 { font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-small); }
.accent { color: var(--accent-ink); }
.hidden { display: none !important; } /* !important = "cette règle gagne toujours" */

/* Les icônes (bibliothèque Phosphor, style "plein") : app.js leur donne aussi la classe "lucide"
   (le nom de l'ancienne bibliothèque), pour que tout le reste du code continue de marcher.
   Une icône = une lettre d'une police spéciale : sa taille, c'est font-size. */
.lucide {
  font-size: 18px; width: 1em; height: 1em; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* Le logo : le "B" menthe + "Buddy" */
.logo { display: inline-flex; align-items: center; gap: 9px; font-family: var(--font-display); font-weight: 900; font-size: 1.55rem; letter-spacing: -0.01em; color: var(--navy); }
:root[data-theme="dark"] .logo { color: #fff; }
.logo-img { width: 38px; height: 38px; flex: none; display: block; }
/* Le sourire sous « Buddy » (comme sur le logo) : un trait courbe, de la couleur du texte */
.logo-word { position: relative; line-height: 1; padding-bottom: 0.18em; }
.logo-word::after {
  content: ""; position: absolute; left: 14%; right: -2%; bottom: -0.1em; height: 0.26em; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 14'%3E%3Cpath d='M3 4 Q45 15 95 5 Q98 4 97 1' fill='none' stroke='black' stroke-width='3.4' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 14'%3E%3Cpath d='M3 4 Q45 15 95 5 Q98 4 97 1' fill='none' stroke='black' stroke-width='3.4' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
}

/* ---------- 3. LES BOUTONS ET CHAMPS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 99px;                   /* des pilules, comme dans la charte */
  padding: 11px 20px;
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.18s var(--ease), box-shadow 0.25s var(--ease), background 0.2s, border-color 0.2s, color 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn .lucide { font-size: 17px; }
.btn-primary { background: var(--primary); color: var(--on-accent); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08); }
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 6px 16px rgba(95, 226, 195, 0.28); transform: translateY(-1px); }
.btn-primary .lucide-arrow-right { transition: transform 0.2s var(--ease); }
.btn-primary:hover .lucide-arrow-right { transform: translateX(3px); }
.btn-primary:disabled { opacity: 0.5; cursor: wait; box-shadow: none; transform: none; }
/* Le bouton secondaire : une pilule menthe claire */
.btn-ghost { background: var(--accent-soft); color: var(--text); border-color: transparent; }
.btn-ghost:hover { background: color-mix(in srgb, var(--primary) 20%, var(--card)); }
.btn-big { padding: 15px 28px; font-size: 1.02rem; }
.btn-full { width: 100%; }
.btn-icon { padding: 0; width: 46px; height: 46px; flex-shrink: 0; border-radius: 50%; }

input, textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--card-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, textarea:focus { border-color: var(--primary); background: var(--card); box-shadow: 0 0 0 4px rgba(95, 226, 195, 0.16); }
textarea { resize: vertical; }

.icon-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.18s var(--ease);
}
.icon-btn .lucide { font-size: 18px; }
.icon-btn.round { border-radius: 50%; }
.icon-btn:hover { background: var(--card-strong); border-color: var(--border-strong); }
.theme-toggle .lucide { color: var(--accent-ink); }
/* Le bouton FR / EN : on y écrit la langue vers laquelle on passe */
.lang-toggle { font: inherit; font-size: 12px; font-weight: 800; letter-spacing: 0.06em; color: var(--accent-ink); cursor: pointer; }
.soon { opacity: 0.5; cursor: default; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- 4. LES CARTES ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--s5);
  transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s var(--ease);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s4); }
.card-title { display: flex; align-items: center; gap: var(--s3); }
.card-title h3 { font-size: 1.06rem; font-weight: 700; }
.card-title .muted.small { font-size: 0.82rem; margin-top: 2px; }
.title-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: var(--navy); background: var(--accent-soft); }
:root[data-theme="dark"] .title-icon { color: var(--accent-ink); }
.title-icon .lucide { font-size: 19px; }
.title-icon.plain { background: var(--accent-soft); }
.card-actions { display: flex; align-items: center; gap: 8px; }
.badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: 99px;
  padding: 4px 10px;
}
.mini-btn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--border); background: var(--card); color: var(--text-2); cursor: pointer; transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.18s var(--ease); }
.mini-btn .lucide { font-size: 16px; }
.mini-btn:hover { border-color: var(--primary); color: var(--accent-ink); background: var(--accent-soft); }
.mini-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.eyebrow {
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.pill {
  display: inline-block;
  font-size: 0.8rem; font-weight: 600;
  padding: 6px 14px; border-radius: 99px;
  background: var(--accent-soft); color: var(--accent-ink);
}

/* ---------- 5. LA PAGE D'ACCUEIL (non connecté) ---------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 28px;
  max-width: 1240px; margin: 0 auto; padding: 18px 24px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav-right .btn { white-space: nowrap; }
/* Petit téléphone : on resserre la barre du haut pour que "Se connecter" tienne sur une ligne */
@media (max-width: 420px) {
  .nav { gap: 12px; }
  .nav-right { gap: 6px; }
  .nav-right .icon-btn { width: 38px; height: 38px; }
  .nav-right .btn { padding: 9px 14px; }
}
.hero {
  max-width: 1240px; margin: 0 auto;
  padding: 30px 24px 60px;
  display: grid; grid-template-columns: 1fr 1.05fr; gap: 56px; align-items: center;
  min-height: min(720px, calc(100vh - 80px)); /* plafonné : sur un grand écran, on devine la suite (captures, offres) */
}
.hero h1 { font-size: clamp(2.5rem, 5vw, 3.75rem); line-height: 1.12; }
.hero h1 .accent { color: #1fae8b; } /* la menthe, un peu plus soutenue : bien lisible sur fond blanc */
.hero-sub { color: var(--muted); font-size: 1.1rem; margin: 22px 0 32px; max-width: 460px; }
.hero-values { list-style: none; margin: 36px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.hero-values li { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 99px; background: var(--card); border: 1px solid var(--border); font-size: 0.88rem; font-weight: 600; color: var(--text-2); }
.hero-values .lucide { color: var(--accent-ink); font-size: 17px; }

/* Le grand visuel : un panneau clair illustré, avec Buddy qui fait coucou */
.scene { position: relative; overflow: hidden; border-radius: 28px; isolation: isolate; }
.scene-hero {
  height: min(560px, 70vh); animation: fade-up 0.8s ease-out;
  background:
    radial-gradient(circle at 82% 18%, var(--blob) 0 90px, transparent 91px),
    radial-gradient(circle at 18% 92%, var(--blob-2) 0 150px, transparent 151px),
    radial-gradient(circle at 50% 118%, var(--blob) 0 260px, transparent 261px),
    linear-gradient(150deg, var(--scene-a) 0%, var(--scene-b) 55%, var(--scene-c) 100%);
  border: 1px solid var(--border);
}
.scene-hero .buddy-img { bottom: 8%; height: 76%; }
/* Petites cartes posées sur le visuel (comme des widgets de l'appli) */
.hero-chip {
  position: absolute; z-index: 2; display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--border);
  box-shadow: var(--shadow-lift); font-size: 0.85rem; font-weight: 700; color: var(--text);
  animation: flotte 6s ease-in-out infinite;
}
.hero-chip .lucide { font-size: 20px; color: var(--accent-ink); }
.hero-chip small { display: block; font-weight: 500; color: var(--muted); font-size: 0.75rem; }
.hero-chip.one { top: 12%; left: 7%; }
.hero-chip.two { bottom: 14%; right: 6%; animation-delay: -3s; }
@keyframes flotte { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* "C'est parti" : la flèche invite à descendre (un petit mouvement vers le bas) */
#hero-cta .lucide-arrow-down { animation: descend 1.8s ease-in-out infinite; }
@keyframes descend { 0%, 100% { transform: translateY(-1px); } 50% { transform: translateY(3px); } }

/* Apparition au défilement (class="reveal", voir setupReveal dans app.js) :
   invisible et un peu plus bas, puis il glisse à sa place quand on arrive dessus */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease-out, transform 0.8s var(--ease-soft); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }
.shot-phone.reveal { transform: translate(28px, 70px) rotate(4deg); }   /* le téléphone arrive en glissant, un peu penché */
.plan-list li.reveal { transform: translateX(-14px); }                 /* chaque avantage arrive de la gauche */
.shot-phone.reveal.in, .plan-list li.reveal.in { transform: none; }

/* L'app en images (sous le titre) : le tableau de bord, avec le téléphone posé devant */
.showcase { max-width: 1100px; margin: 0 auto; padding: 10px 24px 80px; scroll-margin-top: 76px; }
.shots { position: relative; padding-right: 9%; }
.shot-desktop {
  display: block; width: 100%; height: auto; border-radius: 20px;
  border: 1px solid var(--border); box-shadow: var(--shadow-lift);
}
.shot-phone {
  position: absolute; right: 0; bottom: -40px; width: 24%; height: auto;
  border-radius: 30px; border: 7px solid var(--navy);
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.22);
}
/* Gratuit ou Premium ? */
.plans { max-width: 960px; margin: 0 auto; padding: 40px 24px 90px; text-align: center; }
.plans h2 { font-family: var(--font-display); font-weight: 900; letter-spacing: -0.02em; font-size: clamp(2rem, 4vw, 2.6rem); }
.plans-sub { color: var(--muted); margin: 10px auto 34px; max-width: 520px; }
.plan-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; text-align: left; }
.plan-card {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  padding: 28px 26px; border-radius: 24px; background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.plan-card h3 { font-weight: 800; font-size: 1.25rem; }
.plan-price { display: flex; align-items: baseline; gap: 4px; margin-bottom: 8px; }
.plan-price strong { font-weight: 800; font-size: 2rem; line-height: 1; letter-spacing: -0.03em; }
.plan-price span { color: var(--muted); font-weight: 600; }
.plan-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.plan-list li { display: flex; align-items: flex-start; gap: 10px; font-weight: 600; font-size: 0.95rem; line-height: 1.4; }
.plan-list .lucide { font-size: 18px; margin-top: 1px; color: var(--accent-ink); }
/* La carte Premium, mise en avant */
.plan-card.premium {
  border: 2px solid var(--primary); box-shadow: var(--shadow-lift);
  background:
    radial-gradient(circle at 100% 0%, var(--blob) 0 120px, transparent 121px),
    var(--card);
}
.plan-card.premium .premium-trial { align-self: flex-start; }
/* Le bouton de chaque offre, en bas de sa carte */
.plan-list { margin-bottom: 18px; }
.plan-btn { margin-top: auto; }
.plan-card.premium .plan-btn { box-shadow: 0 8px 20px rgba(95, 226, 195, 0.28); }
.plan-note { text-align: center; font-size: 0.8rem; color: var(--muted); margin-top: -2px; }
/* Premium : l'essai gratuit en grand ("0 € pendant 7 jours"), le prix mensuel juste dessous */
.plan-card.premium .plan-price { margin-bottom: 0; }
.plan-card.premium .plan-price strong { color: var(--navy); font-size: 2.4rem; }
.plan-card.premium .plan-price span { color: var(--text); font-weight: 700; font-size: 1.05rem; }
.plan-then { color: var(--muted); font-weight: 600; font-size: 0.9rem; margin: -4px 0 8px; }
.plan-card.premium .premium-trial { font-size: 0.9rem; padding: 7px 14px; }
.plan-card.premium .premium-trial .lucide { font-size: 17px; }
@media (max-width: 700px) { .plan-card.premium { order: -1; } } /* sur téléphone : Premium (et son essai gratuit) en premier */

/* En haut de la page d'accueil : "7 jours de Premium offerts", bien visible dès l'arrivée */
.trial-pill {
  display: inline-flex; align-items: center; gap: 8px; margin: -4px 0 18px;
  padding: 8px 14px; border-radius: 99px; background: var(--accent-soft); border: 1px solid rgba(95, 226, 195, 0.35);
  color: var(--text); font-size: 0.92rem; font-weight: 600; transition: transform 0.2s var(--ease-soft), box-shadow 0.2s;
}
.trial-pill strong { color: var(--accent-ink); font-weight: 800; }
.trial-pill .lucide { font-size: 18px; color: var(--accent-ink); }
.trial-pill .lucide-caret-down { font-size: 14px; animation: descend 1.8s ease-in-out infinite; }
.trial-pill:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(95, 226, 195, 0.22); }
.plan-card.premium .plan-list .lucide { color: var(--navy); }
:root[data-theme="dark"] .plan-card.premium .plan-list .lucide { color: var(--accent-ink); }
@media (max-width: 700px) {
  .plan-cards { grid-template-columns: 1fr; }  /* l'une sous l'autre sur téléphone */
  .showcase { padding-bottom: 60px; }
  .shot-phone { width: 30%; border-width: 5px; border-radius: 22px; bottom: -30px; }
}

/* Le bas de la page d'accueil : les liens vers les pages légales */
.site-footer { max-width: 1100px; margin: 0 auto; padding: 28px 24px 40px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; color: var(--muted); font-size: 0.88rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.site-footer a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.legal-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.auth-legal { text-align: center; line-height: 1.5; }
.auth-legal a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }

/* LES PAGES LÉGALES (public/legal/) : du texte simple et lisible */
.legal-page { max-width: 760px; margin: 0 auto; padding: 8px 24px 64px; }
.legal-page h1 { font-size: clamp(2rem, 5vw, 2.6rem); margin: 18px 0 6px; }
.legal-page .updated { color: var(--muted); font-size: 0.88rem; margin-bottom: 28px; }
.legal-page h2 { font-size: 1.1rem; margin: 28px 0 8px; }
.legal-page p, .legal-page li { line-height: 1.65; color: var(--text-2); }
.legal-page p + p { margin-top: 10px; }
.legal-page ul { padding-left: 20px; display: grid; gap: 6px; }
.legal-page a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.legal-page .note { margin-top: 12px; padding: 12px 16px; border-radius: var(--radius-md); background: var(--accent-soft); }
/* Les informations à compléter : bien visibles */
mark.todo { background: #fff3c4; color: #7a4b00; padding: 1px 6px; border-radius: 6px; font-weight: 700; }
:root[data-theme="dark"] mark.todo { background: #5c4400; color: #ffe8a3; }

/* La page de connexion / inscription : plein écran, carte centrée */
.auth-screen {
  position: relative; min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center; padding: 72px 16px 32px;
  background:
    radial-gradient(circle at 12% 12%, var(--blob) 0 140px, transparent 141px),
    radial-gradient(circle at 90% 88%, var(--blob-2) 0 180px, transparent 181px),
    var(--bg);
}
.auth-back { position: absolute; top: 18px; left: 16px; }
.auth-card { width: 100%; max-width: 420px; display: grid; gap: 12px; padding: 32px 26px; animation: fade-up 0.35s ease-out; text-align: center; box-shadow: var(--shadow-lift); }
.auth-card input, .auth-card .tabs, .auth-card .btn { text-align: left; }
.auth-card .btn { justify-content: center; }
.auth-logo { justify-content: center; margin-bottom: 4px; font-size: 1.7rem; }
.auth-logo .logo-img { width: 46px; height: 46px; }
.auth-card h1 { font-size: 1.75rem; }
.auth-card > p.muted { margin-bottom: 6px; }
.auth-switch button { background: none; border: none; padding: 0; color: var(--accent-ink); font: inherit; font-weight: 700; cursor: pointer; }
.tabs { display: flex; background: var(--card-strong); border-radius: 99px; padding: 4px; }
.tab { flex: 1; background: transparent; border: none; color: var(--muted); font: inherit; font-weight: 600; padding: 9px; border-radius: 99px; cursor: pointer; text-align: center; }
.tab.active { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1); }
.auth-info { color: var(--error); font-size: 0.9rem; min-height: 1.2em; }
.auth-info.ok { color: var(--accent-ink); }
/* "Mot de passe oublié ?" : un petit lien discret, sous le mot de passe, à droite */
.auth-forgot {
  justify-self: end; margin-top: -4px; padding: 2px 0;
  background: none; border: none; color: var(--muted); font: inherit; font-size: 0.86rem; font-weight: 600; cursor: pointer;
}
.auth-forgot:hover { color: var(--accent-ink); }
/* L'écran "Bienvenue dans l'équipe !" après l'inscription : un grand rond menthe avec une coche */
.done-mark {
  width: 84px; height: 84px; margin: 0 auto 4px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink);
  animation: pop-in 0.6s cubic-bezier(.2, 1.6, .4, 1);
}
.done-mark .lucide { font-size: 40px; }
.auth-done h1 { font-size: 1.75rem; }
.mail-step {
  display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 14px 16px; border-radius: var(--radius-md);
  background: var(--accent-soft);
}
.mail-step p { margin: 0; line-height: 1.45; }
.mail-step strong { color: var(--accent-ink); word-break: break-all; }
.mail-icon { font-size: 26px; color: var(--accent-ink); }
@keyframes pop-in { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- 6. BUDDY (la mascotte) ----------
   Toutes ses images ont le même cadre : il reste au même endroit d'une émotion à l'autre. */
.buddy-img {
  /* left/right à -100% : l'image reste bien centrée même si elle est plus large que sa place */
  position: absolute; left: -100%; right: -100%; margin: 0 auto;
  bottom: 0; height: 100%; max-width: none;
  transform-origin: 50% 100%;
  filter: drop-shadow(0 10px 14px rgba(15, 23, 42, 0.12));
  animation: respire 3.6s ease-in-out infinite;
  pointer-events: none;
}
/* Des mouvements discrets (pas de rebond de dessin animé) */
@keyframes respire { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.015); } }
@keyframes reflechit { 0%, 100% { transform: rotate(-1deg); } 50% { transform: rotate(1deg); } }
@keyframes pop { 0% { transform: translateY(6px) scale(0.98); } 100% { transform: translateY(0) scale(1); } }
@keyframes saute { 0%, 100% { transform: translateY(0); } 35% { transform: translateY(-12px); } 65% { transform: translateY(0); } 82% { transform: translateY(-4px); } }
.buddy-img.reflechit { animation: reflechit 3s ease-in-out infinite; }
.buddy-img.pop { animation: pop 0.5s var(--ease-soft); }
.buddy-img.saute { animation: saute 0.9s var(--ease-soft); }
/* Changement d'émotion : fondu enchaîné (voir crossfade dans app.js).
   La nouvelle pose apparaît vite, l'ancienne ("fantôme", par-dessus) s'efface plus lentement. */
.buddy-img { transition: opacity 0.18s ease-out; }
.buddy-ghost { animation: none !important; transition: opacity 0.45s ease-in-out; z-index: 1; }
/* Il change de scène (sport, études…) : une petite apparition douce, sans étincelles */
.buddy-img.tenue { animation: tenue 0.6s var(--ease-soft); }
@keyframes tenue { 0% { transform: translateY(10px) scale(0.96); opacity: 0.4; } 100% { transform: none; opacity: 1; } }
.tenue-poof { display: none; }

/* ---------- 7. L'APPLI : menu à gauche + contenu ---------- */
.app-layout { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: var(--s6);
  padding: 26px 16px 20px;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
}
.sidebar .logo { padding: 0 10px; }
.side-nav { display: grid; gap: var(--s1); }
.side-link {
  position: relative;
  display: flex; align-items: center; gap: var(--s3);
  padding: 11px 14px; border-radius: 99px;
  color: var(--muted); font-weight: 600; font-size: 0.95rem;
  transition: background 0.2s, color 0.2s;
}
/* Les icônes du menu : petites et discrètes, c'est le mot qui compte */
.side-link .lucide { font-size: 16px; color: var(--faint); transition: color 0.2s, transform 0.25s var(--ease-soft); }
.side-link:hover .lucide { color: var(--muted); }
.side-link:hover { color: var(--text); background: var(--card-strong); }
.side-link.active { color: var(--text); font-weight: 700; background: var(--accent-soft); }
.side-link.active .lucide { color: var(--accent-ink); }
.side-quote {
  position: relative; overflow: hidden; margin-top: auto;
  padding: var(--s4) 18px; border-radius: var(--radius);
  background: var(--accent-soft);
  font-weight: 700; font-size: 0.9rem; line-height: 1.4; color: var(--text);
}
.side-quote .lucide { color: var(--accent-ink); font-size: 22px; margin-bottom: 10px; position: relative; }
.side-quote p { position: relative; }
/* Un petit cercle décoratif, comme sur les illustrations */
.side-quote::after { content: ""; position: absolute; right: -30px; bottom: -40px; width: 110px; height: 110px; border-radius: 50%; background: rgba(95, 226, 195, 0.16); }

.main { position: relative; min-width: 0; }
/* En haut à droite : langue, thème, compte (une vraie ligne, plus rien ne passe dessous) */
.topbar {
  display: flex; align-items: center; justify-content: flex-end; gap: var(--s2);
  padding: 20px 32px 0;
}
.topbar .icon-btn { width: 38px; height: 38px; border-radius: 50%; }
.user-menu { position: relative; }
.user-btn {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--border);
  color: var(--text); font: inherit; font-weight: 600; font-size: 0.92rem;
  padding: 4px 12px 4px 4px; border-radius: 99px; cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.user-btn:hover { border-color: var(--border-strong); background: var(--card-strong); }
.user-btn .lucide { font-size: 14px; color: var(--muted); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-ink);
  font-weight: 800; font-size: 0.9rem; text-transform: uppercase;
}
.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 12;
  min-width: 230px; padding: 8px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow-lift);
  animation: fade-in 0.15s ease-out;
}
.dropdown-email { color: var(--muted); font-size: 0.85rem; padding: 8px 10px; overflow: hidden; text-overflow: ellipsis; }
.dropdown-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  background: transparent; border: none; color: var(--text);
  font: inherit; padding: 10px; border-radius: 10px; cursor: pointer;
}
.dropdown-item:hover { background: var(--card-strong); }

.page { padding: 16px 32px 48px; animation: fade-up 0.5s ease-out; }

/* ---------- 8. LA GRANDE BANNIÈRE ----------
   Un panneau clair illustré : le texte, Buddy, la carte "On reprend…", et dessous la frise du jour. */
.banner {
  position: relative; overflow: hidden; isolation: isolate;
  margin: 0 0 var(--s5); padding: 36px 40px 22px;
  border-radius: 28px; border: 1px solid var(--border);
  background:
    radial-gradient(circle at 93% 8%, var(--blob) 0 110px, transparent 111px),
    radial-gradient(circle at 58% 125%, var(--blob) 0 240px, transparent 241px),
    radial-gradient(circle at 4% 110%, var(--blob-2) 0 150px, transparent 151px),
    linear-gradient(120deg, var(--scene-a) 0%, var(--scene-b) 55%, var(--scene-c) 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(200px, 250px) minmax(0, 0.95fr);
  grid-template-areas: "copy buddy resume" "timeline timeline timeline";
  column-gap: var(--s5); row-gap: var(--s4);
  align-items: center;
}
.banner-copy { grid-area: copy; position: relative; z-index: 2; max-width: 470px; }
/* "BIENVENUE" : une petite étiquette menthe, en lettres espacées */
.hero-eyebrow { display: inline-block; margin: 0; padding: 5px 12px; border-radius: 99px; background: var(--card); color: var(--accent-ink); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05); }
.banner-copy h1 { font-size: clamp(2.2rem, 3.6vw, 3rem); line-height: 1.15; margin: 14px 0 10px; }
.banner-copy p { font-size: 1.05rem; line-height: 1.5; color: var(--text-2); margin-bottom: 24px; }
.banner-copy .btn { white-space: nowrap; }
#greeting-name { white-space: nowrap; }

.banner-buddy { grid-area: buddy; position: relative; z-index: 1; height: 250px; align-self: end; }
/* Un petit socle rond sous Buddy (comme sur la maquette) */
.banner-buddy::before {
  content: ""; position: absolute; z-index: -1; left: 50%; bottom: -4px; width: 180px; height: 26px; transform: translateX(-50%);
  border-radius: 50%; background: rgba(15, 23, 42, 0.07); filter: blur(2px);
}

/* "On reprend où on s'était arrêtés ?" : une petite carte blanche à côté de Buddy */
.resume-card {
  grid-area: resume; position: relative; z-index: 2; justify-self: end;
  width: 100%; max-width: 320px;
  display: grid; gap: var(--s2);
  padding: 16px 18px; border-radius: 18px;
  background: var(--card); border: 1px solid var(--border);
  box-shadow: var(--shadow-lift);
  color: var(--text); cursor: pointer;
  animation: fade-in 0.6s ease-out;
  transition: border-color 0.25s, box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
}
.resume-card:hover { border-color: rgba(95, 226, 195, 0.5); transform: translateY(-2px); }
.resume-title { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.02em; color: var(--accent-ink); }
.resume-quote { font-size: 0.95rem; font-weight: 600; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.resume-reply { font-size: 0.85rem; color: var(--muted); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.resume-reply:empty { display: none; }
.resume-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 2px; }
.resume-when { font-size: 0.76rem; color: var(--faint); }
.resume-btn {
  border: none; background: none; padding: 0; cursor: pointer;
  font: inherit; font-size: 0.85rem; font-weight: 700; color: var(--link); white-space: nowrap;
}
.resume-card:hover .resume-btn { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 8 bis. LA FRISE DU JOUR ----------
   Les tâches d'aujourd'hui, dans l'ordre de la journée, reliées par une courbe.
   Chaque tâche cochée fait avancer la courbe vers la suivante ; au bout, Buddy félicite. */
.timeline {
  grid-area: timeline; position: relative; z-index: 2;
  background: color-mix(in srgb, var(--card) 72%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  border-radius: 22px;
  padding: 4px 6px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.tl-scroll { overflow-x: auto; overflow-y: hidden; scroll-behavior: smooth; scrollbar-width: thin; scroll-snap-type: x proximity; }
.tl-track { position: relative; display: flex; justify-content: space-between; align-items: flex-start; width: max-content; min-width: 100%; padding: 16px 18px 12px; gap: 12px; }
.tl-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.tl-path-bg { fill: none; stroke: var(--neutral); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 2 9; opacity: 0.9; }
.tl-path-done { fill: none; stroke: var(--primary); stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset 0.85s var(--ease-soft); }
.tl-node {
  position: relative; z-index: 1; flex: 0 0 auto; width: 104px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: none; border: none; padding: 0; font: inherit; color: var(--text); cursor: pointer;
  scroll-snap-align: center;
}
.tl-dot {
  position: relative; width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--card); color: var(--navy);
  border: 2px solid var(--border);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
  transition: border-color 0.35s, box-shadow 0.35s, transform 0.25s var(--ease-soft);
}
:root[data-theme="dark"] .tl-dot { color: var(--text); }
.tl-dot .lucide { font-size: 22px; }
.tl-label {
  max-width: 104px; padding: 4px 10px; border-radius: 99px;
  background: var(--card); border: 1px solid var(--border);
  font-size: 0.74rem; font-weight: 700; line-height: 1.3; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;   /* un intitulé trop long est raccourci : "…" */
}
.tl-time { margin-top: -4px; font-size: 0.68rem; color: var(--muted); font-variant-numeric: tabular-nums; min-height: 1em; }
/* La pastille ✓ d'une tâche faite */
.tl-check {
  position: absolute; top: -5px; right: -7px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; background: var(--primary); color: var(--navy);
  box-shadow: 0 0 0 3px var(--card);
  transform: scale(0); transition: transform 0.35s var(--ease-soft) 0.45s;
}
.tl-check .lucide { font-size: 13px; }
.tl-node.done .tl-dot { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(95, 226, 195, 0.14); }
.tl-node.done .tl-check { transform: scale(1); }
.tl-node.done .tl-label { color: var(--muted); }
/* La prochaine tâche à faire : un anneau menthe qui "respire" doucement */
.tl-node.next .tl-dot { border-color: var(--primary); animation: tl-next 2.4s ease-in-out infinite; }
@keyframes tl-next { 0%, 100% { box-shadow: 0 0 0 0 rgba(95, 226, 195, 0.28); } 50% { box-shadow: 0 0 0 7px rgba(95, 226, 195, 0); } }
.tl-node.reached .tl-dot { animation: tl-pop 0.5s var(--ease-soft) 0.55s; }
@keyframes tl-pop { 0% { transform: scale(1); } 45% { transform: scale(1.12); } 100% { transform: scale(1); } }
/* La fin : Buddy, petit, qui félicite quand tout est fait */
.tl-end { cursor: default; }
.tl-end .tl-dot { border-style: dashed; background: var(--accent-soft); overflow: visible; }
.tl-end img { width: 62px; height: 62px; object-fit: contain; object-position: 50% 100%; margin-top: -14px; transition: transform 0.4s var(--ease-soft); }
.tl-end { width: 124px; }
.tl-end .tl-label { max-width: 124px; background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.tl-end.won .tl-dot { border-style: solid; border-color: var(--primary); }
.tl-end.won img { animation: tl-bravo 0.9s var(--ease-soft) 0.6s; }
@keyframes tl-bravo { 0%, 100% { transform: translateY(0); } 35% { transform: translateY(-8px); } 65% { transform: translateY(0); } }
/* Quelques petites étoiles autour de Buddy (seulement quand la journée est bouclée) */
.tl-stars { position: absolute; inset: -12px; pointer-events: none; }
.tl-stars i { position: absolute; width: 8px; height: 8px; background: var(--warning); opacity: 0; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
.tl-stars i:nth-child(1) { top: 2px; left: 6px; }
.tl-stars i:nth-child(2) { top: -4px; right: 10px; width: 10px; height: 10px; }
.tl-stars i:nth-child(3) { bottom: 16px; right: -2px; }
.tl-end.won .tl-stars i { animation: tl-star 1.4s ease-out 0.8s both; }
.tl-end.won .tl-stars i:nth-child(2) { animation-delay: 0.95s; }
.tl-end.won .tl-stars i:nth-child(3) { animation-delay: 1.1s; }
@keyframes tl-star { 0% { opacity: 0; transform: scale(0.2) rotate(0); } 40% { opacity: 1; transform: scale(1.2) rotate(20deg); } 100% { opacity: 0.85; transform: scale(1) rotate(0); } }
/* Aucune tâche aujourd'hui */
.tl-empty { display: flex; align-items: center; gap: 14px; padding: 12px 16px; }
.tl-empty img { width: 54px; height: 54px; object-fit: contain; object-position: 50% 100%; }
.tl-empty p { flex: 1; font-weight: 600; color: var(--text-2); font-size: 0.92rem; }

/* ---------- 9. LA GRILLE DES CARTES ---------- */
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; }
.today-card { grid-column: span 4; }
.quote-card { grid-column: span 4; }
.goals-card { grid-column: span 4; }
.week-card  { grid-column: span 4; }
.cats-card  { grid-column: span 12; }
.home-dump  { grid-column: span 8; }

/* Aujourd'hui */
.checklist { list-style: none; margin: 0; padding: 0; display: grid; }
.checklist li { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: var(--s3); padding: 10px 8px; border-radius: var(--radius-md); border-bottom: 1px solid var(--border); transition: background 0.2s; }
.checklist li:last-child { border-bottom-color: transparent; }
.checklist li:hover { background: var(--card-strong); }
.checklist li.empty { display: block; border-bottom: none; }
.checklist time { color: var(--muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.check {
  width: 22px; height: 22px; border-radius: 7px;
  border: 1.8px solid var(--neutral); background: var(--card);
  cursor: pointer; position: relative; padding: 0;
  transition: background 0.2s, border-color 0.2s, transform 0.15s var(--ease);
}
.check:active { transform: scale(0.88); }
.checklist .check:hover { border-color: var(--primary); }
.checklist li.done .check { background: var(--primary); border-color: var(--primary); animation: coche 0.35s ease-out; }
.checklist li.done .check::after {
  content: ""; position: absolute; left: 6.5px; top: 2.5px; width: 5.5px; height: 10.5px;
  border: solid var(--navy); border-width: 0 2.4px 2.4px 0; transform: rotate(45deg);
}
.checklist .task-title { background: none; border: none; color: inherit; font: inherit; font-weight: 600; text-align: left; padding: 0; cursor: pointer; display: flex; align-items: center; gap: 8px; min-width: 0; }
.checklist .task-title:hover span { text-decoration: underline; text-underline-offset: 3px; }
.checklist .task-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.checklist li.done .task-title span { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.checklist li.done time { color: var(--faint); }
/* "2/4" et la barre, en haut de la carte */
.today-progress { display: flex; align-items: center; gap: var(--s3); margin: -4px 0 var(--s3); }
.today-progress .bar { flex: 1; }
.today-progress:has(.today-count:empty) { display: none; } /* pas de tâche aujourd hui : pas de barre */
.today-count { color: var(--muted); font-size: 0.82rem; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.edit-btn { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: none; background: transparent; color: var(--faint); cursor: pointer; }
.edit-btn:hover { background: var(--card-strong); color: var(--accent-ink); }
.edit-btn .lucide { font-size: 16px; }

/* Les barres de progression */
.bar { height: 7px; background: var(--card-strong); border-radius: 99px; overflow: hidden; }
.bar div { height: 100%; background: var(--c, var(--primary)); border-radius: 99px; transition: width 0.6s var(--ease); animation: bar-fill 1s var(--ease); }

/* La citation : une carte menthe, la phrase en Calistoga */
.quote-card {
  position: relative; overflow: hidden; min-height: 300px; padding: var(--s5);
  background:
    radial-gradient(circle at 100% 0%, rgba(95, 226, 195, 0.22) 0 120px, transparent 121px),
    radial-gradient(circle at -10% 110%, rgba(96, 165, 250, 0.14) 0 140px, transparent 141px),
    var(--accent-soft);
  border-color: transparent; display: flex; flex-direction: column; justify-content: center; gap: 24px;
}
/* Une phrase longue : un peu plus petite, pour rester lisible et aérée */
.quote-card blockquote.long { font-size: 1.05rem; line-height: 1.45; }
.quote-card blockquote {
  position: relative; z-index: 1; margin: 0;
  color: var(--text); font-size: 1.2rem; font-weight: 700; line-height: 1.45; letter-spacing: -0.01em;
}
.quote-card blockquote::before {
  content: "“"; font-family: var(--font-display); position: absolute; left: -6px; top: -64px; font-size: 6rem; line-height: 1; color: var(--primary); opacity: 0.35;
}

/* Mes objectifs */
.goals { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.goals li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; column-gap: var(--s3); row-gap: 8px; padding: 8px; margin: 0 -8px; border-radius: var(--radius-md); transition: background 0.2s; }
.goals li.clickable { cursor: pointer; }
.goals li.empty { display: block; }
.goals li.clickable:hover { background: var(--card-strong); }
.goal-icon { grid-row: span 2; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: color-mix(in srgb, var(--c) 14%, var(--card)); color: var(--navy); transition: transform 0.25s var(--ease-soft); }
:root[data-theme="dark"] .goal-icon { color: var(--text); }
.goal-icon .lucide { font-size: 20px; }
.goals span:not(.goal-icon) { font-weight: 600; font-size: 0.93rem; min-width: 0; }
.goals strong { font-size: 0.9rem; font-variant-numeric: tabular-nums; color: var(--text-2); }
.goals .bar { grid-column: 2 / 4; height: 6px; }
.goal-week { display: block; color: var(--muted); font-size: 0.78rem; font-weight: 500; margin-top: 2px; }
/* Sur l'accueil, on garde l'essentiel (le détail "Cette semaine : ..." reste sur la page Suivi) */
.goals-card .goal-week { display: none; }

/* Cette semaine : le cercle */
.week-card { display: flex; flex-direction: column; color: inherit; }
.week-body { flex: 1; display: flex; align-items: center; gap: var(--s5); }
.ring { position: relative; width: 124px; height: 124px; flex-shrink: 0; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring-bg { stroke: var(--card-strong); }
.ring-fg {
  stroke: url(#ring-grad); stroke-linecap: round;
  stroke-dasharray: 326.7px;
  stroke-dashoffset: calc(326.7px * (100 - var(--p)) / 100);
  animation: ring-fill 1.2s ease-out;
}
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-label strong { font-weight: 800; font-size: 1.7rem; line-height: 1; letter-spacing: -0.03em; }
.ring-label span { font-size: 0.72rem; color: var(--muted); margin-top: 4px; }
.week-stats { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); color: var(--muted); font-size: 0.9rem; }
/* Chaque ligne se lit d un trait ("25 🔥 jours de série") : la pastille de couleur est posée à gauche */
.week-stats li { position: relative; padding-left: 20px; line-height: 1.35; }
.week-stats li::before { content: ""; position: absolute; left: 0; top: 0.42em; width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent); }
.week-stats strong { margin-right: 4px; font-variant-numeric: tabular-nums; color: var(--text); }
/* Rien de coché cette semaine : un message qui donne envie de commencer (pas de 0 %) */
.week-stats li.week-hello { padding-left: 0; display: grid; gap: 4px; }
.week-stats li.week-hello::before { display: none; }
.week-hello strong { font-weight: 800; font-size: 1rem; line-height: 1.3; }
.week-hello span { color: var(--muted); font-size: 0.88rem; }
/* Un objectif à 0 % : "À lancer" en menthe, plutôt qu'un zéro */
.goals strong.goal-start { font-size: 0.78rem; font-weight: 700; color: var(--accent-ink); background: var(--accent-soft); padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
/* Page Suivi, nouveau compte : une invitation à la place des statistiques vides */
.stat-start { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: var(--accent-soft); border-color: transparent; }
.stat-start strong { display: block; font-weight: 800; font-size: 1.15rem; margin-bottom: 4px; }
.link-hint { display: flex; align-items: center; gap: 2px; color: var(--link); font-size: 0.85rem; font-weight: 700; }
.link-hint .lucide { font-size: 14px; transition: transform 0.2s var(--ease); }
.week-card:hover .link-hint .lucide { transform: translateX(3px); }

/* Mes catégories : des cartes illustrées (l'image en haut, le nom dessous) */
.categories { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s3); }
.cat {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  border-radius: 18px; border: 1px solid var(--border); background: var(--card);
  color: var(--text); cursor: pointer;
  transition: transform 0.3s var(--ease-soft), border-color 0.25s, box-shadow 0.3s var(--ease);
}
.cat-art {
  height: 92px; background: var(--photo, none) center / cover no-repeat, linear-gradient(135deg, var(--mint), color-mix(in srgb, var(--primary) 30%, var(--mint)));
  transition: transform 0.5s var(--ease-soft);
}
.cat-foot { display: flex; align-items: center; gap: 10px; padding: 10px 12px 12px; }
.cat-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--accent-soft); color: var(--navy); flex: none; transition: transform 0.3s var(--ease-soft); }
:root[data-theme="dark"] .cat-icon { color: var(--accent-ink); }
.cat-icon .lucide { font-size: 17px; }
.cat h4 { font-size: 0.9rem; font-weight: 700; line-height: 1.2; }
.cat p { display: flex; align-items: center; gap: 4px; font-size: 0.74rem; color: var(--muted); }
.cat p .lucide { font-size: 12px; transition: transform 0.2s var(--ease); }
/* "Autre" (pas d'illustration) : une grande étincelle sur fond menthe */
.cat.no-art .cat-art { display: grid; place-items: center; color: var(--primary); }
.cat.no-art .cat-art .lucide { font-size: 38px; opacity: 0.9; }

/* ---------- 9 bis. LES PETITES ANIMATIONS AU SURVOL ----------
   Très discrètes, seulement avec une souris (pas sur écran tactile). */
@media (hover: hover) {
  .cat:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: rgba(95, 226, 195, 0.45); }
  .cat:hover .cat-art { transform: scale(1.04); }
  .cat:hover .cat-icon { transform: rotate(-8deg) scale(1.06); }
  .cat:hover p .lucide { transform: translateX(3px); }
  .goals li.clickable:hover .goal-icon { transform: rotate(-6deg) scale(1.06); }
  .side-link:hover .lucide { transform: scale(1.1); }
  .tl-node:not(.tl-end):hover .tl-dot { transform: translateY(-3px) scale(1.05); box-shadow: 0 8px 18px rgba(15, 23, 42, 0.1); }
  .tl-node:not(.tl-end):hover .tl-dot .lucide { animation: petit-coucou 0.5s var(--ease-soft); }
  .tl-end:hover img { transform: translateY(-3px) rotate(-3deg); }
  .title-icon { transition: transform 0.25s var(--ease-soft); }
  .card:hover .title-icon { transform: rotate(-6deg); }
  .chip:hover .lucide, .mini-btn:hover .lucide { transform: scale(1.08); }
  .week-card:hover { transform: translateY(-2px); }
}
@keyframes petit-coucou { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-12deg); } 65% { transform: rotate(8deg); } }

/* Les cartes principales réagissent doucement au survol */
.today-card:hover, .goals-card:hover, .week-card:hover, .cats-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-lift); }

/* ---------- 10. LE PANNEAU DE DISCUSSION ---------- */
.drawer {
  position: fixed; top: 0; right: 0; z-index: 30;
  width: min(440px, 100vw); height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; gap: 14px;
  padding: 20px;
  background: var(--card); border-left: 1px solid var(--border);
  box-shadow: -20px 0 60px rgba(15, 23, 42, 0.12);
  transform: translateX(105%);           /* caché à droite de l'écran */
  visibility: hidden;                    /* … et vraiment caché une fois sorti (sinon l'iPhone élargit la page) */
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s linear 0.35s;
}
.drawer.open { transform: translateX(0); visibility: visible; transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s; } /* glisse dans l'écran */
.drawer-backdrop { position: fixed; inset: 0; z-index: 25; background: rgba(15, 23, 42, 0.28); animation: fade-in 0.2s; }
.drawer-head { display: flex; align-items: center; gap: 12px; }
.drawer-head h3 { font-weight: 800; font-size: 1.1rem; }
.drawer-head .icon-btn { margin-left: auto; background: var(--card-strong); border-color: transparent; }
.drawer-head .icon-btn + .icon-btn { margin-left: 0; }
/* L'avatar de Buddy : la mascotte en entier, dans un rond menthe */
.drawer-avatar { width: 46px; height: 46px; flex-shrink: 0; }
.drawer-avatar img { width: 100%; height: 100%; display: block; }
.style-badge { white-space: nowrap; font-family: var(--font-ui); font-size: 0.72rem; font-weight: 700; color: var(--accent-ink); background: var(--accent-soft); border-radius: 99px; padding: 3px 9px; margin-left: 6px; vertical-align: middle; }
.drawer-status { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 0.85rem; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 3px rgba(95, 226, 195, 0.25); }
.drawer-status { color: var(--accent-ink); }
.goal-chip {
  display: flex; align-items: flex-start; gap: 8px;
  background: var(--accent-soft);
  border-radius: 14px; padding: 10px 13px; font-size: 0.9rem; font-weight: 600;
}
.goal-chip .lucide { color: var(--accent-ink); margin-top: 2px; }
.chat { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px; }
.message { max-width: 86%; padding: 11px 15px; border-radius: 20px; white-space: pre-wrap; font-size: 0.95rem; animation: bulle 0.25s ease-out; }
.message.buddy { background: var(--mint); color: var(--navy); border-bottom-left-radius: 6px; }
.message.user { align-self: flex-end; background: var(--navy); color: #fff; border-bottom-right-radius: 6px; font-weight: 500; }
:root[data-theme="dark"] .message.buddy { background: var(--card-strong); color: var(--text); }
:root[data-theme="dark"] .message.user { background: var(--primary); color: var(--navy); }
.message.error { background: rgba(239, 68, 68, 0.08); border: 1px solid rgba(239, 68, 68, 0.3); }
.typing { display: flex; gap: 5px; padding: 15px 16px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); animation: typing 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
.chat-form { display: flex; gap: 10px; }
.chat-form input { border-radius: 99px; padding-left: 18px; }

/* ---------- 10 bis. LES ÉLÉMENTS COMMUNS ---------- */
.card-title { color: inherit; }
.empty { color: var(--muted); font-size: 0.92rem; padding: 10px 2px; }
.empty .btn { margin-top: 12px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--card);
  color: var(--text); font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.chip .lucide { transition: transform 0.2s var(--ease-soft); }
.chip:hover { border-color: var(--primary); }
.chip.active { background: var(--accent-soft); border-color: var(--primary); color: var(--text); }
.chip:active { transform: scale(0.97); }
.btn-danger { background: rgba(239, 68, 68, 0.1); color: var(--error); margin-right: auto; }
.btn-danger:hover { background: rgba(239, 68, 68, 0.18); }
.cat-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); display: inline-block; flex-shrink: 0; }

/* Une tâche cliquable ailleurs (cartes objectifs, suivi) */
.task-link { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; background: none; border: none; color: inherit; font: inherit; text-align: left; padding: 2px 0; cursor: pointer; }
.task-link .pen { font-size: 14px; color: var(--muted); opacity: 0; transition: opacity 0.15s; margin-left: auto; }
.task-link:hover .pen { opacity: 1; color: var(--accent-ink); }
@media (hover: none) { .task-link .pen { opacity: 0.6; } } /* sur téléphone, le crayon reste visible */

/* Les pages autres que l'accueil */
.page-padded { padding-top: 20px; max-width: 1180px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 0 0 24px; }
.page-head h1 { font-size: var(--fs-h2); line-height: var(--lh-h2); margin-bottom: 6px; }

/* Mes objectifs */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.goal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.goal-card { display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden; }
.goal-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--c); opacity: 0.8; }
.goal-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cat-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 700; color: var(--navy); background: color-mix(in srgb, var(--c) 14%, var(--card)); padding: 5px 11px; border-radius: 99px; }
:root[data-theme="dark"] .cat-pill { color: var(--text); }
.cat-pill .lucide { font-size: 15px; }
.goal-card h3 { font-size: 1.15rem; line-height: 1.3; }
.goal-card .reason { color: var(--muted); font-size: 0.9rem; }
.goal-meta { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 0.85rem; }
.goal-meta span { display: inline-flex; align-items: center; gap: 5px; }
.goal-meta .lucide { font-size: 15px; }
.goal-tasks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 0.9rem; }
.goal-tasks li { display: flex; align-items: center; gap: 8px; }
.goal-tasks .lucide { font-size: 16px; color: var(--faint); }
.goal-tasks li.done .lucide { color: var(--primary); }
.goal-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 4px; }
/* Un objectif "brouillon" (pas fini de définir avec Buddy) : bordure en pointillés, étiquette "Incomplet" */
.goal-card.draft { border: 1.5px dashed var(--border-strong); background: color-mix(in srgb, var(--card) 70%, var(--bg)); box-shadow: none; }
.goal-card.draft::before { display: none; }
.draft-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 0.75rem; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: rgba(245, 158, 11, 0.12); color: #b45309; }
:root[data-theme="dark"] .draft-badge { color: #fbbf24; }
.draft-badge .lucide { font-size: 14px; }
.goal-actions { flex-wrap: wrap; }
.goal-actions .btn { padding: 9px 14px; font-size: 0.9rem; white-space: nowrap; }

/* Suivi */
.stat-tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 22px; }
.stat-tile { padding: 18px; }
.stat-tile strong { display: block; font-weight: 800; font-size: 1.6rem; line-height: 1.2; letter-spacing: -0.02em; }
.stat-tile span { color: var(--muted); font-size: 0.85rem; }
.suivi-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; }
.suivi-goals { grid-column: 1 / -1; }
.task-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.task-row:last-child { border-bottom: none; }
.task-row-title { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; }
.task-row-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dots { display: flex; gap: 6px; }
.dot { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 0.7rem; font-weight: 700; color: var(--muted); background: var(--card-strong); }
.dot[data-status="done"] { background: color-mix(in srgb, var(--primary) 22%, transparent); color: var(--accent-ink); }
.dot[data-status="missed"] { background: color-mix(in srgb, var(--error) 14%, transparent); color: var(--error); }
.dot[data-status="todo"] { outline: 1px dashed var(--faint); }
.dot[data-status="none"] { opacity: 0.35; }
.dots-legend { display: flex; justify-content: flex-end; gap: 6px; margin-bottom: 4px; }
.dots-legend span { width: 26px; text-align: center; font-size: 0.7rem; color: var(--muted); }
.heatmap { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.heat-head { text-align: center; font-size: 0.72rem; color: var(--muted); }
.heat-cell { aspect-ratio: 1; border-radius: 8px; background: var(--card-strong); display: inline-block; }
.heat-legend .heat-cell { width: 12px; height: 12px; vertical-align: middle; margin: 0 3px 0 10px; border-radius: 3px; }
.heat-cell[data-level="1"] { background: color-mix(in srgb, var(--primary) 30%, transparent); }
.heat-cell[data-level="2"] { background: color-mix(in srgb, var(--primary) 60%, transparent); }
.heat-cell[data-level="3"] { background: var(--primary); }
.heat-cell.today { outline: 2px solid var(--text); outline-offset: 1px; }
.heat-cell.future { opacity: 0.25; }
.heat-cell.joker { background: color-mix(in srgb, var(--sky) 30%, transparent); outline: 2px dashed var(--sky); outline-offset: -2px; }
.heat-legend { margin: 12px 0 16px; }
.week-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.week-list li { display: grid; grid-template-columns: 110px 1fr 44px; align-items: center; gap: 10px; font-size: 0.88rem; color: var(--muted); }
.week-list strong { color: var(--text); text-align: right; }

/* Outils : minuteur */
.focus-card { max-width: 520px; text-align: center; }
.focus-card .card-head { text-align: left; }
.focus-time { font-size: 4.5rem; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; margin: 10px 0 18px; }
.focus-time.running { color: var(--accent-ink); }
.focus-presets, .focus-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.focus-actions { margin-top: 18px; }

/* Paramètres */
.settings { display: grid; gap: 16px; max-width: 720px; }
.settings h3 { font-size: 1.05rem; margin-bottom: 4px; }
.inline-form { display: flex; gap: 10px; margin-top: 12px; }
.style-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.style-option {
  display: grid; gap: 4px; text-align: left;
  padding: 14px; border-radius: 16px;
  border: 1px solid var(--border); background: var(--card);
  color: var(--text); font: inherit; cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.style-option:hover { border-color: var(--border-strong); }
.style-option span { color: var(--muted); font-size: 0.85rem; }
.style-option.active { border-color: var(--primary); background: var(--accent-soft); }
.settings .btn-ghost { margin-top: 12px; }
.settings .inline-form .btn-ghost { margin-top: 0; }
.field { display: grid; gap: 6px; margin-top: 14px; font-size: 0.88rem; font-weight: 600; color: var(--muted); }

/* Les interrupteurs on/off des e-mails */
.toggles { display: grid; gap: 4px; margin-top: 14px; }
.toggle-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.toggle-row:last-child { border-bottom: none; }
.toggle-row > input[type="checkbox"] { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; padding: 0; }
.toggle-row strong { display: block; font-size: 0.95rem; }
.toggle-row small { color: var(--muted); font-size: 0.82rem; }
.toggle-row input[type="time"] { width: auto; padding: 8px 10px; }
.toggle-row .switch { grid-column: 1; }
.switch { position: relative; width: 46px; height: 28px; border-radius: 99px; background: var(--neutral); transition: background 0.2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2); transition: transform 0.25s var(--ease-soft); }
:root[data-theme="dark"] .switch { background: var(--border-strong); }
.toggle-row input:checked + .switch { background: var(--primary); }
.toggle-row input:checked + .switch::after { transform: translateX(18px); }
.toggle-row input:focus-visible + .switch { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Les fenêtres (dialog) */
.dialog {
  width: min(520px, calc(100vw - 32px));
  padding: 28px; border: 1px solid var(--border); border-radius: 24px;
  background: var(--card); color: var(--text); box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
  /* Plus haute que l'écran ? La fenêtre défile toute seule (et la molette ne fait pas bouger la page derrière) */
  max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain;
}
/* Une fenêtre est ouverte : la page derrière ne bouge plus */
html:has(dialog[open]) { overflow: hidden; }
.dialog::backdrop { background: rgba(15, 23, 42, 0.32); backdrop-filter: blur(3px); }
.dialog[open] { animation: fade-up 0.25s ease-out; }
.dialog form { display: grid; gap: 14px; }
.dialog h2 { font-size: 1.35rem; }
.dialog label { display: grid; gap: 6px; font-size: 0.88rem; font-weight: 600; color: var(--muted); }
.dialog select { width: 100%; font: inherit; color: var(--text); background: var(--card-strong); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 14px; }
.dialog select option { background: var(--card); }
.dialog input[type="range"] { padding: 0; accent-color: var(--primary); background: none; border: none; box-shadow: none; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-error { color: var(--error); font-size: 0.88rem; min-height: 1em; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; }
.cat-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; margin-top: -6px; }
.cat-picker .chip { justify-content: center; }

/* Les choix de sujet dans la discussion */
.choices { display: flex; flex-wrap: wrap; gap: 8px; margin: -2px 0 6px; animation: bulle 0.3s ease-out; }
.choices .chip { font-size: 0.85rem; }

/* La bulle Buddy flottante : la mascotte dans un rond menthe */
.buddy-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 20;
  width: 68px; height: 68px; padding: 0; border: none; background: none; cursor: pointer;
  filter: drop-shadow(0 8px 14px rgba(20, 40, 75, 0.25));
  transition: transform 0.25s var(--ease-soft);
}
.buddy-fab:hover { transform: translateY(-3px) scale(1.06); }
/* La bulle de Buddy, qui se balance doucement de temps en temps (comme un petit coucou) */
.buddy-fab img { width: 100%; height: 100%; display: block; transform-origin: 20% 90%; animation: coucou 5s ease-in-out infinite; }
@keyframes coucou { 0%, 70%, 100% { rotate: 0deg; } 76% { rotate: -5deg; } 84% { rotate: 4deg; } 92% { rotate: -2deg; } }

/* Le choix "Quand ?" d'une tâche */
.segmented { display: flex; flex-wrap: wrap; gap: 8px; margin-top: -6px; }
.day-picker { display: flex; gap: 6px; }
.day-chip {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--card);
  color: var(--text); font: inherit; font-weight: 700; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.day-chip.active { background: var(--primary); border-color: var(--primary); color: var(--on-accent); }

/* Les tâches des autres jours (sous "Aujourd'hui") */
.other-days { margin-top: 14px; }
.other-days summary { cursor: pointer; color: var(--muted); font-size: 0.88rem; font-weight: 600; }
.other-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.other-list button {
  width: 100%; display: flex; align-items: center; gap: 8px;
  background: none; border: none; color: var(--text); font: inherit; font-size: 0.9rem;
  padding: 7px 8px; border-radius: 10px; cursor: pointer; text-align: left;
}
.other-list button:hover { background: var(--card-strong); }
.other-list .when { margin-left: auto; color: var(--muted); font-size: 0.8rem; white-space: nowrap; }
.task-when { color: var(--muted); font-size: 0.8rem; }

/* Les badges */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.badge-item {
  display: grid; justify-items: center; gap: 4px; text-align: center;
  padding: 16px 10px; border-radius: 18px; border: 1px solid var(--border); background: var(--card);
}
.badge-item strong { font-size: 0.9rem; }
.badge-item small { color: var(--muted); font-size: 0.76rem; line-height: 1.3; }
.badge-emoji { font-size: 2rem; line-height: 1; }
.badge-item.earned { border-color: rgba(95, 226, 195, 0.45); background: var(--accent-soft); }
.badge-item.locked .badge-emoji { filter: grayscale(1); opacity: 0.35; }
.badge-item.locked strong { color: var(--muted); }
.badge-dialog { text-align: center; }
.badge-won { display: flex; align-items: center; gap: 16px; text-align: left; margin: 8px 0 16px; }
.badge-emoji.big { font-size: 3.4rem; animation: pop 0.5s ease-out; }
.badge-won h2 { font-size: 1.2rem; margin-bottom: 4px; }

/* La zone "supprimer mon compte" */
.danger-zone { border-color: rgba(239, 68, 68, 0.3); }
.danger-zone .btn-danger { margin-top: 12px; margin-right: 0; }

/* Le petit message de confirmation (en bas, au centre) */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 50;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 12px 20px; border-radius: 99px; white-space: nowrap; max-width: calc(100vw - 32px);
  overflow: hidden; text-overflow: ellipsis;
  background: var(--navy); color: #fff; font-weight: 600; font-size: 0.95rem;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.25);
  transition: opacity 0.25s, transform 0.25s;
}
:root[data-theme="dark"] .toast { background: var(--card-hover); border: 1px solid var(--border-strong); }
.toast.error { background: #b91c1c; white-space: normal; width: max-content; max-width: min(560px, calc(100vw - 32px)); border-radius: 18px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- LES NOTIFICATIONS ---------- */
/* La bannière "Active les notifications" en haut de l'accueil */
.push-banner {
  display: flex; align-items: center; gap: var(--s4); margin: 0 0 var(--s5); padding: 14px 18px;
  border-radius: var(--radius); background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow);
  animation: fade-up 0.35s ease-out;
}
.push-banner-icon { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.push-banner-icon .lucide { font-size: 20px; }
.push-banner p { margin: 0; flex: 1; font-weight: 600; font-size: 0.95rem; line-height: 1.45; color: var(--text-2); }
.push-banner .btn { white-space: nowrap; }
.push-banner-close { width: 34px; height: 34px; flex: none; }
.push-status { margin: 12px 0; font-weight: 600; }
.push-status[data-status="denied"], .push-status[data-status="unsupported"] { color: var(--muted); font-weight: 500; font-size: 0.92rem; }
.ios-steps { margin: 14px 0 18px; padding: 0; list-style: none; display: grid; gap: 10px; line-height: 1.45; }
.ios-steps li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--card-strong); }
.ios-num { flex: none; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--primary); color: var(--navy); font-size: 0.78rem; font-weight: 800; }
.ios-icon { flex: none; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; background: var(--card); border: 1px solid var(--border); color: #0a84ff; }
.ios-icon svg { width: 24px; height: 24px; }
.ios-icon.app { padding: 0; overflow: hidden; border: none; }
.ios-icon.app img { width: 100%; height: 100%; }
@media (max-width: 700px) {
  .push-banner { flex-wrap: wrap; gap: 10px; }
  .push-banner p { flex-basis: calc(100% - 90px); font-size: 0.92rem; }
  .push-banner .btn { flex: 1; }
}

/* "Je te préviens 5 minutes avant ?" : une cloche dans un rond menthe */
.push-ask { text-align: center; max-width: 420px; }
.push-ask h2 { font-size: 1.4rem; line-height: 1.3; }
.push-ask-icon { width: 72px; height: 72px; margin: 0 auto 6px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.push-ask-icon .lucide { font-size: 34px; animation: cloche 2.4s ease-in-out infinite; transform-origin: 50% 10%; }
@keyframes cloche { 0%, 70%, 100% { transform: rotate(0); } 76% { transform: rotate(12deg); } 84% { transform: rotate(-10deg); } 92% { transform: rotate(5deg); } }
.push-ask .dialog-actions { justify-content: center; }
.push-ask .btn { white-space: nowrap; }

/* ---------- BUDDY PREMIUM ----------
   L'écran de choix après l'inscription (et sa version courte quand une limite gratuite est atteinte) */
.dialog.premium { width: min(440px, calc(100vw - 24px)); padding: 0; }
.premium-box {
  position: relative; text-align: center; padding: 30px 26px 22px;
  background:
    radial-gradient(circle at 100% 0%, var(--blob) 0 110px, transparent 111px),
    radial-gradient(circle at 0% 100%, var(--blob-2) 0 120px, transparent 121px),
    var(--card);
}
.dialog.premium form.premium-box { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.premium-close { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 50%; border: none; background: transparent; color: var(--faint); cursor: pointer; display: grid; place-items: center; }
.premium-close:hover { background: var(--card-strong); color: var(--muted); }
.premium-close .lucide { font-size: 16px; }
.premium-trial { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-ink); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.02em; }
.premium-trial .lucide { font-size: 15px; }
.dialog.premium h2 { font-family: var(--font-display); font-weight: 900; letter-spacing: -0.02em; font-size: 2rem; margin-top: 2px; }
.premium-sub { color: var(--muted); margin-top: -6px; }
.premium-reason { width: 100%; padding: 10px 14px; border-radius: var(--radius-md); background: var(--accent-soft); font-weight: 600; font-size: 0.92rem; color: var(--text); }
/* Les 5 avantages */
.premium-perks { list-style: none; margin: 6px 0 0; padding: 0; width: 100%; display: grid; gap: 10px; text-align: left; }
.premium-perks li { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 0.93rem; line-height: 1.35; }
.perk-icon { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--navy); }
:root[data-theme="dark"] .perk-icon { color: var(--accent-ink); }
.perk-icon .lucide { font-size: 18px; }
/* La petite frise : Aujourd'hui → Jour 5 → Jour 7 */
.premium-steps { list-style: none; margin: 6px 0 4px; padding: 14px 16px; width: 100%; display: grid; gap: 10px; text-align: left; border-radius: var(--radius-md); background: var(--card-strong); }
.premium-steps li { position: relative; display: grid; grid-template-columns: 82px 1fr; gap: 8px; padding-left: 20px; font-size: 0.88rem; }
.premium-steps li::before { content: ""; position: absolute; left: 0; top: 0.4em; width: 9px; height: 9px; border-radius: 50%; background: var(--primary); }
.premium-steps li:not(:last-child)::after { content: ""; position: absolute; left: 4px; top: calc(0.4em + 11px); height: calc(100% + 1px); width: 1.5px; background: color-mix(in srgb, var(--primary) 40%, transparent); }
.premium-steps li:nth-child(2)::before { background: var(--sky); }
.premium-steps li:last-child::before { background: var(--navy); }
:root[data-theme="dark"] .premium-steps li:last-child::before { background: var(--text); }
.premium-steps strong { font-weight: 700; }
.premium-steps span { color: var(--muted); }
.premium-note { font-size: 0.8rem; color: var(--muted); margin-top: -4px; }
/* "Continuer gratuitement" : un vrai lien bien visible (pas caché) */
.premium-free { border: none; background: none; padding: 6px 10px; font: inherit; font-weight: 700; font-size: 0.95rem; color: var(--link); cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.premium-free:hover { color: var(--text); }
/* La version courte (limite atteinte) : sans la frise */
.dialog.premium.short .premium-steps { display: none; }

/* ---------- LE CALENDRIER ---------- */
/* Le raccourci "Voir mon agenda →" en bas de la carte Aujourd'hui */
.agenda-link {
  display: flex; align-items: center; gap: 10px; margin-top: var(--s4); padding: 11px 16px;
  border-radius: 99px; background: var(--accent-soft);
  color: var(--text); font-weight: 700; font-size: 0.92rem; text-decoration: none;
  transition: background 0.2s;
}
.agenda-link .lucide { font-size: 18px; color: var(--accent-ink); }
.agenda-link .lucide-arrow-right { margin-left: auto; color: var(--accent-ink); transition: transform 0.2s var(--ease); }
.agenda-link:hover { background: color-mix(in srgb, var(--primary) 20%, var(--card)); }
.agenda-link:hover .lucide-arrow-right { transform: translateX(3px); }

.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.cal-card { padding: 18px; }
.cal-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
#cal-month { font-size: 1.15rem; font-weight: 800; text-transform: capitalize; min-width: 170px; text-align: center; }
.cal-today-btn { margin-left: auto; padding: 8px 14px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.cal-head { text-align: center; font-size: 0.75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; padding-bottom: 4px; }
.cal-cell {
  min-height: 96px; padding: 6px; border-radius: 14px; overflow: hidden;
  display: flex; flex-direction: column; gap: 3px;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  font: inherit; text-align: left; cursor: pointer; transition: border-color 0.2s, background 0.2s;
}
.cal-cell:hover { border-color: rgba(95, 226, 195, 0.5); }
.cal-cell.other { opacity: 0.4; }
.cal-cell.selected { border-color: var(--primary); background: var(--accent-soft); }
.cal-num { display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; font-weight: 700; }
.cal-cell.today .cal-num b { background: var(--primary); color: var(--navy); border-radius: 99px; padding: 1px 7px; }
.cal-item {
  font-size: 0.72rem; line-height: 1.3; padding: 2px 5px; border-radius: 6px;
  background: color-mix(in srgb, var(--c) 16%, transparent); border-left: 3px solid var(--c);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-item.done { opacity: 0.55; text-decoration: line-through; }
.cal-item.missed { opacity: 0.45; }
.cal-more { font-size: 0.7rem; color: var(--muted); padding-left: 4px; }
.cal-dots { display: none; flex-wrap: wrap; gap: 3px; }
.cal-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.cal-dots span.done, .cal-dots span.missed { opacity: 0.4; }

/* Le programme du jour choisi */
.cal-day h3 { font-weight: 800; font-size: 1.1rem; }
.cal-list { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 8px; }
.cal-list button {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 14px; border: 1px solid var(--border); background: var(--card);
  color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: border-color 0.2s;
}
.cal-list button:hover { border-color: rgba(95, 226, 195, 0.5); }
.cal-list .cal-past { cursor: default; }
.cal-time { min-width: 42px; color: var(--muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.cal-title { flex: 1; min-width: 0; }
/* Les pastilles de statut (comme dans la charte : un point de couleur + le mot) */
.cal-status { display: inline-flex; align-items: center; gap: 5px; font-size: 0.75rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; white-space: nowrap; background: var(--card-strong); color: var(--text-2); }
.cal-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.cal-status.done { background: rgba(34, 197, 94, 0.12); color: #15803d; }
.cal-status.done::before { background: var(--success); }
.cal-status.missed { background: rgba(239, 68, 68, 0.1); color: #b91c1c; }
.cal-status.missed::before { background: var(--error); }
.cal-status.todo { background: rgba(96, 165, 250, 0.14); color: #1d4ed8; }
.cal-status.todo::before { background: var(--sky); }
:root[data-theme="dark"] .cal-status.done { color: #4ade80; }
:root[data-theme="dark"] .cal-status.missed { color: #fca5a5; }
:root[data-theme="dark"] .cal-status.todo { color: #93c5fd; }
.cal-deadline {
  margin-top: 8px; padding: 10px 12px; border-radius: 14px; font-size: 0.9rem;
  background: var(--accent-soft);
}
@media (max-width: 1100px) { .cal-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) {
  .cal-card { padding: 14px; }
  .cal-nav { gap: 6px; }
  .cal-nav .icon-btn { width: 36px; height: 36px; }
  .cal-today-btn { padding: 7px 11px; font-size: 0.85rem; }
  /* Sur téléphone : les tâches deviennent des petits points de couleur */
  .cal-grid { gap: 4px; }
  .cal-cell { min-height: 54px; padding: 5px 4px; gap: 4px; border-radius: 10px; }
  .cal-item, .cal-more { display: none; }
  .cal-dots { display: flex; }
  .cal-num { font-size: 0.8rem; }
  #cal-month { min-width: 0; font-size: 1.1rem; }
}

/* ---------- LA VISITE GUIDÉE ----------
   Le "spot" est un cadre transparent posé sur la zone expliquée : son ombre géante
   assombrit tout le reste de l'écran. La bulle se place juste au-dessus ou en dessous. */
.tour { position: fixed; inset: 0; z-index: 100; }
.tour.no-target { background: rgba(15, 23, 42, 0.45); animation: fade-in 0.25s; }
.tour-spot {
  position: fixed; border-radius: 20px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.45), 0 0 0 3px var(--primary);
  transition: left 0.35s ease, top 0.35s ease, width 0.35s ease, height 0.35s ease, border-radius 0.35s ease;
}
.tour.no-target .tour-spot { opacity: 0; }
.tour-bubble {
  position: fixed; width: min(360px, calc(100vw - 32px));
  background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-radius: 22px;
  padding: 18px 18px 16px; box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
  transition: left 0.35s ease, top 0.35s ease;
}
.tour-bubble.pop { animation: bulle 0.3s ease-out; }
.tour-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
/* Buddy, discret, qui "chille" dans son petit rond menthe */
.tour-avatar { position: relative; width: 46px; height: 46px; border-radius: 50%; overflow: hidden; flex: none; background: var(--accent-soft); }
.tour-avatar img { position: absolute; left: 50%; bottom: -6%; height: 112%; width: auto; max-width: none; transform: translateX(-50%); }
.tour-step { font-size: 0.78rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-ink); }
.tour-skip { margin-left: auto; background: none; border: none; color: var(--muted); font: inherit; font-size: 0.88rem; cursor: pointer; padding: 4px; }
.tour-skip:hover { color: var(--text); }
.tour-bubble h3 { font-weight: 800; font-size: 1.1rem; margin: 0 0 6px; }
.tour-bubble p { margin: 0; color: var(--muted); line-height: 1.55; font-size: 0.95rem; }
.tour-foot { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.tour-foot .btn { padding: 10px 16px; white-space: nowrap; }
.tour-dots { display: flex; gap: 5px; margin-right: auto; }
.tour-dots span { width: 7px; height: 7px; border-radius: 99px; background: var(--border-strong); transition: width 0.25s, background 0.25s; }
.tour-dots span.on { width: 18px; background: var(--primary); }
@media (max-width: 700px) {
  .tour-bubble { padding: 14px 14px 12px; }
  .tour-avatar { width: 38px; height: 38px; }
  .tour-head { margin-bottom: 6px; }
  .tour-bubble h3 { font-size: 1.15rem; }
  .tour-bubble p { font-size: 0.9rem; line-height: 1.45; }
  .tour-foot { margin-top: 12px; gap: 6px; }
  .tour-foot .btn { padding: 9px 12px; }
  .tour-dots span { width: 6px; height: 6px; }
  .tour-dots span.on { width: 14px; }
}

/* Ce qui vient d'être ajouté ou modifié s'illumine un instant en menthe */
.flash { animation: flash 1.4s ease-out; }
@keyframes flash {
  0% { box-shadow: 0 0 0 0 rgba(95, 226, 195, 0.55); background-color: rgba(95, 226, 195, 0.14); }
  100% { box-shadow: 0 0 0 14px rgba(95, 226, 195, 0); }
}

/* ---------- 11. LES PETITES ANIMATIONS ---------- */
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes bulle { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-5px); opacity: 1; } }
@keyframes coche { 0% { transform: scale(0.7); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }
@keyframes ring-fill { from { stroke-dashoffset: 326.7px; } }
@keyframes bar-fill { from { width: 0; } }
@keyframes wave { 0%, 100% { transform: rotate(0); } 20%, 60% { transform: rotate(16deg); } 40%, 80% { transform: rotate(-8deg); } }

/* Pour les personnes qui ont demandé "moins d'animations" dans leur ordinateur */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- 12. TABLETTE ET TÉLÉPHONE ---------- */
@media (max-width: 1200px) {
  .today-card, .quote-card, .goals-card, .week-card { grid-column: span 6; }
  .cats-card, .home-dump { grid-column: span 12; }
  .stat-tiles { grid-template-columns: repeat(3, 1fr); }
  .banner { grid-template-columns: minmax(0, 1.2fr) minmax(170px, 210px) minmax(0, 1fr); padding: 30px 28px 20px; }
  .banner-buddy { height: 220px; }
}

@media (max-width: 900px) {
  /* le menu de gauche devient une barre en haut */
  .app-layout { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; align-items: center; gap: 12px; padding: 10px 14px; border-right: none; border-bottom: 1px solid var(--border); }
  .sidebar .logo { font-size: 1.25rem; padding: 0; }
  .side-nav { display: flex; gap: 2px; margin-left: auto; }
  .side-link { padding: 9px; }
  .side-link .lucide { font-size: 20px; color: var(--muted); } /* sur téléphone, il n'y a QUE l'icône : on la garde lisible */
  .side-link span, .side-quote { display: none; }
  .topbar { padding: 12px 16px 0; }
  .user-name { display: none; }
  .page { padding: 12px 16px 30px; }
  .page-padded { padding-top: 12px; }
  /* La bannière : le texte et Buddy en haut, la carte "On reprend…" puis la frise dessous */
  .banner {
    grid-template-columns: minmax(0, 1fr) 150px;
    grid-template-areas: "copy buddy" "resume resume" "timeline timeline";
    padding: 24px 20px 16px; border-radius: 24px;
  }
  .banner-buddy { height: 170px; }
  .resume-card { justify-self: stretch; max-width: none; }
  .page-head { flex-wrap: wrap; align-items: flex-start; }
  .suivi-grid { grid-template-columns: 1fr; }
  .stat-tiles { grid-template-columns: repeat(2, 1fr); }
  .hero { grid-template-columns: 1fr; gap: 28px; padding: 10px 16px 40px; min-height: auto; }
  .scene-hero { height: 380px; order: -1; }
  /* Sur téléphone : un visuel un peu moins haut, pour voir le bouton "C'est parti" dès l'ouverture */
  @media (max-height: 900px) { .scene-hero { height: min(250px, 30vh); } }
  .trial-pill { font-size: 0.84rem; padding: 7px 12px; margin-bottom: 14px; }
  .hero h1 { font-size: 2.3rem; }
  .hero-sub { margin: 14px 0 22px; }
  .nav { padding: 14px 16px; }
}

@media (max-width: 700px) {
  .grid { gap: 14px; }
  .today-card, .quote-card, .goals-card, .week-card, .cats-card, .home-dump { grid-column: span 12; }
  .categories { grid-template-columns: repeat(2, 1fr); }
  .week-body { justify-content: space-around; }
  .drawer { width: 100vw; }
  .style-options, .form-row { grid-template-columns: 1fr; }
  .cat-picker { grid-template-columns: repeat(2, 1fr); }
  .goal-grid { grid-template-columns: 1fr; }
  .buddy-fab { right: 14px; bottom: 14px; width: 60px; height: 60px; }
  .dot { width: 22px; height: 22px; }
  .dots-legend span { width: 22px; }
  .quote-card { min-height: 230px; }
}

@media (max-width: 520px) {
  .banner { grid-template-columns: minmax(0, 1fr) 112px; column-gap: 8px; padding: 20px 16px 14px; }
  .banner-copy h1 { font-size: 1.75rem; margin-top: 10px; }
  .banner-copy p { font-size: 0.95rem; margin-bottom: 16px; }
  .banner-copy .btn-big { padding: 12px 18px; font-size: 0.95rem; white-space: nowrap; }
  .banner-buddy { height: 132px; }
  .tl-node { width: 86px; }
  .tl-label { max-width: 86px; }
  .tl-dot { width: 46px; height: 46px; }
  .tl-dot .lucide { font-size: 20px; }
  .hero-chip { display: none; }
}

/* Petit téléphone : 6 icônes dans la barre du haut, on les resserre un peu */
@media (max-width: 420px) {
  .sidebar { gap: 8px; }
  .side-link { padding: 7px; }
  .sidebar .logo { font-size: 1.1rem; }
  .sidebar .logo-img { width: 32px; height: 32px; }
  .sidebar .logo { font-size: 1.2rem; }
}

/* ---------- 13. LES OUTILS (Vide-tête, Jours sans, Cagnotte) ---------- */
/* Deux colonnes de cartes (côte à côte sur grand écran, l'une sous l'autre sur téléphone) */
.tools-grid { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.tools-col { flex: 1 1 340px; min-width: 0; display: grid; gap: 20px; }
.tools-grid .focus-card { max-width: none; }
.premium-tag {
  display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; vertical-align: middle;
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.02em; color: var(--navy);
  background: linear-gradient(135deg, #ffe08a, #ffb547); padding: 3px 9px; border-radius: 99px;
}
.premium-tag .lucide { font-size: 12px; }
.premium-tag.big { font-size: 0.85rem; padding: 6px 14px; margin: 0; }
.btn.btn-small { padding: 8px 14px; font-size: 0.85rem; }

/* Le Vide-tête */
.dump-zone { position: relative; }
.dump-body { display: grid; gap: 12px; }
.dump-body textarea { min-height: 104px; }
.dump-result { display: grid; gap: 10px; }
.dump-message { margin: 4px 0 0; font-weight: 600; line-height: 1.45; }
.dump-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.dump-list label { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--card-strong); cursor: pointer; }
.dump-list input { width: 18px; height: 18px; flex: none; accent-color: var(--accent-ink); }
.dump-title { flex: 1; font-weight: 600; font-size: 0.92rem; }
.dump-when { font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
.dump-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.dump-row { display: flex; align-items: center; gap: 6px; }
.dump-row label { flex: 1; min-width: 0; }
.dump-edit-btn { flex: none; width: 40px; height: 40px; }
.dump-edit-btn svg { width: 17px; height: 17px; }
.dump-edit-btn.active { background: var(--accent-soft, var(--card-strong)); }
.dump-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 6px 0 4px; padding: 10px 12px; border: 1px dashed var(--border); border-radius: 12px; }
.dump-edit.hidden { display: none; }
.dump-edit label { display: grid; gap: 4px; font-size: 0.78rem; font-weight: 600; color: var(--muted); min-width: 0; padding: 0; border: 0; background: none; cursor: default; }
.dump-edit .dump-edit-title { grid-column: 1 / -1; }
.dump-edit input { width: 100%; min-width: 0; height: auto; flex: initial; }
@media (max-width: 520px) { .dump-row > label { flex-wrap: wrap; row-gap: 2px; } .dump-title { min-width: 60%; } .dump-when { margin-left: auto; } }
/* Version gratuite : on voit un exemple flouté, avec le bandeau Premium par-dessus */
.locked-overlay { display: none; }
.dump-card.locked .dump-body, .home-dump.locked .home-dump-body { filter: blur(3.5px); opacity: 0.7; pointer-events: none; user-select: none; }
.dump-card.locked .locked-overlay, .home-dump.locked .locked-overlay {
  display: flex; position: absolute; inset: 0; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 20px; text-align: center;
  /* un léger voile au centre, pour bien lire le texte par-dessus le flou */
  background: radial-gradient(closest-side, color-mix(in srgb, var(--card) 94%, transparent) 55%, transparent);
}
.locked-overlay p { margin: 0; max-width: 280px; font-weight: 800; font-size: 1.05rem; }

/* Les compteurs et les cagnottes */
.tracker-list { display: grid; gap: 12px; }
.tracker { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--border); border-radius: 16px; background: var(--card-strong); }
.tracker p { margin: 0; }
.tracker-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.quit-days { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.quit-days strong { font-family: var(--font-display); font-size: 2.4rem; font-weight: 900; line-height: 1; color: var(--accent-ink); }
.quit-days span { font-weight: 700; }
.tracker-bar { height: 8px; border-radius: 99px; background: var(--border); overflow: hidden; }
.tracker-bar span { display: block; height: 100%; border-radius: inherit; background: var(--primary); transition: width 0.6s var(--ease-soft); }
.tracker .btn-small { justify-self: start; }
.pot-name { font-size: 1rem; }
.pot-amount { color: var(--muted); }
.pot-amount b { color: var(--text); font-size: 1.15rem; }
.pot-add { display: flex; gap: 8px; }
.pot-add input { flex: 1; min-width: 0; }
.tool-form { display: grid; gap: 10px; margin-top: 12px; padding-top: 14px; border-top: 1px dashed var(--border); }
.tool-form label { display: grid; gap: 6px; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.tool-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tool-form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 480px) { .tool-form-row { grid-template-columns: 1fr; } }

/* ---------- 14. SE CONNECTER AVEC GOOGLE / APPLE ---------- */
.auth-providers { display: grid; gap: 10px; }
.btn-provider {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  padding: 12px 16px; border-radius: 99px; border: 1px solid var(--border-strong);
  background: var(--card); color: var(--text); font: inherit; font-weight: 700; cursor: pointer;
  transition: background 0.2s, transform 0.18s var(--ease);
}
.btn-provider:hover { background: var(--card-hover); transform: translateY(-1px); }
.btn-provider svg { width: 20px; height: 20px; flex: none; }
.btn-provider.apple { background: #000; color: #fff; border-color: #000; }
[data-theme="dark"] .btn-provider.apple { background: #fff; color: #000; border-color: #fff; }
.auth-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.82rem; margin: 2px 0; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ---------- 15. INSTALLER BUDDY (accueil + QR code sur ordinateur) ---------- */
.get-app {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  max-width: 880px; margin: 34px auto 0; padding: 22px 26px; border: 1px solid var(--border); border-radius: 22px;
  background: var(--card); box-shadow: var(--shadow-soft, 0 10px 30px rgba(15, 23, 42, 0.06));
}
.get-app-text { flex: 1 1 320px; display: grid; gap: 8px; }
.get-app h3 { font-family: var(--font-display); font-weight: 900; font-size: 1.3rem; }
.get-app p { margin: 0; color: var(--muted); line-height: 1.5; }
.platforms { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.platforms > span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; background: var(--accent-soft); color: var(--text); font-weight: 700; font-size: 0.86rem; }
.platforms .lucide { font-size: 16px; }
.get-app-qr { display: grid; justify-items: center; gap: 6px; max-width: 140px; text-align: center; font-size: 0.78rem; font-weight: 700; color: var(--muted); }
.get-app-qr img, .phone-card img { border-radius: 12px; border: 1px solid var(--border); background: #fff; padding: 4px; }
.phone-card { display: flex; align-items: center; gap: 18px; }
.phone-card p { margin: 4px 0 0; }
/* Le QR code n'a de sens que sur ordinateur (pas sur un téléphone ni une tablette tactile) */
@media (max-width: 760px), (pointer: coarse) { .desktop-only { display: none !important; } }

/* ---------- 16. L'ANNONCE DU LANCEMENT ---------- */
.launch-box { display: grid; gap: 12px; justify-items: center; text-align: center; }
.launch-buddy { height: 150px; width: auto; }
.launch-box p { margin: 0; color: var(--muted); line-height: 1.55; }

/* ---------- 17. MODE STORE (appli Google Play) : ni prix ni paiement, comme l'exige Google ---------- */
.premium-store { display: none; margin: 4px 0 0; font-weight: 700; color: var(--accent-ink); }
.store-mode .premium-store { display: block; }
.store-mode #plans, .store-mode #trial-pill, .store-mode #premium-start, .store-mode .premium-steps,
.store-mode .premium-note, .store-mode .premium-trial, .store-mode #plan-manage, .store-mode .get-app { display: none !important; }

/* ---------- 18. RETOUCHES (8 octobre) ---------- */
/* Formulaires à 2 colonnes : chaque case reste dans sa colonne (Safari sur iPad élargissait le champ "Heure") */
.form-row > * { min-width: 0; }
.form-row input, .form-row select { width: 100%; min-width: 0; box-sizing: border-box; }
@supports (-webkit-touch-callout: none) {
  input[type="time"], input[type="date"] { -webkit-appearance: none; appearance: none; min-width: 0; min-height: 46px; text-align: left; }
}

/* Mes objectifs : toutes les catégories sur UNE ligne, qu'on fait défiler */
#goal-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 4px; margin-right: -4px; }
#goal-filters::-webkit-scrollbar { display: none; }
#goal-filters .chip { flex: none; }

/* Les icônes des catégories (les mêmes que sur l'accueil) dans les petites pastilles */
.chip-ico { color: var(--c, var(--accent-ink)); font-size: 16px; vertical-align: -3px; margin-right: 2px; }
.chip.active .chip-ico { color: inherit; }

/* Le Vide-tête sur l'accueil */
.home-dump { display: grid; gap: 14px; align-content: start; }
.home-dump-zone { position: relative; }
.home-dump-body { display: grid; gap: 10px; grid-template-columns: 1fr auto; align-items: end; }
.home-dump-body textarea { min-height: 76px; }
@media (max-width: 700px) { .home-dump-body { grid-template-columns: 1fr; } }

/* "Voir la conversation précédente" (en haut d'une nouvelle discussion) */
.chat-previous {
  display: inline-flex; align-items: center; gap: 6px; align-self: center; margin: 2px auto 12px;
  padding: 7px 14px; border-radius: 99px; border: 1px solid var(--border); background: var(--card);
  color: var(--muted); font: inherit; font-size: 0.82rem; font-weight: 700; cursor: pointer;
}
.chat-previous:hover { color: var(--text); border-color: var(--border-strong); }
/* Mes catégories sur toute la largeur : les 7 sur une ligne (4 sur tablette, 2 sur téléphone) */
.cats-card .categories { grid-template-columns: repeat(7, 1fr); }
@media (max-width: 1200px) { .cats-card .categories { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 700px) { .cats-card .categories { grid-template-columns: repeat(2, 1fr); } }

/* ---------- 19. L'APPLI IPHONE (App Store) : la page est rangée dans l'appli ----------
   (classe "native-app" posée par app.js seulement dans l'appli : le site n'est pas concerné)
   L'écran va jusque sous l'heure (en haut) et la barre d'accueil (en bas) : on garde ces zones libres. */
.native-app .nav { padding-top: calc(18px + env(safe-area-inset-top, 0px)); }
.native-app .sidebar { padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
.native-app .auth-screen { padding-top: calc(72px + env(safe-area-inset-top, 0px)); }
.native-app .drawer { padding-top: calc(20px + env(safe-area-inset-top, 0px)); padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
.native-app .buddy-fab { bottom: calc(22px + env(safe-area-inset-bottom, 0px)); }
.native-app .toast { bottom: calc(28px + env(safe-area-inset-bottom, 0px)); }
.native-app #app { padding-bottom: env(safe-area-inset-bottom, 0px); }
/* Pas de connexion internet (au démarrage de l'appli) */
.native-offline {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  padding: 32px; text-align: center; background: var(--bg); color: var(--text);
}
.native-offline p { margin: 0; max-width: 320px; line-height: 1.5; }
/* Le bouton "Partager ma série" (dans la tuile de la série) */
.native-app .stat-tile { position: relative; }
.stat-share {
  position: absolute; top: 8px; right: 8px; width: 34px; height: 34px;
  display: grid; place-items: center; padding: 0; border: none; border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-ink); cursor: pointer;
}
.stat-share .lucide { font-size: 18px; }

/* Appli iPhone : les champs de texte en 16 px minimum (en dessous, l'iPhone zoome tout seul quand on tape dedans) */
.native-app input, .native-app textarea, .native-app select { font-size: max(16px, 1em); }

/* Écrans tactiles : les boutons réagissent immédiatement au doigt (pas d'attente du "double-tap"),
   sans le carré gris de Safari, avec un petit enfoncement visible. */
@media (pointer: coarse) {
  * { -webkit-tap-highlight-color: transparent; }
  a, button, label, summary, input, textarea, select, .chip, .side-link, [data-push], [role="button"] { touch-action: manipulation; }
  button, .btn, .chip, .icon-btn, .side-link { transition: transform 0.08s ease-out, background-color 0.15s, opacity 0.15s; }
  button:active, .btn:active, .chip:active, .icon-btn:active, .side-link:active { transform: scale(0.96); }
}
/* Appli iPhone : changement de page plus vif (comme une appli native), et pas de "rebond" de toute la page sur les côtés */
.native-app .page { animation-duration: 0.18s; }
.native-app body { overscroll-behavior-x: none; }
.native-app .chat { overscroll-behavior: contain; }

/* Petits écrans : la présentation ne dépasse jamais sur les côtés (le téléphone arrive d'en bas, pas de la droite),
   et la page entière ne peut pas glisser de gauche à droite. */
@media (max-width: 700px) {
  .showcase, .shots { overflow-x: clip; }
  .shot-phone.reveal { transform: translateY(70px) rotate(4deg); }
}
