/* Le Comptoir — feuille de style unique.
   Inspiration : bonpourtoi.ca (bandeau turquoise arrondi, fond crème, contours noirs, cartes sombres,
   pastilles roses inclinées, boutons pilule). Police : Rubik (OFL), embarquée. */

@font-face {
  font-family: "Rubik";
  src: url("../fonts/rubik-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --teal: #00BBB4;
  --teal-dark: #008F89;
  --teal-soft: #D2F2EF;
  --cream: #FFF4E0;
  --peach: #FDEADD;
  --ink: #1D1D1B;
  --text: #2B2724;
  --muted: #6F665E;
  --yellow: #FFBD00;
  --yellow-soft: #FFE9A8;
  --pink: #FF8ABA;
  --pink-soft: #FFD6E6;
  --blue: #00A1F4;
  --orange: #FF7400;
  --wine: #7A1F2B;
  --green: #11865A;
  --red: #D93A3F;
  --white: #fff;
  --hero: var(--teal);
  --hero-ink: #fff;
  --bw: 2px;
  --r-xl: 28px;
  --r-lg: 22px;
  --r-md: 14px;
  --r-sm: 10px;
  --maxw: 1180px;
  --font: "Rubik", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --nav-h: 68px;
  color-scheme: light;
}
body.theme-cave { --hero: #7A1F2B; }
body.theme-cartes { --hero: #FF8ABA; --hero-ink: var(--ink); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--cream); color: var(--text); font-family: var(--font); font-size: 16px;
  line-height: 1.5; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-weight: 800; line-height: 1.1; margin: 0 0 .4em; letter-spacing: .1px; }
h1 { font-size: clamp(30px, 6vw, 50px); text-transform: uppercase; }
h2 { font-size: clamp(22px, 3.4vw, 30px); text-transform: uppercase; color: var(--ink); }
h3 { font-size: 19px; color: var(--ink); }
p { margin: 0 0 .8em; }
.i { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-line; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.stack > * + * { margin-top: 18px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- en-tête */
.topbar { background: var(--hero); color: var(--hero-ink); }
.topbar .wrap { display: flex; align-items: center; gap: 22px; min-height: 76px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 900;
  text-transform: uppercase; letter-spacing: .5px; line-height: .9; font-size: 20px; }
.logo-mark { width: 44px; height: 44px; border-radius: 50%; background: var(--yellow); border: var(--bw) solid var(--ink);
  display: grid; place-items: center; color: var(--ink); flex: none; }
.logo-mark svg { width: 26px; height: 26px; }
.logo small { display: block; font-size: 11px; font-weight: 600; letter-spacing: 1.4px; opacity: .85; }
.mainnav { display: flex; gap: 6px; margin-left: 12px; }
.mainnav a { text-decoration: none; font-weight: 700; padding: 9px 16px; border-radius: 999px; font-size: 16px; }
.mainnav a:hover { background: rgba(255,255,255,.18); }
.mainnav a.on { background: var(--white); color: var(--ink); }
body.theme-cartes .mainnav a.on { background: var(--ink); color: var(--white); }
.topbar .tools { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.iconbtn { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  border: var(--bw) solid currentColor; background: transparent; cursor: pointer; text-decoration: none; }
.iconbtn:hover { background: rgba(255,255,255,.18); }
.iconbtn.on { background: var(--white); color: var(--ink); border-color: var(--white); }

/* ---------------------------------------------------------------- bandeau */
.hero { background: var(--hero); color: var(--hero-ink); border-radius: 0 0 48px 48px; padding: 14px 0 72px;
  position: relative; }
.hero.tight { padding-bottom: 44px; }
.hero h1 { margin: 6px 0 8px; }
.hero .lead { font-size: 17px; max-width: 720px; opacity: .95; margin: 0; }
.hero .crumbs { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.hero .crumbs a { text-decoration: underline; text-underline-offset: 3px; }
.hero .actions { margin-top: 18px; }
.hero-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.hero-stat { background: rgba(255,255,255,.16); border: var(--bw) solid rgba(255,255,255,.55); border-radius: 999px;
  padding: 6px 14px; font-weight: 700; font-size: 14px; }
body.theme-cartes .hero-stat { background: rgba(255,255,255,.35); border-color: var(--ink); }
.hero-stat b { font-size: 17px; }

.sticker { display: inline-block; background: var(--pink); color: var(--ink); border: var(--bw) solid var(--ink);
  border-radius: 999px; padding: 5px 14px; font-weight: 800; font-size: 12.5px; text-transform: uppercase;
  letter-spacing: .4px; transform: rotate(-5deg); white-space: nowrap; }
.sticker.yellow { background: var(--yellow); }
.sticker.teal { background: var(--teal); color: var(--white); }
.sticker.white { background: var(--white); }

/* Panneau jaune qui chevauche le bandeau (recherche, filtres) */
.panel { position: relative; background: var(--yellow); border: var(--bw) solid var(--ink); border-radius: var(--r-lg);
  padding: 20px 22px; margin-top: -48px; z-index: 2; }
.panel .sticker { position: absolute; top: -16px; right: 26px; }
.panel.white { background: var(--white); }

/* ---------------------------------------------------------------- boutons & champs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  padding: 10px 20px; border-radius: 999px; border: var(--bw) solid var(--ink); background: var(--ink);
  color: var(--white); font-weight: 700; font-size: 13.5px; text-transform: uppercase; letter-spacing: .35px;
  text-decoration: none; cursor: pointer; white-space: nowrap; transition: transform .08s ease, background .15s; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn.light { background: var(--white); color: var(--ink); }
.btn.teal { background: var(--teal); color: var(--white); border-color: var(--ink); }
.btn.pink { background: var(--pink); color: var(--ink); }
.btn.yellow { background: var(--yellow); color: var(--ink); }
.btn.ghost { background: transparent; color: inherit; border-color: currentColor; }
.btn.danger { background: var(--white); color: var(--red); border-color: var(--red); }
.btn.sm { min-height: 36px; padding: 6px 14px; font-size: 12px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.hero .btn.light { border-color: var(--ink); }

label { display: block; font-weight: 700; font-size: 14px; color: var(--ink); margin: 0 0 6px; }
.field { margin-bottom: 16px; }
.field .hint { font-size: 13px; color: var(--muted); margin-top: 5px; }
input[type=text], input[type=search], input[type=url], input[type=number], input[type=password], input[type=date],
input[type=email], input:not([type]), select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border: var(--bw) solid var(--ink); border-radius: 12px;
  background: var(--white); font-size: 16px; outline: none; }
textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%),
  linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 3px var(--teal); }
input[type=color] { width: 46px; height: 46px; padding: 3px; border: var(--bw) solid var(--ink); border-radius: 12px; background: var(--white); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; font-size: 15px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--teal); margin: 1px 0 0; flex: none; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; }
.search { position: relative; }
.search .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 42px; border-radius: 999px; }

/* ---------------------------------------------------------------- blocs */
.box { background: var(--white); border: var(--bw) solid var(--ink); border-radius: var(--r-lg); padding: 24px; }
.box.flat { border-color: rgba(29,29,27,.15); }
.box.cream { background: var(--peach); }
.box > h2:first-child, .box > h3:first-child { margin-top: 0; }
.box-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.box-title h2, .box-title h3 { margin: 0; }
.sub { color: var(--teal-dark); text-transform: uppercase; font-weight: 800; font-size: 17px; letter-spacing: .2px; margin: 18px 0 8px; }
.section { margin: 34px 0; }
.page { padding-bottom: calc(var(--nav-h) + 40px); }
.two-col { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 28px; align-items: start; }
.two-col.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.two-col.wide-first { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.sidebar-sticky { position: sticky; top: 16px; }

.flash { display: flex; gap: 10px; align-items: center; border: var(--bw) solid var(--ink); border-radius: 16px;
  padding: 12px 16px; font-weight: 600; margin: 18px 0 0; background: var(--teal-soft); }
.flash.err { background: var(--pink-soft); }
.flash .x { margin-left: auto; background: none; border: 0; cursor: pointer; padding: 4px; }

.empty { text-align: center; padding: 42px 20px; }
.empty .big { font-size: 20px; font-weight: 800; color: var(--ink); margin-bottom: 6px; }

/* Pastilles */
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 11px; font-size: 12.5px;
  font-weight: 700; background: var(--teal); color: var(--ink); line-height: 1.5; white-space: nowrap; }
.pill.cat { background: var(--c, var(--teal)); color: var(--ink); }
.pill.ok { background: #BFF0D9; color: #0B5C3C; }
.pill.miss { background: var(--pink-soft); color: #8C1F4B; }
.pill.warn { background: var(--yellow-soft); color: #6B4A00; }
.pill.outline { background: transparent; border: 1.5px solid currentColor; }
.pill.dark { background: var(--ink); color: var(--white); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--teal)); display: inline-block; flex: none;
  border: 1.5px solid var(--ink); }

/* Filtres en puces */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.chip { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 6px 14px; border-radius: 999px;
  border: var(--bw) solid var(--ink); background: var(--white); font-weight: 700; font-size: 14px; cursor: pointer;
  text-decoration: none; color: var(--ink); white-space: nowrap; }
.chip.on { background: var(--ink); color: var(--white); }
.chip .n { font-size: 12px; opacity: .7; font-weight: 600; }
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.toolbar .search { flex: 1 1 260px; }
.region-select { width: auto; min-width: 180px; border-radius: 999px; }
.add-details { margin-top: 14px; }
.more-links { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 30px; }
/* Rangées qui glissent de côté : fondu au bord tant qu'il y a de la suite (classes posées par app.js) */
.fade-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
.fade-l { -webkit-mask-image: linear-gradient(to right, transparent, #000 40px);
  mask-image: linear-gradient(to right, transparent, #000 40px); }
.fade-l.fade-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent); }

/* ---------------------------------------------------------------- cartes de recettes (grille) */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 22px; margin-top: 26px; }
.rcard { position: relative; background: var(--ink); border-radius: var(--r-md); overflow: hidden; color: var(--white);
  text-decoration: none; display: flex; flex-direction: column; transition: transform .12s ease; }
.rcard:hover { transform: translateY(-3px); }
.rcard .ph { aspect-ratio: 1 / 1; background: color-mix(in srgb, var(--c, var(--teal)) 38%, var(--cream)); position: relative;
  display: grid; place-items: center; overflow: hidden; }
.rcard .ph img { width: 100%; height: 100%; object-fit: cover; }
.rcard .ph svg.glass { width: 62%; height: 62%; }
.rcard .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.rcard .title { font-weight: 800; font-size: 17px; line-height: 1.2; }
.rcard .meta { margin-top: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12.5px;
  border-top: 1px solid rgba(255,255,255,.18); padding-top: 9px; color: rgba(255,255,255,.85); }
.rcard .meta .i { width: 15px; height: 15px; }
.rcard .state-ok { color: #7BE3B6; font-weight: 700; display: inline-flex; gap: 4px; align-items: center; }
.rcard .state-miss { color: var(--pink); font-weight: 700; display: inline-flex; gap: 4px; align-items: center; }
.fav { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%; border: var(--bw) solid var(--ink);
  background: var(--white); color: var(--ink); display: grid; place-items: center; cursor: pointer; z-index: 2; padding: 0; }
.fav .i { width: 17px; height: 17px; }
.fav.on { background: var(--pink); }
.fav.on .i { fill: var(--ink); }
.rcard .origin { position: absolute; top: 12px; left: 10px; z-index: 2; }

/* ---------------------------------------------------------------- fiche recette */
.recipe-hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 34px; align-items: start; }
.recipe-photo { border-radius: var(--r-lg); overflow: hidden; border: var(--bw) solid var(--ink); aspect-ratio: 1 / 1;
  background: color-mix(in srgb, var(--c, var(--teal)) 38%, var(--cream)); display: grid; place-items: center;
  margin-top: 8px; position: relative; }
.recipe-photo img { width: 100%; height: 100%; object-fit: cover; }
.recipe-photo svg.glass { width: 58%; height: 58%; }
.wine-hero { grid-template-columns: minmax(0, 3fr) minmax(0, 8fr); }
.wine-hero .recipe-photo { aspect-ratio: 3 / 4; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: var(--bw) solid var(--ink); border-radius: 18px;
  background: var(--white); overflow: hidden; color: var(--ink); }
.facts > div { padding: 12px 10px; text-align: center; border-right: var(--bw) solid var(--ink); }
.facts > div:last-child { border-right: 0; }
.facts .k { font-size: 12px; color: var(--muted); display: flex; gap: 5px; align-items: center; justify-content: center; }
.facts .v { font-weight: 800; font-size: 15px; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.22);
  border: 1.5px solid rgba(255,255,255,.6); }
.box .tag, .tagline .tag { background: var(--peach); border-color: rgba(29,29,27,.25); color: var(--ink); }

.ings { list-style: none; margin: 0; padding: 0; }
.ing { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1.5px solid var(--teal); }
.ing:last-child { border-bottom: 0; }
.ing .st { width: 28px; height: 28px; border-radius: 50%; border: var(--bw) solid var(--teal); display: grid; place-items: center;
  flex: none; color: var(--white); background: var(--white); cursor: pointer; padding: 0; }
.ing .st .i { width: 16px; height: 16px; }
.ing.have .st { background: var(--teal); }
.ing.need .st { border-color: var(--pink); background: var(--pink-soft); color: #8C1F4B; }
.ing.always .st { border-style: dashed; background: var(--white); color: var(--teal-dark); cursor: default; }
.ing .st .when-need { display: none; }
.ing.need .st .when-have { display: none; }
.ing.need .st .when-need { display: block; }
.filebtn { position: relative; overflow: hidden; }
.filebtn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.ing .txt { flex: 1; min-width: 0; }
.ing .name { font-weight: 700; color: var(--ink); }
.ing .qty { color: var(--text); }
.ing .note { display: block; font-size: 13px; color: var(--muted); }
.ing .buy { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 6px; border-radius: 50%; }
.ing .buy.on { color: var(--orange); }
.scaler { display: inline-flex; align-items: center; gap: 4px; border: var(--bw) solid var(--ink); border-radius: 999px;
  background: var(--white); padding: 3px; }
.scaler button { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--ink); color: var(--white); cursor: pointer;
  display: grid; place-items: center; }
.scaler output { min-width: 96px; text-align: center; font-weight: 800; font-size: 14px; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps li { padding: 14px 0; border-bottom: 1.5px solid var(--teal); }
.steps li:last-child { border-bottom: 0; }
.steps .n { color: var(--teal-dark); font-weight: 800; font-size: 14px; display: block; margin-bottom: 3px; }
.steps b { color: var(--ink); }
.missing-box { border: var(--bw) solid var(--ink); background: var(--pink-soft); border-radius: 16px; padding: 12px 16px; font-weight: 600; }
.ok-box { border: var(--bw) solid var(--ink); background: #CFF5E4; border-radius: 16px; padding: 12px 16px; font-weight: 600; }

/* ---------------------------------------------------------------- formulaire recette */
.lines { display: flex; flex-direction: column; gap: 10px; }
.line { display: grid; grid-template-columns: minmax(0, 3fr) 90px 130px minmax(0, 2fr) 140px 40px; gap: 8px; align-items: start;
  background: var(--white); border: 1.5px solid rgba(29,29,27,.18); border-radius: 14px; padding: 10px; }
.line input, .line select { min-height: 42px; padding: 8px 10px; font-size: 15px; }
.line .match { grid-column: 1 / -1; font-size: 12.5px; margin-top: -2px; display: flex; gap: 6px; align-items: center; }
.line .match.known { color: var(--green); }
.line .match.new { color: #8C5A00; }
.line .rm { width: 40px; height: 42px; border-radius: 12px; border: var(--bw) solid var(--ink); background: var(--white); cursor: pointer;
  display: grid; place-items: center; }
.line-head { display: grid; grid-template-columns: minmax(0, 3fr) 90px 130px minmax(0, 2fr) 140px 40px; gap: 8px; font-size: 12.5px;
  font-weight: 700; color: var(--muted); padding: 0 11px; }
.step-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) 40px; gap: 10px; align-items: start; }
.step-row .num { width: 36px; height: 36px; border-radius: 50%; background: var(--teal); color: var(--white); font-weight: 800;
  display: grid; place-items: center; margin-top: 4px; }
.step-row .fields { display: grid; gap: 6px; }
.photo-pick { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.photo-pick .thumb { width: 110px; height: 110px; border-radius: 16px; border: var(--bw) solid var(--ink); overflow: hidden;
  background: var(--peach); display: grid; place-items: center; flex: none; }
.photo-pick .thumb img { width: 100%; height: 100%; object-fit: cover; }
.formbar { position: sticky; bottom: 14px; z-index: 5; display: flex; gap: 10px; justify-content: flex-end; align-items: center;
  flex-wrap: wrap; background: var(--white); border: var(--bw) solid var(--ink); border-radius: 999px; padding: 7px;
  margin: 24px 0 0 auto; width: fit-content; max-width: 100%; box-shadow: 0 8px 24px rgba(29,29,27,.14); }
.formbar.counter { width: auto; margin-left: 0; }
.notice { border: var(--bw) solid var(--ink); border-radius: 16px; padding: 14px 16px; background: var(--yellow-soft); }
.notice.teal { background: var(--teal-soft); }
.notice.pink { background: var(--pink-soft); }
.stars { display: inline-flex; gap: 2px; }
.stars button { background: none; border: 0; padding: 2px; cursor: pointer; color: var(--ink); }
.stars .i { width: 22px; height: 22px; }
.stars .on .i { fill: var(--yellow); }

/* ---------------------------------------------------------------- bar */
.bar-group { margin-top: 28px; }
.bar-group h2 { display: flex; align-items: center; gap: 10px; font-size: 22px; }
.bar-group h2 .count { font-size: 14px; color: var(--muted); font-weight: 600; text-transform: none; }
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.bitem { background: var(--white); border: var(--bw) solid var(--ink); border-radius: 18px; padding: 12px 14px; display: flex;
  flex-direction: column; gap: 8px; scroll-margin-top: 20px; }
.bitem.out { background: #FBF7F0; border-color: rgba(29,29,27,.35); }
.bitem .head { display: flex; gap: 10px; align-items: center; }
.bitem .name { font-weight: 800; color: var(--ink); flex: 1; min-width: 0; }
.bitem .uses { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.toggle { position: relative; width: 58px; height: 32px; border-radius: 999px; border: var(--bw) solid var(--ink); background: #E9E2D6;
  cursor: pointer; flex: none; padding: 0; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--white);
  border: var(--bw) solid var(--ink); transition: left .15s; }
.toggle.on { background: var(--teal); }
.toggle.on::after { left: 29px; }
.toggle[disabled] { cursor: default; opacity: .7; }
.bottles { display: flex; flex-direction: column; gap: 6px; }
.bottle { display: flex; gap: 8px; align-items: center; font-size: 14px; background: var(--peach); border-radius: 12px; padding: 6px 8px 6px 12px; }
.bottle .bn { flex: 1; min-width: 0; font-weight: 600; }
.bottle select { min-height: 34px; padding: 4px 30px 4px 10px; font-size: 13px; width: auto; border-width: 1.5px; background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; }
.lvl { width: 38px; height: 12px; border: 1.5px solid var(--ink); border-radius: 4px; background: var(--white); overflow: hidden; flex: none; }
.lvl span { display: block; height: 100%; background: var(--teal); }
.bitem details summary { list-style: none; cursor: pointer; font-size: 13px; font-weight: 700; color: var(--teal-dark); }
.bitem details summary::-webkit-details-marker { display: none; }
.bitem details[open] summary { margin-bottom: 8px; }
.mini-form { display: grid; gap: 8px; }
.mini-form .row input, .mini-form .row select { min-height: 40px; padding: 7px 10px; font-size: 15px; }
.cartbtn { border: 0; background: none; cursor: pointer; color: #B7AEA3; padding: 4px; }
.cartbtn.on { color: var(--orange); }
.unlock { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1.5px solid var(--teal); }
.unlock:last-child { border-bottom: 0; }
.unlock .big { font-size: 26px; font-weight: 900; color: var(--teal-dark); min-width: 44px; text-align: center; }

/* ---------------------------------------------------------------- cave */
.wines { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 24px; }
.wcard { background: var(--white); border: var(--bw) solid var(--ink); border-radius: 18px; overflow: hidden; display: grid;
  grid-template-columns: 86px minmax(0, 1fr); text-decoration: none; color: inherit; transition: transform .12s; }
.wcard:hover { transform: translateY(-2px); }
.wcard.empty-stock { opacity: .6; }
.wcard .side { background: color-mix(in srgb, var(--wc) 22%, var(--cream)); display: grid; place-items: center; border-right: var(--bw) solid var(--ink); }
.wcard .side img { width: 100%; height: 100%; object-fit: cover; }
.wcard .side svg { width: 46px; height: 118px; }
.wcard .body { padding: 12px 14px; display: flex; flex-direction: column; gap: 5px; }
.wcard .wname { font-weight: 800; color: var(--ink); line-height: 1.2; }
.wcard .wsub { font-size: 14px; color: var(--muted); }
.wcard .foot { margin-top: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding-top: 6px; }
.qty-badge { margin-left: auto; font-weight: 900; font-size: 15px; background: var(--ink); color: var(--white); border-radius: 999px;
  padding: 2px 11px; }
.qty-badge.zero { background: #CFC6BA; color: var(--ink); }
.colorbar { display: flex; height: 16px; border: var(--bw) solid var(--ink); border-radius: 999px; overflow: hidden; margin-top: 12px;
  background: var(--white); max-width: 520px; }
.colorbar span { height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13.5px; font-weight: 600; margin-top: 8px; }
.legend .dot { width: 12px; height: 12px; }
.colorcard { background: var(--white); color: var(--ink); border: var(--bw) solid var(--ink); border-radius: 18px; padding: 10px 14px 8px;
  margin-top: 16px; max-width: 540px; }
.colorcard .colorbar { margin-top: 0; max-width: none; background: var(--cream); }
.colorcard .colorbar span + span { border-left: var(--bw) solid var(--ink); }
.stock-ctrl { display: inline-flex; align-items: center; gap: 12px; border: var(--bw) solid var(--ink); border-radius: 999px;
  background: var(--white); padding: 5px; color: var(--ink); }
.stock-ctrl button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--ink); color: var(--white); cursor: pointer;
  display: grid; place-items: center; }
.stock-ctrl output { font-size: 26px; font-weight: 900; min-width: 44px; text-align: center; }
.stock-ctrl .u { font-size: 13px; font-weight: 700; margin-right: 8px; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; margin: 0; }
.kv dt { font-weight: 700; color: var(--muted); font-size: 14px; }
.kv dd { margin: 0; color: var(--ink); font-weight: 600; }
.moves { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.moves li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(29,29,27,.12); }
.moves .d { font-weight: 800; min-width: 34px; }
.moves .d.neg { color: var(--wine); }
.moves .d.pos { color: var(--green); }
.suggest { position: relative; }
.suggest-list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); background: var(--white);
  border: var(--bw) solid var(--ink); border-radius: 14px; max-height: 300px; overflow: auto; box-shadow: 0 10px 30px rgba(0,0,0,.12); }
.suggest-list button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 10px 14px; cursor: pointer;
  border-bottom: 1px solid rgba(29,29,27,.08); }
.suggest-list button:hover, .suggest-list button.act { background: var(--teal-soft); }
.suggest-list small { color: var(--muted); display: block; font-size: 12.5px; }
.refbox { border: var(--bw) dashed var(--teal-dark); background: var(--teal-soft); border-radius: 16px; padding: 12px 14px; font-size: 14px; }

/* Scanner de code-barres */
.scan { position: fixed; inset: 0; z-index: 100; background: rgba(29,29,27,.85); display: grid; place-items: center;
  padding: 16px; overflow: auto; }
/* Le formulaire de la bouteille scannée peut être plus haut que l'écran d'un téléphone : la fenêtre défile. */
.scan .inner { background: var(--white); border: var(--bw) solid var(--ink); border-radius: var(--r-lg); padding: 16px;
  width: min(460px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.scan .inner > .row.between { position: sticky; top: -16px; background: var(--white); padding: 6px 0; z-index: 1; }
.scan video { width: 100%; border-radius: 14px; background: #000; aspect-ratio: 4 / 3; object-fit: cover; }

/* ---------------------------------------------------------------- cartes invités (admin) */
.clist { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; margin-top: 24px; }
.ccard { background: var(--white); border: var(--bw) solid var(--ink); border-radius: 22px; padding: 18px; text-decoration: none;
  color: inherit; display: flex; flex-direction: column; gap: 8px; transition: transform .12s; }
.ccard:hover { transform: translateY(-2px); }
.ccard .t { font-weight: 800; font-size: 19px; color: var(--ink); }
.qrbox { background: var(--white); border: var(--bw) solid var(--ink); border-radius: var(--r-lg); padding: 20px; text-align: center; }
.qrbox svg.segno { width: 100%; max-width: 280px; height: auto; margin: 0 auto; display: block; }
.url-line { display: flex; gap: 8px; align-items: center; background: var(--peach); border-radius: 12px; padding: 8px 10px 8px 14px;
  font-size: 14px; font-weight: 600; word-break: break-all; text-align: left; }
.pick-group { margin-top: 18px; }
.pick-group h3 { display: flex; gap: 8px; align-items: center; }
.pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.pick label { display: flex; gap: 10px; align-items: center; background: var(--white); border: 1.5px solid rgba(29,29,27,.2);
  border-radius: 14px; padding: 8px 10px; cursor: pointer; font-weight: 600; margin: 0; }
.pick label:has(input:checked) { border-color: var(--ink); background: var(--teal-soft); box-shadow: inset 0 0 0 1px var(--ink); }
.pick input { width: 20px; height: 20px; accent-color: var(--ink); flex: none; }
.pick .mini { width: 38px; height: 38px; border-radius: 10px; overflow: hidden; flex: none; display: grid; place-items: center;
  background: color-mix(in srgb, var(--c, var(--teal)) 38%, var(--cream)); }
.pick .mini img { width: 100%; height: 100%; object-fit: cover; }
.pick .mini svg { width: 30px; height: 30px; }
.pick .nm { flex: 1; min-width: 0; line-height: 1.25; }
.pick .nm small { display: block; font-weight: 500; font-size: 12px; }
.counter { position: sticky; bottom: calc(var(--nav-h) + 10px); z-index: 5; }
.qrfull { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 24px; background: var(--teal); color: var(--white); }
.qrfull .card { background: var(--white); color: var(--ink); border: 3px solid var(--ink); border-radius: 32px; padding: 28px; width: min(560px, 100%); }
.qrfull svg.segno { width: 100%; height: auto; display: block; }

/* ---------------------------------------------------------------- réglages */
.set-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.list-edit { display: flex; flex-direction: column; gap: 8px; }
.list-edit form.item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.list-edit .item-fields { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.list-edit .item-fields input[type=text] { flex: 1 1 160px; width: auto; min-height: 40px; padding: 7px 12px; }
.list-edit .item-fields select { width: auto; min-height: 40px; padding: 6px 34px 6px 10px; }
.list-edit .uses { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.list-edit .btns { display: flex; gap: 4px; }
.sq { width: 40px; height: 40px; border-radius: 12px; border: var(--bw) solid var(--ink); background: var(--white); cursor: pointer;
  display: grid; place-items: center; padding: 0; color: var(--ink); }
.sq.danger { color: var(--red); border-color: var(--red); }

/* ---------------------------------------------------------------- connexion */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--teal); }
.login-col { width: min(420px, 100%); min-width: 0; display: grid; gap: 12px; }
.login .box { width: 100%; min-width: 0; overflow-wrap: anywhere; }
.login-back { justify-self: start; display: inline-flex; align-items: center; gap: 6px; color: var(--white); font-weight: 700;
  text-decoration: none; padding: 6px 2px; }
.login-back:hover { text-decoration: underline; text-underline-offset: 3px; }
.login { grid-template-columns: minmax(0, 1fr); }
.login h1 { font-size: 30px; color: var(--ink); }

/* ---------------------------------------------------------------- navigation mobile */
.bottomnav { display: none; }
dialog.modal { border: var(--bw) solid var(--ink); border-radius: var(--r-lg); padding: 22px; max-width: min(440px, calc(100vw - 32px)); background: var(--white); color: var(--text); }
dialog.modal::backdrop { background: rgba(29,29,27,.55); }
.footer { text-align: center; font-size: 13px; color: var(--muted); padding: 30px 0 10px; }

@media (max-width: 900px) {
  .two-col, .two-col.even, .recipe-hero, .wine-hero { grid-template-columns: minmax(0, 1fr); }
  .recipe-photo { max-width: 460px; }
  .wine-hero .recipe-photo { max-width: 240px; aspect-ratio: 3 / 4; }
  .sidebar-sticky { position: static; }
  .line { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; }
  .line-head { display: none; }
  .line .name-in { grid-column: 1 / -1; }
  .line .amount-in { grid-column: 1 / 2; }
  .line .unit-in { grid-column: 2 / 4; }
  .line .note-in { grid-column: 1 / -1; }
  .line .role-in { grid-column: 1 / 3; }
  .line .rm { grid-column: 3 / 4; width: 44px; }
}
@media (max-width: 760px) {
  .topbar .wrap { min-height: 64px; }
  .mainnav { display: none; }
  .logo { font-size: 17px; }
  .logo-mark { width: 38px; height: 38px; }
  .hero { border-radius: 0 0 34px 34px; padding-bottom: 64px; }
  .panel { padding: 16px; margin-top: -42px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .rcard .title { font-size: 15px; }
  .rcard .body { padding: 10px 11px 11px; }
  .rcard .meta { font-size: 11.5px; }
  .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts > div:nth-child(2) { border-right: 0; }
  .facts > div:nth-child(-n+2) { border-bottom: var(--bw) solid var(--ink); }
  .box { padding: 18px; border-radius: 20px; }
  .bottomnav { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: var(--white); border-top: var(--bw) solid var(--ink); height: calc(var(--nav-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom); }
  .bottomnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none;
    font-size: 11.5px; font-weight: 700; color: var(--muted); position: relative; }
  .bottomnav a .i { width: 24px; height: 24px; }
  .bottomnav a.on { color: var(--ink); }
  .bottomnav a.on::before { content: ""; position: absolute; top: 0; left: 22%; right: 22%; height: 4px; background: var(--teal);
    border-radius: 0 0 4px 4px; }
  .formbar { border-radius: 22px; justify-content: stretch; width: auto; margin-left: 0; bottom: calc(var(--nav-h) + 10px); }
  .formbar .btn { flex: 1; }
  /* Pastilles sur une ligne qui glisse, dans le cadre (plus de pastilles coupées par la bordure) */
  .chips, [data-scroll-row] { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
  .chips { margin-top: 10px; }
  .chips::-webkit-scrollbar, [data-scroll-row]::-webkit-scrollbar { display: none; }
  .chips > *, [data-scroll-row] > * { flex: none; }
  .chip { min-height: 36px; padding: 5px 12px; font-size: 13.5px; }
  .hero-stats { gap: 8px; margin-top: 12px; }
  .hero-stat { padding: 5px 12px; font-size: 13px; white-space: nowrap; }
  .hero-stat b { font-size: 15px; }
  .hero .actions { margin-top: 12px; gap: 8px; }
  .hero .actions .btn { padding: 9px 13px; font-size: 12.5px; gap: 6px; }
  .btn .lbl-d { display: none; }
  .toolbar { gap: 8px; flex-wrap: nowrap; }
  .toolbar .search { flex: 1 1 0; min-width: 0; }
  .toolbar .search input { min-width: 0; }
  .toolbar > .btn, .toolbar > .dropdown > .btn { padding: 10px 13px; }
  .region-select { flex: 0 1 132px; min-width: 0; padding-right: 28px; text-overflow: ellipsis; }
  .add-details { margin-top: 10px; }
  .add-details:not([open]) { display: none; }
  .recipe-photo { aspect-ratio: 4 / 3; }
  .rcard .meta .t { display: none; }
  .bitem { padding: 10px 12px; }
  .wines, .clist { grid-template-columns: minmax(0, 1fr); }
  .shelf { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .hide-m { display: none !important; }
}
@media (min-width: 761px) { .show-m { display: none !important; } }
@media print {
  .topbar, .bottomnav, .no-print, .formbar, .flash { display: none !important; }
  body { background: #fff; }
  .hero { border-radius: 0; padding: 10px 0; }
}

/* ---------------------------------------------------------------- messages éphémères */
.toast { position: fixed; z-index: 200; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom));
  display: flex; gap: 10px; align-items: center; max-width: min(560px, calc(100vw - 32px)); background: var(--ink); color: var(--white);
  border-radius: 16px; padding: 12px 16px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.toast.err { background: #8C1F4B; }
.toast .x { background: none; border: 0; color: inherit; cursor: pointer; padding: 2px; margin-left: 4px; }
@media (min-width: 761px) { .toast { bottom: 26px; } }

/* ---------------------------------------------------------------- menu déroulant */
.dropdown { position: relative; }
.dropdown > summary { list-style: none; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown-menu { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; min-width: 260px; background: var(--white);
  border: var(--bw) solid var(--ink); border-radius: 16px; padding: 6px; color: var(--ink); box-shadow: 0 12px 30px rgba(0,0,0,.18); }
.dropdown-menu button, .dropdown-menu a { display: flex; gap: 8px; align-items: center; width: 100%; text-align: left; background: none;
  border: 0; padding: 10px 12px; border-radius: 10px; cursor: pointer; font-weight: 600; text-decoration: none; font-size: 15px; }
.dropdown-menu button:hover, .dropdown-menu a:hover { background: var(--teal-soft); }
.dropdown-menu.right { left: auto; right: 0; }
.dropdown-menu button.on { background: var(--ink); color: var(--white); }

/* ---------------------------------------------------------------- page publique (invités) */
body.public { background: var(--cream); }
.pub-hero { background: var(--teal); color: var(--white); border-radius: 0 0 44px 44px; padding: 22px 0 70px; text-align: center; }
.pub-hero h1 { margin: 14px 0 6px; font-size: clamp(32px, 8vw, 56px); }
.pub-hero .lead { font-size: 17px; margin: 0; opacity: .95; }
.pub-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .6px; font-size: 15px; }
.pub-brand .logo-mark { width: 38px; height: 38px; }
.pub-hero .sticker { display: table; margin: 14px auto 0; }
.pub-main { max-width: 760px; margin-top: -44px; position: relative; padding-bottom: 40px; }
.pub-message { background: var(--yellow); border: var(--bw) solid var(--ink); border-radius: 20px; padding: 16px 18px; font-weight: 600;
  text-align: center; margin-bottom: 22px; white-space: pre-line; }
.pub-section { margin-top: 26px; }
.pub-section h2 { display: flex; gap: 10px; align-items: center; justify-content: center; margin-bottom: 14px; }
.pub-section h2 .sticker { font-size: 17px; padding: 7px 18px; transform: rotate(-3deg); }
.menu { display: flex; flex-direction: column; gap: 12px; }
.menu-item { position: relative; display: flex; gap: 14px; align-items: flex-start; background: var(--white); border: var(--bw) solid var(--ink);
  border-radius: 20px; padding: 12px; }
.menu-ph { width: 92px; height: 92px; border-radius: 14px; overflow: hidden; flex: none; display: grid; place-items: center;
  background: color-mix(in srgb, var(--c, var(--teal)) 38%, var(--cream)); border: var(--bw) solid var(--ink); }
.menu-ph img { width: 100%; height: 100%; object-fit: cover; }
.menu-ph svg.glass { width: 78%; height: 78%; }
.menu-txt { flex: 1; min-width: 0; padding-top: 2px; }
.menu-txt h3 { margin: 0 0 4px; font-size: 19px; text-transform: uppercase; letter-spacing: .2px; }
.menu-txt .vint { color: var(--muted); font-weight: 700; }
.menu-sub { margin: 0 0 4px; font-size: 14px; font-weight: 600; color: var(--muted); }
.menu-desc { margin: 0 0 6px; font-size: 15px; }
.menu-ings { margin: 0; font-size: 13.5px; color: var(--teal-dark); font-weight: 700; }
.menu-note { margin: 6px 0 0; font-size: 13.5px; font-style: italic; }
.menu-item.soldout { opacity: .55; }
.menu-item .sold { position: absolute; top: 10px; right: -6px; transform: rotate(6deg); background: var(--pink); border: var(--bw) solid var(--ink);
  border-radius: 999px; padding: 3px 12px; font-weight: 800; font-size: 12px; text-transform: uppercase; opacity: 1; }
.pub-foot { text-align: center; margin-top: 36px; font-weight: 800; font-size: 20px; color: var(--ink); }
.pub-foot .tiny { font-weight: 500; color: var(--muted); }
@media (max-width: 480px) {
  .menu-ph { width: 74px; height: 74px; }
  .menu-txt h3 { font-size: 17px; }
}

/* ---------------------------------------------------------------- carte imprimable (A5) */
body.print-page { background: #E9E2D6; }
.print-tools { display: flex; gap: 12px; align-items: center; justify-content: center; padding: 16px; flex-wrap: wrap; }
.print-card { width: 148mm; min-height: 210mm; margin: 0 auto 30px; background: var(--white); border: var(--bw) solid var(--ink);
  display: flex; flex-direction: column; overflow: hidden; }
.print-card header { background: var(--teal); color: var(--white); text-align: center; padding: 8mm 8mm 9mm; border-radius: 0 0 12mm 12mm; }
.print-card header h1 { font-size: 26pt; margin: 3mm 0 1mm; }
.print-card header p { margin: 0; font-size: 11pt; }
.print-body { padding: 5mm 9mm; flex: 1; columns: 1; }
.print-body section { margin-bottom: 4mm; break-inside: avoid; }
.print-body h2 { font-size: 13pt; margin: 2mm 0; display: inline-block; background: var(--c, var(--teal)); border: 1.5px solid var(--ink);
  border-radius: 999px; padding: 1mm 4mm; transform: rotate(-2deg); color: var(--ink); }
.print-item { padding: 1.4mm 0; border-bottom: 1px solid var(--teal); font-size: 10.5pt; }
.print-item b { display: block; text-transform: uppercase; font-size: 11pt; color: var(--ink); }
.print-item span { color: var(--muted); }
.print-foot { display: flex; gap: 5mm; align-items: center; padding: 4mm 9mm 7mm; border-top: 1.5px dashed var(--ink); font-size: 11pt; }
.print-qr { width: 34mm; flex: none; }
.print-qr svg.segno { width: 100%; height: auto; display: block; }
@media print {
  body.print-page { background: #fff; }
  .print-card { margin: 0; border: 0; width: 148mm; height: 210mm; }
  .print-card header, .print-body h2 { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Cartes-radio (genre de carte, mode de contenu) */
.pickcard { display: grid; gap: 4px; padding: 12px 14px; border: 1.5px solid rgba(29,29,27,.18); border-radius: 16px;
  background: var(--white); cursor: pointer; position: relative; }
.pickcard.on { border: var(--bw) solid var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.pickcard input { position: absolute; opacity: 0; pointer-events: none; }
.pickcard b { display: flex; gap: 8px; align-items: center; }
.pickcard b svg { width: 18px; height: 18px; }
.row.wrap { flex-wrap: wrap; }

/* Dégustations : étoiles cliquables, cœur, journal de ce qu'on a bu */
.starpick { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.star-radio { position: relative; cursor: pointer; }
.star-radio input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.star-radio span { display: inline-block; padding: 4px 8px; border-radius: 999px; border: 1.5px solid rgba(29,29,27,.18);
  color: rgba(29,29,27,.35); font-size: 13px; letter-spacing: -1px; background: var(--white); }
.star-radio input:checked + span { border: var(--bw) solid var(--ink); color: #C8850B; background: #FFF8E6; }
.star-radio input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 2px; }
.stars-inline { color: #C8850B; letter-spacing: -1px; }
.pill.fav-pill { background: #FFE3EE; border: 1.5px solid #FF8ABA; color: #8C1F4B; display: inline-flex; gap: 4px; align-items: center; }
.pill.fav-pill svg { width: 13px; height: 13px; }
.drinklog { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.drinklog li { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 14px;
  border: 1.5px solid rgba(29,29,27,.14); background: var(--white); border-left: 6px solid var(--wc, #7A1F2B); }
.drinklog .thumb { width: 42px; flex: none; display: grid; place-items: center; }
.drinklog .thumb img { width: 42px; height: 42px; object-fit: cover; border-radius: 10px; }
.drinklog .txt { display: grid; gap: 2px; min-width: 0; flex: 1 1 auto; }
.drinklog .name { font-weight: 800; text-decoration: none; color: var(--ink); }
.drinklog .sub { font-size: 12.5px; color: var(--muted); }
.drinklog .say { font-size: 13px; font-style: italic; }
.drinklog .meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 12.5px; flex: none; }
.drinklog .date { color: var(--muted); white-space: nowrap; }
@media (max-width: 560px) {
  .drinklog li { flex-wrap: wrap; }
  .drinklog .meta { flex-direction: row; align-items: center; width: 100%; }
}

/* ---------------------------------------------------------------- fusion de doublons (Mon bar) */
.merge-pick { width: 24px; height: 24px; flex: none; margin: 0 4px 0 0; accent-color: var(--ink); cursor: pointer; }
.bitem:has(.merge-pick:checked) { box-shadow: 0 0 0 3px var(--ink); }
[data-merge-toggle].on { background: var(--ink); color: var(--white); }

/* ---------------------------------------------------------------- avis express */
.avis-score { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.avis-score .n { font-size: 52px; font-weight: 900; line-height: 1; color: var(--wine); }
.avis-score .n small { font-size: 18px; font-weight: 700; color: var(--muted); }
.avis-prix { font-size: 26px; font-weight: 900; line-height: 1.1; }
.verdict { display: inline-block; border-radius: 12px; padding: 6px 12px; font-weight: 800; }
.verdict.affaire, .verdict.bon { background: #BFF0D9; color: #0B5C3C; }
.verdict.normal { background: var(--teal-soft); color: var(--teal-dark); }
.verdict.cher { background: var(--yellow-soft); color: #6B4A00; }
.verdict.tres-cher { background: var(--pink-soft); color: #8C1F4B; }
.avis-liste { display: grid; gap: 10px; }
.avis-ligne { display: flex; gap: 12px; align-items: center; text-decoration: none; color: inherit; }
.avis-ligne .n { font-size: 22px; font-weight: 900; color: var(--wine); min-width: 44px; text-align: center; }

/* Sur téléphone, un bouton au libellé long passe à la ligne plutôt que de déborder de l'écran. */
@media (max-width: 520px) { .btn { white-space: normal; text-align: center; } }

/* ---------------------------------------------------------------- administration */
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.stat-tiles .tile { background: var(--white, #fff); border: 1.5px solid rgba(29,29,27,.14); border-radius: 16px; padding: 14px; }
.stat-tiles .tile b { display: block; font-size: 28px; font-weight: 900; line-height: 1.1; }
.stat-tiles .tile span { font-size: 13px; color: var(--muted); }
.mini-chart { margin: 16px 0 0; }
.mini-chart .bars { display: flex; align-items: flex-end; gap: 2px; height: 110px; margin-top: 8px;
  border-bottom: 1.5px solid rgba(29,29,27,.25); }
.mini-chart .bar { flex: 1; height: 100%; display: flex; align-items: flex-end; cursor: default; }
.mini-chart .bar i { display: block; width: 100%; height: max(var(--h), 2px); background: var(--teal-dark);
  border-radius: 4px 4px 0 0; }
.mini-chart .bar:hover i { background: var(--ink); }
.mini-chart .axis { display: flex; justify-content: space-between; margin-top: 4px; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { text-align: left; padding: 6px 8px; border-bottom: 1px solid rgba(29,29,27,.12); vertical-align: top; }
.tbl th { font-size: 12px; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); }

/* ---------------------------------------------------------------- bandeau de la démo */
.demo-banner { background: var(--yellow); border-bottom: var(--bw) solid var(--ink); color: var(--ink); }
.demo-banner .wrap { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding-top: 8px; padding-bottom: 8px; }
.demo-banner span { flex: 1 1 220px; }

/* ---------------------------------------------------------------- sélecteur de langue FR / EN (discret) */
.lang-switch { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: 999px;
  border: 1.5px solid currentColor; font-size: 12px; font-weight: 700; letter-spacing: .5px; line-height: 1; flex: none; }
.lang-switch a { text-decoration: none; padding: 5px 7px; border-radius: 999px; opacity: .75; color: inherit; }
.lang-switch a:hover { opacity: 1; background: rgba(255,255,255,.18); }
.lang-switch a.on { opacity: 1; background: var(--ink); color: var(--white); }
.topbar .lang-switch a.on, .lang-switch.on-teal a.on { background: var(--white); color: var(--ink); }
.login-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--white); }
.lang-foot { display: flex; justify-content: center; padding-top: 0; padding-bottom: 24px; color: var(--muted); }
@media (max-width: 380px) { .topbar .lang-switch { display: none; } }
@media print { .lang-switch, .lang-foot { display: none !important; } }

/* Version papier d'une carte */
.papier { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 24px; align-items: start; }
.papier-styles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.papier-style { padding: 8px; text-align: center; }
.papier-style img { width: 100%; height: auto; aspect-ratio: 180 / 128; object-fit: cover; border-radius: 6px; display: block; margin-bottom: 6px; background: #eee; }
.papier-formats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.papier-forme { width: 54px; height: 40px; color: var(--accent, #FF8ABA); }
.papier-conseil { color: #b25a00; display: block; margin-top: 4px; }
.papier-textes { margin-top: 14px; } .papier-textes summary { cursor: pointer; font-weight: 600; margin-bottom: 8px; }
.papier-apercu { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 8px; }
.papier-cadre { background: #4a4a4a; border-radius: 10px; overflow: hidden; height: min(78vh, 900px); }
.papier-cadre iframe { width: 100%; height: 100%; border: 0; display: block; }
.papier-alerte { color: #b25a00; font-weight: 600; }
.papier-actions { flex-wrap: wrap; }
@media (max-width: 900px) {
  .papier { grid-template-columns: minmax(0, 1fr); }
  .papier-apercu { position: static; order: -1; }
  .papier-cadre { height: 62vh; }
  .papier-styles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
