/* Yamoo Drive — base partagée « Champagne » (site client + Espace Bob)
   Couches : reset, base, composants, utilitaires. Jetons dans tokens.css (à charger avant).
   Mobile d'abord ; points de rupture 480 / 768 / 1024 / 1280 ; survols sous (hover: hover).
   Composants : .btn (-or, -encre, -contour, -clair, -fantome, -s, -l, -bloc), .icon-btn, .fleches/.fleche, .chip, .tag,
   .champ (+ .champ-sable, .souligne), .segment (+ .segment-verre), .carte, .carte-media, .rail-cartes, .verre-clair,
   .verre-sombre, .filet, .filet-or, .titre-serif (+ -hero, -edito, -section), .edito, .fond-*, .feuille, .toast. */

/* ============================== RESET ============================== */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
  html, body { overflow-x: clip; }
  body { margin: 0; min-height: 100dvh; }
  img, picture, video, canvas { display: block; max-width: 100%; }
  img { height: auto; }
  input, button, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
  button, [role="button"], label[for], select, summary { cursor: pointer; }
  button:disabled { cursor: not-allowed; }
  textarea { resize: vertical; }
  p, h1, h2, h3, h4, h5, h6, figure, blockquote, dl, dd { margin: 0; }
  ul[role="list"], ol[role="list"] { list-style: none; margin: 0; padding: 0; }
  :where(h1, h2, h3, h4) { overflow-wrap: break-word; text-wrap: balance; }
  :where(p, li, figcaption) { text-wrap: pretty; }
  table { border-collapse: collapse; }
  [hidden] { display: none !important; }
  @media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
  }
}

/* ============================== BASE ============================== */
@layer base {
  html { scroll-padding-top: calc(var(--h-entete) + var(--s-4)); }
  /* Feuille ouverte : défilement bloqué sans décalage ; la largeur de la barre (--barre-defil, posée par Y.ouvrir)
     devient une marge, et le voile couvre tout l'écran, sans bande unie à droite */
  html.feuille-ouverte { overflow: hidden; scrollbar-gutter: auto; padding-right: var(--barre-defil, 0px); }
  body {
    font-family: var(--texte);
    font-size: var(--t-corps);
    line-height: 1.6;
    color: var(--encre);
    background: var(--creme);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-kerning: normal;
    /* Jamais de faux gras : Instrument Serif n'existe qu'en 400, une graisse 700 ou 800 héritée d'une vue reste fine. */
    font-synthesis-weight: none;
  }
  a { color: var(--encre); text-underline-offset: .2em; text-decoration-thickness: from-font; }
  /* Titres : h1 et h2 en Instrument Serif 400 (grands titres, sections) ; h3 et h4 en Instrument Sans (cartes, blocs). */
  h1, h2, h3, h4 { color: inherit; }
  h1, h2 { font-family: var(--serif); font-weight: 400; letter-spacing: var(--serre); }
  h1 { font-size: var(--t-1); line-height: 1.02; }
  h2 { font-size: var(--t-2); line-height: 1.06; }
  h3, h4 { font-family: var(--texte); letter-spacing: -.01em; }
  h3 { font-size: var(--t-3); font-weight: 500; line-height: 1.25; }
  h4 { font-size: var(--t-4); font-weight: 600; line-height: 1.3; }
  :where(h1, h2) em { font-style: italic; }
  small { font-size: var(--t-petit); }
  strong, b { font-weight: 600; }
  hr { border: 0; border-top: 1px solid var(--trait); margin: var(--s-5) 0; }
  ::selection { background: var(--or-pale); color: var(--encre); }
  ::placeholder { color: var(--gris-2); opacity: 1; }

  /* Focus : anneau doré foncé (5,4:1 sur crème) au clavier uniquement ; doré clair sur fond sombre ou photo */
  :focus-visible { outline: 2px solid var(--or-texte); outline-offset: 3px; }
  :where(.sur-nuit, .sur-photo) :focus-visible { outline-color: var(--or-clair); }
  :focus:not(:focus-visible) { outline: none; }
  [tabindex="-1"]:focus { outline: none; }
}

/* ============================== COMPOSANTS ============================== */
@layer composants {

  /* ---------- Mise en page ---------- */
  .cadre { width: min(var(--largeur), 100% - 2 * var(--gouttiere)); margin-inline: auto; }
  .section { padding-block: var(--section); }
  .entete { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--s-4) var(--s-5); margin-bottom: clamp(20px, 3vw, 36px); }
  .entete > a { display: inline-flex; align-items: center; gap: var(--s-2); min-height: 44px; font-weight: 600; text-decoration: underline; text-decoration-color: var(--or); text-underline-offset: 5px; color: var(--encre); }
  /* h2 de section : Instrument Serif, interlettrage légèrement serré */
  .entete h2 { font-family: var(--serif); font-weight: 400; font-size: var(--t-2); line-height: 1.06; letter-spacing: var(--serre); }
  .grille-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
  .bloc { margin-top: var(--s-6); }
  .bloc > h3 { margin-bottom: var(--s-3); }
  .boite {
    background: var(--ivoire);
    border-radius: var(--r-carte);
    box-shadow: inset 0 0 0 1px var(--trait);
    padding: clamp(20px, 3vw, 32px);
  }
  .boite > h3 { font-size: 1.25rem; }

  /* ---------- Fonds de section (alternance blanc, crème, or pâle, encre) ---------- */
  .fond-blanc { background: var(--blanc); }
  .fond-creme { background: var(--creme); }
  .fond-ivoire { background: var(--ivoire); }
  .fond-or-pale { background: var(--or-pale); }
  .fond-encre { background: var(--encre); color: var(--blanc); }

  /* ---------- Titres serif (utilitaires) ---------- */
  .titre-serif { font-family: var(--serif); font-weight: 400; line-height: 1.04; letter-spacing: var(--serre); text-wrap: balance; }
  .titre-hero { font-family: var(--serif); font-weight: 400; font-size: var(--t-hero); line-height: 1; letter-spacing: -.02em; text-wrap: balance; }
  .titre-edito { font-family: var(--serif); font-weight: 400; font-size: var(--t-edito); line-height: 1.04; letter-spacing: var(--serre); text-wrap: balance; }
  .titre-section { font-family: var(--serif); font-weight: 400; font-size: var(--t-2); line-height: 1.06; letter-spacing: var(--serre); text-wrap: balance; }
  :where(.titre-serif, .titre-hero, .titre-edito, .titre-section) em { font-style: italic; }
  :where(.sur-nuit, .sur-photo) :where(.titre-serif, .titre-hero, .titre-edito, .titre-section) em { color: var(--or-clair); }
  .chapeau { font-size: clamp(1.0625rem, 1rem + .35vw, 1.25rem); line-height: 1.55; color: var(--gris); max-width: 52ch; }
  .sur-nuit .chapeau { color: var(--blanc-70); }

  /* Grande phrase éditoriale centrée (sur or pâle) avec une ligne d'appui */
  .edito { display: grid; justify-items: center; gap: var(--s-5); text-align: center; }
  .edito-phrase { max-width: 18ch; font-family: var(--serif); font-weight: 400; font-size: var(--t-edito); line-height: 1.04; letter-spacing: var(--serre); text-wrap: balance; }
  .edito-appui { max-width: 46ch; font-size: clamp(1.0625rem, 1rem + .4vw, 1.375rem); line-height: 1.5; color: var(--encre); }

  /* ---------- Surtitre : petit, gris, précédé d'un filet d'or ---------- */
  .section-eyebrow {
    display: inline-flex; align-items: center; gap: var(--s-3);
    margin-bottom: var(--s-4);
    font-family: var(--texte); font-size: var(--t-micro); font-weight: 600; line-height: 1.3;
    letter-spacing: .16em; text-transform: uppercase;
    color: var(--gris);
  }
  .section-eyebrow::before { content: ""; flex: none; width: 20px; height: 1px; background: var(--or); }
  .sur-nuit { color: var(--blanc); }
  .sur-nuit .section-eyebrow { color: var(--or-clair); }
  .sur-nuit .muted { color: var(--blanc-70); }

  /* ---------- Filets ---------- */
  .filet { height: 1px; border: 0; margin: 0; background: var(--trait); }
  .sur-nuit .filet { background: var(--trait-nuit); }
  .filet-or { display: block; width: 40px; height: 1px; border: 0; margin: 0; background: var(--or); }

  /* ---------- Verre clair et verre sombre (sur photo) ---------- */
  .verre-clair {
    background: var(--verre-ivoire); color: var(--encre);
    -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
    box-shadow: inset 0 0 0 1px var(--trait-verre);
  }
  .verre-sombre {
    background: var(--verre-sombre); color: var(--blanc);
    -webkit-backdrop-filter: blur(18px) saturate(1.2); backdrop-filter: blur(18px) saturate(1.2);
    box-shadow: inset 0 0 0 1px var(--blanc-20);
  }

  /* ---------- Icônes ---------- */
  svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

  /* ---------- Boutons : pilules ----------
     .btn-or      principal : aplat or champagne, texte encre (6,5:1)
     .btn-encre   secondaire : encre, texte blanc (alias .btn-nuit, .btn-bleu, .btn-indigo)
     .btn-contour contour encre fin, fond transparent (alias .btn-clair : fond ivoire et filet)
     .btn-fantome clair sur sombre ou sur photo : filet blanc, verre léger (alias .btn-verre)
     Tailles : .btn-s (44 px), .btn (48 px), .btn-l (56 px) ; .btn-bloc pleine largeur. */
  .btn {
    position: relative; isolation: isolate; overflow: hidden;
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 48px; padding: 0 24px;
    border: 0; border-radius: var(--r-pill);
    background: var(--ivoire); color: var(--encre);
    font-family: var(--texte); font-size: 1rem; font-weight: 600; line-height: 1.15; letter-spacing: -.005em;
    text-decoration: none; text-align: center; white-space: nowrap;
    user-select: none; -webkit-user-select: none;
    transition: transform var(--d-1) var(--ease), background-color var(--d-2) var(--ease), box-shadow var(--d-2) var(--ease), color var(--d-2) var(--ease), opacity var(--d-2);
  }
  .btn svg.i { width: 18px; height: 18px; }
  .btn:active { transform: scale(.98); }
  .btn:focus-visible { outline-offset: 3px; }

  .btn-or, .btn-laiton { background: var(--or); color: var(--encre); box-shadow: none; }
  .btn-encre, .btn-nuit, .btn-bleu, .btn-indigo { background: var(--encre); color: var(--blanc); }
  .btn-contour { background: transparent; color: var(--encre); box-shadow: inset 0 0 0 1px var(--encre); }
  .btn-clair { background: var(--ivoire); color: var(--encre); box-shadow: inset 0 0 0 1px var(--trait-2); }
  .btn-fantome, .btn-verre {
    background: var(--blanc-08); color: var(--blanc);
    box-shadow: inset 0 0 0 1px var(--blanc-50);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  }
  /* Sur fond clair, un bouton « verre » devient un contour encre (lisible) */
  :where(.fond-creme, .fond-blanc, .fond-or-pale, .boite, .feuille, .pied) .btn-verre:where(:not(.sur-nuit *)) {
    background: transparent; color: var(--encre); box-shadow: inset 0 0 0 1px var(--encre);
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .btn-bloc { display: flex; width: 100%; }
  .btn-s { min-height: 44px; padding: 0 18px; font-size: .9375rem; gap: 8px; }
  .btn-s svg.i { width: 16px; height: 16px; }
  .btn-l { min-height: 56px; padding: 0 32px; font-size: 1.0625rem; }
  /* Avant Y.peindreIcones (DOMContentLoaded) : place de l'icône réservée, le bouton garde sa largeur (CLS). */
  .btn[data-i]:not([data-fait]) { padding-inline-start: 52px; }
  .btn-s[data-i]:not([data-fait]) { padding-inline-start: 40px; }

  @media (hover: hover) {
    .btn-or:hover, .btn-laiton:hover { background: var(--or-survol); }
    .btn-encre:hover, .btn-nuit:hover, .btn-bleu:hover, .btn-indigo:hover { background: var(--encre-3); }
    .btn-contour:hover { background: var(--encre); color: var(--blanc); }
    .btn-clair:hover { box-shadow: inset 0 0 0 1px var(--encre); }
    .btn-fantome:hover, .btn-verre:hover { background: var(--blanc-20); }
    :where(.fond-creme, .fond-blanc, .fond-or-pale, .boite, .feuille, .pied) .btn-verre:where(:not(.sur-nuit *)):hover { background: var(--encre); color: var(--blanc); }
  }

  .btn:disabled, .btn[aria-disabled="true"] {
    background: var(--sable-2); color: var(--gris);
    box-shadow: none;
    cursor: not-allowed; transform: none;
  }

  /* ---------- Bouton icône ---------- */
  .icon-btn {
    position: relative;
    display: inline-grid; place-items: center; flex: none;
    width: 44px; height: 44px; padding: 0;
    border: 0; border-radius: 50%;
    background: var(--ivoire); color: var(--encre);
    box-shadow: inset 0 0 0 1.5px var(--trait);
    text-decoration: none;
    transition: transform var(--d-1) var(--ease), box-shadow var(--d-2) var(--ease), background-color var(--d-2) var(--ease), color var(--d-2);
  }
  .icon-btn:active { transform: scale(.92); }
  .icon-btn:disabled { opacity: .45; }
  @media (hover: hover) {
    .icon-btn:hover { box-shadow: inset 0 0 0 1.5px var(--encre); }
  }

  /* ---------- Puces, étiquettes, points ---------- */
  .chip {
    display: inline-flex; align-items: center; gap: var(--s-2);
    min-height: 44px; padding: 0 18px;
    border: 0; border-radius: var(--r-pill);
    background: var(--ivoire); color: var(--encre);
    box-shadow: inset 0 0 0 1px var(--trait-2);
    font-size: var(--t-petit); font-weight: 500; line-height: 1.2; white-space: nowrap; text-decoration: none;
    transition: background-color var(--d-2) var(--ease), color var(--d-2), box-shadow var(--d-2), transform var(--d-1) var(--ease);
  }
  .chip svg.i { width: 18px; height: 18px; }
  .chip:active { transform: scale(.96); }
  .chip[aria-pressed="true"], .chip[aria-current], .chip.actif { background: var(--encre); color: var(--blanc); box-shadow: none; }
  @media (hover: hover) {
    .chip:not([aria-pressed="true"]):hover { box-shadow: inset 0 0 0 1px var(--encre); }
  }

  .tag {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: var(--r-pill);
    background: var(--sable); color: var(--encre);
    font-size: var(--t-micro); font-weight: 600; line-height: 1.35; white-space: nowrap;
  }
  .tag svg.i { width: 14px; height: 14px; }
  .tag.ok { background: var(--palme-pale); color: var(--palme); }
  .tag.alerte { background: var(--laterite-pale); color: var(--laterite); }
  .tag.attente { background: var(--or-pale); color: var(--or-texte); }

  .point { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
  .point.vivant { animation: pouls 1.8s var(--ease) infinite; }
  @keyframes pouls {
    0% { box-shadow: 0 0 0 0 currentColor; }
    70% { box-shadow: 0 0 0 8px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
  }

  .lien-aide {
    display: inline-flex; align-items: center; gap: var(--s-2);
    min-height: 44px; padding: 0;
    border: 0; background: none; color: inherit;
    font-weight: 600; text-decoration: underline; text-underline-offset: 4px;
    text-decoration-color: var(--or); text-decoration-thickness: 1.5px;
  }
  .lien-aide svg.i { width: 18px; height: 18px; }

  /* ---------- Flèches rondes de carrousel (44 px), seules ou groupées dans une pilule .fleches ---------- */
  .fleches {
    display: inline-flex; gap: 4px; padding: 4px;
    border-radius: var(--r-pill);
    background: var(--ivoire); box-shadow: inset 0 0 0 1px var(--trait), var(--ombre-1);
  }
  .fleche {
    display: inline-grid; place-items: center; flex: none;
    width: 44px; height: 44px; padding: 0;
    border: 0; border-radius: 50%;
    background: var(--ivoire); color: var(--encre);
    box-shadow: inset 0 0 0 1px var(--trait-2);
    transition: background-color var(--d-2) var(--ease), color var(--d-2), box-shadow var(--d-2), opacity var(--d-2);
  }
  .fleches .fleche { box-shadow: none; background: transparent; }
  .fleche svg.i { width: 18px; height: 18px; }
  .fleche:disabled, .fleche[aria-disabled="true"] { opacity: .35; cursor: default; }
  .sur-nuit .fleche, .sur-photo .fleche { background: var(--blanc-08); color: var(--blanc); box-shadow: inset 0 0 0 1px var(--blanc-50); }
  @media (hover: hover) {
    .fleche:not(:disabled):hover { background: var(--encre); color: var(--blanc); box-shadow: none; }
    :is(.sur-nuit, .sur-photo) .fleche:not(:disabled):hover { background: var(--blanc); color: var(--encre); }
  }

  /* ---------- Cartes ----------
     .carte : surface ivoire, filet fin, rayon 20 px.
     .carte-media : photo arrondie puis texte posé sur le fond (surtitre gris, titre, texte, bouton contour). */
  .carte {
    position: relative;
    background: var(--ivoire); color: var(--encre);
    border-radius: var(--r-carte);
    box-shadow: inset 0 0 0 1px var(--trait);
    padding: clamp(20px, 2.4vw, 28px);
  }
  .carte-media { display: grid; align-content: start; gap: var(--s-3); min-width: 0; color: inherit; text-decoration: none; }
  .carte-photo { width: 100%; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--r-carte); background: var(--sable); }
  .carte-photo img, img.carte-photo { width: 100%; height: 100%; object-fit: cover; }
  .carte-surtitre { margin-top: var(--s-2); color: var(--gris); font-size: var(--t-petit); font-weight: 500; }
  .carte-titre { font-family: var(--texte); font-size: var(--t-3); font-weight: 500; line-height: 1.25; letter-spacing: -.01em; }
  .carte-texte { color: var(--gris); font-size: var(--t-corps); line-height: 1.55; }
  .carte-media > .btn { justify-self: start; margin-top: var(--s-2); }
  .sur-nuit .carte-texte, .sur-nuit .carte-surtitre { color: var(--blanc-70); }

  /* ---------- Rail de cartes : défilement à l'aimant, la carte suivante dépasse sur mobile ---------- */
  .rail-cartes {
    --colonnes: 1.18;
    display: grid; grid-auto-flow: column;
    grid-auto-columns: calc((100% - (var(--colonnes) - 1) * var(--s-5)) / var(--colonnes));
    gap: var(--s-5);
    overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scroll-padding-inline: 0;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  .rail-cartes::-webkit-scrollbar { display: none; }
  .rail-cartes > * { scroll-snap-align: start; min-width: 0; }
  @media (min-width: 600px) { .rail-cartes { --colonnes: 2.15; } }
  @media (min-width: 1024px) { .rail-cartes { --colonnes: 3; gap: var(--s-6); grid-auto-columns: calc((100% - 2 * var(--s-6)) / 3); } }

  /* ---------- Plaque camerounaise (code de location) ---------- */
  .plaque {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 6px 14px 6px 8px; border-radius: var(--r-xs);
    background: var(--plaque); color: var(--encre);
    box-shadow: inset 0 0 0 2px var(--encre);
    font-family: var(--texte); font-size: 26px; font-weight: 800; line-height: 1; letter-spacing: .04em;
    font-variant-numeric: tabular-nums;
  }
  .plaque small {
    display: grid; place-items: center;
    padding: 4px; border-radius: 4px;
    background: var(--encre); color: var(--plaque);
    font-family: var(--texte); font-size: 12px; font-weight: 700; line-height: 1.1; letter-spacing: .04em;
  }

  /* ---------- Motif ndop ---------- */
  .ndop { background-color: var(--encre); }

  /* ---------- Champs ---------- */
  /* ---------- Champs ----------
     .champ : libellé au-dessus, champ encadré ivoire (rayon 12 px, 16 px de texte : pas de zoom iOS).
     .champ.champ-sable : fond sable sans bord (formulaires posés sur ivoire).
     .champ.souligne : champ souligné, sans cadre (barre de réservation du héros) ; clair sur sombre dans .sur-nuit / .sur-photo. */
  .champ { display: grid; gap: 6px; font-size: var(--t-petit); font-weight: 500; color: var(--encre); }
  .champ input, .champ select, .champ textarea {
    width: 100%; min-width: 0; min-height: 48px;
    padding: 10px 14px;
    border: 1px solid var(--trait-2); border-radius: var(--r-champ);
    background: var(--ivoire); color: var(--encre);
    font-size: 1rem; font-weight: 400; line-height: 1.4;
    transition: border-color var(--d-2) var(--ease), box-shadow var(--d-2) var(--ease), background-color var(--d-2);
  }
  .champ textarea { min-height: 104px; }
  .champ select {
    appearance: none; -webkit-appearance: none;
    padding-right: 44px;
    background-image: var(--chevron); background-repeat: no-repeat; background-position: right 14px center; background-size: 18px;
  }
  .champ input:focus, .champ select:focus, .champ textarea:focus { outline: 0; border-color: var(--encre); box-shadow: var(--anneau-champ); }
  .champ input:user-invalid, .champ select:user-invalid, .champ textarea:user-invalid { border-color: var(--laterite); }
  .champ input:disabled, .champ select:disabled, .champ textarea:disabled { background: var(--sable); color: var(--gris); }
  .champ-sable :is(input, select, textarea) { background-color: var(--sable); border-color: transparent; }
  .champ-sable :is(input, select, textarea):focus { background-color: var(--ivoire); }
  .champ.souligne { gap: 2px; font-size: var(--t-micro); font-weight: 500; letter-spacing: .02em; }
  .champ.souligne :is(input, select) {
    min-height: 44px; padding: 6px 0;
    border: 0; border-bottom: 1px solid var(--trait-2); border-radius: 0;
    background-color: transparent;
  }
  .champ.souligne select { padding-right: 28px; background-position: right 0 center; }
  .champ.souligne :is(input, select):focus { border-bottom-color: var(--encre); box-shadow: 0 1px 0 var(--encre); }
  :where(.sur-nuit, .sur-photo) .champ.souligne { color: var(--blanc-70); }
  :where(.sur-nuit, .sur-photo) .champ.souligne :is(input, select) { color: var(--blanc); border-bottom-color: var(--blanc-50); color-scheme: dark; }
  :where(.sur-nuit, .sur-photo) .champ.souligne select { background-image: var(--chevron-clair); }
  :where(.sur-nuit, .sur-photo) .champ.souligne select option { color: var(--encre); background: var(--ivoire); }
  :where(.sur-nuit, .sur-photo) .champ.souligne :is(input, select):focus { border-bottom-color: var(--or-clair); box-shadow: 0 1px 0 var(--or-clair); }

  /* ---------- Segment en pilule : boutons aria-pressed, ou radios (label > input[type=radio] + texte) ----------
     .segment-verre : sur photo ou fond sombre (verre, choix actif ivoire). */
  .segment {
    display: flex; gap: 2px; padding: 3px;
    border-radius: var(--r-pill);
    background: var(--sable);
    box-shadow: inset 0 0 0 1px var(--trait);
  }
  .segment button, .segment label {
    position: relative;
    flex: 1 1 0; min-width: 0; min-height: 44px; padding: 0 16px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: var(--r-pill);
    background: transparent; color: var(--gris);
    font-size: var(--t-petit); font-weight: 600; line-height: 1.2; text-align: center;
    transition: background-color var(--d-2) var(--ease), color var(--d-2), box-shadow var(--d-2);
  }
  .segment label input[type="radio"] { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
  .segment label:has(input:focus-visible) { outline: 2px solid var(--or-texte); outline-offset: 2px; }
  .segment button[aria-pressed="true"], .segment label:has(input:checked) { background: var(--encre); color: var(--blanc); box-shadow: var(--ombre-1); }
  .segment.large { border-radius: var(--r-m); }
  .segment.large :is(button, label) { min-height: 52px; padding: 6px 10px; border-radius: calc(var(--r-m) - 2px); white-space: normal; }
  .segment-verre {
    background: var(--blanc-08); box-shadow: inset 0 0 0 1px var(--blanc-50);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  }
  .segment-verre :is(button, label) { color: var(--blanc); }
  .segment-verre button[aria-pressed="true"], .segment-verre label:has(input:checked) { background: var(--ivoire); color: var(--encre); }
  @media (hover: hover) {
    .segment button:not([aria-pressed="true"]):hover, .segment label:not(:has(input:checked)):hover { color: var(--encre); }
    .segment-verre button:not([aria-pressed="true"]):hover, .segment-verre label:not(:has(input:checked)):hover { color: var(--blanc); background: var(--blanc-12); }
  }

  /* ---------- Interrupteur 52 × 32 ---------- */
  .inter { position: relative; display: inline-block; vertical-align: middle; flex: none; width: 52px; height: 32px; }
  .inter input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
  .inter span { position: absolute; inset: 0; border-radius: var(--r-pill); background: var(--trait-2); transition: background-color var(--d-2) var(--ease); }
  .inter span::after {
    content: ""; position: absolute; top: 3px; left: 3px;
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--blanc); box-shadow: var(--ombre-pouce-s);
    transition: transform var(--d-2) var(--spring);
  }
  .inter input:checked + span { background: var(--encre); }
  .inter input:checked + span::after { transform: translateX(20px); }
  .inter input:disabled { cursor: not-allowed; }
  .inter input:disabled + span { opacity: .6; }
  .inter input:focus-visible + span { outline: 3px solid var(--or); outline-offset: 3px; }

  /* ---------- Curseur (range) : la variable --p (ex. 40%) colore la partie parcourue ---------- */
  input[type="range"] {
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 32px; margin: 0;
    background: transparent;
  }
  input[type="range"]::-webkit-slider-runnable-track {
    height: 8px; border-radius: 4px;
    background: linear-gradient(to right, var(--encre) var(--p, 50%), var(--sable-2) var(--p, 50%));
  }
  input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 28px; height: 28px; margin-top: -10px; border-radius: 50%;
    background: var(--blanc); border: 3px solid var(--encre);
    box-shadow: var(--ombre-pouce);
    transition: transform var(--d-1) var(--ease);
  }
  input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.12); }
  input[type="range"]::-moz-range-track { height: 8px; border-radius: 4px; background: var(--sable-2); }
  input[type="range"]::-moz-range-progress { height: 8px; border-radius: 4px; background: var(--encre); }
  input[type="range"]::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: var(--blanc); border: 3px solid var(--encre); box-shadow: var(--ombre-pouce); }
  input[type="range"]:focus-visible { outline: none; }
  input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: var(--anneau-or); }
  input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: var(--anneau-or); }

  /* ---------- Option (ligne libellé + interrupteur) ---------- */
  .option { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--trait); }
  .option:last-child { border-bottom: 0; }
  .option > div { flex: 1; min-width: 0; }
  .option small { display: block; margin-top: 2px; color: var(--gris); font-size: var(--t-petit); line-height: 1.45; }

  /* ---------- Voile et feuilles ---------- */
  .voile {
    position: fixed; inset: 0; z-index: var(--z-voile);
    background: var(--voile-nuit);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    opacity: 0; pointer-events: none;
    transition: opacity var(--d-3) var(--ease);
  }
  .voile.ouvert { opacity: 1; pointer-events: auto; }

  /* Mobile : feuille basse. Le JS (Y.fermer) remet [hidden] après 460 ms : transitions ≤ 440 ms. */
  .feuille {
    position: fixed; inset: auto 0 0 0; z-index: var(--z-feuille);
    display: flex; flex-direction: column;
    max-height: 92dvh;
    overflow: hidden;
    background: var(--ivoire); color: var(--encre);
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    box-shadow: var(--ombre-feuille);
    transform: translateY(104%);
    transition: transform 420ms var(--ease);
  }
  .feuille.ouvert { transform: none; }
  /* Pile de feuilles : Y.ouvrir rend inertes celles du dessous ; elles passent sous un voile, seule la feuille
     du sommet paraît active (Lya → devis → envoi). */
  .feuille::after {
    content: ""; position: absolute; inset: 0; z-index: 50; pointer-events: none;
    border-radius: inherit;
    background: var(--voile-nuit);
    opacity: 0;
    transition: opacity var(--d-3) var(--ease);
  }
  .feuille.ouvert[inert]::after { opacity: 1; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
  .feuille .poignee { flex: none; width: 40px; height: 5px; margin: 10px auto 0; border-radius: 3px; background: var(--trait-2); }
  .feuille-tete { flex: none; display: flex; align-items: center; gap: var(--s-3); padding: 14px 20px 12px; }
  .feuille-tete :is(h2, h3) { font-family: var(--serif); font-size: 1.625rem; font-weight: 400; letter-spacing: var(--serre); line-height: 1.12; }
  .feuille-corps { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 4px 20px 24px; }
  .feuille-corps:last-child { padding-bottom: calc(24px + var(--bas-sur)); }
  .feuille-pied { flex: none; padding: 14px 20px calc(16px + var(--bas-sur)); border-top: 1px solid var(--trait); background: var(--ivoire); }

  /* Tablette et ordinateur : fenêtre centrée avec zoom d'entrée */
  @media (min-width: 768px) {
    .feuille {
      inset: 50% auto auto 50%;
      width: min(640px, 100vw - 48px);
      max-height: min(88dvh, 880px);
      border-radius: var(--r-xl);
      box-shadow: var(--ombre-3);
      opacity: 0; pointer-events: none;
      transform: translate(-50%, -47%) scale(.96);
      transition: transform 420ms var(--ease), opacity 280ms var(--ease);
    }
    .feuille.ouvert { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%); }
    .feuille .poignee { display: none; }
    .feuille-tete { padding: 22px 28px 14px; }
    .feuille-corps { padding: 4px 28px 28px; }
    .feuille-corps:last-child { padding-bottom: 28px; }
    .feuille-pied { padding: 16px 28px 20px; }
    #resa.feuille { width: min(760px, 100vw - 48px); }
  }

  /* Ordinateur : Lya en panneau latéral droit pleine hauteur */
  @media (min-width: 1024px) {
    #lya.feuille {
      inset: 16px 16px 16px auto;
      width: min(420px, 100vw - 32px);
      height: auto; max-height: none;
      opacity: 1;
      transform: translateX(calc(100% + 32px));
      transition: transform 420ms var(--ease);
    }
    #lya.feuille.ouvert { transform: none; }
  }

  /* ---------- Messages éphémères ---------- */
  .toasts {
    position: fixed; left: 50%; bottom: calc(var(--s-4) + var(--bas-sur)); z-index: var(--z-toast);
    display: grid; gap: var(--s-2);
    width: min(440px, 100vw - 32px);
    transform: translateX(-50%);
    pointer-events: none;
  }
  .toast {
    position: relative; overflow: hidden;
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3);
    padding: 14px 56px 14px 16px; border-radius: var(--r-m); /* place réservée à la croix, toujours en haut à droite */
    background: var(--verre-nuit); color: var(--blanc);
    -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
    box-shadow: var(--ombre-3), inset 0 0 0 1px var(--blanc-08);
    font-size: .9375rem; line-height: 1.45;
    pointer-events: auto;
    animation: toast-entree var(--d-3) var(--ease) both;
  }
  .toast > svg.i { color: var(--or-clair); }
  .toast > span { flex: 1 1 180px; min-width: 0; }
  /* sur écran étroit, l'action passe sous le texte, alignée à droite */
  .toast-action {
    flex: none; min-height: 44px; margin: -6px 0 -6px auto; padding: 0 14px;
    border: 0; border-radius: var(--r-pill);
    background: var(--blanc-12); color: var(--or-clair);
    font-size: var(--t-petit); font-weight: 600; white-space: nowrap;
  }
  .toast-action + .toast-action { margin-left: 0; } /* deux actions (suggestion de langue) : côte à côte, à droite */
  .toast :focus-visible { outline-color: var(--or-clair); }
  .toast-fermer {
    position: absolute; top: 5px; right: 5px;
    flex: none; display: grid; place-items: center;
    width: 44px; height: 44px; margin: 0; padding: 0;
    border: 0; border-radius: 50%;
    background: none; color: var(--blanc-70);
  }
  .toast-fermer svg.i { width: 18px; height: 18px; }
  .toast-barre {
    position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
    background: var(--or);
    transform-origin: left;
    animation: toast-barre var(--duree, 3200ms) linear forwards;
  }
  .toast.sortant { opacity: 0; transform: translateY(8px) scale(.98); transition: opacity var(--d-2) var(--ease), transform var(--d-2) var(--ease); }
  @media (hover: hover) {
    .toast-action:hover { background: var(--blanc-20); }
    .toast-fermer:hover { color: var(--blanc); }
  }
  @keyframes toast-entree { from { opacity: 0; transform: translateY(12px); } }
  @keyframes toast-barre { from { transform: scaleX(1); } to { transform: scaleX(0); } }

  /* ---------- Vue 360° (vraies images uniquement) ---------- */
  .spin { position: relative; padding-bottom: 40px; outline-offset: 4px; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
  .spin:active { cursor: grabbing; }
  .spin img { width: 100%; height: auto; pointer-events: none; -webkit-user-drag: none; }
  .spin .spin-aide {
    position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
    display: flex; align-items: center; gap: var(--s-2);
    padding: 6px 12px; border-radius: var(--r-pill);
    background: var(--blanc-90); box-shadow: var(--ombre-2);
    font-size: 13px; font-weight: 600; white-space: nowrap;
    transition: opacity var(--d-3);
  }
  .spin.touche .spin-aide { opacity: 0; }
  .spin-jauge { height: 4px; overflow: hidden; border-radius: 2px; background: var(--trait); }
  .spin-jauge i { display: block; width: 8%; height: 100%; border-radius: 2px; background: var(--encre); transition: transform 100ms linear; }

  /* ---------- Squelette : lueur pendant le décodage des images ---------- */
  .squelette { position: relative; overflow: hidden; background-color: var(--sable); }
  .squelette::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(100deg, transparent 20%, var(--lueur) 50%, transparent 80%);
    transform: translateX(-100%);
    animation: lueur 1.4s var(--ease-in-out) infinite;
  }
  .squelette:has(img.charge)::after, .squelette.charge::after { display: none; }
  html.anime .squelette img { transition: opacity var(--d-3) var(--ease); }
  html.anime .squelette img:not(.charge) { opacity: 0; }
  @keyframes lueur { to { transform: translateX(100%); } }

  /* ---------- Révélations au défilement ----------
     [data-reveal] (monte par défaut, fondu, zoom, gauche) n'est caché que si le JS a posé html.anime.
     .vu révèle ; style="--i:n" décale de n × 70 ms. */
  html.anime [data-reveal] {
    opacity: 0;
    transform: translateY(var(--monte));
    transition: opacity var(--d-4) var(--ease), transform var(--d-4) var(--ease);
    transition-delay: calc(var(--i, 0) * 60ms);
  }
  html.anime [data-reveal="fondu"] { transform: none; }
  html.anime [data-reveal="zoom"] { transform: scale(.98); }
  html.anime [data-reveal="gauche"] { transform: translateX(calc(-1 * var(--monte))); }
  html.anime [data-reveal].vu { opacity: 1; transform: none; }
}

/* ============================== UTILITAIRES ============================== */
@layer utilitaires {
  .sr {
    position: absolute !important;
    width: 1px !important; height: 1px !important;
    margin: -1px !important; padding: 0 !important;
    overflow: hidden !important; clip: rect(0 0 0 0) !important; clip-path: inset(50%) !important;
    white-space: nowrap !important; border: 0 !important;
  }
  .muted { color: var(--gris); }
  .num { font-variant-numeric: tabular-nums; }

  /* ---------- Typographie par langue (socle « Passeport », 7.2 ; docs/I18N.md § 6) ----------
     Couche « utilitaires » : passe après les vues. Chaque traducteur ajoute ses réglages dans le bloc de sa langue. */
  /* zh : polices du système (aucun téléchargement), le latin garde Instrument ; ni interlettrage, ni italique ou gras
     synthétiques sur les idéogrammes ; coupures de ligne strictes (ponctuation pleine chasse jamais en début de ligne). */
  html:lang(zh) {
    --serif: "Instrument Serif", "Songti SC", STSong, "Noto Serif CJK SC", "Source Han Serif SC", SimSun, serif;
    --texte: "Instrument Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
    --serre: 0;
  }
  :lang(zh) { font-synthesis: none; line-break: strict; word-break: normal; overflow-wrap: anywhere; }
  :lang(zh) :not(.logo-mot, .logo-mot *, .intro-mot, .intro-mot *, .plaque, .plaque *) { letter-spacing: 0; }
  :lang(zh) :is(em, i, cite) { font-style: normal; }
  /* de : mots composés longs, coupés proprement dans les titres et les boutons plutôt que de déborder */
  :lang(de) :is(h1, h2, h3, h4, .titre-hero, .titre-edito, .titre-section, .titre-serif, .edito-phrase, .carte-titre, .btn, button) { hyphens: auto; overflow-wrap: break-word; }
  :lang(de) .btn { white-space: normal; text-wrap: balance; }
  /* de : ajustements du traducteur ci-dessous */
  :lang(de) .opt-texte b { hyphens: auto; overflow-wrap: break-word; } /* « Blumenschmuck », « Dienstkleidung » : césure si le navigateur la connaît */
  :lang(de) .options-fiche { grid-template-columns: repeat(auto-fit, minmax(min(100%, max(10.5rem, 50% - 4px)), 1fr)); } /* fiche : deux colonnes seulement si « Dienstkleidung » y tient */
  /* en : ajustements du traducteur ci-dessous */
  /* es : ajustements du traducteur ci-dessous */
  :lang(es) .btn { white-space: normal; text-wrap: balance; } /* libellés plus longs qu'en français : à la ligne plutôt que rognés à 320 px */
  :lang(es) .lya-carte-actions .btn-s { padding-inline: 6px; font-size: .875rem; } /* « Presupuesto » dans les cartes de Lya à 320 px */
  @media (max-width: 379px) { :lang(es) .fiche .options-fiche { grid-template-columns: 1fr; } } /* fiche : « Conductor uniformado », « Decoración floral » ne tiennent pas dans 2 colonnes à 320 px */
  /* zh : ajustements du traducteur ci-dessous */
  /* Titres : la partie en <em> reste d'un tenant, la coupure tombe après la virgule (前路，/ 由您做主。) */
  :lang(zh) :is(h1, h2, h3, h4, .titre-hero, .titre-edito, .titre-section, .titre-serif, .edito-phrase) em { display: inline-block; }
  /* Contrôles : un mot latin (WhatsApp, Jetour) ne se coupe pas ; un libellé long passe à la ligne au lieu d'être rogné */
  :lang(zh) :is(button, .btn, .chip, label) { overflow-wrap: break-word; }
  :lang(zh) .btn { white-space: normal; text-wrap: balance; }
  /* Pas d'italique (oblique synthétique) sur les idéogrammes : rubrique du menu, couleur du véhicule, « sur devis » */
  :lang(zh) :is(.menu-liens a[aria-current="page"], #maLocation .loc-hero h2 span, .ligne-recap.sur-devis .num) { font-style: normal; }

  /* Mouvement réduit : une seule règle, contenu immédiatement visible */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 1ms;
      animation-delay: 0ms;
      animation-iteration-count: 1;
      transition-duration: 1ms;
      transition-delay: 0ms;
      scroll-behavior: auto;
    }
    html.anime [data-reveal] { opacity: 1; transform: none; }
    html.anime .squelette img { opacity: 1; }
    ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none; }
  }
}
