/* Horizon — site client (/app) — système de tokens sémantiques.
   Approche Linear/Vercel/Notion : les couleurs flippent au niveau :root
   selon data-theme + @media prefers-color-scheme. Aucun composant ne
   référence de couleur dure ; tout passe par les tokens.
*/

/* L'attribut hidden doit gagner sur display:grid/flex/etc. */
[hidden] { display: none !important; }

/* ===== Tokens sémantiques — light par défaut ===================== */
:root {
  /* surfaces */
  --bg: #faf7f2;                       /* page bg (proche cream-50) */
  --surface: #ffffff;                  /* cards, panels */
  --surface-2: #f1ece4;                /* nested surfaces */
  --surface-elevated: #ffffff;         /* fixed overlays (top-bar, nav) */

  /* texte */
  --text: #1a1714;                     /* primary */
  --text-soft: #3d3833;                /* secondary */
  --text-muted: #7a7269;               /* tertiary / labels */
  --text-subtle: #a59d92;

  /* bordures */
  --border: #ece5da;
  --border-strong: #d8cfc1;

  /* inputs */
  --input-bg: #ffffff;
  --placeholder: #b7af9f;

  /* boutons primaires (CTA) */
  --btn-primary-bg: #1a1714;
  --btn-primary-text: #ffffff;
  --btn-primary-hover: #c7633e;        /* hover terracotta */

  /* feedback */
  --err-bg: #FBEBE0;
  --err-text: #6a2c12;

  /* ombres */
  --shadow-sm: 0 2px 6px rgba(28, 23, 20, 0.04);
  --shadow-md: 0 8px 24px -6px rgba(28, 23, 20, 0.08);
  --shadow-lg: 0 24px 48px -12px rgba(28, 23, 20, 0.18);
  --shadow-xl: 0 32px 64px -16px rgba(28, 23, 20, 0.22);

  /* accent (immutable across modes) */
  --accent: #c7633e;
  --accent-soft: #fbebe0;
  --accent-strong: #9a4423;
}

/* ===== Dark mode forcé ============================================ */
:root[data-theme="dark"], body[data-theme="dark"] {
  --bg: #0f0c0a;
  --surface: #181513;
  --surface-2: #221d18;
  --surface-elevated: #1c1814;

  --text: #f3eee5;
  --text-soft: #c8c0b3;
  --text-muted: #8e8578;
  --text-subtle: #5e574c;

  --border: #2a241e;
  --border-strong: #3e3629;

  --input-bg: #181513;
  --placeholder: #5e574c;

  --btn-primary-bg: #f3eee5;           /* en dark, CTA = clair-sur-foncé */
  --btn-primary-text: #181513;
  --btn-primary-hover: #c7633e;

  --err-bg: #3a1d10;
  --err-text: #ffb89a;

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px -6px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 32px 64px -16px rgba(0, 0, 0, 0.7);

  --accent: #d97849;                   /* terracotta légèrement plus vif en dark */
  --accent-soft: #2e1a13;
  --accent-strong: #f5a17b;
}

/* ===== Dark mode auto (suit l'OS) ================================= */
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"], body[data-theme="auto"] {
    --bg: #0f0c0a;
    --surface: #181513;
    --surface-2: #221d18;
    --surface-elevated: #1c1814;

    --text: #f3eee5;
    --text-soft: #c8c0b3;
    --text-muted: #8e8578;
    --text-subtle: #5e574c;

    --border: #2a241e;
    --border-strong: #3e3629;

    --input-bg: #181513;
    --placeholder: #5e574c;

    --btn-primary-bg: #f3eee5;
    --btn-primary-text: #181513;
    --btn-primary-hover: #c7633e;

    --err-bg: #3a1d10;
    --err-text: #ffb89a;

    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px -6px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, 0.6);

    --accent: #d97849;
    --accent-soft: #2e1a13;
    --accent-strong: #f5a17b;
  }
}

/* ===== Globals =================================================== */
html, body {
  background: var(--bg);
  color: var(--text);
  transition: background-color .25s ease, color .25s ease;
}

.skip-link {
  position: absolute; top: -40px; left: 1rem;
  background: var(--btn-primary-bg); color: var(--btn-primary-text);
  padding: .5rem 1rem; border-radius: var(--r-sm); z-index: 1000;
  transition: top .2s;
}
.skip-link:focus { top: 1rem; }

/* ===== Top bar =================================================== */
.app-top {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--bg) 85%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.app-top-inner {
  max-width: 1200px; margin: 0 auto;
  padding: .75rem 1rem; display: flex; align-items: center; gap: 1rem;
}
.brand {
  font-family: var(--font-display); font-size: 1.25rem; letter-spacing: -.02em;
  font-variation-settings: 'opsz' 120, 'SOFT' 60;
  color: var(--text); text-decoration: none; font-weight: 500;
}
.brand .dot { color: var(--accent); margin-right: .15em; }
.app-top-actions { margin-left: auto; display: flex; gap: .35rem; align-items: center; }
.icon-btn {
  position: relative; background: transparent; border: 1px solid var(--border);
  width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; color: var(--text-muted);
  transition: all var(--t) var(--ease);
}
.icon-btn:hover { border-color: var(--text-soft); color: var(--text); }
.bell-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 2px var(--bg);
}

/* ===== Main ====================================================== */
.app-main {
  max-width: 1200px; margin: 0 auto;
  padding: 1.25rem 1rem 6rem;
  min-height: calc(100vh - 60px);
}
@media (min-width: 900px) { .app-main { padding: 2rem 1.6rem 3rem; } }

/* ===== Bottom nav (mobile) / side rail (desktop) ================= */
.app-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in oklab, var(--bg) 90%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-top: 1px solid var(--border);
  padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom));
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: .5rem .25rem; color: var(--text-muted); text-decoration: none;
  font-size: 11px; font-weight: 500;
  transition: color var(--t) var(--ease);
}
.nav-item.active, .nav-item:hover { color: var(--accent); }
.nav-fab {
  background: var(--btn-primary-bg); color: var(--btn-primary-text) !important;
  width: 52px; height: 52px; border-radius: 50%;
  margin: -10px auto 0; box-shadow: var(--shadow-md);
  align-self: center; padding: 0;
}
.nav-fab svg { color: var(--btn-primary-text); }
.nav-fab.active { background: var(--accent); color: #fff !important; }

@media (min-width: 900px) {
  .app-nav {
    position: sticky; top: 60px; bottom: auto;
    grid-template-columns: repeat(5, auto);
    justify-content: center; gap: .5rem;
    border-top: 0; border-bottom: 1px solid var(--border);
    padding: .5rem 1rem;
  }
  .nav-item { flex-direction: row; gap: .5rem; padding: .55rem 1rem; border-radius: var(--r-pill); font-size: var(--step--1); }
  .nav-item.active { background: var(--accent-soft); }
  .nav-fab { margin: 0; width: auto; height: auto; border-radius: var(--r-pill); padding: .55rem 1.1rem; }
}

/* ===== Concierge FAB ============================================ */
.concierge-fab {
  position: fixed; bottom: calc(82px + env(safe-area-inset-bottom)); right: 16px;
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff; border: none; cursor: pointer;
  box-shadow: 0 12px 24px -8px color-mix(in oklab, var(--accent) 60%, transparent);
  display: grid; place-items: center; z-index: 45;
  font-size: 26px; font-family: var(--font-display);
  transition: transform var(--t) var(--ease);
  animation: phenixPulse 4s ease-in-out infinite;
}
.concierge-fab:hover { transform: scale(1.06); }
.concierge-fab .phenix { display: block; transform: translateY(-1px); }
@keyframes phenixPulse {
  0%, 100% { box-shadow: 0 12px 24px -8px color-mix(in oklab, var(--accent) 60%, transparent); }
  50% { box-shadow: 0 12px 32px -4px color-mix(in oklab, var(--accent) 80%, transparent); }
}
@media (min-width: 900px) {
  .concierge-fab { bottom: 28px; right: 28px; width: 64px; height: 64px; }
}

/* ===== Toasts =================================================== */
.toast-host {
  position: fixed; left: 50%; top: 24px; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: .5rem; z-index: 100;
  pointer-events: none;
}
.toast {
  background: var(--text); color: var(--bg); padding: .8rem 1.2rem;
  border-radius: var(--r-pill); font-size: var(--step--1);
  box-shadow: var(--shadow-md); pointer-events: auto;
  animation: toastIn .3s var(--ease);
}
.toast.success { background: #2e7d32; color: #fff; }
.toast.error { background: var(--accent-strong); color: #fff; }
@keyframes toastIn { from { transform: translateY(-20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ===== Modal ===================================================== */
.modal-host {
  position: fixed; inset: 0; z-index: 200;
  background: color-mix(in oklab, #000 50%, transparent);
  display: grid; place-items: end center;
  animation: fade .2s var(--ease);
}
@media (min-width: 700px) { .modal-host { place-items: center; } }
.modal-card {
  background: var(--surface); color: var(--text);
  width: 100%; max-width: 520px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 1.6rem 1.4rem 2rem;
  max-height: 90vh; overflow-y: auto;
  animation: slideUp .3s var(--ease);
}
@media (min-width: 700px) { .modal-card { border-radius: var(--r-lg); margin-bottom: 0; } }
.modal-card h3 { font-family: var(--font-display); font-size: var(--step-2); font-weight: 500; margin-bottom: .8rem; }
.modal-card .modal-close { float: right; background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 1.5rem; line-height: 1; }
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ===== Auth screens ============================================== */
.auth-screen {
  max-width: 420px; margin: 1.5rem auto;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 2.5rem 1.8rem;
  box-shadow: var(--shadow-md);
}
@media (min-width: 600px) { .auth-screen { margin-top: 4rem; padding: 3rem 2.4rem; } }
.auth-screen h1 {
  font-family: var(--font-display); font-size: var(--step-4); letter-spacing: -.02em;
  font-weight: 400; line-height: 1.05; margin-bottom: .4rem;
  font-variation-settings: 'opsz' 100, 'SOFT' 30;
}
.auth-screen h1 em { color: var(--accent); font-style: italic; }
.auth-screen .sub { color: var(--text-muted); margin-bottom: 2rem; font-size: var(--step-0); }
.auth-screen .form-row { margin-bottom: 1.2rem; }
.auth-screen label { display: block; font-size: var(--step--1); color: var(--text-soft); margin-bottom: .3rem; font-weight: 500; }
.auth-screen .err {
  background: var(--err-bg); color: var(--err-text);
  padding: .7rem 1rem; border-radius: var(--r-sm);
  margin-bottom: 1rem; font-size: var(--step--1);
}
.auth-screen .btn-primary {
  width: 100%; padding: .9rem 1.2rem;
  background: var(--btn-primary-bg); color: var(--btn-primary-text);
  border: none; border-radius: var(--r-pill);
  font: 500 var(--step-0) var(--font-body); cursor: pointer;
  transition: all var(--t) var(--ease);
}
.auth-screen .btn-primary:hover { background: var(--btn-primary-hover); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.auth-screen .btn-primary:disabled { opacity: .5; cursor: wait; }
.auth-screen .btn-secondary {
  width: 100%; padding: .8rem 1.2rem; background: transparent; color: var(--text-soft);
  border: 1px solid var(--border-strong); border-radius: var(--r-pill);
  font: 500 var(--step--1) var(--font-body); cursor: pointer; margin-top: .6rem;
}
.auth-screen .btn-secondary:hover { border-color: var(--text); color: var(--text); }
.auth-screen .divider {
  text-align: center; margin: 1.5rem 0; color: var(--text-subtle);
  font-size: var(--step--2); font-family: var(--font-mono); letter-spacing: .15em;
}
.auth-screen .oauth-row { display: grid; gap: .6rem; }

/* ===== Inputs (globaux dans /app) =============================== */
input, textarea, select {
  background: var(--input-bg); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  font: 400 var(--step-0) var(--font-body);
  transition: border-color var(--t) var(--ease);
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 18%, transparent);
}
input::placeholder, textarea::placeholder { color: var(--placeholder); }
.auth-screen input, .auth-screen select {
  width: 100%; box-sizing: border-box; padding: .75rem .9rem;
}

/* ===== Boutons ==================================================== */
.oauth-btn {
  display: flex; align-items: center; justify-content: center; gap: .8rem;
  padding: .75rem 1rem; background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--r-pill);
  font: 500 var(--step--1) var(--font-body); cursor: pointer;
  transition: all var(--t) var(--ease);
}
.oauth-btn:hover { border-color: var(--text); }

.btn-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .9rem 1.6rem; background: var(--btn-primary-bg); color: var(--btn-primary-text);
  border: none; border-radius: var(--r-pill); cursor: pointer;
  font: 500 var(--step-0) var(--font-body);
  transition: all var(--t) var(--ease); text-decoration: none;
}
.btn-cta:hover { background: var(--btn-primary-hover); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-cta:disabled { opacity: .5; cursor: not-allowed; }

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .65rem 1.3rem; background: transparent; color: var(--text-soft);
  border: 1px solid var(--border-strong); border-radius: var(--r-pill);
  cursor: pointer; font: 500 var(--step--1) var(--font-body);
  transition: all var(--t) var(--ease); text-decoration: none;
}
.btn-ghost:hover { border-color: var(--text); color: var(--text); }

/* ===== Onboarding ================================================ */
.onb-screen { max-width: 460px; margin: 0 auto; padding: 1rem; }
.onb-progress { height: 3px; background: var(--surface-2); border-radius: 999px; margin-bottom: 2rem; overflow: hidden; }
.onb-progress-fill { height: 100%; background: var(--accent); transition: width .4s var(--ease); }
.onb-step h2 { font-family: var(--font-display); font-size: var(--step-3); font-weight: 400; line-height: 1.1; margin-bottom: .6rem; letter-spacing: -.015em; color: var(--text); }
.onb-step .h-sub { color: var(--text-muted); margin-bottom: 1.6rem; }
.onb-step .actions { display: flex; gap: .5rem; margin-top: 1.6rem; }
.onb-step .actions button { flex: 1; }
.chip-grid { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  padding: .5rem 1rem; border: 1px solid var(--border-strong);
  border-radius: var(--r-pill); cursor: pointer; user-select: none;
  font-size: var(--step--1); transition: all var(--t) var(--ease);
  background: var(--surface); color: var(--text-soft);
}
.chip:hover { border-color: var(--text-soft); color: var(--text); }
.chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ===== Discover ================================================== */
.discover-hero {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 1.5rem;
}
.discover-hero h1 { font-family: var(--font-display); font-size: var(--step-3); font-weight: 400; line-height: 1.1; flex: 1; color: var(--text); }
.search-bar { position: relative; margin-bottom: 1rem; }
.search-bar input {
  width: 100%; box-sizing: border-box;
  padding: .85rem 1rem .85rem 2.6rem;
  border-radius: var(--r-pill);
}
.search-bar svg { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.filter-row {
  display: flex; gap: .5rem; overflow-x: auto;
  margin-bottom: 1.4rem; padding-bottom: .3rem;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.filter-row::-webkit-scrollbar { display: none; }
.filter-row .chip { white-space: nowrap; }

.view-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: var(--r-pill); padding: 2px; margin-bottom: 1rem; background: var(--surface); }
.view-toggle button { background: transparent; border: 0; padding: .4rem .9rem; font-size: var(--step--1); border-radius: var(--r-pill); cursor: pointer; color: var(--text-muted); }
.view-toggle button.active { background: var(--btn-primary-bg); color: var(--btn-primary-text); }

select { padding: .4rem .8rem; border-radius: var(--r-pill); cursor: pointer; }

.resto-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 600px) { .resto-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .resto-grid { grid-template-columns: repeat(3, 1fr); } }
.resto-card {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-md); overflow: hidden;
  cursor: pointer; transition: all var(--t) var(--ease);
  display: flex; flex-direction: column;
}
.resto-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.resto-card .cover { aspect-ratio: 16/9; background: var(--surface-2); position: relative; overflow: hidden; }
.resto-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.resto-card .cover .badge {
  position: absolute; top: .6rem; left: .6rem;
  background: rgba(0,0,0,.7); color: #fff;
  padding: .25rem .6rem; border-radius: var(--r-pill);
  font-size: 11px; font-weight: 500; letter-spacing: .04em;
  font-family: var(--font-mono);
}
.resto-card .body { padding: 1rem 1.1rem; flex: 1; display: flex; flex-direction: column; gap: .35rem; }
.resto-card .name { font-family: var(--font-display); font-size: var(--step-1); font-weight: 500; color: var(--text); }
.resto-card .meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); letter-spacing: .04em; text-transform: uppercase; }
.resto-card .stats-row { display: flex; gap: .8rem; font-size: var(--step--1); margin-top: .3rem; color: var(--text-soft); }
.resto-card .stats-row .star { color: var(--accent); }

/* ===== Restaurant detail ========================================= */
.resto-detail { max-width: 800px; margin: 0 auto; }
.resto-detail .cover-banner { aspect-ratio: 16/8; background: var(--surface-2); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 1.4rem; }
.resto-detail h1 { font-family: var(--font-display); font-size: var(--step-4); font-weight: 400; letter-spacing: -.02em; margin-bottom: .3rem; color: var(--text); }
.resto-detail .resto-meta { color: var(--text-muted); margin-bottom: 1.6rem; }
.section {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 1.4rem 1.4rem; margin-bottom: 1rem;
}
.section h2 { font-family: var(--font-display); font-size: var(--step-2); font-weight: 500; margin-bottom: .9rem; letter-spacing: -.01em; color: var(--text); }
.section h3 { font-family: var(--font-display); font-size: var(--step-1); font-weight: 500; margin: .8rem 0 .5rem; color: var(--text); }

/* ===== Slot picker ============================================== */
.slot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: .5rem; }
.slot {
  text-align: center; padding: .6rem .4rem;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text);
  cursor: pointer; font-family: var(--font-mono); font-size: var(--step--1);
  transition: all var(--t) var(--ease);
}
.slot:hover:not(:disabled) { border-color: var(--accent); }
.slot.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.slot:disabled { opacity: .35; cursor: not-allowed; text-decoration: line-through; }

/* ===== Battle pass ============================================== */
.tier-card {
  background: linear-gradient(135deg, color-mix(in oklab, var(--accent) 12%, var(--surface)), var(--surface));
  color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 1.6rem; margin-bottom: 1.5rem;
}
.tier-name { font-family: var(--font-display); font-size: var(--step-3); font-weight: 400; color: var(--text); }
.tier-progress { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin: 1rem 0 .5rem; }
.tier-progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-strong)); transition: width .6s var(--ease); }
.tier-xp { font-family: var(--font-mono); font-size: var(--step--1); color: var(--text-muted); }

.achv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .8rem; }
.achv-cell {
  text-align: center; padding: 1rem .6rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); transition: transform var(--t) var(--ease);
  position: relative; color: var(--text);
}
.achv-cell:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.achv-cell .icon { font-size: 2rem; margin-bottom: .4rem; }
.achv-cell .label { font-size: var(--step--2); color: var(--text-soft); font-weight: 500; }
.achv-cell.locked .icon { filter: grayscale(1); opacity: .35; }
.achv-cell.locked .label { color: var(--text-subtle); }
.achv-cell.legendary { border-color: gold; background: linear-gradient(135deg, color-mix(in oklab, gold 15%, var(--surface)), var(--surface)); }
.achv-cell .rarity { position: absolute; top: 4px; right: 4px; font-size: 9px; font-family: var(--font-mono); padding: 1px 5px; border-radius: 999px; background: var(--btn-primary-bg); color: var(--btn-primary-text); }

/* ===== Stats / charts ============================================ */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-bottom: 1rem; }
@media (min-width: 700px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-cell {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 1rem;
}
.stat-cell .num { font-family: var(--font-display); font-size: var(--step-3); font-weight: 500; color: var(--text); }
.stat-cell .lbl { font-size: var(--step--2); color: var(--text-muted); font-family: var(--font-mono); letter-spacing: .04em; text-transform: uppercase; }

.heatmap { display: grid; grid-template-columns: 40px repeat(7, 1fr); gap: 3px; font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); }
.heatmap .col-h { text-align: center; padding-bottom: .3rem; }
.heatmap .row-h { padding-right: .3rem; text-align: right; }
.heatmap .cell { aspect-ratio: 1; border-radius: 3px; background: var(--surface-2); }
.heatmap .cell[data-v="1"] { background: color-mix(in oklab, var(--accent) 25%, var(--surface-2)); }
.heatmap .cell[data-v="2"] { background: color-mix(in oklab, var(--accent) 50%, var(--surface-2)); }
.heatmap .cell[data-v="3"] { background: color-mix(in oklab, var(--accent) 80%, var(--surface-2)); }
.heatmap .cell[data-v="4"] { background: var(--accent); }

/* ===== Concierge chat ============================================ */
.concierge-shell {
  display: flex; flex-direction: column; height: 75vh;
  max-width: 700px; margin: 0 auto;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden;
}
.concierge-msgs { flex: 1; overflow-y: auto; padding: 1.2rem; display: flex; flex-direction: column; gap: .8rem; }
.msg { max-width: 80%; padding: .6rem .9rem; border-radius: var(--r-md); font-size: var(--step-0); line-height: 1.4; word-wrap: break-word; }
.msg.user { align-self: flex-end; background: var(--btn-primary-bg); color: var(--btn-primary-text); border-bottom-right-radius: 4px; }
.msg.assistant { align-self: flex-start; background: var(--surface-2); color: var(--text); border-bottom-left-radius: 4px; }
.msg-input-row { display: flex; gap: .5rem; padding: .8rem; border-top: 1px solid var(--border); background: var(--surface); }
.msg-input-row input { flex: 1; padding: .7rem 1rem; border-radius: var(--r-pill); }
.msg-input-row button { padding: .7rem 1.4rem; border: none; background: var(--btn-primary-bg); color: var(--btn-primary-text); border-radius: var(--r-pill); cursor: pointer; font-weight: 500; }

/* ===== Profile / privacy ========================================= */
.profile-hero { display: flex; gap: 1.2rem; align-items: center; margin-bottom: 1.6rem; }
.avatar { width: 84px; height: 84px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-family: var(--font-display); font-size: 2rem; color: var(--accent); border: 3px solid var(--bg); flex-shrink: 0; }
.avatar.premium { border-color: gold; box-shadow: 0 0 0 4px color-mix(in oklab, gold 30%, transparent); }
.profile-hero .name { font-family: var(--font-display); font-size: var(--step-3); font-weight: 500; color: var(--text); }
.profile-hero .username { color: var(--text-muted); font-family: var(--font-mono); font-size: var(--step--1); }
.privacy-row { display: flex; justify-content: space-between; align-items: center; padding: .7rem 0; border-top: 1px solid var(--border); }
.privacy-row:first-child { border-top: 0; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: var(--r-pill); padding: 2px; }
.seg button { background: transparent; border: 0; padding: .35rem .8rem; font-size: 11px; font-family: var(--font-mono); border-radius: var(--r-pill); cursor: pointer; color: var(--text-muted); letter-spacing: .04em; text-transform: uppercase; }
.seg button.active { background: var(--btn-primary-bg); color: var(--btn-primary-text); }

/* ===== Empty / loader ============================================ */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty-state .mark { font-family: var(--font-display); color: var(--accent); font-size: 3rem; margin-bottom: .6rem; }
.spinner { width: 24px; height: 24px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin: 2rem auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Friends + feed ============================================ */
.friends-tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.friends-tabs a { padding: .6rem .9rem; cursor: pointer; color: var(--text-muted); border-bottom: 2px solid transparent; font-size: var(--step--1); font-weight: 500; }
.friends-tabs a.active { color: var(--text); border-color: var(--accent); }
.feed-post { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-md); padding: 1.2rem; margin-bottom: .8rem; }
.feed-post .head { display: flex; gap: .6rem; align-items: center; margin-bottom: .6rem; }
.feed-post .head .av { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; color: var(--accent); font-family: var(--font-display); }
.feed-post .head strong { font-size: var(--step--1); color: var(--text); }
.feed-post .head small { color: var(--text-muted); font-family: var(--font-mono); font-size: 11px; }
.feed-post p { font-size: var(--step--1); line-height: 1.5; color: var(--text); }
.feed-post .actions { display: flex; gap: .8rem; margin-top: .6rem; font-size: var(--step--1); color: var(--text-muted); }
.feed-post .actions button { background: transparent; border: 0; cursor: pointer; color: inherit; display: inline-flex; gap: .25rem; align-items: center; }
.feed-post .actions button.liked { color: var(--accent); }

/* ===== QR scanner ================================================ */
.qr-scanner { max-width: 400px; margin: 0 auto; aspect-ratio: 1; border-radius: var(--r-lg); overflow: hidden; background: #000; position: relative; }
.qr-scanner video { width: 100%; height: 100%; object-fit: cover; }
.qr-scanner .frame { position: absolute; inset: 20%; border: 3px solid var(--accent); border-radius: var(--r-md); pointer-events: none; }

/* ===== Wrap (Spotify-like) ====================================== */
.wrap-stories { max-width: 420px; margin: 0 auto; aspect-ratio: 9/16; border-radius: var(--r-lg); overflow: hidden; position: relative; background: linear-gradient(135deg, var(--accent), #1a1714); color: #fff; }
.wrap-card { position: absolute; inset: 0; padding: 2.5rem 1.6rem; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.wrap-card .label { font-size: var(--step--1); letter-spacing: .15em; text-transform: uppercase; opacity: .7; margin-bottom: 1rem; }
.wrap-card .num { font-family: var(--font-display); font-size: 5rem; font-weight: 400; line-height: 1; margin-bottom: 1rem; }
.wrap-card .desc { font-family: var(--font-display); font-size: var(--step-1); }

/* ===== Walkthrough interactif ==================================== */
#tourOverlay { position: fixed; inset: 0; z-index: 300; pointer-events: none; }
#tourOverlay rect[mask] { pointer-events: auto; }
#tourPopover .tp-card {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.2rem 1.3rem;
  box-shadow: var(--shadow-xl);
  pointer-events: auto;
  animation: tpIn .2s var(--ease);
}
#tourPopover .tp-step { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); margin-bottom: .3rem; }
#tourPopover .tp-title { font-family: var(--font-display); font-size: var(--step-2); font-weight: 500; letter-spacing: -.01em; margin-bottom: .5rem; color: var(--text); }
#tourPopover .tp-body { font-size: var(--step--1); line-height: 1.5; margin-bottom: 1.1rem; color: var(--text-soft); }
#tourPopover .tp-actions { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
#tourPopover button {
  border: 1px solid var(--border-strong); background: transparent;
  color: var(--text-soft); padding: .45rem .9rem; border-radius: var(--r-pill);
  cursor: pointer; font: 500 var(--step--1) var(--font-body); transition: all var(--t) var(--ease);
}
#tourPopover button:hover { border-color: var(--text); color: var(--text); }
#tourPopover .tp-next { background: var(--btn-primary-bg); color: var(--btn-primary-text); border-color: var(--btn-primary-bg); }
#tourPopover .tp-next:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
@keyframes tpIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ===== Map (Snap-style) ========================================== */
.snap-map { position: relative; width: 100%; height: calc(100vh - 60px - 70px); margin: 0 -1rem; overflow: hidden; background: var(--surface-2); }
@media (min-width: 900px) { .snap-map { height: calc(100vh - 60px - 60px); margin: 0 -1.6rem; border-radius: var(--r-lg); } }
.snap-map .leaflet-container, .snap-map .maplibregl-map { width: 100%; height: 100%; background: var(--surface-2); }
.snap-back {
  position: absolute; top: 12px; left: 12px; z-index: 5;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border);
  padding: .5rem 1rem; border-radius: var(--r-pill);
  text-decoration: none; font-size: var(--step--1); font-weight: 500;
  box-shadow: var(--shadow-md);
  transition: all var(--t) var(--ease);
}
.snap-back:hover { background: var(--text); color: var(--bg); }
.snap-marker {
  width: 56px; height: 56px; border-radius: 50%;
  border: 3px solid #fff;
  background-size: cover; background-position: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.35);
  cursor: pointer; transition: transform .2s ease;
  position: relative;
}
.snap-marker:hover { transform: scale(1.1); }
.snap-marker.tested { border-color: gold; }
.snap-marker .pin-tail {
  position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent;
  border-top: 10px solid #fff;
}
.snap-marker.tested .pin-tail { border-top-color: gold; }
.snap-marker .name-bubble {
  position: absolute; top: -32px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,.85); color: #fff;
  padding: .25rem .7rem; border-radius: var(--r-pill);
  font-size: 11px; font-weight: 500; white-space: nowrap;
  font-family: var(--font-mono); letter-spacing: .03em;
  pointer-events: none;
}
.user-pulse {
  width: 22px; height: 22px; border-radius: 50%;
  background: #4285f4; border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(66,133,244,.5);
  animation: userPulse 2.4s ease-in-out infinite;
}
@keyframes userPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(66,133,244, .5); }
  50% { box-shadow: 0 0 0 16px rgba(66,133,244, 0); }
}
.snap-bottom-sheet {
  position: absolute; bottom: 16px; left: 16px; right: 16px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 1rem 1.2rem;
  box-shadow: var(--shadow-xl);
  animation: sheetUp .3s var(--ease);
  z-index: 1;
}
@keyframes sheetUp { from { transform: translateY(100%); opacity: 0; } to { transform: none; opacity: 1; } }
.snap-bottom-sheet .row-header { display: flex; gap: .8rem; align-items: center; margin-bottom: .8rem; }
.snap-bottom-sheet .row-header img { width: 64px; height: 64px; border-radius: var(--r-md); object-fit: cover; flex-shrink: 0; }
.snap-bottom-sheet .row-header h3 { font-family: var(--font-display); font-size: var(--step-1); font-weight: 500; color: var(--text); margin: 0; }
.snap-bottom-sheet .row-header small { color: var(--text-muted); font-size: var(--step--2); }
.snap-bottom-sheet .map-actions { display: flex; gap: .5rem; }
.snap-bottom-sheet .map-actions a { flex: 1; }

/* ===== Cover carousel (auto-rotate) ============================== */
.cover-carousel { position: relative; }
.cover-carousel img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .8s ease;
}
.cover-carousel img.active { opacity: 1; }
/* Pour les .resto-card .cover qui sont déjà position:relative */
.resto-card .cover.cover-carousel img { position: absolute; inset: 0; }
.resto-detail .cover-banner.cover-carousel { position: relative; }

/* ===== Time wheels (hour : minute) =============================== */
.time-wheels { display: flex; align-items: center; justify-content: center; gap: .8rem; max-width: 380px; margin: 0 auto; }
.time-wheels .ios-wheel { flex: 1; min-width: 100px; max-width: 140px; }
.time-sep { font-family: var(--font-mono); font-size: 2rem; font-weight: 500; color: var(--text); padding: 0 .2rem; }

/* ===== iOS-style time wheel picker =============================== */
.ios-wheel {
  position: relative;
  height: 200px;
  overflow: hidden;
  background: var(--surface-2);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  user-select: none;
}
.ios-wheel-mask {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom,
    var(--surface-2) 0%,
    color-mix(in oklab, var(--surface-2) 60%, transparent) 30%,
    transparent 45%,
    transparent 55%,
    color-mix(in oklab, var(--surface-2) 60%, transparent) 70%,
    var(--surface-2) 100%);
  pointer-events: none;
  z-index: 2;
}
.ios-wheel-selected {
  position: absolute; left: 0; right: 0;
  top: 50%; height: 44px;
  margin-top: -22px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  pointer-events: none;
  z-index: 1;
}
.ios-wheel-track {
  position: absolute; left: 0; right: 0; top: 0;
  padding: 78px 0; /* 200/2 - 22 = 78 visible row offset */
  scroll-snap-type: y mandatory;
  overflow-y: scroll;
  height: 100%; box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.ios-wheel-track::-webkit-scrollbar { display: none; }
.ios-wheel-item {
  height: 44px; line-height: 44px;
  text-align: center;
  font-family: var(--font-mono); font-size: 1.4rem;
  color: var(--text-muted);
  scroll-snap-align: center;
  transition: color .2s, font-size .2s, opacity .2s;
  cursor: pointer;
}
.ios-wheel-item.selected { color: var(--text); font-size: 1.7rem; font-weight: 500; }
.ios-wheel-item.unavailable { opacity: .25; cursor: not-allowed; scroll-snap-align: none; }
.ios-wheel-item.unavailable.selected { font-size: 1.4rem; opacity: .25; color: var(--text-muted); font-weight: 400; }
.ios-wheel.disabled { opacity: .5; pointer-events: none; }

/* ===== Photos strip + lightbox =================================== */
.photo-strip { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .3rem; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.photo-strip::-webkit-scrollbar { height: 6px; }
.photo-strip::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }
.photo-thumb { flex: 0 0 auto; padding: 0; border: 0; background: transparent; cursor: pointer; border-radius: var(--r-sm); overflow: hidden; }
.photo-thumb img { width: 200px; height: 140px; object-fit: cover; display: block; transition: transform .2s var(--ease); }
.photo-thumb:hover img { transform: scale(1.04); }
.photo-lightbox {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.92);
  display: grid; place-items: center;
  animation: fade .2s var(--ease);
}
.photo-lightbox img { max-width: 96vw; max-height: 92vh; object-fit: contain; }
.photo-lightbox .lb-close, .photo-lightbox .lb-prev, .photo-lightbox .lb-next {
  position: absolute; background: rgba(255,255,255,.1); color: #fff;
  border: 0; cursor: pointer; backdrop-filter: blur(8px);
  display: grid; place-items: center; transition: background .2s;
}
.photo-lightbox .lb-close:hover, .photo-lightbox .lb-prev:hover, .photo-lightbox .lb-next:hover { background: rgba(255,255,255,.25); }
.photo-lightbox .lb-close { top: 16px; right: 16px; width: 44px; height: 44px; border-radius: 50%; font-size: 28px; }
.photo-lightbox .lb-prev, .photo-lightbox .lb-next { top: 50%; transform: translateY(-50%); width: 56px; height: 56px; border-radius: 50%; font-size: 32px; }
.photo-lightbox .lb-prev { left: 16px; }
.photo-lightbox .lb-next { right: 16px; }
.photo-lightbox .lb-counter { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,.7); font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; }

/* ===== Misc ====================================================== */
.row { display: flex; gap: .6rem; align-items: center; }
.row.between { justify-content: space-between; }
.row.gap-lg { gap: 1.2rem; }
.col { display: flex; flex-direction: column; gap: .4rem; }
.muted { color: var(--text-muted); }
.tag { display: inline-block; padding: .15rem .55rem; background: var(--surface-2); color: var(--text-soft); border-radius: var(--r-pill); font-size: 11px; font-family: var(--font-mono); letter-spacing: .04em; }
.tag.gold { background: gold; color: #1a1714; font-weight: 600; }
.divider-h { height: 1px; background: var(--border); margin: 1rem 0; }
