/* Kolpo : prune et soleil. Une seule couleur forte (prune), le jaune seulement pour le point d'arrivée.
   Jamais de noir pur ni de blanc pur ; chaque texte dépasse 4,5:1 de contraste, en clair comme en sombre. */
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap; src: url("../fonts/manrope-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 300 700; font-display: swap; src: url("../fonts/space-grotesk-latin-wght-normal.woff2") format("woff2"); }
:root {
  --vert: #3b1747; --vert-texte: #3b1747; --vert-clair: #efe8f1;
  --ambre: #ffc72c; --ambre-clair: #fff1c7; --ambre-fonce: #4a3500; --sur-soleil: #1e0f24;
  --succes: #24614b; --succes-clair: #e2f0e9;
  --rouge: #b3261e; --rouge-clair: #fbe9e7;
  --bleu: #2f4a7a; --bleu-clair: #e6eaf3;
  --violet: #3b1747; --violet-clair: #efe8f1;
  --encre: #1e0f24; --gris: #5e5763; --gris-clair: #eeebe6; --ligne: #e2dcd3;
  --fond: #f6f3ee; --carte: #ffffff; --champ: #ffffff;
  --entete: #3b1747; --sur-entete: #f6f0f8; --sur-accent: #ffffff; --wa: #1a7f45;
  --voile: rgba(30, 15, 36, .45); --toast-bg: #1e0f24; --toast-fg: #f6f3ee;
  --rayon: 12px;
  --ombre: 0 1px 2px rgba(30, 15, 36, .06), 0 2px 8px rgba(30, 15, 36, .05);
  --titre: "Space Grotesk", "Manrope", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --vert: #d7c2e2; --vert-texte: #d7c2e2; --vert-clair: #33263d;
    --ambre: #ffc72c; --ambre-clair: #3f3210; --ambre-fonce: #ffe08a; --sur-soleil: #1e0f24;
    --succes: #8fd1b5; --succes-clair: #173229;
    --rouge: #f2766c; --rouge-clair: #3b1d1b;
    --bleu: #a9bde6; --bleu-clair: #1f2740;
    --violet: #d7c2e2; --violet-clair: #33263d;
    --encre: #eee8f1; --gris: #b5aabd; --gris-clair: #2e2535; --ligne: #3a2f42;
    --fond: #1a1320; --carte: #241b2b; --champ: #1f1726;
    --entete: #241b2b; --sur-entete: #eee8f1; --sur-accent: #1e0f24; --wa: #1a7f45;
    --voile: rgba(0, 0, 0, .6); --toast-bg: #eee8f1; --toast-fg: #1a1320;
    --ombre: 0 1px 2px rgba(0, 0, 0, .35), 0 2px 10px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --vert: #d7c2e2; --vert-texte: #d7c2e2; --vert-clair: #33263d;
  --ambre: #ffc72c; --ambre-clair: #3f3210; --ambre-fonce: #ffe08a; --sur-soleil: #1e0f24;
  --succes: #8fd1b5; --succes-clair: #173229;
  --rouge: #f2766c; --rouge-clair: #3b1d1b;
  --bleu: #a9bde6; --bleu-clair: #1f2740;
  --violet: #d7c2e2; --violet-clair: #33263d;
  --encre: #eee8f1; --gris: #b5aabd; --gris-clair: #2e2535; --ligne: #3a2f42;
  --fond: #1a1320; --carte: #241b2b; --champ: #1f1726;
  --entete: #241b2b; --sur-entete: #eee8f1; --sur-accent: #1e0f24; --wa: #1a7f45;
  --voile: rgba(0, 0, 0, .6); --toast-bg: #eee8f1; --toast-fg: #1a1320;
  --ombre: 0 1px 2px rgba(0, 0, 0, .35), 0 2px 10px rgba(0, 0, 0, .25);
  color-scheme: dark;
}
/* Changement clair/sombre : fondu court au lieu d'un flash (seulement pendant le changement) */
html.theme-anim, html.theme-anim * { transition: background-color .22s ease, color .22s ease, border-color .22s ease, fill .22s ease !important; }
@media (prefers-reduced-motion: reduce) { html.theme-anim, html.theme-anim * { transition: none !important; } }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px; line-height: 1.45; color: var(--encre); background: var(--fond);
  -webkit-text-size-adjust: 100%;
}
body.noscroll { overflow: hidden; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.2; font-family: var(--titre); letter-spacing: -.01em; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
p { margin: .3em 0; }
a { color: var(--vert-texte); }
.muted { color: var(--gris); }
.small { font-size: .85rem; }
.ink { color: var(--encre); }
.danger { color: var(--rouge); }
.loading, .empty { padding: 32px 16px; text-align: center; color: var(--gris); }
.empty { background: var(--carte); border: 1px dashed var(--ligne); border-radius: var(--rayon); margin: 12px 0; }

/* ---------- Formulaires ---------- */
label { display: block; font-size: .9rem; font-weight: 600; color: var(--encre); }
input, select {
  display: block; width: 100%; margin-top: 4px; padding: 11px 12px; font: inherit; font-weight: 400;
  border: 1px solid var(--ligne); border-radius: 10px; background: var(--champ); color: var(--encre);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--vert-texte); outline-offset: 1px; border-color: var(--vert-texte); }
label.check, label.switch { display: flex; align-items: center; gap: 8px; font-weight: 500; }
label.check input, label.switch input { width: auto; margin: 0; }
fieldset { border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 12px; margin: 0; }
legend { font-weight: 600; padding: 0 4px; }
.stack > * + * { margin-top: 12px; }
.grid2, .grid3 { display: grid; gap: 12px; }
@media (min-width: 560px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid3 { grid-template-columns: 1fr 1fr 1fr; } }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 16px; font: inherit; font-weight: 600; text-decoration: none;
  border: 1px solid var(--ligne); border-radius: 10px; background: var(--champ); color: var(--encre); cursor: pointer;
}
.btn:disabled { opacity: .6; cursor: wait; }
.btn-primary { background: var(--vert); border-color: var(--vert); color: var(--sur-accent); }
.btn-warn { background: var(--champ); border-color: var(--rouge); color: var(--rouge); }
.btn-wa { background: var(--wa); border-color: var(--wa); color: #ffffff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: .9rem; }
.btn-block { width: 100%; }
.link { background: none; border: 0; color: var(--vert-texte); font: inherit; font-weight: 600; padding: 8px 0; cursor: pointer; text-decoration: underline; }

/* ---------- Connexion ---------- */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.auth-card { width: 100%; max-width: 400px; background: var(--carte); border-radius: 16px; padding: 24px; box-shadow: var(--ombre); }
.auth-card.wide { max-width: 560px; }
.auth-card form { margin-top: 16px; }
.auth-card form > * + * { margin-top: 12px; }
.auth-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.brand { color: var(--vert-texte); font-size: 1.6rem; }

/* ---------- Coquille ---------- */
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--entete); color: var(--sur-entete); border-bottom: 1px solid var(--ligne); }
.topbar .btn-ghost { color: var(--sur-entete); }
.brand-sm { font-size: .8rem; opacity: .8; letter-spacing: .04em; text-transform: uppercase; }
.shop-name { font-weight: 700; font-size: 1.1rem; }
.tabs { display: flex; background: var(--carte); border-bottom: 1px solid var(--ligne); position: sticky; top: 0; z-index: 5; overflow-x: auto; }
.tabs button { flex: 1; min-height: 48px; padding: 0 12px; border: 0; background: none; font: inherit; font-weight: 600; color: var(--gris); border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; }
.tabs button.active { color: var(--vert-texte); border-bottom-color: var(--vert-texte); }
.tab-count:not(:empty) { display: inline-block; margin-left: 6px; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--ambre); color: var(--sur-soleil); font-weight: 700; font-size: .75rem; line-height: 20px; }
main#view, .pub-main { max-width: 860px; margin: 0 auto; padding: 16px; padding-bottom: 48px; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--carte); border-radius: var(--rayon); padding: 10px 12px; box-shadow: var(--ombre); }
.stat b { display: block; font-size: 1.15rem; }
.stat span { font-size: .8rem; color: var(--gris); }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 12px 0 8px; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; overflow-x: auto; flex: 1; padding-bottom: 2px; }
.chip { min-height: 36px; padding: 0 12px; border-radius: 18px; border: 1px solid var(--ligne); background: var(--champ); color: var(--encre); font: inherit; font-size: .9rem; cursor: pointer; white-space: nowrap; }
.chip.active { background: var(--vert); color: var(--sur-accent); border-color: var(--vert); }
.search { margin-bottom: 8px; }
.section-title { margin: 16px 0 8px; }
.info { background: var(--vert-clair); border-radius: var(--rayon); padding: 10px 12px; margin-bottom: 8px; }
.alert { background: var(--ambre-clair); border-left: 4px solid var(--ambre); border-radius: 8px; padding: 10px 12px; margin: 10px 0; }
.alert ul { margin: 4px 0 0; padding-left: 18px; }

/* ---------- Cartes ---------- */
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.card { background: var(--carte); border-radius: var(--rayon); padding: 12px; box-shadow: var(--ombre); }
section.card { margin-bottom: 12px; }
.card-cmd { cursor: pointer; }
.card-cmd:focus { outline: 2px solid var(--vert); }
.row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.row + .row { margin-top: 4px; }
.row.gap { justify-content: flex-start; gap: 8px; }
.wrap { flex-wrap: wrap; }
.prod { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: .75rem; font-weight: 600; background: var(--gris-clair); color: var(--gris); white-space: nowrap; }
.st-nouvelle { background: var(--ambre-clair); color: var(--ambre-fonce); }
.st-confirmee { background: var(--bleu-clair); color: var(--bleu); }
.st-envoyee { background: var(--violet-clair); color: var(--violet); }
.st-livree { background: var(--succes-clair); color: var(--succes); }
.st-annulee, .st-refusee { background: var(--rouge-clair); color: var(--rouge); }
.pa-paye { background: var(--succes-clair); color: var(--succes); }
.pa-partiel { background: var(--ambre-clair); color: var(--ambre-fonce); }
.pa-non_paye { background: var(--gris-clair); color: var(--gris); }
.pa-rembourse { background: var(--bleu-clair); color: var(--bleu); }

/* ---------- Modale ---------- */
.modal { position: fixed; inset: 0; background: var(--voile); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.modal[hidden] { display: none; }
.modal-card { background: var(--carte); width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto; border-radius: 16px 16px 0 0; padding: 16px; }
@media (min-width: 640px) { .modal { align-items: center; } .modal-card { border-radius: 16px; } }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.block { border-top: 1px solid var(--ligne); padding-top: 10px; margin-top: 10px; }
.block summary { cursor: pointer; font-weight: 600; }
.note { background: var(--fond); border-radius: 8px; padding: 6px 10px; }
.lines { width: 100%; border-collapse: collapse; }
.lines td { padding: 4px 0; vertical-align: top; }
.lines td:first-child { width: 44px; color: var(--gris); }
.lines .num { text-align: right; white-space: nowrap; }
.lines .sub td { color: var(--gris); border-top: 1px solid var(--ligne); }
.lines .tot td { font-weight: 700; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; position: sticky; bottom: -16px; background: var(--carte); padding: 12px 0; }
.actions .btn { flex: 1; min-width: 140px; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.inline-form input, .inline-form select { flex: 1; min-width: 110px; margin: 0; }
.json { background: var(--fond); padding: 10px; border-radius: 8px; overflow-x: auto; font-size: .8rem; }
.hist { padding-left: 18px; margin: 6px 0; font-size: .9rem; }

/* ---------- Sélecteur de produits ---------- */
.picker { display: grid; gap: 6px; max-height: 260px; overflow-y: auto; }
.pick-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
/* Indisponible : image estompée, texte en gris lisible (contraste ≥ 4,5:1) */
.pick-row.off, .pub-prod.off { background: var(--fond); }
.pick-row.off .vignette, .pub-prod.off .vignette { opacity: .5; }
.pick-row.off, .pub-prod.off b { color: var(--gris); }
.stepper { display: inline-flex; align-items: center; gap: 4px; }
.stepper button { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--ligne); background: var(--champ); color: var(--encre); font-size: 1.2rem; cursor: pointer; }
.stepper b { min-width: 24px; text-align: center; }
.libre { display: grid; grid-template-columns: 2fr 1fr 64px auto; gap: 6px; margin-top: 10px; }
.libre input { margin: 0; }
.total-line { text-align: right; font-size: 1.1rem; }
.linkbox { display: flex; gap: 8px; }
.linkbox input { margin: 0; }

/* ---------- Page publique ---------- */
.pub-head { background: var(--entete); color: var(--sur-entete); padding: 20px 16px; text-align: center; }
.pub-head .muted { color: var(--sur-entete); opacity: .85; }
.pub-prod { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
#pub-form { margin-top: 16px; }
.recap { background: var(--fond); border-radius: 10px; padding: 10px 12px; }
.recap .tot { font-weight: 700; border-top: 1px solid var(--ligne); padding-top: 6px; }

/* ---------- Notifications ---------- */
.toasts { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { background: var(--toast-bg); color: var(--toast-fg); padding: 10px 14px; border-radius: 10px; max-width: 480px; box-shadow: var(--ombre); }
.toast-ok { background: var(--vert); color: var(--sur-accent); }
.toast-err { background: var(--rouge); color: var(--sur-accent); }
.piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.seg { display: flex; background: var(--fond); border-radius: 10px; padding: 4px; margin: 16px 0 4px; }
.seg button { flex: 1; min-height: 40px; border: 0; border-radius: 8px; background: none; font: inherit; font-weight: 600; color: var(--gris); cursor: pointer; }
.seg button.active { background: var(--carte); color: var(--vert-texte); box-shadow: var(--ombre); }
.badge.plan { background: rgba(255,255,255,.16); color: var(--sur-entete); }
.badge.plan.premium { background: var(--ambre); color: var(--sur-soleil); }
.alert.band { margin: 0; border-radius: 0; }
.lock { border: 1px dashed var(--ambre); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.alert[hidden] { display: none; }

/* ================= v0.2 : mise en page responsive ================= */
html { -webkit-tap-highlight-color: transparent; }
.topbar { gap: 12px; position: sticky; top: 0; z-index: 6; }
.topbar > div:first-child { min-width: 0; flex: 1; }
.shop-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* Onglets : barre en haut sur ordinateur */
.tabs { top: 64px; overflow: visible; }
.tabs-inner { display: flex; max-width: 860px; margin: 0 auto; width: 100%; }
.tabs button { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.tabs svg { width: 18px; height: 18px; flex-shrink: 0; }

/* Cartes de commande */
.card-cmd { display: grid; gap: 4px; }
.cmd-nom { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd-meta { overflow-wrap: anywhere; }
.cmd-bas { justify-content: flex-start; gap: 8px; }
.cmd-bas b { font-size: 1.05rem; }
.row > .badge { flex-shrink: 0; }

/* Barre d'outils */
.toolbar .chips { min-width: 0; }

/* Page client : deux colonnes sur grand écran */
.pub-produits .cards { margin-bottom: 0; }
@media (min-width: 900px) {
  .pub-main.pub-grid { max-width: 1100px; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(340px, 1fr); gap: 24px; align-items: start; }
  .pub-grid #pub-form { margin-top: 0; position: sticky; top: 16px; }
}

/* ================= Téléphone ================= */
@media (max-width: 719px) {
  .only-desktop { display: none !important; }
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .topbar { padding: 10px 16px; }
  .shop-name { font-size: 1rem; }
  .brand-sm { font-size: .7rem; }

  /* Navigation en bas, comme une appli */
  .tabs { position: fixed; top: auto; bottom: 0; left: 0; right: 0; z-index: 10; border-top: 1px solid var(--ligne); border-bottom: 0; box-shadow: var(--ombre); padding-bottom: env(safe-area-inset-bottom); }
  .tabs-inner { max-width: none; }
  .tabs button { flex: 1 1 0; min-width: 0; flex-direction: column; gap: 2px; min-height: 60px; padding: 6px 1px; font-size: .64rem; letter-spacing: -.01em; border-bottom: 0; border-top: 3px solid transparent; }
  .tabs button.active { border-top-color: var(--vert-texte); border-bottom: 0; }
  .tabs svg { width: 22px; height: 22px; }
  .tab-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tab-count:not(:empty) { position: absolute; top: 4px; left: calc(50% + 6px); margin: 0; min-width: 18px; line-height: 18px; font-size: .68rem; }

  /* « + Commande » devient un bouton flottant */
  .fab { position: fixed; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 9; width: 56px; height: 56px; min-height: 56px; padding: 0; border-radius: 50%; font-size: 1.8rem; box-shadow: var(--ombre), 0 6px 16px rgba(0, 0, 0, .2); }
  .fab-label { display: none; }
  .toolbar { flex-wrap: wrap; }
  .toolbar .chips { flex: 1 1 100%; }
  main#view { padding-bottom: 96px; }

  .modal { z-index: 20; }
  .modal-card { max-height: 94vh; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .inline-form input { flex: 1 1 100%; }
  .inline-form select, .inline-form .btn { flex: 1 1 0; }
  .libre { grid-template-columns: 1fr 1fr 64px; }
  .libre .btn { grid-column: 1 / -1; }
  .stats { gap: 6px; }
  .stat { padding: 8px 10px; }
  .stat b { font-size: 1.05rem; }
  .pub-head h1 { font-size: 1.5rem; }
}
.btn { text-align: center; line-height: 1.25; }
.btn-block { padding-top: 10px; padding-bottom: 10px; }
@media (max-width: 719px) {
  .prod > :first-child { flex: 1 1 100%; }
  .prod > :last-child { margin-left: auto; }
}

/* ================= v0.2 : thème, aide, présentation ================= */
.tabs, .modal-card, .actions { background: var(--carte); }
.tabs button { color: var(--gris); }
.topbar-actions .icon-btn { width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 10px; color: var(--sur-entete); background: transparent; border: 0; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.topbar-actions .icon-btn:hover, .topbar-actions .icon-btn:focus-visible { background: rgba(255, 255, 255, .14); }
.icon-btn svg { width: 22px; height: 22px; }
:focus-visible { outline: 2px solid var(--vert-texte); outline-offset: 2px; }
.seg.small button { min-height: 36px; font-size: .9rem; }
textarea { display: block; width: 100%; margin-top: 4px; padding: 11px 12px; font: inherit; font-weight: 400; border: 1px solid var(--ligne); border-radius: 10px; background: var(--champ); color: var(--encre); resize: vertical; min-height: 110px; }
.aide-section h3 { margin-top: 16px; }
.aide-section details { border-top: 1px solid var(--ligne); padding: 10px 0; }
.aide-section summary { cursor: pointer; font-weight: 600; }
.aide-section details p { margin: 8px 0 0; color: var(--encre); }
.ok-msg { background: var(--succes-clair); border-radius: 8px; padding: 10px 12px; }

/* Écran d'accueil : présentation + connexion */
.accueil { min-height: 100vh; display: grid; align-content: center; gap: 20px; padding-block: 24px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); max-width: 1040px; margin: 0 auto; }
.presentation { display: grid; gap: 12px; max-width: 34rem; }
.presentation .marque { font-size: 2.2rem; font-weight: 800; color: var(--vert-texte); letter-spacing: -.02em; margin: 0; }
.presentation .accroche { font-size: 1.35rem; font-weight: 700; line-height: 1.3; margin: 0; text-wrap: balance; }
.presentation ul { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 10px; }
.presentation li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; color: var(--encre); }
.presentation li svg { width: 24px; height: 24px; color: var(--vert-texte); }
.presentation .petit { color: var(--gris); font-size: .9rem; margin: 0; }
.accueil .auth-card { margin: 0; justify-self: stretch; max-width: 420px; width: 100%; }
@media (min-width: 900px) {
  .accueil { grid-template-columns: 1.1fr 1fr; align-items: center; gap: 56px; }
  .accueil .auth-card { justify-self: end; }
}
@media (max-width: 719px) {
  .presentation .marque { font-size: 1.8rem; }
  .presentation .accroche { font-size: 1.15rem; }
  .presentation ul { gap: 6px; font-size: .95rem; }
}

/* ================= v0.3 : photos, logo, installation ================= */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.presentation .marque { display: flex; align-items: center; gap: 12px; }
.presentation .marque .logo { width: 44px; height: 44px; flex: 0 0 auto; }
.vignette { flex: 0 0 auto; width: 56px; height: 56px; border-radius: 10px; overflow: hidden; background: var(--gris-clair); color: var(--gris); display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--ligne); }
.vignette img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vignette svg { width: 26px; height: 26px; opacity: .7; }
.vignette.grande { width: 96px; height: 96px; font-size: .75rem; text-align: center; padding: 4px; }
.vignette.grande img { margin: -4px; width: calc(100% + 8px); height: calc(100% + 8px); }
.prod { flex-wrap: nowrap; }
.prod .prod-info { flex: 1 1 auto; min-width: 0; }
.prod .prod-info b { overflow-wrap: anywhere; }
.photo-zone { display: flex; gap: 14px; align-items: center; }
.photo-zone .stack > * + * { margin-top: 6px; }
label.btn { display: inline-flex; font-weight: 600; }
.pub-prod { gap: 12px; }
.pub-prod .prod-info { flex: 1 1 auto; min-width: 0; }
.pub-vignette { width: 64px; height: 64px; padding: 0; cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; z-index: 40; background: var(--voile); display: flex; align-items: center; justify-content: center; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.lightbox figure { margin: 0; background: var(--carte); border-radius: 14px; overflow: hidden; max-width: min(92vw, 520px); }
.lightbox img { display: block; width: 100%; max-height: 72vh; object-fit: contain; background: #fff; }
.lightbox figcaption { padding: 10px 14px; font-weight: 600; color: var(--encre); }
.lightbox .btn { position: absolute; top: max(12px, env(safe-area-inset-top, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); }
@media (max-width: 719px) {
  .prod { flex-wrap: wrap; }
  .prod .prod-info { flex: 1 1 calc(100% - 72px); }
  .prod > .vignette { width: 48px; height: 48px; }
}
.photo-zone .link, .photo-zone #photo-etat { display: block; padding: 2px 0; }
@media (max-width: 719px) {
  .prod > .vignette:first-child { flex: 0 0 48px; }
  .prod > .prod-info { flex: 1 1 calc(100% - 64px); }
}

/* ---------- Identité : nom « kolpo. », titres, montants ---------- */
.brand-sm, .marque, .brand { font-family: var(--titre); font-weight: 700; letter-spacing: -.03em; }
.marque .point, .brand-sm .point { color: var(--ambre); }
.presentation .marque .point { color: #e0a800; }
:root[data-theme="dark"] .presentation .marque .point { color: var(--ambre); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .presentation .marque .point { color: var(--ambre); } }
.montant, .total, .stat-val { font-family: var(--titre); font-variant-numeric: tabular-nums; }
.btn-primary { border-radius: 999px; }

/* ---------- Hors ligne ---------- */
.bandeau-hl { background: var(--ambre-clair); color: var(--ambre-fonce); font-size: .9rem; padding: 8px 16px; display: flex; gap: 8px; align-items: center; }
.bandeau-hl[hidden] { display: none; }
.bandeau-hl svg { width: 18px; height: 18px; flex: 0 0 auto; }
.brand-sm { text-transform: none; font-size: 1.05rem; opacity: 1; letter-spacing: -.02em; line-height: 1.1; }
@media (max-width: 719px) { .brand-sm { font-size: 1rem; } }

/* ---------- Abonnement ---------- */
.avantages, .conditions { list-style: none; margin: 0; padding: 0; }
.avantages li { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.avantages svg { width: 18px; height: 18px; color: var(--vert-texte); flex: 0 0 auto; }
.conditions li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--ligne); font-size: .92rem; }
.conditions li:last-child { border-bottom: 1px solid var(--ligne); }
.conditions .ok { color: var(--succes); font-weight: 700; }
.badge.plan-actif { background: var(--ambre); color: var(--sur-soleil); }
.row.between { justify-content: space-between; align-items: center; }
.row.between h3 { margin: 0; }

/* ---------- Bilan du jour ---------- */
.bilan { margin: 0; padding: 12px; background: var(--fond); border: 1px solid var(--ligne); border-radius: 10px; font: inherit; font-size: .92rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--encre); }

/* ---------- Admin ---------- */
.adm-carte .row + .small { margin: 2px 0 8px; }
.journal { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.journal li { display: flex; gap: 12px; padding: 6px 0; border-top: 1px solid var(--ligne); }
.journal li span:first-child { color: var(--gris); white-space: nowrap; min-width: 108px; }
#adm-q { margin-top: 4px; }
.marque, .brand-sm { -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }

/* ---------- Produits : visible / masqué ---------- */
.btn.vis { display: inline-flex; align-items: center; gap: 6px; }
.btn.vis svg { width: 18px; height: 18px; }
.btn.vis.off { background: var(--gris-clair); color: var(--gris); border-color: var(--ligne); }
.card.prod.masque .prod-info b, .card.prod.masque .vignette { opacity: .55; }

/* ---------- Démarrage ---------- */
.demarrage { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; }
.demarrage .logo { width: 64px; height: 64px; }
.demarrage-barre { width: 120px; height: 4px; border-radius: 4px; background: var(--ligne); overflow: hidden; }
.demarrage-barre span { display: block; width: 40%; height: 100%; border-radius: 4px; background: var(--vert); animation: kolpo-barre 1s ease-in-out infinite; }
@keyframes kolpo-barre { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }
@media (prefers-reduced-motion: reduce) { .demarrage-barre span { animation: none; width: 100%; opacity: .5; } }

/* ---------- Fluidité au toucher ---------- */
html { -webkit-tap-highlight-color: transparent; }
button, a, label, select, input[type="checkbox"], input[type="radio"], .card-cmd, .chip { touch-action: manipulation; }
.btn, .chip, .tabs button, .card-cmd, .icon-btn, .stepper button { transition: transform .08s ease, background-color .15s ease, opacity .15s ease; }
.btn:active:not(:disabled), .chip:active, .tabs button:active, .card-cmd:active, .icon-btn:active, .stepper button:active { transform: scale(.97); }
.modal:not([hidden]) .modal-card { animation: kolpo-monte .18s ease-out; }
.modal:not([hidden]) { animation: kolpo-voile .18s ease-out; }
@keyframes kolpo-monte { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes kolpo-voile { from { background: transparent; } }
.modal-card { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
@media (prefers-reduced-motion: reduce) {
  .modal:not([hidden]) .modal-card, .modal:not([hidden]) { animation: none; }
  .btn:active:not(:disabled), .chip:active, .tabs button:active, .card-cmd:active { transform: none; }
}
.modal-card:focus { outline: none; }

/* ---------- Code à 4 chiffres ---------- */
.verrou { position: fixed; inset: 0; z-index: 40; background: var(--fond); display: flex; align-items: center; justify-content: center; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); overflow-y: auto; }
.verrou[hidden] { display: none; }
.verrou-carte { width: 100%; max-width: 320px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.verrou-carte .logo { width: 56px; height: 56px; }
.verrou-carte h1 { font-size: 1.4rem; margin: 6px 0 0; }
.verrou-carte .muted { margin: 0; min-height: 1.4em; }
.points { display: flex; gap: 14px; margin: 14px 0 4px; }
.points span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--vert-texte); transition: background-color .1s ease; }
.points span.plein { background: var(--vert-texte); }
.verrou-err { min-height: 1.4em; margin: 0; color: var(--rouge); font-size: .92rem; font-weight: 600; }
.clavier { display: grid; grid-template-columns: repeat(3, 72px); gap: 14px; justify-content: center; margin-top: 4px; }
.clavier button { width: 72px; height: 72px; border-radius: 50%; border: 1px solid var(--ligne); background: var(--carte); color: var(--encre); font: 600 1.6rem var(--titre); cursor: pointer; touch-action: manipulation; transition: transform .08s ease, background-color .15s ease; }
.clavier button:active { transform: scale(.94); background: var(--vert-clair); }
.clavier button[data-touche="effacer"] { border-color: transparent; background: transparent; font-size: 1.4rem; }
.verrou-carte .link { margin-top: 8px; }
.secoue { animation: kolpo-secoue .32s ease; }
@keyframes kolpo-secoue { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@media (prefers-reduced-motion: reduce) { .secoue { animation: none; } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.verrou-carte:focus { outline: none; }

/* ---------- Pages Confidentialité / Conditions ---------- */
.page-texte { background: var(--fond); }
.texte-entete { padding: 16px; max-width: 760px; margin: 0 auto; }
.texte-marque { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--vert-texte); font-family: var(--titre); font-weight: 700; font-size: 1.3rem; letter-spacing: -.03em; }
.texte-marque .logo { width: 36px; height: 36px; }
.texte-marque .point { color: var(--ambre); }
.texte { max-width: 760px; margin: 0 auto; padding: 8px 16px 48px; line-height: 1.6; }
.texte h1 { font-size: 1.8rem; margin-bottom: .2em; }
.texte h2 { font-size: 1.2rem; margin-top: 1.6em; }
.texte h3 { font-size: 1rem; margin-top: 1em; }
.texte ul { padding-left: 1.2em; }
.texte li + li { margin-top: .3em; }
.texte-pied { margin-top: 2.4em; border-top: 1px solid var(--ligne); padding-top: 1em; }
mark.a-remplir { background: var(--ambre-clair); color: var(--ambre-fonce); padding: 0 .2em; border-radius: 4px; }
.liens-legaux { font-size: .85rem; text-align: center; color: var(--gris); margin: 12px 0 0; }
.liens-legaux a { color: var(--gris); }

/* ---------- Réglages (séparés de Boutique) ---------- */
.topbar-actions .icon-btn.active { background: rgba(255, 255, 255, .18); }
.entete-vue { display: flex; align-items: center; gap: 8px; margin: 2px 0 12px; }
.entete-vue h2 { margin: 0; font-family: var(--titre); font-size: 1.25rem; }
.carte-lien { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; font: inherit; color: var(--encre);
  background: var(--carte); border: 1px dashed var(--ligne); border-radius: var(--rayon); padding: 12px 14px; cursor: pointer; min-height: 56px; }
.carte-lien > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.carte-lien > span:last-child { font-size: 1.4rem; color: var(--gris); }
.carte-lien svg { width: 22px; height: 22px; flex-shrink: 0; color: var(--vert-texte); }
.carte-lien:focus-visible { outline: 3px solid var(--ambre); outline-offset: 2px; }

/* ---------- Personnalisation de la page de commande ---------- */
.apercu-page { --marque: #3b1747; display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 10px; background: var(--marque); color: #fff; }
.apercu-page b { display: block; font-family: var(--titre); font-size: 1.05rem; }
.apercu-page span { display: block; font-size: .85rem; opacity: .92; }
.apercu-page .apercu-h { opacity: .8; }
.apercu-logo { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; flex-shrink: 0; background: rgba(255, 255, 255, .16); }
.apercu-logo.vide { display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.3rem; opacity: 1; }
.nuancier { display: flex; flex-wrap: wrap; gap: 10px; }
.pastille { position: relative; width: 44px; height: 44px; border-radius: 50%; background: var(--c); cursor: pointer; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25); }
.pastille input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.pastille:has(input:checked) { outline: 3px solid var(--encre); outline-offset: 3px; }
.pastille:has(input:checked)::after { content: ""; position: absolute; left: 15px; top: 11px; width: 10px; height: 18px; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg); }
.pastille:has(input:focus-visible) { outline: 3px solid var(--ambre); outline-offset: 3px; }
/* Page client : l'en-tête prend la couleur et le logo de la boutique */
.pub-head.perso { background: var(--marque); color: #fff; }
.pub-head.perso .muted { color: #fff; }
.pub-logo { width: 72px; height: 72px; border-radius: 18px; object-fit: cover; display: block; margin: 0 auto 10px; background: rgba(255, 255, 255, .16); }
.pub-desc { margin: 6px auto 0; max-width: 520px; }
.pub-horaires { margin: 4px 0 0; font-size: .9rem; opacity: .85; }

/* Chargement : cartes grises qui respirent doucement (désactivé si l'appareil réduit les animations) */
.squelette { display: flex; flex-direction: column; gap: 10px; min-height: 78px; }
.squelette span { display: block; height: 14px; border-radius: 7px; background: var(--gris-clair); }
.squelette span:first-child { width: 55%; }
.squelette span:last-child { width: 35%; }
@media (prefers-reduced-motion: no-preference) { .squelette span { animation: respire 1.4s ease-in-out infinite; } }
@keyframes respire { 50% { opacity: .45; } }
/* Longues listes : le navigateur ne dessine que les cartes visibles (défilement plus fluide) */
.cards > li.card-cmd { content-visibility: auto; contain-intrinsic-size: auto 92px; }

/* ---------- Suivi de commande (client) ---------- */
.etapes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.etapes li { display: flex; align-items: flex-start; gap: 12px; color: var(--gris); }
.etapes li > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.etapes li.fait, .etapes li.actuelle { color: var(--encre); }
.pastille-etape { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; font-weight: 800;
  border: 2px solid var(--ligne); background: var(--carte); }
.etapes li.fait .pastille-etape { background: var(--succes); border-color: var(--succes); color: var(--carte); }
.etapes li.actuelle .pastille-etape { background: var(--ambre); border-color: var(--ambre); color: var(--sur-soleil); }
.centre { text-align: center; }
.mes-suivis a { font-weight: 700; }
.pub-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.pub-opts .pub-opt { max-width: 100%; }
.prod-desc { margin: 4px 0 0; color: var(--gris); line-height: 1.35; overflow-wrap: anywhere; }
.choix-groupe { display: grid; grid-template-columns: minmax(80px, 1fr) 2.4fr; gap: 8px; }
@media (max-width: 420px) { .choix-groupe { grid-template-columns: 1fr; } }
.pub-opt { margin-top: 6px; min-height: 36px; padding: 4px 8px; font: inherit; border-radius: 8px; border: 1px solid var(--ligne); background: var(--champ); color: var(--encre); }
/* Boutique : lien court et frais par quartier */
.lien-court summary, .frais-quartiers summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.lien-court form { margin-top: 8px; }
.linkbox .prefixe { align-self: center; color: var(--gris); font-weight: 600; white-space: nowrap; }
.grille-frais { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
@media (min-width: 640px) { .grille-frais { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.grille-frais label { font-size: .85rem; }
.qte-retour { width: 72px; text-align: right; }
.slugbox { flex-wrap: wrap; }
.slugbox input { flex: 1 1 140px; min-width: 0; }
@media (max-width: 480px) { .slugbox .btn { flex: 1 1 100%; } }
.lignes-retour { display: flex; flex-direction: column; gap: 10px; }
.ligne-retour { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ligne-retour > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ligne-retour input { flex: 0 0 72px; margin: 0; }

/* ---------- Premium en ligne (Chariow) ---------- */
.offres { display: grid; gap: 8px; }
@media (min-width: 640px) { .offres { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.offre { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 56px; padding: 10px 14px; text-align: left;
  font: inherit; color: var(--encre); background: var(--carte); border: 1px solid var(--ligne); border-radius: var(--rayon); cursor: pointer; }
.offre > span { display: flex; flex-direction: column; gap: 2px; }
.offre:hover { border-color: var(--vert-texte); }
.offre:focus-visible { outline: 3px solid var(--ambre); outline-offset: 2px; }
.en-ligne > a.small { color: var(--gris); }
.bandeau-paiement { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; font-weight: 600; }
.bandeau-paiement.attente { background: var(--ambre-clair); color: var(--ambre-fonce); }
.bandeau-paiement.ok { background: var(--succes-clair); color: var(--succes); }
.bandeau-paiement .link { color: inherit; }
.grille-tarifs { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 8px 10px; }

/* Notes des clients */
.pub-note { margin: 6px 0 0; font-weight: 700; color: var(--sur-entete, inherit); }
.pub-note span { font-weight: 400; }
.etoiles { display: flex; gap: 4px; }
.etoile { font-size: 2rem; line-height: 1; min-width: 44px; min-height: 44px; border: 0; background: none; color: var(--gris); cursor: pointer; padding: 0; }
.etoile.on { color: #a86f00; }
.barres { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.barres li { display: grid; grid-template-columns: 2.5em 1fr 2.5em; align-items: center; gap: 8px; font-size: .9rem; }
.barre { height: 8px; border-radius: 4px; background: var(--ligne); overflow: hidden; }
.barre i { display: block; height: 100%; background: #a86f00; }
.alert.suspendue { border-left: 4px solid #b3261e; }

/* Précommandes et livraisons planifiées */
.pre-info { margin: 4px 0 0; color: var(--encre); }
.pre-info b { color: var(--vert); }
.pre-acompte { font-weight: 700; }
.badge.pre { background: var(--champ); border: 1px solid var(--vert); color: var(--encre); }
.badge.planif { background: var(--champ); border: 1px dashed var(--ligne); color: var(--encre); }
.recap .row > span:last-child { white-space: nowrap; padding-left: 8px; }
/* Catégories, produit partagé, QR code */
.pub-cats { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; flex-wrap: nowrap; }
.pub-cats::-webkit-scrollbar { display: none; }
.pub-cats .chip { flex: 0 0 auto; }
.pub-prod.prod-vise { outline: 3px solid var(--vert); outline-offset: 2px; }
.pub-partager { display: inline-block; margin-top: 4px; padding: 4px 0; min-height: 32px; }
.qr-affiche { text-align: center; padding: 16px; border: 1px solid var(--ligne); border-radius: 14px; background: #fff; color: #111; }
.qr-zone .qr { width: min(260px, 70vw); height: auto; display: block; margin: 0 auto; }
.qr-nom { font-size: 1.3rem; font-weight: 800; margin: 10px 0 0; color: #111; }
.qr-texte { margin: 4px 0; color: #111; }
.qr-affiche .muted { color: #444; }
@media print {
  body.impression-qr * { visibility: hidden; }
  body.impression-qr #qr-affiche, body.impression-qr #qr-affiche * { visibility: visible; }
  body.impression-qr #qr-affiche { position: fixed; inset: 0; border: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; }
  body.impression-qr .qr-zone .qr { width: 12cm; }
}
.propulse { margin: 18px 0 8px; } .propulse a { color: inherit; font-weight: 700; }
