/* FH Créations — système visuel
   Direction : éditorial cartographique. Papier, encre, et le sienna du bois
   brûlé par le laser. Les courbes de niveau sont la matière, pas un décor
   rapporté : elles viennent du produit lui-même. */

:root {
  /* Palette : un fond dominant, un accent unique */
  --papier:      #f6f2ea;
  --papier-fonce:#ece5d8;
  --encre:       #17140f;
  --encre-douce: #5a5147;
  --encre-tenue: #8c8275;
  --brulure:     #a8562b;   /* la couleur du contreplaqué gravé */
  --brulure-pale:#c98a5e;
  --trait:       #d8cfbe;
  --succes:      #4a6b3a;
  --alerte:      #9c5a1e;

  /* Typographie : serif éditoriale pour la voix, système pour le service.
     Aucune police téléchargée : rien à charger, rendu immédiat sur iPhone. */
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --t-micro: .72rem;
  --t-petit: .84rem;
  --t-base:  1rem;
  --t-grand: clamp(1.5rem, 1.1rem + 2vw, 2.1rem);
  --t-titre: clamp(2.1rem, 1.3rem + 4.2vw, 3.6rem);

  /* Rythme : progression nette, pas une échelle linéaire molle */
  --e1: .35rem;  --e2: .7rem;  --e3: 1.2rem;
  --e4: 2rem;    --e5: 3.2rem; --e6: 5rem;

  --rayon: 3px;              /* presque droit : on découpe du bois, pas des bulles */
  --duree: 420ms;
  --sortie: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--papier);
  color: var(--encre);
  font: var(--t-base)/1.6 var(--sans);
  /* Grain discret : le papier n'est jamais parfaitement lisse */
  background-image:
    radial-gradient(circle at 18% 12%, rgba(168,86,43,.045), transparent 42%),
    radial-gradient(circle at 88% 78%, rgba(90,81,71,.04), transparent 46%);
  background-attachment: fixed;
}

/* ── Fond cartographique : courbes de niveau, en très discret ─────────────── */
.releve {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none; opacity: .5;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 72%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 72%);
}
.releve path { fill: none; stroke: var(--trait); stroke-width: .8; }

.page { position: relative; z-index: 1; max-width: 46rem; margin: 0 auto;
        padding: var(--e4) var(--e3) var(--e6); }

/* ── En-tête ──────────────────────────────────────────────────────────────── */
.bandeau { display: flex; align-items: baseline; justify-content: space-between;
           gap: var(--e3); margin-bottom: var(--e5); }
.marque { font: 600 var(--t-petit)/1 var(--sans); letter-spacing: .16em;
          text-transform: uppercase; color: var(--encre); text-decoration: none; }
.marque-nom span { color: var(--brulure); }
.bandeau nav { font-size: var(--t-micro); letter-spacing: .08em;
               text-transform: uppercase; }
.bandeau nav a { color: var(--encre-tenue); text-decoration: none; margin-left: var(--e3); }
.bandeau nav a:hover { color: var(--brulure); }

/* ── Titre : composition asymétrique, pas un bloc centré ──────────────────── */
.ouverture { margin-bottom: var(--e5); }
.sur-titre { font: var(--t-micro)/1 var(--sans); letter-spacing: .2em;
             text-transform: uppercase; color: var(--brulure);
             margin: 0 0 var(--e3); display: flex; align-items: center; gap: var(--e2); }
.sur-titre::after { content: ""; flex: 1; height: 1px; background: var(--trait); }
h1 { font: 400 var(--t-titre)/1.04 var(--serif); margin: 0 0 var(--e3);
     letter-spacing: -.02em; max-width: 17ch; }
h1 em { font-style: italic; color: var(--brulure); }
.chapeau { font-size: 1.05rem; color: var(--encre-douce); max-width: 44ch; margin: 0; }

h2 { font: 400 var(--t-grand)/1.15 var(--serif); margin: 0 0 var(--e3);
     letter-spacing: -.01em; }
h3 { font: 600 var(--t-petit)/1.3 var(--sans); letter-spacing: .1em;
     text-transform: uppercase; color: var(--encre-tenue); margin: 0 0 var(--e2); }

/* ── Dépôt du fichier ─────────────────────────────────────────────────────── */
.depot { position: relative; display: block; border: 1.5px dashed var(--trait);
         border-radius: var(--rayon); background: rgba(255,255,255,.55);
         padding: var(--e5) var(--e3); text-align: center; cursor: pointer;
         transition: border-color var(--duree) var(--sortie),
                     background var(--duree) var(--sortie); }
.depot:hover, .depot.survol { border-color: var(--brulure); background: #fff; }
.depot input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.depot-titre { font: 400 1.3rem/1.2 var(--serif); margin-bottom: var(--e1); }
.depot-aide { font-size: var(--t-petit); color: var(--encre-tenue); }
.depot-fichier { font: var(--t-petit)/1.4 var(--mono); color: var(--brulure);
                 margin-top: var(--e2); word-break: break-all; }

/* ── Champs ───────────────────────────────────────────────────────────────── */
.champs { display: grid; gap: var(--e3); margin-top: var(--e4); }
.champ label { display: block; font: 600 var(--t-micro)/1 var(--sans);
               letter-spacing: .1em; text-transform: uppercase;
               color: var(--encre-tenue); margin-bottom: var(--e1); }
.champ input, .champ textarea, .champ select {
  width: 100%; padding: .7rem .8rem; font: var(--t-base) var(--sans);
  color: var(--encre); background: #fff; border: 1px solid var(--trait);
  border-radius: var(--rayon); transition: border-color 160ms ease;
}
.champ input:focus, .champ textarea:focus, .champ select:focus {
  outline: none; border-color: var(--brulure);
  box-shadow: 0 0 0 3px rgba(168,86,43,.12);
}
.champ .note { font-size: var(--t-micro); color: var(--encre-tenue); margin-top: var(--e1); }
.duo { display: grid; gap: var(--e3); grid-template-columns: 1fr; }
@media (min-width: 34rem) { .duo { grid-template-columns: 1fr 1fr; } }

/* ── Boutons ──────────────────────────────────────────────────────────────── */
.bouton { display: inline-flex; align-items: center; justify-content: center;
  gap: var(--e2); padding: .85rem 1.6rem; border: 1px solid var(--encre);
  border-radius: var(--rayon); background: var(--encre); color: var(--papier);
  font: 600 var(--t-petit) var(--sans); letter-spacing: .06em;
  text-transform: uppercase; text-decoration: none; cursor: pointer;
  transition: transform 160ms var(--sortie), background 200ms ease; }
.bouton:hover { background: var(--brulure); border-color: var(--brulure);
                transform: translateY(-1px); }
.bouton:active { transform: translateY(0); }
.bouton[disabled] { opacity: .45; pointer-events: none; }
.bouton--creux { background: transparent; color: var(--encre); }
.bouton--creux:hover { color: var(--papier); }
.bouton--large { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: var(--e2); margin-top: var(--e4); }

/* ── Aperçu : le moment où le coureur reconnaît sa course ─────────────────── */
.planche { margin-top: var(--e5); }
.cadre-apercu { background: #fff; border: 1px solid var(--trait);
                border-radius: var(--rayon); padding: var(--e3);
                box-shadow: 0 1px 2px rgba(23,20,15,.04),
                            0 12px 32px -18px rgba(23,20,15,.25); }
.cadre-apercu svg { display: block; width: 100%; height: auto; }

/* Le SVG livré au laser porte un trait de 0,05 mm, soit un dixieme de pixel
   une fois reduit a la largeur d'un telephone : invisible. On epaissit pour
   l'ecran uniquement, le fichier telecharge garde ses cotes machine. */
.cadre-apercu { background: #efe7d8; padding: var(--e2); }
.cadre-apercu svg #GRAVURE_LIGNES { stroke-width: .2;  stroke: #5b4426; }
.cadre-apercu svg #GRAVURE_LIGNES path[stroke-width] { stroke-width: .7; stroke: #3d2c16; }
.cadre-apercu svg #GRAVURE_TEXTE  { stroke-width: .2;  stroke: #4a3418; }
/* L'eau sort sur son propre calque pour que l'atelier la remplisse. A l'écran
   on la montre remplie, puisque c'est le résultat visé. */
.cadre-apercu svg #EAU { stroke-width: .3; stroke: #0a3d62; fill: #0a3d62;
                         fill-opacity: .3; }
/* Ce qui reste de DECOUPE apres nettoyage : fente de ruban et accroche. */
.cadre-apercu svg #DECOUPE        { stroke-width: .4;  stroke: #7d6038; fill: #cbb189; }
.cadre-apercu svg #CADRE_DECOUPE  { display: none; }   /* les baguettes sont peintes */
/* Les aretes de chanfrein sont de la lumiere, pas du trace : elles ne se
   dessinent pas, elles sont la des la premiere image. */
.cadre-apercu svg path.arete { stroke-dasharray: none !important;
  stroke-dashoffset: 0 !important; animation: none !important; }
.cadre-apercu svg #CADRE_MOULURE  { stroke-width: .35; stroke: #8d6f45; }
.cadre-apercu svg #REPERE_MEDAILLE circle { animation: none !important;
  stroke-dasharray: 2.5 2 !important; stroke-dashoffset: 0 !important; }

/* Le tracé se dessine : un seul moment de mouvement dans toute l'interface */
@media (prefers-reduced-motion: no-preference) {
  .cadre-apercu svg path { stroke-dasharray: 2400; stroke-dashoffset: 2400;
                           animation: tracer 2.4s var(--sortie) forwards; }
  /* Le texte ne se DESSINE pas : un glyphe fait quelques millimetres de
     contour, le trait n'apparaissait qu'a la toute fin de l'animation et le
     bandeau semblait vide pendant plusieurs secondes. Il apparait en fondu. */
  .cadre-apercu svg #GRAVURE_TEXTE path { stroke-dasharray: none;
    stroke-dashoffset: 0; animation: paraitre .5s var(--sortie) .35s both; }
  .cadre-apercu svg #DECOUPE path, .cadre-apercu svg #DECOUPE rect {
    stroke-dasharray: none; stroke-dashoffset: 0;
    animation: paraitre .5s var(--sortie) .2s both; }
  .cadre-apercu svg #CADRE_DECOUPE *, .cadre-apercu svg #CADRE_MOULURE *,
  .cadre-apercu svg #REPERE_MEDAILLE *, .cadre-apercu svg #JETON_POSE *,
  .cadre-apercu svg rect[fill], .cadre-apercu svg path[fill] {
    animation: none !important; stroke-dasharray: none !important;
    stroke-dashoffset: 0 !important; }
  .cadre-apercu svg #CADRE_MOULURE path { stroke-dasharray: none !important; }
}
@keyframes tracer { to { stroke-dashoffset: 0; } }
@keyframes paraitre { from { opacity: 0; } to { opacity: 1; } }

/* ── Relevé de mesures : lecture tabulaire, pas des cartes empilées ───────── */
.mesures { margin: var(--e4) 0 0; border-top: 1px solid var(--trait); }
.mesures div { display: flex; justify-content: space-between; align-items: baseline;
               gap: var(--e3); padding: .55rem 0; border-bottom: 1px solid var(--trait); }
.mesures dt { font-size: var(--t-petit); color: var(--encre-tenue); }
.mesures dd { margin: 0; font: 500 var(--t-base) var(--mono); color: var(--encre); }
.mesures dd small { font-family: var(--sans); color: var(--encre-tenue);
                    font-weight: 400; }

/* ── Messages ─────────────────────────────────────────────────────────────── */
.mot { padding: var(--e3); border-radius: var(--rayon); font-size: var(--t-petit);
       border-left: 2px solid; }
.mot--alerte { background: rgba(156,90,30,.07); border-color: var(--alerte);
               color: #6d400f; }
.mot--erreur { background: rgba(168,86,43,.08); border-color: var(--brulure);
               color: #7a3c1b; }
.mot--ok { background: rgba(74,107,58,.08); border-color: var(--succes); color: #33501f; }
.mot p { margin: 0 0 var(--e1); }
.mot p:last-child { margin: 0; }
.mot code { font: var(--t-micro) var(--mono); opacity: .75; }

/* ── Attente ──────────────────────────────────────────────────────────────── */
/* L'indicateur est porte par le FORMULAIRE : avec hx-indicator, htmx pose la
   classe sur la cible elle-meme, et un selecteur descendant ne matche jamais. */
.htmx-indicator { display: none; }
form.htmx-request .htmx-indicator { display: flex; }
form.htmx-request .masque-pendant { display: none; }

.patience { align-items: center; gap: var(--e3); justify-content: center;
            padding: var(--e4) var(--e3); color: var(--encre-douce);
            font-size: var(--t-petit); border: 1px solid var(--trait);
            border-radius: var(--rayon); background: rgba(255,255,255,.6);
            margin-top: var(--e4); }
.rouet { flex: none; width: 1.15rem; height: 1.15rem; border-radius: 50%;
  border: 2px solid var(--trait); border-top-color: var(--brulure);
  animation: tourne .75s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }

/* Les etapes defilent : la premiere generation interroge l'IGN et dure une
   dizaine de secondes, une roue muette laisse croire a un blocage. */
.etapes { position: relative; display: block; min-height: 1.5em; flex: 1; }
.etapes b { position: absolute; inset: 0; font-weight: 500; opacity: 0;
            transform: translateY(.35em); animation: etape 12s var(--sortie) infinite; }
.etapes b[data-etape="1"] { animation-delay: 2.2s; }
.etapes b[data-etape="2"] { animation-delay: 5.2s; }
.etapes b[data-etape="3"] { animation-delay: 8.2s; }
@keyframes etape {
  0%, 2%   { opacity: 0; transform: translateY(.35em); }
  5%, 22%  { opacity: 1; transform: translateY(0); }
  26%,100% { opacity: 0; transform: translateY(-.35em); }
}
@media (prefers-reduced-motion: reduce) {
  .etapes b { animation: none; opacity: 0; }
  .etapes b[data-etape="0"] { opacity: 1; }
}

/* ── Tableau d'administration ─────────────────────────────────────────────── */
.filtres { display: flex; flex-wrap: wrap; gap: var(--e2); margin-bottom: var(--e4); }
.filtres a { font-size: var(--t-micro); letter-spacing: .08em; text-transform: uppercase;
             padding: .35rem .8rem; border: 1px solid var(--trait);
             border-radius: 99px; color: var(--encre-douce); text-decoration: none; }
.filtres a.actif { background: var(--encre); color: var(--papier); border-color: var(--encre); }
.commande { border: 1px solid var(--trait); border-radius: var(--rayon);
            background: #fff; padding: var(--e3); margin-bottom: var(--e2); }
.commande header { display: flex; justify-content: space-between; align-items: baseline;
                   gap: var(--e2); margin-bottom: var(--e2); flex-wrap: wrap; }
.commande .qui { font: 500 var(--t-base) var(--sans); }
.commande .quand { font-size: var(--t-micro); color: var(--encre-tenue); }
.commande .detail { font-size: var(--t-petit); color: var(--encre-douce); }
.commande .detail a { color: var(--brulure); }
.etiquette { font-size: var(--t-micro); letter-spacing: .08em; text-transform: uppercase;
             padding: .18rem .55rem; border-radius: 99px; border: 1px solid var(--trait);
             color: var(--encre-douce); }
.etiquette--nouvelle { background: var(--brulure); color: #fff; border-color: var(--brulure); }

.pied { margin-top: var(--e6); padding-top: var(--e3); border-top: 1px solid var(--trait);
        font-size: var(--t-micro); color: var(--encre-tenue);
        display: flex; justify-content: space-between; gap: var(--e3); flex-wrap: wrap; }
.pied a { color: var(--encre-tenue); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Annotation sous l'aperçu : elle parle DE l'objet, elle n'en fait pas partie. */
.legende-apercu { margin: var(--e2) 0 0; text-align: center;
  font-size: var(--t-petit); color: var(--encre-tenue); }
.legende-apercu strong { color: var(--brulure); font-weight: 600; }

/* Choix du fond de carte : deux propositions lisibles, pas un menu déroulant. */
.choix { display: grid; gap: var(--e1); }
/* Ces options sont des <label> : sans cela elles heritent des capitales et de
   l'interlettrage des libellés de champ, et le texte devenait illisible. */
.choix .choix-option { display: flex; gap: var(--e2); align-items: flex-start;
  text-transform: none; letter-spacing: normal; font-weight: 400;
  color: var(--encre-tenue); line-height: 1.5;
  padding: var(--e2); border: 1px solid var(--trait); border-radius: var(--rayon);
  cursor: pointer; transition: border-color var(--duree) var(--sortie),
                               background var(--duree) var(--sortie); }
.choix .choix-option:hover { border-color: var(--brulure); }
.choix .choix-option:has(input:checked) { border-color: var(--brulure);
  background: color-mix(in oklab, var(--brulure) 6%, transparent); }
/* « .champ input » impose width:100% aux champs de saisie. Applique a un bouton
   radio, il lui donnait toute la largeur et chassait le texte hors de l'ecran. */
.choix .choix-option input { flex: 0 0 auto; width: auto; min-width: 0;
  margin: .3em 0 0; accent-color: var(--brulure); }
.choix .choix-option > span { flex: 1 1 auto; min-width: 0; }
.choix .choix-option span { font-size: var(--t-petit); color: var(--encre-tenue); }
.choix .choix-option strong { display: block; color: var(--encre);
  font-size: var(--t-base); font-weight: 600; text-transform: none;
  letter-spacing: normal; margin-bottom: .15em; }

/* Tarif sur la page commande : deux lignes lisibles, pas un tableau de prix. */
.tarif { border: 1px solid var(--trait); border-radius: var(--rayon);
  margin: var(--e3) 0; overflow: hidden; }
.tarif-ligne { display: flex; gap: var(--e2); align-items: baseline;
  justify-content: space-between; padding: var(--e2);
  border-bottom: 1px solid var(--trait); }
.tarif-ligne:last-child { border-bottom: 0;
  background: color-mix(in oklab, var(--brulure) 5%, transparent); }
.tarif-quoi { font-size: var(--t-petit); color: var(--encre-tenue); }
.tarif-quoi strong { display: block; color: var(--encre);
  font-size: var(--t-base); font-weight: 600; }
.tarif-prix { font: 600 var(--t-base) var(--mono); color: var(--encre);
  white-space: nowrap; }

/* Aide GPX : un dépliant natif, sans une ligne de JavaScript. */
.aide { margin: calc(var(--e2) * -1) 0 var(--e3); }
.aide summary { display: flex; align-items: center; gap: var(--e1);
  cursor: pointer; list-style: none; padding: var(--e1) 0;
  font-size: var(--t-petit); color: var(--encre-tenue);
  transition: color var(--duree) var(--sortie); }
.aide summary::-webkit-details-marker { display: none; }
.aide summary:hover, .aide[open] summary { color: var(--brulure); }
.aide summary:focus-visible { outline: 2px solid var(--brulure);
  outline-offset: 3px; border-radius: var(--rayon); }
.aide-pastille { flex: 0 0 auto; display: grid; place-items: center;
  width: 1.5em; height: 1.5em; border: 1px solid currentColor;
  border-radius: 50%; font-size: .85em; font-weight: 600; line-height: 1; }
.aide-titre { flex: 1 1 auto; }
/* Chevron : il pivote a l'ouverture, seul mouvement de tout le dépliant. */
.aide-fleche { flex: 0 0 auto; width: .5em; height: .5em;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translate(-.1em, -.1em);
  transition: transform var(--duree) var(--sortie); }
.aide[open] .aide-fleche { transform: rotate(-135deg) translate(-.15em, -.15em); }

.aide-corps { margin-top: var(--e1);
  border: 1px solid var(--trait); border-radius: var(--rayon);
  background: color-mix(in oklab, var(--papier) 60%, #fff);
  overflow: hidden; }
.aide-liste { margin: 0; padding: 0; }
.aide-liste dt { padding: var(--e2) var(--e2) 0;
  font: 600 var(--t-micro)/1.25 var(--sans); letter-spacing: .07em;
  text-transform: uppercase; color: var(--brulure); }
.aide-liste dd { margin: .25em 0 0; padding: 0 var(--e2) var(--e2);
  font-size: var(--t-petit); line-height: 1.55; color: var(--encre-tenue);
  border-bottom: 1px solid var(--trait); }
.aide-liste dd:last-of-type { border-bottom: 0; }
.aide-liste b { font: 500 .95em var(--mono); color: var(--encre); font-weight: 500;
  background: color-mix(in oklab, var(--encre) 7%, transparent);
  padding: .08em .38em; border-radius: 3px; }
.aide-note { margin: 0; padding: var(--e2);
  border-top: 1px solid var(--trait);
  background: color-mix(in oklab, var(--brulure) 5%, transparent);
  font-size: var(--t-petit); line-height: 1.55; color: var(--encre-tenue); }

/* A partir du moment ou la place le permet, la marque passe en regard. */
@media (min-width: 30em) {
  .aide-liste { display: grid; grid-template-columns: 7.5em 1fr; }
  .aide-liste dt { padding: var(--e2) 0 var(--e2) var(--e2); align-self: start; }
  .aide-liste dd { margin: 0; padding: var(--e2); border-bottom: 1px solid var(--trait); }
  .aide-liste dt + dd { border-left: 1px solid var(--trait); }
  .aide-liste dt:last-of-type { border-bottom: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .aide[open] .aide-corps { animation: paraitre .25s var(--sortie) both; }
}

/* Tarif sur la page commande : deux lignes lisibles, pas un tableau de prix. */
.tarif { border: 1px solid var(--trait); border-radius: var(--rayon);
  margin: var(--e3) 0; overflow: hidden; }
.tarif-ligne { display: flex; gap: var(--e2); align-items: baseline;
  justify-content: space-between; padding: var(--e2);
  border-bottom: 1px solid var(--trait); }
.tarif-ligne:last-child { border-bottom: 0;
  background: color-mix(in oklab, var(--brulure) 5%, transparent); }
.tarif-quoi { font-size: var(--t-petit); color: var(--encre-tenue); }
.tarif-quoi strong { display: block; color: var(--encre);
  font-size: var(--t-base); font-weight: 600; }
.tarif-prix { font: 600 var(--t-base) var(--mono); color: var(--encre);
  white-space: nowrap; }

/* Aide GPX : un dépliant natif, sans une ligne de JavaScript. */
.aide { margin: calc(var(--e2) * -1) 0 var(--e3); }
.aide summary { display: flex; align-items: center; gap: var(--e1);
  cursor: pointer; list-style: none; padding: var(--e1) 0;
  font-size: var(--t-petit); color: var(--encre-tenue);
  transition: color var(--duree) var(--sortie); }
.aide summary::-webkit-details-marker { display: none; }
.aide summary:hover, .aide[open] summary { color: var(--brulure); }
.aide-pastille { display: grid; place-items: center; width: 1.45em; height: 1.45em;
  border: 1px solid currentColor; border-radius: 50%;
  font-size: .85em; font-weight: 600; line-height: 1; }
.aide-corps { padding: var(--e2) 0 0 calc(1.45em + var(--e1));
  border-left: 1px solid var(--trait); margin-left: .72em; }
.aide-corps p { margin: 0 0 var(--e2); padding-left: var(--e2);
  font-size: var(--t-petit); color: var(--encre-tenue); line-height: 1.55; }
.aide-corps strong { display: block; color: var(--encre); font-weight: 600; }
.aide-ui { font: 500 .95em var(--mono); color: var(--encre);
  background: color-mix(in oklab, var(--encre) 6%, transparent);
  padding: .05em .35em; border-radius: 3px; white-space: nowrap; }
.aide-note { border-top: 1px solid var(--trait); padding-top: var(--e2) !important;
  font-style: italic; }
@media (prefers-reduced-motion: no-preference) {
  .aide[open] .aide-corps { animation: paraitre .25s var(--sortie) both; }
}

/* Marque : le monogramme grave sur chaque cadre, repris en en-tete. */
.marque { display: inline-flex; align-items: center; gap: .55em; }
.marque-signe { flex: 0 0 auto; width: 1.55em; height: 1.55em;
  border-radius: 22%; color: var(--papier); }
.marque-signe > rect:first-child { fill: var(--encre); }
.marque-lettre rect { fill: var(--papier); }
.marque-nom { display: inline; }

/* Catalogue des courses : une liste cliquable, pas une grille de vignettes. */
.courses { display: grid; gap: var(--e1); margin: var(--e3) 0; }
.course-carte { display: grid; gap: .2em; padding: var(--e2);
  border: 1px solid var(--trait); border-radius: var(--rayon);
  text-decoration: none; background: color-mix(in oklab, var(--papier) 55%, #fff);
  transition: border-color var(--duree) var(--sortie),
              transform var(--duree) var(--sortie); }
.course-carte:hover { border-color: var(--brulure); transform: translateX(2px); }
.course-nom { font: 600 var(--t-base)/1.2 var(--sans); color: var(--encre); }
.course-resume { font-size: var(--t-petit); color: var(--encre-tenue); }
.course-orga { font: 600 var(--t-micro) var(--sans); letter-spacing: .07em;
  text-transform: uppercase; color: var(--brulure); }

/* Le repli, pour qui n'a pas enregistré sa course. */
.repli { margin: calc(var(--e2) * -1) 0 var(--e3); padding: var(--e2);
  border: 1px dashed var(--trait); border-radius: var(--rayon);
  display: grid; gap: var(--e2); justify-items: center; text-align: center; }
.repli p { margin: 0; font-size: var(--t-petit); color: var(--encre-tenue); }

/* La carte cadeau : un objet qu'on imprime ou qu'on envoie tel quel. */
.cadeau { margin: var(--e3) 0; padding: var(--e4) var(--e3); text-align: center;
  border: 1px solid var(--encre); border-radius: var(--rayon);
  background: color-mix(in oklab, var(--papier) 40%, #fff);
  box-shadow: 0 1px 2px rgba(23,20,15,.05), 0 18px 40px -28px rgba(23,20,15,.35); }
.cadeau-sur { margin: 0; font: 600 var(--t-micro) var(--sans);
  letter-spacing: .18em; text-transform: uppercase; color: var(--brulure); }
.cadeau-pour { margin: var(--e2) 0 0; font: 400 var(--t-titre)/1.1 var(--serif); }
.cadeau-quoi { margin: var(--e1) 0 0; font-size: var(--t-petit);
  color: var(--encre-tenue); }
.cadeau-mot { margin: var(--e3) auto 0; max-width: 32ch; padding: 0;
  border: 0; font: italic 400 var(--t-base)/1.5 var(--serif); color: var(--encre); }
.cadeau-code { margin: var(--e3) 0 0; font: 600 var(--t-base) var(--mono);
  letter-spacing: .12em; color: var(--encre);
  border: 1px dashed var(--trait); border-radius: var(--rayon);
  padding: var(--e2) var(--e1); }
.cadeau-de { margin: var(--e2) 0 0; font-size: var(--t-petit);
  color: var(--encre-tenue); }
.cadeau-usee { margin: var(--e2) 0 0; font: 600 var(--t-micro) var(--sans);
  letter-spacing: .1em; text-transform: uppercase; color: var(--brulure); }
@media print {
  .bandeau, .pied, .actions, .releve { display: none !important; }
  .cadeau { box-shadow: none; }
}

/* Accord de réutilisation du tracé : discret, décoché, et jamais déterminant. */
.accord { display: flex; gap: var(--e2); align-items: flex-start;
  text-transform: none; letter-spacing: normal; font-weight: 400;
  font-size: var(--t-petit); line-height: 1.5; color: var(--encre-tenue);
  cursor: pointer; }
.accord input { flex: 0 0 auto; width: auto; min-width: 0; margin: .25em 0 0;
  accent-color: var(--brulure); }
.accord strong { color: var(--encre); font-weight: 600; }

.lien-trace { font: 600 var(--t-micro) var(--sans); letter-spacing: .07em;
  text-transform: uppercase; color: var(--brulure); text-decoration: none;
  border-bottom: 1px solid currentColor; }

/* L'offre : trois lignes de même facture, le prix toujours au même endroit. */
.offre { border: 1px solid var(--trait); border-radius: var(--rayon);
  padding: 0; margin: var(--e3) 0; overflow: hidden; }
.offre-ligne { display: grid; grid-template-columns: auto 1fr auto;
  gap: var(--e2); align-items: start; padding: var(--e2);
  border-bottom: 1px solid var(--trait); cursor: pointer;
  text-transform: none; letter-spacing: normal; font-weight: 400;
  transition: background var(--duree) var(--sortie); }
.offre-ligne:hover { background: color-mix(in oklab, var(--brulure) 4%, transparent); }
.offre-ligne:has(input:checked) {
  background: color-mix(in oklab, var(--brulure) 7%, transparent); }
.offre-ligne input { flex: none; width: auto; min-width: 0; margin: .3em 0 0;
  accent-color: var(--brulure); }
.offre-texte { display: grid; gap: .15em; min-width: 0; }
.offre-nom { font: 600 var(--t-base)/1.3 var(--sans); color: var(--encre); }
.offre-detail { font-size: var(--t-petit); line-height: 1.5;
  color: var(--encre-tenue); }
.offre-prix { font: 600 var(--t-base) var(--mono); color: var(--encre);
  white-space: nowrap; }
/* L'option est subordonnée au cadre : en retrait, et marquée par un filet. */
.offre-option { padding-left: calc(var(--e2) * 2.2); position: relative;
  background: color-mix(in oklab, var(--encre) 2%, transparent); }
.offre-option::before { content: ""; position: absolute;
  left: var(--e2); top: 0; bottom: 0; width: 2px;
  background: color-mix(in oklab, var(--brulure) 35%, transparent); }
.offre-option .offre-nom { font-size: var(--t-petit); }
/* « hidden » passe par display:none dans la feuille du navigateur : un
   display explicite le bat. Sans cette ligne, l'option restait visible. */
.offre-ligne[hidden] { display: none; }
.offre-total { display: flex; justify-content: flex-end; align-items: baseline;
  gap: var(--e2); margin: 0; padding: var(--e2);
  background: color-mix(in oklab, var(--encre) 4%, transparent);
  font-size: var(--t-petit); color: var(--encre-tenue); }
.offre-total strong { font: 600 1.35em var(--mono); color: var(--encre); }
.sr-seulement { position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; }

/* Le choix de formule reprend la mécanique du fond de carte. */
#formule { border: 0; padding: 0; margin: var(--e3) 0; display: grid; gap: var(--e1); }
.sr-seulement { position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; }

/* Option de fabrication et total. */
.choix-option.option { margin: 0 0 var(--e3); }
.total { margin: calc(var(--e3) * -1) 0 var(--e3); text-align: right;
  font-size: var(--t-petit); color: var(--encre-tenue); }
.total strong { font: 600 var(--t-titre-petit, var(--t-base)) var(--mono);
  color: var(--encre); margin-left: .4em; }

/* ─── Backoffice ─────────────────────────────────────────────────────────── */
/* Navigation d'atelier : toujours au même endroit, sur toutes les pages. */
.atelier-nav { display: flex; gap: .15em; margin: 0 0 var(--e3);
  padding-bottom: 2px; overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--trait); }
.atelier-nav::-webkit-scrollbar { display: none; }
.atelier-nav a { flex: 0 0 auto; display: inline-flex; align-items: center;
  gap: .5em; padding: var(--e2) var(--e2) calc(var(--e2) - 2px);
  font: 600 var(--t-micro)/1 var(--sans); letter-spacing: .08em;
  text-transform: uppercase; color: var(--encre-tenue); text-decoration: none;
  border-bottom: 2px solid transparent; white-space: nowrap;
  transition: color var(--duree) var(--sortie),
              border-color var(--duree) var(--sortie); }
.atelier-nav a:hover { color: var(--encre); }
.atelier-nav a.actif { color: var(--brulure); border-bottom-color: var(--brulure); }
.onglets { display: none; }
/* Téléphone : plus de barre à faire glisser. Onglets fixes en bas, introduction repliée. */
@media (max-width: 47.99em) {
  :root { --barre-bas: calc(4.1rem + env(safe-area-inset-bottom)); }
  body:has(.onglets) { padding-bottom: var(--barre-bas); }
  .atelier-nav { display: none; }
  .onglets { position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; display: grid;
    grid-template-columns: repeat(5, 1fr); height: var(--barre-bas);
    padding: 0 .25rem env(safe-area-inset-bottom); background: #fffdf8;
    border-top: 1px solid var(--trait); box-shadow: 0 -6px 18px rgba(40,25,10,.06); }
  .onglets > a, .onglets summary { position: relative; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: .25rem; height: 4.1rem; cursor: pointer;
    font: 600 .68rem/1 var(--sans); letter-spacing: .02em; color: var(--encre-tenue);
    text-decoration: none; list-style: none; -webkit-tap-highlight-color: transparent; }
  .onglets summary::-webkit-details-marker { display: none; }
  .onglets svg { width: 1.45rem; height: 1.45rem; fill: none; stroke: currentColor;
    stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  .onglets .actif { color: var(--brulure); }
  .onglets > .actif::before, .onglets summary.actif::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%;
    height: 2px; border-radius: 0 0 2px 2px; background: var(--brulure); }
  .onglets .pastille { position: absolute; top: .45rem; left: calc(50% + .45rem); font-size: .62rem; }
  .onglets-feuille { position: fixed; left: .6rem; right: .6rem; bottom: calc(var(--barre-bas) + .5rem);
    display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; padding: .6rem;
    background: #fffdf8; border: 1px solid var(--trait); border-radius: calc(var(--rayon) * 1.5);
    box-shadow: 0 14px 40px rgba(40,25,10,.18); }
  .onglets-feuille a { display: flex; align-items: center; min-height: 3rem; padding: .5rem .9rem;
    border: 1px solid var(--trait); border-radius: var(--rayon); background: #fff;
    font: 600 .92rem/1.2 var(--sans); color: var(--encre); text-decoration: none; }
  .onglets-feuille a.actif { border-color: var(--brulure); color: var(--brulure); }
  .onglets-feuille a:last-child { color: var(--encre-tenue); font-weight: 400; }
  /* Les pages d'atelier : titre resserré, le texte d'explication sur deux lignes. */
  body:has(.onglets) .ouverture h1 { font-size: clamp(1.9rem, 8vw, 2.4rem); }
  body:has(.onglets) .ouverture .chapeau { display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; margin-bottom: 0; }
  body:has(.onglets) .ouverture .chapeau.deplie { display: block; }
}
@media (max-width: 47.99em) and (prefers-reduced-motion: no-preference) {
  .onglets-plus[open] .onglets-feuille { animation: feuille 180ms cubic-bezier(.16,1,.3,1); }
  @keyframes feuille { from { opacity: 0; transform: translateY(.6rem); } }
}
.pastille { display: inline-grid; place-items: center; min-width: 1.5em;
  height: 1.5em; padding: 0 .4em; border-radius: 999px;
  background: var(--brulure); color: var(--papier);
  font: 600 .85em/1 var(--mono); letter-spacing: 0; }

/* Carte de commande : une ligne d'identité, un corps, une barre d'actions. */
.commande-actions { display: flex; gap: var(--e2); flex-wrap: wrap;
  align-items: center; margin-top: var(--e3);
  padding-top: var(--e2); border-top: 1px solid var(--trait); }
.commande-actions .bouton { padding: .45rem 1rem; }
.commande-actions form { display: flex; gap: var(--e2); margin-left: auto; }
.commande-actions select { padding: .45rem .6rem; border: 1px solid var(--trait);
  border-radius: var(--rayon); background: var(--papier); color: var(--encre);
  font: inherit; }
@media (max-width: 30em) {
  .commande-actions form { margin-left: 0; width: 100%; }
  .commande-actions select { flex: 1; }
}

/* Tableau de bord atelier : etiquette de produit et ligne « ce qui est commande ». */
.etiquette--produit { background: var(--encre); color: var(--papier); border-color: var(--encre); }
.commande-objet { font-size: var(--t-petit); margin: 0 0 var(--e2); color: var(--encre); }
.commande-objet strong { font-weight: 600; }

/* ── Bascule d'essence sur l'apercu ───────────────────────────────────────
   Le prix affiche vaut pour le cadre standard ; l'essence contrastee est une
   option a 15 EUR. L'onglet actif dit donc toujours ce qu'on paie. */
.essence-vue { margin: 0; position: relative; }
.essence-image { display: block; width: 100%; height: auto; border-radius: 4px; }
.essence-choix { display: flex; gap: var(--e1); margin-top: var(--e2);
                 background: rgba(255,255,255,.72); border: 1px solid var(--trait);
                 border-radius: calc(var(--rayon) - 2px); padding: 3px; }
.essence-onglet { flex: 1; border: 0; background: none; cursor: pointer;
                  font: inherit; font-size: .82rem; letter-spacing: .01em;
                  color: var(--encre-douce); padding: .45rem .5rem;
                  border-radius: calc(var(--rayon) - 5px);
                  transition: background .18s ease, color .18s ease; }
.essence-onglet span { color: var(--encre-tenue); font-size: .76rem; }
.essence-onglet:hover { color: var(--encre); }
.essence-onglet.est-actif { background: #fff; color: var(--encre);
                            box-shadow: 0 1px 2px rgba(23,20,15,.10); }
.essence-onglet.est-actif span { color: var(--encre-douce); }
.essence-onglet:focus-visible { outline: 2px solid var(--encre); outline-offset: 1px; }

/* Interrupteur d atelier : prix + PayPal affichés partout, ou nulle part. */
.reglage-prix { display: flex; flex-wrap: wrap; align-items: center; gap: var(--e3);
  justify-content: space-between; padding: var(--e3); margin-block: var(--e3);
  border: 1px solid currentColor; border-radius: var(--rayon); font-size: var(--t-petit); }

/* Connecté en atelier : toute la largeur de l'écran (les clients gardent la colonne de lecture). */
.page--large { max-width: none; padding-inline: clamp(1rem, 3vw, 3.5rem); }

/* ── Système unique avec l'accueil (revue design 24/11) ──────────────────────
   Référence Awesome Design « oura » : papier chaud, serif éditoriale, une seule
   couleur d'action (l'encre), un seul bouton (la pastille), contrastes AAA. */
:root {
  --papier: #f4efe6;
  --brulure: #9c4a22;
  --encre-douce: #4f463c;   /* 8,6:1 sur le papier */
  --encre-tenue: #6b6155;   /* 5,4:1 : libellés et notes */
  --serif: 'Fraunces', "Iowan Old Style", Palatino, Georgia, serif;
}
h1, h2 { font-variation-settings: "opsz" 144; }

/* Navigation publique : cibles de 44 px au doigt */
.bandeau { align-items: center; }
.marque { display: inline-flex; align-items: center; gap: .6em; min-height: 44px; }
.bandeau nav { display: flex; gap: var(--e3); font-size: var(--t-petit);
               letter-spacing: 0; text-transform: none; }
.bandeau nav a { margin-left: 0; display: inline-flex; align-items: center;
                 min-height: 44px; color: var(--encre-douce); }
.bandeau nav a.tout { color: var(--encre); font-weight: 600; }

/* Bouton : la même pastille que l'accueil */
.bouton { border-radius: 999px; text-transform: none; letter-spacing: 0;
          font-size: .95rem; padding: .95rem 1.7rem; min-height: 44px; }
.bouton:hover { transform: translateY(-2px); }
.bouton--creux:hover { background: var(--encre); border-color: var(--encre); }

/* Liens dans le texte : plus jamais le bleu du navigateur */
.page main a:not([class]) { color: var(--encre); text-decoration: underline;
  text-decoration-color: var(--brulure); text-underline-offset: .2em;
  text-decoration-thickness: 1px; }
.page main a:not([class]):hover { color: var(--brulure); }

/* Focus clavier visible partout */
a:focus-visible, button:focus-visible, summary:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible, .depot:focus-within {
  outline: 2px solid var(--brulure); outline-offset: 3px; }
.evitement { position: absolute; left: var(--e3); top: -4rem; z-index: 200;
  background: var(--encre); color: var(--papier); padding: .7rem 1.1rem;
  border-radius: 999px; text-decoration: none; font-weight: 600; }
.evitement:focus { top: var(--e2); }

/* L'aide ne remonte plus sur le cadre de dépôt */
.aide { margin: var(--e2) 0 var(--e3); }

/* Photo de la pièce finie, en tête des pages produit */
.vitrine-produit { float: right; width: min(40%, 300px); margin: 0 0 var(--e3) var(--e4); }
.vitrine-produit img { display: block; width: 100%; height: auto; border-radius: 6px;
  rotate: 1.5deg; box-shadow: 0 34px 50px -22px rgba(60,38,18,.5), 0 8px 14px -6px rgba(60,38,18,.2); }
.vitrine-produit figcaption { margin-top: var(--e2); font-size: var(--t-micro);
  color: var(--encre-tenue); text-align: center; letter-spacing: .06em; }
main > form, main > section:not(.ouverture), main > .planche { clear: both; }
@media (max-width: 34rem) {
  .vitrine-produit { float: none; width: auto; margin: 0 0 var(--e4); }
  .vitrine-produit img { max-height: 70svh; width: auto; max-width: 100%; margin: 0 auto; rotate: 0deg; }
}
