/* ==========================================================
   Doléances · interface mobile
   Palette marbre : Carrare (clair) + Nero Marquina (sombre)
   Toutes les animations n'utilisent que transform / opacity.
   ========================================================== */
:root {
  --bg: #ece7df;
  --paper: #faf8f4;
  --paper-2: #f3efe8;
  --ink: #26231f;
  --ink-2: #4a453e;
  --muted: #8a8378;
  --line: rgba(38, 35, 31, .12);
  --accent: #9a7b4f;          /* laiton */
  --dark: #2a2723;
  --agree: #4e7d5b;
  --disagree: #b0544a;
  --love: #c2475a;
  --warn: #c08a2c;
  --radius: 22px;
  --ease: cubic-bezier(.32, .72, 0, 1);
  --spring: cubic-bezier(.175, .885, .32, 1.275);
  --serif: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);

  /* Veinage de marbre clair (rendu une seule fois par le navigateur) */
  --marble: url("/img/marble-light.jpg");
  --marble-card: url("/img/marble-card.jpg");
  /* Veinage clair sur fond sombre */
  --marble-dark: url("/img/marble-dark.jpg");
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }

.marble { background: var(--bg) var(--marble) center / 1200px 1200px; }

.eyebrow {
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); font-weight: 500;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; letter-spacing: -.01em; }

/* ---------- Boutons ---------- */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 56px; padding: 0 26px; border-radius: 999px;
  background: var(--dark); color: #f3eee6;
  font-weight: 600; font-size: 16px; letter-spacing: .01em;
  box-shadow: 0 10px 24px -10px rgba(30, 26, 22, .55), inset 0 1px 0 rgba(255,255,255,.08);
  transition: transform .18s var(--ease), opacity .2s;
}
.btn-primary:active { transform: scale(.96); }
.btn-primary.small { height: 46px; font-size: 15px; padding: 0 20px; }
.btn-primary.wide, .btn-ghost.wide { width: 100%; }
.btn-primary[disabled] { opacity: .5; }
.btn-ghost {
  height: 48px; padding: 0 22px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255,255,255,.55);
  font-weight: 500; transition: transform .18s var(--ease);
}
.btn-ghost:active { transform: scale(.96); }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .6); border: 1px solid var(--line);
  transition: transform .18s var(--ease);
}
.icon-btn:active { transform: scale(.9); }
.icon-btn.ghost { visibility: hidden; }

/* ---------- Accueil ---------- */
.screen {
  height: 100dvh; display: flex; flex-direction: column;
  padding: calc(var(--safe-t) + 18px) 20px calc(var(--safe-b) + 18px);
}
.top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.top-actions { display: flex; gap: 8px; }
.brand h1 { font-size: 40px; line-height: 1; margin-top: 4px; }
.home-main { flex: 1; display: flex; padding: 22px 0 18px; min-height: 0; }

.teaser {
  position: relative; flex: 1; width: 100%;
  border-radius: 28px; overflow: hidden;
  background-color: var(--dark); background-image: var(--marble-dark); background-size: cover;
  color: #f1ece3;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  box-shadow: 0 30px 50px -28px rgba(20, 17, 14, .7), inset 0 0 0 1px rgba(255,255,255,.06);
  transition: transform .25s var(--ease);
  text-align: center;
}
.teaser:active { transform: scale(.985); }
.teaser::after {
  content: ""; position: absolute; inset: 12px; border-radius: 20px;
  border: 1px solid rgba(201, 178, 138, .28); pointer-events: none;
}
.teaser-stack { position: relative; width: 116px; height: 146px; margin-bottom: 10px; }
.teaser-stack i {
  position: absolute; inset: 0; border-radius: 14px;
  background: var(--paper); background-image: var(--marble); background-size: 400px 400px;
  box-shadow: 0 10px 20px -8px rgba(0,0,0,.6);
  animation: float 5s ease-in-out infinite;
}
.teaser-stack i:nth-child(1) { transform: rotate(-11deg) translateX(-18px); opacity: .55; animation-delay: -2s; }
.teaser-stack i:nth-child(2) { transform: rotate(8deg) translateX(16px); opacity: .75; animation-delay: -1s; }
.teaser-stack i:nth-child(3) { transform: rotate(-1deg); }
.teaser-stack i:nth-child(3)::before {
  content: ""; position: absolute; left: 14px; right: 30px; top: 22px; height: 9px; border-radius: 4px; background: rgba(38,35,31,.75);
  box-shadow: 0 18px 0 -1px rgba(38,35,31,.16), 0 32px 0 -1px rgba(38,35,31,.16), 0 46px 0 -1px rgba(38,35,31,.16);
}
@keyframes float { 50% { translate: 0 -6px; } }
.teaser-label { font-family: var(--serif); font-size: 34px; line-height: 1.05; font-weight: 600; }
.teaser-count { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: #c9b28a; min-height: 1.2em; }
.teaser-hint {
  position: absolute; left: 28px; right: 28px; bottom: 30px;
  display: flex; justify-content: space-between; font-size: 12px; color: rgba(241,236,227,.55);
}
.teaser-hint span { display: inline-flex; align-items: center; gap: 4px; }
.teaser-hint svg { width: 15px; height: 15px; }

.bottom { display: flex; }
.bottom .btn-primary { flex: 1; height: 60px; font-size: 17px; }

/* ---------- Vues plein écran ---------- */
.view {
  position: fixed; inset: 0; z-index: 10;
  display: flex; flex-direction: column;
  transform: translate3d(100%, 0, 0);
  transition: transform .45s var(--ease);
  will-change: transform;
  padding-top: var(--safe-t);
  box-shadow: -20px 0 40px -20px rgba(0,0,0,.25);
  visibility: hidden;
}
.view.open { transform: translate3d(0, 0, 0); visibility: visible; }
.view.closing { visibility: visible; }
.view-top {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 16px 6px;
}
.view-title { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 500; }

/* ---------- Pile de cartes ---------- */
.stack {
  position: relative; z-index: 1; flex: 1; min-height: 0;
  touch-action: none;
  margin-top: 4px;
}
.card {
  position: absolute; top: 6px; bottom: 26px; left: 0; right: 0;
  margin: 0 auto; width: min(calc(100% - 32px), 440px);
  border-radius: var(--radius);
  background: var(--paper) var(--marble-card) center / cover;
  box-shadow: 0 0 0 1px rgba(38,35,31,.07), 0 18px 30px -20px rgba(38, 30, 20, .45);
  display: flex; flex-direction: column;
  padding: 22px 22px 18px;
  user-select: none; -webkit-user-select: none;
  transform-origin: 50% 92%;
  transform: translate3d(0, 0, 0);
  transition: transform .45s var(--ease), opacity .3s ease;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  contain: layout style paint;
  cursor: grab;
}
.card[data-depth="1"] { transform: translate3d(0, 16px, 0) scale(.95); cursor: default; }
.card[data-depth="2"] { transform: translate3d(0, 32px, 0) scale(.9); cursor: default; }
.stack.dragging .card { transition: none; }
.card.dragging { cursor: grabbing; transition: none !important; }
.card.flying { pointer-events: none; }
.card.enter { animation: cardIn .45s var(--ease) both; }
@keyframes cardIn { from { opacity: 0; } }

.stamp {
  position: absolute; top: 26px; z-index: 3;
  padding: 5px 12px 4px; border: 3px solid currentColor; border-radius: 10px;
  font-weight: 700; font-size: 20px; letter-spacing: .08em; text-transform: uppercase;
  background: rgba(250,248,244,.9);
  pointer-events: none;
  opacity: 0;
  will-change: opacity;
}
.stamp.yes { left: 18px; color: var(--agree); transform: rotate(-12deg); }
.stamp.no  { right: 18px; color: var(--disagree); transform: rotate(12deg); }

.card-head { position: relative; display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.card-head .meta { display: inline-flex; gap: 12px; }
.card-head .meta span { display: inline-flex; align-items: center; gap: 4px; }
.card-head svg { width: 14px; height: 14px; }
.card-head .loves.on { color: var(--love); }
.card-head .loves.on svg { fill: currentColor; }
.card h3 {
  position: relative; font-size: 29px; line-height: 1.08; margin: 14px 0 12px;
  overflow-wrap: anywhere; hyphens: auto;
}
.card .rule { position: relative; width: 36px; height: 2px; background: var(--accent); margin-bottom: 14px; border-radius: 2px; opacity: .8; }
.card-body {
  position: relative; flex: 1; min-height: 0; overflow: hidden;
  font-size: 15.5px; line-height: 1.55; color: var(--ink-2);
  white-space: pre-line; overflow-wrap: anywhere;
}
.card-body.clipped::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2.4em; background: linear-gradient(rgba(250,248,244,0), #f8f6f2); pointer-events: none; }
.card-comments { position: relative; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.cc-label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; display: flex; justify-content: space-between; }
.cc-label button { color: var(--accent); letter-spacing: .08em; text-transform: uppercase; font-size: 11px; font-weight: 600; padding: 4px 0 4px 8px; }
.cc {
  font-size: 13.5px; line-height: 1.4; color: var(--ink-2); font-style: italic;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  padding-left: 10px; border-left: 2px solid rgba(154,123,79,.35); margin-top: 6px;
}
.cc-empty { font-size: 13px; color: var(--muted); }

.burst {
  position: absolute; left: 50%; top: 45%; z-index: 4; width: 110px; height: 110px; margin: -55px 0 0 -55px;
  color: var(--love); pointer-events: none; opacity: 0;
}
.burst svg { width: 100%; height: 100%; fill: currentColor; stroke: none; filter: drop-shadow(0 8px 18px rgba(194,71,90,.4)); }
.burst.go { animation: burst .75s var(--ease) both; }
@keyframes burst {
  0% { opacity: 0; transform: scale(.3); }
  30% { opacity: 1; transform: scale(1.12); }
  55% { transform: scale(.95); }
  100% { opacity: 0; transform: scale(1.25); }
}

/* ---------- Barre d'actions ---------- */
.actions {
  display: flex; justify-content: center; align-items: center; gap: 14px;
  padding: 4px 16px calc(var(--safe-b) + 18px);
}
.act {
  width: 50px; height: 50px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--paper); color: var(--ink-2);
  box-shadow: 0 0 0 1px rgba(38,35,31,.08), 0 10px 20px -12px rgba(38,30,20,.5);
  transition: transform .2s var(--spring), background-color .2s, color .2s;
}
.act:active { transform: scale(.86); }
.act svg { width: 22px; height: 22px; }
.act-big { width: 64px; height: 64px; }
.act-big svg { width: 28px; height: 28px; stroke-width: 2.2; }
.act-no { color: var(--disagree); }
.act-yes { color: var(--agree); }
.act-report { color: var(--warn); }
.act-love { color: var(--love); }
.act-love.on { background: var(--love); color: #fff; }
.act-love.on svg { fill: currentColor; }
.act-love.pop { animation: pop .45s var(--spring); }
@keyframes pop { 40% { transform: scale(1.22); } }
.act[disabled] { opacity: .35; pointer-events: none; }

/* ---------- État vide ---------- */
.empty {
  position: absolute; z-index: 2; inset: 70px 24px 120px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 12px; animation: fadeUp .5s var(--ease) both;
}
.empty h3 { font-size: 32px; }
.empty p { color: var(--muted); margin: 0 0 8px; line-height: 1.5; }
.empty-mark { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--dark); color: #e9e3d8; margin-bottom: 6px; }
.empty-mark svg { width: 28px; height: 28px; stroke-width: 2.2; }
@keyframes fadeUp { from { opacity: 0; transform: translate3d(0, 14px, 0); } }

/* ---------- Recherche ---------- */
.search-top { gap: 10px; }
.search-field {
  flex: 1; display: flex; align-items: center; gap: 8px;
  height: 46px; padding: 0 16px; border-radius: 999px;
  background: rgba(255,255,255,.75); border: 1px solid var(--line);
}
.search-field svg { width: 18px; height: 18px; color: var(--muted); }
.search-field input { flex: 1; border: 0; outline: 0; background: none; font-size: 16px; min-width: 0; }
.results { list-style: none; margin: 0; padding: 10px 16px calc(var(--safe-b) + 20px); overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; }
.results li {
  background: rgba(250,248,244,.92); border-radius: 16px; padding: 14px 16px; margin-bottom: 10px;
  box-shadow: 0 0 0 1px rgba(38,35,31,.06), 0 8px 18px -14px rgba(38,30,20,.5);
  animation: fadeUp .35s var(--ease) both;
  transition: transform .15s var(--ease);
}
.results li:active { transform: scale(.98); }
.results .r-title { font-family: var(--serif); font-size: 21px; font-weight: 600; line-height: 1.15; }
.results .r-title mark { background: rgba(154,123,79,.22); color: inherit; border-radius: 3px; }
.results .r-ex { font-size: 13.5px; color: var(--muted); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.results .r-meta { font-size: 12px; color: var(--muted); margin-top: 6px; display: flex; gap: 10px; }
.search-hint { text-align: center; color: var(--muted); font-size: 14px; position: absolute; top: 45%; left: 0; right: 0; margin: 0; padding: 0 30px; }

/* ---------- Feuilles (bottom sheets) ---------- */
.backdrop {
  position: fixed; inset: 0; z-index: 30; background: rgba(24, 21, 18, .42);
  opacity: 0; pointer-events: none; transition: opacity .35s ease;
}
.backdrop.on { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 31;
  max-width: 560px; margin: 0 auto;
  max-height: 92dvh; display: flex; flex-direction: column;
  background: var(--paper); border-radius: 26px 26px 0 0;
  padding: 10px 20px calc(var(--safe-b) + 20px);
  transform: translate3d(0, 105%, 0);
  transition: transform .45s var(--ease);
  will-change: transform;
  box-shadow: 0 -20px 40px -20px rgba(0,0,0,.3);
  visibility: hidden;
}
.sheet.open { transform: translate3d(0, 0, 0); visibility: visible; }
.sheet.closing { visibility: visible; }
.sheet.tall { height: 82dvh; }
.grab { width: 40px; height: 5px; border-radius: 3px; background: rgba(38,35,31,.15); margin: 0 auto 14px; flex: none; }
.sheet h2 { font-size: 28px; }
.sheet-sub { color: var(--muted); font-size: 14px; margin: 4px 0 18px; }
.field { display: block; margin-bottom: 14px; }
.field-top { display: flex; justify-content: space-between; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.counter { letter-spacing: 0; font-variant-numeric: tabular-nums; transition: color .2s; }
.counter.warn { color: var(--warn); }
.counter.max { color: var(--disagree); }
.field input, .field textarea {
  width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 14px;
  padding: 13px 14px; font-size: 16px; outline: 0; resize: none;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(154,123,79,.14); }
.field textarea { line-height: 1.5; min-height: 132px; }
.form-error {
  margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; font-size: 14px; line-height: 1.4;
  background: rgba(176,84,74,.1); color: #8e3b33; animation: shake .4s;
}
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.fine { font-size: 12px; color: var(--muted); text-align: center; margin: 12px 0 0; line-height: 1.45; }

.comment-list { list-style: none; margin: 14px 0 0; padding: 0; flex: 1; overflow-y: auto; min-height: 0; -webkit-overflow-scrolling: touch; }
.comment-list li { padding: 12px 0; border-bottom: 1px solid var(--line); animation: fadeUp .3s var(--ease) both; }
.comment-list .c-body { font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.comment-list .c-date { font-size: 12px; color: var(--muted); margin-top: 4px; }
.comment-list .c-none { color: var(--muted); text-align: center; border: 0; padding-top: 40px; }
.comment-form { display: flex; gap: 8px; padding-top: 12px; }
.comment-form input {
  flex: 1; min-width: 0; height: 50px; border-radius: 999px; border: 1px solid var(--line); padding: 0 18px;
  font-size: 16px; outline: 0; background: #fff;
}
.comment-form input:focus { border-color: var(--accent); }
.send { width: 50px; height: 50px; border-radius: 50%; background: var(--dark); color: #f3eee6; display: grid; place-items: center; transition: transform .18s var(--ease); }
.send:active { transform: scale(.9); }
.send svg { width: 20px; height: 20px; }
#commentError { margin-top: 10px; }

.report-reasons { display: grid; gap: 8px; margin-bottom: 14px; }
.report-reasons button {
  text-align: left; padding: 15px 16px; border-radius: 14px; background: #fff; border: 1px solid var(--line);
  font-weight: 500; transition: transform .15s var(--ease), background-color .2s;
}
.report-reasons button:active { transform: scale(.98); background: var(--paper-2); }

/* ---------- Intro ---------- */
.intro {
  position: fixed; inset: 0; z-index: 50; overflow-y: auto;
  display: flex; align-items: center; justify-content: center;
  padding: calc(var(--safe-t) + 24px) 20px calc(var(--safe-b) + 24px);
  transition: opacity .4s ease, transform .5s var(--ease);
}
.intro.leaving { opacity: 0; transform: scale(1.03); pointer-events: none; }
.intro-card { width: 100%; max-width: 440px; animation: fadeUp .7s var(--ease) both; }
.intro h1 { font-size: 54px; line-height: 1; margin-top: 10px; }
.intro .rule { width: 44px; height: 2px; background: var(--accent); margin: 18px 0; }
.intro p { line-height: 1.6; color: var(--ink-2); font-size: 16px; margin: 0 0 16px; }
.intro-list { list-style: none; padding: 0; margin: 0 0 18px; }
.intro-list li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; line-height: 1.5; font-size: 15px; color: var(--ink-2); border-top: 1px solid var(--line); }
.intro-list li span {
  flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--dark); color: #e9e3d8; font-family: var(--serif); font-size: 15px; font-weight: 600; margin-top: 1px;
}
.intro .intro-fine { font-size: 13px; color: var(--muted); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; top: calc(var(--safe-t) + 14px); z-index: 60;
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 14px;
  background: var(--dark); color: #f3eee6; font-size: 14px; line-height: 1.4; text-align: center;
  box-shadow: 0 14px 30px -14px rgba(0,0,0,.5);
  transform: translate3d(-50%, -160%, 0); transition: transform .45s var(--ease);
  pointer-events: none;
}
.toast.show { transform: translate3d(-50%, 0, 0); }
.toast.error { background: #7d3a33; }

@media (max-height: 680px) {
  .card { padding: 18px 18px 14px; }
  .card h3 { font-size: 25px; margin: 10px 0 8px; }
  .card-body { font-size: 14.5px; line-height: 1.5; }
  .act-big { width: 58px; height: 58px; }
  .act { width: 46px; height: 46px; }
  .teaser-label { font-size: 30px; }
}
/* Rebond d'appel à l'action sur « Ajouter un avis » (transform uniquement : composité GPU) */
/* Cycle de 4,5 s, tout synchronisé : halo qui pulse → rebond → reflet lumineux qui balaie le bouton.
   Uniquement transform/opacity sur des calques dédiés : aucun repaint, fluide même sur petit téléphone. */
#btnAdd {
  position: relative; isolation: isolate;
  background: linear-gradient(180deg, #3a342d, var(--dark) 60%);
  box-shadow: 0 12px 28px -10px rgba(30,26,22,.6), 0 0 0 1px rgba(154,123,79,.35), inset 0 1px 0 rgba(255,255,255,.12);
  animation: ctaBounce 4.5s cubic-bezier(.3,.7,.4,1) 1s infinite; will-change: transform;
}
#btnAdd > svg { position: relative; z-index: 1; color: #e6c891; }
#btnAdd:active { animation: none; }
#btnAdd:active::before, #btnAdd:active .cta-shine::before { animation: none; opacity: 0; }
/* halo laiton qui s'élargit et s'efface */
#btnAdd::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 0 2px rgba(201,164,106,.75), 0 0 22px 4px rgba(201,164,106,.45);
  opacity: 0; will-change: transform, opacity;
  animation: ctaHalo 4.5s ease-out 1s infinite;
}
/* reflet : bande claire en biais qui traverse le bouton */
.cta-shine { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; z-index: 0; }
.cta-shine::before {
  content: ""; position: absolute; top: -20%; bottom: -20%; left: 0; width: 38%;
  background: linear-gradient(100deg, rgba(255,255,255,0), rgba(255,240,215,.38) 50%, rgba(255,255,255,0));
  transform: translate3d(-130%,0,0) skewX(-18deg); opacity: 0; will-change: transform;
  animation: ctaShine 4.5s cubic-bezier(.4,0,.2,1) 1s infinite;
}
@keyframes ctaBounce {
  0%, 74%, 100% { transform: translate3d(0,0,0) scale(1); }
  78% { transform: translate3d(0,-10px,0) scale(1.03); }
  83% { transform: translate3d(0,0,0) scale(1.01, .98); }
  87% { transform: translate3d(0,-4px,0) scale(1.01); }
  91% { transform: translate3d(0,0,0) scale(1); }
}
@keyframes ctaHalo {
  0%, 70% { opacity: 0; transform: scale(1); }
  76% { opacity: 1; transform: scale(1); }
  96%, 100% { opacity: 0; transform: scale(1.12, 1.45); }
}
@keyframes ctaShine {
  0%, 80% { opacity: 0; transform: translate3d(-130%,0,0) skewX(-18deg); }
  81% { opacity: 1; }
  97% { opacity: 1; transform: translate3d(330%,0,0) skewX(-18deg); }
  98%, 100% { opacity: 0; transform: translate3d(330%,0,0) skewX(-18deg); }
}
@media (prefers-reduced-motion: reduce) {
  .teaser-stack i, .td-card, .td-label, #btnAdd, #btnAdd::before, .cta-shine::before { animation: none; }
}

/* ---------- Tuto du swipe ---------- */
.tuto {
  position: absolute; inset: 0; z-index: 5;
  background: rgba(26, 23, 20, .82);
  display: flex; align-items: center; justify-content: center;
  padding: calc(var(--safe-t) + 20px) 24px 120px;
  animation: tutoIn .45s ease backwards;
}
.tuto.leaving { opacity: 0; transition: opacity .3s ease; pointer-events: none; }
@keyframes tutoIn { from { opacity: 0; } }
.view.tuto-on .actions { position: relative; z-index: 6; }
.view.tuto-on .act { animation: glow 2.2s ease-in-out infinite; pointer-events: none; }
.view.tuto-on .act:nth-child(2) { animation-delay: .2s; }
.view.tuto-on .act:nth-child(3) { animation-delay: .4s; }
.view.tuto-on .act:nth-child(4) { animation-delay: .6s; }
.view.tuto-on .act:nth-child(5) { animation-delay: .8s; }
@keyframes glow { 50% { transform: translate3d(0, -4px, 0); } }
.tuto-inner { width: 100%; max-width: 380px; color: #f1ece3; text-align: center; animation: fadeUp .55s var(--ease) .1s both; }
.eyebrow.light { color: #c9b28a; }
.tuto-demo { position: relative; height: 130px; margin: 16px 0 6px; display: flex; align-items: center; justify-content: center; }
.td-card {
  position: relative; width: 84px; height: 108px; border-radius: 12px;
  background: var(--paper); background-image: var(--marble); background-size: 400px 400px;
  box-shadow: 0 12px 24px -10px rgba(0,0,0,.6);
  transform-origin: 50% 95%;
  animation: demoSwipe 3.2s var(--ease) infinite;
}
.td-card i { position: absolute; left: 12px; right: 12px; height: 5px; border-radius: 3px; background: rgba(38,35,31,.18); }
.td-card i:nth-child(1) { top: 16px; right: 26px; height: 7px; background: rgba(38,35,31,.7); }
.td-card i:nth-child(2) { top: 34px; }
.td-card i:nth-child(3) { top: 46px; right: 20px; }
.td-card b {
  position: absolute; left: 50%; bottom: -22px; width: 30px; height: 30px; margin-left: -15px; border-radius: 50%;
  background: rgba(255,255,255,.9); box-shadow: 0 0 0 6px rgba(255,255,255,.25);
}
@keyframes demoSwipe {
  0%, 8%   { transform: translate3d(0,0,0) rotate(0); }
  28%, 36% { transform: translate3d(64px,0,0) rotate(12deg); }
  50%, 58% { transform: translate3d(0,0,0) rotate(0); }
  78%, 86% { transform: translate3d(-64px,0,0) rotate(-12deg); }
  100%     { transform: translate3d(0,0,0) rotate(0); }
}
.td-label {
  position: absolute; top: 50%; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  padding: 4px 8px; border: 2px solid currentColor; border-radius: 7px; opacity: 0;
}
.td-yes { right: 0; color: #8fc29c; transform: translateY(-50%) rotate(8deg); animation: lblYes 3.2s infinite; }
.td-no  { left: 0;  color: #e8978d; transform: translateY(-50%) rotate(-8deg); animation: lblNo 3.2s infinite; }
@keyframes lblYes { 0%, 18% { opacity: 0; } 28%, 40% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes lblNo  { 0%, 68% { opacity: 0; } 78%, 90% { opacity: 1; } 100% { opacity: 0; } }
.tuto-lead { font-size: 16px; line-height: 1.5; margin: 22px 0 18px; color: #ece6dc; }
.tuto-lead b { color: #fff; }
.tuto-legend { list-style: none; padding: 0; margin: 0 0 22px; text-align: left; }
.tuto-legend li { display: flex; align-items: center; gap: 12px; padding: 7px 0; font-size: 14.5px; color: #e4ddd1; }
.tl { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); flex: none; }
.tl svg { width: 18px; height: 18px; stroke-width: 2; }
.tl-no { color: var(--disagree); } .tl-yes { color: var(--agree); } .tl-love { color: var(--love); }
.tl-comment { color: var(--ink-2); } .tl-report { color: var(--warn); }
.btn-light {
  height: 54px; border-radius: 999px; background: #f3eee6; color: var(--dark);
  font-weight: 600; font-size: 16px; transition: transform .18s var(--ease);
}
.btn-light:active { transform: scale(.96); }
@media (max-height: 700px) {
  .tuto-demo { height: 100px; margin-top: 6px; }
  .td-card { width: 66px; height: 86px; }
  .tuto-lead { margin: 14px 0 10px; font-size: 15px; }
  .tuto-legend li { padding: 4px 0; }
}
.btn-light.wide { width: 100%; }
.tuto { background: rgba(26, 23, 20, .9); }

/* ---------- Logo ---------- */
.logo-mini { width: 15px; height: 15px; vertical-align: -3px; margin-right: 7px; }
.intro-logo { width: 54px; height: 54px; display: block; margin-bottom: 18px; }
.top-actions .icon-btn { width: 42px; height: 42px; }
.top-actions { gap: 6px; }

/* ---------- Installation PWA ---------- */
.install-btn { background: var(--dark); color: #f3eee6; border-color: transparent; animation: installIn .5s var(--spring) both; }
@keyframes installIn { from { opacity: 0; transform: scale(.6); } }
.install-head { display: flex; gap: 14px; align-items: center; margin-bottom: 6px; }
.install-icon { width: 60px; height: 60px; border-radius: 14px; box-shadow: 0 0 0 1px var(--line), 0 8px 16px -8px rgba(0,0,0,.35); }
.install-head .sheet-sub { margin: 2px 0 0; }
.install-steps { list-style: none; padding: 0; margin: 14px 0 18px; counter-reset: s; }
.install-steps li {
  counter-increment: s; display: flex; align-items: center; gap: 12px;
  padding: 13px 0; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.45;
}
.install-steps li::before {
  content: counter(s); flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--dark); color: #e9e3d8; font-family: var(--serif); font-size: 15px; font-weight: 600;
}
.install-steps .key {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 8px;
  background: var(--paper-2); border: 1px solid var(--line); font-weight: 600; white-space: nowrap;
}
.install-steps .key svg { width: 17px; height: 17px; color: #2f6fd6; }

/* Vote déjà donné (mode « revoir ») */
.voted { margin-left: 6px; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; letter-spacing: .02em; }
.voted.v-yes { background: rgba(78,125,91,.13); color: var(--agree); }
.voted.v-no { background: rgba(176,84,74,.12); color: var(--disagree); }

/* ---------- Recherche sur l'accueil + bouton d'installation ---------- */
.search-row { display: flex; gap: 10px; margin-top: 18px; }
.home-search { height: 52px; background: rgba(255,255,255,.82); box-shadow: 0 8px 18px -14px rgba(38,30,20,.45); }
.home-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(154,123,79,.14); }
.home-search input::-webkit-search-cancel-button { display: none; }
.search-clear { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); margin-right: -6px; }
.search-clear svg { width: 16px; height: 16px; }
.install-btn {
  flex: none; width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--dark); color: #f3eee6;
  box-shadow: 0 10px 22px -12px rgba(30,26,22,.6);
  transition: transform .18s var(--ease);
}
.install-btn:active { transform: scale(.9); }
.install-btn svg { width: 22px; height: 22px; stroke-width: 2; }
.home-main { position: relative; padding-top: 18px; }
.home-main .results { padding: 0 0 8px; margin: 0; }
.home-main .search-hint { top: 40%; }
.teaser { animation: fadeUp .35s var(--ease) both; }
.top-actions { display: none; }
.home-search { min-width: 0; }

/* ---------- Neutre (glisser vers le haut) ---------- */
.stamp.mid {
  top: auto; bottom: 34%; left: 50%; color: #8a7350;
  transform: translateX(-50%) rotate(-4deg);
}
.voted.v-mid { background: rgba(154,123,79,.14); color: #8a7350; }
.tl-mid { color: #8a7350; }
.td-mid { top: -6px; left: 50%; color: #d9c49c; transform: translateX(-50%); animation: lblMid 4.8s infinite; }
.td-card { animation: demoSwipe3 4.8s var(--ease) infinite; }
.td-yes { animation: lblYes3 4.8s infinite; }
.td-no { animation: lblNo3 4.8s infinite; }
@keyframes demoSwipe3 {
  0%, 6%   { transform: translate3d(0,0,0) rotate(0); }
  18%, 24% { transform: translate3d(64px,0,0) rotate(12deg); }
  33%, 39% { transform: translate3d(0,0,0) rotate(0); }
  51%, 57% { transform: translate3d(-64px,0,0) rotate(-12deg); }
  66%, 72% { transform: translate3d(0,0,0) rotate(0); }
  84%, 90% { transform: translate3d(0,-26px,0) rotate(0); }
  100%     { transform: translate3d(0,0,0) rotate(0); }
}
@keyframes lblYes3 { 0%, 12% { opacity: 0; } 18%, 26% { opacity: 1; } 33%, 100% { opacity: 0; } }
@keyframes lblNo3  { 0%, 45% { opacity: 0; } 51%, 59% { opacity: 1; } 66%, 100% { opacity: 0; } }
@keyframes lblMid  { 0%, 78% { opacity: 0; } 84%, 92% { opacity: 1; } 100% { opacity: 0; } }
.tuto-demo { margin-top: 26px; }

/* ---------- Formulaire d'ajout plein écran ---------- */
.sheet.full {
  top: 0; max-width: none; max-height: none; height: 100dvh; border-radius: 0;
  padding: calc(var(--safe-t) + 10px) 20px calc(var(--safe-b) + 16px);
  background: var(--paper) var(--marble-card) center / cover;
}
.full-top { display: flex; justify-content: flex-start; margin-bottom: 18px; }
.sheet.full h2 { font-size: 36px; }
.sheet.full #addForm { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.sheet.full .field:nth-of-type(2) { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.sheet.full .field textarea { flex: 1; min-height: 120px; }
.sheet.full .btn-primary.wide { margin-top: 4px; flex: none; }

/* 3 derniers commentaires : une ligne chacun sur les petits écrans */
@media (max-height: 720px) { .cc { -webkit-line-clamp: 1; } }
/* Commentaire touché : affiché en entier, la zone commentaires s'agrandit (le texte de l'avis se réduit) */
.card .cc { cursor: pointer; }
.card .cc.open { display: block; -webkit-line-clamp: unset; overflow: visible; border-left-color: var(--accent); color: var(--ink); animation: ccOpen .25s ease both; }
.card .card-comments.has-open { flex-shrink: 0; }
@keyframes ccOpen { from { opacity: .4; } to { opacity: 1; } }
