/* Palier commun : un tableau d'affichage de palier. Papier quadrillé, fiches cartonnées, post-it, étiquettes et tickets. */
:root {
  --paper: #f6f1e7;
  --sheet: #fffdf8;
  --ink: #231d16;
  --muted: #5a4f42;
  --accent: #0b5d6b;
  --hot: #a8311f;
  --tape: #ffd85e;
  --cork: #c9a06a;
  --focus: #0b5d6b;
  --w: 1080px;
  --hand: "Segoe Print", "Bradley Hand", "Marker Felt", "Chalkboard SE", "Comic Sans MS", cursive;
  --slab: Rockwell, "Roboto Slab", "Zilla Slab", "Rockwell Nova", Georgia, "Times New Roman", serif;
  --body: "Avenir Next", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; color: var(--ink); font: 1.0625rem/1.65 var(--body);
  background-color: var(--paper);
  background-image: linear-gradient(rgba(35, 29, 22, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(35, 29, 22, .05) 1px, transparent 1px);
  background-size: 28px 28px;
  overflow-wrap: break-word;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--hot); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.rail :focus-visible, .wall :focus-visible { --focus: #ffd85e; }
h1, h2, h3 { font-family: var(--slab); line-height: 1.2; margin: 0; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.3em; }
mark { background: linear-gradient(transparent 58%, var(--tape) 58%); color: inherit; padding: 0 .1em; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--tape); color: var(--ink); padding: 10px 16px; font-weight: 700; }
.skip:focus { top: 10px; }
main > * { width: min(var(--w), calc(100% - 32px)); margin-left: auto; margin-right: auto; margin-top: 40px; min-width: 0; }
main > :first-child { margin-top: 28px; }
main { padding-bottom: 56px; }
td, th, li, label, summary, .field, .month, .scroll { position: relative; }

/* ---------- Rail (en-tête) ---------- */
.rail { background: var(--ink); color: var(--paper); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 20px; padding: 10px max(16px, calc((100% - var(--w)) / 2)); border-bottom: 6px solid var(--tape); }
.rail a { color: var(--paper); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--slab); font-size: 1.35rem; font-weight: 800; letter-spacing: -.01em; }
.brand-name { line-height: 1.1; }
.brand:hover { color: var(--tape); }
.brand em { font-style: normal; font-weight: 400; color: var(--tape); }
.brand-foot em { color: var(--tape); }
.tabs { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.tabs > a, .more > summary { display: inline-block; padding: 8px 14px; text-decoration: none; font-weight: 600; font-size: .98rem; border: 2px solid transparent; border-radius: 0; cursor: pointer; list-style: none; color: var(--paper); }
.tabs > a:hover, .more > summary:hover { background: var(--paper); color: var(--ink); }
.more > summary::-webkit-details-marker { display: none; }
.more > summary::after { content: " ▾"; }
.more[open] > summary { background: var(--paper); color: var(--ink); }
.more { position: relative; }
.more-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; display: grid; min-width: 240px; max-width: calc(100vw - 32px); background: var(--sheet); border: 2px solid var(--ink); box-shadow: 6px 6px 0 rgba(35, 29, 22, .35); }
.more-panel a { color: var(--ink); padding: 10px 16px; text-decoration: none; font-weight: 600; border-bottom: 1px dashed rgba(35, 29, 22, .35); }
.more-panel a:last-child { border-bottom: 0; }
.more-panel a:hover { background: var(--tape); color: var(--ink); }

/* ---------- Pied de page (le mur) ---------- */
.wall { background: var(--ink); color: var(--paper); padding: 40px 16px 20px; margin-top: 24px; border-top: 6px solid var(--tape); }
.wall a { color: var(--paper); }
.wall a:hover { color: var(--tape); }
.wall-grid { width: min(var(--w), 100%); margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(4, minmax(0, 1fr)); gap: 28px; }
.wall-grid > * { min-width: 0; }
.wall-about p { font-size: .95rem; margin-top: 12px; color: #e9e1d2; }
.foot-title { font-family: var(--slab); font-weight: 800; color: var(--tape); margin: 0 0 8px; font-size: 1.05rem; }
.wall ul { list-style: none; padding: 0; margin: 0; }
.wall li { margin: 5px 0; font-size: .95rem; }
.wall-base { width: min(var(--w), 100%); margin: 28px auto 0; border-top: 1px dashed rgba(246, 241, 231, .4); padding-top: 14px; font-size: .88rem; color: #e9e1d2; }
.wall-base p { margin: 0; }

/* ---------- Accueil : le panneau ---------- */
.board { width: 100%; max-width: none; margin-top: 0; padding: 40px max(16px, calc((100% - var(--w)) / 2)); display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 34px; align-items: center; background-color: var(--cork); background-image: radial-gradient(rgba(60, 35, 10, .28) 1.2px, transparent 1.6px), radial-gradient(rgba(255, 255, 255, .18) 1px, transparent 1.4px); background-size: 14px 14px, 22px 22px; background-position: 0 0, 7px 7px; border-bottom: 6px solid var(--ink); }
.board-main { position: relative; background: var(--sheet); border: 2px solid var(--ink); padding: 34px 34px 26px; transform: rotate(-.5deg); box-shadow: 8px 8px 0 rgba(35, 29, 22, .45); min-width: 0; }
.board-main::before { content: ""; position: absolute; top: -16px; left: 50%; width: 120px; height: 30px; margin-left: -60px; background: rgba(255, 216, 94, .9); border: 1px dashed rgba(35, 29, 22, .35); transform: rotate(-2deg); }
.tape { display: inline-block; background: var(--ink); color: var(--paper); font-family: var(--hand); font-size: .95rem; letter-spacing: .04em; padding: 4px 12px; margin: 0 0 14px; }
.board h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 800; letter-spacing: -.02em; }
.board .lead { margin-top: 16px; font-size: 1.12rem; }
.board-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 18px; }
.board-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; min-width: 0; }
.stat { background: #ffe98a; border: 1px solid rgba(35, 29, 22, .5); padding: 18px 20px 16px; box-shadow: 5px 6px 0 rgba(35, 29, 22, .4); transform: rotate(2deg); position: relative; }
.stat.s2 { background: #ffb3cf; transform: rotate(-2.2deg); margin-left: 18px; }
.stat.s3 { background: #b4f0bf; transform: rotate(1.4deg); }
.stat::after { content: ""; position: absolute; top: -9px; left: 50%; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: var(--hot); border: 2px solid var(--ink); }
.stat b { display: block; font-family: var(--hand); font-size: 2.6rem; line-height: 1.1; }
.stat span { font-weight: 600; }

/* ---------- En-tête de page ---------- */
.entete { position: relative; background: var(--sheet); border: 2px solid var(--ink); border-left: 18px solid var(--c, var(--tape)); padding: 24px 28px; box-shadow: 6px 6px 0 rgba(35, 29, 22, .18); }
.entete h1 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); font-weight: 800; letter-spacing: -.015em; }
.entete .lead { margin: 12px 0 0; font-size: 1.1rem; max-width: 62ch; }
.crumbs { margin-bottom: 12px; font-size: .9rem; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 2px 6px; list-style: none; margin: 0; padding: 0; }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--muted); }
.crumbs [aria-current] { color: var(--muted); }
.byline { display: flex; align-items: center; gap: 10px; margin: 16px 0 0; font-size: .92rem; color: var(--muted); }
.board .byline { margin: 0; }
.avatar { flex: none; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--ink); color: var(--tape); font-family: var(--slab); font-weight: 800; font-size: .85rem; }
.compte { display: inline-block; margin: 14px 0 0; padding: 4px 14px; border: 2px dashed var(--ink); font-weight: 600; }
.compte b { font-family: var(--hand); font-size: 1.3rem; margin-right: 4px; }
.portrait { display: grid; place-items: center; width: 110px; height: 110px; margin: 0 0 14px; border-radius: 50%; background: var(--ink); color: var(--tape); font-family: var(--slab); font-size: 2.4rem; font-weight: 800; }

/* ---------- Rayons et étiquettes ---------- */
.rayon > h2 { display: inline-block; max-width: 100%; background: var(--ink); color: var(--paper); font-size: clamp(1.25rem, 2.6vw, 1.7rem); padding: 6px 16px; margin: 0 0 14px; transform: rotate(-.6deg); box-shadow: 4px 4px 0 var(--tape); }
.rayon > .note, .note { color: var(--muted); max-width: 70ch; }
.note a { color: var(--accent); }

/* ---------- Grilles et cartes ---------- */
.grid { list-style: none; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.grid > li { min-width: 0; display: flex; }
.grid > li > a { flex: 1 1 auto; min-width: 0; }
.fiche { display: grid; align-content: start; gap: 4px; background: var(--sheet); border: 2px solid var(--ink); border-top: 16px solid var(--c, var(--tape)); padding: 14px 16px 16px; color: var(--ink); text-decoration: none; box-shadow: 5px 5px 0 rgba(35, 29, 22, .85); transition: transform .12s, box-shadow .12s; }
.fiche:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 rgba(35, 29, 22, .85); color: var(--ink); }
.fiche i { font-style: normal; font-size: 1.9rem; line-height: 1.2; }
.fiche b { font-family: var(--slab); font-size: 1.12rem; line-height: 1.25; }
.fiche span { color: var(--muted); font-size: .92rem; line-height: 1.4; }
.tickets { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.ticket { display: grid; grid-template-columns: 56px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 12px; align-content: center; background: #fff6cf; border: 2px dashed var(--ink); padding: 12px 14px; color: var(--ink); text-decoration: none; position: relative; transition: transform .12s; }
.ticket:hover { transform: rotate(-.8deg) scale(1.01); color: var(--ink); background: #ffeb99; }
.ticket i { grid-row: 1 / 3; align-self: center; font-style: normal; font-size: 1.8rem; text-align: center; border-right: 2px dashed var(--ink); padding-right: 10px; }
.ticket b { font-family: var(--slab); font-size: 1.02rem; line-height: 1.25; align-self: end; }
.ticket span { font-size: .9rem; color: var(--muted); line-height: 1.35; align-self: start; }
.sites { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
.sites > li { position: relative; padding: 4px; }
.sites > li:nth-child(3n+1) { transform: rotate(-1deg); }
.sites > li:nth-child(3n+2) { transform: rotate(.8deg); }
.postit { display: grid; align-content: start; gap: 6px; background: var(--c, #ffe98a); border: 1px solid rgba(35, 29, 22, .45); padding: 16px 40px 14px 14px; color: var(--ink); text-decoration: none; box-shadow: 3px 4px 0 rgba(35, 29, 22, .35); position: relative; min-height: 84px; }
.postit::after { content: ""; position: absolute; right: 0; bottom: 0; width: 22px; height: 22px; background: linear-gradient(135deg, rgba(246, 241, 231, .95) 50%, rgba(35, 29, 22, .22) 50%); }
.postit:hover { box-shadow: 5px 6px 0 rgba(35, 29, 22, .55); color: var(--ink); text-decoration: underline; }
.postit b { font-family: var(--slab); font-size: 1.02rem; line-height: 1.25; overflow-wrap: anywhere; }
.postit span { font-size: .85rem; line-height: 1.3; }
.fav { position: absolute; top: 8px; right: 8px; z-index: 2; width: 36px; height: 36px; display: grid; place-items: center; background: rgba(255, 253, 248, .85); border: 1px solid var(--ink); color: var(--ink); font-size: 1.25rem; line-height: 1; cursor: pointer; padding: 0; }
.fav[aria-pressed="true"] { background: var(--ink); color: var(--tape); }
.has-fav .postit { padding-right: 52px; }

/* ---------- Annuaire : recherche, filtres, favoris ---------- */
.finder { margin: 18px 0 8px; }
.finder-row { position: relative; max-width: 560px; }
.finder-row input { width: 100%; font: inherit; padding: 13px 48px 13px 16px; border: 2px solid var(--ink); background: #fff; color: var(--ink); border-radius: 0; }
.finder-clear { position: absolute; right: 4px; top: 4px; width: 40px; height: 40px; border: 0; background: transparent; font-size: 1.1rem; cursor: pointer; color: var(--ink); }
.aide { font-size: .88rem; color: var(--muted); margin: 6px 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 14px 0 0; }
.chips button { font: inherit; font-size: .9rem; padding: 6px 12px; border: 2px solid var(--ink); background: var(--sheet); color: var(--ink); cursor: pointer; border-radius: 0; }
.chips button:hover { background: var(--c, var(--tape)); }
.chips button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.finder-count { margin: 12px 0 0; font-weight: 600; color: var(--muted); }
.favbox { margin: 20px 0; padding: 18px 20px; background: #fff3c4; border: 2px dashed var(--ink); }
.favbox h3 { font-size: 1.15rem; margin-bottom: 8px; }
.favbox-actions { display: flex; flex-wrap: wrap; gap: 12px 20px; margin: 14px 0 8px; }
.linkbtn { font: inherit; background: none; border: 0; padding: 4px 0; color: var(--accent); text-decoration: underline; text-decoration-thickness: 2px; cursor: pointer; }
.linkbtn:hover { color: var(--hot); }
.empty { text-align: center; padding: 30px 12px; border: 2px dashed var(--ink); background: var(--sheet); margin-top: 18px; }
.empty-emoji { font-size: 2.4rem; }
.directory { min-width: 0; }

/* ---------- Boutons ---------- */
.btn { display: inline-block; font: inherit; font-weight: 700; text-decoration: none; text-align: center; padding: 12px 22px; background: var(--ink); color: var(--paper); border: 2px solid var(--ink); cursor: pointer; border-radius: 0; box-shadow: 4px 4px 0 var(--tape); transition: transform .1s, box-shadow .1s; }
.btn:hover { background: var(--hot); border-color: var(--hot); color: #fff; transform: translate(-1px, -1px); }
.btn.alt { background: var(--sheet); color: var(--ink); box-shadow: 4px 4px 0 rgba(35, 29, 22, .3); }
.btn.alt:hover { background: var(--tape); color: var(--ink); border-color: var(--ink); }
.btn.small { padding: 8px 14px; font-size: .95rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.actions-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 0; }

/* ---------- Texte courant : la feuille ---------- */
.feuille { background: var(--sheet); border: 2px solid var(--ink); border-left: 6px double rgba(168, 49, 31, .75); padding: 30px 34px; box-shadow: 6px 6px 0 rgba(35, 29, 22, .15); }
.prose h2 { font-size: 1.5rem; margin: 1.7em 0 .6em; padding-bottom: 6px; border-bottom: 2px dashed rgba(35, 29, 22, .45); }
.prose > h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.15rem; margin: 1.4em 0 .5em; }
.prose p, .prose li { max-width: 72ch; }
.prose.wide p, .prose.wide li { max-width: none; }
.prose .intro { font-size: 1.15rem; font-weight: 600; border-left: 5px solid var(--tape); padding-left: 14px; }
.prose ul.grid { max-width: none; padding: 0; }
.prose ul.grid li { max-width: none; }
.plain { columns: 2 240px; column-gap: 28px; padding-left: 1.1em; }
.plain li { break-inside: avoid; margin: 3px 0; }
.facts { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: 8px 22px; margin: 0; }
.facts dt { font-weight: 700; }
.facts dd { margin: 0; }
.links { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.links li { max-width: none; }
.links a { display: grid; gap: 2px; padding: 12px 14px; border: 2px solid var(--ink); background: #fff; text-decoration: none; color: var(--ink); overflow-wrap: anywhere; }
.links a span { font-size: .9rem; color: var(--muted); }
.links a:hover { background: var(--tape); }
.chiplist { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.chiplist li { max-width: 100%; }
.chiplist a { display: inline-block; padding: 7px 14px; border: 2px solid var(--ink); background: #fff; color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; }
.chiplist a:hover { background: var(--tape); color: var(--ink); }
.checklist { background: #fff3c4; border: 2px dashed var(--ink); padding: 8px 22px; }
.checklist ul { list-style: none; padding: 0; margin: 0; }
.checklist li { padding: 7px 0 7px 32px; position: relative; border-bottom: 1px dotted rgba(35, 29, 22, .35); }
.checklist li:last-child { border-bottom: 0; }
.checklist li::before { content: ""; position: absolute; left: 2px; top: 13px; width: 16px; height: 16px; border: 2px solid var(--ink); background: #fff; }
.callout { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; margin: 28px 0; padding: 18px 22px; background: #fff; border: 2px solid var(--ink); border-left: 14px solid var(--c, var(--tape)); }
.callout p { margin: 0; font-weight: 600; max-width: 46ch; }
.guide-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.guide-nav a { display: grid; gap: 4px; padding: 14px 16px; border: 2px solid var(--ink); background: #fff; color: var(--ink); text-decoration: none; font-family: var(--slab); font-weight: 700; }
.guide-nav a span { font-family: var(--body); font-size: .85rem; font-weight: 600; color: var(--muted); }
.guide-nav a:hover { background: var(--tape); }
.guide-nav a[rel="next"] { text-align: right; }
.faq { display: grid; gap: 10px; }
.faq details { background: #fff; border: 2px solid var(--ink); padding: 0; }
.faq summary { cursor: pointer; font-weight: 700; padding: 12px 16px; list-style: none; position: relative; padding-right: 44px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 16px; top: 8px; font-size: 1.4rem; font-weight: 400; }
.faq details[open] summary::after { content: "−"; }
.faq details[open] summary { background: var(--tape); }
.faq details p { margin: 0; padding: 12px 16px 14px; max-width: none; }
.rayon.faq { background: transparent; border: 0; padding: 0; }

/* ---------- Outils : le carnet et le ticket de caisse ---------- */
.atelier { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .95fr); gap: 28px; align-items: start; }
.atelier > * { min-width: 0; }
.carnet { position: relative; background: var(--sheet); border: 2px solid var(--ink); padding: 24px 22px 12px 46px; box-shadow: 6px 6px 0 rgba(35, 29, 22, .18); background-image: radial-gradient(circle at 18px 50%, var(--paper) 0 5px, var(--ink) 5.5px 6.5px, transparent 7px); background-size: 36px 34px; background-repeat: repeat-y; background-position: 0 6px; }
.carnet > * { min-width: 0; }
.field { display: grid; gap: 6px; margin-bottom: 16px; min-width: 0; }
.field label { font-weight: 700; font-size: .96rem; line-height: 1.35; }
.field input[type="number"], .field input[type="text"], .field input[type="date"], .field input[type="search"], .field select, .field textarea, .embedbox textarea { width: 100%; max-width: 100%; min-width: 0; font: inherit; padding: 10px 12px; border: 2px solid var(--ink); background: #fff; color: var(--ink); border-radius: 0; }
.field textarea, .embedbox textarea { font-family: var(--mono); font-size: .93rem; line-height: 1.5; resize: vertical; }
.field.check { display: flex; align-items: center; gap: 10px; }
.field.check input { width: 22px; height: 22px; accent-color: var(--ink); flex: none; }
.field.check label { font-weight: 600; }
.result { position: relative; background: #fffef9; border: 2px solid var(--ink); padding: 6px 0 0; box-shadow: 6px 6px 0 rgba(35, 29, 22, .18); min-width: 0; }
.atelier > .result { position: sticky; top: 14px; }
.result::before { content: ""; display: block; height: 10px; margin: -6px 0 6px; background: repeating-linear-gradient(135deg, var(--ink) 0 8px, transparent 8px 16px); opacity: .85; }
.res { margin: 0; padding: 0; }
.res > div { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 14px; padding: 10px 16px; border-bottom: 1px dashed rgba(35, 29, 22, .4); }
.res dt { color: var(--muted); font-size: .94rem; flex: 1 1 140px; min-width: 0; overflow-wrap: break-word; }
.res dd { margin: 0; font-weight: 700; text-align: right; flex: 0 1 auto; min-width: 0; max-width: 100%; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.res .main { background: #ffe98a; border-bottom: 2px solid var(--ink); }
.res .main dt { color: var(--ink); font-weight: 600; }
.res .main dd { font-family: var(--slab); font-size: 1.3rem; }
.rnote { margin: 0; padding: 12px 16px; font-size: .88rem; color: var(--muted); }
.err { margin: 0; padding: 14px 16px; background: #fff0ec; color: #8a2515; font-weight: 600; border-top: 2px solid #8a2515; }
.conv-main { margin: 0; padding: 14px 16px; font-family: var(--slab); font-size: 1.35rem; font-weight: 700; background: #ffe98a; border-bottom: 2px solid var(--ink); overflow-wrap: anywhere; }
.status { min-height: 1.4em; font-size: .92rem; color: var(--muted); }
.swap { justify-self: start; font: inherit; font-weight: 700; padding: 8px 14px; border: 2px solid var(--ink); background: var(--tape); color: var(--ink); cursor: pointer; margin-bottom: 16px; border-radius: 0; }
.swap:hover { background: var(--ink); color: var(--tape); }
.example { background: #fff; border: 2px dashed var(--ink); padding: 14px 18px; margin: 14px 0; }
.example ul { margin: 0 0 12px; }
.example .result { box-shadow: none; }
.embedbox { background: #fff; border: 2px dashed var(--ink); padding: 16px 18px; }
.embedbox textarea { margin: 6px 0 12px; }
.scroll { overflow-x: auto; max-width: 100%; position: relative; }
pre.out { margin: 0; padding: 14px 16px; font-family: var(--mono); font-size: .9rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; background: #fff; border-top: 2px solid var(--ink); }
.out:focus-visible { outline-offset: -3px; }

/* ---------- Tables et agenda ---------- */
.evlist { width: 100%; min-width: 460px; border-collapse: collapse; background: #fff; }
.evlist th, .evlist td { text-align: left; padding: 9px 12px; border: 1px solid rgba(35, 29, 22, .45); vertical-align: top; font-size: .95rem; }
.evlist thead th { background: var(--ink); color: var(--paper); font-weight: 700; }
.evlist tbody th { font-weight: 700; background: #fff8e1; }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 18px; }
.controls label { font-weight: 700; }
.controls select { font: inherit; padding: 8px 12px; border: 2px solid var(--ink); background: #fff; color: var(--ink); border-radius: 0; }
.months { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 14px; margin: 14px 0 24px; }
.month { min-width: 0; background: #fff; border: 1px solid var(--ink); padding: 8px; }
.month table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: .8rem; text-align: center; }
.month caption { font-family: var(--slab); font-weight: 800; text-align: left; padding: 2px 2px 6px; font-size: .95rem; }
.month th, .month td { padding: 3px 0; position: relative; }
.month th { color: var(--muted); font-weight: 600; }
.mk span { display: inline-block; min-width: 22px; padding: 1px 0; font-weight: 800; border-radius: 50%; }
.mk-ferie span { background: #ff9bd2; }
.mk-pont span { background: #ffe98a; outline: 2px dashed var(--ink); }
.mk-fete span { background: #8fd0ff; }

/* ---------- Documents du classeur ---------- */
.modele-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.modele-grid > * { min-width: 0; }
.modele-form { padding-bottom: 8px; }
.modele-side h2 { font-size: 1.3rem; margin-bottom: 10px; }
.paper { background: #fff; border: 1px solid var(--ink); padding: 28px 30px; font-family: Georgia, "Times New Roman", serif; font-size: 1rem; line-height: 1.55; box-shadow: 6px 6px 0 rgba(35, 29, 22, .25); overflow-wrap: break-word; min-height: 220px; }
.paper p { margin: 0 0 .3em; }
.dl-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* ---------- Pèse-choix ---------- */
.matrix { background: var(--sheet); border: 2px solid var(--ink); padding: 24px 26px; box-shadow: 6px 6px 0 rgba(35, 29, 22, .18); }
.matrix h2 { font-size: 1.35rem; margin: 22px 0 10px; }
.matrix-top { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.matrix-top > * { min-width: 0; }
.names { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 16px; }
.names > * { min-width: 0; }
.help { color: var(--muted); font-size: .92rem; }
.fallback { padding: 12px 16px; background: #fff0ec; border: 2px solid #8a2515; }
.crit { border: 2px solid var(--ink); background: #fff; padding: 12px 16px 6px; margin: 0 0 16px; min-width: 0; }
.crit legend { font-family: var(--slab); font-weight: 800; padding: 0 8px; }
.crit input[type="text"], .crit input[type="number"], .crit select { width: 100%; max-width: 100%; min-width: 0; font: inherit; padding: 8px 10px; border: 2px solid var(--ink); background: #fff; color: var(--ink); border-radius: 0; }
.scores { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 14px; }
.scores > * { min-width: 0; }
.ranking { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; }
.ranking li { display: grid; grid-template-columns: 3rem minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; background: #fff; border: 2px solid var(--ink); padding: 10px 14px; }
.ranking li > * { min-width: 0; }
.rk { font-family: var(--hand); font-size: 1.2rem; }
.bar { display: block; height: 12px; background: rgba(35, 29, 22, .12); border: 1px solid var(--ink); }
.bar i { display: block; height: 100%; background: var(--accent); }
.sc { font-weight: 800; white-space: nowrap; }
.verdict { font-weight: 600; padding: 12px 16px; background: #ffe98a; border: 2px solid var(--ink); }

/* ---------- Pages intégrables ---------- */
body.embed { background: #fff; background-image: none; font-size: 1rem; }
.embed-wrap { width: min(640px, 100%); margin: 0 auto; padding: 14px 14px 20px; }
.embed-wrap > * { width: auto; margin: 0 0 14px; }
.embed-wrap h1 { font-size: 1.35rem; margin-bottom: 12px; }
.embed .atelier { grid-template-columns: minmax(0, 1fr); gap: 16px; }
.embed .atelier > .result { position: static; }
.embed-credit { margin: 12px 0 0; font-size: .88rem; text-align: right; }

/* ---------- Adaptation ---------- */
@media (max-width: 960px) {
  .wall-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wall-about { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
  .board { grid-template-columns: minmax(0, 1fr); padding-top: 34px; }
  .board-notes { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .stat, .stat.s2 { margin-left: 0; }
  .stat b { font-size: 2rem; }
  .atelier, .modele-grid { grid-template-columns: minmax(0, 1fr); }
  .atelier > .result { position: static; }
}
@media (max-width: 640px) {
  body { font-size: 1rem; }
  main > * { margin-top: 30px; }
  .rail { padding: 8px 16px; }
  .brand { font-size: 1.2rem; }
  .tabs { width: 100%; }
  .tabs > a, .more > summary { padding: 7px 10px; font-size: .92rem; }
  .more { width: 100%; }
  .more-panel { position: static; width: 100%; max-width: 100%; box-shadow: none; margin-top: 6px; }
  .board-main { padding: 26px 20px 20px; }
  .board-notes { grid-template-columns: minmax(0, 1fr); }
  .stat, .stat.s2, .stat.s3 { transform: none; }
  .entete { padding: 18px 16px; border-left-width: 12px; }
  .feuille { padding: 20px 16px; }
  .carnet { padding: 20px 14px 8px 40px; }
  .grid, .sites, .tickets { grid-template-columns: minmax(0, 1fr); }
  .sites > li { transform: none !important; }
  .facts { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .facts dd { margin-bottom: 10px; }
  .guide-nav { grid-template-columns: minmax(0, 1fr); }
  .guide-nav a[rel="next"] { text-align: left; }
  .matrix { padding: 16px 12px; }
  .matrix-top { grid-template-columns: minmax(0, 1fr); }
  .ranking li { grid-template-columns: 2.4rem minmax(0, 1fr) auto; }
  .ranking .bar { grid-column: 1 / -1; grid-row: 2; }
  .wall-grid { grid-template-columns: minmax(0, 1fr); }
  .paper { padding: 18px 16px; }
  .callout { padding: 16px; }
  .res > div { padding: 9px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fiche, .ticket, .btn { transition: none; }
  .ticket:hover, .fiche:hover, .btn:hover { transform: none; }
}
@media print {
  body { background: #fff; }
  .rail, .wall, .skip, .entete, .atelier > .result, .dl-actions, .modele-form, .modele-side h2, .feuille, .crumbs { display: none !important; }
  main > * { width: 100%; margin: 0; }
  .modele-grid { display: block; }
  .modele-side { display: block; }
  .paper { border: 0; box-shadow: none; padding: 0; }
}


/* ===== kit commun : export, filtre, outils liés, impression, grandes listes ===== */
.kit-actions{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;margin:.9rem 0 0}
.kit-actions button{font:inherit;font-weight:700;font-size:.95rem;cursor:pointer;padding:.45rem .85rem;min-height:44px;border:2px solid currentColor;border-radius:.6rem;background:transparent;color:inherit}
.kit-actions button:hover{text-decoration:underline}
.kit-status{font-size:.9rem;min-height:1.2em}
.kit-filter{margin:0 0 1.2rem}
.kit-filter label{display:block;font-weight:700;margin-bottom:.35rem}
.kit-filter input{font:inherit;width:100%;max-width:32rem;padding:.6rem .8rem;min-height:44px;border:2px solid #222;border-radius:.6rem;background:#fff;color:#111}
.kit-count{margin:.4rem 0 0;font-size:.92rem;min-height:1.2em}
.kit-related{margin:2.2rem 0 1rem;padding:1rem 1.2rem;border:2px solid currentColor;border-radius:.8rem}
.kit-related h2{font-size:1.15rem;margin:0 0 .7rem}
.kit-related ul{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,15rem),1fr));gap:.4rem .8rem}
.kit-related li{min-width:0}
.kit-related a{display:block;padding:.35rem .1rem;overflow-wrap:break-word}
ul:has(> li:nth-child(40)) > li{content-visibility:auto;contain-intrinsic-size:auto 100px}
@media print{
  body.kit-printing *{visibility:hidden!important}
  body.kit-printing .kit-print-target,body.kit-printing .kit-print-target *{visibility:visible!important}
  body.kit-printing .kit-print-target{position:absolute!important;left:0;top:0;width:100%;color:#000!important;background:#fff!important;box-shadow:none!important}
}
