/* My shop — identité « Teranga » : vert profond, sable, touches safran, motif wax discret.
   Une seule feuille, sans dépendance ni police externe, pensée pour Android d'entrée de gamme.
   Contrastes AA vérifiés par l'audit axe (test/ui/a11y.spec.js), en clair et en sombre. */
:root {
  --fond: #f5f2ea; --fond-2: #ede8dc; --carte: #fff; --texte: #14201a; --doux: #56625c; --trait: #e7e2d6; --trait-fort: #cdc5b3;
  --vert: #0b7a4b; --vert-fonce: #075e39; --vert-clair: #e2f3e9; --rouge: #b3261e; --rouge-clair: #fde8e6;
  --orange: #9a5200; --orange-clair: #fff1dc; --bleu: #1b5fb0; --bleu-clair: #e6effb;
  --safran: #f4b400; --safran-texte: #3a2800; --wa: #13733d;
  /* Fonds de boutons pleins (texte blanc, contraste AA ≥ 4,5 dans les deux thèmes) */
  --btn-vert: #0b7a4b; --btn-vert-2: #086a41; --btn-rouge: #b3261e;
  --hero-1: #053d27; --hero-2: #0b7a4b;
  --ombre: 0 1px 2px rgb(20 32 26 / 6%), 0 6px 20px rgb(20 32 26 / 7%);
  --ombre-forte: 0 2px 6px rgb(20 32 26 / 10%), 0 14px 34px rgb(20 32 26 / 14%);
  --rayon: 18px; --rayon-sm: 14px; --focus: #1b5fb0;
  --tab-h: 68px; --top-h: 56px;
  --barre: #fffdf8; /* opaque : pas de flou d'arrière-plan (trop coûteux sur petit téléphone, surtout sur la vidéo caméra) */
  /* Motif wax (losanges et cercles) en SVG, utilisé en surimpression très légère */
  --wax: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.11' stroke-width='2'%3E%3Cpath d='M28 4 52 28 28 52 4 28Z'/%3E%3Ccircle cx='28' cy='28' r='8'/%3E%3Ccircle cx='0' cy='0' r='8'/%3E%3Ccircle cx='56' cy='0' r='8'/%3E%3Ccircle cx='0' cy='56' r='8'/%3E%3Ccircle cx='56' cy='56' r='8'/%3E%3C/g%3E%3C/svg%3E");
  color-scheme: light;
  font-size: 16px;
}
:root[data-big] { font-size: 19px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="clair"]) {
    --fond: #0d1411; --fond-2: #121c17; --carte: #17221c; --texte: #e8efe9; --doux: #a3b2a8; --trait: #26342c; --trait-fort: #3a4a40;
    --vert: #3cc184; --vert-fonce: #86e0b0; --vert-clair: #163726; --rouge: #ff8a80; --rouge-clair: #3b1c19;
    --orange: #ffb35c; --orange-clair: #3a2a14; --bleu: #8ab8f0; --bleu-clair: #17273a; --focus: #8ab8f0;
    --hero-1: #042a1b; --hero-2: #0a6640; --barre: #17221c;
    --ombre: 0 1px 2px rgb(0 0 0 / 30%), 0 6px 20px rgb(0 0 0 / 25%);
    --ombre-forte: 0 2px 6px rgb(0 0 0 / 35%), 0 14px 34px rgb(0 0 0 / 40%);
    color-scheme: dark;
  }
}
:root[data-theme="sombre"] {
  --fond: #0d1411; --fond-2: #121c17; --carte: #17221c; --texte: #e8efe9; --doux: #a3b2a8; --trait: #26342c; --trait-fort: #3a4a40;
  --vert: #3cc184; --vert-fonce: #86e0b0; --vert-clair: #163726; --rouge: #ff8a80; --rouge-clair: #3b1c19;
  --orange: #ffb35c; --orange-clair: #3a2a14; --bleu: #8ab8f0; --bleu-clair: #17273a; --focus: #8ab8f0;
  --hero-1: #042a1b; --hero-2: #0a6640; --barre: #17221c;
  --ombre: 0 1px 2px rgb(0 0 0 / 30%), 0 6px 20px rgb(0 0 0 / 25%);
  --ombre-forte: 0 2px 6px rgb(0 0 0 / 35%), 0 14px 34px rgb(0 0 0 / 40%);
  color-scheme: dark;
}

/* ── Base ──────────────────────────────────────── */
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  background: var(--fond); color: var(--texte); line-height: 1.45;
  -webkit-tap-highlight-color: transparent; overscroll-behavior-y: contain; overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--vert-fonce); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--carte); padding: 8px; z-index: 100; }
.skip:focus { left: 8px; }
[hidden] { display: none !important; }
b, .kpi, .qty-huge, .tile b, .total, .keypad-display, .end { font-variant-numeric: tabular-nums; }

/* ── Barre du haut (translucide) ───────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20; min-height: var(--top-h); display: flex; align-items: center; gap: 4px;
  padding: env(safe-area-inset-top) 8px 0 6px; background: var(--barre); border-bottom: 1px solid var(--trait);
}
.topbar h1 { flex: 1; margin: 0 4px; font-size: 1.12rem; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .icon-btn { flex: none; }
.icon-btn {
  width: 48px; height: 48px; border: 0; background: none; border-radius: 14px; display: grid; place-items: center; cursor: pointer; color: var(--texte);
  transition: background .15s;
}
.icon-btn:hover { background: var(--fond-2); }
.icon-btn:active { background: var(--trait); }
.icon-btn svg, .btn svg, .tabs svg, .action svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pill {
  border: 1px solid var(--trait); background: var(--carte); color: var(--doux); border-radius: 999px; padding: 6px 12px;
  font-size: .8rem; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; min-height: 38px; cursor: pointer; white-space: nowrap;
  box-shadow: var(--ombre);
}
.pill .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--doux); box-shadow: 0 0 0 3px rgb(0 0 0 / 5%); }
.pill.ok .dot { background: var(--vert); }
.pill.offline .dot, .pill.pending .dot { background: var(--safran); }
.pill.error .dot, .pill.auth .dot { background: var(--rouge); }
.pill.syncing .dot { background: var(--bleu); animation: pulse 1s infinite alternate; }
@keyframes pulse { to { opacity: .3; } }
@media (max-width: 420px) {
  /* Tout va bien : le point suffit, le texte reste lu par les lecteurs d'écran. */
  .pill.quiet { padding: 6px 12px; }
  .pill.quiet span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .pill span:last-child { max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
}

/* ── Contenu ───────────────────────────────────── */
main { padding: 14px 14px calc(var(--tab-h) + 40px + env(safe-area-inset-bottom)); max-width: 760px; margin: 0 auto; outline: none; }
main > * { animation: entree .22s ease-out; }
@keyframes entree { from { opacity: 0; transform: translateY(6px); } }
.stack > * + * { margin-top: 14px; }
.stack-sm > * + * { margin-top: 6px; }
.hstack { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.grid2 > *, .grid3 > * { min-width: 0; }
.muted { color: var(--doux); }
.small { font-size: .86rem; }
.center { text-align: center; }
.neg { color: var(--rouge); font-weight: 700; }
.pos { color: var(--vert); font-weight: 700; }
.warn-t { color: var(--orange); font-weight: 700; }
h2 {
  display: flex; align-items: center; gap: 8px; font-size: .78rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--doux); margin: 22px 2px 8px; font-weight: 800;
}
h2::before { content: ""; width: 4px; height: 14px; border-radius: 4px; background: var(--safran); flex: none; }
h2:first-child { margin-top: 4px; }

.card { background: var(--carte); border-radius: var(--rayon); padding: 16px; box-shadow: var(--ombre); border: 1px solid var(--trait); }
.card.flat { box-shadow: none; }
.card.stack-sm > span { display: block; }
a.card { display: block; text-decoration: none; color: inherit; transition: transform .12s; }
a.card:active { transform: scale(.99); }

/* ── Bandeau d'accueil ─────────────────────────── */
.hero-card {
  position: relative; overflow: hidden; border-radius: 24px; padding: 18px 18px 16px; color: #fff;
  background: var(--wax), linear-gradient(140deg, var(--hero-1) 0%, var(--hero-2) 100%);
  box-shadow: var(--ombre-forte);
}
.hero-card::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(circle, rgb(244 180 0 / 35%), transparent 70%); pointer-events: none;
}
.hero-card .hello { font-size: .92rem; opacity: .92; }
.hero-card .shop { font-size: 1.45rem; font-weight: 800; letter-spacing: -.01em; margin: 2px 0 12px; }
.hero-card .figure { font-size: 2.1rem; font-weight: 800; line-height: 1.05; letter-spacing: -.02em; }
.hero-card .figure-label { font-size: .85rem; opacity: .92; }
.hero-card .hero-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 10px; position: relative; z-index: 1; }
.hero-card .hero-chip {
  display: inline-flex; align-items: center; gap: 6px; background: rgb(255 255 255 / 16%); border: 1px solid rgb(255 255 255 / 22%);
  color: #fff; text-decoration: none; border-radius: 999px; padding: 6px 12px; font-size: .82rem; font-weight: 700; white-space: nowrap;
}
.hero-card .date { font-size: .8rem; opacity: .9; }
.hero-card .date::first-letter { text-transform: uppercase; }

/* Actions rapides (ronds) */
.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.action {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; color: var(--texte);
  font-size: .8rem; font-weight: 700; text-align: center; position: relative; padding: 4px 0;
}
.action .bubble {
  width: 58px; height: 58px; border-radius: 20px; display: grid; place-items: center; background: var(--carte); color: var(--vert-fonce);
  border: 1px solid var(--trait); box-shadow: var(--ombre); transition: transform .12s;
}
.action:active .bubble { transform: scale(.94); }
.action.main-action .bubble { background: linear-gradient(160deg, var(--btn-vert), var(--btn-vert-2)); color: #fff; border-color: transparent; box-shadow: 0 8px 20px rgb(11 122 75 / 35%); }
.action .count { position: absolute; top: 0; right: calc(50% - 36px); background: var(--rouge); color: #fff; border-radius: 10px; font-size: .7rem; padding: 0 6px; line-height: 18px; min-width: 18px; }

/* Tuiles de l'accueil */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tile {
  position: relative; border-radius: var(--rayon); padding: 14px 16px; background: var(--carte); text-decoration: none; color: var(--doux);
  display: block; box-shadow: var(--ombre); border: 1px solid var(--trait); min-height: 92px; min-width: 0; overflow: hidden; font-weight: 600; font-size: .9rem;
}
.tile b { padding-right: 16px; display: block; font-size: 1.95rem; line-height: 1.1; color: var(--texte); letter-spacing: -.02em; }
.tile b.small { font-size: 1.15rem; white-space: nowrap; padding-right: 20px; }
.tile::after { content: ""; position: absolute; top: 14px; right: 14px; width: 10px; height: 10px; border-radius: 50%; background: var(--trait-fort); }
.tile.warn { background: linear-gradient(160deg, var(--orange-clair), var(--carte) 75%); }
.tile.warn b { color: var(--orange); } .tile.warn::after { background: var(--safran); }
.tile.danger { background: linear-gradient(160deg, var(--rouge-clair), var(--carte) 75%); }
.tile.danger b { color: var(--rouge); } .tile.danger::after { background: var(--rouge); }
.tile.ok { background: linear-gradient(160deg, var(--vert-clair), var(--carte) 75%); }
.tile.ok b { color: var(--vert-fonce); } .tile.ok::after { background: var(--vert); }
.tile.info { background: linear-gradient(160deg, var(--bleu-clair), var(--carte) 75%); }
.tile.info b { color: var(--bleu); } .tile.info::after { background: var(--bleu); }

/* ── Boutons ───────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 16px;
  border-radius: var(--rayon-sm); border: 1px solid var(--trait-fort); background: var(--carte); cursor: pointer; font-weight: 700;
  text-decoration: none; color: var(--texte); user-select: none; touch-action: manipulation; transition: transform .1s, box-shadow .15s, background .15s;
}
.btn:hover { box-shadow: var(--ombre); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, var(--btn-vert), var(--btn-vert-2)); border-color: var(--btn-vert-2); color: #fff; box-shadow: 0 4px 12px rgb(11 122 75 / 25%); }
.btn.danger { background: var(--rouge-clair); border-color: transparent; color: var(--rouge); }
.btn.solid-danger { background: var(--btn-rouge); border-color: var(--btn-rouge); color: #fff; }
.btn.wa { background: var(--wa); border-color: var(--wa); color: #fff; }
.btn.ghost { background: none; border-color: transparent; color: var(--vert-fonce); box-shadow: none; }
.btn.block { display: flex; width: 100%; }
.btn.big { min-height: 62px; font-size: 1.15rem; border-radius: 18px; }
.btn.huge { min-height: 80px; font-size: 1.3rem; border-radius: 22px; }
.btn.sm { min-height: 40px; padding: 6px 12px; font-size: .88rem; border-radius: 12px; }
.pm { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pm .btn { min-height: 74px; font-size: 1.9rem; font-weight: 800; border-radius: 20px; }
.pm .minus { background: var(--rouge-clair); color: var(--rouge); border-color: transparent; }
.pm .plus { background: linear-gradient(180deg, var(--btn-vert), var(--btn-vert-2)); color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgb(11 122 75 / 28%); }

/* ── Listes ────────────────────────────────────── */
.list { list-style: none; margin: 0; padding: 0; background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre); border: 1px solid var(--trait); overflow: hidden; }
.list > li + li { border-top: 1px solid var(--trait); }
.item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 64px; text-decoration: none; color: inherit; transition: background .12s; }
a.item:hover, button.item:hover { background: var(--fond); }
a.item:active, button.item:active { background: var(--fond-2); }
button.item { width: 100%; border: 0; background: none; text-align: left; cursor: pointer; }
.item .emoji {
  font-size: 1.5rem; width: 46px; height: 46px; border-radius: 15px; background: var(--fond); display: grid; place-items: center; flex: none; overflow: hidden;
}
.item .main { flex: 1; min-width: 0; }
.item a.main, a.main { text-decoration: none; color: inherit; }
.item .title { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .sub { display: block; font-size: .84rem; color: var(--doux); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .end { text-align: right; flex: none; }
.item .end b { font-size: 1.2rem; }
.item.wrap { flex-wrap: wrap; }
.item.wrap .main { flex: 1 1 calc(100% - 60px); }
.item.wrap .end { flex: 1 1 100%; justify-content: flex-end; padding-left: 58px; }
.item input[type="checkbox"], label input[type="checkbox"] { width: 24px; height: 24px; flex: none; accent-color: var(--vert); }
.qty-ok { color: var(--texte); }
.qty-critique { color: var(--orange); }
.qty-rupture, .qty-negatif { color: var(--rouge); }
.badge { display: inline-block; border-radius: 999px; padding: 2px 9px; font-size: .74rem; font-weight: 800; background: var(--fond-2); color: var(--texte); vertical-align: middle; }
.badge.danger { background: var(--rouge-clair); color: var(--rouge); }
.badge.warn { background: var(--orange-clair); color: var(--orange); }
.badge.ok { background: var(--vert-clair); color: var(--vert-fonce); }
.badge.info { background: var(--bleu-clair); color: var(--bleu); }
.history-day { font-size: .76rem; color: var(--doux); font-weight: 800; padding: 10px 14px 4px; background: var(--fond); text-transform: capitalize; }

.alert { border-radius: var(--rayon-sm); padding: 12px 14px; font-weight: 600; font-size: .94rem; border: 1px solid transparent; }
.alert.warn { background: var(--orange-clair); color: var(--orange); border-color: rgb(154 82 0 / 15%); }
.alert.danger { background: var(--rouge-clair); color: var(--rouge); border-color: rgb(179 38 30 / 15%); }
.alert.ok { background: var(--vert-clair); color: var(--vert-fonce); border-color: rgb(11 122 75 / 15%); }
.alert.info { background: var(--bleu-clair); color: var(--bleu); border-color: rgb(27 95 176 / 15%); }
.banner { border-radius: var(--rayon-sm); padding: 10px 12px; background: var(--bleu-clair); color: var(--bleu); font-size: .9rem; }

.empty { text-align: center; color: var(--doux); padding: 32px 16px; }
.empty .big-emoji {
  font-size: 2.4rem; width: 84px; height: 84px; margin: 0 auto 10px; border-radius: 28px; display: grid; place-items: center;
  background: var(--carte); box-shadow: var(--ombre); border: 1px solid var(--trait);
}

/* ── Puces et contrôle segmenté ────────────────── */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; align-items: center; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--trait-fort); background: var(--carte); border-radius: 999px; padding: 8px 15px; min-height: 40px;
  cursor: pointer; font-weight: 700; font-size: .88rem; white-space: nowrap; transition: background .12s;
}
.chip[aria-pressed="true"] { background: var(--btn-vert); border-color: var(--btn-vert); color: #fff; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--fond-2); border-radius: 16px; padding: 4px; gap: 4px; border: 1px solid var(--trait); }
.seg button { border: 0; background: none; border-radius: 12px; min-height: 44px; font-weight: 800; cursor: pointer; font-size: .88rem; padding: 4px; color: var(--doux); transition: background .15s; }
.seg button[aria-pressed="true"] { background: var(--carte); box-shadow: var(--ombre); color: var(--vert-fonce); }
.seg.vente button[aria-pressed="true"] { color: var(--rouge); }

/* ── Formulaires ───────────────────────────────── */
.field { display: block; }
.field > span { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 5px; }
.field small { display: block; color: var(--doux); margin-top: 4px; font-size: .8rem; }
.input, select.input, textarea.input {
  width: 100%; min-height: 50px; border: 1.5px solid var(--trait-fort); border-radius: var(--rayon-sm); padding: 10px 14px; background: var(--carte);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--vert); outline: none; box-shadow: 0 0 0 4px var(--vert-clair); }
.input.big { font-size: 1.3rem; font-weight: 800; }
.input-row { display: flex; gap: 8px; }
.input-row .input { flex: 1; min-width: 0; }
.search { position: sticky; top: calc(var(--top-h) + 6px); z-index: 5; }
.spread > label.small { display: flex; align-items: center; gap: 8px; }
.spread > label.small .input { width: auto; min-height: 42px; padding: 6px 12px; }
.search .input { padding-left: 46px; background: var(--carte); border-radius: 999px; box-shadow: var(--ombre); border-color: var(--trait); }
.search svg { position: absolute; left: 16px; top: 13px; width: 22px; height: 22px; fill: none; stroke: var(--doux); stroke-width: 2; }
.form-error { color: var(--rouge); font-weight: 700; }
.emoji-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.emoji-pick button { font-size: 1.5rem; width: 50px; height: 50px; border-radius: 14px; border: 1px solid var(--trait); background: var(--carte); cursor: pointer; }
.emoji-pick button[aria-pressed="true"] { border: 2px solid var(--vert); background: var(--vert-clair); }
details.more { border-top: 1px dashed var(--trait-fort); padding-top: 4px; }
details.more > summary { cursor: pointer; font-weight: 800; padding: 10px 0; color: var(--vert-fonce); list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "▸ "; }
details.more[open] > summary::before { content: "▾ "; }

/* ── Barre d'onglets flottante ─────────────────── */
.tabs {
  position: fixed; left: 10px; right: 10px; bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--barre); border: 1px solid var(--trait); border-radius: 24px; height: var(--tab-h); max-width: 740px; margin: 0 auto;
  box-shadow: var(--ombre-forte);
}
.tabs a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none;
  color: var(--doux); font-size: .66rem; font-weight: 700; position: relative; min-width: 0;
}
.tabs a > svg { padding: 4px 14px; width: 52px; height: 32px; border-radius: 16px; transition: background .15s; box-sizing: border-box; }
.tabs a[aria-current="page"] { color: var(--vert-fonce); }
.tabs a[aria-current="page"] > svg { background: var(--vert-clair); }
.tabs a span { white-space: nowrap; font-size: .66rem; }
.tabs a.scan-tab span.ring {
  width: 62px; height: 62px; border-radius: 22px; background: linear-gradient(160deg, var(--btn-vert), var(--btn-vert-2)); color: #fff; display: grid; place-items: center;
  margin-top: -30px; box-shadow: 0 10px 22px rgb(11 122 75 / 40%); border: 4px solid var(--fond); transform: rotate(0);
}
.tabs a.scan-tab svg { width: 28px; height: 28px; }
.tabs .count {
  position: absolute; top: 6px; left: calc(50% + 8px); background: var(--rouge); color: #fff; border-radius: 10px; font-size: .68rem;
  padding: 0 6px; min-width: 18px; text-align: center; line-height: 18px; box-shadow: 0 0 0 2px var(--carte);
}
small.wo { display: block; font-size: .72em; font-weight: 600; opacity: .85; font-style: italic; }
.btn small.wo { display: inline; margin-left: 6px; }
.tabs small.wo { display: none; }
.tabs.bilingue small.wo { display: block; font-size: .56rem; line-height: 1; }

/* ── Scanner ───────────────────────────────────── */
.camera {
  position: relative; background: #0a0f0c; border-radius: 22px; overflow: hidden; aspect-ratio: 4 / 3; max-height: 42vh; width: 100%;
  display: grid; place-items: center; color: #dff5e8; box-shadow: var(--ombre-forte);
}
.camera video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.camera .viseur { position: relative; width: 74%; height: 38%; border-radius: 16px; pointer-events: none; }
.camera .viseur::before {
  content: ""; position: absolute; inset: 0; border-radius: 16px; padding: 3px; pointer-events: none;
  background: linear-gradient(90deg, #fff 0 22%, transparent 22% 78%, #fff 78%) top / 100% 3px no-repeat,
              linear-gradient(90deg, #fff 0 22%, transparent 22% 78%, #fff 78%) bottom / 100% 3px no-repeat,
              linear-gradient(#fff 0 30%, transparent 30% 70%, #fff 70%) left / 3px 100% no-repeat,
              linear-gradient(#fff 0 30%, transparent 30% 70%, #fff 70%) right / 3px 100% no-repeat;
}
.camera .viseur::after { content: ""; position: absolute; left: 6%; right: 6%; top: 50%; height: 2px; background: #ff5a4f; box-shadow: 0 0 10px #ff5a4f; animation: laser 1.6s ease-in-out infinite alternate; }
@keyframes laser { from { transform: translateY(-18px); } to { transform: translateY(18px); } }
.camera .cam-msg { position: absolute; bottom: 10px; left: 10px; right: 10px; text-align: center; font-size: .86rem; font-weight: 600; text-shadow: 0 1px 3px #000; }
.camera .cam-tools { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; }
.camera .cam-tools .icon-btn { background: rgb(0 0 0 / 50%); color: #fff; }
.camera.flash-ok { box-shadow: 0 0 0 5px var(--vert) inset, var(--ombre-forte); }
.camera.flash-err { box-shadow: 0 0 0 5px var(--rouge) inset, var(--ombre-forte); }
.camera.off { aspect-ratio: auto; min-height: 120px; }
.scan-result { border-radius: var(--rayon); padding: 14px 16px; background: var(--vert-clair); border: 1px solid rgb(11 122 75 / 18%); animation: entree .18s ease-out; }
.scan-result.unknown { background: var(--orange-clair); border-color: rgb(154 82 0 / 18%); }
.scan-result .name { font-weight: 800; font-size: 1.1rem; }
.scan-result .change { font-size: 1.9rem; font-weight: 800; margin: 2px 0; letter-spacing: -.02em; }
.scan-result .change .arrow { color: var(--doux); font-weight: 500; }
.qty-huge { font-size: 3rem; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.kpi { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.grid2 .kpi { font-size: 1.25rem; }

/* ── Feuilles (dialogues en bas d'écran) ───────── */
dialog.sheet {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; max-height: 92vh; border-radius: 26px 26px 0 0;
  background: var(--carte); color: var(--texte); box-shadow: 0 -10px 40px rgb(0 0 0 / 25%);
}
dialog.sheet[open] { animation: monte .2s ease-out; }
@keyframes monte { from { transform: translateY(24px); opacity: .6; } }
dialog.sheet::backdrop { background: rgb(8 14 11 / 55%); }
.sheet-body { padding: 10px 18px calc(18px + env(safe-area-inset-bottom)); overflow-y: auto; max-height: 92vh; }
.sheet-body::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--trait-fort); margin: 0 auto 12px; }
.sheet-body h3 { margin: 0 0 12px; font-size: 1.18rem; font-weight: 800; }
.sheet-actions { display: flex; gap: 10px; margin-top: 16px; }
.sheet-actions .btn { flex: 1; }

/* Pavé numérique géant (une main, doigts occupés) */
.keypad-display { font-size: 2.5rem; font-weight: 800; text-align: center; padding: 8px; border-radius: 16px; background: var(--fond); min-height: 68px; }
.keypad-display .unit { font-size: 1.1rem; color: var(--doux); font-weight: 700; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.keypad button { min-height: 60px; font-size: 1.6rem; font-weight: 800; border-radius: 16px; border: 1px solid var(--trait); background: var(--carte); cursor: pointer; box-shadow: var(--ombre); }
.keypad button:active { background: var(--fond-2); transform: scale(.97); }
.quick { display: flex; gap: 6px; margin-top: 10px; }
.quick button { flex: 1; min-height: 44px; border-radius: 12px; border: 1px solid var(--trait-fort); background: var(--fond); font-weight: 800; cursor: pointer; }

/* Notifications éphémères */
#toasts { position: fixed; left: 10px; right: 10px; bottom: calc(var(--tab-h) + 22px + env(safe-area-inset-bottom)); z-index: 50; display: grid; gap: 8px; pointer-events: none; max-width: 560px; margin: 0 auto; }
.toast {
  pointer-events: auto; background: #16211b; color: #fff; border-radius: 16px; padding: 12px 16px; display: flex; gap: 10px; align-items: center;
  box-shadow: 0 10px 30px rgb(0 0 0 / 35%); animation: up .2s ease-out; font-weight: 600;
}
.toast.error { background: var(--btn-rouge); }
.toast .grow { flex: 1; }
.toast button { background: none; border: 0; color: #ffd466; font-weight: 800; min-height: 40px; cursor: pointer; text-transform: uppercase; font-size: .85rem; }
@keyframes up { from { transform: translateY(12px); opacity: 0; } }

/* ── Caisse ────────────────────────────────────── */
.cart-line { display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.cart-line .qbtn { width: 46px; height: 46px; border-radius: 14px; border: 1px solid var(--trait-fort); background: var(--fond); font-size: 1.3rem; font-weight: 800; cursor: pointer; }
.cart-line button.main { border: 0; background: none; text-align: left; cursor: pointer; min-width: 0; padding: 0; }
.cart-line .title { font-weight: 700; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-line .sub { font-size: .8rem; color: var(--doux); display: block; }
.cart-line .emoji { font-size: 1.4rem; }
.total-bar {
  position: sticky; bottom: calc(var(--tab-h) + 18px + env(safe-area-inset-bottom)); background: var(--carte); border-radius: 22px; padding: 12px 12px 12px 18px;
  box-shadow: var(--ombre-forte); border: 1px solid var(--trait);
}
.total-bar .total { font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; }
.pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pay-grid .btn { min-height: 58px; }
.pay-wave { background: #e3f6fd; }
.pay-om { background: #fff0e3; }
.pay-free { background: #fde7e8; }
:root[data-theme="sombre"] .pay-wave, :root[data-theme="sombre"] .pay-om, :root[data-theme="sombre"] .pay-free { background: var(--carte); }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
.pos-grid button {
  min-height: 92px; border-radius: 18px; border: 1px solid var(--trait); background: var(--carte); cursor: pointer; padding: 8px 6px; font-size: .8rem; font-weight: 700;
  box-shadow: var(--ombre); transition: transform .1s;
}
.pos-grid button:active { transform: scale(.96); }
.pos-grid button .e { font-size: 1.9rem; display: block; }
.pos-grid button .p { color: var(--vert-fonce); font-size: .76rem; display: block; font-weight: 800; }
.pos-grid.pictures { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.pos-grid.pictures button { min-height: 130px; font-size: .95rem; }
.pos-grid.pictures button .e { font-size: 3rem; }
.pos-grid.pictures button .p { font-size: 1rem; color: var(--texte); }
.promo { display: inline-block; background: var(--safran); color: var(--safran-texte); border-radius: 8px; padding: 0 6px; font-size: .72rem; font-weight: 800; }

/* Photos d'articles */
img.thumb { width: 46px; height: 46px; object-fit: cover; border-radius: 15px; display: block; }
.pos-grid button img.thumb { width: 64px; height: 64px; margin: 0 auto 4px; border-radius: 16px; }
.pos-grid.pictures button img.thumb { width: 96px; height: 96px; }
.card .emoji { font-size: 2.4rem; }
.card .emoji img.thumb { width: 76px; height: 76px; border-radius: 20px; }

/* ── Graphiques simples (barres) ───────────────── */
.bars { display: flex; align-items: flex-end; gap: 5px; height: 120px; padding-top: 8px; }
.bars .bar { flex: 1; background: linear-gradient(180deg, var(--vert), var(--btn-vert-2)); border-radius: 6px 6px 2px 2px; min-height: 3px; position: relative; opacity: .75; }
.bars .bar.today { opacity: 1; background: linear-gradient(180deg, var(--safran), #d99a00); }
.bars-labels { display: flex; gap: 5px; }
.bars-labels span { flex: 1; text-align: center; font-size: .64rem; color: var(--doux); }
.meter { height: 10px; border-radius: 6px; background: var(--fond-2); overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--vert); border-radius: 6px; }
.meter.warn > i { background: var(--safran); }
.meter.danger > i { background: var(--rouge); }

/* ── Étiquettes imprimables ────────────────────── */
.labels-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(62mm, 1fr)); gap: 3mm; }
.label { border: 1px dashed var(--trait-fort); border-radius: 6px; padding: 3mm; text-align: center; background: #fff; color: #000; break-inside: avoid; }
.label .ln { font-weight: 700; font-size: 11pt; margin-bottom: 1mm; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.label .lp { font-weight: 800; font-size: 13pt; }
.label svg { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.label.qr svg { width: 28mm; }
@media print {
  body { background: #fff; }
  .topbar, .tabs, #toasts, .no-print { display: none !important; }
  main { padding: 0; max-width: none; }
  main > * { animation: none; }
  .label { border-color: #bbb; }
  @page { margin: 8mm; }
}

/* ── Bienvenue ─────────────────────────────────── */
.hero { text-align: center; padding: 8px 8px 4px; }
.hero .logo { font-size: 3.2rem; }
.hero h1 { margin: 8px 0 4px; font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; }
.welcome-art {
  border-radius: 28px; overflow: hidden; box-shadow: var(--ombre-forte);
  background: var(--wax), linear-gradient(150deg, var(--hero-1), var(--hero-2));
}
.welcome-art svg { display: block; width: 100%; height: auto; }
.features { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; list-style: none; padding: 0; margin: 0; }
.features li { background: var(--carte); border: 1px solid var(--trait); border-radius: var(--rayon-sm); padding: 12px; font-size: .86rem; font-weight: 600; box-shadow: var(--ombre); }
.features li span { display: block; font-size: 1.5rem; margin-bottom: 4px; }
.kinds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kinds button { min-height: 88px; border-radius: 18px; border: 2px solid var(--trait); background: var(--carte); cursor: pointer; font-weight: 800; transition: border-color .15s, background .15s; }
.kinds button[aria-pressed="true"] { border-color: var(--vert); background: var(--vert-clair); }
.kinds button span { display: block; font-size: 1.8rem; }

/* ── Menu « Plus » ─────────────────────────────── */
.who { display: flex; gap: 6px; flex-wrap: wrap; }
.menu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.menu-grid a {
  display: flex; flex-direction: column; gap: 4px; padding: 14px; background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre);
  border: 1px solid var(--trait); text-decoration: none; color: inherit; min-height: 104px; transition: transform .1s;
}
.menu-grid a:active { transform: scale(.98); }
.menu-grid a .e { font-size: 1.5rem; width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; background: var(--fond); margin-bottom: 4px; }
.menu-grid a b { font-size: .98rem; }
.menu-grid a small { color: var(--doux); font-size: .78rem; }

@media (min-width: 560px) {
  .menu-grid { grid-template-columns: repeat(3, 1fr); }
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .features { grid-template-columns: repeat(4, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Mes boutiques (tableau multi-boutiques du patron) */
.shop-cards { display: grid; gap: 12px; }
.shop-cards > li.card { list-style: none; }
.shop-cards h2 { margin: 0; font-size: 1.15rem; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 12px; background: var(--fond); border: 1px solid var(--trait); }
.stat b { font-size: 1.1rem; overflow-wrap: anywhere; }
.big-num { font-size: 1.4rem; }

/* Livraisons */
ul.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
ul.plain li::before { content: "• "; color: var(--doux); }
