/* Trot web, prototype essai-web. Tokens repris de app/theme.js et du handoff. */
:root {
  --green: #014421;
  --red: #F2413B;
  --radius: 20px;
  --rail: 84px;
  --header: 64px;
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  /* sombre (défaut) */
  --bg: #0c1013; /* comme Instagram : pas un noir pur, légèrement bleuté */
  --text: #ffffff;
  --text-muted: rgba(255,255,255,.62);
  --rail-on: #ffffff;
  --rail-off: rgba(255,255,255,.6);
  --seg-bg: rgba(255,255,255,.08);
  --seg-border: transparent;
  --seg-on-bg: #ffffff;
  --seg-on-fg: #1a1a1a;
  --seg-off: rgba(255,255,255,.75);
  --pill-bg: rgba(255,255,255,.08);
  --pill-border: rgba(255,255,255,.14);
  --pill-fg: #ffffff;
  --pill-shadow: none;
  --help: rgba(255,255,255,.5);
  --card-shadow: 0 20px 60px rgba(0,0,0,.5);
  --peek: rgba(43,47,44,.5);
  --surface-muted: rgba(255,255,255,.08);
  --surface-muted-fg: rgba(255,255,255,.72);
  --tile-bg: #161c20;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f6f4; --text: #1a1a1a; --text-muted: #666;
    --rail-on: #014421; --rail-off: #999;
    --seg-bg: #fff; --seg-border: #eee; --seg-on-bg: #014421; --seg-on-fg: #fff; --seg-off: #666;
    --pill-bg: #fff; --pill-border: #eee; --pill-fg: #014421; --pill-shadow: 0 2px 10px rgba(0,0,0,.05);
    --help: #999; --card-shadow: 0 20px 60px rgba(0,0,0,.18); --peek: rgba(220,220,216,.7);
    --surface-muted: #f0f0f0; --surface-muted-fg: #666; --tile-bg: #e6e6e2;
  }
}
:root[data-theme="light"] {
  --bg: #f6f6f4; --text: #1a1a1a; --text-muted: #666;
  --rail-on: #014421; --rail-off: #999;
  --seg-bg: #fff; --seg-border: #eee; --seg-on-bg: #014421; --seg-on-fg: #fff; --seg-off: #666;
  --pill-bg: #fff; --pill-border: #eee; --pill-fg: #014421; --pill-shadow: 0 2px 10px rgba(0,0,0,.05);
  --help: #999; --card-shadow: 0 20px 60px rgba(0,0,0,.18); --peek: rgba(220,220,216,.7);
  --surface-muted: #f0f0f0; --surface-muted-fg: #666; --tile-bg: #e6e6e2;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
.ic { display: inline-flex; flex: none; }
.ic svg { width: 100%; height: 100%; display: block; fill: currentColor; }
kbd { font-family: var(--font); font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 5px; border: 1px solid currentColor; opacity: .9; }
:focus-visible { outline: 2px solid #6fbf8f; outline-offset: 2px; }

/* ---------- rail ---------- */
.rail { position: fixed; z-index: 20; left: 0; top: 0; bottom: 0; width: var(--rail); background: var(--bg); display: flex; flex-direction: column; align-items: center; padding: 32px 0 16px; }
.rail-logo img { width: 36px; height: 36px; border-radius: 11px; display: block; }
.rail-mid { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; }
.rail-btn { position: relative; color: var(--rail-off); display: inline-flex; transition: color .15s; }
.rail-btn:hover { color: var(--rail-on); }
.rail-btn.on { color: var(--rail-on); }
/* onglet actif bien visible : icône pleine sur une pastille, comme l'app et Instagram */
.rail-btn.on::before { content: ''; position: absolute; inset: -10px; border-radius: 12px; background: var(--surface-muted); z-index: -1; }
.rail-btn.on svg path { fill: currentColor; }
.rail-btn { isolation: isolate; }
.pastille { position: absolute; top: -1px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }
.rail-add { width: 42px; height: 42px; border-radius: 11px; background: var(--green); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.theme-btn { font-size: 11px; font-weight: 600; color: var(--rail-off); padding: 6px 8px; border-radius: 999px; border: 1px solid var(--pill-border); }
.theme-btn:hover { color: var(--rail-on); }
:root[data-theme="dark"] .t-dark, :root:not([data-theme="light"]) .t-dark { display: none; }
:root[data-theme="light"] .t-light { display: none; }
:root[data-theme="light"] .t-dark { display: inline; }

/* ---------- header ---------- */
.topbar { position: fixed; z-index: 15; top: 0; left: var(--rail); right: 0; height: var(--header); display: flex; align-items: center; justify-content: center; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.tabs { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--seg-bg); border: 1px solid var(--seg-border); gap: 2px; }
.tab { font-size: 13px; font-weight: 600; padding: 8px 18px; border-radius: 999px; color: var(--seg-off); white-space: nowrap; transition: background .15s, color .15s; }
.tab:hover { color: var(--text); }
.tab.on, .tab.on:hover { background: var(--seg-on-bg); color: var(--seg-on-fg); }
.open-app { position: absolute; top: 33px; right: 40px; display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px 8px 10px; border-radius: 999px; background: var(--pill-bg); border: 1px solid var(--pill-border); color: var(--pill-fg); box-shadow: var(--pill-shadow); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); font-size: 13px; font-weight: 600; white-space: nowrap; }
.oa-short { display: none; }
.kbd-help { position: fixed; right: 24px; bottom: 16px; margin: 0; font-size: 12px; color: var(--help); z-index: 5; }

/* ---------- feed ---------- */
/* Comme Instagram : une annonce par écran, carte presque pleine hauteur, coins à peine arrondis. */
:root { --VH: 100vh; --H: min(1000px, calc(var(--VH) - 32px)); --W: calc(var(--H) * 9 / 16); --card-radius: 6px; }
@supports (height: 100dvh) { :root { --VH: 100dvh; } }
.scroller { position: fixed; top: 0; left: var(--rail); right: 0; bottom: 0; overflow-y: auto; overflow-x: hidden; scroll-snap-type: y mandatory; scrollbar-width: none; overscroll-behavior: contain; }
.scroller::-webkit-scrollbar { display: none; }
/* comme Instagram : halo gris doux derrière la colonne, bords plus sombres (mode sombre seulement) */
.page-feed .scroller { background: radial-gradient(ellipse 34% 80% at 50% 50%, #1c1d20 0%, #17191c 45%, rgba(12,16,19,0) 100%) fixed, var(--bg); }
:root[data-theme="light"] .page-feed .scroller { background: var(--bg); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .page-feed .scroller { background: var(--bg); } }
.slot { height: var(--VH); scroll-snap-align: start; scroll-snap-stop: always; display: flex; align-items: center; justify-content: center; }
.card { position: relative; width: var(--W); height: var(--H); border-radius: var(--card-radius); overflow: hidden; background: #1b1d1c; box-shadow: var(--card-shadow); color: #fff; flex: none; isolation: isolate; container-type: size; }
.slot:not(.active) .card { cursor: pointer; }
.slot .card::before { content: ''; position: absolute; inset: 0; z-index: 9; border-radius: inherit; background: var(--peek); opacity: 0; pointer-events: none; transition: opacity .3s ease; }
.slot:not(.active) .card::before { opacity: 1; }
.slot:not(.active) .card .actions, .slot:not(.active) .card .layer, .slot:not(.active) .card .dots, .slot:not(.active) .gate-close, .slot:not(.active) .gate-body { visibility: hidden; }

.media { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; }
.slides { display: flex; height: 100%; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.slides::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; height: 100%; scroll-snap-align: center; background: #111; overflow: hidden; } /* sinon le média agrandi (flou) déborde sur le voisin */
.slide { position: relative; }
.slide img, .slide video { width: 100%; height: 100%; object-fit: cover; display: block; }
.slide .vposter { position: absolute; inset: 0; pointer-events: none; transition: opacity .25s; }
.slide.vready .vposter { opacity: 0; }
.shade { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(180deg, rgba(0,0,0,.18) 0%, transparent 14%, transparent 45%, rgba(0,0,0,.82) 100%); }
.dots { position: absolute; left: 0; right: 0; top: 61%; display: flex; justify-content: center; gap: 6px; pointer-events: none; z-index: 2; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.5); transition: background .2s; }
.dot.on { background: #fff; }

.actions { position: absolute; right: 16px; bottom: 200px; display: flex; flex-direction: column; align-items: center; gap: 28px; z-index: 5; transition: opacity .2s; }
.act { color: #fff; display: inline-flex; filter: drop-shadow(0 1px 3px rgba(0,0,0,.45)); }
.act:hover { transform: scale(1.06); }

.layer { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 clamp(16px, 2.34cqh, 24px) clamp(16px, 2.34cqh, 24px); display: flex; flex-direction: column; gap: clamp(6px, .9cqh, 10px); z-index: 4; cursor: pointer; max-height: 78%; text-shadow: 0 0 2px rgba(0,0,0,.6); }
.layer.open { overflow-y: auto; padding-top: 40px; background: linear-gradient(180deg, transparent 0, rgba(0,0,0,.55) 40px, rgba(0,0,0,.72) 100%); scrollbar-width: thin; }
.card.desc-open .actions { opacity: 0; pointer-events: none; }
.author { display: flex; align-items: center; gap: 10px; text-align: left; align-self: flex-start; margin-bottom: 3px; }
.avatar { width: clamp(40px, 6cqh, 58px); height: clamp(40px, 6cqh, 58px); border-radius: 50%; border: 2px solid #fff; object-fit: cover; flex: none; background: var(--green); }
.avatar-txt { color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; }
.who { display: flex; flex-direction: column; line-height: 1.25; }
.aname { font-size: clamp(14px, 2.08cqh, 20px); font-weight: 700; }
.asub { font-size: clamp(12px, 1.69cqh, 16px); opacity: .92; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: clamp(10px, 1.43cqh, 13px); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; border-radius: 6px; padding: 4px 8px; white-space: nowrap; text-shadow: none; line-height: 1.2; }
.tag-fill { background: var(--green); border: 1px solid var(--green); color: #fff; }
.tag-outline { border: 1px solid rgba(255,255,255,.75); background: rgba(0,0,0,.25); }
.tag-sold { background: #fff; color: #1a1a1a; border: 1px solid #fff; }
.name { font-size: clamp(15px, 2.21cqh, 21px); font-weight: 700; margin: 0; line-height: 1.25; }
.name.upper { text-transform: uppercase; }
.meta { font-size: clamp(12px, 1.69cqh, 16px); line-height: 1.6; }
.desc { font-size: clamp(12px, 1.69cqh, 16px); line-height: 1.6; margin-top: 6px; white-space: pre-line; overflow-wrap: anywhere; }
.more { align-self: flex-start; font-size: clamp(12px, 1.69cqh, 16px); font-weight: 700; color: #fff; text-shadow: inherit; }
.soldbox { margin-top: 4px; text-shadow: none; cursor: default; }
.card.is-sold .actions { bottom: 268px; }
.card.is-sold .dots { top: 54%; }
.soldbtn { width: 100%; padding: 10px 12px; border-radius: 999px; background: #fff; color: var(--green); font-size: 13px; font-weight: 700; }

/* annonces suivantes, hors connexion : floutées comme dans l'app */
.card.locked .media img, .card.locked .media video { filter: blur(6px) brightness(.9); transform: scale(1.05); }
.card.locked .dots, .card.locked .more { display: none; }
.card.locked .actions { z-index: 6; }
/* seul l'auteur reste lisible (et les tags), le nom du cheval et le texte sont floutés */
.card.locked .name, .card.locked .meta, .card.locked .desc { filter: blur(5px); user-select: none; pointer-events: none; }
/* aperçu : qui a posté, le nom, la 1re ligne d'infos et le début de la description */
.card.locked .meta > div:nth-child(n+2) { display: none; }
.card.locked .desc[hidden] { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; white-space: normal; }
.lock { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; border-radius: inherit; }
.lock-pill { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 999px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.3); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: #fff; font-size: 14px; font-weight: 700; white-space: nowrap; }
.lock-banner { position: absolute; left: 14px; right: 14px; bottom: 14px; z-index: 6; display: flex; align-items: center; gap: 14px; padding: 14px 14px 14px 16px; border-radius: 16px; background: rgba(16,18,20,.66); border: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); color: #fff; z-index: 7; }
.lb-txt { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.lb-txt b { font-size: clamp(15px, 2.1cqh, 19px); font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.lb-txt span { font-size: clamp(12px, 1.6cqh, 14px); color: rgba(255,255,255,.72); }
.lb-mob { display: none; }
.lb-qr { flex: none; background: #fff; padding: 6px; border-radius: 10px; }
.lb-qr .qr, .lb-qr .qr img, .lb-qr .qr canvas { width: 76px !important; height: 76px !important; display: block; }
.slot:not(.active) .lock-banner { visibility: hidden; }
.card.locked .soldbox { display: none; }
.lock-pill { display: none; }
.cat-nav .slot[data-k="0"] .card { visibility: hidden; } /* le temps de la flouter */ /* plus de bouton au milieu : un clic n'importe où sur le média ouvre le pop-up */

/* catégories en menu déroulant, en haut à gauche (bureau) */
.catmenu { position: fixed; z-index: 16; top: 37px; left: calc(var(--rail) + 24px); }
.cat-btn { display: inline-flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 700; letter-spacing: -.02em; color: var(--text); }
.cat-chev { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.cat-btn[aria-expanded="true"] .cat-chev { transform: rotate(180deg); }
.cat-list { position: absolute; top: calc(100% + 12px); left: -12px; min-width: 240px; padding: 8px; border-radius: 18px; background: #262a2f; border: 1px solid rgba(255,255,255,.06); box-shadow: 0 16px 40px rgba(0,0,0,.45); }
:root[data-theme="light"] .cat-list { background: #fff; border-color: #eee; box-shadow: 0 16px 40px rgba(0,0,0,.12); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .cat-list { background: #fff; border-color: #eee; box-shadow: 0 16px 40px rgba(0,0,0,.12); } }
.cat-list[hidden] { display: none; }
.cat-items { display: flex; flex-direction: column; }
/* liste façon Instagram : pas de fond sur l'élément choisi, une coche à droite */
.catmenu .cat-items .tab, .catmenu .cat-items .tab.on, .catmenu .cat-items .tab.on:hover { display: flex; align-items: center; justify-content: space-between; text-align: left; width: 100%; font-size: 16px; font-weight: 500; padding: 14px 14px; border-radius: 12px; background: none; color: var(--text); }
.catmenu .cat-items .tab:hover { background: var(--surface-muted); }
.catmenu .cat-items .tab.on::after { content: ''; width: 20px; height: 20px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat; }
/* comme Instagram, le menu reste le même à toutes les largeurs (sur téléphone il passe sur la photo) */
.page-feed .topbar .tabs { display: none; }
@media (max-width: 599px) {
  .catmenu { left: 16px; top: calc(14px + env(safe-area-inset-top)); }
  .cat-btn { color: #fff; font-size: 20px; text-shadow: 0 1px 4px rgba(0,0,0,.45); }
}
@media (max-width: 1099px) { .kbd-help { display: none; } }

.slide-btn { position: absolute; top: 50%; transform: translateY(-50%); z-index: 4; width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,.85); color: #1a1a1a; box-shadow: 0 2px 8px rgba(0,0,0,.25); transition: opacity .15s, background .15s; }
.slide-btn:hover { background: #fff; }
.slide-btn[hidden] { display: none; }
.slide-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.slide-btn.prev { left: 12px; }
.slide-btn.next { right: 12px; }
.slot:not(.active) .slide-btn, .card.locked .slide-btn { display: none; }
@media (max-width: 599px) { .slide-btn { display: none; } }

/* flèches haut / bas, comme Instagram */
.navbtns { position: fixed; right: 24px; top: 50%; transform: translateY(-50%); z-index: 6; display: flex; flex-direction: column; gap: 14px; }
.navbtn { width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--pill-bg); border: 1px solid var(--pill-border); color: var(--pill-fg); }
.navbtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.navbtn:disabled { opacity: .3; cursor: default; }

/* bureau : boutons à droite hors de la carte */
@media (min-width: 600px) {
  .card:not(.gate) { overflow: visible; }
  .actions { right: auto; left: calc(100% + 18px); bottom: 4px; gap: clamp(22px, 3.4cqh, 32px); }
  .card.is-sold .actions { bottom: 4px; }
  .card.desc-open .actions { opacity: 1; pointer-events: auto; }
  .act { color: var(--text); filter: none; }
  .act .ic { width: clamp(26px, 3.6cqh, 32px) !important; height: clamp(26px, 3.6cqh, 32px) !important; }
  .layer.open { border-radius: 0 0 var(--card-radius) var(--card-radius); }
  .page-feed .topbar { height: auto; top: calc((var(--VH) - var(--H)) / 2 + 12px); }
  .page-feed .tabs { background: rgba(0,0,0,.28); border-color: transparent; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
  .page-feed .tab { color: rgba(255,255,255,.85); }
  .page-feed .tab.on { background: #fff; color: #1a1a1a; }
  .page-feed .open-app { position: fixed; top: 33px; right: 24px; }
}
/* grand écran : auteur et texte à gauche hors de la carte, comme Instagram */
@media (min-width: 1100px) {
  .layer { left: auto; right: calc(100% + 28px); width: min(320px, calc((100vw - var(--rail) - var(--W)) / 2 - 56px)); padding: 0; color: var(--text); text-shadow: none; max-height: calc(var(--H) - 80px); }
  /* description longue : hauteur bornée, elle défile dans son bloc (comme la légende Instagram) */
  .layer.open { padding-top: 0; background: none; border-radius: 0; max-height: min(calc(var(--H) * .55), 440px); scrollbar-width: none; overscroll-behavior: contain; }
  .layer.open::-webkit-scrollbar { display: none; }
  .shade { background: linear-gradient(180deg, rgba(0,0,0,.18) 0%, transparent 14%); }
  .avatar { border: 0; } /* pas de cerclage hors de la carte, comme Instagram */
  .tag-outline { border-color: var(--text-muted); background: transparent; }
  .tag-sold { border-color: var(--text); }
  .more { color: var(--text); }
  .dots { top: auto; bottom: 16px; }
  .card.is-sold .dots { top: auto; }
}

/* ---------- invitation ---------- */
.gate { background: #0b2a19; }
.gate-bg { position: absolute; inset: -20px; overflow: hidden; }
.gate-bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); filter: blur(22px); }
/* assombrissement (brightness .55 du handoff) porté par le voile : certains WebKit mobiles ignorent le filtre */
.gate-veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(1,68,33,.55), rgba(0,0,0,.35)), rgba(0,0,0,.45); }
.gate-close { position: absolute; top: 16px; right: 16px; z-index: 3; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.gate-body { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0 48px; gap: 26px; color: #fff; }
.gate-logo { width: 56px; height: 56px; border-radius: 16px; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.gate-title, .modal-title { margin: 0; font-size: clamp(26px, 3.9cqh, 38px); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.gate-sub { margin: 0; font-size: clamp(13px, 1.8cqh, 17px); color: rgba(255,255,255,.8); max-width: min(320px, 80cqw); line-height: 1.5; }
.qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.qr-box { background: #fff; padding: 10px; border-radius: 16px; box-shadow: 0 16px 40px rgba(0,0,0,.35); }
.qr { width: 120px; height: 120px; }
.qr img, .qr canvas { width: 120px !important; height: 120px !important; display: block; }
.qr-cap { margin: 0; font-size: 12px; font-weight: 600; }
.stores { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.store { display: inline-flex; align-items: center; gap: 7px; padding: 10px 18px; border-radius: 999px; border: 1px solid rgba(255,255,255,.45); font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; }
.store:hover { background: rgba(255,255,255,.1); }
.gate-foot { margin: 0; font-size: 12px; color: rgba(255,255,255,.75); }
.open-mobile { display: none; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 999px; background: #fff; color: var(--green); font-size: 14px; font-weight: 700; }

/* ---------- modale QR ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); padding: 16px 16px 16px calc(var(--rail) + 16px); }
.modal[hidden] { display: none; }
.modal-card { position: relative; width: calc(var(--W) - 48px); max-width: 100%; border-radius: var(--card-radius); padding: 44px 20px 32px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 20px; color: #fff; background: linear-gradient(180deg, #0d4a2a, #06210f); box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.modal-title { font-size: 26px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: #fff; color: #1a1a1a; padding: 10px 16px; border-radius: 999px; font-size: 13px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.25); opacity: 0; pointer-events: none; transition: all .25s; z-index: 60; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- profil ---------- */
.profile { padding: var(--header) 16px 48px calc(var(--rail) + 16px); }
.pcol { position: relative; width: 640px; max-width: 100%; margin: 0 auto; display: flex; flex-direction: column; align-items: center; text-align: center; }
.pshare { position: absolute; top: 0; right: 0; color: var(--text); display: inline-flex; }
.pavatar { width: 140px; height: 140px; border-radius: 50%; object-fit: cover; margin-top: 8px; background: var(--surface-muted); }
.pname { font-size: 22px; font-weight: 700; margin: 14px 0 2px; }
.ppseudo { font-size: 16px; color: var(--text-muted); margin: 0 0 4px; }
.pcompany { font-size: 16px; margin: 0 0 4px; }
.pstats { font-size: 16px; margin: 8px 0 14px; }
.pstats b { font-weight: 700; }
.pbtns { display: flex; gap: 10px; width: 100%; margin-bottom: 14px; }
.pbtn { flex: 1; padding: 12px; border-radius: 12px; font-size: 15px; font-weight: 600; background: var(--surface-muted); color: var(--surface-muted-fg); }
.pbtn-main { background: var(--green); color: #fff; }
.pbio { width: 100%; text-align: left; background: var(--surface-muted); border-radius: 12px; padding: 16px 18px; font-size: 15px; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; }
.pbio img.emoji { height: 1.15em; width: 1.15em; vertical-align: -0.2em; margin: 0 .05em; }
.pcontact { width: 100%; margin-top: 10px; padding: 14px; border-radius: 12px; background: var(--surface-muted); color: var(--surface-muted-fg); font-size: 15px; font-weight: 600; }
.ptitle { align-self: flex-start; font-size: 22px; font-weight: 700; margin: 28px 0 12px; }
.grid { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.tile { position: relative; aspect-ratio: 9 / 16; border-radius: 14px; overflow: hidden; background: var(--tile-bg); color: #fff; text-align: left; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.tile:hover img { transform: scale(1.03); }
.tile-shade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,.8) 100%); }
.tile-tag { position: absolute; top: 8px; left: 8px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; background: var(--green); padding: 3px 6px; border-radius: 5px; }
.tile-txt { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; flex-direction: column; gap: 2px; }
.tile-name { font-size: 14px; font-weight: 700; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-price { font-size: 13px; }

/* ---------- index du prototype ---------- */
.idx { padding: calc(var(--header) + 8px) 16px 48px calc(var(--rail) + 16px); max-width: calc(760px + var(--rail)); margin: 0 auto; }
.idx h1 { font-size: 28px; letter-spacing: -.02em; margin: 0 0 8px; }
.idx h2 { font-size: 18px; margin: 28px 0 10px; }
.idx-lead { color: var(--text-muted); line-height: 1.55; margin: 0; }
.idx-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.idx-list a { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: 12px; background: var(--surface-muted); }
.idx-list img { width: 48px; height: 64px; object-fit: cover; border-radius: 8px; flex: none; background: var(--tile-bg); }
.idx-list span { display: flex; flex-direction: column; min-width: 0; }
.idx-list b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idx-list small { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- mobile ---------- */
@media (max-width: 599px) {
  :root { --rail: 0px; }
  .rail, .kbd-help { display: none; }
  .topbar { left: 0; height: 56px; justify-content: flex-start; padding: 0 12px; padding-top: env(safe-area-inset-top); }
  .page-feed .tabs { background: rgba(0,0,0,.28); border-color: transparent; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
  .page-feed .tab { color: rgba(255,255,255,.85); }
  .page-feed .tab.on { background: #fff; color: #1a1a1a; }
  .tab { font-size: 12px; padding: 7px 10px; }
  .open-app { top: calc(10px + env(safe-area-inset-top)); right: 12px; padding: 8px 12px 8px 10px; }
  .page-feed .open-app { background: rgba(0,0,0,.28); border-color: rgba(255,255,255,.18); color: #fff; }
  .oa-long { display: none; }
  .oa-short { display: inline; }
  :root { --H: var(--VH); --W: 100vw; }
  .scroller { top: 0; left: 0; }
  .navbtns { display: none; }
  .modal { padding: 16px; }
  .modal-card { width: 380px; border-radius: 20px; }
  .card { border-radius: 0; box-shadow: none; }
  .slot .card::before { display: none; }
  .actions { right: 0; bottom: calc(96px + env(safe-area-inset-bottom)); gap: 0; }
  .act { padding: 13px 15px; }
  .act .ic { width: 26px !important; height: 26px !important; }
  .layer { padding: 0 64px calc(18px + env(safe-area-inset-bottom)) 16px; }
  .layer.open { padding-right: 16px; }
  .gate-body { padding: 0 32px; gap: 22px; }
  .gate .gate-close { top: calc(64px + env(safe-area-inset-top)); }
  .slot:not(.active) .gate-body { visibility: visible; }
  .gate .qr-wrap, .modal .qr-wrap { display: none; }
  .open-mobile { display: inline-flex; }
  .lb-qr, .lb-desk { display: none; }
  .lb-mob { display: inline; }
  .lock-banner { bottom: calc(14px + env(safe-area-inset-bottom)); }
  .card.locked .layer { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
  .card.locked .actions { bottom: calc(112px + env(safe-area-inset-bottom)); }
  .gate .stores, .modal .stores { display: none; } /* un seul bouton sur téléphone */
  .profile { padding: 64px 16px 40px; }
  .pshare { top: -44px; right: auto; left: 0; }
  .idx { padding: 72px 16px 40px; }
}
