/*! Verre — le design commun à toutes les pages.
 *
 * Chargée APRÈS la feuille propre à chaque page. Elle redéfinit d'abord les
 * JETONS que toutes les pages utilisent déjà (surfaces, bordures, rayons,
 * couleurs de texte), puis la charpente commune : police, fond, en-tête,
 * navigation, boutons, champs, cartes, volets, pied de page.
 *
 * Deux matières, pas plus :
 * - le VERRE pour ce qui flotte au-dessus de la page (en-tête, barre
 *   d'onglets, atelier) : dépoli, saturé, un reflet net sur le bord haut et
 *   une ombre portée qui lui donne de l'épaisseur ;
 * - la CARTE pour le contenu : une surface à peine teintée, un filet fin,
 *   et une lueur qui suit le pointeur au survol.
 *
 * Le Liquid Glass d'Apple réfracte ce qui passe dessous. Sur le web, cette
 * réfraction n'existe que dans Chrome, et encore partiellement (mesuré :
 * filtre décalé sur une partie de la surface) ; Safari et Firefox l'ignorent.
 * On garde donc ce qui marche partout : flou, saturation, reflet, profondeur.
 *
 * Le fond est un halo coloré qui dérive lentement, avec un grain fin. Ses
 * couleurs sont déclarées en jetons (--halo-1 à 4) : la suite `contraste`
 * mesure chaque texte sur le fond nu ET sur chaque halo à son maximum.
 */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../polices/inter.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ------------------------------------------------------------- jetons */
:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #050507;
  --halo-1: rgba(112, 88, 255, .22);
  --halo-2: rgba(32, 178, 210, .14);
  --halo-3: rgba(236, 72, 153, .10);
  --halo-4: rgba(255, 255, 255, .025);
  --halo-5: rgba(255, 255, 255, .05);
  --surface: rgba(255, 255, 255, .035);
  --surface-2: rgba(255, 255, 255, .06);
  --surface-3: rgba(255, 255, 255, .095);
  /* Verre « clair » : la variante la plus transparente du Liquid Glass. La
     teinte est presque nulle ; ce sont le liseré et l'ombre interne qui
     dessinent la matière. */
  --verre: rgba(255, 255, 255, .03);
  --verre-fort: rgba(12, 12, 18, .30);
  --verre-flou: blur(7px) saturate(200%) brightness(.94);
  --liseré: linear-gradient(135deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, .1) 28%, rgba(255, 255, 255, .03) 55%, rgba(255, 255, 255, .24));
  --verre-ombre: inset 0 1px 1px rgba(255, 255, 255, .22), inset 0 -1px 1px rgba(0, 0, 0, .25), inset 0 0 22px rgba(255, 255, 255, .035), 0 10px 40px rgba(0, 0, 0, .38);
  --border: rgba(255, 255, 255, .085);
  --border-strong: rgba(255, 255, 255, .17);
  --reflet: rgba(255, 255, 255, .16);
  --reflet-fort: rgba(255, 255, 255, .34);
  --text: #f5f5f7;
  --text-2: #dadae2;
  --muted: #c6c6d1;
  --accent: #cec6ff;
  --accent-hover: #c6bdff;
  --accent-ink: #0b0b12;
  --accent-soft: rgba(179, 167, 255, .13);
  --primaire: #f5f5f7;
  --primaire-ink: #0a0a0d;
  --good-ink: #7be39a;
  --warning-ink: #f3c25e;
  --serious-ink: #ffbb9c;
  --critical-ink: #ffb3b3;
  --radius: 18px;
  --radius-sm: 12px;
  --ombre-portee: 0 1px 1px rgba(0, 0, 0, .25), 0 12px 40px rgba(0, 0, 0, .45);
  --shadow: none;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f6f8;
  --halo-1: rgba(112, 88, 255, .14);
  --halo-2: rgba(32, 178, 210, .12);
  --halo-3: rgba(236, 72, 153, .09);
  --halo-4: rgba(0, 0, 0, .02);
  --halo-5: rgba(20, 20, 60, .06);
  --surface: rgba(255, 255, 255, .72);
  --surface-2: rgba(20, 20, 40, .04);
  --surface-3: rgba(20, 20, 40, .07);
  --verre: rgba(255, 255, 255, .2);
  --verre-fort: rgba(255, 255, 255, .4);
  --verre-flou: blur(7px) saturate(190%) brightness(1.06);
  --liseré: linear-gradient(135deg, rgba(255, 255, 255, 1), rgba(255, 255, 255, .45) 30%, rgba(30, 30, 70, .07) 58%, rgba(255, 255, 255, .85));
  --verre-ombre: inset 0 1px 1px rgba(255, 255, 255, .9), inset 0 -1px 1px rgba(30, 30, 70, .08), inset 0 0 20px rgba(255, 255, 255, .25), 0 10px 32px rgba(30, 30, 70, .12);
  --border: rgba(20, 20, 40, .09);
  --border-strong: rgba(20, 20, 40, .18);
  --reflet: rgba(255, 255, 255, .9);
  --reflet-fort: rgba(255, 255, 255, 1);
  --text: #0b0b10;
  --text-2: #2e2e38;
  --muted: #45454f;
  --accent: #3a27b8;
  --accent-hover: #3d29c2;
  --accent-ink: #ffffff;
  --accent-soft: rgba(75, 54, 214, .09);
  --primaire: #0b0b10;
  --primaire-ink: #ffffff;
  --good-ink: #175020;
  --warning-ink: #5c400a;
  --serious-ink: #7e2a0b;
  --critical-ink: #8a1a1a;
  --ombre-portee: 0 1px 2px rgba(20, 20, 40, .06), 0 12px 32px rgba(20, 20, 40, .08);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]):not([data-theme="light"]) {
    color-scheme: light;
    --bg: #f6f6f8;
    --halo-1: rgba(112, 88, 255, .14);
    --halo-2: rgba(32, 178, 210, .12);
    --halo-3: rgba(236, 72, 153, .09);
    --halo-4: rgba(0, 0, 0, .02);
    --halo-5: rgba(20, 20, 60, .06);
  --halo-5: rgba(20, 20, 60, .06);
    --surface: rgba(255, 255, 255, .72);
    --surface-2: rgba(20, 20, 40, .04);
    --surface-3: rgba(20, 20, 40, .07);
    --verre: rgba(255, 255, 255, .2);
    --verre-fort: rgba(255, 255, 255, .4);
    --verre-flou: blur(7px) saturate(190%) brightness(1.06);
    --liseré: linear-gradient(135deg, rgba(255, 255, 255, 1), rgba(255, 255, 255, .45) 30%, rgba(30, 30, 70, .07) 58%, rgba(255, 255, 255, .85));
    --verre-ombre: inset 0 1px 1px rgba(255, 255, 255, .9), inset 0 -1px 1px rgba(30, 30, 70, .08), inset 0 0 20px rgba(255, 255, 255, .25), 0 10px 32px rgba(30, 30, 70, .12);
    --border: rgba(20, 20, 40, .09);
    --border-strong: rgba(20, 20, 40, .18);
    --reflet: rgba(255, 255, 255, .9);
    --reflet-fort: rgba(255, 255, 255, 1);
    --text: #0b0b10;
    --text-2: #2e2e38;
    --muted: #45454f;
    --accent: #3a27b8;
    --accent-hover: #3d29c2;
    --accent-ink: #ffffff;
    --accent-soft: rgba(75, 54, 214, .09);
    --primaire: #0b0b10;
    --primaire-ink: #ffffff;
    --good-ink: #175020;
    --warning-ink: #5c400a;
    --serious-ink: #7e2a0b;
    --critical-ink: #8a1a1a;
    --ombre-portee: 0 1px 2px rgba(20, 20, 40, .06), 0 12px 32px rgba(20, 20, 40, .08);
  }
}

/* L'attribut hidden l'emporte toujours, même sur un display posé ici. */
[hidden] { display: none !important; }

/* --------------------------------------------------------- la base */
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { color: var(--text); font-weight: 650; letter-spacing: -.028em; line-height: 1.12; }
h1 { font-weight: 700; letter-spacing: -.036em; line-height: 1.04; }
/* Un mot trop long se coupe au lieu de pousser la page hors de l'écran. */
h1, h2, h3, p, li, summary, label, .tuile-texte, .barre > a { overflow-wrap: break-word; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }

/* ---------------------------------------------------------- le fond */
/* Deux calques fixes derrière la page : les halos, qui dérivent lentement,
   et un grain fin. Fixes, ils ne coûtent rien au défilement, et Safari les
   respecte (contrairement à un fond « attaché » à l'écran). */
body::before {
  content: ""; position: fixed; z-index: -2; pointer-events: none;
  inset: -20vmax;
  background:
    radial-gradient(42vmax 32vmax at 22% 18%, var(--halo-1), transparent 64%),
    radial-gradient(36vmax 30vmax at 82% 24%, var(--halo-2), transparent 62%),
    radial-gradient(44vmax 34vmax at 50% 96%, var(--halo-3), transparent 64%);
  animation: derive 38s ease-in-out infinite alternate;
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    radial-gradient(120% 70% at 50% -10%, var(--halo-4), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23g)'/%3E%3C/svg%3E");
}
/* Une grille fine en haut de page, qui s'efface vers le bas. Elle défile avec
   la page : elle signe le haut, elle ne suit pas la lecture. */
html::after {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  top: 0; left: 0; right: 0; height: 980px;
  background-image:
    linear-gradient(to right, var(--halo-5) 1px, transparent 1px),
    linear-gradient(to bottom, var(--halo-5) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 50% 0%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 60% 70% at 50% 0%, #000 30%, transparent 75%);
}
@keyframes derive {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(-3%, 2%, 0) scale(1.06); }
  100% { transform: translate3d(2%, -2%, 0) scale(1.02); }
}

@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ------------------------------------------------------ le verre */
/* La matière des éléments qui flottent : presque aucune teinte, un liseré en
   dégradé qui accroche la lumière en haut à gauche et en bas à droite, une
   ombre interne pour l'épaisseur, une ombre portée pour la hauteur.
   Le liseré est un calque à part, découpé par un masque pour ne garder que
   l'anneau de 1 px : posé en fond sous un verre presque transparent, il se
   verrait à travers tout le panneau et le rendrait laiteux. */
.site-header, .panel.composer, .barre-bas {
  border: 0;
  background: var(--verre);
  box-shadow: var(--verre-ombre);
}
.site-header::after, .panel.composer::after, .barre-bas::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  padding: 1px; pointer-events: none;
  background: var(--liseré);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}

/* ------------------------------------------------------- l'en-tête */
.site-header {
  position: sticky; top: 12px; z-index: 40;
  width: min(1120px, calc(100% - 24px));
  max-width: none;
  margin: 12px auto 0;
  padding: 8px 8px 8px 14px;
  min-height: 60px;
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap;
  border-radius: 22px;
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
/* Le flou est porté par un calque derrière l'en-tête, pas par l'en-tête : un
   élément flouté devient le cadre de référence de tout ce qu'il contient en
   position fixe. */
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  -webkit-backdrop-filter: var(--verre-flou);
  backdrop-filter: var(--verre-flou);
}
.brand { gap: 10px; min-width: 0; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  color: #fff;
  background: linear-gradient(145deg, #7b61ff, #2bb6d6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 4px 14px rgba(110, 90, 255, .35);
}
.brand-mark svg { width: 19px; height: 19px; }
.brand-text strong { font-size: .98rem; font-weight: 650; letter-spacing: -.02em; color: var(--text); }
.brand-text small { color: var(--muted); font-size: .76rem; }

.icon-btn, .lang-link {
  height: 38px; min-width: 38px; border-radius: 999px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-2);
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.icon-btn { width: 38px; }
.lang-link { padding: 0 14px; display: inline-flex; align-items: center; font-size: .84rem; font-weight: 560; text-decoration: none; }
.icon-btn:hover, .lang-link:hover { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }
.nav-tools { border-left: 0; padding-left: 0; margin-left: 0; display: flex; gap: 6px; flex: none; }
.header-tools { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

/* ------------------------------------------- la barre de navigation */
/* Quatre destinations, les mêmes partout. Sur ordinateur dans l'en-tête ;
   sur téléphone, en bas de l'écran, sous le pouce. Deux barres portent les
   mêmes liens, une seule existe à la fois. */
.barre {
  display: flex; align-items: center; gap: 2px;
  margin-left: auto; padding: 0;
  flex-wrap: wrap;
}
.barre > a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px;
  color: var(--muted); text-decoration: none;
  font-size: .9rem; font-weight: 520; white-space: nowrap;
  transition: background .2s ease, color .2s ease;
}
.barre > a svg { width: 17px; height: 17px; flex: none; opacity: .9; }
.barre > a:hover { color: var(--text); background: var(--surface-2); }
.barre > a[aria-current="page"] {
  color: var(--text);
  background: var(--surface-3);
  box-shadow: inset 0 1px 0 var(--reflet);
}
.barre-bas { display: none; }

@media (max-width: 760px) {
  .site-header { top: 8px; margin-top: 8px; width: calc(100% - 16px); min-height: 54px; padding: 7px 7px 7px 10px; }
  .brand-text small { display: none; }
  .barre-haut { display: none; }
  .barre-bas {
    position: fixed; z-index: 50;
    left: 50%; transform: translateX(-50%);
    bottom: max(12px, env(safe-area-inset-bottom));
    width: min(420px, calc(100% - 24px));
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
    margin: 0; padding: 6px; gap: 2px;
    border-radius: 28px;
    --verre: var(--verre-fort);
    -webkit-backdrop-filter: var(--verre-flou);
    backdrop-filter: var(--verre-flou);
  }
  .barre-bas > a {
    flex-direction: column; justify-content: center; gap: 3px;
    padding: 7px 4px; min-height: 50px; border-radius: 22px;
    font-size: .69rem; font-weight: 600; text-align: center;
    white-space: normal; overflow-wrap: anywhere; line-height: 1.15;
  }
  .barre-bas > a svg { width: 21px; height: 21px; }
  /* La barre ne doit jamais couvrir la fin de la page. */
  body { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(96px + env(safe-area-inset-bottom)) !important; }
}

/* ------------------------------------------------------ les boutons */
/* L'action principale est en couleur PLEINE et contrastée — blanc sur fond
   sombre, noir sur fond clair — comme sur les sites d'outils les plus
   soignés. Les actions secondaires sont des pastilles discrètes. */
.btn, .btn-primary, .btn-plein, .liste-box .btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px;
  border-radius: 999px;
  font-weight: 600; font-size: .92rem; letter-spacing: -.01em;
  background: var(--primaire); color: var(--primaire-ink);
  border: 1px solid transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px rgba(0, 0, 0, .2), 0 8px 24px color-mix(in srgb, var(--primaire) 14%, transparent);
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, filter .2s ease;
  filter: none;
}
.btn-primary { flex: 0 0 auto; }
.btn:hover, .btn-primary:hover, .btn-plein:hover { filter: none; transform: translateY(-1px); background: var(--primaire); border-color: transparent; }
.btn:active, .btn-primary:active, .btn-plein:active { transform: translateY(0); }
.btn kbd, .btn-primary kbd {
  font-family: var(--sans); font-size: .72rem; font-weight: 600;
  padding: 2px 6px; border-radius: 6px;
  background: color-mix(in srgb, var(--primaire-ink) 10%, transparent);
  color: inherit; border: 0;
}
.btn-ghost, .btn-sobre, .btn.btn-ghost, .btn-small, .retirer, .abo-supprimer {
  min-height: 0;
  background: transparent; color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: none;
  font-weight: 560;
}
.btn.btn-ghost, .btn-ghost { min-height: 38px; padding: 0 15px; }
.btn-ghost:hover, .btn-sobre:hover, .btn-small:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); transform: none; }

.filter, .format-chip, .tab, .case, .chip, .lang-link {
  border-radius: 999px;
}
.filter, .format-chip {
  background: transparent; border: 1px solid var(--border); color: var(--muted);
  font-weight: 520;
}
.filter:hover, .format-chip:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-2); }
.filter.is-on, .format-chip.is-active, .format-chip[aria-pressed="true"] {
  background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600;
}

/* -------------------------------------------------------- les champs */
textarea, input[type="text"], input[type="password"], input[type="url"], input[type="search"],
input[type="number"], input[type="date"], input[type="email"], select {
  font-family: var(--sans);
  border-radius: var(--radius-sm);
  background-color: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: none;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
textarea:hover, input:hover, select:hover { border-color: var(--border-strong); }
textarea:focus, input:focus, select:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  background-color: var(--surface-2);
}
::placeholder { color: var(--muted); opacity: 1; }
label, .champ label, .field label { color: var(--text-2); font-weight: 560; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ------------------------------------------------- cartes et blocs */
.card, .method-card, .verdict, .totaux, .abo, .partager, .bilan, .installer, .exemple,
.generateur, .dropzone, .carte, .epreuve, .bascule, .horizon, .liste-box, .score-hero,
.offers-setup, .signal, .tips li, .steps li, .excerpt, .history-list li,
.virement, .solde, .depense, .equilibre, .avertissement {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 var(--reflet);
}
.virement, .solde, .depense, .equilibre, .history-list li, .tips li, .steps li, .signal, .excerpt {
  border-radius: var(--radius-sm);
}
.panel {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: inset 0 1px 0 var(--reflet), var(--ombre-portee);
}
/* La lueur qui suit le pointeur : position fournie par assets/js/effets.js.
   Sans script, la carte reste simplement nette. */
.card, .method-card, .tuile { position: relative; isolation: isolate; }
.card::after, .method-card::after, .tuile::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1;
  pointer-events: none; opacity: 0; transition: opacity .3s ease;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%);
}
.card:hover::after, .method-card:hover::after, .tuile:hover::after { opacity: 1; }
.card:hover, .method-card:hover, .tuile:hover { border-color: var(--border-strong); }

.pledge {
  position: relative;
  background: transparent; border: 0; border-radius: 0;
  border-left: 0; padding: 0 0 0 26px;
  color: var(--muted); font-size: .9rem; max-width: 64ch;
}
.pledge b { color: var(--text-2); font-weight: 600; }
.pledge::before {
  content: ""; position: absolute; left: 2px; top: .42em;
  width: 9px; height: 9px; border-radius: 50%;
  background: #34c759;
  box-shadow: 0 0 0 4px rgba(52, 199, 89, .16), 0 0 12px rgba(52, 199, 89, .5);
}

/* -------------------------------------------------------- la page */
main { width: min(1120px, calc(100% - 32px)); max-width: none; margin-left: auto; margin-right: auto; padding-left: 0; padding-right: 0; }
.hero { padding-top: 72px; padding-bottom: 40px; max-width: 46rem; }
.hero h1 { font-size: clamp(2.3rem, 5.4vw, 3.6rem); }
.hero h1 em { font-style: normal; color: var(--muted); }
.lede { color: var(--text-2); line-height: 1.6; }
.hero .lede { font-size: clamp(1rem, 1.6vw, 1.12rem); margin-top: 20px; max-width: 58ch; }
.hero .pledge { margin-top: 24px; }
h2 { font-size: clamp(1.35rem, 2.4vw, 1.75rem); }
.saisie, .resultats, .explain, .findings, .advice, .truth { margin-top: 56px; }

@media (max-width: 760px) {
  main { width: calc(100% - 32px); }
  .hero { padding-top: 40px; padding-bottom: 28px; }
  .hero h1 { font-size: clamp(2rem, 9vw, 2.6rem); }
}

/* ------------------------------------- les volets d'explication */
/* Des rangées séparées par un filet, comme une foire aux questions bien
   faite : le titre seul, et le texte au clic. */
.volet { border-top: 1px solid var(--border); }
.volet:last-of-type { border-bottom: 1px solid var(--border); }
.volet + .volet { border-top: 1px solid var(--border); }
.volet > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 2px;
}
.volet > summary::-webkit-details-marker { display: none; }
.volet > summary h2 {
  margin: 0 !important; font-size: 1.02rem; font-weight: 600; letter-spacing: -.015em; line-height: 1.35;
}
.volet > summary::after {
  content: ""; flex: none; width: 22px; height: 22px; border-radius: 50%;
  background:
    linear-gradient(var(--text-2), var(--text-2)) center / 10px 1.5px no-repeat,
    linear-gradient(var(--text-2), var(--text-2)) center / 1.5px 10px no-repeat;
  border: 1px solid var(--border);
  transition: transform .25s ease;
}
.volet[open] > summary::after { transform: rotate(45deg); }
.volet > summary:hover h2 { color: var(--accent); }
.volet > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.volet-corps { padding: 0 2px 22px; }
.volet-corps > :first-child { margin-top: 0; }
.explain > h2, .truth > h2 { margin-top: 44px; }

/* ------------------------------------------------- le pied de page */
.site-footer {
  width: min(1120px, calc(100% - 32px));
  max-width: none;
  margin: 96px auto 0;
  padding: 28px 0 40px;
  border: 0; border-top: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: var(--muted); font-size: .86rem;
}
.site-footer a { color: var(--text-2); text-decoration: none; }
.site-footer a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

/* ================================================================ */
/*                             L'ACCUEIL                              */
/* ================================================================ */

/* Le haut de page, centré : une promesse, une phrase, et l'atelier juste
   dessous, comme sur les outils d'IA qu'on utilise tous les jours. */
#top > .hero { margin: 0 auto; text-align: center; padding-top: 64px; padding-bottom: 36px; max-width: 54rem; }
#top > .hero h1 { margin: 0 auto; max-width: 20ch; font-size: clamp(2.4rem, 5.4vw, 3.9rem); }
#top > .hero .lede { margin: 22px auto 0; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 12px; margin-bottom: 26px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2); font-size: .8rem; font-weight: 520;
  box-shadow: inset 0 1px 0 var(--reflet);
}
.eyebrow .dot { background: #34c759; box-shadow: 0 0 10px rgba(52, 199, 89, .7); }
.hero-stats {
  justify-content: center; gap: 0; margin-top: 30px;
}
.hero-stats li {
  background: transparent; border: 0; border-radius: 0; padding: 0 18px;
  color: var(--muted); font-size: .86rem;
}
.hero-stats li + li { border-left: 1px solid var(--border); }
.hero-stats b { color: var(--text); font-weight: 650; }

/* L'atelier : la demande au centre, le résultat dessous. */
.workspace {
  display: grid; grid-template-columns: minmax(0, 1fr);
  gap: 20px; max-width: 900px; margin: 0 auto;
}
.composer {
  position: relative; top: auto;
  padding: 10px;
  border-radius: 26px;
  display: flex; flex-direction: column;
}
.composer::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  -webkit-backdrop-filter: var(--verre-flou);
  backdrop-filter: var(--verre-flou);
}
.composer .panel-head { order: 0; padding: 10px 12px 0; }
.composer .panel-head h2 { font-size: .95rem; font-weight: 600; letter-spacing: -.01em; }
.composer .panel-hint { color: var(--muted); font-size: .84rem; }
.composer .field-textarea { order: 1; margin-top: 6px; }
.composer textarea#request {
  background: transparent; border: 0; box-shadow: none;
  min-height: 132px; font-size: 1.06rem; line-height: 1.55; padding: 12px;
  resize: vertical;
}
/* Le champ n'a pas de cadre au repos ; au focus, un anneau fin et doux à
   l'intérieur du verre, pour qu'on voie où l'on tape au clavier. */
.composer textarea#request:focus {
  border-radius: 16px;
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 60%, transparent);
}
.composer .composer-meta { padding: 0 12px; }
.composer .composer-actions {
  order: 2; margin: 6px 0 0; padding: 10px 6px 4px;
  border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.composer .composer-actions #generate { order: 9; margin-left: auto; }
.composer .settings { order: 3; margin: 0; padding: 4px 6px 4px; border-top: 0; }
.advanced > summary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 999px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-2); font-size: .84rem; font-weight: 560;
}
.advanced > summary:hover { background: var(--surface-2); color: var(--text); }
.advanced-body { padding: 14px 6px 8px; }

.result {
  border-radius: 22px;
  min-height: 0;
}
.tabs { background: transparent; padding: 8px 10px 0; border-bottom: 1px solid var(--border); }
.tab { border-radius: 999px 999px 0 0; color: var(--muted); }
.tab.is-active { color: var(--text); background: transparent; border-bottom-color: var(--text); }
#output {
  background: rgba(0, 0, 0, .22);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
:root[data-theme="light"] #output { background: rgba(255, 255, 255, .7); }
.empty-state { background: transparent; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); }

/* Les sections de l'accueil : un titre, une phrase, du contenu. */
.history, .library, .method, .liste, .offers, .outils { margin-top: 128px; scroll-margin-top: 96px; }
.section-head { margin-bottom: 28px; }
.section-head h2 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); }
.section-head .lede { color: var(--muted); font-size: 1rem; margin-top: 8px; }
.method-card .num { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.method-card h3 { margin-top: 10px; font-size: 1.02rem; }
.method-card p { color: var(--muted); font-size: .9rem; }
.card h3 { font-size: .98rem; font-weight: 600; }
.card p { color: var(--muted); }

/* ----------------------------------------------- la grille d'outils */
.tuiles {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}
.tuile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 18px;
  height: 100%; padding: 22px;
  border: 1px solid var(--border); border-radius: 22px;
  background: var(--surface);
  box-shadow: inset 0 1px 0 var(--reflet);
  color: var(--text); text-decoration: none;
  transition: border-color .25s ease, transform .25s ease;
}
.tuile:hover { transform: translateY(-2px); }
.tuile:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.tuile-icone {
  flex: none; width: 46px; height: 46px; border-radius: 13px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(145deg, var(--t1), var(--t2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 8px 20px -6px var(--t2);
}
.tuile-icone svg { width: 23px; height: 23px; }
.tuile-texte { display: grid; gap: 6px; min-width: 0; }
.tuile-texte strong { font-size: 1.02rem; font-weight: 620; letter-spacing: -.015em; }
.tuile-texte span { color: var(--muted); font-size: .9rem; line-height: 1.5; }
.t-partage { --t1: #34c759; --t2: #0f9d8f; }
.t-abonnements { --t1: #ff9f0a; --t2: #e8562c; }
.t-vrai-prix { --t1: #ffc400; --t2: #f08a00; }
.t-passe { --t1: #0a84ff; --t2: #5b5be6; }
.t-photo { --t1: #ff375f; --t2: #c81d82; }
.t-empreinte { --t1: #8e6cff; --t2: #b54ae8; }
.t-clause { --t1: #32ade6; --t2: #0a62e0; }
.t-application { --t1: #6f5cff; --t2: #1fa6bf; }

@media (max-width: 760px) {
  #top > .hero { padding-top: 32px; padding-bottom: 22px; }
  #top > .hero h1 { font-size: clamp(1.95rem, 8.6vw, 2.5rem); }
  #top > .hero .lede { font-size: .98rem; }
  /* Sur un téléphone, les trois chiffres passaient sur deux lignes bancales
     et repoussaient l'atelier hors de l'écran : la pastille du haut dit déjà
     l'essentiel. */
  .hero-stats { display: none; }
  .eyebrow { margin-bottom: 18px; }
  .history, .library, .method, .liste, .offers, .outils { margin-top: 88px; }
  .composer { border-radius: 22px; }
  .composer .composer-actions #generate { width: 100%; order: -1; margin-left: 0; }
}

/* L'en-tête se densifie dès qu'on fait défiler (classe posée par effets.js). */
/* Quand le contenu passe dessous, l'en-tête prend juste assez de teinte pour
   rester lisible : c'est ce que fait iOS avec le verre clair. */
.a-defile .site-header { --verre: var(--verre-fort); }

/* Le rappel d'un emplacement à remplir dans le prompt (texte à résumer,
   code à corriger…). */
.a-remplir { margin: 8px 0 0; font-size: .86rem; color: var(--text); }
