/* Opération Egg-Lons — charte dérivée de l'affiche. Mobile first, aucun framework. */

@font-face {
  font-family: "Marker";
  src: url("/static/fonts/permanent-marker.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Num";
  src: url("/static/fonts/barlow-condensed-800.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}

/* Palette « Rouge Aiglons » (décision n° 107) : rouge du logo + or. --orange garde son nom (couleur principale). */
:root {
  --ink: #141414;
  --cream: #FFF9EA;
  --paper: #FFFFFF;
  --orange: #D60E13;
  --orange-dark: #A50B0F;
  --yellow: #FFC21A;
  --sky: #8FD3F4;
  --sand: #FBE7B8;
  --sunset: linear-gradient(180deg, #B00B10 0%, #D60E13 45%, #F29A0E 80%, #FFC21A 100%);
  --red: #9E0A0E;
  --muted: #6B6257;
  --line: #EDDDB8;
  --ok: #2E8B3A;
  --warn: #B85C00;
  /* catégories (couleurs du tableau de prix de l'affiche) */
  --cat-standard: #F5B800;
  --cat-pleinair: #2FA8E0;
  --cat-bio: #3BAA3B;
  --radius: 14px;
  --shadow: 0 2px 0 rgba(20, 20, 20, .08), 0 8px 24px rgba(20, 20, 20, .06);
  --font-title: "Marker", "Comic Sans MS", cursive;
  --font-num: "Num", "Arial Narrow", system-ui, sans-serif; /* chiffres : lisibles, non ambigus */
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 16px/1.5 var(--font-body);
}
img { max-width: 100%; display: block; }
a { color: var(--orange-dark); }
h1, h2, h3, .title { font-family: var(--font-title); font-weight: 400; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 6vw, 3rem); }
h2 { font-size: clamp(1.4rem, 4.5vw, 2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

/* ---------- En-tête ---------- */
.topbar { background: var(--orange); color: #fff; box-shadow: 0 3px 0 var(--orange-dark); }
.topbar .wrap { display: flex; align-items: center; gap: 6px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; min-width: 0; }
.brand img { width: 40px; height: auto; flex: none; }
.brand span { font-family: var(--font-title); font-size: clamp(.82rem, 3.6vw, 1.35rem); line-height: 1; white-space: nowrap; }
.brand span b { color: var(--ink); font-weight: 400; }
.brand .op { font-style: normal; }
@media (max-width: 419px) { body[data-user] .brand .op { display: none; } }  /* connecté : place pour 💬, prénom et ☰ */
.topnav { display: none; margin-left: auto; gap: 4px; align-items: center; }
.topnav .toplink, .dd > summary { color: #fff; text-decoration: none; padding: 8px 12px; border-radius: 999px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.dd > summary { list-style: none; }
.dd > summary::-webkit-details-marker { display: none; }
.dd > summary::after { content: " ▾"; font-size: .8em; }
.topnav .toplink:hover, .dd > summary:hover { background: rgba(255, 255, 255, .18); }
.topnav .toplink[aria-current="page"], .dd > summary[aria-current="page"] { background: #fff; color: var(--orange-dark); }
.dd { position: relative; }
.annmenu { position: relative; margin-left: auto; }
.annmenu .ddmenu { left: auto; right: 0; }
.annmenu > summary { list-style: none; }
.annmenu > summary::-webkit-details-marker { display: none; }
.annmenu .ddmenu { min-width: 220px; }
.ddmenu, .sheet { background: var(--paper); color: var(--ink); box-shadow: var(--shadow); border-radius: 14px; padding: 8px; display: grid; }
.ddmenu { position: absolute; top: calc(100% + 8px); left: 0; min-width: 250px; z-index: 30; }
.ddmenu a, .sheet a { color: var(--ink); text-decoration: none; padding: 9px 12px; border-radius: 10px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ddmenu a:hover, .sheet a:hover { background: var(--cream); }
.ddmenu a[aria-current="page"], .sheet a[aria-current="page"] { background: #FDE8E8; color: var(--orange-dark); }
.menutitle { margin: 8px 12px 2px; font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
/* Menus (décision n° 116) : sections séparées par un trait, titre rouge avec icône, liens décalés ; ☰ : rôle en bandeau rouge. */
.msec { display: grid; }
.msec + .msec { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
.msectitle { margin: 4px 12px 2px; font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--orange-dark); }
.msec.titled a { padding-left: 26px; }
.sheettitle { margin: 12px 0 4px; padding: 8px 12px; border-radius: 10px; background: var(--orange-dark); color: #fff; font-size: .85rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.sheettitle:first-child { margin-top: 4px; }
.msgchip, .userchip { color: #fff; text-decoration: none; border-radius: 999px; padding: 6px 10px; font-weight: 600; white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.msgchip { margin-left: auto; font-size: 1.15rem; padding: 6px 6px; }
.userchip { font-size: .85rem; max-width: 84px; padding: 6px 6px; }
.userchip span { overflow: hidden; text-overflow: ellipsis; }
.userchip .long { display: none; }
.msgchip:hover, .userchip:hover { background: rgba(255, 255, 255, .18); }
.msgchip.on, .userchip.on { background: #fff; color: var(--orange-dark); }
.msgchip .badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--ink); color: #fff; font: 800 .75rem var(--font-num); }
.msgchip .badge[hidden] { display: none; }
.burger > summary { list-style: none; cursor: pointer; color: #fff; font-size: 1.6rem; line-height: 1; padding: 6px 8px; border-radius: 10px; }
.burger > summary::-webkit-details-marker { display: none; }
.burger[open] > summary { background: rgba(255, 255, 255, .18); }
.sheet { position: fixed; left: 8px; right: 8px; top: 68px; z-index: 40; max-height: calc(100vh - 80px); overflow-y: auto; }
.sheetlink { font-size: 1.05rem; }

@media (min-width: 860px) {
  .topnav { display: flex; }
  .msgchip { margin-left: 4px; }
  .userchip { max-width: 200px; }
  .userchip .short { display: none; }
  .userchip .long { display: block; }
  .burger { display: none; }
}

/* ---------- Pinceau (étiquettes façon affiche) ---------- */
.brush {
  position: relative; display: inline-block; z-index: 0;
  padding: .25em .9em .3em; color: #fff; font-family: var(--font-title);
}
.brush::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--brush, var(--ink));
  -webkit-mask: url("/static/img/brush.svg") center / 100% 100% no-repeat;
          mask: url("/static/img/brush.svg") center / 100% 100% no-repeat;
}
.brush.orange { --brush: var(--orange); }
.brush.yellow { --brush: var(--yellow); color: var(--ink); }
.brush.tilt { transform: rotate(-2deg); }

/* ---------- Sections / cartes ---------- */
main { padding: 20px 0 32px; }
.card { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card + .card, .stack > * + * { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
@media (min-width: 700px) { .grid.cols-2 { grid-template-columns: 1fr 1fr; } .grid.cols-3 { grid-template-columns: repeat(3, 1fr); } }
.pagehead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; margin-bottom: 16px; }
.pagehead h1 { margin: 0; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border: 0; border-radius: 999px; cursor: pointer;
  font: 700 1rem var(--font-body); text-decoration: none; white-space: nowrap; max-width: 100%;
  background: var(--orange); color: #fff; box-shadow: 0 3px 0 var(--orange-dark);
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--orange-dark); }
.btn.dark { background: var(--ink); box-shadow: 0 3px 0 #000; }
.btn.light { background: #fff; color: var(--orange-dark); box-shadow: 0 3px 0 var(--orange-dark); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: .9rem; }

/* ---------- Badges / pastilles ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: var(--line); }
.pill.ok { background: #DDF2DF; color: var(--ok); }
.pill.warn { background: #FFF1C9; color: var(--warn); }
.pill.open { background: var(--yellow); color: var(--ink); }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex: none; }
.cat-standard { --cat: var(--cat-standard); }
.cat-pleinair { --cat: var(--cat-pleinair); }
.cat-bio { --cat: var(--cat-bio); }
.dot { background: var(--cat, var(--muted)); }

/* ---------- Aide (info-bulle au survol, au focus et au tap) ---------- */
[hidden] { display: none !important; } /* l'attribut hidden gagne toujours (sinon .btn, .note… le réaffichent) */
.tip { position: relative; display: inline-flex; vertical-align: middle; }
.tip > button {
  width: 22px; height: 22px; border-radius: 50%; border: 0; padding: 0; cursor: help;
  background: var(--orange-dark); color: #fff; font: 700 .8rem var(--font-body);
}
.tip > [role="tooltip"] {
  position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%);
  width: max-content; max-width: min(260px, 80vw); z-index: 30;
  background: var(--ink); color: #fff; font-size: .85rem; line-height: 1.4; font-weight: 400;
  font-family: var(--font-body); text-transform: none; letter-spacing: normal; text-align: left; /* lisible même dans un titre */
  padding: 8px 10px; border-radius: 10px; display: none; /* display:none : une bulle cachée ne doit pas élargir la page */
}
.tip:hover > [role="tooltip"], .tip:focus-within > [role="tooltip"] { display: block; }

/* ---------- Héros (accueil) ---------- */
.hero { background: var(--sunset); color: #fff; overflow: hidden; margin-top: -20px; }
.hero .wrap { display: grid; gap: 12px; padding-top: 24px; padding-bottom: 36px; }
.hero .intro { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: start; }
.hero h1 { font-size: clamp(2.1rem, 8.5vw, 3.8rem); text-shadow: 0 3px 0 var(--orange-dark); }
.hero .lead { font-size: 1.1rem; font-weight: 600; max-width: 34em; margin-top: 8px; text-shadow: 0 1px 2px rgba(150, 60, 0, .35); }
.hero img.badge { width: clamp(92px, 24vw, 220px); }
.hero img.wordmark { width: min(100%, 520px); margin-bottom: 8px; }
.slogan { margin: 0; line-height: 1; }
.slogan .brush { font-size: clamp(1rem, 4vw, 1.35rem); }
.slogan .big { display: block; margin-top: 10px; font: 800 clamp(2.4rem, 10vw, 4.4rem)/.95 var(--font-num); text-transform: uppercase; text-shadow: 0 4px 0 var(--orange-dark); }
.hero .cta { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Tableau de prix ---------- */
.prices { display: grid; gap: 10px; }
.price { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--paper); box-shadow: var(--shadow); }
.price .name { white-space: nowrap; font-weight: 800; padding: 2px 12px; border-radius: 8px; background: var(--cat); color: #fff; }
.price.light .name { color: var(--ink); }
.price .amount { margin-left: auto; font: 800 2rem/1 var(--font-num); white-space: nowrap; }

/* ---------- Commande (sélecteur de quantité) ---------- */
.line { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; padding: 14px 0; border-bottom: 1px dashed var(--line); }
.line:last-child { border-bottom: 0; }
.line .label { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.line .sub { grid-column: 1; font-size: .85rem; color: var(--muted); }
.qty { display: flex; align-items: center; gap: 6px; grid-row: span 2; }
.qty button { width: 44px; height: 44px; border-radius: 50%; border: 0; font: 700 1.4rem var(--font-body); background: var(--orange); color: #fff; box-shadow: 0 3px 0 var(--orange-dark); cursor: pointer; }
.qty output { min-width: 2ch; text-align: center; font: 800 2rem/1 var(--font-num); font-variant-numeric: tabular-nums; }
.total { display: flex; align-items: baseline; justify-content: space-between; padding-top: 12px; margin-top: 4px; border-top: 3px solid var(--ink); }
.total strong { font: 800 2.4rem/1 var(--font-num); font-variant-numeric: tabular-nums; }
.stickybar { position: sticky; bottom: 0; background: var(--paper); margin: 0 -18px -18px; padding: 4px 18px 12px; border-radius: 0 0 var(--radius) var(--radius); box-shadow: 0 -8px 16px -12px rgba(20,20,20,.25); }

/* ---------- Compteurs (KPI) ---------- */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 700px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.kpi .v { font: 800 2.4rem/1.05 var(--font-num); font-variant-numeric: tabular-nums; }
.kpi .k { font-size: .8rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.kpi.accent { background: var(--yellow); }

/* ---------- Barre de progression (stock, jauge) ---------- */
.bar { display: block; height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; width: var(--p, 0%); background: var(--cat, var(--orange)); border-radius: inherit; }

/* ---------- Listes / tableaux ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .who { font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--cream); }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; cursor: pointer; }
.check input { width: 24px; height: 24px; accent-color: var(--ok); }

table.data { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.data th, table.data td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
table.data th { font-size: .8rem; text-transform: uppercase; color: var(--muted); }
table.data td.n, table.data th.n { text-align: right; font-variant-numeric: tabular-nums; }
table.data tfoot td { font-weight: 800; border-top: 3px solid var(--ink); border-bottom: 0; }
.scroll-x { overflow-x: auto; }

/* ---------- Barres empilées par zone (fournisseur) ---------- */
.zonebar { display: flex; height: 26px; border-radius: 8px; overflow: hidden; background: var(--line); }
.zonebar > span { background: var(--cat); color: #fff; font: 800 1rem var(--font-num); display: grid; place-items: center; min-width: 26px; }
.zonebar > span.cat-standard { color: var(--ink); }

/* ---------- Avis / encarts ---------- */
.note { border-left: 6px solid var(--orange); background: var(--paper); padding: 12px 14px; border-radius: 0 12px 12px 0; }
.note.circle { border-color: var(--cat-pleinair); }

/* ---------- Pied de page ---------- */
.footer { background: var(--sand); color: var(--ink); font-size: .85rem; padding: 24px 0 32px; }
.footer .wrap { display: grid; gap: 10px; }
.footer img { width: 64px; }
.footer a { color: var(--orange-dark); }


/* ---------- Impression (bons, récaps → PDF) ---------- */
@media print {
  body { background: #fff; padding: 0; font-size: 12px; }
  .topbar, .footer, .no-print { display: none !important; }
  .card { box-shadow: none; border: 1px solid #999; break-inside: avoid; }
}
.push-right { margin-left: auto; }
.btn.ghost.light { color: #fff; box-shadow: inset 0 0 0 2px #fff; }
.steps { margin: 0; padding-left: 1.3em; display: grid; gap: 10px; }
.zone-row .zonebar { margin: 8px 0 6px; }
.mapph { min-height: 220px; display: grid; place-items: center; text-align: center; padding: 16px; border-radius: 12px; background: repeating-linear-gradient(45deg, var(--cream), var(--cream) 12px, #fff 12px, #fff 24px); color: var(--muted); }
.msgform { display: flex; gap: 8px; margin-top: 12px; }
.msgform input { flex: 1; min-width: 0; min-height: 44px; border: 2px solid var(--line); border-radius: 999px; padding: 0 16px; font: inherit; }
.bar { margin-top: 6px; }

/* ---------- Chiffres importants (montants, quantités) ---------- */
.num { font-family: var(--font-num); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.list .num { font-size: 1.35rem; }

/* ---------- Emblèmes ---------- */
.mascot { width: 64px; flex: none; }
.note.with-mascot { display: flex; gap: 12px; align-items: center; }
.nowrap { white-space: nowrap; }

/* ---------- Formulaires ---------- */
.narrow { max-width: 560px; }
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; display: flex; align-items: center; gap: 6px; }
.field input, .field select { min-height: 48px; padding: 0 14px; border: 2px solid var(--line); border-radius: 12px; font: inherit; background: #fff; width: 100%; }
.field input:focus, .field select:focus { border-color: var(--orange); outline: none; }
[aria-invalid="true"] { border-color: var(--red) !important; }
.field-error { color: var(--red); font-size: .875rem; font-weight: 700; margin: 0; }
.field-error::before, [data-push-msg].err::before { content: "⚠ "; }  /* erreur ≠ couleur principale (rouge) */
.charter { background: var(--cream); border-radius: 12px; padding: 12px 14px; font-size: .9rem; }
.charter ul { margin: 6px 0 0; padding-left: 1.2em; }
.center-img { margin: 0 auto 8px; }
.wrap-row { flex-wrap: wrap; }
details.danger { margin-top: 14px; }
details.danger summary { cursor: pointer; color: var(--red); font-weight: 700; }

/* ---------- Administration ---------- */
/* Pages admin : plus d'air (main.admin, base.html) */
.admin .card { padding: 22px; }
.admin .card + .card, .admin .stack > * + * { margin-top: 22px; }
.admin .grid > .card + .card { margin-top: 0; }
.admin .form { gap: 18px; }
.admin .zonepick { padding: 14px 16px; gap: 12px; }
@media (min-width: 760px) { .admin .card { padding: 26px 28px; } }
.flash { margin: 0; padding: 10px 14px; border-radius: 12px; background: #DDF2DF; color: var(--ok); font-weight: 700; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters input, .filters select { min-height: 40px; padding: 0 12px; border: 2px solid var(--line); border-radius: 999px; font: inherit; background: #fff; min-width: 0; flex: 1 1 140px; }
.kpi.link { text-decoration: none; color: inherit; }
.rowlink { color: inherit; text-decoration: none; }
.rowlink:hover .who { color: var(--orange-dark); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.zonepick { border: 2px dashed var(--line); border-radius: 12px; padding: 8px 12px; display: grid; gap: 6px; }
.zonepick legend { font-weight: 700; font-size: .9rem; padding: 0 4px; }
.map { height: 280px; border-radius: 12px; border: 2px solid var(--line); background: #E8F4F8; }
.latlng { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.catrow { grid-template-columns: 1fr 1fr; align-items: end; }
.catrow > div:first-of-type { grid-column: 1 / -1; }  /* nom de la catégorie : pleine ligne sur mobile */
@media (min-width: 760px) { .catrow { grid-template-columns: 2fr 90px 130px 170px 90px; } .catrow.nomargin { grid-template-columns: 2fr 90px 130px 90px; }
  .catrow > div:first-of-type { grid-column: auto; } }
.catrow .catrow-desc { grid-column: 1 / -1; }
.catrow-foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; }
.catrow-foot .btn { margin-left: auto; }
.catrow input[type="color"] { padding: 4px; min-height: 48px; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; }
code { font-size: .85em; background: var(--cream); padding: 1px 6px; border-radius: 6px; }

/* ---------- Campagnes et commande (étape 5) ---------- */
.qty input { width: 3ch; text-align: center; font: 800 2rem/1 var(--font-num); font-variant-numeric: tabular-nums; border: 0; background: transparent; padding: 0; -moz-appearance: textfield; appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty input[aria-invalid="true"] { color: var(--red); }
.line .field-error { grid-column: 1 / -1; }
.note.warn { border-color: var(--red); }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 14px; }
.campcat { border-left: 6px solid var(--cat, var(--line)); padding: 4px 0 4px 12px; display: grid; gap: 8px; }
.campcat .check { font-size: 1.05rem; }
.campfields { display: grid; gap: 10px; }
@media (min-width: 700px) { .campfields { grid-template-columns: repeat(3, 1fr); } }
.check.small { font-size: .85rem; font-weight: 600; }
.check.small input { width: 20px; height: 20px; }
.field input:disabled { background: var(--cream); color: var(--muted); }
.legal h2 { margin-top: 1.2em; }
.legal ol, .legal ul { padding-left: 1.3em; }
.campfields .field { align-content: start; }
.check > span:not(.dot) { flex: 1; }

/* ---------- Zones, fils (étape 6a) ---------- */
.field textarea { padding: 10px 14px; border: 2px solid var(--line); border-radius: 12px; font: inherit; background: #fff; width: 100%; resize: vertical; }
.field textarea:focus { border-color: var(--orange); outline: none; }
.thread { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.msg { max-width: 85%; padding: 10px 14px; border-radius: 14px; background: var(--cream); }
.msg p { margin: 2px 0 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.mine { justify-self: end; background: #FFE3CC; }
.msg.sys { justify-self: center; max-width: 100%; background: transparent; border: 2px dashed var(--line); font-size: .9rem; text-align: center; }
.msg .who { font-weight: 700; }
.tick { margin-left: 6px; font-weight: 800; letter-spacing: -.15em; color: var(--muted); }
.tick.read { color: #1E7BC4; }
.zonecard .pagehead { margin-bottom: 6px; }
.unread { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font: 800 .8rem var(--font-num); }
.cogform { margin-top: 12px; }
@media (min-width: 700px) { .cogform { grid-template-columns: 2fr 2fr auto; align-items: end; } }
.paynote { margin: 6px 0 8px; }
.soon { opacity: .55; font-style: italic; }
.zonelist { display: grid; gap: 8px; }
.zonerow { border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.zonerow > summary { cursor: pointer; list-style: none; display: grid; gap: 6px; }
.zonerow > summary::-webkit-details-marker { display: none; }
.zonerow > summary .zname::before { content: "▸ "; color: var(--orange-dark); }
.zonerow[open] > summary .zname::before { content: "▾ "; }
.zonerow[open] { border-color: var(--orange); }
.zonerow.total { display: grid; gap: 6px; background: var(--cream); border-style: dashed; }
.zname { font-weight: 800; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ztot { font-size: .95rem; }
.ztot .num { font-size: 1.15rem; }
@media (min-width: 760px) { .zonerow > summary, .zonerow.total { grid-template-columns: 1.2fr 2fr auto; align-items: center; } }
/* Barre collante compacte : total + bouton seulement */
.formfoot { padding-top: 8px; }
.formfoot p { margin: 4px 0; }
.stickybar { padding: 2px 18px 10px; }
.stickybar .total { padding-top: 6px; margin: 0 0 6px; border-top-width: 2px; }
.stickybar .total strong { font-size: 1.9rem; }
@media (max-width: 859px) { .stickybar .btn { min-height: 44px; } }

/* ---------- Récap gérant (étape 6b) ---------- */
.orderrow { flex-wrap: wrap; }
.marks { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.marks form { margin: 0; }
.asbtn { border: 0; cursor: pointer; font: inherit; font-size: .85rem; font-weight: 700; padding: 6px 12px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }
.orderrow .chips strong { margin-left: 4px; }
@media print { .no-print { display: none !important; } .kpis { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 699px) { .orderrow .marks { flex-basis: 100%; } }

/* ---------- Transferts (étape 6c) ---------- */
form.inline { display: inline; }
.zonechange { margin-top: 12px; }
.exclude { border-bottom: 1px solid var(--line); padding: 8px 0; }
.exclude summary { cursor: pointer; margin: 4px 0 0 32px; color: var(--orange-dark); }
.exclude .list { margin: 6px 0 0 32px; }
details.more { margin-top: 10px; }
details.more summary { cursor: pointer; color: var(--orange-dark); font-weight: 700; }
.who-marked { font-size: .75rem; margin-right: 6px; }

/* ---------- Producteur : bon de préparation, carte (étape 7) ---------- */
.preprow { flex-wrap: wrap; }
.kpi .dot { background: var(--cat); }
.mapgrid { display: grid; gap: 16px; }
@media (min-width: 900px) { .mapgrid { grid-template-columns: 1fr 360px; align-items: start; } }
.map.big { height: 420px; }
@media (min-width: 900px) { .map.big { height: 620px; } }
.mappanel { max-height: none; }
@media (min-width: 900px) { .mappanel { max-height: 620px; overflow-y: auto; } }
.donut-total { position: relative; display: grid; place-items: center; width: 150px; height: 150px; margin: 0 auto 6px; }
.donut-total svg { position: absolute; inset: 0; }
.donut-total svg ~ .num, .donut-total svg ~ .small { display: none; }
.mapzone { cursor: pointer; border-radius: 10px; padding-left: 6px; padding-right: 6px; }
.mapzone.on { background: #FDE8E8; outline: 2px solid var(--orange); }
.ringicon { background: none; border: 0; filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
.prepline { margin: 6px 0 10px; }
.step { display: inline-grid; gap: 2px; justify-items: start; align-content: start; margin-right: 8px; }
.step .who-marked { margin: 0; max-width: 16em; }
.preprow .marks { align-items: start; margin-top: 6px; }

/* Notifications (Mon compte) */
table.notifs th.c, table.notifs td.c { text-align: center; width: 4.5rem; }
table.notifs input { width: 22px; height: 22px; accent-color: var(--ok); }
.pushbox { display: grid; gap: 10px; margin-bottom: 14px; }
.pushbox p { margin: 0; }
table.notifs + .btn { margin-top: 14px; }
.push-all-off { display: flex; align-items: center; gap: 6px; }
[data-push-msg].err { color: var(--red); font-weight: 700; }

/* Jauge de l'objectif du tournoi (barre « coup de pinceau ») */
.gauge { display: grid; gap: 10px; }
.gauge-top { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.gauge-pct { font-size: 2.8rem; font-weight: 800; line-height: 1; }
.gauge-top b { font-family: var(--font-num); font-size: 1.1rem; }
.gauge-bar { height: 44px; display: flex; background: var(--sand);
  -webkit-mask: url("/static/img/brush.svg") center / 100% 100% no-repeat; mask: url("/static/img/brush.svg") center / 100% 100% no-repeat; }
.gauge-bar span { width: var(--p); background: var(--c); }
.gauge-leg { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .9rem; }
.gauge-leg li { display: flex; align-items: center; gap: 6px; }
.gauge-leg b { font-family: var(--font-num); font-size: 1rem; }
.gdot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); border: 1.5px solid var(--ink); }
.gauge-thanks { margin: 0; font-size: .85rem; color: var(--muted); }
.gauge-thanks b { color: var(--ink); }
.fundrow { grid-template-columns: 1fr; }
@media (min-width: 900px) { .fundrow { grid-template-columns: 110px minmax(170px, 2fr) 100px 170px minmax(120px, 1fr) auto auto; align-items: end; } }

/* Hors ligne (app.js) */
.pushbar { margin-bottom: 16px; background: var(--sand); }
.msgbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.msgbar[hidden] { display: none; }
.msgbar a.note { flex: 1; display: block; font-weight: 700; color: var(--ink); text-decoration: none; background: var(--sand); }
.pushbar p { margin: 0 0 8px; }
.offline-bar { position: sticky; top: 0; z-index: 30; margin: 0; padding: 10px 16px; background: var(--ink); color: #fff; font-weight: 700; text-align: center; }
.gauge.compact { margin-top: 8px; padding: 12px 4px 0; border-top: 1px dashed var(--line); gap: 6px; color: var(--muted); font-size: .9rem; }
.gauge.compact .gauge-line { margin: 0; }
.gauge.compact .gauge-line b { font-family: var(--font-num); font-size: 1.05rem; color: var(--ink); }
.gauge.compact .gauge-bar { height: 14px; }
.gauge-more summary { cursor: pointer; font-size: .85rem; }
.gauge-more .gauge-leg { margin: 6px 0; }
.histfilters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
@media (min-width: 900px) { .histfilters { grid-template-columns: 150px 150px 1fr 1fr 150px auto; } }
.histrow { flex-wrap: wrap; }
@media (max-width: 599px) { .histrow > .grow { flex-basis: 100%; } }
/* Aide */
.helppage h3 { font-family: var(--font-body); font-weight: 800; font-size: 1.05rem; margin: 18px 0 6px; }
.helppage .steps { margin: 0; padding-left: 1.4em; display: grid; gap: 4px; }
.helppage section.card h2 { margin-bottom: 0; }

/* Commande de ‹point› : jauge « J'aimerais commander » (largeur via --p) et petit formulaire en ligne */
.interest { height: 12px; border-radius: 999px; background: var(--sand); overflow: hidden; }
.interest span { display: block; height: 100%; width: var(--p); background: var(--yellow); }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.inline-form input { width: 96px; min-height: 40px; padding: 0 10px; border: 2px solid var(--line); border-radius: 10px; font: inherit; }
.catrow-point { display: grid; grid-template-columns: 1fr 120px; gap: 10px; align-items: end; padding: 8px 0; border-bottom: 1px solid var(--line); }

/* ---------- Messages (n° 118) : 2 colonnes sur PC, liste puis conversation sur téléphone ---------- */
.msgapp { display: grid; gap: 16px; align-items: start; }
.msgside .pagehead { margin-bottom: 8px; }
.msgnav ul { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 2px; }
.msgnav .menutitle { margin-left: 0; }
.msgsect { margin: 14px 0 6px; padding-top: 10px; border-top: 2px solid var(--line); font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--orange-dark); }
.msgnav > .msgsect:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.msgrow { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 400; }
.msgrow:hover { background: var(--paper); }
.msgrow.on { background: #FDE8E8; color: var(--orange-dark); }
.msgrow.new { font-weight: 800; color: var(--ink); }
.msgrow.new::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.msgnav .btn.block { margin-top: 6px; }
.newdm > summary { list-style: none; }
.newdm > summary::-webkit-details-marker { display: none; }
.newdm[open] .form { margin-top: 8px; }
.msghead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 8px; }
.msghead h2 { margin: 0; }
.msgbody { max-height: 62vh; overflow-y: auto; padding-right: 4px; }
.msgform { margin-top: 12px; }
.msg.deleted { opacity: .7; }
.linkbtn { background: none; border: 0; padding: 0 0 0 6px; color: var(--muted); text-decoration: underline; font: inherit; cursor: pointer; }
.msgempty { padding: 40px 0; }
.msgapp.has-thread .msgside, .msgapp:not(.has-thread) .msgpane { display: none; }
@media (min-width: 860px) {
  .msgapp { grid-template-columns: 300px 1fr; }
  .msgapp.has-thread .msgside, .msgapp:not(.has-thread) .msgpane { display: block; }
  .msgback { display: none; }
}
.msgside h1 { font-size: clamp(1.6rem, 6vw, 2rem); }
