/* ==========================================================
   Thème — toutes les couleurs et polices sont ici.
   Changer ces variables suffit à faire évoluer l'identité.
   ========================================================== */
:root {
  --bg: #f6f5f1;          /* blanc cassé, inspiré de DAK */
  --surface: #ffffff;
  --surface-2: #eaeae6;   /* gris chaud des vignettes produit */
  --line: #dddbd4;
  --text: #231f20;
  --muted: #77736c;
  --dek: #4a4542;         /* texte d'accroche en italique */
  --accent: #9a5a2c;      /* cuivre, assombri pour rester lisible sur fond clair */
  --star: #c08a2e;
  --danger: #b04a38;
  --tag-yellow: #f0e69f;  /* étiquettes pastel façon DAK */
  --tag-green: #c1e1c1;
  --tabbar-bg: #ece2d0;   /* sable, beige chaud de la barre d'onglets */

  --serif: 'Newsreader', 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, system-ui, sans-serif;
  --display: 'Anton', 'Inter', sans-serif; /* logo et grand titre de l'accueil */
  --brand: #8f1426; /* rouge cerise de café de la fève de l'accueil (à reporter dans img/feve.svg) */
  --logo: #c7531a; /* orange brûlé du logo Beandle */

  --gutter: 20px;
  --maxw: 560px;
  --tabbar-h: 54px;
  --radius: 2px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
h1, h2 { margin: 0; font-weight: 400; }

.view {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter) calc(var(--tabbar-h) + 40px + env(safe-area-inset-bottom));
  padding-top: env(safe-area-inset-top);
}
.muted { color: var(--muted); }

/* Petites capitales façon magazine */
.kicker, .section-title, legend, .masthead-top, .facts dt, .tabbar span, .row-meta, .stats span {
  font: 600 10.5px/1.3 var(--sans);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.kicker { color: var(--accent); display: block; }

/* ---------- En-tête de la page d'accueil ---------- */
.masthead { text-align: center; padding: 22px 0 18px; border-bottom: 1px solid var(--text); }
.masthead-top { display: flex; justify-content: space-between; color: var(--muted); padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.logo { font: italic 400 64px/1 var(--serif); letter-spacing: -.02em; margin: 18px 0 6px; }
.tagline { font: italic 15px var(--serif); color: var(--muted); margin: 0; }

/* Barre de recherche façon magazine : pas de cadre, un simple trait d'encre dessous, texte en italique */
.searchbar, .search-field {
  display: flex; align-items: center; gap: 10px;
  margin: 18px 0 6px; padding: 10px 0 9px;
  border-bottom: 2px solid var(--text);
  color: var(--dek); font: italic 400 19px/1.3 var(--serif);
}
.searchbar svg, .search-field svg { flex: none; }
.searchbar > a { flex: 1; display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
/* Bouton « scanner un paquet » au bout des barres de recherche */
.scan-btn { display: flex; padding: 2px 0 2px 10px; border-left: 1px solid var(--line); color: var(--text); cursor: pointer; }
.scan-btn.scan-gallery { border-left: 0; padding-left: 4px; }
.form .photo-pick { display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; color: var(--muted); font-size: 14px; cursor: pointer; }
.photo-pick svg { width: 20px; height: 20px; }
.scan-status { display: flex; align-items: center; gap: 10px; padding: 24px 0; color: var(--muted); }
.scan-note { margin: -14px 0 0; font-size: 12px; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--text); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.auto-filled { background: color-mix(in srgb, #e0ad2a 14%, var(--surface)) !important; }
.scan-title { margin: 16px 0 4px; font-weight: 600; }
.search-field input { flex: 1; min-width: 0; background: none; border: 0; padding: 0; color: var(--text); font: inherit; outline: none; }
.search-field input::placeholder { color: var(--muted); }

/* ---------- Accueil ---------- */
/* En-tête de l'accueil : le nom à gauche, le grand en bonnet juste à sa droite (pieds au niveau du bas
   des lettres) ; partager et installer en haut à droite */
.home-top { position: relative; display: flex; flex-direction: column; align-items: flex-start; padding: 30px 0 12px; }
.home-logo { display: flex; align-items: flex-end; gap: 16px; margin: 0; }
.home-logo .wordmark { margin: 0 0 2px; font-size: 54px; line-height: .85; letter-spacing: .06em; white-space: nowrap; }
.pote { display: block; pointer-events: none; }
.pote svg { display: block; width: 100%; height: auto; }
.pote-grand { width: 50px; } .pote-grain { width: 46px; } .pote-petite { width: 74px; }
.home-top .icon-btn { position: absolute; top: 14px; right: -6px; }
.home-top .share-btn { right: 30px; margin: 0; }
.home-top .share-btn:last-child { right: -6px; } /* appli déjà installée : pas de bouton d'installation */
.install-btn svg { width: 22px; height: 22px; }
.wordmark { font: 400 30px/1 var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--logo); margin-top: 6px; }
.hero { padding: 22px 0 4px; }
.hero h1 { font: 400 44px/1.04 var(--display); letter-spacing: -.01em; }
.hero h1 em { font-style: italic; font-weight: 700; }
.hero-lead { margin: 0; font: 400 20px/1.35 var(--serif); color: var(--text); }
.hero .searchbar { margin-top: 22px; }

/* Carrousel horizontal de cartes produit */
.carousel { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter) 6px; scroll-padding-inline: var(--gutter); scrollbar-width: none; }
.carousel::-webkit-scrollbar { display: none; }
.card { flex: 0 0 62%; max-width: 240px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 3px; }
.card-media { position: relative; display: block; margin-bottom: 8px; }
.card-media .cover { aspect-ratio: 4 / 5; }
.card-media .cover-name { font-size: 26px; }
.tags { position: absolute; top: 8px; left: 8px; z-index: 2; display: flex; gap: 4px; flex-wrap: wrap; }
.tag { font: 600 9px var(--sans); letter-spacing: .08em; text-transform: uppercase; padding: 4px 7px; border-radius: 999px; color: var(--text); }
.tag-yellow { background: var(--tag-yellow); }
.tag-green { background: var(--tag-green); }
.card-roaster { font: 600 10px var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.card-name { font: 400 21px/1.15 var(--serif); }
.card-notes { font: italic 14px var(--serif); color: var(--muted); }
.card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; font-size: 13px; }
.card-foot b { font-weight: 600; }

/* Grille des torréfacteurs */
.roaster-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
/* « Quoi de neuf » : cartes qui défilent à l'horizontale (dernier article, café, torréfacteur) */
.news-rail { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter) 4px; scroll-padding-inline: var(--gutter); scrollbar-width: none; }
.news-rail::-webkit-scrollbar { display: none; }
.news-card { flex: 0 0 76%; scroll-snap-align: start; display: flex; gap: 12px; align-items: center; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: inherit; }
.news-card .news-cover, .news-img { flex: none; width: 52px; height: 66px; border-radius: 6px; object-fit: cover; background: var(--surface-2); }
.news-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.news-body b { font: 400 18px/1.2 var(--serif); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.news-body .muted { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roaster-card { display: flex; flex-direction: column; gap: 4px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; } /* seules cartes aux coins arrondis */
.roaster-card b { font: 400 18px/1.15 var(--serif); margin-top: 6px; }
.roaster-card .muted { font-size: 12px; }
.roaster-thumbs { display: flex; gap: 4px; }
.cover-mini { flex: 1; aspect-ratio: 4 / 5; padding: 2px; }
.cover-mini .cover-roaster, .cover-mini .cover-origin, .cover-mini .cover-name { display: none; }
.cover-mini::after { display: none; }

.invite p { margin: 0; font: italic 18px/1.45 var(--serif); color: var(--dek); }

/* ---------- Sections ---------- */
.section { margin-top: 34px; }
.section-title {
  position: relative; color: var(--text); padding-bottom: 10px; margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 12px;
}
/* Petit trait de couleur sous chaque titre de section */
.section-title::after { content: ''; position: absolute; left: 0; bottom: -2px; width: 34px; height: 3px; border-radius: 3px; background: var(--brand); }
.section:nth-of-type(3n+2) .section-title::after { background: #d9a520; }
.section:nth-of-type(3n) .section-title::after { background: #5e9a6a; }
.section-title small { color: var(--muted); font-size: inherit; letter-spacing: inherit; font-weight: 400; }

.page-head { padding: 26px 0 8px; }
.page-head h1 { font: 400 38px/1.05 var(--serif); letter-spacing: -.01em; }
.page-head p { margin: 8px 0 0; }

/* ---------- Visuel produit ---------- */
.cover { position: relative; overflow: hidden; background: var(--surface-2); border-radius: var(--radius); }
.cover-photo { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: contain; background: var(--surface-2); }
/* Petites vignettes : la photo remplit tout le cadre (pas de bandes de couleur autour du fond de la photo) */
.cover-thumb .cover-photo, .cover-lib .cover-photo, .cover-rail .cover-photo, .cover-mini .cover-photo { object-fit: cover; }
.cover-label {
  background:
    linear-gradient(160deg, rgba(255,255,255,.06), rgba(0,0,0,.35)),
    var(--label);
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; padding: 12px; color: #f3ead9;
}
.cover-label::after { content: ''; position: absolute; inset: 8px; border: 1px solid rgba(243,234,217,.25); pointer-events: none; }
.cover-roaster { font: 600 9px var(--sans); letter-spacing: .2em; text-transform: uppercase; opacity: .8; }
.cover-name { font: italic 400 28px/1.05 var(--serif); margin: 10px 0; }
.cover-origin { font: 500 9px var(--sans); letter-spacing: .18em; text-transform: uppercase; opacity: .7; }

.cover-hero { aspect-ratio: 4 / 3; margin-bottom: 18px; }
.cover-hero .cover-name { font-size: 40px; }
.cover-thumb { width: 56px; height: 72px; flex: none; padding: 4px; }
.cover-thumb .cover-roaster, .cover-thumb .cover-origin { display: none; }
.cover-thumb .cover-name { font-size: 11px; margin: 0; }
.cover-thumb::after { inset: 3px; }
/* Avis accompagnés de la miniature du café */
a.with-thumb { display: flex; align-items: flex-start; gap: 14px; }
.with-thumb > span { flex: 1; min-width: 0; }

/* ---------- À la une ---------- */
.feature { display: block; }
.feature-title { display: block; font: 400 34px/1.05 var(--serif); margin: 6px 0 8px; }
.feature-dek { display: block; font: italic 17px/1.45 var(--serif); color: var(--dek); }
.feature-score { display: flex; align-items: center; gap: 8px; margin-top: 12px; color: var(--muted); font-size: 13px; }
.feature-score b { color: var(--text); }

/* ---------- Listes ---------- */
.list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row-rank { font: italic 26px var(--serif); color: var(--muted); width: 18px; text-align: center; }
.row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-title { font: 400 20px/1.15 var(--serif); }
.row-meta { color: var(--muted); font-size: 9.5px; font-weight: 500; }
.row-score { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.row-score b { font: 400 22px/1 var(--serif); }
.row-score small { color: var(--muted); font-size: 11px; }

.meter { display: flex; gap: 3px; margin: 2px 0; }
.meter i { flex: 1; height: 4px; background: linear-gradient(90deg, var(--accent) var(--f), var(--surface-2) var(--f)); }

.see-all { color: var(--muted); font-weight: 500; text-decoration: underline; }
.sort { flex-direction: row; align-items: center; gap: 10px; margin-top: 10px; font-size: 12px; }
.sort select { width: auto; flex: 1; padding: 9px 8px; font-size: 13px; }

/* Recettes */

/* Choix « Créer un compte / J'ai déjà un compte » */
.seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: var(--radius); margin-top: 18px; overflow: hidden; }
.seg a { text-align: center; padding: 10px 6px; font-size: 13px; color: var(--muted); }
.seg a.on { background: var(--text); color: var(--bg); }
.small { font-size: 12px; }
.btn:disabled { opacity: .5; cursor: wait; }

/* Carnet de recettes perso */
/* Swipe vers la gauche sur une recette : le bouton rouge se découvre derrière la carte */
.photo-drop.small { aspect-ratio: auto; height: 140px; }
.photo-drop.small img { object-fit: contain; background: var(--surface-2); }
.link-btn.inline { display: inline-block; margin: 10px 0 0; }
.section-title a { color: inherit; }
.menu-link { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); font: 400 20px var(--serif); }
/* « Se déconnecter » dans le menu du profil, comme un lien */
.logout-link { width: 100%; background: none; border-width: 0 0 1px; color: var(--text); text-align: left; cursor: pointer; }
.logout-link .muted { font: 12px var(--sans); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 55%; }
.menu-link .muted { font: 13px var(--sans); }
.section .btn-ghost { margin-top: 14px; }

/* Note qualité-prix */
/* Cœurs (1 à 3) et grain d'or */
.hearts-mini { display: inline-flex; align-items: center; gap: 1px; color: var(--brand); font-size: 13px; line-height: 1; }
.hearts-mini i { font-style: normal; }
.gold-bean { width: 16px; height: 16px; flex: none; margin-left: 3px; }
.heart-total { font: 400 20px/1 var(--serif); color: var(--brand); white-space: nowrap; }
.heart-big { color: var(--brand); }
.gold-count { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: #8a6410; }
.gold-count .gold-bean { margin: 0; width: 14px; height: 14px; }
.rating-big .label, .price-strip .label { font: 600 10.5px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.gold-line { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: #8a6410; }
.gold-line .gold-bean { width: 20px; height: 20px; margin: 0; }
.price-strip { display: flex; align-items: baseline; gap: 10px; padding: 0 0 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.price-strip b { font: 400 26px var(--serif); }
.price-strip .muted { font-size: 12px; }
/* Sans bloc de notes (avis masqués), le prix suit directement l'en-tête du café */
.product-head + .price-strip { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }

/* Bloc facultatif repliable (recette dans l'avis) */

/* Saisie qualité-prix */
.qp-input { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.qp-input input { display: none; }
.qp-input span { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 10px 2px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 10.5px; line-height: 1.2; color: var(--muted); cursor: pointer; min-height: 72px; }
.qp-input span b { font: 400 20px/1 var(--sans); color: var(--brand); letter-spacing: 1px; }
.gold-toggle { display: block; margin-top: 10px; }
.gold-toggle input { display: none; }
.gold-toggle > span { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: var(--radius); cursor: pointer; }
.gold-toggle .gold-bean { width: 30px; height: 30px; margin: 0; filter: grayscale(1) opacity(.45); transition: filter .2s; }
.gold-toggle b { display: block; font-size: 14px; }
.gold-toggle small { color: var(--muted); font-size: 12px; }
.gold-toggle input:checked + span { border: 1px solid #e0ad2a; background: #fbf1d2; }
.gold-toggle input:checked + span .gold-bean { filter: none; }
.qp-input input:checked + span { background: var(--text); border-color: var(--text); color: var(--bg); }
.qp-input input:checked + span b { color: var(--bg); }
legend small { float: right; font-weight: 400; letter-spacing: .04em; text-transform: none; font-size: 12px; }

/* ---------- Chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px;
  font-size: 13px; color: var(--text); background: transparent; cursor: pointer;
}
.chip small { color: var(--muted); margin-left: 4px; }
.chip.static { cursor: default; }
.chip.toggle input { display: none; }
.chip.toggle:has(input:checked) { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ---------- Citations (derniers avis) ---------- */
.quote { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); }
.quote-text { display: block; font: italic 19px/1.4 var(--serif); }
.quote-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; color: var(--muted); }
.quote-meta b { color: var(--text); font-weight: 500; }
.quote-meta:first-child { margin-top: 0; }

/* ---------- Fiche café ---------- */
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; }
.back { color: var(--muted); font-size: 14px; }
.icon-btn { background: none; border: 0; color: var(--text); padding: 6px; cursor: pointer; }
/* Bouton « partager » : dans l'en-tête quand la page en a un, sinon posé en haut à droite */
.topbar .share-btn { margin: -6px -6px -6px auto; }
.view { position: relative; }
.share-float { position: absolute; top: calc(env(safe-area-inset-top) + 22px); right: calc(var(--gutter) - 6px); z-index: 2; }

/* Navigation entre les cafés d'un même torréfacteur */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -6px 0 14px; }
.pager-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 400 22px/1 var(--serif); cursor: pointer; }
.pager-mid { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pager-dots { display: flex; gap: 6px; }
.pager-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.pager-dots i.on { background: var(--text); }
.pager-label { font-size: 11px; color: var(--muted); }
.slide-from-right { animation: slide-in-right .28s ease-out; }
.slide-from-left { animation: slide-in-left .28s ease-out; }
@keyframes slide-in-right { from { opacity: 0; transform: translateX(40px); } }
@keyframes slide-in-left { from { opacity: 0; transform: translateX(-40px); } }
@media (prefers-reduced-motion: reduce) { .slide-from-right, .slide-from-left { animation: none; } }

.product-head h1 { font: 400 42px/1.02 var(--serif); letter-spacing: -.01em; margin: 6px 0 6px; }
.product-sub { margin: 0; color: var(--muted); }
.product-notes { margin: 10px 0 0; font: italic 17px var(--serif); }

.rating-block { display: flex; gap: 22px; align-items: center; margin: 24px 0 16px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.rating-big { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; font-size: 12px; }
.rating-num { font: 400 54px/1 var(--serif); }
.rating-none { margin: 0; font: italic 16px var(--serif); }

.dek { font: italic 19px/1.5 var(--serif); color: var(--dek); margin: 28px 0 0; }


.facts { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.facts dt { color: var(--muted); margin-bottom: 2px; }
.facts dd { margin: 0; font: 17px var(--serif); }
.buy { margin-top: 22px; }

.review { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); }
.review header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.review header b { font-weight: 600; }
.review header .muted { font-size: 12px; }
.review p { margin: 8px 0 0; font: 17px/1.45 var(--serif); }
.review-notes { margin-top: 6px; font-size: 12px; color: var(--accent); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-block; text-align: center; cursor: pointer;
  background: var(--text); color: var(--bg); border: 1px solid var(--text);
  padding: 14px 20px; border-radius: var(--radius);
  font: 600 12px var(--sans); letter-spacing: .14em; text-transform: uppercase;
}
.btn-block { display: block; width: 100%; }
.btn-ghost { background: transparent; color: var(--text); }
.link-btn { display: block; margin: 18px auto 0; background: none; border: 0; color: var(--muted); font: 12px var(--sans); text-decoration: underline; cursor: pointer; }

/* ---------- Formulaires ---------- */
.form { display: flex; flex-direction: column; gap: 22px; margin-top: 12px; }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
legend { color: var(--muted); padding: 0 0 10px; width: 100%; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
input, select, textarea {
  width: 100%; background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; font: 16px var(--sans); /* 16px évite le zoom auto sur iOS */
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--muted); }
textarea { font-family: var(--serif); font-size: 17px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
/* Ajouter un café : cafés déjà connus proposés sous le champ « Nom » (anti-doublon) */
.suggest-wrap { position: relative; }
.suggest { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, .12); overflow: hidden; }
.suggest-head { margin: 0; padding: 10px 12px 6px; font-size: 12px; color: var(--muted); }
.suggest-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; color: var(--text); border-top: 1px solid var(--line); }
.suggest-item .muted { font-size: 13px; }
.suggest-item:hover, .suggest-item.active { background: var(--surface-2); }
.suggest-none { display: block; width: 100%; padding: 10px 12px; border: 0; border-top: 1px solid var(--line);
  background: none; color: var(--muted); font: 14px var(--sans); text-align: left; cursor: pointer; }
.hint { font-size: 12px; color: var(--muted); margin: -12px 0 0; font-style: italic; }

.filters { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 10px; }
.filters select { padding: 9px 8px; font-size: 13px; }
.result-count { color: var(--muted); font-size: 12px; margin: 16px 0 0; }


/* Photo */
.photo-drop {
  position: relative; aspect-ratio: 4 / 3; border: 1px dashed var(--muted); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: pointer;
}
.photo-drop input { display: none; }
.photo-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.photo-empty svg { width: 34px; height: 34px; }
.photo-drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-drop.has-photo { border-style: solid; }

/* Profil */
.profile-head { display: flex; align-items: center; gap: 16px; }
.avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font: italic 30px var(--serif); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 18px; }
.stats div { display: flex; flex-direction: column; align-items: center; padding: 14px 0; }
.stats div + div { border-left: 1px solid var(--line); }
.stats b { font: 400 28px var(--serif); }
.stats span { color: var(--muted); }

.empty { text-align: center; padding: 40px 0; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.empty p { margin: 0; font: italic 18px var(--serif); }
.soon { opacity: .8; }

/* ---------- Barre d'onglets ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: center;
  background: var(--tabbar-bg);
  border-top: 1px solid #dccfb6;
  /* Sur iPhone, on rogne un peu la marge de la barre d'accueil pour garder une barre basse */
  padding-bottom: max(4px, calc(env(safe-area-inset-bottom) - 14px));
}
.tabbar a {
  flex: 1; max-width: 112px; height: var(--tabbar-h);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: #7a6a55;
}
.tabbar span { font-size: 8.5px; letter-spacing: .06em; }
@media (max-width: 360px) { .tabbar span { font-size: 7.5px; letter-spacing: 0; } }
.tabbar a { position: relative; }
.tabbar a.active { color: var(--brand); }
.tabbar a.active::before { content: ''; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand); }
.tabbar .tab-add svg { color: var(--accent); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: var(--radius);
  font-size: 13px; transition: .25s; z-index: 20; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.link-btn.danger { color: var(--danger); }

/* Présentation de l'app sur l'accueil : sobre, façon sommaire de magazine */

/* ---------- Avis d'experts ---------- */
.article-card { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.article-card img { width: 84px; height: 104px; flex: none; object-fit: cover; border-radius: var(--radius); background: var(--surface-2); }
.article-card > span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.article-card-title { font: 400 22px/1.15 var(--serif); }
.article-byline { font-size: 12px; color: var(--muted); }
.article-byline b { color: var(--text); font-weight: 600; }
.article { padding-top: 6px; }
.article h1 { font: 400 36px/1.08 var(--serif); letter-spacing: -.01em; margin: 6px 0 0; }
.article .dek { margin: 14px 0 0; }
.article > .article-byline { margin: 14px 0 0; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.article-photo { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); background: var(--surface-2); margin: 18px 0 4px; }
.article p:not([class]) { font: 400 19px/1.6 var(--serif); margin: 16px 0 0; }
.article h2 { font: 600 11px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 28px 0 0; }

/* ---------- Bibliothèque ---------- */
.product-actions { display: flex; gap: 10px; }
.product-actions .btn { flex: 1; padding-left: 10px; padding-right: 10px; }
.lib-btn.on { border-color: var(--text); }
.lib-btn:disabled { opacity: 1; cursor: default; }
.lib-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; color: inherit; text-decoration: none; }
.lib-head > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lib-head b { font: 400 20px/1.2 var(--serif); }
.lib-meta { font-size: 12px; }
/* Résumé de « Mes cafés » sur l'accueil : chiffres puis une rangée de cafés qui défile */
.lib-summary { margin: 0 0 12px; color: var(--muted); }
.lib-summary b { color: var(--text); font: 400 20px var(--serif); }
.lib-summary i { margin: 0 8px; font-style: normal; }
.lib-rail { display: flex; gap: 12px; overflow-x: auto; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter) 6px; scrollbar-width: none; }
.lib-rail::-webkit-scrollbar { display: none; }
.lib-rail-item { flex: none; width: 96px; display: flex; flex-direction: column; gap: 4px; color: inherit; text-decoration: none; font-size: 12px; }
.cover-rail { aspect-ratio: 4 / 5; padding: 5px; }
.cover-rail .cover-roaster, .cover-rail .cover-origin { display: none; }
.cover-rail .cover-name { font-size: 12px; margin: 0; }
.lib-rail-name { font-size: 13px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Coups de cœur au-dessus des recommandations (page Chercher) */
.loved { margin: 18px 0 6px; }
.loved .section-title { margin-bottom: 10px; }
.reco-title { margin: 22px 0 4px; }
.loved .lib-rail-item { width: 88px; }
.loved .hearts-mini { font-size: 11px; color: var(--brand); letter-spacing: 1px; }
.saved-line { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.saved-line b { color: var(--text); font-weight: 600; }
.avatar-sm { width: 44px; height: 44px; flex: none; font-size: 20px; }
.member-row .row-score b { font: 400 22px var(--serif); }
.member-link { color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
/* ---------- Forum ---------- */
.topic-row .row-score b { font: 400 22px var(--serif); }
.forum-body p { margin: 0 0 12px; font: 400 18px/1.5 var(--serif); }
.forum-post { padding: 14px 0; border-bottom: 1px solid var(--line); }
.forum-post .forum-body p { font-size: 17px; }
.forum-post .byline, .page-head .byline { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.byline .link-btn { font-size: 13px; }
.discuss-link { display: inline-block; margin-top: 8px; }
.byline .link-btn.inline { margin: 0; }
.community { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.community-card { display: flex; flex-direction: column; gap: 6px; padding: 16px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: inherit; text-decoration: none; }
.community-card b { font: 400 22px var(--serif); }
.community-card span { font-size: 13px; }
/* ---------- Connexion Google / Apple, pseudo ---------- */
.oauth { margin-top: 18px; }
.oauth-btn { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 10px; }
.oauth-btn svg { width: 18px; height: 18px; }
.oauth-or { display: flex; align-items: center; gap: 10px; margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.oauth-or::before, .oauth-or::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.rename { margin-top: 16px; }
.rename label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.rename-row { display: flex; gap: 8px; }
.rename-row input { flex: 1; min-width: 0; }
/* ---------- Ma bibliothèque (onglet Mes cafés) et notes perso ---------- */
.lib-title h1 { font-size: 40px; }
.lib-count { margin: 6px 0 0; color: var(--muted); }
.lib-count b { color: var(--text); font: 400 22px var(--serif); }
.lib-card { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.lib-card-cover { flex: none; text-decoration: none; }
.cover-lib { width: 56px; height: 72px; flex: none; padding: 4px; }
.cover-lib .cover-roaster, .cover-lib .cover-origin { display: none; }
.cover-lib .cover-name { font-size: 11px; margin: 0; }
.lib-card-body { flex: 1; min-width: 0; }
.lib-card-info { display: flex; flex-direction: column; gap: 2px; color: inherit; text-decoration: none; }
.lib-card-info b { font: 400 19px/1.2 var(--serif); }
.lib-card-info .muted { font-size: 12.5px; }
/* « + Écrire une note perso » et « Retirer » sur une seule ligne ; une note écrite passe en dessous */
.lib-card .note-slot { display: inline-block; margin: 6px 14px 0 0; font-size: 13px; }
.lib-card .note-slot:has(.my-note, .note-form) { display: block; margin-right: 0; }
.lib-card .my-note { padding: 8px 10px; }
.lib-card .my-note p { font-size: 15px; line-height: 1.35; margin-bottom: 2px; }
.lib-remove { display: inline-block; margin-top: 6px; padding: 0; color: var(--muted); font-size: 13px; }
.lib-remove[data-armed] { color: var(--danger); }
.note-slot { margin-top: 10px; }
.my-note { padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.my-note .label { display: block; margin-bottom: 4px; font: 600 10.5px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.my-note p { margin: 0 0 6px; font: italic 400 17px/1.45 var(--serif); }
.my-note .link-btn.inline { margin: 0; }
.note-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.note-actions { display: flex; gap: 10px; margin-top: 10px; }
.note-actions .btn { flex: 1; }
.note-slot > .link-btn.inline { margin: 0; padding: 0; }

/* ---------- Notes privées et recommandations « Pour toi » ---------- */
.match { font: 400 20px/1 var(--serif); color: var(--brand); white-space: nowrap; }
.forme-block { margin: 24px 0 16px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.forme-block .label { display: block; margin-bottom: 8px; font: 600 10.5px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.forme-block .label small { font-weight: 400; letter-spacing: .04em; text-transform: none; }
.forme-text { margin: 0; font: italic 17px/1.45 var(--serif); color: var(--dek); }
.forme-text a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
.forme-match { display: flex; align-items: center; gap: 14px; }
.match-big { font: 400 46px/1 var(--serif); color: var(--brand); white-space: nowrap; }
.forme-match .muted { font-size: 13px; line-height: 1.4; }
.forme-mine { display: flex; align-items: center; gap: 10px; font: italic 17px var(--serif); }
.forme-mine .hearts-mini { font-size: 20px; }
.row-meta.reco-why { font: italic 14px/1.35 var(--serif); letter-spacing: 0; text-transform: none; color: var(--dek); }
.invite-text { margin: 0; font: italic 17px/1.45 var(--serif); color: var(--dek); }
.section-title small { font: 400 12px var(--sans); }
.match { font-variant-numeric: tabular-nums; }
.match-big small { font: 400 15px var(--sans); color: var(--muted); margin-left: 2px; }
.forme-detail { display: flex; flex-direction: column; gap: 4px; }
.forme-rel { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; }
.rel { display: inline-flex; gap: 3px; }
.rel i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.rel-1 i:nth-child(-n+1), .rel-2 i:nth-child(-n+2), .rel-3 i:nth-child(-n+3), .rel-4 i { background: var(--brand); }
.row-score .rel { margin-top: 4px; }
.reco-legend { display: flex; align-items: center; gap: 6px; margin: -4px 0 4px; font-size: 12px; color: var(--muted); }


/* Note de 1 à 5 cœurs : on touche un cœur, ceux d'avant se remplissent */
.form .heart-rate { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 6px; }
.form .heart-rate input { display: none; }
.form .heart-rate label { display: block; margin: 0; padding: 0; font: 400 42px/1 var(--sans); color: #d9cfc4; opacity: 1; cursor: pointer; transition: color .15s; }
.form .heart-rate input:checked ~ label, .form .heart-rate label:hover, .form .heart-rate label:hover ~ label { color: var(--brand); }
.heart-label { margin: 6px 0 0; font: italic 16px var(--serif); color: var(--dek); }

/* ---------- « Comment ça marche » : les 3 étapes de l'accueil + page dédiée ---------- */
.how { margin-top: 18px; }
/* Les étapes sont repliées : « Comment ça marche ? » les déroule */
/* « Comment ça marche ? » : la petite ronde surgit de derrière une ligne avec sa bulle ; on la touche
   pour déplier les étapes (elle se cache alors à moitié, tout contente) */
.how-fold { --pour: var(--accent); }
.how-fold summary { display: flex; align-items: flex-end; gap: 2px; padding: 0; border-bottom: 1.5px solid var(--dek); cursor: pointer; list-style: none; -webkit-tap-highlight-color: transparent; }
.how-fold summary::-webkit-details-marker { display: none; }
.how-peek { width: 72px; height: 64px; margin-left: 10px; overflow: hidden; flex: none; }
.how-peek svg { display: block; width: 72px; height: auto; transform: translateY(100%); animation: how-peek .7s cubic-bezier(.3, 1.5, .5, 1) .2s forwards, how-hop 5s 2.5s infinite; }
@keyframes how-peek { to { transform: translateY(12%); } }
@keyframes how-hop { 0%, 86%, 100% { transform: translateY(12%) rotate(0); } 90% { transform: translateY(0) rotate(-6deg); } 94% { transform: translateY(8%) rotate(4deg); } }
.how-fold[open] .how-peek svg { animation: none; transform: translateY(40%); transition: transform .35s ease; }
/* Bulle dessinée à la main : contour fin et un peu irrégulier, texte manuscrit */
.how-bubble { position: relative; isolation: isolate; margin: 0 0 36px 2px; padding: 8px 18px 14px 20px; font: 400 20px/1 'Patrick Hand', var(--serif); color: var(--text); white-space: nowrap;
  opacity: 0; transform: scale(.4) rotate(-2deg); transform-origin: left bottom; animation: how-bubble .4s cubic-bezier(.3, 1.6, .5, 1) .7s forwards; }
.how-bubble svg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; fill: var(--surface); stroke: var(--dek); stroke-width: 1.4; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.how-bubble svg path { vector-effect: non-scaling-stroke; }
@keyframes how-bubble { to { opacity: 1; transform: rotate(-2deg); } }
.how-fold[open] .how-bubble::after { content: ' ×'; color: var(--muted); }
.how-fold summary:active .how-peek svg { transform: translateY(0); }
/* Les étapes : le fil se remplit de café de haut en bas, chaque pastille se colore à son passage */
.how-pour { position: relative; list-style: none; margin: 16px 0 0; padding: 4px 0 0; }
.how-pour::before, .how-pour::after { content: ''; position: absolute; left: 13px; top: 18px; bottom: 34px; width: 1.5px; border-radius: 2px; background: var(--line); }
.how-pour::after { background: var(--pour); transform-origin: top; transform: scaleY(0); }
.how-fold[open] .how-pour::after { animation: how-fill 1.2s .35s cubic-bezier(.4, 0, .2, 1) forwards; }
@keyframes how-fill { to { transform: scaleY(1); } }
.how-pour li { position: relative; display: grid; grid-template-columns: 28px 1fr; column-gap: 14px; padding-bottom: 18px; opacity: 0; }
.how-fold[open] .how-pour li { animation: how-step .5s calc(.35s + var(--i) * .45s) ease-out forwards; }
@keyframes how-step { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
.how-pour b { position: relative; z-index: 1; display: grid; place-items: center; width: 22px; height: 22px; margin: 2px 3px 0; border-radius: 50%; border: 1.5px solid var(--line); background: var(--bg); color: var(--muted); font: 400 15px/1 'Patrick Hand', var(--sans); }
.how-fold[open] .how-pour b { animation: how-dot .35s calc(.55s + var(--i) * .45s) ease-out forwards; }
@keyframes how-dot { 50% { transform: scale(1.18); } to { border-color: var(--pour); background: var(--pour); color: #fff; } }
.how-pour li > span { display: flex; flex-direction: column; gap: 2px; padding-top: 3px; font: 400 14px/1.45 var(--sans); color: var(--muted); }
.how-pour strong { font: 400 17px/1.3 var(--serif); color: var(--text); }
@media (prefers-reduced-motion: reduce) { .how-fold *, .how-fold *::before, .how-fold *::after { animation-duration: .01s !important; animation-delay: 0s !important; transition: none !important; } }
.how-link { display: flex; align-items: center; gap: 6px; margin: 0; padding: 4px 0 0; color: var(--pour); font: 400 14px/1.3 var(--sans); text-decoration: none; }
.how-link svg { width: 38px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.how-link:active svg, .how-link:hover svg { transform: translateX(4px); }
.how-cta { margin-top: 18px; }
.how-steps { list-style: none; margin: 8px 0 0; padding: 0; counter-reset: step; border-top: 1px solid var(--line); }
.how-steps li { counter-increment: step; display: grid; grid-template-columns: 30px 1fr; column-gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.how-steps li::before { content: counter(step); grid-row: span 2; font: 400 28px/1 var(--serif); color: var(--brand); }
.how-steps b { font: 400 19px/1.25 var(--serif); }
.how-steps span { margin-top: 3px; font-size: 14px; line-height: 1.45; color: var(--dek); }
.how-tips { display: grid; gap: 10px; margin-top: 16px; }
.how-tip { display: flex; gap: 12px; margin: 0; padding: 12px 14px; background: var(--tabbar-bg); border-radius: 10px; font-size: 14px; line-height: 1.45; color: var(--dek); }
.how-tip-ico { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--surface); color: var(--brand); }
.how-tip-ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.how-tip b { display: block; margin-bottom: 2px; font: 400 17px/1.25 var(--serif); color: var(--text); }
.how-details p { margin: 0 0 14px; font-size: 14px; line-height: 1.5; color: var(--dek); }
.how-details b { display: block; margin-bottom: 2px; font: 600 14px var(--sans); color: var(--text); }
.how-note { margin: 18px 0 0; font: italic 15px/1.45 var(--serif); color: var(--muted); }

/* ---------- Essais : fonds pastel (activés par ?bleu, ?ciel, ?rose, ?tropical ou ?jungle, voir index.html) ---------- */
:root[data-theme="bleu"] {
  --bg: #dce8f6;
  --surface: #f5f9fd;
  --surface-2: #cbdcf0;
  --line: #bccfe6;
  --dek: #3d4656;
  --muted: #66707f;
  --tabbar-bg: #c8daf0;
}
:root[data-theme="bleu"] .tabbar { border-top-color: #b5cae4; }
:root[data-theme="rose"] {
  --bg: #eedff0;
  --surface: #fbf6fc;
  --surface-2: #e2cfe6;
  --line: #dcc6e0;
  --dek: #4b3f50;
  --muted: #76697a;
  --tabbar-bg: #e3cdea;
}
:root[data-theme="rose"] .tabbar { border-top-color: #d5bcdc; }
:root[data-theme="ciel"] {
  --bg: #bfe4fa;
  --surface: #f3faff;
  --surface-2: #a9d8f5;
  --line: #9fcbe8;
  --dek: #2f4454;
  --muted: #557083;
  --tabbar-bg: #a7d6f3;
}
:root[data-theme="ciel"] .tabbar { border-top-color: #8fc3e4; }
/* Tropical clair : vert feuille pâle, barre du bas marron café, touches vert jungle et terre cuite */
:root[data-theme="tropical"] {
  --bg: #e6ead8;
  --surface: #f8f9f1;
  --surface-2: #d6ddc1;
  --line: #c8d0b2;
  --text: #2a2419;
  --dek: #3d4130;
  --muted: #6c705c;
  --logo: #4a2f1e;
  --brand: #2f6b3f;
  --accent: #b5562c;
  --tabbar-bg: #4a2f1e;
}
:root[data-theme="tropical"] .tabbar { border-top-color: #3a2416; }
:root[data-theme="tropical"] .tabbar a { color: #d9c7ad; }
:root[data-theme="tropical"] .tabbar a.active { color: #b9e07a; }
:root[data-theme="tropical"] .tabbar a.active::before { background: #b9e07a; }
:root[data-theme="tropical"] .section:nth-of-type(3n+2) .section-title::after { background: #b5562c; }
:root[data-theme="tropical"] .section:nth-of-type(3n) .section-title::after { background: #8a5a35; }
:root[data-theme="tropical"] .pote svg g { stroke: #4a2f1e; }
:root[data-theme="tropical"] .pote svg [fill="#6e1d17"] { fill: #4a2f1e; }
/* Jungle : vert profond, textes crème, touches vert tendre et orange papaye, barre du bas marron */
:root[data-theme="jungle"] {
  --bg: #1e3a2a;
  --surface: #284a36;
  --surface-2: #33583f;
  --line: rgba(240, 230, 205, .2);
  --text: #f3ead6;
  --dek: rgba(243, 234, 214, .86);
  --muted: rgba(243, 234, 214, .64);
  --logo: #f3ead6;
  --brand: #f0a04b;
  --accent: #b9e07a;
  --tabbar-bg: #3d2617;
}
:root[data-theme="jungle"] .tabbar { border-top-color: #2b190e; }
:root[data-theme="jungle"] .tabbar a { color: #d9c7ad; }
:root[data-theme="jungle"] .section:nth-of-type(3n+2) .section-title::after { background: #b9e07a; }
:root[data-theme="jungle"] .section:nth-of-type(3n) .section-title::after { background: #c98a5a; }
:root[data-theme="jungle"] .pote svg g { stroke: #f3ead6; }
:root[data-theme="jungle"] .pote svg [fill="#6e1d17"] { fill: #f3ead6; }
:root[data-theme="jungle"] .btn { background: #f3ead6; color: #1e3a2a; border-color: #f3ead6; }
:root[data-theme="jungle"] .btn-ghost { background: none; color: #f3ead6; }
:root[data-theme="jungle"] input, :root[data-theme="jungle"] select, :root[data-theme="jungle"] textarea { background: #284a36; color: #f3ead6; border-color: rgba(240, 230, 205, .3); }

/* ---------- Test des goûts : duels entre deux profils ---------- */
.quiz { padding-top: 6px; }
.duel-q { margin: 4px 0 14px; font: 400 30px/1.15 var(--serif); }
.duel-bar { height: 3px; margin-bottom: 18px; background: var(--line); border-radius: 3px; overflow: hidden; }
.duel-bar i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.duel { display: grid; gap: 4px; }
.duel-card {
  display: grid; grid-template-columns: 158px 1fr; align-items: center; gap: 8px; padding: 10px 14px 10px 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  font: inherit; color: var(--text); text-align: left; cursor: pointer;
  transition: transform .15s, border-color .15s, box-shadow .15s;
  animation: duel-in .3s ease both;
}
.duel-card:last-child { animation-delay: .06s; }
.duel-card:active { transform: scale(.98); }
.duel-card.picked { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.duel-text { display: flex; flex-direction: column; gap: 4px; }
.duel-card b { font: 400 20px/1.15 var(--serif); }
.duel-card .kicker { font-size: 10px; line-height: 1.3; }
.duel-notes { font-size: 13px; line-height: 1.4; color: var(--muted); }
/* Profil sensoriel en radar */
.radar { width: 158px; height: auto; overflow: visible; }
.radar-grid { fill: none; stroke: var(--line); stroke-width: .8; }
.radar-shape { fill: color-mix(in srgb, var(--c) 30%, transparent); stroke: var(--c); stroke-width: 1.6; stroke-linejoin: round; }
.radar text { font-family: var(--sans); font-size: 10.5px; font-weight: 400; fill: var(--muted); stroke: none; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice {
  padding: 16px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  font: 400 17px/1.2 var(--serif); color: var(--text); cursor: pointer; animation: duel-in .3s ease both;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.choice:active { transform: scale(.97); }
.choice[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); color: var(--accent); }
.choice-hint { margin: -6px 0 10px; font-size: 13px; }
.quiz .choice-ok { margin-top: 16px; }
.quiz .choice-ok:disabled { opacity: .35; }
.palate-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 4px; }
.palate-facts div { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.palate-facts dt { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.palate-facts dd { margin: 2px 0 0; font: 400 17px/1.25 var(--serif); }
.duel-or { justify-self: center; font: italic 15px var(--serif); color: var(--muted); }
.duel-skip { display: block; margin: 18px auto 0; text-align: center; }
.duel-skips { display: flex; justify-content: center; align-items: center; gap: 10px; margin: 18px 0 0; color: var(--muted); }
.duel-skips .link-btn { flex: none; width: auto; margin: 0; padding: 4px 2px; }
@keyframes duel-in { from { opacity: 0; transform: translateY(8px); } }

.palate-lead { margin: 18px 0 8px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.palate { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.palate li { padding: 7px 12px; border: 1px solid var(--accent); border-radius: 999px; color: var(--accent); font-size: 14px; }
.palate-less li { border-color: var(--line); color: var(--muted); }
.quiz .hint { margin: 24px 0 0; }
.quiz-picks { margin-top: 26px; }
.quiz-why { margin-top: 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 14px; line-height: 1.5; color: var(--dek); }
.quiz-why p { margin: 0; }
.quiz-why p + p { margin-top: 6px; }
.quiz .btn-block { margin-top: 22px; }

/* Invitation au test sur l'accueil */
.quiz-invite {
  display: flex; align-items: center; gap: 14px; margin-top: 12px; padding: 14px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text);
}
.quiz-invite b { display: block; font: 400 18px/1.2 var(--serif); }
.quiz-invite .muted { font-size: 13px; line-height: 1.35; }
.quiz-invite-cups { display: flex; flex: none; }
.quiz-invite-cups i { width: 26px; height: 26px; border-radius: 50%; border: 3px solid #fff; background: var(--c); box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.quiz-invite-cups i + i { margin-left: -8px; }

/* Mot de passe oublié, sous le formulaire de connexion */
.form .forgot { align-self: center; margin-top: -10px; font-size: 14px; }

/* En tête des recommandations : comment elles deviennent fiables */
.how-recos { margin: 4px 0 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 13.5px; line-height: 1.45; color: var(--dek); }
.how-recos-title { margin: 0 0 10px; font: 400 17px/1.2 var(--serif); color: var(--text); }
.how-recos ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.how-recos li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: start; opacity: .75; }
.how-recos li.now { opacity: 1; }
.how-recos li .rel { margin-top: 4px; }
.how-recos li b { display: block; color: var(--text); }
.how-recos li small { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--accent); color: #fff; font: 700 10px/1.6 var(--sans); letter-spacing: .04em; text-transform: uppercase; vertical-align: 2px; }
.how-recos-foot { margin: 10px 0 0; font-size: 12.5px; font-style: italic; color: var(--muted); }

/* Où j'achète mon café */
.palate-facts .palate-zone { grid-column: 1 / -1; }
.palate-zone select, .zone-link select { font: 400 16px var(--serif); border: 0; background: none; padding: 0; color: var(--text); text-align: right; }
.palate-zone select { text-align: left; font-size: 17px; }
.zone-link { cursor: pointer; }

/* Bibliothèque : deux piles, et une carte qu'on glisse vers la gauche pour la retirer */
.lib-swipe-hint { margin: 4px 0 0; }
.lib-pile .section-title small { margin-left: 6px; color: var(--muted); font-size: .75em; }
.lib-swipe { position: relative; overflow: hidden; transition: height .25s ease, opacity .25s ease; }
.lib-swipe::before { content: 'Retirer'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: flex-end; padding-right: 20px; background: var(--danger); color: #fff; font: 700 13px var(--sans); letter-spacing: .06em; text-transform: uppercase; opacity: 0; transition: opacity .15s; }
.lib-swipe.dragging::before, .lib-swipe.gone::before { opacity: 1; }
.lib-swipe .lib-card { position: relative; background: var(--bg); transition: transform .25s ease; }
.lib-swipe.dragging .lib-card { transition: none; }
.lib-swipe.gone { height: 0 !important; opacity: 0; }
.lib-card-info .hearts-mini { margin-top: 3px; }

/* Fenêtre « Beandle sur ton écran d'accueil » (bouton + de l'accueil) */
.sheet-backdrop { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; background: rgba(0,0,0,.35); opacity: 0; transition: opacity .2s; }
.sheet-backdrop.show { opacity: 1; }
.sheet { width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; padding: 22px var(--gutter) calc(20px + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; background: var(--bg); text-align: center; transform: translateY(24px); transition: transform .2s; }
.sheet-backdrop.show .sheet { transform: none; }
.sheet-icon { width: 64px; height: 64px; border-radius: 15px; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.sheet h2 { margin: 12px 0 4px; font: 400 22px/1.2 var(--serif); }
.sheet .muted { margin: 0 0 16px; font-size: 14px; }
.sheet-steps { margin: 0 0 20px; padding: 0; list-style: none; counter-reset: s; text-align: left; }
.sheet-steps li { counter-increment: s; display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.4; }
.sheet-steps li::before { content: counter(s); flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font: 700 13px/1 var(--sans); }
.sheet-ico { display: inline-block; vertical-align: -4px; }
.sheet-ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
