@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500;12..96,700;12..96,800&family=Caveat:wght@500;700&family=Karla:wght@400;500;700&family=Space+Mono:wght@400;700&display=swap');

/* ------------------------------------------------------------------
   Palette reprise de la bannière : papier crème, feuillage à l'aquarelle,
   vert d'encre pour le trait.
------------------------------------------------------------------ */
:root {
  --bark: #1F3315;
  --ink: #14200E;
  --leaf: #78A254;
  --leaf-dk: #5C8340;
  --lime: #ECEFE3;
  --cream: #F5F2E8;
  --paper: #FBFAF6;
  --sage: #C3D3B2;
  --sage-pale: #DCE6D1;
  --sawdust: #DCD5C4;
  --wood: #B08556;
  --white: #FBFAF6;
  --fb: #1877F2;
  --etsy: #F1641E;
  --shadow: 0 1px 0 rgba(31,51,21,.06), 0 12px 28px -18px rgba(31,51,21,.5);
  --shadow-soft: 0 2px 4px -2px rgba(31,51,21,.12), 0 18px 40px -28px rgba(31,51,21,.55);
}

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: Karla, ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: 'Bricolage Grotesque', Karla, sans-serif;
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -.02em;
  margin: 0;
  color: var(--bark);
}
p { margin: 0; }
a { color: var(--leaf-dk); }
:focus-visible { outline: 2px solid var(--bark); outline-offset: 3px; border-radius: 2px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; position: relative; z-index: 1; }
.wrap.etroit { max-width: 760px; }

/* Réservé aux lecteurs d'écran : présent, mais invisible à l'œil */
.srconly { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------------
   Feuillage : un décor posé derrière la page, qui respire au vent.
------------------------------------------------------------------ */
.feuillage {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}
.feuillage svg { position: absolute; display: block; }
.feuillage .coin-hg { top: -30px; left: -50px; width: 42vw; max-width: 560px; }
.feuillage .coin-bd { bottom: -40px; right: -60px; width: 46vw; max-width: 620px; }
.feuillage .coin-hd { top: -20px; right: -40px; width: 26vw; max-width: 330px; opacity: .7; }
.feuillage .coin-bg { bottom: -30px; left: -40px; width: 24vw; max-width: 300px; opacity: .6; }

@media (max-width: 720px) {
  .feuillage .coin-hg { width: 62vw; }
  .feuillage .coin-bd { width: 68vw; }
  .feuillage .coin-hd, .feuillage .coin-bg { display: none; }
}

/* Le vent : la branche entière ondule, les feuilles suivent avec un retard.
   La branche pivote sur son point d'attache, donné dans le repère du viewBox
   — d'où view-box ici, et fill-box sur la feuille, qui tourne sur sa propre base. */
.brin { transform-box: view-box; transform-origin: var(--pivot, 50% 100%); }
.souffle-lent  { animation: souffle 11s ease-in-out infinite; }
.souffle-moyen { animation: souffle 8s  ease-in-out infinite; }
.souffle-vif   { animation: souffle 6s  ease-in-out infinite; }
.feuille { transform-box: fill-box; transform-origin: 8% 50%; animation: frisson 5.5s ease-in-out infinite; }

@keyframes souffle {
  0%, 100% { transform: rotate(-1.1deg) translateX(0); }
  35%      { transform: rotate(1.4deg) translateX(3px); }
  65%      { transform: rotate(.2deg) translateX(-2px); }
}
@keyframes frisson {
  0%, 100% { transform: rotate(-2.5deg); }
  40%      { transform: rotate(3.5deg); }
  70%      { transform: rotate(-1deg); }
}

/* ------------------------------------------------------------------
   En-tête
------------------------------------------------------------------ */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 0 10px; flex-wrap: wrap; }
.topbar .brand { display: inline-block; line-height: 0; }
.topbar img.logo { height: 54px; width: auto; }
.topnav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.linkbtn {
  background: none; border: none; color: var(--bark); font-size: 13px; letter-spacing: .14em;
  text-transform: uppercase; font-weight: 700; cursor: pointer; padding: 8px; text-decoration: none;
}
.linkbtn:hover { color: var(--leaf-dk); }

/* Bannière : affichée seulement si assets/banniere.png existe */
.banniere { display: block; width: 100%; height: auto; border-radius: 5px; margin: 6px 0 4px; }

/* ------------------------------------------------------------------
   Boutons de liens externes
------------------------------------------------------------------ */
.fb, .etsy {
  display: inline-flex; align-items: center; gap: 9px; text-decoration: none;
  color: #fff; font-weight: 700; font-size: 15px;
  padding: 11px 18px; border-radius: 3px; border: 2px solid transparent;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.fb { background: var(--fb); border-color: var(--fb); }
.fb:hover { background: #0F5EC4; border-color: #0F5EC4; color: #fff; }
.etsy { background: var(--etsy); border-color: var(--etsy); }
.etsy:hover { background: #D45010; border-color: #D45010; color: #fff; }
.fb svg { width: 19px; height: 19px; fill: currentColor; flex: none; }
/* L'icône boutique est dessinée au trait, pas en aplat */
.etsy svg { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.fb.small, .etsy.small { font-size: 13px; padding: 7px 12px; }
.fb.block, .etsy.block { width: 100%; justify-content: center; padding: 15px 18px; font-size: 16px; }
.liens { display: flex; gap: 10px; flex-wrap: wrap; }
.liens > * { flex: 1 1 220px; }

/* ------------------------------------------------------------------
   Estampille du code
------------------------------------------------------------------ */
.stamp {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: 'Space Mono', ui-monospace, monospace; font-weight: 700;
  font-size: 15px; letter-spacing: .22em; color: var(--wood);
  border: 2px solid var(--wood); border-radius: 3px; padding: 7px 12px 6px;
  text-transform: uppercase; box-shadow: inset 0 0 0 1px rgba(176,133,86,.25);
  background: rgba(255,255,255,.55);
}
.stamp small { font-size: 9px; letter-spacing: .18em; opacity: .85; font-weight: 400; }
.stamp.sm { font-size: 12px; letter-spacing: .16em; padding: 4px 8px 3px; border-width: 1.5px; }
.stamp.grand { font-size: 20px; letter-spacing: .3em; padding: 12px 20px 10px; }

/* ------------------------------------------------------------------
   Accueil : rien d'autre que la recherche d'une œuvre
------------------------------------------------------------------ */
.accueil { padding: 30px 0 20px; text-align: center; }
.eyebrow { font-family: 'Space Mono', monospace; font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: var(--leaf-dk); }
.accueil h1 { font-size: clamp(32px, 6.5vw, 56px); margin: 14px auto 12px; max-width: 16ch; }
.accueil h1 em { font-style: normal; color: var(--leaf-dk); }
.accueil .lede { max-width: 50ch; margin: 0 auto; color: #3E4A36; }

.chercher {
  margin: 30px auto 0; max-width: 560px;
  background: rgba(251,250,246,.92); border: 1px solid var(--sawdust); border-radius: 6px;
  padding: 26px 24px 24px; box-shadow: var(--shadow-soft);
  backdrop-filter: blur(3px);
}
.chercher label {
  display: block; font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
  font-weight: 700; color: var(--bark); margin-bottom: 12px;
}
.finder { display: flex; flex-wrap: wrap; gap: 10px; }
.finder input {
  flex: 1 1 260px; min-width: 0; padding: 15px 16px; border: 2px solid var(--bark); border-radius: 3px;
  background: #fff; font-family: 'Space Mono', monospace; font-size: 19px;
  letter-spacing: .24em; text-transform: uppercase; color: var(--ink); text-align: center;
}
.finder input::placeholder { letter-spacing: .1em; text-transform: none; color: #9AA192; font-family: Karla, sans-serif; font-size: 15px; }

/* Les trois promesses de la bannière */
.promesses {
  display: flex; gap: 26px; justify-content: center; flex-wrap: wrap;
  margin: 40px auto 10px; max-width: 800px;
}
.promesse { display: flex; align-items: center; gap: 12px; text-align: left; }
.promesse svg { width: 38px; height: 38px; flex: none; stroke: var(--bark); fill: none; stroke-width: 1.4; }
.promesse span {
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  font-weight: 700; color: var(--bark); line-height: 1.35; max-width: 12ch;
}

/* ------------------------------------------------------------------
   La boutique Etsy, reprise du flux de la boutique
------------------------------------------------------------------ */
.boutique { padding: 10px 0 56px; }
.boutique .sectionhead { margin: 10px 0 18px; align-items: center; }

.vitrine { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.article {
  display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit;
  background: rgba(251,250,246,.9); border: 1px solid var(--sawdust); border-radius: 5px;
  padding: 10px; box-shadow: var(--shadow);
  transition: transform .18s ease, border-color .18s ease;
}
.article:hover { transform: translateY(-3px); border-color: var(--leaf); }
.article .visuel {
  aspect-ratio: 1; background: var(--sage-pale); border-radius: 3px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.article .visuel img { width: 100%; height: 100%; object-fit: cover; display: block; }
.article .visuel span { font-family: 'Space Mono', monospace; font-size: 11px; letter-spacing: .2em; color: #8A8878; }
.article .nom {
  font-size: 13px; line-height: 1.35; color: var(--bark); font-weight: 700;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ------------------------------------------------------------------
   Page réseaux : les liens de l'atelier, et le chemin vers une œuvre
------------------------------------------------------------------ */
.reseaux { max-width: 440px; margin: 0 auto; padding: 40px 0 56px; text-align: center; }
.reseaux .brand { display: inline-block; line-height: 0; }
.reseaux img.logo { height: 120px; width: auto; }
.reseaux .eyebrow { margin-top: 20px; }
.reseaux .lede { max-width: 34ch; margin: 10px auto 0; color: #3E4A36; }
.carnet { display: flex; flex-direction: column; gap: 12px; margin-top: 30px; }

.retrouver {
  display: flex; align-items: center; gap: 16px; margin-top: 28px; padding: 16px 18px;
  text-align: left; text-decoration: none; color: var(--bark);
  background: rgba(251,250,246,.92); border: 1px solid var(--sawdust); border-radius: 6px;
  box-shadow: var(--shadow-soft); backdrop-filter: blur(3px);
  transition: border-color .15s ease, transform .15s ease;
}
.retrouver:hover { border-color: var(--leaf); transform: translateY(-2px); }
.retrouver .picto {
  flex: none; width: 54px; height: 54px; border-radius: 50%; border: 2px solid var(--bark);
  display: flex; align-items: center; justify-content: center;
}
.retrouver .picto svg { width: 26px; height: 26px; fill: none; stroke: var(--bark); stroke-width: 2; stroke-linecap: round; }
.retrouver strong { display: block; font-family: 'Bricolage Grotesque', Karla, sans-serif; font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.retrouver small { display: block; font-size: 13px; color: #6C7563; }
.retrouver .fleche { margin-left: auto; font-size: 20px; color: var(--leaf-dk); }

/* ------------------------------------------------------------------
   Page d'une œuvre — celle qu'on atteint en scannant le QR
------------------------------------------------------------------ */
.sheet { padding: 20px 0 60px; }
.back { display: inline-block; font-family: 'Space Mono', monospace; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--leaf-dk); text-decoration: none; padding: 6px 0; }

.oeuvre {
  background: rgba(251,250,246,.93); border: 1px solid var(--sawdust); border-radius: 6px;
  padding: 28px; box-shadow: var(--shadow-soft); backdrop-filter: blur(3px);
}
@media (max-width: 620px) { .oeuvre { padding: 20px 16px; } }

.detail { display: grid; grid-template-columns: 1.15fr .85fr; gap: 34px; align-items: start; }
@media (max-width: 860px) { .detail { grid-template-columns: 1fr; gap: 24px; } }
.detail h1 { font-size: clamp(28px, 5vw, 42px); }
.meta { font-family: 'Space Mono', monospace; font-size: 12px; letter-spacing: .14em; color: #6C7563; text-transform: uppercase; margin: 12px 0 18px; }
.desc { white-space: pre-wrap; color: #3E4A36; margin-bottom: 22px; }
.rule { height: 1px; background: var(--sawdust); border: 0; margin: 22px 0; }
.note-piece { font-size: 14px; color: #6C7563; }

.followbox { margin-top: 22px; padding: 18px; background: var(--cream); border: 1px solid var(--sawdust); border-radius: 4px; }
.followbox p { font-size: 14px; color: #3E4A36; margin-bottom: 12px; }

/* ------------------------------------------------------------------
   Galerie de médias : photos, vidéos déposées, vidéos hébergées ailleurs
------------------------------------------------------------------ */
.gallery { display: flex; flex-direction: column; gap: 10px; }
.scene {
  position: relative; width: 100%; border-radius: 4px; border: 1px solid var(--sawdust);
  background: var(--paper); overflow: hidden;
}
/* Une seule vue à la fois. Attention en touchant à ces règles : `display`
   ne doit être posé que par les deux sélecteurs ci-dessous. Un `.scene img`
   qui porterait `display: block` serait plus spécifique que `.scene > *`
   et rendrait toutes les photos visibles d'un coup. */
.scene > * { display: none; width: 100%; }
.scene > .on { display: block; }
.scene img { width: 100%; height: auto; }
.scene video { width: 100%; height: auto; background: #14200E; }
.scene .cadre { position: relative; width: 100%; aspect-ratio: 16/9; background: #14200E; }
.scene .cadre iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.strip { display: flex; gap: 8px; flex-wrap: wrap; }
.strip button {
  position: relative; width: 64px; height: 64px; padding: 0; border-radius: 3px; overflow: hidden;
  border: 2px solid transparent; cursor: pointer; background: var(--sage-pale);
}
.strip button.on { border-color: var(--leaf-dk); }
/* La vignette d'une vidéo doit se cadrer comme une photo, sinon le lecteur
   garde sa taille native et déborde du bouton. */
.strip img, .strip video { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Pastille de lecture sur les vignettes de vidéo */
.strip .play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(20,32,14,.42);
}
.strip .play::after {
  content: ''; width: 0; height: 0; margin-left: 3px;
  border-left: 13px solid #fff; border-top: 8px solid transparent; border-bottom: 8px solid transparent;
}
.vide {
  aspect-ratio: 4/3; background: var(--sage-pale); display: flex; align-items: center; justify-content: center;
  border-radius: 4px; border: 1px solid var(--sawdust);
}
.vide span { font-family: 'Space Mono', monospace; font-size: 11px; letter-spacing: .2em; color: #8A8878; }

/* ------------------------------------------------------------------
   Signature manuscrite
------------------------------------------------------------------ */
.signature-bloc { margin-top: 24px; text-align: center; }
.signature-bloc .titre {
  font-family: 'Space Mono', monospace; font-size: 10px; letter-spacing: .24em;
  text-transform: uppercase; color: #6C7563; margin-bottom: 6px;
}
.signature-bloc img { max-width: 260px; width: 100%; height: auto; display: block; margin: 0 auto; }
.signature-bloc .main { font-family: Caveat, cursive; font-size: 30px; color: var(--bark); }

/* Zone de tracé dans l'atelier */
.signature-pad { display: flex; flex-direction: column; gap: 8px; }
.signature-pad .toile {
  position: relative; background: #fff; border: 1.5px dashed var(--sawdust); border-radius: 4px;
  touch-action: none;
}
.signature-pad canvas { display: block; width: 100%; height: 180px; border-radius: 4px; cursor: crosshair; }
.signature-pad .ligne {
  position: absolute; left: 8%; right: 8%; bottom: 38px; height: 1px; background: var(--sawdust); pointer-events: none;
}
.signature-pad .consigne {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: Caveat, cursive; font-size: 24px; color: #B9C0AE; pointer-events: none;
}
.signature-pad .consigne[hidden] { display: none; }
.signature-actuelle { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.signature-actuelle img {
  max-height: 90px; background: #fff; border: 1px solid var(--sawdust); border-radius: 3px; padding: 6px;
  transition: opacity .15s ease, filter .15s ease;
}
.signature-actuelle .quoi { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
/* Retrait demandé : la signature s'efface à l'écran avant de l'être pour de bon */
.signature-actuelle.retiree img { opacity: .3; filter: grayscale(1); }
.signature-actuelle.retiree .hint { color: #A4402F; }

/* ------------------------------------------------------------------
   Patron d'intarsia — l'outil de l'atelier : une photo devient un
   gabarit de chantournage. Tout est cadré par .patron, pour que ces
   règles ne débordent jamais sur le reste du site.
------------------------------------------------------------------ */
.patron { padding-bottom: 40px; }
.patron .tete { border-bottom: 1px solid var(--sawdust); padding: 8px 0 20px; display: flex; flex-wrap: wrap; gap: 18px 28px; align-items: flex-end; justify-content: space-between; }
.patron h2.titre { font-size: clamp(26px, 4.4vw, 38px); margin: 8px 0 0; }
.patron .tagline { margin: 10px 0 0; color: #3E4A36; max-width: 58ch; font-size: 15px; }
.patron .etapes { display: flex; flex-wrap: wrap; font-family: 'Space Mono', monospace; font-size: 11px; color: #6C7563; letter-spacing: .04em; }
.patron .etapes span { padding: 0 10px; border-left: 1px solid var(--sawdust); }
.patron .etapes span:first-child { padding-left: 0; border-left: 0; }
.patron .etapes b { color: var(--bark); font-weight: 700; }

.patron .layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 26px; margin-top: 24px; align-items: start; }
@media (max-width: 920px) {
  /* Sur téléphone, le gabarit passe devant ses réglages. */
  .patron .layout { grid-template-columns: 1fr; gap: 20px; }
  .patron .rail { order: 2; position: static; }
  .patron .work { order: 1; }
}
.patron .rail { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 16px; }
.patron .work { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* Le panneau du site, mais avec un bandeau de titre : d'où le retrait
   du rembourrage, repris par .panel-body. */
.patron .panel { padding: 0; overflow: hidden; }
.patron .panel > h3 {
  font-family: 'Space Mono', monospace; font-size: 10.5px; letter-spacing: .15em;
  text-transform: uppercase; color: #6C7563; font-weight: 700;
  margin: 0; padding: 11px 14px; border-bottom: 1px solid var(--sawdust); background: var(--cream);
}
.patron .panel-body { padding: 14px; display: flex; flex-direction: column; gap: 15px; }
.patron .panel-body .field { margin-bottom: 0; }
.patron .ligne { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.patron .val { font-family: 'Space Mono', monospace; font-size: 12px; font-weight: 700; color: var(--leaf-dk); font-variant-numeric: tabular-nums; }

/* Curseurs : rail couleur sciure, bouton vert d'encre */
.patron input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 18px; background: transparent; margin: 0; cursor: pointer; }
.patron input[type=range]::-webkit-slider-runnable-track { height: 2px; background: var(--sawdust); border-radius: 2px; }
.patron input[type=range]::-moz-range-track { height: 2px; background: var(--sawdust); border-radius: 2px; }
.patron input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--leaf-dk); border: 2px solid var(--paper); margin-top: -6px; box-shadow: 0 0 0 1px var(--leaf-dk); }
.patron input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--leaf-dk); border: 2px solid var(--paper); box-shadow: 0 0 0 1px var(--leaf-dk); }

.patron .segmented { display: flex; border: 1.5px solid var(--sawdust); border-radius: 3px; overflow: hidden; }
.patron .segmented button { flex: 1; border: 0; border-left: 1px solid var(--sawdust); background: #fff; color: var(--bark); font: 700 12.5px/1 Karla, sans-serif; padding: 9px 4px; cursor: pointer; }
.patron .segmented button:first-child { border-left: 0; }
.patron .segmented button[aria-pressed=true] { background: var(--bark); color: var(--lime); }

.patron .checks { display: flex; flex-direction: column; gap: 9px; }
.patron .check { display: flex; align-items: center; gap: 9px; font-size: 14px; cursor: pointer; }
.patron .check input { accent-color: var(--leaf-dk); width: 15px; height: 15px; margin: 0; }

/* Le bandeau de chiffres */
.patron .statbar { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); border: 1px solid var(--sawdust); border-radius: 4px; background: var(--paper); overflow: hidden; margin: 0; }
.patron .stat { padding: 11px 13px; border-left: 1px solid var(--sawdust); }
.patron .stat:first-child { border-left: 0; }
.patron .stat dt { font-family: 'Space Mono', monospace; font-size: 10px; letter-spacing: .11em; text-transform: uppercase; color: #6C7563; margin: 0 0 3px; }
.patron .stat dd { margin: 0; font-family: 'Bricolage Grotesque', Karla, sans-serif; font-weight: 800; font-size: 19px; color: var(--bark); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.patron .stat dd small { font-family: Karla, sans-serif; font-weight: 500; font-size: 11.5px; color: #6C7563; margin-left: 2px; }
/* Une pièce plus petite que la lame : on le signale en rouge d'atelier */
.patron .stat.flag dd { color: #A4402F; }

/* Le plateau où s'affiche le gabarit */
.patron .board { position: relative; background: var(--sage-pale); border: 1px solid var(--sawdust); border-radius: 4px; padding: 14px; min-height: 220px; }
.patron .board.drag { outline: 2px dashed var(--leaf-dk); outline-offset: -6px; }
.patron .board svg { display: block; width: 100%; height: auto; }
.patron .busy {
  position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
  background: rgba(220,230,209,.78);
  font-family: 'Space Mono', monospace; font-size: 12px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--bark);
}
.patron .board[data-busy=true] .busy { display: flex; }

.patron .sourcebar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.patron .sourcebar .who { font-size: 13px; color: #6C7563; }
.patron .sourcebar .who b { color: var(--bark); font-weight: 700; }
.patron .btnrow { display: flex; gap: 8px; flex-wrap: wrap; }

/* Répartition par essence */
.patron .essences { border: 1px solid var(--sawdust); border-radius: 4px; background: var(--paper); overflow: hidden; }
.patron .essences > h3 { font-family: 'Space Mono', monospace; font-size: 10.5px; letter-spacing: .15em; text-transform: uppercase; color: #6C7563; font-weight: 700; margin: 0; padding: 11px 14px; border-bottom: 1px solid var(--sawdust); background: var(--cream); }
.patron table { width: 100%; border-collapse: collapse; font-size: 14px; }
.patron th { text-align: left; font-family: 'Space Mono', monospace; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: #6C7563; font-weight: 700; padding: 8px 14px; border-bottom: 1px solid var(--sawdust); }
.patron th.num, .patron td.num { text-align: right; font-variant-numeric: tabular-nums; }
.patron td { padding: 7px 14px; border-bottom: 1px solid var(--sawdust); }
.patron tr:last-child td { border-bottom: 0; }
.patron td.num { font-family: 'Space Mono', monospace; font-size: 12.5px; color: var(--bark); }
.patron .swatch { width: 22px; height: 22px; border-radius: 2px; border: 1px solid rgba(31,51,21,.28); display: inline-block; vertical-align: middle; }
.patron .tonecell { display: flex; align-items: center; gap: 10px; }
.patron .tonecell select { width: auto; min-width: 130px; padding: 5px 7px; font-size: 13px; }
.patron .tone-id { font-family: 'Space Mono', monospace; font-size: 11px; color: #6C7563; width: 20px; }

.patron .notes { border-top: 1px solid var(--sawdust); margin-top: 30px; padding-top: 22px; display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.patron .notes h3 { font-size: 16px; margin: 0 0 6px; }
.patron .notes p { color: #3E4A36; font-size: 13.5px; line-height: 1.6; }

/* Message passager : enregistrement, copie, image refusée */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 20px; z-index: 60;
  background: var(--bark); color: var(--lime); font-size: 13px; padding: 10px 18px;
  border-radius: 3px; box-shadow: var(--shadow-soft);
}

/* ------------------------------------------------------------------
   Patron v2 — l'atelier de pieces. La page porte .patron et .patron2 :
   tout le decor vient de la v1, on n'ajoute ici que ce qui lui manque.
------------------------------------------------------------------ */
.patron2 .board { padding: 8px; background: var(--paper); }
.patron2 canvas {
  display: block; width: 100%; height: auto; border-radius: 3px;
  touch-action: none; cursor: crosshair; background: var(--sage-pale);
}
.patron2 canvas[data-outil=bois]    { cursor: cell; }
.patron2 canvas[data-outil=separer] { cursor: not-allowed; }
.patron2 canvas[data-outil=fil]     { cursor: grab; }

.patron2 .outils { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.patron2 .outils button {
  border: 1.5px solid var(--sawdust); background: #fff; color: var(--bark);
  font: 700 12.5px/1.2 Karla, sans-serif; padding: 9px 6px; border-radius: 3px; cursor: pointer;
}
.patron2 .outils button[aria-pressed=true] { background: var(--bark); color: var(--lime); border-color: var(--bark); }

.patron2 .palette { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; }
.patron2 .bois {
  display: flex; align-items: center; gap: 6px; text-align: left; cursor: pointer;
  border: 1px solid var(--sawdust); background: #fff; border-radius: 3px;
  padding: 4px 6px; font: 500 11.5px/1.2 Karla, sans-serif; color: var(--bark);
}
.patron2 .bois[aria-pressed=true] { border-color: var(--bark); box-shadow: inset 0 0 0 1px var(--bark); }
.patron2 .bois .swatch { width: 14px; height: 14px; flex: none; }

/* Hors patron : des hachures, pour qu'on ne le prenne pas pour un bois clair */
.patron2 .bois.hors .swatch, .patron2 .swatch.hors {
  background: repeating-linear-gradient(45deg, #ECE8DD 0 3px, #C9C1AE 3px 4.5px);
}

/* La barre du recadrage, posée au-dessus de la planche */
.patron2 .cadrage {
  display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between;
  background: var(--bark); color: var(--lime); border-radius: 4px; padding: 10px 14px;
}
.patron2 .cadrage[hidden] { display: none; }
.patron2 .cadrage p { margin: 0; font-size: 13px; line-height: 1.5; flex: 1 1 280px; }
.patron2 .cadrage .btn { background: var(--leaf-dk); border-color: var(--leaf-dk); color: #fff; }
.patron2 .cadrage .btn.ghost { color: var(--lime); border-color: rgba(236,239,227,.5); background: transparent; }
.patron2 .cadrage .btn.ghost:hover { background: rgba(236,239,227,.12); }

.patron2 .rule { margin: 4px 0; }
.patron2 .row.serree { gap: 8px; }
.patron2 .panel-body .btn.sm { padding: 7px 10px; }

/* ------------------------------------------------------------------
   Patron v3 — le panneau « Demander à Claude ». La page porte en plus
   .patron3 ; le cadre reprend celui de la liste des bois.
------------------------------------------------------------------ */
.patron3 .claude { border: 1px solid var(--sawdust); border-radius: 4px; background: var(--paper); overflow: hidden; }
.patron3 .claude > h3 { font-family: 'Space Mono', monospace; font-size: 10.5px; letter-spacing: .15em; text-transform: uppercase; color: #6C7563; font-weight: 700; margin: 0; padding: 11px 14px; border-bottom: 1px solid var(--sawdust); background: var(--cream); }
.patron3 .claude-corps { padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.patron3 .claude-corps .field { margin-bottom: 0; }
.patron3 .claude-corps .notice { margin: 0; }
.patron3 .claude-etape { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.patron3 .claude-etape .hint { flex: 1 1 220px; }
.patron3 .claude-corps .hint { font-size: 12.5px; line-height: 1.5; color: #6C7563; }
.patron3 #v3-mode { max-width: 420px; margin-bottom: 10px; }
.patron3 #v3-fond-bloc { margin-bottom: 6px; }
.patron3 #v3-fond-bloc[hidden] { display: none; }
.patron3 #v3-description { min-height: 240px; font-size: 14px; line-height: 1.55; }
.patron3 .claude-etat { margin: 0; font-size: 13.5px; color: var(--bark); font-weight: 700; }
.patron3 .claude-etat:empty { display: none; }
.patron3 .pensee summary, .patron3 .claude-resultat summary { cursor: pointer; font-size: 13px; color: #6C7563; }
.patron3 .pensee div { white-space: pre-wrap; max-height: 220px; overflow: auto; margin-top: 8px; font-size: 12.5px; line-height: 1.5; color: #6C7563; }
.patron3 .claude-resultat { border-top: 1px solid var(--sawdust); padding-top: 12px; }
.patron3 .claude-resultat h4 { font-size: 14px; margin: 0 0 4px; }
.patron3 .claude-resultat p { margin: 0 0 12px; font-size: 13.5px; line-height: 1.6; color: #3E4A36; white-space: pre-wrap; }
.patron3 .claude-resultat ol { margin: 8px 0 0; padding-left: 22px; font-size: 13px; line-height: 1.5; color: #3E4A36; }
.patron3 .claude-resultat li { margin-bottom: 4px; }

/* ------------------------------------------------------------------
   Boutons
------------------------------------------------------------------ */
.btn {
  display: inline-block; border: 2px solid var(--bark); background: var(--bark); color: var(--lime);
  padding: 13px 22px; border-radius: 3px; font-weight: 700; font-size: 15px; cursor: pointer;
  font-family: inherit; text-decoration: none; text-align: center;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.btn:hover { background: var(--leaf-dk); border-color: var(--leaf-dk); color: var(--lime); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--bark); }
.btn.ghost:hover { background: var(--bark); color: var(--lime); }
.btn.leaf { background: var(--leaf-dk); border-color: var(--leaf-dk); color: #fff; }
.btn.danger { background: transparent; border-color: #A4402F; color: #A4402F; }
.btn.danger:hover { background: #A4402F; color: #fff; }
.btn.sm { padding: 7px 13px; font-size: 13px; border-width: 1.5px; }
.btn.block { display: block; width: 100%; }
.btn[disabled] { opacity: .55; cursor: default; }
/* Bouton portant une icône au trait, comme « Page scannée » */
.btn.avec-icone { display: inline-flex; align-items: center; gap: 7px; }
.btn.avec-icone svg {
  width: 15px; height: 15px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round;
}

.notice { margin-top: 14px; padding: 12px 14px; border-radius: 3px; font-size: 14px; }
.notice.warn { background: #FBEDE9; border: 1px solid #E3BBB1; color: #A4402F; }
.notice.ok { background: #E8F0E0; border: 1px solid #BBD1A8; color: #3E5C2A; }

/* ------------------------------------------------------------------
   Atelier
------------------------------------------------------------------ */
.sectionhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 34px 0 16px; flex-wrap: wrap; }
.sectionhead h2 { font-size: 22px; }
.count { font-family: 'Space Mono', monospace; font-size: 12px; letter-spacing: .16em; color: #6C7563; }

.panel { background: var(--paper); border: 1px solid var(--sawdust); border-radius: 4px; padding: 22px; box-shadow: var(--shadow); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--bark); }
.field .hint { font-size: 12px; color: #6C7563; letter-spacing: 0; text-transform: none; font-weight: 400; }
.field input[type=text], .field input[type=password], .field input[type=date], .field input[type=url], .field input[type=number], .field textarea, .field select {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--sawdust); border-radius: 3px;
  background: #fff; font-family: inherit; font-size: 15px; color: var(--ink);
}
.field textarea { resize: vertical; min-height: 110px; }
.field select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%231F3315' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; background-size: 11px; }
.field.note textarea, .field.note input { background: #FFF9E8; border-color: #E4D6A8; }

fieldset.bloc { border: 1px solid var(--sawdust); border-radius: 4px; padding: 16px; margin: 0 0 18px; }
fieldset.bloc > legend {
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700;
  color: var(--bark); padding: 0 8px;
}

.row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1 1 220px; }
.row.serree > * { flex: 0 0 auto; }

.adminlist { display: flex; flex-direction: column; gap: 10px; padding-bottom: 40px; }
.item { display: flex; align-items: center; gap: 14px; background: var(--paper); border: 1px solid var(--sawdust); border-radius: 4px; padding: 10px 12px; flex-wrap: wrap; }
.item .mini { width: 56px; height: 56px; border-radius: 3px; object-fit: cover; background: var(--sage-pale); flex: none; }
.item .who { flex: 1 1 200px; min-width: 0; }
.item .who strong { display: block; font-family: 'Bricolage Grotesque', sans-serif; font-size: 17px; color: var(--bark); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .who span { font-family: 'Space Mono', monospace; font-size: 11px; letter-spacing: .14em; color: #6C7563; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pill { display: inline-block; font-family: 'Space Mono', monospace; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; background: #FFF9E8; border: 1px solid #E4D6A8; color: #8A6D18; border-radius: 2px; padding: 2px 6px; }
.pill.vert { background: #E8F0E0; border-color: #BBD1A8; color: #3E5C2A; }

/* Médias déjà attachés, dans le formulaire */
.medias { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.medias figure { margin: 0; width: 116px; }
.medias .apercu {
  position: relative; width: 116px; height: 116px; border-radius: 3px; border: 1px solid var(--sawdust);
  overflow: hidden; background: var(--sage-pale); display: flex; align-items: center; justify-content: center;
}
.medias .apercu img { width: 100%; height: 100%; object-fit: cover; display: block; }
.medias .apercu video { width: 100%; height: 100%; object-fit: cover; display: block; background: #14200E; }
.medias .apercu .marque {
  position: absolute; left: 0; right: 0; bottom: 0; background: rgba(20,32,14,.72); color: #fff;
  font-family: 'Space Mono', monospace; font-size: 9px; letter-spacing: .14em; text-transform: uppercase;
  text-align: center; padding: 3px 2px;
}
.medias label { display: flex; gap: 5px; align-items: center; font-size: 11px; letter-spacing: 0; text-transform: none; color: #A4402F; margin-top: 5px; font-weight: 400; }

.empty { text-align: center; padding: 46px 20px; border: 1.5px dashed var(--sawdust); border-radius: 4px; color: #6C7563; }

.modal { position: fixed; inset: 0; background: rgba(20,32,14,.62); display: flex; align-items: flex-start; justify-content: center; padding: 24px; overflow: auto; z-index: 50; }
.modal[hidden] { display: none; }
.modal .inner { background: var(--paper); border-radius: 5px; padding: 20px; max-width: 520px; width: 100%; }
.modal .inner img.preview { width: 100%; border: 1px solid var(--sawdust); border-radius: 3px; display: block; margin-bottom: 16px; }

.footer { border-top: 1px solid var(--sawdust); padding: 22px 0 34px; font-size: 13px; color: #6C7563; display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; align-items: center; }
.footer .baseline { font-family: 'Space Mono', monospace; font-size: 12px; letter-spacing: .14em; }

/* ------------------------------------------------------------------
   Personne ne doit subir le vent : on coupe tout mouvement à la demande.
------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
