:root {
  color-scheme: dark;
  /* Surfaces « noir chaud quasi-OLED » alignées sur l'app Android (Color.kt :
     Ink/InkElevated/InkTile/InkOutline) — neutres légèrement chaudes, échelonnées
     bg < bg-soft < card. L'accent reste personnalisable (caméléon) ; seules les
     surfaces sont fixes, comme sur Android (« pas de Material You »). */
  --bg: #0b0c0b;
  --bg-soft: #141614;
  --card: #1b1e1b;
  --line: #2a2e2b;
  --fg: #ecefec;
  --muted: #8c938c;
  /* Accent par défaut : Indigo Teams (le sélecteur caméléon permet d'en changer). */
  --accent: #8b8ff5;
  --accent-strong: #6f74ee;
  --danger: #f0717a;
  --radius: 14px;
  --maxw: 460px;
  /* Surfaces enfoncées (champs, puces) — variabilisées pour le thème clair */
  --inset: #0a0b0a;
  --chip: #20231f;
  /* Échelle d'élévation (ombres) — façon Fluent/Teams : 1=repos, 2=survol, 3=flottant.
     Sur fond sombre, ombres noires franches ; adoucies en clair (cf. data-theme). */
  --elev-1: 0 1px 2px rgba(0, 0, 0, .32);
  --elev-2: 0 6px 16px -6px rgba(0, 0, 0, .48);
  --elev-3: 0 18px 44px -12px rgba(0, 0, 0, .58);
  /* Accents dérivés (suivent la palette caméléon via color-mix) :
     --accent-ink  = accent utilisé comme TEXTE/icône (assez foncé pour le contraste)
     --accent-soft = fond teinté léger (puces, halos)
     --accent-line = bordure teintée
     --on-accent   = texte posé SUR un fond accent (pastel) */
  --accent-ink: var(--accent);
  --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent);
  --accent-line: color-mix(in srgb, var(--accent) 42%, transparent);
  --on-accent: #0b0d12;
  /* Vert sémantique (statuts « en ligne / public / ami / libre / ok ») */
  --success: #7fdca0;
  /* Indice de débordement (scroll-shadows). Sur fond sombre, une ombre noire
     est invisible → on utilise une teinte CLAIRE (léger halo au bord scrollable). */
  --scroll-shadow: rgba(255, 255, 255, .14);

  /* ===================== v3 2026 — langage visuel ======================
     Couche de tokens ajoutée pour la refonte : typographie affirmée,
     hiérarchie de texte à 3 niveaux (fg / fg-soft / muted), reliefs de
     profondeur (hairline + liseré lumineux) et mouvement « spring ». */
  /* Texte secondaire à contraste renforcé : entre --fg et --muted. */
  --fg-soft: #b9bfb8;
  /* Échelle typographique en rem (plancher 12px = pas de texte plus petit). */
  --t-2xs: 0.75rem;    /* 12px — légendes, badges, libellés de nav */
  --t-xs: 0.8125rem;   /* 13px */
  --t-sm: 0.875rem;    /* 14px */
  --t-base: 1rem;      /* 16px — corps */
  --t-md: 1.125rem;    /* 18px */
  --t-lg: 1.375rem;    /* 22px */
  --t-xl: 1.75rem;     /* 28px */
  --t-2xl: 2.25rem;    /* 36px — grands titres */
  /* Reliefs : filet stable en thème + liseré lumineux en haut des surfaces. */
  --hairline: color-mix(in srgb, var(--fg) 13%, transparent);
  --highlight: inset 0 1px 0 color-mix(in srgb, #fff 7%, transparent);
  /* Police mono — signature « identité + dev tool » : @handles, clé, numéros,
     blocs de config MCP. Utilise JetBrains/Geist Mono si présents, sinon repli
     système (aucun webfont chargé → zéro coût perf). */
  --font-mono: "JetBrains Mono", "Geist Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  /* Mouvement unifié : sortie « décélérée », ressort discret, durées étagées. */
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .64, 1);
  --dur-fast: 140ms;
  --dur: 220ms;
  --dur-slow: 340ms;
  /* ── Bulles de chat (style WhatsApp) ── */
  --bbl-theirs:      #1e2b31;
  --bbl-theirs-fg:   #d0d8db;
  --bbl-meta:        rgba(255,255,255,.52);
  --bbl-ticks-read:  #53bdeb;
}

/* Mode clair — bascule via data-theme="light" sur <html> */
:root[data-theme="light"] {
  color-scheme: light;
  --bbl-theirs:      #ffffff;
  --bbl-theirs-fg:   #111b21;
  --bbl-meta:        rgba(0,0,0,.45);
  --bbl-ticks-read:  #25a489;
  /* Surfaces lavande très désaturées (clair) — pendant doux du blue-black sombre. */
  --bg: #f3f4fb;
  --bg-soft: #e9ebf6;
  --card: #ffffff;
  --line: #dde0ef;
  --fg: #1b2030;
  --muted: #5d6675;
  --danger: #d6454e;
  --inset: #eef0fa;
  --chip: #e7eaf7;
  /* Élévation adoucie en clair : ombres bleutées légères (jamais noir pur). */
  --elev-1: 0 1px 2px rgba(20, 28, 60, .08);
  --elev-2: 0 6px 16px -6px rgba(20, 28, 60, .14);
  --elev-3: 0 18px 44px -12px rgba(20, 28, 60, .20);
  /* En clair, on assombrit l'accent pour le texte (les pastels passent ~2.3:1
     sur blanc → illisibles). Mix vers un encre sombre → contraste ≥ 4.5:1
     tout en gardant la teinte choisie (suit la palette caméléon). */
  --accent-ink: color-mix(in srgb, var(--accent) 52%, #131a2b);
  --accent-soft: color-mix(in srgb, var(--accent) 18%, #ffffff);
  --accent-line: color-mix(in srgb, var(--accent) 50%, #ffffff);
  /* Le vert pastel sombre devient illisible sur blanc → vert profond (≈5:1). */
  --success: #0e7048;
  /* En clair, l'ombre de débordement classique (noir translucide) fonctionne. */
  --scroll-shadow: rgba(0, 0, 0, .20);

  /* v3 : texte secondaire lisible sur fond clair ; liseré lumineux quasi nul
     (les surfaces claires se distinguent par l'ombre, pas par un highlight). */
  --fg-soft: #495061;
  --highlight: inset 0 1px 0 color-mix(in srgb, #fff 60%, transparent);
}

* { box-sizing: border-box; }

/* garde-fou horizontal : `clip` (et non `hidden`) — `hidden` force overflow-y:auto,
   ce qui crée un conteneur de défilement et casse `position: sticky` (barre d'ancres). */
html, body { overflow-x: clip; max-width: 100%; }


html { scroll-behavior: smooth; }

/* Trois teintes ENREGISTRÉES comme <color> : @property les rend interpolables,
   donc animables en douceur (impossible avec des custom props ordinaires). Elles
   cyclent une palette caméléon → les halos changent lentement de couleur. */
@property --h1 { syntax: "<color>"; inherits: false; initial-value: #8b5cf6; }
@property --h2 { syntax: "<color>"; inherits: false; initial-value: #43b58f; }
@property --h3 { syntax: "<color>"; inherits: false; initial-value: #6366f1; }

/* Fond ambiant fixe, sous tout le contenu. Halos radiaux teintés par --h1..3,
   + vignette. `fixed` (reste en place au défilement), `pointer-events:none`. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(70% 60% at 18% 12%, color-mix(in srgb, var(--h1) 42%, transparent), transparent 55%),
    radial-gradient(65% 60% at 88% 22%, color-mix(in srgb, var(--h2) 34%, transparent), transparent 55%),
    radial-gradient(85% 75% at 60% 105%, color-mix(in srgb, var(--h3) 34%, transparent), transparent 60%),
    radial-gradient(130% 120% at 50% 45%, transparent 52%, color-mix(in srgb, #000 55%, transparent) 100%);
  animation: hue-cycle 32s ease-in-out infinite;
}
/* Thème clair : mêmes halos, atténués (le fond lavande est déjà lumineux). */
:root[data-theme="light"] body::before { opacity: .62; }

@keyframes hue-cycle {
  0%,100% { --h1: #8b5cf6; --h2: #43b58f; --h3: #6366f1; }  /* violet · vert Milo · indigo */
  20%     { --h1: #6366f1; --h2: #22c3a6; --h3: #a855f7; }  /* indigo · teal · pourpre */
  40%     { --h1: #22c3a6; --h2: #f472b6; --h3: #8b5cf6; }  /* teal · rose · violet */
  60%     { --h1: #eab308; --h2: #8b5cf6; --h3: #43b58f; }  /* ambre · violet · vert */
  80%     { --h1: #f472b6; --h2: #6366f1; --h3: #22c3a6; }  /* rose · indigo · teal */
}
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg);
  color: var(--fg);
  /* v3 : corps à 16px (évite le zoom auto iOS), interligne plus aéré, léger
     resserrement de l'interlettrage pour un rendu plus net façon 2026. */
  font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent-ink); }

/* Bouton « caméléon » — marque visuelle des actions d'authentification
   mindlog.id : un dégradé multicolore qui glisse lentement, en écho au
   caméléon Milo qui change de couleur. Respecte prefers-reduced-motion. */
.btn.primary.chameleon, .btn.chameleon {
  color: #fff;
  border: none;
  background: linear-gradient(100deg,
    #8b5cf6, #6366f1, #22c3a6, #43b58f, #eab308, #f472b6, #a855f7, #8b5cf6);
  background-size: 280% 100%;
  animation: chameleon-shift 9s ease-in-out infinite;
  box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--accent) 55%, transparent);
}
.btn.primary.chameleon:hover, .btn.chameleon:hover { filter: brightness(1.06) saturate(1.08); background-position: 100% 50%; border-color: transparent; }
.btn.primary.chameleon .icon, .btn.chameleon .icon { color: #fff; }
/* Footer de l'écran d'auth : version + crédit le-lab.net, discret, en bas. */
[data-view="auth"] .app-foot {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: flex; flex-wrap: wrap; gap: .45rem; justify-content: center; align-items: center;
  padding: .9rem 1rem; font-size: .82rem; color: var(--muted);
}
[data-view="auth"] .app-foot .sep { opacity: .5; }
[data-view="auth"] .app-foot a { color: color-mix(in srgb, var(--accent) 68%, var(--fg)); text-decoration: none; }
[data-view="auth"] .app-foot a:hover { text-decoration: underline; }

/* ── Écran de connexion — refonte « soignée » ──────────────────────────────
   Backdrop caméléon cohérent (glows haut/bas qui ENCADRENT la carte, plus de
   halos épars « vides »), carte glass nettement détachée du fond, logo en
   pastille circulaire avec halo propre. */
#app[data-view="auth"] {
  position: relative; overflow: hidden;
  background: var(--bg);
  padding: 1.25rem;
}
/* Backdrop animé en ::before (même recette éprouvée que body::before : anime
   --h1..3 via hue-cycle → les dégradés changent de couleurs). */
#app[data-view="auth"]::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(115% 70% at 50% -8%, color-mix(in srgb, var(--h1, #8b5cf6) 42%, transparent), transparent 62%),
    radial-gradient(120% 75% at 50% 108%, color-mix(in srgb, var(--h2, #43b58f) 36%, transparent), transparent 62%),
    radial-gradient(90% 60% at 88% 52%, color-mix(in srgb, var(--h3, #6366f1) 30%, transparent), transparent 60%);
  animation: hue-cycle 24s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  #app[data-view="auth"]::before { animation: none; }
}
/* Sans carte : le contenu flotte directement sur le backdrop ambiant (le
   « gros rectangle gris » ne servait à rien sur un fond déjà travaillé). */
[data-view="auth"] .auth-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 360px; margin: auto;
  padding: 1.5rem 1.25rem; text-align: center;
}
/* Logo : pastille ronde surélevée + ANNEAU dégradé net (masque radial → un vrai
   cercle, pas le « diamant » d'un conic-gradient flouté) + glow violet doux. */
.auth-logo {
  position: relative; width: 112px; height: 96px; margin: 0 auto 1rem;
  display: grid; place-items: center;
}
.auth-logo svg { position: relative; z-index: 1; width: 84px; height: 84px; overflow: visible; }
/* Glow radial (circulaire par nature → aucun artefact anguleux), doux et pulsé. */
.auth-logo-ring {
  position: absolute; inset: -16px; z-index: 0; border-radius: 50%;
  background:
    radial-gradient(circle at 42% 40%, color-mix(in srgb, var(--h1, #8b5cf6) 60%, transparent), transparent 62%),
    radial-gradient(circle at 62% 66%, color-mix(in srgb, var(--h2, #43b58f) 48%, transparent), transparent 62%);
  filter: blur(11px);
  animation: auth-glow-pulse 4.5s ease-in-out infinite;
}
@keyframes auth-glow-pulse {
  0%, 100% { opacity: .6; transform: scale(1); }
  50% { opacity: .85; transform: scale(1.06); }
}
.auth-title { margin: 0 0 .4rem; font-size: 1.72rem; font-weight: 800; letter-spacing: -.015em; }
.auth-title b { color: var(--accent-ink); }
.auth-tagline { margin: 0 auto 1.6rem; max-width: 19rem; font-size: .92rem; line-height: 1.55; color: var(--muted); }
.auth-actions { display: flex; flex-direction: column; gap: .55rem; }
.auth-actions .btn { min-height: 48px; font-size: .96rem; border-radius: 14px; }
@media (prefers-reduced-motion: reduce) { .auth-logo-ring { animation: none; } }

@keyframes chameleon-shift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .btn.primary.chameleon, .btn.chameleon { animation: none; background-position: 30% 50%; }
}

#app { width: 100%; flex: 1; display: flex; flex-direction: column; align-items: center; }
#app[data-view="private"] { justify-content: center; }
/* Page identité : en-tête collant tout en haut, contenu centré horizontalement
   ET verticalement. #app remplit déjà la hauteur (body 100dvh, flex:1) ; le
   header garde sa place en haut, .pub-page absorbe l'espace restant via des
   marges auto (→ centrage vertical ; se réduit à 0 si le contenu déborde). */
#app[data-view="profile"] { justify-content: flex-start; }
#app[data-view="profile"] .pub-page { margin-block: auto; }
/* Nouvelle vue héro : full-width, pas de max-width ni de centrage vertical */
#app[data-view="profile"]:has(.pub-hero-page) { align-items: stretch; }
#app[data-view="profile"] .pub-hero-page { margin: 0; padding: 0; width: 100%; }

/* ── Le topbar est un frère de #app (hors du #app) ; on cible depuis body.
   En vue profil-héro : le header flotte en overlay absolu sur le héro,
   libérant toute la hauteur viewport pour la couverture. ── */
body:has(#app[data-view="profile"] .pub-hero-page) {
  /* Contexte de positionnement pour que position:absolute du header
     se réfère bien au coin haut-gauche de la page. */
  position: relative;
}
/* Profil hero : topbar standard visible en overlay fixe sur la photo de couverture.
   Remplace les glass buttons top-left/top-right pour une continuité visuelle avec
   l'app connectée (logo Milo + recherche + chip @handle). */
body:has(#app[data-view="profile"] .pub-hero-page) .topbar.site-header {
  position: fixed !important;
  top: 0; left: 0; right: 0;
  z-index: 200;
  background: linear-gradient(to bottom, rgba(0,0,0,.52) 0%, rgba(0,0,0,.18) 70%, transparent 100%) !important;
  border-bottom: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
/* Texte et icônes de la barre : blancs sur fond photo */
body:has(#app[data-view="profile"] .pub-hero-page) .topbar.site-header .brand,
body:has(#app[data-view="profile"] .pub-hero-page) .topbar.site-header .brand-text,
body:has(#app[data-view="profile"] .pub-hero-page) .topbar.site-header .btn,
body:has(#app[data-view="profile"] .pub-hero-page) .topbar.site-header .profile-chip { color: #fff; }
body:has(#app[data-view="profile"] .pub-hero-page) .topbar.site-header .profile-chip {
  background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.3);
}
body:has(#app[data-view="profile"] .pub-hero-page) .topbar.site-header input {
  background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.25);
}
body:has(#app[data-view="profile"] .pub-hero-page) .topbar.site-header input::placeholder { color: rgba(255,255,255,.55); }
/* Glass overlay buttons supprimés : la barre standard les remplace */
body:has(#app[data-view="profile"] .pub-hero-page) .pub-cover-top-left,
body:has(#app[data-view="profile"] .pub-hero-page) .pub-cover-top { display: none !important; }

/* Boutons « Retour » et « Créer ma page » dans la topbar du profil public :
   icône + label, version pill arrondie en desktop, cercle icône en mobile (cf.
   media query plus bas). */
.pub-back-btn,
.pub-create-cta {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .35rem .7rem .35rem .55rem !important;
  border-radius: 999px !important;
}
.pub-back-btn svg,
.pub-create-cta svg { flex: none; }

/* ============================== Mascotte Milo ============================== */
.milo { display: block; overflow: visible; }
.milo-body { fill: #43b58f; stroke: #2c7d63; stroke-width: 2.5; }
.milo-head { fill: #50c79c; stroke: #2c7d63; stroke-width: 2.5; }
.milo-belly { fill: #7fdcc0; }
.milo-crest { stroke: var(--accent); stroke-width: 4; fill: none; }
.milo-cheek { fill: var(--accent); opacity: .3; }
.milo-eyeball { fill: #f4f8ff; }
.milo-iris { fill: var(--accent); }
.milo-pupil { fill: #10141d; }
.milo-shine { fill: #ffffff; }
.milo-mouth { stroke: #1f5546; stroke-width: 3; fill: none; }
.milo-leg { stroke: #3aa17e; stroke-width: 7; fill: none; }
.milo-branch { stroke: #5a6a4a; stroke-width: 5; }
.milo-tail { stroke: #43b58f; stroke-width: 8; fill: none; }
.milo-look { transition: transform .08s linear; }

.hero-milo { display: flex; justify-content: center; margin-bottom: .25rem; }
.empty-milo { display: flex; justify-content: center; margin: .25rem auto 1rem; }

/* Scène + bulle de dialogue */
.milo-stage { position: relative; display: inline-block; }
.milo-bubble {
  position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  margin-bottom: 8px; background: #eef2fb; color: #10141d;
  padding: .5rem .8rem; border-radius: var(--r-md); font-size: .85rem; font-weight: 500;
  text-align: center; max-width: 240px; white-space: normal; line-height: 1.3;
  box-shadow: 0 8px 24px rgba(0,0,0,.35); z-index: 2;
}
.milo-bubble[hidden] { display: none; }
.milo-bubble::after {
  content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 7px solid transparent; border-top-color: #eef2fb;
}

/* Mascotte fixe (coin), visible au scroll */
#milo-fab { position: fixed; top: 62px; right: 16px; width: 76px; z-index: 90; }
#milo-fab .milo-stage { cursor: pointer; }
#milo-fab .milo-bubble {
  left: auto; right: calc(100% + 6px); bottom: auto; top: 6px;
  transform: none; margin: 0; max-width: 210px;
}
#milo-fab .milo-bubble::after {
  top: 16px; left: 100%; transform: none;
  border: 7px solid transparent; border-left-color: #eef2fb;
}
.milo-palette {
  position: absolute; top: calc(100% + 6px); right: 0;
  display: flex; gap: .4rem; padding: .5rem .6rem;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: 0 12px 30px rgba(0,0,0,.45);
  opacity: 0; pointer-events: none; transform: translateY(-6px);
  transition: opacity .2s, transform .2s;
}
.milo-palette { align-items: center; }
.milo-palette.show { opacity: 1; pointer-events: auto; transform: none; }
/* Croix de fermeture du sélecteur de couleur (palette de la marque). */
.brand-palette-close {
  width: 22px; height: 22px; flex: none; padding: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; line-height: 1; border-radius: 50%;
  background: var(--inset); border: 1px solid var(--line); color: var(--muted);
  margin-left: .15rem; transition: transform .12s, color .12s, border-color .12s;
}
.brand-palette-close:hover { transform: scale(1.12); color: var(--fg); border-color: var(--accent-ink); }
.theme-toggle {
  width: 24px; height: 24px; flex: none; padding: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; line-height: 1; border-radius: 50%;
  background: var(--inset); border: 1px solid var(--line); color: var(--fg);
  margin-left: .25rem; transition: transform .12s, border-color .12s;
  border-left-width: 1px;
}
.theme-toggle:hover { transform: scale(1.12); border-color: var(--accent-ink); }
/* Icône SVG (soleil/lune) — plus d'emoji : taille pilotée par le bouton. */
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle-fixed svg { width: 20px; height: 20px; }
.theme-toggle-header svg { width: 17px; height: 17px; }
.theme-toggle-fixed {
  position: fixed; right: 16px; top: 16px; z-index: 90;
  width: 44px; height: 44px;
  background: var(--card); box-shadow: 0 6px 20px rgba(0,0,0,.3);
}
.theme-toggle-fixed:hover { transform: scale(1.08); }
@media (max-width: 600px) {
  .theme-toggle-fixed { width: 40px; height: 40px; right: 12px; top: 12px; }
}
/* Bascule de thème INTÉGRÉE à la barre (vue connectée) : alignée sur la cloche,
   même gabarit que les boutons .btn.sm — pas de bouton flottant qui « pend ». */
.theme-toggle-header {
  width: 34px; height: 34px; margin-left: 0; font-size: 1rem;
  border-radius: var(--r-md);
  background: var(--bg-soft); border: 1px solid var(--line);
}
.theme-toggle-header:hover { transform: none; background: var(--chip); border-color: var(--accent-ink); }
/* Masqué là où la bascule vit déjà dans la barre (landing + vue connectée).
   Conservé sur /status & invite, qui n'ont pas de toggle intégré au header. */
#app[data-view="landing"] ~ .theme-toggle-fixed,
#app[data-view="private"] ~ .theme-toggle-fixed,
#app[data-view="private"] .theme-toggle-fixed,
#app[data-view="profile"] ~ .theme-toggle-fixed,
#app[data-view="profile"] .theme-toggle-fixed { display: none; }
@media (max-width: 600px) {
  #milo-fab { width: 60px; top: 56px; right: 10px; }
  #milo-fab .milo-bubble { display: none; }
}

/* Palette (rangée) */
.palette { display: flex; align-items: center; justify-content: center; gap: .4rem; flex-wrap: wrap; margin: .25rem 0 1.25rem; }
.palette-label { font-size: .8rem; color: var(--muted); margin-right: .15rem; }
.swatch {
  width: 20px; height: 20px; border-radius: 50%; padding: 0; cursor: pointer;
  background: var(--sw); border: 2px solid var(--line);
  transition: transform .12s, border-color .12s;
}
.swatch:hover { transform: scale(1.18); }
.swatch.active { border-color: var(--fg); box-shadow: 0 0 0 2px var(--sw); }

/* Page Statut */
.status { width: 100%; max-width: 680px; margin: 2rem auto; padding: 0 1.25rem; }
.status-head { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.status-head h1 { margin: 0; font-size: 1.5rem; }
.status-badge { font-size: .78rem; font-weight: 600; padding: .25rem .65rem; border-radius: 999px; }
.status-badge.up { color: var(--success); background: rgba(127,220,160,.12); border: 1px solid rgba(127,220,160,.4); }
.status-badge.down { color: var(--danger); background: rgba(240,113,122,.12); border: 1px solid rgba(240,113,122,.4); }
.status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.status-card { display: flex; align-items: center; gap: .7rem; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--r-md); padding: .9rem 1rem; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.status-card.up .status-dot { background: #7fdca0; box-shadow: 0 0 0 4px rgba(127,220,160,.18); }
.status-card.down .status-dot { background: var(--danger); box-shadow: 0 0 0 4px rgba(240,113,122,.18); }
.status-name { font-weight: 500; }
.status-state { color: var(--muted); font-size: .82rem; }
.status-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr)); gap: .75rem; margin-top: .2rem; }
.metric { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--r-md); padding: 1rem; text-align: center; }
.metric b { display: block; font-size: 1.5rem; color: var(--accent-ink); }
.metric span { color: var(--muted); font-size: .8rem; }
.status-meta { color: var(--muted); font-size: .82rem; margin-top: 1.25rem; text-align: center; }

/* ============================== Wordmark ============================== */
.brand {
  display: flex; align-items: center; gap: .5rem;
  font-weight: 600; letter-spacing: -.01em; text-decoration: none; color: var(--fg);
}
.brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.brand-milo { display: inline-flex; width: 44px; height: 44px; flex: none; cursor: pointer; }
.brand-milo .milo { width: 44px; height: 44px; overflow: visible; }
.brand-palette { position: absolute; right: auto; z-index: 200; }
.topbar {
  width: 100%; max-width: 960px; padding: 1.25rem 1.25rem 0;
  display: flex; justify-content: space-between; align-items: center;
}

/* Bandeau « Mise à jour disponible » — frère en flux avant #app (body en flex
   colonne, centré → width:100% pour occuper toute la largeur). Pousse l'app vers
   le bas sans recouvrement, survit aux re-renders de #app. */
.update-banner {
  width: 100%; box-sizing: border-box; flex: none;
  display: flex; align-items: center; justify-content: center; gap: .7rem; flex-wrap: wrap;
  padding: .5rem 1rem; z-index: 500;
  background: var(--accent); color: #0b0d12;
  font-size: .88rem; font-weight: 600;
}
.update-banner-text { display: inline-flex; align-items: center; gap: .4rem; }
.update-banner svg { color: #0b0d12; flex: none; }
.update-banner .btn.sm { background: #0b0d12; color: var(--accent); border-color: transparent; flex: none; }
.update-banner .btn.sm:hover { opacity: .9; }

/* ============================== Landing ============================== */
.hero {
  width: 100%; max-width: 720px; padding: 3.5rem 1.25rem 1rem;
  text-align: center;
}
.hero h1 {
  font-size: clamp(2rem, 6vw, 3.1rem); line-height: 1.05; margin: 0 0 1rem;
  letter-spacing: -.03em;
}
.hero h1 .accent { color: var(--accent-ink); }
.hero p.lead { color: var(--muted); font-size: 1.1rem; max-width: 34rem; margin: 0 auto 2rem; }

/* Recherche : le CTA principal du pattern annuaire */
.search {
  position: relative; max-width: 520px; margin: 0 auto;
}
.search-box {
  display: flex; align-items: center; gap: .6rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: .15rem .25rem .15rem 1rem; transition: border-color .15s, box-shadow .15s;
}
.search-box:focus-within { border-color: var(--accent-ink); box-shadow: 0 0 0 4px var(--accent-soft); }
.search-box svg { color: var(--muted); flex: none; }
.search-box input {
  flex: 1; border: none; background: none; color: var(--fg);
  font-size: 1rem; padding: .7rem 0;
}
.search-box input:focus { outline: none; }
.search-box .go {
  border: none; background: var(--accent); color: #0b0d12;
  border-radius: 999px; padding: .6rem 1.1rem; font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.search-box .go:hover { background: var(--accent-strong); }

.results {
  position: absolute; top: calc(100% + .5rem); left: 0; right: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  overflow: hidden; text-align: left; z-index: 20;
}
.result {
  display: flex; align-items: center; gap: .75rem; padding: .7rem .9rem;
  text-decoration: none; color: var(--fg); border-bottom: 1px solid var(--line);
  transition: background .12s;
}
.result:last-child { border-bottom: none; }
.result:hover, .result:focus { background: var(--bg-soft); outline: none; }
.result .av { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--chip); flex: none; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.result .meta { min-width: 0; }
.result .nm { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result .hd { color: var(--muted); font-size: .82rem; }
.result .no { padding: .9rem; color: var(--muted); font-size: .9rem; }

.hero-actions { margin-top: 1.5rem; display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }
/* Bloc « app mobile très prochainement » + badges stores, sous les actions du hero. */
.app-soon { margin: 1rem auto 0; display: flex; flex-direction: column; align-items: center; gap: .55rem; }
.app-soon-cap { margin: 0; display: inline-flex; align-items: center; gap: .4rem; font-size: .82rem; font-weight: 600; color: var(--accent-ink); }
.app-soon-cap svg { flex: none; }
.store-badges { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; }
/* Badges au style officiel (sombre + logo blanc), conservé en thème clair. */
.store-badge {
  display: inline-flex; align-items: center; gap: .55rem; padding: .42rem .85rem;
  border-radius: var(--r-md); background: #101216; color: #fff; border: 1px solid rgba(255, 255, 255, .18);
  text-decoration: none; transition: transform .15s ease, border-color .15s ease;
}
.store-badge:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, .42); }
.store-badge svg { flex: none; }
.store-badge > span { display: flex; flex-direction: column; line-height: 1.12; text-align: left; }
.store-badge small { font-size: .58rem; letter-spacing: .04em; text-transform: uppercase; opacity: .8; }
.store-badge b { font-size: .92rem; font-weight: 600; }
.store-badge.is-soon { opacity: .5; cursor: default; }
.store-badge.is-soon:hover { transform: none; border-color: rgba(255, 255, 255, .18); }
@media (prefers-reduced-motion: reduce) { .store-badge:hover { transform: none; } }

/* Boutons génériques */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  border: 1px solid var(--line); background: var(--chip); color: var(--fg);
  border-radius: var(--r-md); padding: .7rem 1.15rem; font: inherit; font-weight: 500;
  cursor: pointer; text-decoration: none; transition: border-color .15s, background .15s, transform .1s;
}
.btn:hover { border-color: var(--accent-ink); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: #0b0d12; border-color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.danger { background: var(--danger); color: #fff; border-color: var(--danger); font-weight: 600; }
.btn.danger:hover { filter: brightness(1.08); }

/* Popup de confirmation in-app */
.confirm-panel { max-width: 380px; }
.confirm-msg { margin: 0 0 1.25rem; font-size: 1rem; }

/* promptDialog — saisie texte applicative (remplace prompt() du navigateur). */
.prompt-panel { max-width: 440px; }
.prompt-msg { margin: 0 0 .85rem; font-size: 1rem; }
.prompt-field { margin: 0 0 .5rem; }
.prompt-field input,
.prompt-field textarea {
  width: 100%; box-sizing: border-box;
  padding: .55rem .75rem;
  background: var(--inset); color: var(--fg);
  border: 1px solid var(--line); border-radius: var(--r-md);
  font: inherit;
}
.prompt-field textarea { resize: vertical; min-height: 4.5rem; font-family: inherit; }
.prompt-err { margin: 0 0 .75rem; color: var(--danger); font-size: .85rem; min-height: 1.1rem; }

/* Section features */
/* Grille bento : 4 colonnes, tuiles de tailles variées (asymétrie type Apple).
   Les nouveautés privacy/comms (P2P, chiffrement multi-appareil) sont mises en
   avant en grandes tuiles teintées ; relations & confidentialité en demi-largeur. */
.features {
  width: 100%; max-width: 880px; padding: 3rem 1.25rem 4rem;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem;
  align-content: center;
}
.feature {
  position: relative; overflow: hidden;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.2rem 1.25rem;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.feature:hover { transform: translateY(-3px); border-color: var(--accent-line); box-shadow: 0 8px 24px -12px color-mix(in srgb, var(--accent) 45%, transparent); }
.feature .ic {
  width: 38px; height: 38px; border-radius: var(--r-md); display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-ink); margin-bottom: .9rem;
}
.feature h3 { margin: 0 0 .4rem; font-size: 1rem; }
.feature p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.5; }

/* Tuiles larges (demi-rangée) : relations, confidentialité. */
.feature--wide { grid-column: span 2; }

/* Tuiles vedettes (demi-rangée, teintées) : messagerie P2P + chiffrement multi-appareil. */
.feature--hl {
  grid-column: span 2;
  background:
    radial-gradient(120% 120% at 0% 0%, var(--accent-soft), transparent 60%),
    var(--bg-soft);
  border-color: var(--accent-line);
}
.feature--hl .ic { width: 44px; height: 44px; border-radius: var(--r-md); }
.feature--hl h3 { font-size: 1.14rem; }
.feature--hl p { color: var(--fg); opacity: .82; }

/* ≤ 768px : 2 colonnes, les grandes tuiles occupent toute la largeur. */
@media (max-width: 768px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .feature--hl, .feature--wide { grid-column: span 2; }
}
/* ≤ 460px : pile sur une colonne. */
@media (max-width: 460px) {
  .features { grid-template-columns: 1fr; }
  .feature--hl, .feature--wide { grid-column: span 1; }
}
@media (prefers-reduced-motion: reduce) {
  .feature { transition: border-color .2s ease; }
  .feature:hover { transform: none; box-shadow: none; }
}

/* ---- Colonne Souveraineté : piliers + comparatif ---- */
.sovereign { width: 100%; max-width: 880px; padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; }
.sov-head { display: flex; align-items: center; gap: .6rem; }
.sov-head .ic {
  width: 38px; height: 38px; border-radius: var(--r-md); display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-ink);
}
.sov-head h2 { margin: 0; font-size: 1.4rem; }
.sov-lead { margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.55; max-width: 46rem; }
.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: .7rem; }
.pillar { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.pillar .pic {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
  border-radius: var(--r-sm); background: var(--accent-soft); color: var(--accent-ink); font-size: 1.05rem; margin-bottom: .55rem;
}
.pillar h3 { margin: 0 0 .25rem; font-size: .98rem; }
.pillar p { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.45; }

.sov-cmp-h { margin: .4rem 0 0; font-size: 1rem; }
.sov-tabs { display: flex; gap: .5rem; flex-wrap: wrap; }
.sov-tab { padding: .45rem .9rem; border: 1px solid var(--line); background: var(--bg-soft); color: var(--muted); border-radius: 999px; cursor: pointer; font: inherit; font-size: .85rem; transition: border-color .15s, background .15s, color .15s; }
.sov-tab:hover { border-color: var(--accent-ink); }
.sov-tab.active { background: var(--accent); color: #0b0d12; border-color: var(--accent-ink); font-weight: 600; }
.sov-panel[hidden] { display: none; }
.sov-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.sov-table { width: 100%; min-width: 540px; border-collapse: collapse; font-size: .82rem; }
.sov-table th, .sov-table td { padding: .5rem .5rem; text-align: center; border-bottom: 1px solid var(--line); }
.sov-table tbody tr:last-child th, .sov-table tbody tr:last-child td { border-bottom: 0; }
.sov-table thead th { color: var(--muted); font-weight: 600; font-size: .72rem; line-height: 1.2; }
.sov-table tbody th[scope="row"] { text-align: left; font-weight: 500; white-space: nowrap; position: sticky; left: 0; background: var(--bg); color: var(--fg); }
/* Colonne « mindlog » (1re colonne produit) mise en valeur. */
.sov-table thead th.me { color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 14%, var(--bg)); }
.sov-table td.me { background: var(--accent-soft); }
.sov-table .ok { color: var(--success); font-weight: 700; }
.sov-table .part { color: var(--fg); font-weight: 700; }
.sov-table .no { color: var(--danger); font-weight: 700; }
.sov-legend { margin: 0; color: var(--muted); font-size: .76rem; text-align: center; }
.sov-cmp-note { margin: 0; color: var(--muted); font-size: .74rem; line-height: 1.4; opacity: .85; }

/* ----------------------------- Démo (showcase) -------------------------- */
.showcase { width: 100%; max-width: 880px; display: flex; flex-direction: column; gap: 1rem; }
.show-head { display: flex; align-items: center; gap: .6rem; }
.show-head h2 { margin: 0; font-size: 1.25rem; }
.show-head .ic {
  width: 40px; height: 40px; border-radius: var(--r-md); display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-ink);
}
/* Onglets segmentés : une démo à la fois */
.show-tabs { display: flex; gap: .5rem; margin: .25rem 0 0; flex-wrap: wrap; }
.show-tab {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .5rem .95rem; border: 1px solid var(--line); background: var(--bg-soft); color: var(--muted);
  border-radius: 999px; cursor: pointer; font: inherit; font-size: .88rem;
  transition: border-color .15s, background .15s, color .15s;
}
.show-tab:hover { border-color: var(--accent-ink); }
.show-tab.active { background: var(--accent); color: #0b0d12; border-color: var(--accent-ink); font-weight: 600; }
.show-tab svg { flex: none; }
.show-stage {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.2rem; min-height: 360px;
}
.show-panel[hidden] { display: none; }
.show-card-head { display: flex; align-items: center; gap: .5rem; color: var(--accent-ink); }
.show-card-head h3 { margin: 0; font-size: 1.02rem; color: var(--fg); }
.show-d { margin: .5rem 0 1rem; color: var(--muted); font-size: .9rem; line-height: 1.5; }

/* Galerie : grille de tuiles colorées qui apparaissent en cascade */
.gal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.gal-tile {
  position: relative; aspect-ratio: 1 / 1; border-radius: var(--r-md); overflow: hidden;
  background: linear-gradient(135deg, hsl(var(--h) 60% 52%), hsl(calc(var(--h) + 40deg) 58% 38%));
}
.gal-like {
  position: absolute; left: .4rem; bottom: .4rem; font-size: .72rem; color: #fff;
  background: rgba(0,0,0,.32); padding: .1rem .4rem; border-radius: 999px; backdrop-filter: blur(2px);
}
.gal-like b { font-weight: 700; }

/* Chat : mini « téléphone » + fil de bulles */
.phone {
  background: var(--inset); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
}
.phone-bar {
  display: flex; justify-content: center; padding: .5rem; border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}
.phone-bar { gap: .4rem; }
.e2e-badge {
  font-size: .72rem; color: var(--success); border: 1px solid color-mix(in srgb, var(--success) 40%, transparent);
  padding: .12rem .5rem; border-radius: 999px;
}
.ttl-badge {
  font-size: .72rem; color: var(--muted); border: 1px solid var(--line);
  padding: .12rem .5rem; border-radius: 999px;
}
.thread { display: flex; flex-direction: column; gap: .5rem; padding: .9rem; }
.thread.ai { padding: .2rem 0; }
.bubble {
  max-width: 82%; padding: .5rem .75rem; border-radius: var(--r-md); font-size: .9rem; line-height: 1.4;
  word-break: break-word;
}
.bubble.in {
  align-self: flex-start; background: var(--chip); color: var(--fg); border-bottom-left-radius: 5px;
}
.bubble.out {
  align-self: flex-end; background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 5px;
}
.bubble.in.milo {
  align-self: flex-start; background: var(--card); border: 1px solid var(--accent-line);
  display: flex; flex-direction: column; gap: .35rem;
}
.milo-tag { font-size: .72rem; font-weight: 700; color: var(--accent-ink); }
.tool-chip {
  display: inline-flex; align-items: center; gap: .3rem; align-self: flex-start;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .68rem;
  color: var(--muted); background: var(--inset); border: 1px solid var(--line);
  padding: .12rem .45rem; border-radius: var(--r-xs);
}

/* Panneau de création (overlay) */
.overlay {
  position: fixed; inset: 0; background: rgba(8,10,14,.6); backdrop-filter: blur(4px);
  /* z-index élevé : une modale (confirmation, RDV, QR) reste toujours cliquable
     au-dessus du deck et d'une colonne de conversation ouverte. */
  display: flex; align-items: center; justify-content: center; padding: 1.25rem; z-index: 150;
  overflow-y: auto; /* dernier recours si la modale dépasse l'écran (mobile) */
}
.panel { position: relative; }
.panel .close,
.card .close {
  position: absolute; top: .9rem; right: .9rem; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: var(--inset); color: var(--muted);
  border-radius: var(--r-sm); cursor: pointer; font-size: 1rem; line-height: 1; z-index: 2;
}
.panel .close:hover,
.card .close:hover { color: var(--fg); border-color: var(--accent-ink); }
/* Card avec .close : réserve la place pour le bouton × (hors chat-card qui gère son propre layout) */
.card:has(.close):not(.chat-card) { position: relative; padding-top: 2.8rem; }
.panel {
  width: 100%; max-width: 420px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r-xl); padding: 1.6rem;
}
/* Modale plus haute que l'écran (ex. « Nouvel événement » sur mobile) : le panneau
   ne doit jamais déborder hors du viewport sinon ses boutons d'action (Ajouter,
   Enregistrer…) deviennent inatteignables. On le plafonne et on le rend défilant.
   Scopé à `.overlay .panel` pour ne pas affecter `.call-panel` (qui vit dans
   `.call-dock`, hors `.overlay`, et gère son propre layout plein écran). */
.overlay .panel {
  max-height: calc(100vh - 2.5rem);
  max-height: calc(100dvh - 2.5rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.panel h2 { margin: 0 0 .3rem; font-size: 1.25rem; }
.panel .sub { color: var(--muted); margin: 0 0 1.25rem; font-size: .92rem; }

/* Page « Espace Premium » (vue plein écran /me/premium) : barre supérieure fixe
   avec bouton Retour + corps défilant. Pas de deck ni de bottom-nav → scroll
   interne normal, et le bouton retour du navigateur fonctionne nativement. */
/* Modèle scroll simple : le body scrolle nativement (pas de chaîne flex
   fragile), le topbar reste collant en haut. Évite les problèmes de
   100dvh + flex où le contenu interne ne pouvait plus défiler. */
#app[data-view="premium"] {
  min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center;
}
.prem-page-view {
  width: 100%; max-width: 760px;
  display: flex; flex-direction: column;
}
.prem-topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.prem-topbar-title {
  display: inline-flex; align-items: center; gap: .4rem;
  font-weight: 700; font-size: 1.05rem;
}
.prem-body { padding: 1rem; padding-bottom: 4rem; }

/* ── Hero « Ce que ton espace privé débloque » ──────────────────────────── */
.prem-benefits {
  margin: 0 0 1.5rem;
  padding: 1.1rem 1.2rem;
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-soft));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
}
.prem-benefits-head {
  display: flex; align-items: flex-start; gap: .75rem;
  margin-bottom: .9rem;
}
.prem-benefits-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 25%, transparent);
  color: var(--accent-ink);
}
.prem-benefits-title {
  margin: 0; font-size: 1.05rem; font-weight: 700; line-height: 1.3;
}
.prem-benefits-sub {
  margin: .2rem 0 0; font-size: .85rem; color: var(--muted); line-height: 1.4;
}
.prem-benefits-list {
  margin: 0; padding: 0;
  /* Flex plutôt que grid auto-fit : avec 5 cartes, une grille laisse une cellule
     vide en fin de dernière rangée (aspect « pas centré »). En flex, les cartes
     de chaque rangée s'étirent pour la remplir (flex-grow) — dernière rangée
     comprise — et sur mobile on retombe sur une colonne pleine largeur. */
  display: flex; flex-wrap: wrap;
  gap: .6rem;
}
.prem-benefit { position: relative; display: block; cursor: pointer; flex: 1 1 240px; }
.prem-benefit input.prem-benefit-cb {
  position: absolute; opacity: 0; pointer-events: none;
}
.prem-benefit-card {
  display: grid; grid-template-columns: 32px 1fr 22px; align-items: start; gap: .6rem;
  padding: .65rem .75rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  transition: border-color .15s, background .15s, box-shadow .15s, transform .12s;
  min-height: 56px;
}
.prem-benefit:hover .prem-benefit-card {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}
.prem-benefit input:checked + .prem-benefit-card {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent) inset;
}
.prem-benefit input:focus-visible + .prem-benefit-card {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.prem-benefit input:disabled + .prem-benefit-card {
  opacity: .55; cursor: not-allowed;
}
.prem-benefit-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent-ink);
}
.prem-benefit-text { min-width: 0; }
.prem-benefit-text b { display: block; font-weight: 600; font-size: .9rem; line-height: 1.3; }
.prem-benefit-text span { display: block; font-size: .78rem; color: var(--muted); line-height: 1.4; margin-top: .15rem; }
.prem-benefit-check {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; margin-top: 4px;
  border-radius: 6px;
  border: 1.5px solid var(--line);
  background: var(--bg-soft);
  color: transparent;
  transition: all .12s;
}
.prem-benefit input:checked + .prem-benefit-card .prem-benefit-check {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

/* ── Avantages de mon abonnement Premium ────────────────────────────────── */
/* Variante des benefits : items en pile verticale, plus dense, avec un mode  */
/* « info » pour les capabilities non-togglables (badge « Inclus »).          */
.prem-perks-list { display: flex; flex-direction: column; gap: .5rem; }
.prem-perk { position: relative; display: block; cursor: pointer; }
.prem-perk.prem-perk--info { cursor: default; }
.prem-perk input.prem-perk-cb { position: absolute; opacity: 0; pointer-events: none; }
.prem-perk-card {
  display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: .65rem;
  padding: .6rem .75rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  transition: border-color .15s, background .15s;
  min-height: 52px;
}
.prem-perk:hover .prem-perk-card { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.prem-perk.prem-perk--info:hover .prem-perk-card { border-color: var(--line); }
.prem-perk input:checked + .prem-perk-card {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--bg));
}
.prem-perk input:focus-visible + .prem-perk-card { outline: 2px solid var(--accent); outline-offset: 2px; }
.prem-perk-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; flex-shrink: 0;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent-ink);
}
.prem-perk-text { min-width: 0; }
.prem-perk-text b { display: block; font-weight: 600; font-size: .88rem; line-height: 1.3; }
.prem-perk-text span { display: block; font-size: .76rem; color: var(--muted); line-height: 1.4; margin-top: .15rem; }
.prem-perk-text code { font-size: .72em; padding: .05rem .25rem; border-radius: 3px; background: var(--bg-soft); font-family: var(--mono); }
.prem-perk-check {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 1.5px solid var(--line);
  background: var(--bg-soft);
  color: transparent;
  transition: all .12s;
}
.prem-perk input:checked + .prem-perk-card .prem-perk-check {
  border-color: var(--accent); background: var(--accent); color: var(--on-accent);
}
.prem-perk-badge {
  font-size: .65rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: .2rem .5rem; border-radius: 999px;
  background: color-mix(in srgb, var(--success, #2ecc71) 18%, transparent);
  color: var(--success, #2ecc71);
}

/* ── Tabs Premium : menu de navigation entre les 3 panes ──
   Pattern segmented-control sticky sous la topbar. JS bascule
   `[data-prem-pane]` via la classe `.is-active` sur la pane et le bouton. */
.prem-tabs {
  display: flex; gap: .35rem; flex-wrap: nowrap;
  margin: 0 0 1.1rem;
  padding: .25rem;
  background: var(--bg-soft, color-mix(in srgb, var(--card) 70%, var(--bg)));
  border: 1px solid var(--line);
  border-radius: var(--r-sm, 10px);
  position: sticky; top: 0; z-index: 2;
}
.prem-tab-btn {
  flex: 1 1 0;
  display: inline-flex; align-items: center; justify-content: center;
  gap: .4rem; min-width: 0;
  padding: .55rem .55rem;
  background: transparent; color: var(--muted);
  border: none; border-radius: calc(var(--r-sm, 10px) - 2px);
  font: inherit; font-weight: 600; font-size: .85rem;
  cursor: pointer;
  transition: background .12s, color .12s;
  white-space: nowrap;
  overflow: hidden;
}
.prem-tab-btn:hover { background: color-mix(in srgb, var(--accent-soft, var(--card)) 50%, transparent); color: var(--fg); }
.prem-tab-btn:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 1px; }
.prem-tab-btn.is-active {
  background: var(--card);
  color: var(--fg);
  box-shadow: 0 1px 2px rgba(0,0,0,.18);
}
.prem-tab-btn svg { flex: none; color: var(--accent-ink); }
.prem-tab-btn > span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
/* Mobile : padding et fonte plus compacts pour tenir sur 1 ligne. */
@media (max-width: 540px) {
  .prem-tabs { gap: .2rem; padding: .2rem; }
  .prem-tab-btn { padding: .5rem .35rem; gap: .3rem; }
  .prem-tab-btn > span { font-size: .74rem; }
}
/* Très petit : on cache le label, icône seule (chip carré). */
@media (max-width: 380px) {
  .prem-tab-btn > span { display: none; }
}

/* Une pane = une section logique du Premium. JS toggle [hidden]. */
.prem-pane[hidden] { display: none; }

/* ── Upsell Premium (pane Personnalisation, compte non-Premium) ──
   Carte unique mise en avant : titre + bénéfices + CTA essai gratuit. */
.prem-upsell {
  /* Largeur bornée + centrée horizontalement (sur grand écran, sinon pleine
     largeur sous 600px) pour ne pas s'étaler sur toute la zone de contenu. */
  margin: 0 auto 1rem;
  max-width: 600px;
  padding: 1.5rem 1.4rem 1.3rem;
  border-radius: var(--r-md, 14px);
  border: 1px solid color-mix(in srgb, var(--accent-ink) 30%, transparent);
  background:
    radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--accent-ink) 18%, transparent), transparent 55%),
    color-mix(in srgb, var(--card) 92%, transparent);
}
.prem-upsell-head { display: flex; align-items: flex-start; gap: .8rem; margin-bottom: .8rem; }
.prem-upsell-ic {
  flex: none;
  width: 42px; height: 42px;
  display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--accent-ink) 22%, transparent);
  border-radius: 50%;
  color: var(--accent-ink);
}
.prem-upsell-title { margin: 0 0 .15rem; font-size: 1.05rem; line-height: 1.35; font-weight: 700; }
.prem-upsell-sub { margin: 0; font-size: .88rem; line-height: 1.45; color: var(--muted); }
.prem-upsell-list {
  list-style: none; margin: 0 0 1rem; padding: 0;
  display: grid; gap: .4rem;
}
.prem-upsell-list li {
  display: flex; align-items: center; gap: .55rem;
  font-size: .9rem; color: var(--fg);
}
.prem-upsell-list li svg { flex: none; color: var(--accent-ink); }
.prem-upsell-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem;
}
#prem-upsell-trial {
  display: inline-flex; align-items: center; flex-wrap: wrap;
  gap: .35rem .55rem;
  padding: .7rem 1.1rem;
  font-weight: 700;
  line-height: 1.25;
}
.prem-upsell-trial-sub {
  display: block; width: 100%;
  font-size: .7rem; font-weight: 500; opacity: .82;
  margin-top: -.05rem;
}

/* ── Titres de sections (Mon abonnement / Mon espace privé / Mon profil) ── */
.prem-section-title {
  display: flex; align-items: center; gap: .5rem;
  margin: 1.6rem 0 .75rem;
  font-size: .8rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted);
}
.prem-section-title:first-of-type { margin-top: 0; }
.prem-section-title svg { color: var(--accent-ink); }
.prem-section-sub {
  font-weight: 500; font-size: .72rem; opacity: .65;
  text-transform: none; letter-spacing: 0;
  margin-left: .15rem;
}
/* La vue Premium n'est PAS dans une cellule de deck contrainte en hauteur :
   neutraliser la classe .col-scroll (héritée du markup partagé) pour laisser
   le document scroller normalement. La topbar reste sticky côté document. */
#app[data-view="premium"] .col-scroll {
  overflow: visible; height: auto; max-height: none; flex: none;
}
.panel label { display: block; font-size: .82rem; color: var(--muted); margin: 0 0 .3rem; }
.panel .group { margin-bottom: 1rem; }
.handle-input { position: relative; display: flex; align-items: center; background: var(--inset); border: 1px solid var(--line); border-radius: var(--r-md); padding-left: .7rem; }
.handle-input span { color: var(--muted); }
.handle-input input { border: none; background: none; }
.panel .err { color: var(--danger); font-size: .85rem; min-height: 1.1rem; margin: -.3rem 0 .6rem; }
.panel label.cr-ack { display: flex; align-items: flex-start; gap: .5rem; color: var(--ink); font-size: .85rem; line-height: 1.4; margin: 0; cursor: pointer; }
.panel label.cr-ack input[type="checkbox"] { width: auto; min-width: 0; padding: 0; border: none; background: none; margin: .15rem 0 0; flex: none; accent-color: var(--accent-ink); }
.panel label.cr-ack span { flex: 1; min-width: 0; }
.panel label.cr-ack a { color: var(--accent); text-decoration: underline; }
/* Champ de saisie PIN : gros chiffres centrés, espacés et tabulaires — gabarit
   IDENTIQUE pour la saisie et la confirmation (fini les tailles 1.5/1.3 divergentes). */
.pin-input {
  text-align: center;
  letter-spacing: .4em;
  text-indent: .4em; /* recentre le texte malgré l'espacement à droite */
  font-size: 1.4rem;
  font-variant-numeric: tabular-nums;
  padding-block: .7rem;
}
.panel .hint { color: var(--muted); font-size: .78rem; margin: .35rem 0 0; }
.lost-key { margin: .9rem 0 0; font-size: .85rem; }
.lost-key a { color: var(--muted); text-decoration: underline; }
.lost-key a:hover { color: var(--accent-ink); }
.trust { margin: 1rem auto 0; font-size: .82rem; color: var(--muted); display: inline-block; padding: .35rem .8rem; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-soft); }
/* Indicateur d'adoption (nombre d'identités créées) */
.adoption { margin: 1rem auto 0; font-size: .9rem; color: var(--muted); display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .9rem; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.adoption[hidden] { display: none; }
.adoption .adopt-num { color: var(--accent-ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.adopt-trend { display: inline-flex; align-items: center; font-size: .75rem; font-weight: 600; color: var(--success); background: rgba(95,211,154,.12); border: 1px solid rgba(95,211,154,.35); border-radius: 999px; padding: .1rem .45rem; }
.lbl-sm { display: block; font-size: .78rem; color: var(--muted); }

/* Notifications (cloche + popover) */
.notif-wrap { position: relative; display: inline-flex; }
#notif-bell { position: relative; }
.notif-badge {
  position: absolute; top: -5px; right: -5px; min-width: 16px; height: 16px;
  padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff;
  font-size: .66rem; font-weight: 700; line-height: 16px; text-align: center;
}
.notif-badge[hidden] { display: none; }
.notif-panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 120;
  width: min(320px, 90vw); max-height: 60vh; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: 0 14px 34px rgba(0,0,0,.5); display: flex; flex-direction: column;
}
.notif-panel[hidden] { display: none; }
.notif-head { padding: .6rem .85rem; font-size: .8rem; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); text-transform: uppercase; letter-spacing: .05em; }
.notif-list { list-style: none; margin: 0; padding: .25rem; overflow-y: auto; display: grid; gap: .15rem; }
.notif { border-radius: var(--r-sm); transition: background var(--dur-fast) var(--ease-out); }
.notif a, .notif > .nt, .notif-act { display: block; width: 100%; padding: .5rem .6rem; text-decoration: none; color: var(--fg); }
.notif-act { background: none; border: none; cursor: pointer; font: inherit; text-align: left; }
.notif:hover { background: var(--bg-soft); }
/* Non-lu : liseré accent à gauche (indicateur explicite, pas seulement une teinte
   de fond) + fond teinté léger. */
.notif.unread { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.notif .nt { font-size: var(--t-sm); }
.notif .nd { display: block; font-size: var(--t-2xs); color: var(--muted); margin-top: .1rem; padding: 0 .6rem .4rem; }
.notif a .nd { padding: .1rem 0 0; }
.notif-list .empty { padding: 1rem .6rem; }
/* En colonne (deck) : pas de hauteur/scroll propres, la colonne s'en charge */
.notif-col { overflow: visible; max-height: none; padding: 0; }

/* Conversation éphémère */
/* Discussion : colonne fermable du deck éditeur, insérée à droite de « Identité »
   (plus de sidebar flottante). La carte hérite du flux flex de .deck .col > .card. */
.chat-card { position: relative; }
/* La colonne de chat remplit toute la hauteur (y compris sur le profil public où
   les cartes sont sinon centrées verticalement) ; seul .chat-log défile. */
.deck .col > .chat-card {
  margin: 0; flex: 1; min-height: 0;
  display: flex; flex-direction: column; overflow: hidden;
}
.chat-card .close {
  position: absolute; top: .9rem; right: .9rem; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: var(--inset); color: var(--muted);
  border-radius: var(--r-sm); cursor: pointer; font-size: 1rem; line-height: 1; z-index: 2;
}
.chat-card .close:hover { color: var(--fg); border-color: var(--accent-ink); }
.chat-card .chat-head { padding-right: 2.6rem; }  /* place pour le bouton ✕ */
.chat-log {
  flex: 1; min-height: 120px; max-height: none; overflow-y: auto;
  display: flex; flex-direction: column; gap: .4rem; padding: .6rem;
  background: var(--inset); border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: .6rem;
}
/* ════════════════ Bulles style WhatsApp ════════════════ */
.chat-log > .bubble {
  max-width: 78%;
  padding: .45rem .65rem .3rem .65rem;
  border-radius: 7.5px;
  font-size: var(--t-sm);
  line-height: 1.45;
  word-break: break-word;
  position: relative;
  box-shadow: 0 1px 1px rgba(0,0,0,.22);
  overflow: visible;   /* laisse la queue déborder */
}
/* ── Envoyé : couleur d'accent caméléon, queue droite ── */
.chat-log > .bubble.mine {
  align-self: flex-end;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 7.5px 7.5px 2px 7.5px;
  margin-right: 9px;
}
.chat-log > .bubble.mine::before {
  content: '';
  position: absolute;
  bottom: 0; right: -7px;
  border-style: solid;
  border-width: 9px 0 0 9px;
  border-color: transparent transparent transparent var(--accent);
}
/* ── Reçu : teinte dérivée du handle, queue gauche ── */
.chat-log > .bubble.theirs {
  align-self: flex-start;
  /* hsl(hue 16% 19%) dark · hue issu du hash du handle (défini en JS via --bbl-theirs-tint) */
  background: hsl(var(--bbl-theirs-tint, 200) 16% 19%);
  color: var(--bbl-theirs-fg);
  border: none;
  border-radius: 7.5px 7.5px 7.5px 2px;
  margin-left: 9px;
}
:root[data-theme="light"] .chat-log > .bubble.theirs {
  background: hsl(var(--bbl-theirs-tint, 200) 28% 94%);
  color: var(--bbl-theirs-fg);
}
.chat-log > .bubble.theirs::before {
  content: '';
  position: absolute;
  bottom: 0; left: -7px;
  border-style: solid;
  border-width: 9px 9px 0 0;
  border-color: transparent hsl(var(--bbl-theirs-tint, 200) 16% 19%) transparent transparent;
}
:root[data-theme="light"] .chat-log > .bubble.theirs::before {
  border-color: transparent hsl(var(--bbl-theirs-tint, 200) 28% 94%) transparent transparent;
}
.chat-restore { display: flex; flex-direction: column; gap: .6rem; align-items: center; text-align: center; margin: auto; padding: 1rem; color: var(--muted); }
.chat-restore p { margin: 0; font-size: .9rem; line-height: 1.5; }
.chat-backup { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; justify-content: space-between; padding: .5rem .7rem; margin-bottom: .5rem; border-radius: var(--r-sm); background: var(--card, rgba(255,255,255,.05)); font-size: .82rem; line-height: 1.4; }
.chat-backup button { flex: none; }
/* Ligne d'historique d'appel : neutre et centrée, ni « mine » ni « theirs ». */
.chat-log > .bubble:has(.b-call) { align-self: center; background: transparent; border: 1px dashed var(--line); color: var(--muted); border-radius: 999px; padding: 4px 14px; margin: 0; }
.chat-log > .bubble:has(.b-call)::before { display: none; }
.b-call { font-size: .85em; }
/* Entrée d'un message qui vient d'arriver (uniquement les nouveaux : cf. chat.js) */
@keyframes bubble-in { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
.chat-log > .bubble.bubble-enter { animation: bubble-in .26s cubic-bezier(.22,.61,.36,1) both; }
@media (prefers-reduced-motion: reduce) { .chat-log > .bubble.bubble-enter { animation: none; } }
/* Conversation archivée : bandeau + bulles en lecture seule */
.chat-archived-banner {
  align-self: stretch; text-align: center; margin: 0 0 .5rem; padding: .4rem .6rem;
  font-size: .76rem; line-height: 1.4; color: var(--muted);
  background: var(--bg-soft); border: 1px dashed var(--line); border-radius: var(--r-sm);
}
.chat-archived-banner b { color: var(--fg); }
.chat-log > .bubble.archived { opacity: .82; box-shadow: none; }
.chat-form.readonly { opacity: .55; pointer-events: none; }
/* Ligne méta (heure + ticks) : float-right pour coller en bas à droite — */
/* pattern WhatsApp classique. */
.bubble .t {
  float: right;
  display: inline-flex; align-items: center; gap: 3px;
  margin: .15rem 0 -.05rem .55rem;
  line-height: 1;
}
.bubble .t-time {
  font-size: .67rem;
  color: var(--bbl-meta);
  opacity: 1;
  cursor: default;
  user-select: none;
  white-space: nowrap;
}
.bubble .t-time:hover { opacity: .85; text-decoration: none; }
/* Compte à rebours avant suppression (déplié au clic sur l'heure) */
.b-countdown { display: block; clear: both; font-size: .61rem; opacity: .75; font-style: italic; text-align: right; margin-top: .1rem; }
.b-countdown[hidden] { display: none; }
.bubble.mine .b-countdown { color: var(--on-accent); opacity: .7; }
/* Ticks : gris = envoyé, double = reçu, bleu = lu */
.bubble .ticks { font-size: .8rem; color: var(--bbl-meta); letter-spacing: -.08em; line-height: 1; }
.bubble .ticks.read { color: var(--bbl-ticks-read) !important; opacity: 1; }
/* Réactions */
.b-reacts { display: flex; gap: .25rem; flex-wrap: wrap; margin-top: .25rem; }
.react { font-size: .72rem; padding: .05rem .35rem; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--fg); cursor: pointer; }
.react.mine { border-color: var(--accent-ink); }
.bubble.mine .react { background: rgba(0,0,0,.18); border-color: rgba(0,0,0,.22); color: var(--on-accent); }
.bubble.theirs .react { color: var(--bbl-theirs-fg); }
/* Actions inline sur la ligne de l'heure : visibles seulement au survol du message */
.b-react-btn, .b-del { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-size: .8rem; line-height: 1; text-align: center; padding: 0; color: var(--fg); flex: none; opacity: 0; transition: opacity .12s ease; }
.bubble:hover .b-react-btn, .bubble:hover .b-del,
.b-react-btn:focus-visible, .b-del:focus-visible { opacity: 1; }
.bubble.mine .b-react-btn, .bubble.mine .b-del { background: rgba(0,0,0,.14); border-color: rgba(0,0,0,.2); color: var(--on-accent); }
.b-react-btn:hover { border-color: var(--accent-ink); }
.b-del:hover { color: var(--danger); border-color: var(--danger); }
/* Popover de sélection d'emoji (au niveau du panneau, pas dans le log) */
.react-pick {
  position: absolute; z-index: 10; display: flex; gap: .1rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: .25rem .4rem; box-shadow: 0 8px 22px rgba(0,0,0,.45);
}
.react-pick[hidden] { display: none; }
.react-pick button { border: none; background: none; cursor: pointer; font-size: 1.25rem; line-height: 1; padding: .15rem .25rem; border-radius: var(--r-sm); }
.react-pick button:hover { background: var(--bg-soft); transform: scale(1.15); }
/* Composer sur 2 lignes : barre d'actions (📎🎤👁) en haut, champ + envoi en bas
   (champ pleine largeur → plus d'espace de saisie). */
.chat-form { display: flex; flex-direction: column; gap: .4rem; }
.chat-actions { display: flex; align-items: center; gap: .4rem; }
.chat-input-row { display: flex; align-items: center; gap: .4rem; }
.chat-input-row input { flex: 1; min-width: 0; }
.chat-input-row .btn.primary { flex: none; padding: .4rem .7rem; }
/* Bouton d'appel : sur la rangée d'actions (avec 📎🎤👁), en vert, occupe l'espace restant. */
.chat-call-btn, .comm-right .chat-call-btn {
  background: #1f9d57; color: #fff; border-color: transparent;
}
.chat-call-btn:hover, .comm-right .chat-call-btn:hover { background: #1c8b4d; }
.chat-call-btn svg { color: #fff; }
.chat-actions .chat-call-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; }

/* État « échange impossible » : illustration + explication, centré dans le log. */
.chat-blocked { display: flex; flex-direction: column; align-items: center; gap: .85rem; text-align: center; padding: 2.2rem 1.2rem; color: var(--muted); }
.chat-blocked-svg { color: var(--muted); opacity: .9; }
.chat-blocked-text { max-width: 32ch; line-height: 1.55; font-size: .9rem; margin: 0; }
.chat-blocked-text b { color: var(--fg); }

/* QR code */
.qr-box {
  display: flex; align-items: center; justify-content: center;
  background: #fff; border-radius: var(--r-md); padding: 14px; margin: .25rem auto 1rem;
  width: max-content;
}
.qr-box img, .qr-box canvas { display: block; }

/* Section MCP (landing) */
.mcp { width: 100%; max-width: 880px; padding: 1rem 1.25rem 4rem; }
.mcp-head { display: flex; align-items: center; gap: .75rem; margin-bottom: .6rem; }
.mcp-head .ic { width: 38px; height: 38px; border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent-ink); flex: none; }
.mcp-head h2 { margin: 0; font-size: clamp(1.3rem, 4vw, 1.7rem); letter-spacing: -.02em; }
.mcp-lead { color: var(--muted); max-width: 48rem; }
.mcp-lead em { display: block; margin-top: .5rem; color: var(--fg); opacity: .8; }
/* Grille intrinsèque (2026) : reflow auto 3→2→1 sans breakpoint. */
.mcp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 1rem; margin: 1.5rem 0; }
.mcp-step { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--r-md); padding: 1.1rem; }
.mcp-step .num { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #0b0d12; font-weight: 700; font-size: .85rem; margin-bottom: .55rem; }
.mcp-step p { margin: 0; font-size: .92rem; }
.mcp-step code { background: var(--card); padding: .1rem .4rem; border-radius: var(--r-xs); border: 1px solid var(--line); }
.mcp-tabs { display: flex; gap: .5rem; margin: 1.5rem 0 1rem; flex-wrap: wrap; }
.mcp-tab { padding: .5rem .95rem; border: 1px solid var(--line); background: var(--bg-soft); color: var(--muted); border-radius: 999px; cursor: pointer; font: inherit; font-size: .88rem; transition: border-color .15s, background .15s, color .15s; }
.mcp-tab:hover { border-color: var(--accent-ink); }
.mcp-tab.active { background: var(--accent); color: #0b0d12; border-color: var(--accent-ink); font-weight: 600; }
.mcp-panel[hidden] { display: none; }
.mcp-panel-lead { color: var(--muted); margin: 0 0 .75rem; }
.mcp-url { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.mcp-url code { flex: 1; min-width: 200px; background: #0c0e13; border: 1px solid var(--line); padding: .55rem .7rem; border-radius: var(--r-sm); font-size: .85rem; }
.mcp-steps { margin: 0 0 1rem; padding-left: 1.2rem; color: var(--muted); display: grid; gap: .4rem; font-size: .9rem; }
.mcp-steps strong { color: var(--fg); }
.mcp-details summary { cursor: pointer; color: var(--accent-ink); font-size: .85rem; margin-bottom: .6rem; }
.mcp-config { background: #0c0e13; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.mcp-config-head { display: flex; justify-content: space-between; align-items: center; padding: .55rem .9rem; border-bottom: 1px solid var(--line); font-size: .82rem; color: var(--muted); }
.mcp-config pre { margin: 0; padding: 1rem; overflow-x: auto; font: 13px/1.55 var(--font-mono); color: #cdd3df; }
.mcp-note { color: var(--muted); font-size: .82rem; margin-top: .8rem; }
.panel .actions { display: flex; gap: .6rem; justify-content: flex-end; margin-top: .5rem; }

/* Bloc succès création */
.created .key-box {
  background: var(--inset); border: 1px dashed var(--accent); border-radius: var(--r-sm);
  padding: .7rem; word-break: break-all; font-size: .85rem; margin: .4rem 0 1rem;
}
.created .warn { color: var(--accent-ink); font-size: .85rem; line-height: 1.45; }
/* Appel à l'action passkey (étape post-création, mise en avant). */
.cr-passkey-cta {
  margin: 1.1rem 0 .5rem; padding: .9rem 1rem;
  border: 1px solid var(--accent-line); border-radius: var(--r-md);
  background: var(--inset);
}
.cr-passkey-head { display: flex; align-items: center; gap: .45rem; font-size: .98rem; }
.cr-passkey-head svg { color: var(--accent-ink); flex: none; }
.cr-passkey-cta .hint { margin: .4rem 0 .8rem; }
.cr-passkey-actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.cr-continue { margin-top: 1rem; }
.url-row { display: flex; gap: .5rem; align-items: center; margin: .5rem 0; }
.url-row code { flex: 1; background: var(--inset); border: 1px solid var(--line); padding: .5rem .6rem; border-radius: var(--r-sm); word-break: break-all; font-size: .82rem; }
.copy { padding: .5rem .7rem; }

.sig-block { margin: .75rem 0 .25rem; text-align: left; }
.sig-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .4rem; }
.sig-title { color: var(--muted); font-size: .82rem; font-weight: 600; }
/* Aperçu sur fond blanc : reflète le rendu réel dans un client mail. */
.sig-preview { background: #ffffff; border: 1px solid var(--line); border-radius: var(--r-sm); padding: .75rem .85rem; overflow-wrap: anywhere; }

/* ============================== Carte ============================== */
.card {
  width: 100%; max-width: var(--maxw); margin: 2.5rem auto;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.75rem;
}
/* Profil public : page verticale adaptative */
.pub-page {
  width: 100%; max-width: 540px; margin: 1.5rem auto 4rem;
  padding: 0 1.25rem; display: flex; flex-direction: column; gap: 1rem;
}
.pub-page > .card,
.pub-page > .pub-section { margin: 0; max-width: none; }
.pub-page .col-scroll { overflow: visible; height: auto; max-height: none; flex: none; }
@media (max-width: 600px) {
  .pub-page { margin-top: .75rem; padding: 0 .75rem; }

  /* — Deck swipeable (mobile) — les cartes deviennent des volets horizontaux. */
  .pub-page.pub-swipe {
    position: relative; overflow: hidden; width: 100%;
    padding: 0 0 2.7rem; /* pas de padding latéral : porté par les volets (calc du swipe exact) */
  }
  .pub-swipe .pub-track { display: flex; align-items: stretch; will-change: transform; }
  .pub-swipe .pub-slide {
    flex: 0 0 100%; box-sizing: border-box; min-width: 0;
    padding: .3rem .75rem; display: flex; flex-direction: column; justify-content: center;
  }
  .pub-swipe .pub-slide > .card,
  .pub-swipe .pub-slide > .pub-section { margin: 0; max-width: none; width: 100%; }

  /* Points indicateurs de position */
  .pub-dots {
    position: absolute; left: 0; right: 0; bottom: 1rem; z-index: 5;
    display: flex; gap: .42rem; justify-content: center;
  }
  .pub-dot {
    width: 7px; height: 7px; padding: 0; border: none; border-radius: 50%;
    background: var(--line); cursor: pointer; transition: background .2s ease, transform .2s ease;
  }
  .pub-dot.active { background: var(--accent); transform: scale(1.4); }

  /* Flèche d'invitation au swipe (le chevron oscille, cf. GSAP) */
  .pub-swipe-hint {
    position: absolute; right: .65rem; top: 50%; transform: translateY(-50%);
    z-index: 6; display: inline-flex; align-items: center; gap: .12rem;
    padding: .42rem .55rem .42rem .7rem; cursor: pointer;
    color: var(--accent-ink);
    background: color-mix(in srgb, var(--card) 86%, transparent);
    border: 1px solid var(--line); border-radius: 999px;
    box-shadow: 0 4px 16px rgba(0,0,0,.28); backdrop-filter: blur(7px);
    transition: opacity .25s ease;
  }
  .pub-swipe-hint-txt { font-size: .73rem; font-weight: 600; letter-spacing: -.01em; }
  .pub-swipe-hint.hidden { opacity: 0; pointer-events: none; }
  .pub-swipe-hint.gone { display: none; }
}

/* ===================================================================
   Page profil publique — layout adaptatif
   Mobile : héro 100svh → onglets sticky → contenu
   Tablet : héro 55svh → onglets sticky → contenu
   Desktop ≥1024px : héro sticky à gauche (40%), contenu à droite (60%)
   =================================================================== */
.pub-hero-page {
  width: 100%; display: flex; flex-direction: column;
  min-height: 100svh;
}

/* --- Cover hero --- */
.pub-cover-hero {
  position: relative; width: 100%;
  height: 100svh; min-height: 480px;
  display: flex; flex-direction: column; justify-content: flex-end;
  flex-shrink: 0;
  overflow: hidden; /* indispensable : sinon la <video.pub-cover-bg> peut dépasser */
}
.pub-cover-bg {
  position: absolute; inset: 0; z-index: 0;
  background-size: cover; background-position: center;
}
.pub-cover-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.78) 0%, rgba(0,0,0,.15) 52%, transparent 100%);
}
/* Boutons discrets en haut à droite (QR…) */
.pub-cover-top {
  position: absolute; top: 1rem; right: 1rem; z-index: 2;
  display: flex; gap: .5rem; align-items: center;
}
/* Boutons cover (haut-droite ET haut-gauche) : glass */
.pub-cover-top .btn, .pub-cover-top button,
.pub-cover-top-left .btn, .pub-cover-top-left button {
  background: rgba(0,0,0,.42); color: #fff; border-color: transparent;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.pub-cover-top .btn:hover, .pub-cover-top button:hover,
.pub-cover-top-left .btn:hover, .pub-cover-top-left button:hover { background: rgba(0,0,0,.62); }
/* theme-toggle dans la cover : même gabarit que les autres boutons */
.pub-cover-top .theme-toggle, .pub-cover-top-left .theme-toggle {
  width: auto; height: auto; padding: .35rem .45rem; border-radius: 6px;
  margin: 0; border-color: transparent;
}
.pub-cover-top .theme-toggle:hover, .pub-cover-top-left .theme-toggle:hover {
  transform: none; border-color: transparent;
}

/* Haut-gauche : retour / recherche / déconnexion */
.pub-cover-top-left {
  position: absolute; top: 1rem; left: 1rem; z-index: 2;
  display: flex; gap: .5rem; align-items: center;
}

/* Avatar wrap : taille S/L/XL. Le wrap a la taille EXACTE de la photo (les
   boutons S/L/XL flottent à côté en position absolue, sortis du flux).
   align-self: flex-start empêche le parent flex column (.pub-cover-identity,
   align-items: stretch par défaut) d'étirer le wrap à 100% de largeur. */
.pub-av-wrap { position: relative; display: inline-block; align-self: flex-start; }
.pub-av-wrap[data-size="s"]  .pub-cover-av,
.pub-av-wrap[data-size="s"]  .pub-cover-av-gen,
.pub-av-wrap[data-size="s"]  .pub-cover-av-milo { width: 40px;  height: 40px; }
.pub-av-wrap[data-size="l"]  .pub-cover-av,
.pub-av-wrap[data-size="l"]  .pub-cover-av-gen,
.pub-av-wrap[data-size="l"]  .pub-cover-av-milo { width: 60px;  height: 60px; }
.pub-av-wrap[data-size="xl"] .pub-cover-av,
.pub-av-wrap[data-size="xl"] .pub-cover-av-gen,
.pub-av-wrap[data-size="xl"] .pub-cover-av-milo { width: 90px;  height: 90px; }

/* Photo seule (wrapper pour le label upload) */
.pub-av-photo { position: relative; display: inline-flex; }
/* Bouton caméra sur l'avatar (isSelf) — couvre uniquement pub-av-photo */
.pub-av-upload-btn {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.0); color: rgba(255,255,255,0);
  border-radius: 50%; cursor: pointer;
  transition: background .15s, color .15s;
}
.pub-av-photo:hover .pub-av-upload-btn {
  background: rgba(0,0,0,.52); color: #fff;
}
/* Sélecteur de taille S/L/XL : flotte à droite de l'avatar (sortie du flux
   pour ne pas gonfler le wrap). Aligné sur le HAUT de la photo (et non
   centré verticalement) car l'avatar a margin-bottom — un translate(-50%)
   sur le wrap décale visuellement vers le bas. */
.pub-av-sizes {
  position: absolute;
  top: 0;
  left: calc(100% + .5rem);
  display: flex; gap: 3px;
}
.pub-av-size-btn {
  padding: .2rem .5rem; font-size: .68rem; font-weight: 700;
  background: rgba(0,0,0,.45); color: rgba(255,255,255,.65);
  border: 1px solid rgba(255,255,255,.18); border-radius: 99px; cursor: pointer;
  transition: background .12s, color .12s;
  min-height: 28px;
}
.pub-av-size-btn.active, .pub-av-size-btn:hover { background: rgba(0,0,0,.72); color: #fff; border-color: rgba(255,255,255,.45); }

/* Identité overlay en bas */
.pub-cover-identity {
  position: relative; z-index: 2;
  padding: 1.5rem 1.25rem 1.5rem;
  display: flex; flex-direction: column; gap: .3rem;
}

/* ── Galerie uploadable ── */
.gal-ph { position: relative; }
.gal-ph:not(.gal-filled) { opacity: .55; }
.gal-ph.gal-drag { outline: 2px dashed var(--accent-ink); opacity: 1; }
.gal-slot-upload {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: transparent; color: rgba(255,255,255,0);
  cursor: pointer; border-radius: 4px;
  transition: background .15s, color .15s;
}
.gal-ph:not(.gal-filled):hover .gal-slot-upload,
.gal-ph:not(.gal-filled) .gal-slot-upload { color: rgba(255,255,255,.7); }
.gal-ph.gal-filled .gal-slot-upload { display: none; }
.gal-slot-del {
  position: absolute; top: 4px; right: 4px; z-index: 2;
  width: 22px; height: 22px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(0,0,0,.55); color: #fff; padding: 0;
  display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.gal-ph.gal-filled:hover .gal-slot-del { display: flex; }

.pub-cover-av,
.pub-cover-av-gen,
.pub-cover-av-milo {
  width: 60px; height: 60px; flex-shrink: 0;
  border-radius: 50%; overflow: hidden;
  border: 2px solid rgba(255,255,255,.4);
  margin-bottom: .55rem;
}
.pub-cover-av { object-fit: cover; display: block; }

/* Forme avatar — toggle au reclic sur la taille active (cf. applyAvSize JS).
   Par défaut le CSS de base met border-radius:50% : on l'override explicitement
   pour la forme « square » (léger arrondi) et on RÉAFFIRME 50% en « circle »
   pour battre toute règle plus spécifique. */
.pub-av-wrap[data-shape="square"] .pub-cover-av,
.pub-av-wrap[data-shape="square"] .pub-cover-av-gen,
.pub-av-wrap[data-shape="square"] .pub-cover-av-milo,
.pub-av-wrap[data-shape="square"] .pub-cover-av-gen svg,
.pub-av-wrap[data-shape="square"] .pub-cover-av-milo svg { border-radius: 12px; }
.pub-av-wrap[data-shape="circle"] .pub-cover-av,
.pub-av-wrap[data-shape="circle"] .pub-cover-av-gen,
.pub-av-wrap[data-shape="circle"] .pub-cover-av-milo,
.pub-av-wrap[data-shape="circle"] .pub-cover-av-gen svg,
.pub-av-wrap[data-shape="circle"] .pub-cover-av-milo svg { border-radius: 50%; }
/* Le SVG remplit son conteneur (.pub-cover-av-gen / -milo) à 100% : sans ça il
   reste figé à 60px et l'avatar « flotte » dans le cadre en taille XL (90px). */
.pub-cover-av-gen svg,
.pub-cover-av-milo svg { width: 100%; height: 100%; display: block; border-radius: 50%; }
.pub-cover-names { display: flex; flex-direction: column; gap: .12rem; }
.pub-cover-name {
  font-size: clamp(1.6rem, 6vw, 2.6rem); font-weight: 800;
  color: #fff; letter-spacing: -.025em; line-height: 1.08; margin: 0;
  text-shadow: 0 2px 12px rgba(0,0,0,.45);
}
.pub-cover-handle { color: rgba(255,255,255,.75); font-size: .95rem; margin: 0; }

/* Ligne @handle + badge de plan (Gratuit/Premium) côte à côte sur Ma page. */
.pub-cover-handle-row { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.pub-plan-wrap { position: relative; display: inline-flex; }

/* Badge stylisé — visible seulement en mode propriétaire (isSelf). */
.pub-plan-badge {
  display: inline-flex; align-items: center; gap: .28rem;
  padding: .18rem .55rem;
  font-size: .72rem; font-weight: 700; letter-spacing: .02em;
  border: 1px solid rgba(255,255,255,.32); border-radius: 99px;
  background: rgba(255,255,255,.08); color: rgba(255,255,255,.92);
  cursor: pointer; backdrop-filter: blur(4px);
  transition: background .15s, transform .15s, box-shadow .15s;
}
.pub-plan-badge:hover { background: rgba(255,255,255,.18); transform: translateY(-1px); }
/* Variante visiteur : badge indicatif (pas un button, pas de hover, pas de menu). */
.pub-plan-badge--readonly { cursor: default; pointer-events: none; }
.pub-plan-badge--readonly:hover { transform: none; }
.pub-plan-badge.is-premium {
  background: linear-gradient(135deg, #f7c14a 0%, #e96bb1 55%, #8b5cf6 100%);
  color: #fff; border-color: transparent;
  box-shadow: 0 2px 12px rgba(233,107,177,.4), 0 0 16px rgba(247,193,74,.35);
  animation: pub-plan-pulse 2.6s ease-in-out infinite;
}
.pub-plan-badge.is-premium:hover {
  box-shadow: 0 4px 20px rgba(233,107,177,.55), 0 0 24px rgba(247,193,74,.55);
}
@keyframes pub-plan-pulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(233,107,177,.3), 0 0 10px rgba(247,193,74,.2); }
  50%      { box-shadow: 0 4px 16px rgba(233,107,177,.55), 0 0 22px rgba(247,193,74,.5); }
}
@media (prefers-reduced-motion: reduce) {
  .pub-plan-badge.is-premium { animation: none; }
}

/* Pop-over avec la liste des fonctions premium. Positionné AU-DESSUS du badge
   (le badge est en bas du hero ; un menu vers le bas masquerait les dots de
   navigation et la zone est tronquée par le viewport). */
.pub-plan-menu {
  position: absolute; bottom: calc(100% + .45rem); left: 0; z-index: 5;
  min-width: 280px; max-width: 92vw;
  padding: .65rem;
  background: rgba(22,22,28,.96);
  border: 1px solid rgba(255,255,255,.12); border-radius: var(--r-lg, 12px);
  box-shadow: 0 12px 40px rgba(0,0,0,.55);
  color: #fff;
  backdrop-filter: blur(10px);
  display: flex; flex-direction: column; gap: .35rem;
}
.pub-plan-menu[hidden] { display: none; }
.pub-plan-menu-title {
  display: flex; align-items: center; gap: .4rem;
  margin: 0 0 .25rem; padding: .15rem .25rem;
  font-size: .76rem; font-weight: 700; letter-spacing: .02em;
  color: rgba(255,255,255,.65); text-transform: uppercase;
}
.pub-plan-item {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem .55rem;
  border-radius: var(--r-sm, 8px);
  color: #fff; text-decoration: none;
  transition: background .12s;
}
.pub-plan-item:hover { background: rgba(255,255,255,.08); }
.pub-plan-item > span { display: flex; flex-direction: column; gap: .05rem; line-height: 1.2; }
.pub-plan-item b      { font-size: .87rem; font-weight: 600; }
.pub-plan-item small  { font-size: .72rem; opacity: .65; }
.pub-plan-cta { margin-top: .35rem; text-align: center; }
.pub-cover-title  { color: rgba(255,255,255,.6);  font-size: .88rem; margin: 0; }
.pub-cover-loc {
  color: rgba(255,255,255,.55); font-size: .78rem;
  display: inline-flex; align-items: center; gap: .3rem; margin: .1rem 0 0;
}
.pub-cover-actions {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .7rem;
}
/* Boutons d'action sur la cover (relation, chat) en style glass */
.pub-cover-actions .btn, .pub-cover-actions .rel-switch {
  background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.3);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.pub-cover-actions .btn:hover { background: rgba(255,255,255,.25); }
.pub-cover-actions .rel-switch { border-radius: var(--r-xl); padding: .4rem .8rem; }
.pub-cover-actions .profile-contact-actions { margin: 0; display: contents; }
.pub-cover-actions .profile-contact-actions .btn { flex: none; }

/* Bouton relation SVG icône (dans pub-cover-top, haut-droite) */
.rel-toggle-icon { padding: .35rem .45rem; line-height: 0; }
.rel-toggle-icon svg { display: block; }
.rel-toggle-icon.is-on { background: rgba(255,255,255,.28) !important; color: #fff !important; }

/* --- Zone de corps (onglets + contenu) --- */
.pub-body { display: flex; flex-direction: column; flex: 1; position: relative; z-index: 1; }

/* --- Barre d'onglets --- */
.pub-tabs {
  display: flex; background: var(--card);
  border-bottom: 1px solid var(--hairline);
  position: sticky; top: 0; z-index: 30;
  backdrop-filter: blur(12px) saturate(1.3);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
}
.pub-tab {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .85rem .5rem; border: 0; background: none;
  color: var(--muted); font: inherit; font-size: .88rem; font-weight: 600;
  cursor: pointer; position: relative;
  transition: color var(--dur) var(--ease-out);
  touch-action: manipulation;
  min-height: 44px;
}
.pub-tab::after {
  content: ""; position: absolute; bottom: 0; left: 12%; right: 12%;
  height: 3px; border-radius: 2px; background: var(--accent);
  transform: scaleX(0); transition: transform var(--dur) var(--ease-spring);
}
.pub-tab.is-on { color: var(--accent-ink); font-weight: 700; }
.pub-tab.is-on::after { transform: scaleX(1); }
.pub-tab:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: -2px; }
.pub-tab svg { color: currentColor; }

/* --- Panneaux de contenu --- */
.pub-tab-body { flex: 1; }
.pub-tab-panel {
  padding: 1.25rem 1.25rem 3rem;
  max-width: 680px; margin: 0 auto;
}
.pub-tab-panel[hidden] { display: none; }
.pub-section-h {
  display: flex; align-items: center; gap: .45rem;
  font-weight: 700; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); margin: 1.5rem 0 .65rem;
}
.pub-section-h.first { margin-top: 0; }
.pub-socials { margin-bottom: .75rem; }
.pub-fields { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .1rem; }
/* Bio proéminente */
.pub-bio {
  font-size: 1.02rem; line-height: 1.75; color: var(--fg);
  margin: 0 0 1.1rem; white-space: pre-wrap;
}
/* Bio inline éditable (isSelf) */
.pub-bio-edit {
  display: block; width: 100%;
  font: inherit; font-size: 1.02rem; line-height: 1.75; color: var(--fg);
  background: transparent; border: none; border-radius: 6px;
  outline: none; resize: none; overflow: hidden;
  padding: .35rem .5rem; margin: -.35rem -.5rem .75rem;
  transition: background .15s, box-shadow .15s;
}
.pub-bio-edit::placeholder { color: var(--muted); font-style: italic; }
.pub-bio-edit:hover { background: var(--hover, rgba(255,255,255,.05)); }
.pub-bio-edit:focus {
  background: var(--hover, rgba(255,255,255,.06));
  box-shadow: 0 0 0 2px var(--accent-ink);
}
/* Tags dans le panneau À propos */
.pub-about-tags { margin-bottom: .9rem; }
/* Bouton Modifier (isSelf) : flottant en haut à droite du panneau */
.pub-edit-btn {
  float: right; margin: 0 0 .5rem .5rem;
  text-decoration: none;
}
/* Galerie inline dans À propos (max 10 photos, grille compacte) */
.pub-inline-gallery { margin-top: .5rem; }
.pub-inline-gallery .gal-grid { grid-template-columns: repeat(3, 1fr); }
.pub-inline-gallery .card { margin: 0; box-shadow: none; padding: 0; border: none; background: none; }

/* ── Galerie placeholder : grille de carrés colorés ── */
.gal-ph-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; margin-top: .5rem; }
.gal-ph {
  aspect-ratio: 1; background: var(--ph-c, #555); border: none; cursor: pointer;
  border-radius: 4px; padding: 0;
  transition: transform .15s var(--ease-out), opacity .15s;
}
.gal-ph:hover { transform: scale(1.04); opacity: .85; }
.gal-ph:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
/* Tuile d'ajout (galerie alimentée par le stockage tiers) */
.gal-slot-add {
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-soft); border: 1px dashed var(--line);
  color: var(--muted);
}
.gal-slot-add:hover { color: var(--accent-ink, var(--accent)); border-color: color-mix(in srgb, var(--accent) 50%, transparent); opacity: 1; transform: none; }
.gal-slot-add input { display: none; }

/* ── Lightbox plein écran ── */
#gal-lb {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
}
.gal-lb-bg {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.9);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.gal-lb-box {
  position: relative; z-index: 1;
  width: min(80vw, 80vh); height: min(80vw, 80vh);
  border-radius: 12px;
  transition: background .25s var(--ease-out);
}
.gal-lb-close {
  position: fixed; top: 1.25rem; right: 1.25rem; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,.15); color: #fff; font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  transition: background .15s;
}
.gal-lb-close:hover { background: rgba(255,255,255,.28); }
.gal-lb-prev, .gal-lb-next {
  position: fixed; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,.15); color: #fff; font-size: 1.6rem;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  transition: background .15s;
}
.gal-lb-prev:hover, .gal-lb-next:hover { background: rgba(255,255,255,.28); }
.gal-lb-prev { left: 1.25rem; }
.gal-lb-next { right: 1.25rem; }
.gal-lb-counter {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); z-index: 2;
  color: rgba(255,255,255,.7); font-size: .85rem; letter-spacing: .04em;
}
/* Flèches stylisées ">" qui indiquent une slide voisine (mobile carrousel) :
   FLÈCHE NUE (pas de cercle/cadre), juste le chevron blanc avec halo respirant.
   Zone cliquable réduite à la flèche elle-même pour ne pas intercepter le swipe.
   Cachées par défaut, affichées par pubSlideArrows() côté JS. */
.pub-slide-arrow {
  position: fixed; top: 50%; z-index: 4;
  display: none; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0;
  background: transparent; border: 0; color: #fff; cursor: pointer;
  /* Zone cliquable réduite au strict minimum (le SVG du chevron). Le bouton
     lui-même est transparent aux events ; seul le SVG capte le clic. Sans ça,
     une zone de 28×28 sur les bords interceptait le geste de swipe. */
  pointer-events: none;
}
.pub-slide-arrow > svg {
  pointer-events: auto;
  /* Animation + filter directement sur le SVG (pas sur le button transparent,
     où le drop-shadow s'applique mal). Drop-shadows empilés = halo plus dense. */
  animation: pub-arrow-breath 2.4s ease-in-out infinite;
}
.pub-slide-arrow:hover > svg { animation-play-state: paused; }
.pub-slide-arrow--left {
  left: .35rem;
  transform: translateY(-50%) rotate(180deg);
}
.pub-slide-arrow--right { right: .35rem; transform: translateY(-50%); }
.pub-slide-arrow:not([hidden]) { display: inline-flex; }
.pub-slide-arrow[hidden] { display: none; }
/* Sur grand écran on désactive (le carrousel n'existe pas en desktop). */
@media (min-width: 768px) { .pub-slide-arrow { display: none !important; } }

@keyframes pub-arrow-breath {
  0%, 100% {
    filter: drop-shadow(0 0 2px rgba(255,255,255,.7)) drop-shadow(0 0 4px rgba(255,255,255,.4));
    opacity: .8;
  }
  50% {
    filter: drop-shadow(0 0 4px #fff) drop-shadow(0 0 10px rgba(255,255,255,.9)) drop-shadow(0 0 18px rgba(255,255,255,.55));
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .pub-slide-arrow > svg { animation: none; }
}

/* Pastilles overlay dans le héro (mobile uniquement) */
.pub-hero-dots {
  position: absolute; bottom: 1.1rem; left: 0; right: 0; z-index: 3;
  display: none; justify-content: center; gap: 6px;
}
@media (max-width: 767px) {
  .pub-hero-dots {
    display: flex;
    /* fixed = visible sur tous les slides du carrousel, pas seulement la cover */
    position: fixed; bottom: 1.1rem; z-index: 50;
  }
}
.pub-hero-dot {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 4px; /* zone de touch généreuse */
  background: none; border: none; cursor: pointer;
  touch-action: manipulation;
}
.pub-hero-dot::after {
  content: ""; display: block;
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255,255,255,.45); box-shadow: 0 1px 3px rgba(0,0,0,.4);
  transition: width .2s ease, background .2s ease;
}
.pub-hero-dot.is-on::after { width: 18px; border-radius: 999px; background: #fff; }

/* ── Spotlight search overlay ── */
#cv-search-overlay {
  position: fixed; inset: 0; z-index: 400;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: clamp(4rem, 18vh, 10rem);
}
.cv-sb-bg {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
}
.cv-sb-modal {
  position: relative; z-index: 1;
  width: min(580px, 92vw);
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,.55), 0 0 0 1px var(--hairline);
  overflow: hidden;
  animation: cvSbIn .15s var(--ease-out);
}
@keyframes cvSbIn { from { opacity: 0; transform: translateY(-10px) scale(.97); } }
.cv-sb-form {
  display: flex; align-items: center; gap: .7rem;
  padding: .9rem 1.1rem;
  border-bottom: 1px solid var(--hairline);
}
.cv-sb-form svg { flex-shrink: 0; color: var(--muted); }
.cv-sb-form input {
  flex: 1; background: none; border: none; outline: none;
  font: inherit; font-size: 1.1rem; color: var(--fg);
  min-width: 0;
}
.cv-sb-form input::placeholder { color: var(--muted); }
.cv-sb-esc {
  font-size: .7rem; padding: .2rem .45rem; border-radius: 5px;
  background: var(--inset); border: 1px solid var(--line); color: var(--muted);
  font-family: inherit; white-space: nowrap;
}
.cv-sb-results { max-height: 340px; overflow-y: auto; }
.cv-sb-result {
  display: flex; align-items: center; gap: .8rem;
  padding: .75rem 1.1rem; color: var(--fg); text-decoration: none;
  transition: background .1s;
}
.cv-sb-result:hover, .cv-sb-result:focus { background: var(--chip); outline: none; }
.cv-sb-result .av { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.cv-sb-result .meta { display: flex; flex-direction: column; min-width: 0; }
.cv-sb-result .nm { font-weight: 600; font-size: .95rem; }
.cv-sb-result .hd { font-size: .8rem; color: var(--muted); }
.cv-sb-empty { padding: 1.25rem 1.1rem; color: var(--muted); font-size: .9rem; text-align: center; }

/* Bloc « intro + tags + socials » sous la cover, modèle Milo : visible pour
   TOUS les comptes (free ET premium), sur desktop comme sur mobile. Sur grand
   écran on lui donne la même largeur que le hero et un padding confortable,
   sur mobile une variante est appliquée par la media query plus bas. */
.pub-cover-about {
  position: relative; z-index: 3;
  padding: 1.4rem 1.5rem 1.6rem;
  background: var(--bg);
  display: flex; flex-direction: column; gap: .85rem;
}
.pub-cover-about .pub-about-tags { display: flex; flex-wrap: wrap; gap: .35rem; }
/* L'onglet « À propos » desktop fait doublon avec ce bloc — masquage en grand
   écran ; sur mobile c'est l'inverse (cf. media query). */
@media (min-width: 768px) {
  #pub-about { display: none !important; }
  .pub-tabs [data-tab="about"] { display: none !important; }
}

/* --- Mobile ≤ 767px : carrousel horizontal cover → panneaux --- */
@media (max-width: 767px) {
  /* Bloque le scroll vertical du body (le footer hors #app rendrait la page scrollable) */
  body:has(#app[data-view="profile"] .pub-hero-page) { overflow: hidden; }

  /* pub-hero-page = scroll-container horizontal + fond cover pour blur des panneaux */
  .pub-hero-page {
    flex-direction: row;
    height: 100svh; min-height: unset;
    overflow-x: auto; overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    background: var(--pub-cover) center / cover no-repeat fixed;
  }
  .pub-hero-page::-webkit-scrollbar { display: none; }
  /* Cover = slide 0 : scrollable verticalement pour révéler pub-cover-about */
  .pub-cover-hero {
    flex: 0 0 100%; scroll-snap-align: start;
    justify-content: flex-start; /* spacer via margin-top:auto sur identity */
    overflow-y: auto; scrollbar-width: none;
  }
  .pub-cover-hero::-webkit-scrollbar { display: none; }
  .pub-cover-identity { margin-top: auto; }
  /* pub-body et pub-tab-body : flex-row sans overflow → panneaux restent dans le flux horizontal */
  .pub-body  { display: flex; flex-direction: row; flex: 0 0 auto; height: 100svh; }
  .pub-tab-body { display: flex; flex-direction: row; flex: 0 0 auto; overflow: visible; height: 100svh; }
  .pub-tabs { display: none; }
  /* Chaque panneau = un slide plein écran (100vw explicite, pas %) */
  .pub-tab-panel {
    flex: 0 0 100vw; width: 100vw;
    height: 100svh; overflow-y: auto;
    scroll-snap-align: start;
    max-width: none; margin: 0;
    padding: 5rem 1.25rem 3rem;
    display: block !important;
    scrollbar-width: none;
  }
  .pub-tab-panel::-webkit-scrollbar { display: none; }
  /* pub-about n'est plus un slide sur mobile : masqué (contenu dans pub-cover-about) */
  #pub-about { display: none !important; }
  /* Bio/tags/socials en bas du slide home — z-index:3 pour passer au-dessus du gradient */
  .pub-cover-about {
    display: block;
    position: relative; z-index: 3;
    padding: 1.25rem 1.25rem 4.5rem; /* espace pour les dots fixes */
    background: var(--bg);
  }
  /* Panneaux agenda + galerie : translucide + blur sur fond cover */
  #pub-agenda, #pub-gallery-slot {
    background: color-mix(in srgb, var(--bg) 75%, transparent);
    backdrop-filter: blur(24px) saturate(1.3);
    -webkit-backdrop-filter: blur(24px) saturate(1.3);
  }

  /* ── Public profile 2026 : avatar plus imposant ── */
  .pub-cover-av,
  .pub-cover-av-gen,
  .pub-cover-av-milo {
    width: 80px; height: 80px;
    border: 3px solid rgba(255,255,255,.6);
  }
  /* Mobile : SVG suit le conteneur (100%/100%) — sinon il reste figé à 80px
     pendant que .pub-cover-av-gen passe à 44/80/110px (S/L/XL). */
  .pub-cover-av-gen svg,
  .pub-cover-av-milo svg { width: 100%; height: 100%; }
  .pub-av-wrap[data-size="s"] .pub-cover-av,
  .pub-av-wrap[data-size="s"] .pub-cover-av-gen,
  .pub-av-wrap[data-size="s"] .pub-cover-av-milo { width: 44px; height: 44px; }
  .pub-av-wrap[data-size="l"] .pub-cover-av,
  .pub-av-wrap[data-size="l"] .pub-cover-av-gen,
  .pub-av-wrap[data-size="l"] .pub-cover-av-milo { width: 80px; height: 80px; }
  .pub-av-wrap[data-size="xl"] .pub-cover-av,
  .pub-av-wrap[data-size="xl"] .pub-cover-av-gen,
  .pub-av-wrap[data-size="xl"] .pub-cover-av-milo { width: 110px; height: 110px; }

  /* ── Nom + handle plus forts ── */
  .pub-cover-name { font-size: clamp(2rem, 8vw, 3.2rem); letter-spacing: -.035em; }
  .pub-cover-handle { font-size: 1.05rem; color: rgba(255,255,255,.9); font-weight: 500; }
  .pub-cover-title  { font-size: .95rem; }

  /* ── Gradient plus profond pour lisibilité de l'identité ── */
  .pub-cover-bg::after {
    background: linear-gradient(to top,
      rgba(0,0,0,.90) 0%,
      rgba(0,0,0,.50) 38%,
      rgba(0,0,0,.10) 65%,
      transparent 100%);
  }

  /* ── Identité : padding bottom généreux ── */
  .pub-cover-identity { padding: 1.5rem 1.25rem 2.5rem; }

  /* ── Boutons d'action sur la cover : plus grands, min 44px ── */
  .pub-cover-actions .btn, .pub-cover-actions .rel-switch {
    padding: .55rem 1rem; font-size: .9rem; min-height: 44px;
  }

  /* ── Boutons glass top-left/right : vrais ronds 44px ── */
  .pub-cover-top .btn, .pub-cover-top button,
  .pub-cover-top-left .btn, .pub-cover-top-left button {
    width: 40px; height: 40px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(8px);
  }

  /* ── Panneaux agenda/gallery : réduction padding-top (5rem → 3rem) ── */
  .pub-tab-panel { padding-top: 3rem; }

  /* ── Fond panneaux : plus opaque pour lisibilité ── */
  #pub-agenda, #pub-gallery-slot {
    background: color-mix(in srgb, var(--bg) 88%, transparent);
  }

  /* ── Calendrier : cellules touchables (min 44px) ── */
  #pub-agenda .cal-cell-wrap { min-height: 56px; }
  #pub-agenda .cal-month-grid { grid-auto-rows: auto; }
  #pub-agenda .calendar-fill { flex: none; }

  /* ── Bouton RDV : CTA proéminent pleine largeur ── */
  #ask-rdv {
    margin-top: 1.5rem !important;
    padding: .9rem 1.25rem !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    border-radius: var(--r-xl) !important;
    justify-content: center !important;
  }

  /* ── Galerie : plein écran — grille s'étire sur tout l'espace disponible ── */
  #pub-gallery-slot {
    display: flex !important;
    flex-direction: column;
    padding-bottom: 2rem;
  }
  #pub-gallery-slot .gal-ph-grid {
    flex: 1;
    min-height: 0;
    grid-template-rows: 1fr 1fr 1fr;
    gap: 3px;
    margin-top: 0;
  }
  #pub-gallery-slot .gal-ph { aspect-ratio: unset; }

  /* ── Bullets de navigation : plus visibles, min 44px de zone tactile ── */
  .pub-hero-dot {
    width: 8px; height: 8px;
    padding: 0; margin: 0 3px;
    border: none; border-radius: 50%;
    background: rgba(255,255,255,.35); cursor: pointer;
    transition: background .2s, transform .2s;
  }
  .pub-hero-dot.is-on {
    background: #fff; transform: scale(1.4);
  }
}

/* --- Tablette + Desktop ≥ 768px : héro sticky gauche + contenu droit, sans header --- */
@media (min-width: 768px) {
  body:has(#app[data-view="profile"] .pub-hero-page) { overflow: clip; height: 100dvh; }

  /* Sur PC, le topbar revient en sticky (en flux) — il décale naturellement le
     contenu de topbar-h sans padding manuel. La règle source-order > règle global
     fixed du thème hero. Les couleurs/backdrop reviennent au style standard. */
  body:has(#app[data-view="profile"] .pub-hero-page) .topbar.site-header {
    position: sticky !important;
    background: color-mix(in srgb, var(--bg) 88%, transparent) !important;
    backdrop-filter: blur(18px) !important;
    -webkit-backdrop-filter: blur(18px) !important;
    border-bottom: 1px solid var(--line) !important;
  }
  body:has(#app[data-view="profile"] .pub-hero-page) .topbar.site-header .brand,
  body:has(#app[data-view="profile"] .pub-hero-page) .topbar.site-header .brand-text,
  body:has(#app[data-view="profile"] .pub-hero-page) .topbar.site-header .btn,
  body:has(#app[data-view="profile"] .pub-hero-page) .topbar.site-header .profile-chip { color: var(--fg) !important; }
  body:has(#app[data-view="profile"] .pub-hero-page) .topbar.site-header .profile-chip {
    background: var(--bg-soft) !important; border-color: var(--line) !important;
  }
  body:has(#app[data-view="profile"] .pub-hero-page) .topbar.site-header input {
    background: var(--inset) !important; color: var(--fg) !important; border-color: var(--line) !important;
  }
  body:has(#app[data-view="profile"] .pub-hero-page) .topbar.site-header input::placeholder { color: var(--muted) !important; }

  /* Hauteur bornée au viewport (sous le topbar sticky) pour que la colonne de
     droite (.pub-body) scrolle EN INTERNE au lieu de déborder/être rognée par
     le body (overflow:clip). Sans ça, un panneau long (ex. Espace privé) est
     coupé en bas. */
  .pub-hero-page {
    flex-direction: row; align-items: stretch;
    height: calc(100dvh - var(--topbar-h)); min-height: 0; overflow: hidden;
  }
  .pub-cover-hero {
    width: 42%; max-width: 460px; flex-shrink: 0;
    height: auto; min-height: 100%;
    position: sticky; top: 0; align-self: flex-start;
    margin-top: 0; padding-top: 0;
  }
  .pub-cover-identity { padding: 2rem 1.5rem 2rem; }
  .pub-cover-name { font-size: clamp(1.75rem, 3vw, 2.75rem); }
  /* pub-body est le conteneur de scroll, son bord haut est déjà sous le topbar.
     Donc pub-tabs colle à top:0 (= sous le topbar). Mettre top:topbar-h le
     décalerait de 56px trop bas et recouvrirait le début du contenu (texte coupé).
     scroll-padding-top = hauteur des onglets pour que le changement d'onglet
     ne place pas le contenu sous la barre d'onglets sticky. */
  /* min-height:0 : indispensable pour qu'un enfant flex puisse être plus court
     que son contenu et donc activer son propre overflow:auto (sinon il s'étire
     à la hauteur du contenu et rien ne scrolle). */
  .pub-body { flex: 1; min-width: 0; min-height: 0; height: 100%; overflow: auto; scroll-padding-top: 3.5rem; }
  .pub-tabs { top: 0; }
  /* Recherche alignée à droite dans le topbar */
  body:has(#app[data-view="profile"] .pub-hero-page) .topbar.site-header .site-header-center {
    flex: 0 1 auto;
    margin-left: auto;
  }
  .pub-tab-panel { padding: 1.75rem 2rem 3rem; max-width: 640px; margin: 0; }
  /* 2 onglets seulement : l'onglet "Accueil" est masqué, son contenu migre côté cover */
  .pub-tab[data-tab="about"] { display: none; }
}

/* --- Desktop ≥ 1024px --- */
@media (min-width: 1024px) {
  .pub-cover-hero { max-width: 560px; }
  .pub-cover-identity { padding: 2.5rem 2rem 2.5rem; }
  .pub-cover-name { font-size: clamp(2rem, 4vw, 3rem); }
  .pub-tab-panel { padding: 2rem 2.5rem 3rem; max-width: 680px; }
}

/* --- Large desktop ≥ 1200px --- */
@media (min-width: 1200px) {
  .pub-cover-hero { width: 40%; max-width: 640px; }
  /* Aligne sur la gauche : cap la largeur totale, pas de centrage */
  #app[data-view="profile"] .pub-hero-page { max-width: 1440px; }
  .pub-tab-panel { max-width: 720px; padding: 2rem 2.5rem 3rem; }
}

@media (prefers-reduced-motion: reduce) {
  .pub-tab::after { transition: none; }
}

/* Éditeur privé : deck horizontal de 3 colonnes (desktop ET mobile), sans
   scroll vertical de page — la navigation est horizontale. */
body:has(#app[data-view="private"]) { height: 100dvh; overflow: hidden; }
#app[data-view="private"] { justify-content: flex-start; min-height: 0; }
.deck-viewport {
  width: 100%; overflow: hidden; flex: 1; min-height: 0;
}
.deck {
  display: flex; gap: 1.25rem; height: 100%; align-items: stretch;
  padding: .85rem 0; will-change: transform;
}
.deck .col {
  flex: 0 0 clamp(280px, 92vw, 520px);
  container-type: inline-size;        /* densité : compaction selon la largeur réelle de la colonne, pas l'écran */
  /* Tokens fluides liés à la largeur de la colonne (cqi = 1% de l'inline-size du conteneur).
     Compaction CONTINUE : colonne étroite → moins de padding/gap, photo plus petite,
     pour « tenir » avant de devoir scroller. Bornés par clamp (min lisible / max actuel). */
  --pad: clamp(0.95rem, 4.5cqi, 1.5rem);
  --gap: clamp(0.4rem, 1.7cqi, 0.7rem);
  --photo: clamp(60px, 22cqi, 104px);
  height: 100%; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;              /* Firefox : pas de scrollbar (base ; barre overlay réactivée au hover plus bas) */
  opacity: .55; transition: box-shadow .4s ease;
  display: flex; flex-direction: column;
  transform-origin: center center; will-change: transform, opacity;
  border-radius: var(--radius);
}
.deck .col:not(.active) { cursor: pointer; }
.deck .col > .card { margin: auto 0; }  /* centre verticalement (sticke en haut si trop grand) */
/* Titre de la colonne active (affiché entre le header et le deck) */
.deck-title { padding-top: .75rem; text-align: center; font-size: .82rem; font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; min-height: 1.6rem; }
/* Chevron « retour au Menu » : icône cliquable en haut à gauche de la colonne,
   couleur d'accent Milo. Injecté dans chaque colonne (sauf Menu). */
.deck-back {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; margin: 0 0 .4rem -.35rem;
  background: none; border: none; padding: 0; border-radius: var(--r-sm);
  color: var(--accent-ink); cursor: pointer;
  transition: background .15s, transform .1s;
}
.deck-back:hover { background: var(--accent-soft); }
.deck-back:active { transform: scale(.9); }
.deck-back:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }

/* Colonne « Menu » : lanceur d'actions (grille bento). */
.menu-head { margin-bottom: 1.1rem; }
.menu-eyebrow { margin: 0 0 .1rem; font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.menu-title { margin: 0; font-size: 1.3rem; font-weight: 700; }
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.menu-tile {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: flex-start; gap: .45rem;
  min-height: 116px; padding: .9rem; text-align: left; cursor: pointer;
  background: var(--inset); border: 1px solid var(--line); color: var(--fg);
  border-radius: var(--r-lg);
  transition: transform .12s ease, border-color .15s, background .15s, box-shadow .15s;
}
.menu-tile-ic {
  width: 44px; height: 44px; border-radius: var(--r-md); flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--c) 20%, transparent);
  color: var(--c);
}
.menu-tile-ic svg { width: 22px; height: 22px; }
.menu-tile-tt { margin-top: auto; font-size: .98rem; font-weight: 700; line-height: 1.1; }
.menu-tile-sb { font-size: .76rem; color: var(--muted); }
.menu-tile:hover {
  border-color: color-mix(in srgb, var(--c) 55%, transparent);
  background: color-mix(in srgb, var(--c) 9%, var(--inset));
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0,0,0,.28);
}
.menu-tile:active { transform: scale(.97); }
.menu-tile:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }
.menu-badge {
  position: absolute; top: .7rem; right: .7rem;
  min-width: 1.35rem; height: 1.35rem; padding: 0 .35rem;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--danger, #ef4444); color: #fff; border-radius: 999px;
  font-size: .72rem; font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
@media (prefers-reduced-motion: reduce) { .menu-tile { transition: none; } .menu-tile:hover { transform: none; } }

/* Milo en bas du Menu : représentation de face, animée (flotte + regard + clin d'œil). */
.menu-milo { margin-top: auto; display: flex; justify-content: center; padding-top: 1.5rem; }
.menu-milo .milo { width: 110px; height: 110px; animation: milo-bob 4.5s ease-in-out infinite; transform-origin: 50% 92%; }
.menu-milo .milo-look { animation: milo-look 7s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.menu-milo .milo-eyeball { animation: milo-blink 5.5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes milo-bob { 0%,100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-7px) rotate(-2deg); } }
@keyframes milo-look { 0%,18% { transform: translateX(0); } 30%,48% { transform: translateX(-5px); } 62%,82% { transform: translateX(3px); } 100% { transform: translateX(0); } }
@keyframes milo-blink { 0%,92%,100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
@media (prefers-reduced-motion: reduce) {
  .menu-milo .milo, .menu-milo .milo-look, .menu-milo .milo-eyeball { animation: none; }
}

/* Sélecteur de contact (tuiles Discuter / Passer un appel). */
.picker-panel { width: min(92vw, 380px); max-height: 80vh; display: flex; flex-direction: column; position: relative; }
.picker-title { margin: 0; font-size: 1.1rem; display: inline-flex; align-items: center; gap: .4rem; }
.picker-title svg { color: var(--accent-ink); }
.pick-search {
  width: 100%; margin-bottom: .6rem; padding: .55rem .7rem;
  background: var(--inset); border: 1px solid var(--line); border-radius: var(--r-sm);
  color: var(--fg); font-size: .9rem;
}
.pick-search:focus { outline: none; border-color: var(--accent-ink); }
.picker-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: .35rem; }
.picker-item {
  display: flex; align-items: center; gap: .6rem; width: 100%;
  background: var(--inset); border: 1px solid var(--line); color: var(--fg);
  border-radius: var(--r-md); padding: .5rem .6rem; cursor: pointer; text-align: left;
  transition: border-color .15s, background .15s;
}
.picker-item:hover { border-color: var(--accent-ink); background: var(--accent-soft); }
.picker-item .meta { display: flex; flex-direction: column; min-width: 0; }
.picker-item .nm { font-weight: 600; }
.picker-item .hd { color: var(--muted); font-size: .8rem; }

/* Cadenas/clé sur l'avatar : indique que le coffre E2E contient bien une clé. */
.vault-badge {
  position: absolute; right: -2px; bottom: -2px;
  width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
  background: var(--accent-strong); color: #fff;
  border: 2px solid var(--card); border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.vault-badge svg { width: 12px; height: 12px; }
.photo-frame { position: relative; display: inline-flex; }
/* Avatar cliquable (panneau Profil) → ouvre le sélecteur de photo. Pastille
   caméra révélée au survol, par-dessus la photo (le badge coffre reste visible
   hors survol). */
.photo-wrap[for] { cursor: pointer; }
.photo-edit {
  position: absolute; inset: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.5); color: #fff;
  opacity: 0; transition: opacity .15s var(--ease-out);
}
.photo-wrap[for]:hover .photo-edit,
.photo-wrap[for]:focus-visible .photo-edit { opacity: 1; }
/* Dernière connexion affichée sous le handle du profil. */
.last-seen { display: inline-flex; align-items: center; gap: .3rem; margin: .25rem 0 0; color: var(--muted); font-size: .78rem; }
.last-seen svg { opacity: .8; }
/* Branche de navigation, en bas (desktop ET mobile) */
.deck-branch { width: 100%; display: flex; justify-content: center; padding: .15rem 0 .45rem; flex: none; }

/* ===================== Landing « moteur » (scroll vertical) =====================
   La page d'accueil déconnectée n'utilise plus le deck horizontal : héros centré
   façon moteur de recherche, puis sections empilées atteignables via la barre
   d'ancres collante. Le deck reste réservé à l'éditeur privé / aux profils. */
#app[data-view="landing"] { justify-content: flex-start; }
.landing { width: 100%; display: flex; flex-direction: column; align-items: center; }

/* Héros : occupe ~le premier écran, tout est centré autour de la recherche. */
.lp-hero {
  width: 100%; max-width: 1120px; padding: clamp(1.5rem, 5vh, 3.5rem) 1.25rem 3.5rem;
  display: grid; grid-template-columns: minmax(0, 1fr) clamp(250px, 30vw, 350px);
  align-items: center; gap: clamp(1.5rem, 5vw, 4rem);
  /* Première page plein écran : hauteur ajustée en JS (viewport − bandeau/topbar),
     avec repli CSS si JS indispo. */
  min-height: 100svh; position: relative;
}
.hero-copy {
  display: flex; flex-direction: column; align-items: flex-start; text-align: left;
  min-width: 0;
}
/* Mockup de l'app, flottant, avec halo accent derrière. */
.hero-visual { position: relative; display: flex; justify-content: center; align-items: center; justify-self: end; }
.hero-visual::before {
  content: ""; position: absolute; inset: -6% -14%; z-index: 0;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 26%, transparent), transparent 72%);
  pointer-events: none;
}
.hero-phone {
  position: relative; z-index: 1; width: 100%; height: auto;
  max-height: min(82svh, 760px);
  filter: drop-shadow(0 30px 60px rgba(0, 0, 0, .55));
  transform-origin: 50% 60%;
}
@media (prefers-reduced-motion: no-preference) {
  .hero-phone { animation: phone-float 7s ease-in-out infinite; }
  .hero-phone-shine { animation: phone-shine 5.5s ease-in-out 1.2s infinite; }
}
@keyframes phone-float {
  0%, 100% { transform: translateY(0) rotate(-1.6deg); }
  50%      { transform: translateY(-14px) rotate(1.6deg); }
}
@keyframes phone-shine {
  0%   { transform: translateX(0); opacity: 0; }
  12%  { opacity: 1; }
  60%  { transform: translateX(560px); opacity: 0; }
  100% { transform: translateX(560px); opacity: 0; }
}

/* Rangée « disponible partout » (badges clients) sous le hero. */
.clients {
  list-style: none; padding: 0; margin: 1rem 0 0;
  display: flex; flex-wrap: wrap; gap: .45rem; max-width: 30rem;
}
.cli {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .3rem .55rem; border-radius: 999px;
  border: 1px solid var(--line); background: color-mix(in srgb, var(--card) 60%, transparent);
  font-size: .82rem; color: var(--muted);
}
.cli .cli-ic { display: inline-flex; opacity: .8; }
.cli em {
  font-style: normal; font-size: .68rem; letter-spacing: .02em; text-transform: uppercase;
  padding: .08rem .38rem; border-radius: 999px; background: var(--line); color: var(--muted);
}
.cli.on { color: var(--fg); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.cli.on em {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: var(--accent-ink);
}
@media (max-width: 880px) {
  .clients { justify-content: center; }
}
/* Indice de défilement animé en bas du hero. */
.scroll-cue {
  position: absolute; left: 50%; bottom: 1.4rem; transform: translateX(-50%);
  display: flex; color: var(--muted); opacity: .7; pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  .scroll-cue { animation: cue-bounce 1.8s ease-in-out infinite; }
}
@keyframes cue-bounce { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 7px); } }
.lp-hero .hero-milo { margin-bottom: 1rem; }
.lp-hero h1 {
  font-size: clamp(1.9rem, 5.5vw, 3rem); line-height: 1.06; letter-spacing: -.03em;
  margin: 0 0 .85rem;
}
.lp-hero h1 .accent { color: var(--accent-ink); }
.lp-tagline { color: var(--muted); font-size: 1.05rem; max-width: 30rem; margin: 0 0 1.75rem; }
.lp-hero .search { width: 100%; z-index: 5; margin-inline: 0; }
.lp-hero .search-box { padding: .25rem .35rem .25rem 1.1rem; box-shadow: 0 12px 34px -20px rgba(0, 0, 0, .65); }
.lp-hero .hero-actions { margin-top: 1.25rem; }
.lp-hero .adoption { margin-top: 1.2rem; }

/* Écrans étroits : on repasse en une colonne, texte centré, mockup sous le texte
   et plus compact (la première page n'est plus verrouillée à 100svh). */
@media (max-width: 880px) {
  .lp-hero {
    grid-template-columns: 1fr; justify-items: center; gap: 2rem;
    min-height: auto; padding-bottom: 4.5rem;
  }
  .hero-copy { align-items: center; text-align: center; }
  .hero-visual { order: 1; justify-self: center; }
  .hero-phone { max-height: 62svh; max-width: 280px; }
}

/* Barre d'ancres collante sous le header — navigation des sections. */
.lp-anchors {
  position: sticky; top: 0; z-index: 30;
  display: flex; gap: .35rem; flex-wrap: wrap; justify-content: center;
  width: 100%; padding: .55rem 1rem;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.lp-anchors a {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .45rem .85rem; border-radius: 999px; text-decoration: none;
  color: var(--muted); font-size: .88rem; font-weight: 500;
  border: 1px solid transparent; transition: color .15s, background .15s, border-color .15s;
}
.lp-anchors a:hover { color: var(--fg); background: var(--bg-soft); border-color: var(--line); }
.lp-anchors a svg { flex: none; }

/* Sections empilées, alternance de fond, ancrage sous la barre collante. */
.lp-section {
  width: 100%; display: flex; flex-direction: column; align-items: center;
  padding: clamp(2.5rem, 7vh, 4.5rem) 0;
  border-top: 1px solid var(--line); scroll-margin-top: 3.5rem;
}
.lp-section:nth-of-type(even) { background: var(--bg-soft); }
.lp-section > .features { padding-top: 0; padding-bottom: 1.5rem; }

/* Section « Tarifs & licence » — intégrée au flux (ex-page /pricing). */
.pricing { width: 100%; max-width: 960px; padding: 0 1.25rem; }
.pr-lead { color: var(--muted); max-width: 46rem; margin: .4rem 0 0; }
.pr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 1rem; margin: 1.75rem 0 0; }
.pr-plan {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.4rem; display: flex; flex-direction: column; gap: .6rem;
}
.pr-plan.feat { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.pr-plan h3 { margin: 0; font-size: 1.1rem; }
.pr-price { font-size: 1.5rem; font-weight: 700; }
.pr-plan ul { margin: .3rem 0 0; padding-left: 1.1rem; color: var(--muted); font-size: .92rem; }
.pr-plan li { margin: .25rem 0; }
.pr-cta {
  margin-top: auto; display: inline-block; width: 100%; text-align: center;
  padding: .6rem 1rem; border-radius: var(--r-md); background: var(--accent);
  color: #0b0d12; font: inherit; font-weight: 600; text-decoration: none;
  border: 0; cursor: pointer;
}
.pr-cta.ghost { background: transparent; color: var(--accent-ink); border: 1px solid var(--accent); }
/* Offre grand public : grille resserrée (2 plans) + prix mensuel + plan « populaire ». */
.pr-grid--duo { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); max-width: 640px; margin-inline: auto; }
.pr-per { font-size: .85rem; font-weight: 500; color: var(--muted); margin-left: .35rem; }
.pr-plan.feat .pr-tag { color: #0b0d12; background: var(--accent); }
/* Encart « Abonnement » de l'écran Options. */
.abo-status { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.abo-badge { font-weight: 700; padding: .2rem .65rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); }
.abo-status.is-premium .abo-badge { background: var(--accent); color: #0b0d12; }
.abo-until { color: var(--muted); font-size: .9rem; }
/* Section « Espace privé » sur la page publique /@handle. Surface l'accès
   aux pages premium pour les abonnés ET propose le checkout pour les autres. */
.pub-space {
  margin: 0 0 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--accent) 4%, transparent);
}
.pub-space--open { border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.pub-space-head {
  display: flex; align-items: center; gap: .4rem;
  font-weight: 700; font-size: .92rem; margin-bottom: .55rem;
}
.pub-space-head svg { color: var(--accent-ink); }
.pub-space-edit { margin-left: auto; opacity: .75; text-decoration: none; font-weight: 500; }
.pub-space-edit:hover { opacity: 1; text-decoration: underline; }
.pub-space-desc { font-size: .88rem; color: var(--muted); margin: 0 0 .65rem; }
.pub-space-pages { list-style: none; margin: 0 0 .75rem; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.pub-space-page {
  display: flex; align-items: center; gap: .55rem;
  padding: .55rem .75rem; border-radius: var(--r-sm);
  background: var(--bg-soft); text-decoration: none; color: inherit;
  transition: background .15s, transform .15s;
}
.pub-space-page:hover {
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-soft));
  transform: translateX(2px);
}
.pub-space-title { flex: 1; font-weight: 500; }
.pub-space-arrow { opacity: .55; }
.pub-space-page-locked {
  display: flex; align-items: center; gap: .55rem;
  padding: .5rem .7rem; border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--bg) 50%, transparent);
  color: var(--muted); font-size: .9rem; opacity: .85;
}
.pub-space-cta { width: 100%; justify-content: center; }

/* ==== Bouton « ← Retour » unifié ====
   Touch target ≥44×44, label visible, focus ring conservé.
   Comportement : history.back() si la page précédente est même origine,
   sinon fallback vers data-fallback. */
.back-btn {
  display: inline-flex; align-items: center; gap: .45rem;
  min-height: 44px; padding: .55rem .95rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--bg-soft); color: inherit;
  font-size: .9rem; font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s;
}
.back-btn:hover {
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-soft));
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}
.back-btn:active { transform: translateX(-1px); }
.back-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.back-btn svg { flex-shrink: 0; }

/* ==== Page index « Espace privé » /@handle/space ====
   Layout responsive : container 1100px max, hero deux colonnes (id+CTA)
   sur ≥760px, grille de cartes auto-fill 1→3 colonnes selon largeur. */
.spx { max-width: 1100px; margin: 1.25rem auto 2.5rem; padding: 0 1.25rem; }
.spx-topbar { margin-bottom: 1.25rem; }

/* Hero : avatar + identité à gauche, CTA à droite (collapse en mobile). */
.spx-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.25rem 2rem;
  align-items: center;
  padding: 1.5rem;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--bg-soft)), var(--bg-soft));
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line));
  margin-bottom: 1.5rem;
}
.spx-hero-id { display: flex; align-items: center; gap: 1.1rem; min-width: 0; }
.spx-avatar {
  width: 80px; height: 80px;
  border-radius: 50%; object-fit: cover; flex-shrink: 0;
  background: var(--bg);
  border: 2px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.spx-avatar-milo, .spx-avatar-gen { display: flex; align-items: center; justify-content: center; }
.spx-hero-text { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.spx-hero-eyebrow {
  display: inline-flex; align-items: center; gap: .35rem;
  margin: 0; font-size: .72rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent-ink);
}
.spx-hero-title { margin: 0; font-size: 1.7rem; line-height: 1.15; }
.spx-hero-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: .35rem;
  margin: .15rem 0 0; color: var(--muted); font-size: .92rem;
}
.spx-hero-meta a { color: inherit; text-decoration: none; }
.spx-hero-meta a:hover { text-decoration: underline; }
.spx-price { font-weight: 600; color: var(--accent-ink); }
.spx-hero-cta { justify-self: end; display: flex; flex-direction: column; gap: .35rem; align-items: flex-end; max-width: 320px; }
.spx-cta {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .85rem 1.4rem;
  min-height: 48px; /* touch-target-size */
  font-size: 1rem; font-weight: 600;
  white-space: nowrap;
}
.spx-cta[disabled], .spx-cta[aria-busy="true"] { opacity: .8; cursor: wait; }
.spx-cta .spx-cta-main b { font-weight: 800; }
.spx-cta-sub {
  margin: 0;
  font-size: .82rem; line-height: 1.4;
  color: var(--muted);
  text-align: right;
  max-width: 280px;
}

/* Statut « accès débloqué » / placeholder */
.spx-status {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .6rem 1rem;
  border-radius: 999px;
  font-size: .88rem; color: var(--muted);
  background: var(--bg-soft);
}
.spx-status--ok {
  color: var(--accent-ink);
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-soft));
}

/* Grille de pages : 1→3 colonnes selon la largeur. */
.spx-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: .75rem;
}
.spx-card {
  position: relative;
  display: flex; align-items: center; gap: .65rem;
  padding: 1rem 1.1rem;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--bg-soft); color: inherit; text-decoration: none;
  min-height: 64px;
  transition: background .15s, border-color .15s, transform .15s, box-shadow .15s;
}
.spx-card:hover {
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-soft));
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  transform: translateY(-1px);
  box-shadow: 0 3px 12px color-mix(in srgb, var(--accent) 12%, transparent);
}
.spx-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.spx-card-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent-ink); flex-shrink: 0;
}
.spx-card-title { flex: 1; font-weight: 600; min-width: 0; word-break: break-word; }
.spx-card-arrow { opacity: .55; font-size: 1.15rem; flex-shrink: 0; }
.spx-card:hover .spx-card-arrow { opacity: 1; transform: translateX(2px); }
.spx-card.is-draft { border-style: dashed; opacity: .85; }
.spx-card-badge {
  font-size: .62rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: .15rem .5rem; border-radius: 4px;
  background: color-mix(in srgb, var(--muted) 28%, transparent); color: var(--muted);
}
.spx-card--locked { color: var(--muted); cursor: default; }
.spx-card--locked:hover { background: var(--bg-soft); border-color: var(--line); transform: none; box-shadow: none; }
.spx-card-lock { color: var(--muted); }
.spx-grid--teaser .spx-card { opacity: .85; }

/* État vide (créateur sans page). */
.spx-empty {
  text-align: center;
  padding: 2.5rem 1.5rem;
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
  max-width: 480px; margin: 1rem auto 0;
}
.spx-empty h1 { margin: 0; }
.spx-empty .subtitle { margin: 0; color: var(--muted); }

/* Mobile : hero en pile, CTA pleine largeur. */
@media (max-width: 720px) {
  .spx-hero {
    grid-template-columns: 1fr;
    padding: 1.25rem;
  }
  .spx-hero-cta { justify-self: stretch; align-items: stretch; max-width: none; }
  .spx-cta { width: 100%; justify-content: center; }
  .spx-cta-sub { text-align: center; max-width: none; }
  .spx-hero-title { font-size: 1.45rem; }
  .spx-avatar { width: 64px; height: 64px; }
}
@media (max-width: 480px) {
  .spx { padding: 0 1rem; }
  .spx-grid { grid-template-columns: 1fr; }
}

/* Conteneur page payante (réutilise .spx + .pp-view). */
.spx .pp-view { margin: 0; max-width: none; }

/* ── Rendu type-aware des pages premium (renderPaidPageContent) ─────────── */
.pp-empty { text-align: center; color: var(--muted); padding: 1.5rem 0; }

/* Lien externe */
.pp-link { display: flex; flex-direction: column; gap: .75rem; }
.pp-link-note { margin: 0; color: var(--fg); white-space: pre-wrap; }
.pp-link-cta { align-self: flex-start; }

/* Galerie publique : grille fluide, items cliquables, lightbox au clic. */
.pp-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .55rem;
}
.pp-gal-item {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  border: 0; padding: 0; margin: 0; cursor: pointer;
  border-radius: var(--r-sm); overflow: hidden;
  background: var(--bg-soft);
  transition: transform .15s, box-shadow .15s;
}
.pp-gal-item:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.pp-gal-item img, .pp-gal-item video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.pp-gal-cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: .25rem .5rem;
  font-size: .75rem; color: #fff;
  background: linear-gradient(to top, rgba(0,0,0,.65), transparent);
  text-align: left;
}

/* Fichier téléchargeable */
.pp-file {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.25rem;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--bg-soft);
}
.pp-file-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent-ink);
  flex-shrink: 0;
}
.pp-file-body { flex: 1; min-width: 0; }
.pp-file-body b { display: block; word-break: break-word; }
.pp-file-size { color: var(--muted); font-size: .85rem; }

/* Markdown léger */
.pp-markdown h1, .pp-markdown h2, .pp-markdown h3 { margin: 1.25rem 0 .5rem; }
.pp-markdown h1 { font-size: 1.5rem; }
.pp-markdown h2 { font-size: 1.25rem; }
.pp-markdown h3 { font-size: 1.05rem; }
.pp-markdown p { margin: .55rem 0; line-height: 1.55; }
.pp-markdown ul { margin: .55rem 0 .55rem 1.25rem; padding-left: .8rem; }
.pp-markdown li { margin: .25rem 0; }
.pp-markdown strong { color: var(--accent-ink); }

/* ── Wizard : type Fichier (carte état uploadé / vide) ───────────────────── */
.pp-file-state { margin: .25rem 0; }
.pp-file-card {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--bg-soft);
}
.pp-file-card .pp-file-ic {
  width: 36px; height: 36px; border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent-ink); flex-shrink: 0;
}
.pp-file-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pp-file-info b { word-break: break-word; }
.pp-file-empty {
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  padding: 1.25rem; text-align: center;
  border: 1.5px dashed var(--line); border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--bg) 50%, transparent);
}
.pp-file-empty .pp-file-ic {
  width: 44px; height: 44px; border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent-ink);
  display: inline-flex; align-items: center; justify-content: center;
}
.pp-file-empty p { margin: 0; color: var(--muted); font-size: .9rem; }

/* Indication d'usage du calendrier public (visiteur) — remplace l'ancien
   bouton « Demander un RDV ». Le RDV se prend en cliquant un jour libre. */
.cal-hint {
  display: flex; align-items: center; gap: .5rem;
  margin: .75rem 0 0; padding: .7rem .9rem;
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-soft));
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line));
  color: var(--fg); font-size: .9rem; line-height: 1.4;
}
.cal-hint svg { flex-shrink: 0; color: var(--accent-ink); }
.pub-space-draft {
  font-size: .65rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: .1rem .4rem; border-radius: 4px;
  background: color-mix(in srgb, var(--muted) 30%, transparent);
  color: var(--muted);
}
.pub-space-page.is-draft { opacity: .8; border: 1px dashed color-mix(in srgb, var(--muted) 30%, var(--line)); }

/* Couverture vidéo (Premium P4) : remplit le hero comme une image background-cover.
   inset:0 hérité de .pub-cover-bg ne suffit pas — sans width/height explicites
   le <video> garde ses dimensions intrinsèques 1080×1920 et dépasse le viewport. */
.pub-cover-video {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
}

/* Modale de cadrage couverture (ui/cover-editor.js) */
.cover-editor { max-width: 480px; }
.cover-editor .ce-stage {
  display: flex; justify-content: center;
  background: #0b0d12; border-radius: var(--r-md);
  padding: 12px; margin: .6rem 0 .8rem;
}
.cover-editor .ce-frame {
  position: relative;
  width: 240px; aspect-ratio: 9 / 16;
  overflow: hidden; border-radius: 18px;
  background: #111;
  touch-action: none;
  cursor: grab;
  user-select: none;
}
.cover-editor .ce-frame:active { cursor: grabbing; }
.cover-editor .ce-media {
  position: absolute; left: 50%; top: 50%;
  pointer-events: none; user-select: none; -webkit-user-drag: none;
  max-width: none; max-height: none;
  transform: translate(-50%, -50%);
}
.cover-editor .ce-loading {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #aaa; font-size: .85rem;
}
.cover-editor .ce-controls { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1rem; }
.cover-editor .ce-controls label { display: flex; align-items: center; gap: .6rem; font-size: .85rem; margin: 0; }
.cover-editor .ce-lbl { display: inline-flex; align-items: center; gap: .3rem; min-width: 70px; color: var(--muted); }
.cover-editor .ce-controls input[type="range"] { flex: 1; }
.cover-editor .ce-trim-val { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .8rem; min-width: 7.5em; text-align: right; }
.cover-editor .ce-actions { display: flex; justify-content: flex-end; gap: .5rem; }
/* Boutons personnalisés de la page publique (Premium P5). */
.pub-buttons { display: flex; flex-direction: column; gap: .5rem; margin: .85rem 0; }
.pub-btn { display: flex; align-items: center; justify-content: center; gap: .5rem; padding: .7rem 1rem; border-radius: var(--r-md); background: var(--accent); color: #0b0d12; font-weight: 600; text-decoration: none; }
.pub-btn:hover { filter: brightness(1.06); }

/* ── Boutons flottants personnalisables (cover-hero) ───────────────────────
   Calque transparent qui couvre la cover et reçoit des badges position:abs
   placés en %. La position est persistée côté serveur (pos_x, pos_y) donc
   les visiteurs voient le même agencement.
   Édition : drag avec pointer events sur le bouton (côté propriétaire). */
.pub-fbtn-layer {
  position: absolute; inset: 0;
  pointer-events: none;            /* ne bloque pas les clics sur la cover */
  z-index: 3;                       /* au-dessus de la cover-bg, sous identity */
}
.pub-fbtn {
  position: absolute;
  pointer-events: auto;            /* ré-active sur les boutons eux-mêmes */
  transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; min-width: 44px;
  padding: 0 .6rem;
  background: rgba(0,0,0,.55); color: #fff;
  border: 1px solid rgba(255,255,255,.35);
  text-decoration: none; font-size: .82rem; font-weight: 600;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 14px rgba(0,0,0,.35);
  transition: background .15s, transform .15s, box-shadow .15s, border-color .15s;
  user-select: none; touch-action: none; /* drag fluide sur mobile */
  -webkit-user-drag: none;               /* bloque le drag natif Safari/WebKit */
}
.pub-fbtn--circle           { border-radius: 50%; }
.pub-fbtn--square           { border-radius: 8px; }
.pub-fbtn.has-label         { width: auto; padding: 0 .85rem; gap: .4rem; min-width: 44px; }
.pub-fbtn:hover             { background: rgba(0,0,0,.78); border-color: rgba(255,255,255,.7); }
.pub-fbtn.is-self           { cursor: grab; }
.pub-fbtn.is-self:active,
.pub-fbtn.is-dragging       { cursor: grabbing; box-shadow: 0 8px 24px rgba(0,0,0,.55); transform: translate(-50%, -50%) scale(1.05); }
.pub-fbtn-lbl               { white-space: nowrap; }

/* Tooltip stylisé au survol — visible UNIQUEMENT si le libellé n'est pas déjà
   affiché en permanence (.has-label) et si data-label est rempli. Bulle sombre
   avec petite flèche pointant vers le badge, fade-in 150ms. */
.pub-fbtn[data-label]:not([data-label=""]):not(.has-label)::after {
  content: attr(data-label);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(4px) scale(.95);
  white-space: nowrap; max-width: 60vw; overflow: hidden; text-overflow: ellipsis;
  padding: .35rem .65rem;
  background: linear-gradient(180deg, rgba(28,28,36,.98), rgba(18,18,24,.98));
  color: #fff;
  font-size: .78rem; font-weight: 600; letter-spacing: .01em;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 6px 18px rgba(0,0,0,.5), 0 0 0 1px rgba(0,0,0,.25);
  opacity: 0; pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
  z-index: 5;
}
.pub-fbtn[data-label]:not([data-label=""]):not(.has-label)::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border: 6px solid transparent;
  border-top-color: rgba(18,18,24,.98);
  opacity: 0; pointer-events: none;
  transition: opacity .15s ease;
  z-index: 5;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.35));
}
.pub-fbtn[data-label]:not([data-label=""]):not(.has-label):hover::after,
.pub-fbtn[data-label]:not([data-label=""]):not(.has-label):focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}
.pub-fbtn[data-label]:not([data-label=""]):not(.has-label):hover::before,
.pub-fbtn[data-label]:not([data-label=""]):not(.has-label):focus-visible::before {
  opacity: 1;
}
/* Pas de tooltip pendant le drag (gêne visuelle) ni sur réduction du mouvement. */
.pub-fbtn.is-dragging::after,
.pub-fbtn.is-dragging::before { opacity: 0 !important; }
@media (prefers-reduced-motion: reduce) {
  .pub-fbtn[data-label]::after,
  .pub-fbtn[data-label]::before { transition: none; }
}

/* Éditeur boutons personnalisés (Ma page, propriétaire). Liste drag-and-drop
   limite 5 entrées ; chaque ligne = icône (avec preview), libellé, URL, ✕. */
.pub-buttons-edit {
  display: flex; flex-direction: column; gap: .5rem;
  margin: .85rem 0;
  padding: .8rem;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--r-lg, 12px);
  color: #fff;
}
.pb-edit-head {
  display: flex; align-items: center; gap: .35rem;
  font-size: .82rem; color: rgba(255,255,255,.85);
}
.pb-edit-count {
  margin-left: auto; font-size: .72rem; opacity: .6; font-variant-numeric: tabular-nums;
}
.pb-edit-hint { font-size: .76rem; color: rgba(255,255,255,.6); margin: 0; }
.pb-edit-hint a { color: var(--accent-ink, #fff); }
.pb-edit-list { display: flex; flex-direction: column; gap: .35rem; }
.pb-edit-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 90px) minmax(0, 1fr) minmax(0, 1.5fr) 28px 28px 28px;
  align-items: center; gap: .35rem;
  padding: .35rem .45rem;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--r-md, 8px);
  transition: background .12s, opacity .12s;
}
.pb-edit-shape, .pb-edit-showlbl {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.18);
  color: #fff; cursor: pointer;
  width: 28px; height: 28px; padding: 0; border-radius: 6px;
  font-size: .82rem; line-height: 1; font-weight: 700;
}
.pb-edit-shape:hover, .pb-edit-showlbl:hover { background: rgba(255,255,255,.16); }
.pb-edit-showlbl.on { background: rgba(255,255,255,.45); color: #0b0d12; }
.pb-edit-hint-inline { margin-left: auto; font-size: .72rem; opacity: .55; }
.pb-preview-ic { display: inline-flex; align-items: center; justify-content: center; color: rgba(255,255,255,.85); }
.pb-edit-row input {
  min-width: 0;
  padding: .35rem .5rem;
  font: inherit; font-size: .82rem;
  background: rgba(0,0,0,.35); color: #fff;
  border: 1px solid rgba(255,255,255,.1); border-radius: var(--r-sm, 6px);
}
.pb-edit-row input:focus { outline: none; border-color: rgba(255,255,255,.45); background: rgba(0,0,0,.6); }
.pb-edit-del {
  background: transparent; border: 0; color: rgba(255,255,255,.55);
  cursor: pointer; font-size: 1rem; padding: 0; line-height: 1;
}
.pb-edit-del:hover { color: var(--danger, #ef4444); }
.pb-edit-actions { display: flex; align-items: center; gap: .55rem; margin-top: .15rem; }
.pb-edit-status { font-size: .76rem; color: rgba(255,255,255,.55); }
/* Sur mobile : 2 lignes — icône+libellé d'abord puis URL+actions ensuite. */
@media (max-width: 540px) {
  .pb-edit-row {
    grid-template-columns: 22px minmax(0, 70px) minmax(0, 1fr) 28px 28px 28px;
    grid-template-areas:
      "preview iconin label del del del"
      "url     url    url   shape lbl ."
      "url-c   url-c  url-c url-c url-c url-c";
    row-gap: .3rem;
  }
  .pb-preview-ic { grid-area: preview; }
  .pb-edit-icon  { grid-area: iconin; }
  .pb-edit-label { grid-area: label; }
  .pb-edit-url   { grid-area: url; grid-column: 1 / -1; }
  .pb-edit-shape { grid-area: shape; }
  .pb-edit-showlbl { grid-area: lbl; }
  .pb-edit-del   { grid-area: del; }
}
/* Éditeur — personnalisation Premium (couverture + boutons). */
.hm-badge.premium { background: var(--accent); color: #0b0d12; }
.lt-premium { display: flex; flex-direction: column; gap: .7rem; margin-top: .5rem; }
.lt-premium.is-locked { opacity: .7; }
.lt-prem-row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.lt-prem-row.lt-prem-col { flex-direction: column; align-items: stretch; }
.lt-prem-label { font-size: .85rem; color: var(--muted); display: inline-flex; align-items: center; gap: .35rem; }
.lt-prem-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.pb-list { display: flex; flex-direction: column; gap: .4rem; }
/* Ligne complète : preview · icône · libellé · URL · forme · show_label · ✕ */
.pb-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 90px) minmax(0, 1fr) minmax(0, 1.5fr) 28px 28px 28px;
  gap: .35rem; align-items: center;
}
.pb-row input { min-width: 0; }
.pb-prev-ic { display: inline-flex; align-items: center; justify-content: center; color: var(--fg); }
.pb-shape, .pb-showlbl {
  background: transparent; border: 1px solid var(--line); border-radius: var(--r-sm, 6px);
  cursor: pointer; color: var(--fg);
  width: 28px; height: 28px; padding: 0;
  font-size: .82rem; line-height: 1; font-weight: 700;
}
.pb-shape:hover, .pb-showlbl:hover { background: var(--inset, rgba(255,255,255,.04)); }
.pb-showlbl.on { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.pb-del { background: transparent; border: 1px solid var(--line); border-radius: var(--r-sm, 8px); cursor: pointer; color: var(--muted); padding: 0 .5rem; }
@media (max-width: 540px) {
  .pb-row {
    grid-template-columns: 22px minmax(0, 80px) minmax(0, 1fr) 28px 28px 28px;
    grid-template-areas:
      "prev icon label del del del"
      "url  url  url   shape lbl .";
    row-gap: .3rem;
  }
  .pb-prev-ic { grid-area: prev; }
  .pb-icon    { grid-area: icon; }
  .pb-label   { grid-area: label; }
  .pb-url     { grid-area: url; grid-column: 1 / -1; }
  .pb-shape   { grid-area: shape; }
  .pb-showlbl { grid-area: lbl; }
  .pb-del     { grid-area: del; }
}
/* Galerie — bouton lien (propriétaire) + pastille (visiteur). */
.gal-link { position: absolute; top: .35rem; left: .35rem; border: 0; border-radius: 999px; cursor: pointer; background: rgba(0,0,0,.55); color: #fff; width: 1.7rem; height: 1.7rem; opacity: .7; }
.gal-link.on { background: var(--accent); color: #0b0d12; opacity: 1; }
.gal-linkbadge { position: absolute; top: .35rem; left: .35rem; font-size: .9rem; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
/* Pages premium (Espace Premium). */
.pp-content { white-space: pre-wrap; line-height: 1.6; }
.pp-row {
  display: flex; gap: .5rem; align-items: center; flex-wrap: wrap;
  padding: .45rem .15rem; border-bottom: 1px solid var(--line);
}
.pp-row:last-child { border-bottom: 0; }
.pp-row-ic { display: inline-flex; align-items: center; color: var(--accent-ink); opacity: .85; }
.pp-row b { font-weight: 600; }
.pp-new summary { cursor: pointer; color: var(--accent-ink); }

/* Wizard : étape 1 = grille de cartes par type. */
.pp-wizard {
  background: color-mix(in srgb, var(--accent) 4%, var(--bg-soft));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.1rem 1.1rem;
  margin-top: .8rem;
}
.pp-form-head { margin: .2rem 0 1.1rem; padding-bottom: .65rem; border-bottom: 1px solid var(--line); }

/* Formulaire — rythme vertical 16/24, labels visibles, focus visible. */
.pp-form { display: flex; flex-direction: column; gap: 1.25rem; }
.pp-field { display: flex; flex-direction: column; gap: .4rem; }
.pp-field--content { gap: .55rem; }
.pp-label {
  font-size: .82rem; font-weight: 600; letter-spacing: .01em;
  color: var(--fg);
}
.pp-required { color: var(--danger, #f87171); margin-left: .15rem; }
.pp-help {
  margin: 0; font-size: .78rem; line-height: 1.4;
  color: var(--muted);
}

/* Inputs : 44px min, focus accent, transitions courtes. Couvre aussi les
   inputs type-spécifiques injectés dans #pp-type-fields (pp-link-url, pp-md, …). */
.pp-form input:not([type="checkbox"]):not([type="file"]):not([type="radio"]),
.pp-form textarea {
  min-height: 44px;
  padding: .6rem .85rem;
  background: var(--inset, var(--bg-soft));
  border: 1px solid var(--line);
  border-radius: 10px;
  color: inherit;
  font-size: .95rem;
  font-family: inherit;
  width: 100%; box-sizing: border-box;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.pp-form input::placeholder, .pp-form textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.pp-form input:not([type="checkbox"]):not([type="file"]):not([type="radio"]):focus,
.pp-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
  background: var(--bg);
}
.pp-form input:invalid:not(:placeholder-shown):not([type="checkbox"]) { border-color: color-mix(in srgb, var(--danger, #f87171) 50%, var(--line)); }

/* Slug : préfixe URL visible inline (read-only-distinction). */
.pp-slug-row {
  display: flex; align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--inset, var(--bg-soft));
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.pp-slug-row:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}
.pp-slug-prefix {
  display: inline-flex; align-items: center;
  padding: 0 .65rem 0 .85rem;
  background: color-mix(in srgb, var(--muted) 12%, transparent);
  color: var(--muted);
  font-size: .85rem; font-family: var(--mono, ui-monospace, "SF Mono", Menlo, monospace);
  white-space: nowrap; user-select: none;
  border-right: 1px solid var(--line);
}
.pp-slug-row input {
  flex: 1; min-width: 0;
  min-height: 44px;
  padding: .6rem .85rem;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: inherit;
  font-family: var(--mono, ui-monospace, "SF Mono", Menlo, monospace);
  font-size: .9rem;
}

/* Toggle « Publier tout de suite » — touch target 44, état clair. */
.pp-toggle {
  display: flex; align-items: flex-start; gap: .8rem;
  padding: .85rem 1rem;
  border-radius: 12px;
  background: var(--inset, var(--bg-soft));
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  min-height: 44px;
}
.pp-toggle:hover { border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.pp-toggle:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.pp-toggle-input { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }
.pp-toggle-track {
  flex-shrink: 0;
  position: relative;
  width: 40px; height: 24px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 35%, transparent);
  transition: background .2s ease;
  margin-top: .15rem;
}
.pp-toggle-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff;
  transition: transform .2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.pp-toggle-input:checked + .pp-toggle-track { background: var(--accent); }
.pp-toggle-input:checked + .pp-toggle-track .pp-toggle-thumb { transform: translateX(16px); }
.pp-toggle-text { display: flex; flex-direction: column; gap: .15rem; line-height: 1.35; }
.pp-toggle-title { font-weight: 600; font-size: .92rem; color: var(--fg); }
.pp-toggle-desc { font-size: .8rem; color: var(--muted); }

/* Actions : secondaires à gauche, primaire à droite (primary-action). */
.pp-actions {
  display: flex; align-items: center; gap: .5rem;
  flex-wrap: wrap;
  padding-top: .6rem; margin-top: .25rem;
  border-top: 1px solid var(--line);
}
.pp-actions-primary { margin-left: auto; min-height: 44px; padding: .7rem 1.25rem; font-weight: 600; }
.pp-actions-secondary { min-height: 40px; }

@media (max-width: 480px) {
  .pp-actions { flex-direction: column-reverse; align-items: stretch; }
  .pp-actions-primary { margin-left: 0; width: 100%; justify-content: center; }
  .pp-actions-secondary { width: 100%; justify-content: center; }
}
.pp-type-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: .55rem; margin-top: .5rem;
}
.pp-type-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: .25rem;
  padding: .75rem .85rem; border-radius: 10px; cursor: pointer; text-align: left;
  background: rgba(255,255,255,.04); border: 1px solid var(--line); color: inherit;
  transition: background .15s, border-color .15s, transform .1s;
}
.pp-type-card:not([disabled]):hover { background: rgba(255,255,255,.09); border-color: var(--accent); }
.pp-type-card:not([disabled]):active { transform: scale(.98); }
.pp-type-card[disabled] { opacity: .45; cursor: not-allowed; }
.pp-type-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.2rem; height: 2.2rem; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent-ink); margin-bottom: .2rem;
}
.pp-type-card b { font-size: .95rem; }
.pp-type-card .lbl-sm { line-height: 1.35; }

/* (anciennes règles génériques pp-form remplacées par le bloc structuré
   ci-dessus avec labels, helper text, toggle stylisé ; cf. ~ligne 2606.) */
.pp-form textarea { resize: vertical; min-height: 7rem; width: 100%; box-sizing: border-box; }
.pr-tag {
  display: inline-block; align-self: flex-start; font-size: .72rem; font-weight: 600;
  color: var(--accent-ink); background: var(--accent-soft); padding: .15rem .5rem; border-radius: 999px;
}
.pr-info { max-width: 46rem; margin: 2rem auto 0; align-self: stretch; }
.pr-info h3 { font-size: 1.1rem; margin: 1.5rem 0 .3rem; }
.pr-info h3:first-child { margin-top: 0; }
.pr-info p { color: var(--muted); margin: 0; }

/* Pied de page dans le flux vertical (remplace l'ancienne colonne « about »). */
.lp-footer {
  width: 100%; display: flex; justify-content: center;
  padding: 3rem 1.25rem 5rem; border-top: 1px solid var(--line);
}
.lp-footer .about-col { height: auto; }
.lp-footer .sub { color: var(--muted); font-size: .9rem; }

/* Mouvement réduit : pas de défilement animé déclenché par les ancres. */
@media (prefers-reduced-motion: no-preference) {
  html:has(#app[data-view="landing"]) { scroll-behavior: smooth; }
}
.deck .col::-webkit-scrollbar { width: 0; height: 0; display: none; } /* WebKit */
/* Compactage pour tenir dans le viewport — tokens fluides (cqi).
   Les @media(max-width:600px) plus bas restent prioritaires (source ultérieure)
   pour forcer le compactage « hauteur limitée » sur téléphone. */
.deck .col .card { padding: var(--pad); }
.deck .col :is(.fields, .rels, .events, .slots, .requests) { gap: var(--gap); }
.deck .section-title { margin: var(--gap) 0 .5rem; padding-top: .85rem; }
.deck .cal-cell-wrap { min-height: 60px; }
.deck .cal-chip { font-size: .65rem; }
.deck .photo { width: var(--photo); height: var(--photo); }
.deck .event-form, .deck .add-row, .deck .rel-add { margin-top: .4rem; }
.deck .col.active { opacity: 1; }
.deck .col .card { max-width: none; }

/* ---- col-scroll : colonnes sans scrollbar apparente ----
   Éditeur (/me) : la carte remplit la hauteur de la colonne, seul le div
   .col-scroll interne déborde (scrollbar fine, invisible au repos).
   Profil public : la carte reste centrée (pas de fill-height). */
#app[data-view="private"] .deck .col {
  overflow: hidden; /* plus de scrollbar sur la colonne elle-même */
}
#app[data-view="private"] .deck .col > .card {
  flex: 1; min-height: 0; margin: 0;
  display: flex; flex-direction: column; overflow: hidden;
}
/* Zone scrollable interne (à placer dans chaque colonne) */
.col-scroll {
  flex: 1; min-height: 0;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
.col-scroll::-webkit-scrollbar { width: 3px; }
.col-scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 2px; }
/* Négatif horizontal pour ne pas rogner le padding de la carte */
#app[data-view="private"] .deck .col-scroll {
  margin: 0 -1.2rem; padding: 0 1.2rem;
}

/* Navigation « branche » */
.branch-nav { overflow: visible; }
.branch-line { stroke: #5a6a4a; stroke-width: 3; }
.bud { cursor: pointer; }
.bud .bud-dot { fill: #2c7d63; stroke: #43b58f; stroke-width: 1.5; transition: fill .2s; }
.bud:hover .bud-dot { fill: var(--accent); }
.bud.active .bud-dot { fill: transparent; stroke: none; }
.bud:focus { outline: none; }
.bud:focus-visible .bud-dot { stroke: var(--accent); stroke-width: 2.5; }
.branch-marker circle { fill: var(--accent); }
.branch-marker .branch-leaf { fill: #43b58f; }
.deck-branch { position: relative; }
.bud-tip {
  position: absolute;
  bottom: calc(100% + .35rem);
  transform: translateX(-50%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .28rem .7rem;
  font-size: .74rem; font-weight: 600; letter-spacing: .01em;
  color: var(--fg);
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
}
/* Petit caret pointant vers le bourgeon. */
.bud-tip::after {
  content: ""; position: absolute; top: 100%; left: 50%;
  width: 8px; height: 8px; margin: -5px 0 0 -4px;
  background: var(--card); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  transform: rotate(45deg);
}
/* Sélecteur de langue : pilule fantôme discrète + chevron custom (pas la flèche native). */
.lang-select {
  appearance: none; -webkit-appearance: none; width: auto; max-width: none;
  font-size: .82rem; font-weight: 500; color: var(--fg);
  background-color: transparent; border: 1px solid var(--line); border-radius: 999px;
  padding: .4rem 1.85rem .4rem .85rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b93a3' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .6rem center; background-size: .68rem;
  transition: border-color .15s, background-color .15s;
}
.lang-select:hover { border-color: var(--accent-line); background-color: var(--bg-soft); }

/* Sur mobile, on garde le deck HORIZONTAL (swipe), une colonne à la fois. */
@media (max-width: 760px) {
  .deck { gap: 0; padding: .5rem 0; }
  .deck .col { flex: 0 0 100vw; padding: 0 1rem; }
  .editor-header .edit-tag { display: none; }
}

/* Relations */
.rels { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.rel { display: flex; align-items: center; gap: .5rem; justify-content: space-between; padding: .5rem .6rem; border-radius: var(--r-md); border: 1px solid transparent; transition: background var(--dur-fast) var(--ease-out), border-color var(--dur) var(--ease-out); }
.rel:hover { background: var(--bg-soft); border-color: var(--hairline); }
.rel-link { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--fg); min-width: 0; flex: 1; }
.rel .av { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--chip); flex: none; display: flex; align-items: center; justify-content: center; color: var(--muted); overflow: hidden; }
.rel .meta { min-width: 0; display: flex; flex-direction: column; }
.rel-link:hover .nm { color: var(--accent-ink); }
.rel .nm { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rel .hd { color: var(--muted); font-size: .8rem; }
.rel-type { font-size: var(--t-2xs); padding: .1rem .5rem; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; }
.rel-type.amis { color: var(--success); border-color: rgba(127,220,160,.4); }
.rel-type.pro { color: var(--accent-ink); border-color: var(--accent-line); }
.rel-type.autre { color: var(--muted); }
.deg { font-size: .7rem; color: var(--muted); text-transform: none; letter-spacing: 0; font-weight: 400; }
.rel-add { display: grid; grid-template-columns: 1fr auto auto; gap: .4rem; margin-top: .5rem; }
select { font: inherit; color: var(--fg); background: var(--inset); border: 1px solid var(--line); border-radius: var(--r-md); padding: .5rem .4rem; transition: border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out); }
select:focus { outline: none; border-color: var(--accent-ink); box-shadow: 0 0 0 3px var(--accent-soft); }
.loading { color: var(--muted); text-align: center; padding: 4rem 1rem; }

/* Spinner d'attente réutilisable dans un bouton (ex. « Ajouter » une relation
   pendant l'appel réseau + re-rendu). Hérite de la couleur du texte du bouton. */
@keyframes btn-spin { to { transform: rotate(360deg); } }
.btn-spinner {
  display: inline-block; width: 1em; height: 1em;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  vertical-align: -.15em; margin-right: .35em;
  animation: btn-spin .6s linear infinite;
}
.btn.is-loading { pointer-events: none; opacity: .9; cursor: progress; }

/* Journal des actions (Compte › Activité) — échecs appel/chat/live détaillés. */
.act-log { display: flex; flex-direction: column; gap: .15rem; }
.act-log-row { display: flex; gap: .55rem; padding: .45rem .55rem; border-radius: var(--r-sm); align-items: flex-start; }
.act-log-row + .act-log-row { border-top: 1px solid var(--line); border-top-left-radius: 0; border-top-right-radius: 0; }
.act-log-ic { flex: none; color: var(--muted); margin-top: .1rem; }
.act-log-body { flex: 1; min-width: 0; }
.act-log-head { display: flex; gap: .5rem; align-items: baseline; justify-content: space-between; }
.act-log-text { font-size: .86rem; color: var(--fg); }
.act-log-time { flex: none; font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.act-log-detail { font-size: .78rem; color: var(--muted); line-height: 1.4; margin-top: .1rem; word-break: break-word; }
.act-log--error { background: color-mix(in srgb, var(--danger, #ef4444) 9%, transparent); }
.act-log--error .act-log-ic, .act-log--error .act-log-text { color: var(--danger, #ef4444); }
.act-log--warn { background: color-mix(in srgb, var(--accent, #f59e0b) 8%, transparent); }

/* Popup d'approbation d'un nouvel appareil. */
.dev-approve-list { display: flex; flex-direction: column; gap: .5rem; margin: .8rem 0 .2rem; }
.dev-approve-row {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  padding: .55rem .7rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg);
}
.dev-approve-name { font-size: .88rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dev-approve-actions { display: flex; gap: .4rem; flex: none; }
@media (prefers-reduced-motion: reduce) { .btn-spinner { animation-duration: 1.4s; } }

.photo-wrap { display: flex; justify-content: center; margin-bottom: 1.25rem; }
/* En-tête Identité (grand écran) : les 4 actions sur UNE seule ligne, centrées.
   Les deux conteneurs passent en display:contents → leurs boutons deviennent
   des frères directs de .id-actions. nowrap + padding/police réduits pour tenir. */
.id-actions { display: flex; flex-wrap: nowrap; justify-content: center; align-items: center; gap: .4rem; margin: .5rem 0 .75rem; }
.id-photo-form, .id-actions-sec { display: contents; }
.id-actions .btn { white-space: nowrap; padding: .45rem .7rem; font-size: .84rem; min-width: 0; }
.id-actions .btn-label { overflow: hidden; text-overflow: ellipsis; }
.photo { width: 104px; height: 104px; border-radius: 50%; object-fit: cover; border: 2px solid var(--line); background: var(--chip); }
.photo.placeholder { display: flex; align-items: center; justify-content: center; color: var(--fg); background: #2a3140; font-size: 2.2rem; font-weight: 600; }
.photo.avatar { overflow: hidden; padding: 0; }
.photo.avatar svg { display: block; width: 100%; height: 100%; }
.photo.milo-photo { background: var(--bg-soft); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.photo.milo-photo svg { width: 118%; height: 118%; transform: translateY(6px); }

.card h1 { font-size: 1.4rem; margin: 0 0 .15rem; text-align: center; }
.card .handle { color: var(--muted); text-align: center; margin: 0 0 .15rem; font-size: .9rem; }
.subtitle { color: var(--muted); text-align: center; margin: .25rem 0 1.25rem; }

/* Colonne identité : en-tête horizontal (photo à gauche, identité à droite). */
.profile-head {
  display: flex; align-items: center; gap: 1rem; text-align: left;
  margin: 2.1rem 0 .9rem;  /* dégage la rangée d'actions (QR / relations) en haut */
}
.profile-head .photo-wrap { margin: 0; flex: none; }
.profile-id { min-width: 0; }
.profile-id h1 { font-size: 1.3rem; text-align: left; margin: 0 0 .1rem; }
.profile-id .handle { text-align: left; margin: 0 0 .2rem; }
.profile-id .subtitle { text-align: left; margin: 0; }
/* Tags + réseaux sociaux regroupés sur une même ligne, alignés à gauche. */
.profile-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .6rem;
  margin: 0 0 .9rem;
}
.profile-meta .tags, .profile-meta .social-links { margin: 0; justify-content: flex-start; }

.fields { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; gap: .55rem; }
.field { display: grid; grid-template-columns: minmax(0, 110px) 1fr; gap: .5rem; align-items: baseline; }
.field .k { color: var(--muted); font-size: .82rem; overflow-wrap: anywhere; }
.field .v { word-break: break-word; }
.field a { color: var(--accent-ink); text-decoration: none; }

.section-title {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); margin: 1.5rem 0 .6rem; border-top: 1px solid var(--line); padding-top: 1rem;
}

.events { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.event { display: flex; justify-content: space-between; gap: .75rem; align-items: baseline; }
.event .when { color: var(--accent-ink); font-variant-numeric: tabular-nums; font-size: .82rem; white-space: nowrap; }
.event .what { flex: 1; }
.event .loc { color: var(--muted); font-size: .82rem; }
.empty { color: var(--muted); font-size: .9rem; }

/* ===== Agenda — événements façon Teams (liste groupée par jour) ===== */
.ev-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  margin-bottom: .85rem; flex: none;
}
.ev-toolbar-title { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; font-size: .92rem; color: var(--fg); }
.ev-toolbar-title svg { color: var(--accent-ink); }

.ev-agenda { display: flex; flex-direction: column; gap: 1.1rem; }
.ev-group { display: flex; flex-direction: column; gap: .45rem; }
.ev-day {
  font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); padding: 0 .15rem .1rem;
}

.ev-card {
  position: relative; display: flex; align-items: flex-start; gap: .8rem;
  padding: .65rem .7rem .65rem 1rem;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
/* Liseré d'accent à gauche (signature visuelle Teams) */
.ev-card::before {
  content: ""; position: absolute; left: 0; top: .55rem; bottom: .55rem; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--accent);
}
.ev-card:hover { border-color: var(--accent-line); box-shadow: var(--elev-1); transform: translateY(-1px); }
.ev-card.past { opacity: .55; }
.ev-card.past::before { background: var(--line); }

.ev-time {
  flex: none; width: 3.3rem; display: flex; flex-direction: column; gap: .05rem;
  font-variant-numeric: tabular-nums; line-height: 1.2; padding-top: .05rem;
}
.ev-time .ev-t0 { font-size: .9rem; font-weight: 600; color: var(--fg); }
.ev-time .ev-t1 { font-size: .76rem; color: var(--muted); }

.ev-main { flex: 1; min-width: 0; }
.ev-title { font-size: .92rem; font-weight: 600; color: var(--fg); overflow-wrap: anywhere; }
.ev-meta { display: flex; flex-wrap: wrap; gap: .25rem .8rem; margin-top: .25rem; }
.ev-meta > * { display: inline-flex; align-items: center; gap: .25rem; font-size: .78rem; color: var(--muted); }
.ev-meta svg { color: var(--muted); flex: none; }
.ev-link { color: var(--accent-ink); text-decoration: none; }
.ev-link:hover { color: var(--accent); }
.ev-link svg { color: currentColor; }

.ev-actions {
  flex: none; display: flex; gap: .15rem; align-self: center;
  opacity: 0; transition: opacity var(--dur-fast) var(--ease-out);
}
.ev-card:hover .ev-actions, .ev-card:focus-within .ev-actions { opacity: 1; }
.ev-act {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0; border-radius: var(--r-sm);
  background: none; border: 1px solid transparent; color: var(--muted); cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.ev-act:hover { background: var(--inset); color: var(--fg); border-color: var(--line); }
.ev-act.danger:hover { color: var(--danger); border-color: rgba(240,113,122,.4); background: rgba(240,113,122,.1); }
.ev-act:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 1px; opacity: 1; }

.ev-empty { color: var(--muted); font-size: .9rem; padding: 1.5rem .25rem; text-align: center; }

/* Tactile : pas de hover fiable → actions toujours visibles. */
@media (hover: none) {
  .ev-actions { opacity: 1; }
}

/* ===== Modale composer d'événement (création / édition) ===== */
.ev-modal { max-width: 520px; }
.ev-modal .ev-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
/* min-width:0 sur les enfants : sans ça, l'intrinsic-min-width de
   `input[type=datetime-local]` (= largeur du placeholder mm/dd/yyyy + icône)
   force la cellule à dépasser et l'input de droite déborde de la modale. */
.ev-modal .ev-grid2 > * { min-width: 0; }
.ev-modal .ev-grid2 input { width: 100%; box-sizing: border-box; }
.ev-modal .opt { color: var(--muted); font-weight: 400; }
.ev-modal .req { color: #ef4444; margin-left: .15rem; font-weight: 700; }
.btn.danger.ghost { background: none; color: var(--danger); border-color: transparent; margin-right: auto; font-weight: 500; }
.btn.danger.ghost:hover { background: rgba(240,113,122,.1); border-color: rgba(240,113,122,.4); filter: none; }

/* ----- Header : titre + badge EN DIRECT (visible uniquement en mode live) ----- */
.ev-modal .ev-header { display: flex; align-items: center; gap: .55rem; margin-bottom: .8rem; }
.ev-modal .ev-header h2 { margin: 0; }
.ev-live-badge {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .15rem .55rem;
  background: #ef4444; color: white;
  border-radius: 999px;
  font-size: .68rem; font-weight: 700; letter-spacing: .06em;
}
.ev-live-dot {
  width: .42rem; height: .42rem; border-radius: 50%; background: white;
  animation: ev-live-pulse 1.4s infinite;
}
@keyframes ev-live-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.85); } }
@media (prefers-reduced-motion: reduce) {
  .ev-live-dot { animation: none; }
}

/* ----- Bascule [data-only] / [data-when] selon le kind du form ----- */
/* Par défaut on cache les éléments scoping le mode live (l'event est par
   défaut un simple événement) et on montre ceux scoping le mode event. */
.ev-modal [data-only="live"],
.ev-modal [data-when="live"] { display: none !important; }
.ev-modal form[data-kind="live"] [data-only="event"],
.ev-modal form[data-kind="live"] [data-when="event"] { display: none !important; }
.ev-modal form[data-kind="live"] [data-only="live"],
.ev-modal form[data-kind="live"] [data-when="live"] { display: revert !important; }
.ev-modal form[data-kind="live"] .ev-notify-row[data-only="live"] { display: flex !important; }
.ev-modal form[data-kind="live"] .ev-live-badge[data-only="live"] { display: inline-flex !important; }
/* Badge EN DIRECT vit dans .ev-header (hors form) → on duplique data-kind sur
   le panel .ev-modal côté JS pour le ciblage sans :has(). */
.ev-modal[data-kind="live"] .ev-live-badge { display: inline-flex !important; }

/* ----- Pills Événement / Live : 2 colonnes, 2 lignes (label + sous-titre) ----- */
.ev-modal .ev-kind-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: .4rem;
  padding: .3rem;
  background: var(--inset);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin: 0 0 .7rem;
}
.ev-modal .ev-kind-tab {
  display: flex; flex-direction: column; align-items: center; gap: .15rem;
  padding: .55rem .5rem;
  border: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: calc(var(--r-md) - 3px);
  font: inherit; font-size: .82rem; cursor: pointer;
  transition: background 180ms var(--ease-out), color 180ms var(--ease-out),
              border-color 180ms var(--ease-out);
}
.ev-modal .ev-kind-tab:hover { color: var(--fg); background: rgba(0,0,0,.03); }
[data-theme="dark"] .ev-modal .ev-kind-tab:hover { background: rgba(255,255,255,.04); }
.ev-modal .ev-kind-tab:focus-visible {
  outline: 2px solid #2563eb; outline-offset: 2px;
}
.ev-modal .ev-kind-tab.active {
  background: var(--surf-1, #ffffff);
  color: var(--fg);
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 2px 8px rgba(0,0,0,.06);
}
[data-theme="dark"] .ev-modal .ev-kind-tab.active {
  background: var(--surf-1, #1a1c22);
}
.ev-modal .ev-kind-tab[data-kind="event"].active { border-color: rgba(37,99,235,.45); color: #2563eb; }
.ev-modal .ev-kind-tab[data-kind="live"].active  { border-color: rgba(239,68,68,.5);  color: #ef4444; }
.ev-modal .ev-kind-tab .ev-kind-label { font-weight: 600; font-size: .9rem; }
.ev-modal .ev-kind-tab .ev-kind-sub   { font-size: .7rem; opacity: .7; }

/* ----- Hint card mode live (encadré rouge avec liseré gauche) ----- */
.ev-modal .ev-live-hint {
  display: flex; align-items: flex-start; gap: .55rem;
  padding: .6rem .75rem;
  margin: 0 0 .8rem;
  background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.22);
  border-left: 3px solid #ef4444;
  border-radius: var(--r-sm);
  font-size: .82rem; line-height: 1.4;
}
.ev-modal .ev-live-hint svg { color: #ef4444; flex: none; margin-top: 2px; }
.ev-modal .ev-live-hint strong { color: #ef4444; }

/* ----- Toggle rows (notify + public) : carte avec icône + sous-texte ----- */
.ev-modal .ev-toggle-row {
  display: flex; align-items: flex-start; gap: .6rem;
  padding: .55rem .7rem;
  margin: 0 0 .5rem;
  background: var(--inset);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: .88rem; color: var(--fg);
  cursor: pointer;
  transition: background 150ms var(--ease-out), border-color 150ms var(--ease-out);
}
.ev-modal .ev-toggle-row:hover { background: rgba(0,0,0,.025); }
[data-theme="dark"] .ev-modal .ev-toggle-row:hover { background: rgba(255,255,255,.03); }
.ev-modal .ev-toggle-row input[type="checkbox"] { margin-top: .15rem; flex: none; width: auto; }
.ev-modal .ev-toggle-text { display: flex; flex-direction: column; gap: .12rem; flex: 1; }
.ev-modal .ev-toggle-text strong { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; font-weight: 600; }
.ev-modal .ev-toggle-text small { font-size: .72rem; opacity: .7; line-height: 1.3; }
.ev-modal .ev-toggle-text svg { flex: none; }
/* Notify : accent rouge live (renforce que c'est une action diffusion) */
.ev-modal .ev-notify-row { background: rgba(239,68,68,.06); border-color: rgba(239,68,68,.22); }
.ev-modal .ev-notify-row .ev-toggle-text strong { color: #ef4444; }

/* ----- Footer d'actions épinglé ----- */
/* La modale dépasse souvent la hauteur du viewport (surtout en mobile) et
   devient défilante via `.overlay .panel { overflow-y:auto }`. Sans épinglage,
   le bouton « Ajouter »/« Enregistrer » tombe sous la ligne de flottaison et
   rien n'indique qu'il faut scroller → l'utilisateur le croit inaccessible.
   On colle donc la barre d'actions au bas du panneau défilant. Les marges
   négatives la font saigner jusqu'aux bords du panneau (padding 1.6rem) ;
   `.actions` démarre au bord du content-box du panneau malgré le décalage
   -1rem du form, donc -1.6rem atteint bien les bords extérieurs. */
.ev-modal .actions {
  position: sticky;
  bottom: -1.6rem;
  z-index: 1;
  /* -1.6rem droite/bas pour atteindre les bords ; à gauche on ajoute les 3px
     de la border-left du form (transparente en mode event, rouge en live). */
  margin: .8rem -1.6rem -1.6rem calc(-1.6rem - 3px);
  padding: .85rem 1.6rem;
  background: var(--card);
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--r-xl) var(--r-xl);
}

/* ----- Liseré rouge sur le form en mode live + submit rouge ----- */
.ev-modal form[data-kind="live"] {
  border-left: 3px solid #ef4444;
  padding-left: 1rem;
  margin-left: -1rem;
  transition: border-color 200ms var(--ease-out);
}
.ev-modal form[data-kind="event"] {
  border-left: 3px solid transparent;
  padding-left: 1rem;
  margin-left: -1rem;
}
.ev-modal form[data-kind="live"] .actions .btn.primary {
  background: #ef4444;
  border-color: #ef4444;
  color: white;
}
.ev-modal form[data-kind="live"] .actions .btn.primary:hover {
  background: #dc2626;
  border-color: #dc2626;
}

@media (max-width: 560px) {
  .ev-modal .ev-grid2 { grid-template-columns: 1fr; }
  .ev-modal .ev-kind-tab { padding: .5rem .35rem; }
}

/* Badge « Live » sur les cartes d'événement et indicateur sur l'agenda éditeur. */
.ev-live-tag { display: inline-flex; align-items: center; gap: .25rem; padding: .05rem .4rem; font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #0b0d12; background: var(--accent); border-radius: 999px; }
.ev-live-tag svg { color: #0b0d12; }
.ev-card-live::before { background: var(--accent); }
.agenda-upcoming-item.is-live .agenda-upcoming-name { color: var(--accent-ink); font-weight: 600; }

/* ---- Invitations à un événement (RSVP) ---- */
/* Badge « Invité par @x » sur un événement reçu (lecture seule). */
.ev-invited { color: var(--accent-ink); font-weight: 600; }
.ev-card-invited::before { background: var(--accent-line); }
/* Bloc « Invitations reçues » en tête du panneau Événements. */
.invites-recv { margin-bottom: 1rem; }
.invite-card {
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem .7rem; margin-bottom: .5rem;
  border: 1px solid var(--accent-line); border-radius: var(--r-md); background: var(--inset);
}
.invite-main { flex: 1; min-width: 0; }
.invite-title { font-weight: 600; }
.invite-sub { display: flex; align-items: center; gap: .3rem; font-size: .78rem; color: var(--muted); margin-top: .15rem; }
.invite-actions { display: flex; gap: .4rem; flex: none; }
/* Liste d'invités dans la modale d'événement (vue organisateur). */
.ev-invite-list { display: flex; flex-direction: column; gap: .35rem; }
.ev-invite-row { display: flex; align-items: center; gap: .5rem; }
.ev-invite-h { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ev-invite-status { font-size: .76rem; color: var(--muted); white-space: nowrap; }
.ev-invite-status.st-accepted { color: var(--ok, #16a34a); }
.ev-invite-status.st-declined { color: var(--danger); }
.agenda-upcoming-item.is-live .agenda-upcoming-name svg { color: var(--accent-ink); vertical-align: -2px; }

/* Compteur de lives planifiés à droite du bouton « Live » dans les actions
   de contact (sous le hero de /@handle). Petite pastille ronde aux couleurs
   d'accent — visuellement cohérente avec les autres badges du site. */
.profile-contact-actions .btn .btn-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.1rem; height: 1.1rem; padding: 0 .35rem;
  margin-left: .35rem; font-size: .7rem; font-weight: 700;
  color: #0b0d12; background: var(--accent); border-radius: 999px; line-height: 1;
}

/* Disponibilités */
.slots { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.slot { display: flex; justify-content: space-between; gap: .75rem; align-items: center; }
.slot .when { color: var(--accent-ink); font-variant-numeric: tabular-nums; font-size: .82rem; white-space: nowrap; }
.slot .what { flex: 1; font-size: .9rem; }
.slot.busy .when { color: var(--muted); }
.tag {
  display: inline-block; font-size: .72rem; padding: .1rem .45rem; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted);
}
.slot.free .tag { color: var(--success); border-color: rgba(127,220,160,.4); }
.btn.book, .btn.sm { padding: .4rem .8rem; font-size: .85rem; }

/* Colonne Agenda : liste d'événements (hauteur naturelle, le scroll est porté
   par #deck-viewport en mode onglet, ou par la carte en page publique). */
.agenda-events {
  overflow-x: hidden; -webkit-overflow-scrolling: touch;
}
.agenda-events::-webkit-scrollbar { width: 3px; }
.agenda-events::-webkit-scrollbar-thumb { background: var(--line); border-radius: 2px; }
/* Conteneur qui s'étire pour remplir l'espace restant de la carte */
.calendar-fill {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  padding-top: .2rem;
}
.calendar-fill .calendar { flex: 1; min-height: 0; display: flex; flex-direction: column; }
/* grid-template-rows: la 1re ligne (jours de semaine) reste compacte, les
   semaines suivantes (grid-auto-rows) se partagent la hauteur restante. */
.calendar-fill .cal-month-grid { flex: 1; min-height: 0; grid-template-rows: min-content; grid-auto-rows: 1fr; }
.calendar-fill .cal-cell-wrap { min-height: 0; height: auto; }
.calendar-fill .cal-time-grid { flex: 1; min-height: 0; }
.calendar-fill .cal-legend { flex: none; }
/* Le panneau Agenda doit être un conteneur flex pleine hauteur pour que
   .calendar-fill (flex:1) s'étire et remplisse la colonne au lieu de laisser
   un grand vide sous un calendrier tassé en haut.
   NB : flex:1 + min-height:0 (et NON min-height:100%). Un pourcentage ne se
   résout pas de façon fiable sur un parent en hauteur flex : au lieu d'étirer,
   il gonflait le min-content du #deck (flex-shrink:0) → la colonne débordait le
   viewport. Le maillon flex est rétabli sur .col-scroll plus bas. */
#app[data-view="private"] #agenda-dispo:not([hidden]) {
  display: flex; flex-direction: column; flex: 1; min-height: 0;
}

/* ===========================================================================
   Calendrier (3 vues Jour/Semaine/Mois) — inspiration MS Teams Fluent
   - Accent Fluent : violet-blue #5B5FC7 (mappé sur --accent-ink existant)
   - Live : rouge alerte Teams (variable --cal-live)
   - Today highlight : numéro du jour dans un cercle plein accent
   =========================================================================== */
.calendar {
  --cal-live: #c4314b;
  --cal-event: var(--accent-ink, #5B5FC7);
  --cal-line: var(--line);
  --cal-row-h: 40px;
  display: block;
}
[data-theme="dark"] .calendar { --cal-live: #e0667c; }

/* ---- Toolbar (nav · titre · view-tabs) ---- */
.cal-toolbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center; gap: .6rem;
  margin-bottom: .8rem;
}
.cal-nav-cluster { display: flex; align-items: center; gap: .25rem; }
.cal-nav {
  height: 32px; min-width: 32px; padding: 0 .55rem;
  border: 1px solid var(--cal-line); background: var(--bg); color: var(--fg);
  border-radius: var(--r-sm); cursor: pointer;
  font-size: 1.1rem; line-height: 1; font-weight: 500;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.cal-nav.cal-today { font-size: .82rem; padding: 0 .75rem; }
.cal-nav:hover:not(:disabled) { background: rgba(91,95,199,.08); border-color: var(--accent-ink); }
.cal-nav:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 1px; }
.cal-nav:disabled { opacity: .35; cursor: default; }
.cal-title {
  text-transform: capitalize; font-size: 1rem; color: var(--fg);
  font-weight: 600; text-align: center;
}
.cal-view-tabs {
  display: inline-flex; padding: 2px;
  border: 1px solid var(--cal-line); border-radius: var(--r-sm);
  background: var(--bg);
}
.cal-view-tab {
  border: 0; background: transparent; color: var(--muted);
  padding: .35rem .75rem; font: inherit; font-size: .82rem; font-weight: 500;
  border-radius: calc(var(--r-sm) - 2px); cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.cal-view-tab:hover { color: var(--fg); background: rgba(91,95,199,.08); }
.cal-view-tab.active { background: var(--accent-ink); color: #fff; }

/* ---- Vue Mois ---- */
.cal-month-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-dow {
  text-align: center; font-size: var(--t-2xs); color: var(--muted);
  padding-bottom: .25rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
}
.cal-cell-wrap {
  position: relative;
  display: flex; flex-direction: column; gap: 2px;
  min-height: 84px; padding: 4px;
  border: 1px solid var(--cal-line); border-radius: var(--r-xs);
  background: var(--bg);
  transition: border-color var(--dur-fast) var(--ease-out);
}
.cal-cell-wrap:hover { border-color: rgba(91,95,199,.4); }
/* Bouton « + » : ajouter un événement ce jour-là (vue Mois, éditeur). */
.cal-cell-add {
  position: absolute; top: 4px; right: 4px;
  width: 20px; height: 20px; padding: 0;
  border: 0; border-radius: 999px;
  background: var(--accent-ink); color: #fff;
  font: 700 1rem/1 inherit;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; opacity: 0; z-index: 3;
  transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.cal-cell-wrap:hover .cal-cell-add,
.cal-cell-add:focus-visible { opacity: 1; }
.cal-cell-add:hover { transform: scale(1.12); }
.cal-cell {
  align-self: flex-start; border: 0; background: transparent;
  width: 26px; height: 26px; padding: 0;
  border-radius: 999px; color: var(--fg); font: inherit; font-size: .82rem; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.cal-cell-num { line-height: 1; }
.cal-cell.empty { border: none; background: none; cursor: default; }
.cal-cell.is-today {
  background: var(--accent-ink); color: #fff; font-weight: 700;
}
.cal-cell:not(:disabled):not(.is-today):hover { background: rgba(91,95,199,.14); }
.cal-cell:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.cal-cell:disabled { cursor: default; opacity: .5; }
.cal-cell-wrap:has(.cal-cell.past) { opacity: .55; }
.cal-cell-wrap:has(.cal-cell.busy) { background: rgba(139,147,163,.06); }
.cal-cell-wrap:has(.cal-cell.free):not(:has(.cal-cell.is-today)) .cal-cell {
  background: rgba(127,220,160,.18); color: var(--success);
}
.cal-cell-wrap:has(.cal-cell.busy) .cal-cell { color: var(--muted); }

.cal-cell-chips {
  display: flex; flex-direction: column; gap: 2px; margin-top: 2px;
  min-height: 0; overflow: hidden;
}
.cal-chip {
  display: flex; align-items: center; gap: 4px;
  width: 100%; padding: 2px 6px;
  border: 0; border-left: 3px solid var(--cal-event);
  background: rgba(91,95,199,.12); color: var(--fg);
  border-radius: 3px; font: inherit; font-size: .7rem; font-weight: 500;
  cursor: pointer; text-align: left;
  transition: background var(--dur-fast) var(--ease-out);
}
.cal-chip:hover { background: rgba(91,95,199,.22); }
.cal-chip.is-live { border-left-color: var(--cal-live); background: rgba(196,49,75,.14); }
.cal-chip.is-live:hover { background: rgba(196,49,75,.24); }
.cal-chip-time { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.cal-chip-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-chip-more {
  font-size: .68rem; color: var(--muted); padding: 0 2px;
}

/* Heatmap (vue publique sans chips) */
.cal-cell-wrap:has(.cal-cell.heat-mid) .cal-cell { background: rgba(245,166,66,.22); color: #f5a642; }
.cal-cell-wrap:has(.cal-cell.heat-high) .cal-cell { background: rgba(231,76,76,.26); color: #ff6b6b; }

/* ---- Vues Jour / Semaine — grille horaire ---- */
.cal-time-grid {
  display: flex; min-height: 0; overflow: auto;
  border: 1px solid var(--cal-line); border-radius: var(--r-sm);
  background: var(--bg);
}
.cal-time-rail {
  flex: 0 0 56px; border-right: 1px solid var(--cal-line);
  display: flex; flex-direction: column;
}
.cal-time-row {
  height: var(--cal-row-h);
  flex: 0 0 var(--cal-row-h);
  box-sizing: border-box;
  border-bottom: 1px solid var(--cal-line);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 4px;
}
.cal-time-lbl {
  font-size: .68rem; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 500;
}
.cal-time-cols { flex: 1; display: flex; min-width: 0; position: relative; }
.cal-day-col {
  flex: 1; min-width: 0; border-right: 1px solid var(--cal-line);
  display: flex; flex-direction: column;
}
.cal-day-col:last-child { border-right: 0; }
.cal-day-col.past .cal-day-body { opacity: .55; }
.cal-day-header {
  height: 64px; flex: 0 0 64px; box-sizing: border-box; padding: 4px 8px;
  border-bottom: 1px solid var(--cal-line); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  background: var(--bg);
}
.cal-day-header.is-spacer { background: transparent; height: 64px; }

/* Pastille d'état du jour (Libre / Occupé) sous le numéro. Cliquable en éditeur
   pour basculer la dispo, et en visiteur pour ouvrir la modale RDV si libre. */
.cal-day-dot {
  border: 1px solid transparent; background: transparent; padding: 1px 8px;
  border-radius: 999px; font: inherit; font-size: .62rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; cursor: pointer;
  line-height: 1.4;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.cal-day-dot:disabled { cursor: default; opacity: .5; }
.cal-day-header.is-free .cal-day-dot {
  background: rgba(127,220,160,.18); color: var(--success);
  border-color: rgba(127,220,160,.35);
}
.cal-day-header.is-free .cal-day-dot:not(:disabled):hover {
  background: rgba(127,220,160,.32); border-color: var(--success);
}
.cal-day-header.is-busy .cal-day-dot {
  background: rgba(139,147,163,.14); color: var(--muted);
  border-color: rgba(139,147,163,.3);
}
.cal-day-header.is-busy .cal-day-dot:not(:disabled):hover {
  background: rgba(139,147,163,.26); border-color: var(--muted);
}
.cal-day-header.is-past .cal-day-dot { opacity: .35; }
.cal-day-dow {
  font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600;
}
.cal-day-num {
  font-size: 1.25rem; font-weight: 600; color: var(--fg);
  line-height: 1;
}
.cal-day-header.is-today .cal-day-num {
  width: 30px; height: 30px; border-radius: 999px;
  background: var(--accent-ink); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
}
.cal-day-header.is-today .cal-day-dow { color: var(--accent-ink); font-weight: 700; }

.cal-day-body { position: relative; display: flex; flex-direction: column; }
/* Tint léger du body selon la dispo du jour — signal visuel pour le visiteur. */
.cal-day-body.is-free { background: rgba(127,220,160,.05); }
.cal-day-body.is-busy { background: rgba(139,147,163,.06); }
.cal-day-body.is-past { background: rgba(139,147,163,.04); }
.cal-time-slot {
  position: relative;
  height: var(--cal-row-h);
  flex: 0 0 var(--cal-row-h);
  box-sizing: border-box;
  border: 0; border-bottom: 1px solid var(--cal-line);
  background: transparent; padding: 0; cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
}
.cal-time-slot:hover:not(:disabled) { background: rgba(91,95,199,.06); }
.cal-time-slot:disabled { cursor: default; }
/* « + » au survol d'une case horaire vide (vues Jour/Semaine, éditeur) :
   pastille accent centrée, même langage visuel que le bouton « + » de la
   vue Mois (.cal-cell-add). pointer-events:none → le clic atteint la case. */
.cal-time-slot[data-slot-new]:hover { background: rgba(91,95,199,.12); }
.cal-time-slot[data-slot-new]:hover::after {
  content: "+";
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 20px; height: 20px; border-radius: 999px;
  background: var(--accent-ink); color: #fff;
  font-size: .95rem; font-weight: 700; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.25); pointer-events: none;
}

.cal-time-block {
  position: absolute; left: 4px; right: 4px;
  min-height: 18px;
  border: 0; padding: 3px 6px 6px;
  background: rgba(91,95,199,.18); color: var(--fg);
  border-left: 3px solid var(--cal-event); border-radius: 4px;
  font: inherit; text-align: left;
  display: flex; flex-direction: column; gap: 1px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
  cursor: grab;
  touch-action: none; /* drag pointer-events sans bloquer le scroll mobile */
  user-select: none;
  transition: background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-spring), box-shadow var(--dur-fast) var(--ease-out);
}
.cal-time-block:hover { background: rgba(91,95,199,.28); transform: translateY(-1px); }
.cal-time-block.is-live { background: rgba(196,49,75,.18); border-left-color: var(--cal-live); }
.cal-time-block.is-live:hover { background: rgba(196,49,75,.28); }

/* Contenu d'un bloc — empilage par densité (overflow:hidden clippe le bas si
   le bloc est trop court : on garde le titre + heure de début toujours en tête). */
.cal-block-row {
  display: flex; align-items: baseline; gap: 6px;
  min-width: 0; white-space: nowrap;
}
.cal-block-head { line-height: 1.15; }
.cal-block-time {
  font-size: .68rem; font-weight: 700; color: var(--muted);
  font-variant-numeric: tabular-nums; flex: none;
}
.cal-time-block.is-live .cal-block-time { color: var(--cal-live); }
.cal-block-title {
  font-size: .78rem; font-weight: 600; color: var(--fg);
  overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0;
}
.cal-block-meta {
  font-size: .65rem; color: var(--muted); margin-top: 1px;
  overflow: hidden;
}
.cal-block-range { font-variant-numeric: tabular-nums; flex: none; }
.cal-block-loc { overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.cal-block-notes {
  font-size: .65rem; opacity: .7; margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Poignée de redimensionnement : 8px en bas, cursor ns-resize.
   On utilise un ::after non-interactif pour le visuel ; la détection du clic
   en zone basse se fait côté JS via bounding rect (plus fiable cross-browser). */
.cal-time-block::after {
  content: ""; position: absolute; left: 6px; right: 6px; bottom: 2px; height: 3px;
  border-radius: 2px; background: currentColor; opacity: 0; pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease-out);
}
.cal-time-block:hover::after { opacity: .35; }
.cal-time-block.is-dragging {
  cursor: grabbing; opacity: .85; z-index: 4;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
  transform: none;
}
/* Pendant le drag, on désactive les hover transitions pour éviter le saut. */
.cal-time-block.is-dragging:hover { transform: none; }
.cal-time-block-time {
  font-size: .68rem; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 600;
}
.cal-time-block.is-live .cal-time-block-time { color: var(--cal-live); }
.cal-time-block-title {
  font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Ligne « maintenant » : traverse toute la grille (toutes les colonnes), pas
   seulement la colonne d'aujourd'hui. L'étiquette flottante indique l'heure. */
.cal-now-line {
  position: absolute; left: 0; right: 0; height: 2px;
  background: var(--cal-live); pointer-events: none; z-index: 3;
}
.cal-now-line::before {
  content: ""; position: absolute; left: -6px; top: -4px;
  width: 10px; height: 10px; border-radius: 999px; background: var(--cal-live);
  box-shadow: 0 0 0 2px var(--bg);
}
.cal-now-label {
  position: absolute; right: 6px; top: -9px;
  background: var(--cal-live); color: #fff;
  font-size: .62rem; font-weight: 700; font-variant-numeric: tabular-nums;
  padding: 1px 5px; border-radius: 4px;
  letter-spacing: .02em;
}

/* ---- Légende (uniquement vue Mois) ---- */
.cal-legend {
  display: flex; flex-wrap: wrap; gap: .9rem; font-size: .78rem; color: var(--muted);
  margin-top: .55rem; align-items: center;
}
.cal-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .3rem; vertical-align: middle; }
.cal-legend .dot-free { background: rgba(127,220,160,.6); }
.cal-legend .dot-busy { background: rgba(139,147,163,.4); }
.cal-legend .dot-heat-0 { background: rgba(127,220,160,.6); }
.cal-legend .dot-heat-mid { background: rgba(245,166,66,.7); }
.cal-legend .dot-heat-high { background: rgba(231,76,76,.7); }

/* Mobile : sur petite largeur, basculer Semaine en colonnes plus serrées */
@media (max-width: 720px) {
  .cal-toolbar { grid-template-columns: 1fr; gap: .4rem; }
  .cal-title { text-align: left; }
  .cal-cell-wrap { min-height: 64px; }
  .cal-chip-title { display: none; }
  .cal-time-rail { flex-basis: 42px; }
}

/* ---- Onglets colonne Compte ---- */
.acct-tabs, .agenda-tabs, .id-tabs, .rel-tabs, .opt-tabs, .act-tabs, .acc-seg-tabs {
  display: flex; gap: 2px; flex: none;
  background: var(--inset); border-radius: var(--r-md); padding: 3px;
  margin-bottom: .75rem;
}
.acct-tab, .agenda-tab, .id-tab, .rel-tab, .opt-tab, .act-tab, .acc-seg-tab {
  flex: 1; min-height: 36px; padding: .38rem .5rem; border: none; border-radius: var(--r-sm);
  background: none; color: var(--muted); font-size: .8rem; font-weight: 500;
  cursor: pointer; transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
  white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: .3rem;
}
.acct-tab:hover, .agenda-tab:hover, .id-tab:hover, .rel-tab:hover, .opt-tab:hover, .act-tab:hover, .acc-seg-tab:hover { color: var(--fg); }
.acct-tab.active, .agenda-tab.active, .id-tab.active, .rel-tab.active, .opt-tab.active, .act-tab.active, .acc-seg-tab.active { background: var(--card); color: var(--fg); box-shadow: var(--elev-1), var(--highlight); }
.acct-tab:focus-visible, .agenda-tab:focus-visible, .id-tab:focus-visible, .rel-tab:focus-visible, .opt-tab:focus-visible, .act-tab:focus-visible, .acc-seg-tab:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 1px; }
.acct-tab-danger, .opt-tab-danger { color: var(--danger); opacity: .75; }
.acct-tab-danger.active, .opt-tab-danger.active { color: var(--danger); opacity: 1; }
.acct-panel[hidden], .agenda-panel[hidden], .id-panel[hidden], .rel-panel[hidden] { display: none; }
/* Compteur dans un onglet (nb d'amis / taille du réseau). */
.tab-count {
  min-width: 1.05rem; height: 1.05rem; padding: 0 .3rem;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-ink);
  border-radius: 999px; font-size: .68rem; font-weight: 700;
}
.rel-tab.active .tab-count { background: var(--accent-strong); color: #fff; }

/* Onglet « Amis » : relations directes mises en avant (cartes). */
.rels-friends { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .25rem; }
.rels-friends .rel {
  background: var(--inset); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: .55rem .65rem; transition: border-color .15s, background .15s;
}
.rels-friends .rel:hover { border-color: var(--accent-line); background: color-mix(in srgb, var(--accent) 7%, var(--inset)); }
.rel-empty { color: var(--muted); font-size: .88rem; line-height: 1.5; padding: .4rem .2rem; list-style: none; }

/* Réseaux sociaux — édition (onglet Réseaux de la carte Identité) */
.social-edit { display: grid; grid-template-columns: 24px 1fr auto; gap: .5rem; align-items: center; margin-bottom: .5rem; }
.social-edit .social-ic { display: inline-flex; align-items: center; justify-content: center; }
.social-edit .social-input { width: 100%; }
.social-open { display: inline-flex; align-items: center; justify-content: center; color: var(--muted); padding: .2rem; }
.social-open:hover { color: var(--accent-ink); }
.social-open[hidden] { display: none; }

/* Réseaux sociaux — pastilles cliquables (carte publique) */
.social-links { display: flex; flex-wrap: wrap; gap: .55rem; justify-content: center; margin: .25rem 0 1rem; }
.social-chip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  color: #fff; background: var(--sc, var(--accent));
  transition: transform .12s, box-shadow .12s; box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.social-chip:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,.28); }

/* Lien d'un événement */
.event .event-link { color: var(--accent-ink); display: inline-flex; vertical-align: -2px; margin-left: .15rem; }
.event .event-link:hover { color: var(--accent); }

/* En-tête de l'éditeur */
/* Header commun toutes pages */
.site-header {
  max-width: 960px; padding: .9rem 1.25rem 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  flex: none; width: 100%;
}
.site-header-center { display: flex; justify-content: center; flex: 1; min-width: 0; }

/* ── En-tête repliable (mobile, bouton chevron) ──────────────────────────────
   Actif quand siteHeader() reçoit `handle` (vues app connectée + profil public).
   Sur mobile, le chevron masque logo + boutons et affiche le @handle centré.
   État persisté (localStorage « mindlog.hdr »), relu à chaque rendu. Ces deux
   vues ont un en-tête sur fond sombre (dégradé / couverture) → texte blanc. */
.header-handle { display: none; }
.header-collapse-btn { display: none; }
@media (max-width: 600px) {
  .site-header.has-collapse { position: relative; }
  .site-header.has-collapse .header-collapse-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; flex: 0 0 auto; position: relative; z-index: 2;
    border-radius: var(--r-md); cursor: pointer; color: #fff;
    background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .28);
  }
  .site-header.has-collapse .header-collapse-btn svg { transition: transform .2s ease; }
  .site-header.is-collapsed { justify-content: flex-end; }
  .site-header.is-collapsed .header-collapse-btn svg { transform: rotate(180deg); }
  .site-header.is-collapsed .brand,
  .site-header.is-collapsed .site-header-left,
  .site-header.is-collapsed .site-header-center,
  .site-header.is-collapsed .editor-head-right { display: none !important; }
  .site-header.is-collapsed .header-handle {
    display: block; position: absolute; left: 12px; right: 12px;
    text-align: center; margin: 0; pointer-events: none;
    font-weight: 600; font-size: 1.05rem; color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .45);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
}

/* Header « arc-en-ciel » caméléon de l'app connectée (identité mindlog.talk).
   Dégradé animé repris de la palette --h1..3 (violet · vert Milo · indigo · rose).
   Le texte de marque passe en blanc ombré pour rester lisible ; les boutons et
   l'avatar gardent leur fond propre. Animation coupée en reduced-motion. */
#app[data-view="private"] .topbar.site-header {
  /* !important : bat la « topbar vitrée » partagée (background color-mix bg 88%,
     définie plus bas dans le fichier). */
  background: linear-gradient(90deg, #8b5cf6, #43b58f, #6366f1, #ec4899, #8b5cf6) !important;
  background-size: 300% 100% !important;
  animation: header-chameleon 18s linear infinite;
  border-bottom: 1px solid rgba(255, 255, 255, .14) !important;
  box-shadow: 0 2px 14px rgba(0, 0, 0, .28);
}
@keyframes header-chameleon { to { background-position: -300% 0; } }
#app[data-view="private"] .topbar.site-header .brand,
#app[data-view="private"] .topbar.site-header .brand-text {
  color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .45);
}
#app[data-view="private"] .topbar.site-header .brand-text b { font-weight: 800; }
@media (prefers-reduced-motion: reduce) {
  #app[data-view="private"] .topbar.site-header { animation: none; }
}
/* Actions accolées à la marque (ex. « Ouvrir ma page » dans l'éditeur). */
.site-header-left { display: flex; align-items: center; flex: none; }
/* Sur petit écran, on garde l'icône seule pour ne pas serrer la barre. */
/* « Ouvrir ma page » : simple lien discret dans le header (plus un bouton). */
.topbar-publink {
  display: inline-flex; align-items: center; gap: .35rem;
  color: rgba(255, 255, 255, .82); text-decoration: none;
  font-size: .85rem; font-weight: 500; padding: .2rem .1rem;
  transition: color var(--dur-fast, .15s) var(--ease-out, ease);
}
.topbar-publink:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.topbar-publink svg { opacity: .9; }
@media (max-width: 600px) { .topbar-publink-label { display: none; } }

/* ---- Header moderne (landing) : barre collante translucide + groupe d'outils ----
   Sticky + blur léger, fine ligne de séparation. La barre d'ancres (GEEK) vient
   se coller juste en dessous (top calé sur la hauteur du header) → pas de conflit. */
#app[data-view="landing"] .topbar.site-header {
  position: sticky; top: 0; z-index: 40;
  max-width: none; padding-inline: clamp(1rem, 4vw, 2rem);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--hairline);
}
#app[data-view="landing"] .topbar.site-header .editor-head-right {
  gap: .5rem; flex-wrap: wrap; justify-content: flex-end;
}
/* Groupe « langue + thème » : compact, légèrement détaché des CTAs. */
.hd-tools { display: inline-flex; align-items: center; gap: .4rem; }
/* La barre d'ancres GEEK se cale sous le header collant (hauteur réelle ≈ 75px). */
#app[data-view="landing"] .lp-anchors { top: 75px; }
/* Mobile : le header peut passer sur 2 lignes → on le repasse en statique pour
   éviter tout chevauchement avec la barre d'ancres. */
@media (max-width: 640px) {
  #app[data-view="landing"] .topbar.site-header { position: static; backdrop-filter: none; -webkit-backdrop-filter: none; }
  #app[data-view="landing"] .lp-anchors { top: 0; }
}
/* Liens du header (Source code · Tarifs) séparés par des points. */
.header-links { display: flex; align-items: center; gap: .9rem; font-size: .88rem; }
.header-links a { color: var(--muted); text-decoration: none; position: relative; transition: color .15s; }
.header-links a { padding: .15rem .1rem; }
.header-links a:hover { color: var(--accent-ink); }
.header-links a + a::before { content: "·"; position: absolute; left: -.5rem; color: var(--muted); opacity: .6; }
@media (max-width: 640px) { .header-links { display: none; } }

/* « Connect to an AI » : pilule accent discrète (CTA léger du header). */
#nav-connect {
  border-radius: 999px; background: var(--accent-soft); border-color: var(--accent-line);
  color: var(--accent-ink); font-weight: 600;
}
#nav-connect svg { opacity: .9; }
#nav-connect:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); border-color: var(--accent-ink); transform: translateY(-1px); }
@media (prefers-reduced-motion: reduce) { #nav-connect:hover { transform: none; } }
.editor-header { max-width: 960px; padding: .9rem 1.25rem 1rem; }
.editor-head-right { display: flex; align-items: center; gap: .6rem; flex: none; }
.edit-tag { font-size: .82rem; color: var(--muted); }

/* Chip profil cliquable */
.profile-chip {
  display: flex; align-items: center; gap: .55rem;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px;
  padding: .22rem .85rem .22rem .22rem; min-width: 0; max-width: 200px;
}
.profile-chip-av {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  object-fit: cover; background: var(--chip); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.profile-chip-svg svg { display: block; width: 30px; height: 30px; border-radius: 50%; }
.profile-chip-info { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.profile-chip-handle { font-size: .82rem; font-weight: 600; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-chip-name { font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Chip compte « icône seule » : juste l'avatar (le @handle/nom passe en header du
   menu déroulant). Bouton rond compact. */
.profile-chip.profile-chip--icon { padding: .22rem; gap: 0; max-width: none; position: relative; }
/* Couronne Premium sur l'avatar (indicateur compact, remplace le bandeau). */
.profile-chip-crown {
  position: absolute; top: -8px; left: 50%; transform: translateX(-50%) rotate(-4deg);
  width: 18px; height: 16px; pointer-events: none;
  color: #ffcf3f;
  filter: drop-shadow(0 1px 1.5px rgba(0,0,0,.55));
}
.profile-chip-crown svg { display: block; width: 100%; height: 100%; }
:root[data-theme="light"] .profile-chip-crown { color: #eab308; }
/* En-tête du menu profil : nom du compte. */
.pmenu-header { display: flex; flex-direction: column; line-height: 1.25; padding: .35rem .6rem .3rem; }
.pmenu-handle { font-weight: 700; font-size: .9rem; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pmenu-name { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.profile-chip { text-decoration: none; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
a.profile-chip:hover { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent); }
button.profile-chip { background: none; border-color: transparent; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
button.profile-chip:hover, button.profile-chip[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent); }
/* profile dropdown menu */
.profile-menu-wrap { position: relative; }
.profile-menu {
  display: none;
  position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: 0 8px 24px rgba(0,0,0,.35);
  z-index: 350; min-width: 180px; padding: .3rem;
  flex-direction: column;
}
.profile-menu-wrap.open .profile-menu { display: flex; }
.pmenu-item {
  display: flex; align-items: center; gap: .5rem;
  padding: .42rem .65rem; border-radius: var(--r-sm);
  font-size: .85rem; color: var(--fg); cursor: pointer;
  background: none; border: none; text-align: left; width: 100%;
  text-decoration: none; transition: background .12s; white-space: nowrap;
}
.pmenu-item:hover, .pmenu-item:focus { background: var(--chip); outline: none; }
.pmenu-item svg { flex: none; opacity: .65; }
.pmenu-sep { height: 1px; background: var(--line); margin: .25rem 0; }
.pmenu-danger { color: var(--danger); }
.pmenu-danger svg { opacity: 1; }
/* badge de notifs sur le profile chip */
.chip-notif-dot {
  position: absolute; top: 2px; right: 2px;
  min-width: 16px; height: 16px; border-radius: 999px;
  background: var(--danger); color: #fff;
  font-size: .65rem; font-weight: 700; line-height: 16px;
  text-align: center; padding: 0 3px;
  pointer-events: none;
}

@media (max-width: 580px) {
  .brand-text { display: none; }
  .profile-chip-name { display: none; }
  .site-header-center .profile-chip { padding-right: .5rem; }
  .editor-head-right .btn.sm:not(#notif-bell):not(#qr-btn):not(#pub-cover-back):not(#pub-create-cta) { display: none; }
  /* Sur mobile les boutons header « Retour » et « Créer ma page » se réduisent
     à leur icône (gain de place) : label masqué, cercle compact 36×36. */
  #pub-cover-back > span,
  #pub-create-cta > span { display: none; }
  #pub-cover-back,
  #pub-create-cta {
    width: 36px; height: 36px;
    padding: 0 !important;
    border-radius: 50% !important;
    justify-content: center;
  }
  /* /status & invite gardent le bouton thème flottant (pas de toggle intégré)
     → on réserve la place du coin haut-droit. La landing l'a dans la barre. */
  #app[data-view="status"] .topbar.site-header,
  #app[data-view="invite"] .topbar.site-header { padding-right: 3.5rem; }
}

/* Demandes de RDV */
.requests { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.request { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--r-md); padding: .75rem .85rem; }
.req-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.req-slot, .req-meta { font-size: .82rem; color: var(--muted); margin-top: .25rem; }
.req-meta a { color: var(--accent-ink); text-decoration: none; }
.req-msg { font-size: .9rem; margin-top: .4rem; white-space: pre-wrap; }
.req-actions { display: flex; gap: .4rem; margin-top: .6rem; align-items: center; }
.req-status { font-size: .72rem; padding: .1rem .5rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.req-status.ok { color: var(--success); border-color: rgba(127,220,160,.4); }
.req-status.no { color: var(--danger); border-color: rgba(240,113,122,.4); }
.req-status.pending { color: var(--accent-ink); border-color: var(--accent-line); }
.req-filters { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .6rem; }
.req-chip {
  font-size: .8rem; padding: .25rem .6rem; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer;
}
.req-chip:hover { border-color: var(--accent-line); }
.req-chip.active { color: var(--accent-ink); border-color: var(--accent-line); background: var(--accent-soft, rgba(255,255,255,.04)); }
.req-chip .chip-n { font-size: .72rem; opacity: .7; }
.badge {
  display: inline-block; background: var(--accent); color: #0b0d12;
  font-size: .7rem; font-weight: 700; padding: .05rem .45rem; border-radius: 999px; vertical-align: middle;
}

/* ---- édition ---- */
input, textarea { font: inherit; color: var(--fg); background: var(--inset); border: 1px solid var(--line); border-radius: var(--r-md); padding: .55rem .6rem; width: 100%; min-width: 0; transition: border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out); }
input[type="file"] { padding: 0; border: none; background: none; color: var(--muted); }
input[type="file"]::file-selector-button {
  font: inherit; cursor: pointer; margin-right: .6rem;
  background: var(--chip); color: var(--fg); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: .5rem .9rem; transition: border-color .15s;
}
input[type="file"]::file-selector-button:hover { border-color: var(--accent-ink); }
input:focus, textarea:focus { outline: none; border-color: var(--accent-ink); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; min-height: 2.2rem; }
label.row { display: flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .82rem; width: auto; }
label.row input { width: auto; }

/* 1 attribut = 2 lignes : le libellé occupe toute la 1re ligne, puis
   champ + visibilité (+ suppression) sur la 2e. Le libellé s'étend sur
   toutes les colonnes (grid-column 1/-1) ; les éléments suivants se placent
   automatiquement sur la ligne du dessous. */
.edit-field { display: grid; grid-template-columns: 1fr auto auto; gap: .3rem .4rem; align-items: center; margin-bottom: .65rem; }
.edit-field .lbl { grid-column: 1 / -1; }
/* Sur écran large, les attributs et les réseaux s'affichent sur 2 colonnes
   (chaque champ reste une sous-grille interne libellé/valeur/visibilité). */
@media (min-width: 700px) {
  #fields-edit { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1.4rem; row-gap: .65rem; align-items: start; }
  #fields-edit .edit-field { margin-bottom: 0; }
  #socials-edit { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1.4rem; row-gap: .5rem; align-items: start; }
  #socials-edit .social-edit { margin-bottom: 0; }
}
.btn-field-del { background: none; border: none; color: var(--muted); cursor: pointer; padding: .2rem .3rem; border-radius: var(--r-xs); line-height: 1; font-size: .9rem; }
.btn-field-del:hover { color: var(--danger); background: rgba(240,113,122,.1); }
.fvis { font-size: .72rem; padding: .3rem .25rem; max-width: 86px; }
.fvis.vis-public { color: var(--success); border-color: rgba(127,220,160,.45); }
.fvis.vis-contact { color: var(--accent-ink); border-color: var(--accent-line); }
.fvis.vis-private { color: var(--muted); }
.rel-via { color: var(--muted); font-size: .72rem; opacity: .85; }
.rel-date { color: var(--muted); font-size: .68rem; opacity: .75; }
.rel-mutual { color: var(--success); font-weight: 700; }
/* search input standalone (replaces old .rel-filters) */
.rel-search-input { width: 100%; margin-bottom: .4rem; }

/* ---- Bascule Liste / Graphe + vue graphe du réseau ---- */
.rel-view-tabs {
  display: flex; gap: .25rem; margin: .15rem 0 .6rem;
  padding: 3px; border-radius: var(--r-sm);
  background: var(--inset, rgba(127,127,127,.08));
}
.rel-view-tab {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  padding: .35rem .5rem; border: 0; border-radius: calc(var(--r-sm) - 2px);
  background: transparent; color: var(--muted); cursor: pointer;
  font: inherit; font-size: .78rem; font-weight: 600;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.rel-view-tab:hover { color: var(--fg); }
.rel-view-tab.active { background: var(--card); color: var(--accent-ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }

/* Le panneau Graphe remplit toute la hauteur disponible de la colonne (flex),
   et le wrap du graphe occupe tout le panneau. :not([hidden]) pour ne s'appliquer
   qu'à l'onglet actif (sinon l'id l'emporterait sur .rel-panel[hidden]). */
#rel-graph-pane:not([hidden]) { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.rel-graph-wrap {
  position: relative; width: 100%; flex: 1; min-height: 300px;
  border: 1px solid var(--cal-line, var(--line)); border-radius: var(--r-sm);
  background:
    radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 60%),
    var(--bg);
  overflow: hidden;
}
.rel-graph-svg { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; user-select: none; }
.rel-graph-svg:active { cursor: grabbing; }
.rg-loading {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: .85rem; pointer-events: none;
}
.rg-edge { stroke: var(--line); stroke-width: 1.3; opacity: .7; }
.rg-node { cursor: pointer; }
.rg-node-c { stroke: var(--bg); stroke-width: 2; transition: stroke .12s var(--ease-out); }
.rg-node:hover .rg-node-c { stroke: var(--accent-ink); }
.rg-me .rg-node-c { stroke: color-mix(in srgb, var(--accent) 50%, var(--bg)); }
.rg-init { fill: #fff; font-weight: 700; font-family: inherit; pointer-events: none; }
.rg-label { fill: var(--fg); font-size: 15px; font-weight: 600; font-family: inherit; pointer-events: none; }
/* Contrôles de zoom (groupe vertical, en superposition haut-droite). */
.rg-zoomctl {
  position: absolute; top: 8px; right: 8px; display: flex; flex-direction: column; gap: .3rem;
}
.rg-zoom, .rg-reset {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--card) 85%, transparent); backdrop-filter: blur(4px);
  color: var(--muted); cursor: pointer; font-size: 1.05rem; line-height: 1;
}
.rg-zoom:hover, .rg-reset:hover { color: var(--accent-ink); border-color: var(--accent-line); }
/* Filtres (type + degré), en superposition bas-gauche. */
.rg-filters {
  position: absolute; left: 8px; bottom: 8px; display: flex; flex-wrap: wrap; gap: .3rem; align-items: center;
  max-width: calc(100% - 16px);
}
.rg-fchip {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .2rem .5rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: color-mix(in srgb, var(--card) 85%, transparent);
  backdrop-filter: blur(4px); color: var(--muted); font-size: .7rem; font-weight: 600;
  transition: opacity .12s, border-color .12s, color .12s;
}
.rg-fchip i { display: inline-block; width: 9px; height: 9px; border-radius: 999px; }
.rg-fchip[aria-pressed="false"] { opacity: .42; }
.rg-fchip.active { color: var(--fg); border-color: var(--accent-line); }
.rg-fsep { width: 1px; height: 16px; background: var(--line); margin: 0 .15rem; }
.rg-empty { padding: 2.5rem 1rem; text-align: center; color: var(--muted); font-size: .85rem; line-height: 1.6; }

/* filter chips row */
.rel-chips-row { display: flex; gap: .3rem; flex-wrap: wrap; margin-bottom: .3rem; }
.rel-chip { padding: .2rem .55rem; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: .72rem; cursor: pointer; transition: background .15s, color .15s, border-color .15s; white-space: nowrap; line-height: 1.6; }
.rel-chip:hover { color: var(--fg); border-color: var(--accent-line); }
.rel-chip.active { background: var(--accent-soft, rgba(255,255,255,.06)); color: var(--accent-ink); border-color: var(--accent-line); }
.rel-chip .chip-n { opacity: .65; font-size: .68rem; }
/* pending requests banner */
.rel-pending-banner { display: flex; align-items: center; gap: .45rem; width: 100%; background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line)); border-radius: var(--r-md); padding: .4rem .7rem; cursor: pointer; font-size: .8rem; color: var(--fg); margin: .35rem 0 .1rem; text-align: left; }
.rel-pending-banner:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.rel-pending-chevron { margin-left: auto; opacity: .55; font-size: .9rem; transition: transform .15s var(--ease-out); display: inline-block; }
.rel-pending-banner[aria-expanded="true"] .rel-pending-chevron { transform: rotate(90deg); }
.rel-pending-panel { padding: .15rem 0 .4rem; }
/* degree separator in unified list */
.rel-deg-sep { list-style: none; display: flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: .6rem 0 .2rem; }
.rel-deg-sep::after { content: ''; flex: 1; height: 1px; background: var(--line); }
/* hover highlight for all direct (D1) relations */
#rel-all-list .rel[data-degree="1"]:hover { border-color: var(--accent-line); background: color-mix(in srgb, var(--accent) 7%, var(--inset)); }
/* empty / no-results messages */
.rel-empty, .rel-no-results { list-style: none; color: var(--muted); font-size: .83rem; padding: .5rem 0; font-style: italic; }
/* handle autocomplete dropdown */
.rel-handle-results { position: absolute; top: calc(100% + 3px); left: -1px; right: -1px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: 0 6px 20px rgba(0,0,0,.3); z-index: 200; max-height: 180px; overflow-y: auto; }
.rel-handle-result { display: flex; align-items: center; gap: .55rem; width: 100%; padding: .45rem .65rem; background: none; border: none; cursor: pointer; text-align: left; }
.rel-handle-result:hover, .rel-handle-result:focus { background: var(--chip); outline: none; }
.rel-handle-result .rhr-av { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: var(--chip); flex: none; overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .7rem; font-weight: 600; }
.rel-handle-result .rhr-info { display: flex; flex-direction: column; min-width: 0; }
.rel-handle-result .nm { font-size: .82rem; font-weight: 500; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rel-handle-result .hd { font-size: .72rem; color: var(--muted); }
[data-recip] { padding: .25rem .55rem; font-size: .76rem; white-space: nowrap; }
.edit-field .lbl { color: var(--muted); font-size: .8rem; }

button.icon { padding: .3rem .55rem; color: var(--muted); background: var(--chip); border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer; }
button.icon:hover { color: var(--danger); border-color: var(--danger); }

.add-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: .4rem; margin-top: .5rem; }
.add-row .btn { padding: .55rem .8rem; }
.event-form { display: grid; gap: .4rem; margin-top: .5rem; }
.event-form .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }

footer { color: var(--muted); font-size: .8rem; text-align: center; max-width: var(--maxw); width: 100%; padding: 0 1.25rem 1rem; background: transparent; border: none; }
footer p { margin: .5rem 0; }
/* Dernière colonne « À propos » du deck landing (remplace l'ancien footer). */
.about-col { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; }
.about-links { display: flex; flex-direction: column; gap: .55rem; margin-top: 1rem; text-align: center; }
.about-links a { color: var(--muted); text-decoration: none; }
.about-links a:hover { color: var(--fg); }
footer code { background: var(--card); padding: .15rem .4rem; border-radius: var(--r-xs); border: 1px solid var(--line); overflow-wrap: anywhere; }
footer a { text-decoration: none; }

.toast {
  position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%);
  background: var(--card); border: 1px solid var(--line); padding: .5rem .9rem;
  border-radius: var(--r-sm); opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 200;
}
.toast.show { opacity: 1; }

@media (max-width: 720px) {
  .features { grid-template-columns: 1fr; }
}
/* Formulaires de la colonne Agenda : compaction selon la largeur de la COLONNE. */
@container (max-width: 520px) {
  .add-row { grid-template-columns: 1fr 1fr; }
  .add-row .btn { grid-column: 1 / -1; }
  .event-form .grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  footer code { display: inline-block; max-width: 100%; }
}

/* Accordéon « Composants tiers & licences » (À propos) : la longue liste de
   dépendances est repliée par défaut (progressive disclosure) pour garder le
   panneau compact et scannable. */
.acc-collapse > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: .5rem;
}
.acc-collapse > summary::-webkit-details-marker { display: none; }
.acc-collapse-title { display: inline-flex; align-items: center; gap: .5rem; flex: 1; }
.acc-collapse > summary > svg:last-child {
  margin-left: auto; color: var(--muted);
  transition: transform var(--dur-fast, .18s) var(--ease-out, ease);
}
.acc-collapse[open] > summary > svg:last-child { transform: rotate(180deg); }
.acc-collapse > summary:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; border-radius: var(--r-sm); }

/* Profil : édition allégée sur mobile. La bannière renvoie vers la version Web
   (app sur ordinateur) et n'apparaît QUE sur petit écran ; sur desktop, tout le
   formulaire reste visible et la bannière est masquée. */
.mobile-web-hint { display: none; }
.mobile-web-hint .mwh-head { display: flex; align-items: center; gap: .4rem; }
@media (max-width: 767px) {
  .mobile-web-hint {
    display: block;
    margin: 0 0 .9rem;
    padding: .7rem .8rem;
    background: var(--inset);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
  }
  /* Champs perso (ajout) et onglet Réseaux : réservés à la version Web. */
  .id-hide-mobile { display: none !important; }
}

/* Petit écran — portée PARTAGÉE (profil public + landing + cartes génériques) et
   GLOBALE (footer). Reste en @media : ces éléments ne sont pas dans une colonne
   (donc pas de contexte de container). */
@media (max-width: 600px) {
  /* (doublon 56px supprimé : il était écrasé par 64px ci-dessous) */
  .deck .photo, .photo { width: 64px; height: 64px; }
  .card h1 { font-size: 1.15rem; }
  .card .handle { font-size: .82rem; }
  .subtitle { font-size: .85rem; }

  /* Profil public (page /@handle) : compaction de l'en-tête de carte. */
  .profile-head { margin: 1.9rem 0 .7rem; gap: .8rem; }
  .profile-meta { margin-bottom: .7rem; }
  .profile-contact-actions { margin-bottom: .7rem; }
  .profile-card-actions { top: .6rem; }
  .profile-card-actions-left { left: .6rem; }
  .profile-card-actions-right { right: .6rem; }

  /* Footer masqué sur mobile (la navigation entre colonnes reste assurée par
     la branche à points .deck-branch, qui n'est PAS dans le footer). */
  footer { display: none; }
  .mobile-hide { display: none; }
}

/* Petit écran — portée COLONNE ÉDITEUR (Identité) : compaction de l'en-tête et
   des actions selon la largeur de la COLONNE (.col a container-type:inline-size),
   pas du viewport. Sur desktop la colonne est large → pas de compaction ; sur
   mobile / colonne étroite → en-tête compact (photo à gauche, actions en ligne). */
@container (max-width: 600px) {
  .deck .col .card { padding: 1rem; }
  .id-head { display: flex; align-items: center; gap: .85rem; margin-bottom: .65rem; }
  .id-head .photo-wrap { margin: 0; flex: none; }
  .id-head-body { flex: 1; min-width: 0; }
  .id-head .handle { text-align: left; margin: 0 0 .45rem; }
  /* 4 actions sur une seule ligne : les 2 boutons photo passent en icône seule
     (label masqué mais aria-label/title conservés), QR & Voir gardent leur texte. */
  .id-actions { display: flex; flex-direction: row; align-items: center; gap: .4rem; }
  .id-photo-form, .id-actions-sec { display: contents; }
  .id-actions .btn { min-height: 40px; font-size: .78rem; }
  .id-photo-form .btn { flex: 0 0 44px; padding: .42rem; justify-content: center; }
  .id-photo-form .btn-label { display: none; }
  .id-actions-sec .btn { flex: 1; padding: .42rem .55rem; }
  .id-tabs { margin-bottom: .5rem; }
  .id-tab { padding: .38rem .35rem; font-size: .76rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto; }
}

/* ------------------------------ Relation switch -------------------------- */
.rel-switch {
  display: flex; align-items: center; gap: .5rem;
  cursor: pointer; user-select: none; font-size: .82rem; color: var(--fg-muted);
}
.rel-switch-label { display: flex; align-items: center; gap: .3rem; white-space: nowrap; }
.toggle-track {
  position: relative; width: 36px; height: 20px; flex-shrink: 0;
  border-radius: var(--r-lg); background: var(--line);
  transition: background .2s;
}
.toggle-track.on { background: var(--accent); }
.toggle-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.35);
}
.toggle-track.on .toggle-thumb { transform: translateX(16px); }

/* Onglet « Options » : liste de bascules (checkbox masquée → piste/pouce). */
.opt-list { display: flex; flex-direction: column; gap: .2rem; }
.opt-row {
  display: flex; align-items: center; gap: .75rem;
  padding: .7rem .2rem; cursor: pointer;
  border-top: 1px solid var(--line);
}
.opt-row:first-child { border-top: none; }
.opt-text { display: flex; flex-direction: column; gap: .15rem; flex: 1; min-width: 0; }
.opt-name { font-size: .9rem; font-weight: 600; }
.opt-desc { font-size: .76rem; color: var(--muted); line-height: 1.35; }
.opt-toggle { position: absolute; opacity: 0; width: 0; height: 0; }
.opt-toggle:focus-visible + .toggle-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.opt-toggle:checked + .toggle-track { background: var(--accent); }
.opt-toggle:checked + .toggle-track .toggle-thumb { transform: translateX(16px); }
.opt-row.disabled { opacity: .45; }
.opt-row.disabled .toggle-track { pointer-events: none; }

/* Disponibilités générales (jours / horaires / périodes) */
.avail-days { display: flex; gap: .35rem; margin: .2rem 0 .6rem; }
.avail-day {
  flex: 1; min-width: 0; aspect-ratio: 1; max-width: 40px;
  border: 1px solid var(--line); background: var(--inset); color: var(--muted);
  border-radius: var(--r-sm); cursor: pointer; font-size: .82rem; font-weight: 600;
}
.avail-day.on { background: var(--accent); color: #0b0d12; border-color: var(--accent-ink); }
.avail-hours { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: .3rem 0 .2rem; font-size: .84rem; color: var(--muted); }
.avail-hours label { display: inline-flex; align-items: center; gap: .35rem; }
.avail-hours input[type="time"], .avail-hours select { font-size: .84rem; padding: .3rem .4rem; }
.avail-period { display: flex; align-items: center; gap: .5rem; padding: .35rem 0; border-top: 1px solid var(--line); font-size: .82rem; }
.avail-period:first-child { border-top: none; }
.avail-period .ap-range { flex: 1; }
.avail-period .ap-status { font-size: .72rem; padding: .05rem .4rem; border-radius: 999px; border: 1px solid var(--line); }

/* Prochains événements sous le calendrier (onglet Agenda → Agenda) */
.agenda-upcoming { padding: .6rem 0 .4rem; }
.agenda-upcoming-title {
  font-size: .68rem; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; gap: .3rem;
  margin: 0 0 .5rem; padding-top: .5rem; border-top: 1px solid var(--line);
}
.agenda-upcoming-item {
  display: flex; align-items: baseline; gap: .55rem;
  padding: .35rem 0; border-bottom: 1px solid var(--hairline);
}
.agenda-upcoming-item:last-child { border-bottom: none; }
.agenda-upcoming-time { font-size: .75rem; color: var(--accent-ink); flex: none; font-variant-numeric: tabular-nums; }
.agenda-upcoming-name { font-size: .84rem; color: var(--fg); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avail-period .ap-status.free { color: #2c7d63; border-color: #2c7d63; }
.avail-period .ap-status.busy { color: var(--muted); }
.avail-period-add { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; align-items: center; }
.avail-period-add input[type="date"], .avail-period-add select { font-size: .8rem; padding: .3rem .4rem; flex: 1; min-width: 110px; }

/* Sélecteur de créneau horaire dans la modale de RDV */
.bk-slots { margin: .2rem 0 .8rem; }
.bk-slots-label { display: block; font-size: .78rem; color: var(--muted); margin-bottom: .35rem; }
.bk-slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: .35rem; max-height: 160px; overflow-y: auto; }
.bk-slot {
  border: 1px solid var(--line); background: var(--inset); color: var(--fg);
  border-radius: var(--r-sm); padding: .35rem 0; cursor: pointer; font-size: .82rem;
}
.bk-slot:hover { border-color: var(--accent-ink); }
.bk-slot.sel { background: var(--accent); color: #0b0d12; border-color: var(--accent-ink); }
.bk-slot.taken { opacity: .4; cursor: not-allowed; text-decoration: line-through; }

/* -------------------------------- Passkeys ------------------------------- */
.badge-sm {
  display: inline-block; font-size: .7rem; font-weight: 500; padding: .15rem .5rem;
  border-radius: var(--r-lg); background: var(--accent); color: var(--on-accent); vertical-align: middle;
  margin-left: .4rem; opacity: .85;
}
.passkey-row {
  display: grid; grid-template-columns: 20px 1fr auto auto; align-items: center;
  gap: .5rem; padding: .5rem .6rem; border-radius: var(--r-sm); background: var(--bg-soft);
  border: 1px solid var(--line); margin-bottom: .4rem;
}
.passkey-icon { color: var(--accent-ink); display: flex; align-items: center; }
.passkey-name { font-weight: 500; font-size: .9rem; }
.passkey-meta { font-size: .78rem; color: var(--fg-muted); }
.btn.sm.danger { font-size: .78rem; padding: .25rem .5rem; background: none; color: var(--danger); border-color: var(--danger); }
.btn.sm.danger:hover { background: var(--danger); color: #fff; }

/* Onglets du dialog récupération */
.rc-tabs { display: flex; gap: .4rem; margin-bottom: 1rem; }
.rc-tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .5rem; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: none; color: var(--fg-muted); cursor: pointer; font-size: .85rem;
  transition: background .15s, color .15s;
}
.rc-tab:hover { background: var(--bg-soft); color: var(--fg); }
.rc-tab.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent-ink); font-weight: 600; }

/* Bandeau GDPR */
.gdpr-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: var(--accent); border: none;
  padding: .3rem .9rem; display: flex; align-items: center; gap: .6rem;
  font-size: .68rem; line-height: 1.3; color: #fff;
  height: 40px;
}
.gdpr-banner p { margin: 0; flex: 1; line-height: 1.3; }
.gdpr-banner a { color: #fff; opacity: .8; }
.gdpr-banner a:hover { opacity: 1; }
.gdpr-banner .btn { padding: .2rem .6rem; font-size: .7rem; background: rgba(255,255,255,.2); color: #fff; border-color: rgba(255,255,255,.35); }
.gdpr-banner .btn:hover { background: rgba(255,255,255,.32); }

/* Zone sensible (export / suppression compte) */
.danger-title { color: var(--danger, #e05252); }

/* Actions du profil public (coins haut de la carte) */
.profile-card-actions {
  position: absolute; top: .9rem; z-index: 2;
  display: flex; align-items: center; gap: .4rem;
}
.profile-card-actions-left { left: .9rem; }
.profile-card-actions-right { right: .9rem; justify-content: flex-end; }
.profile-card-actions .rel-switch { font-size: .78rem; }
/* Bouton « Fermer » de la colonne fiche contact (placé dans la zone actions-droite,
   donc positionné par le conteneur — pas d'absolute ici). */
.profile-card .close {
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: var(--inset); color: var(--muted);
  border-radius: var(--r-sm); cursor: pointer; font-size: 1rem; line-height: 1;
}
.profile-card .close:hover { color: var(--fg); border-color: var(--accent-ink); }

/* ---- Barre de recherche compacte dans le header (hors landing) ---- */
.hdr-search {
  position: relative; flex: 1; max-width: 440px;
}
.hdr-search-box {
  display: flex; align-items: center; gap: .55rem;
  background: color-mix(in srgb, var(--inset) 70%, transparent);
  border: 1px solid var(--line); border-radius: 999px;
  padding: .42rem .55rem .42rem .9rem;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.hdr-search-box:hover { border-color: color-mix(in srgb, var(--accent-ink) 45%, var(--line)); }
.hdr-search-box:focus-within {
  border-color: var(--accent-ink); box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--card);
}
.hdr-search-box svg { color: var(--muted); flex: none; transition: color .18s ease; }
.hdr-search-box:focus-within svg { color: var(--accent-ink); }
.hdr-search-box input {
  flex: 1; border: none; background: none; color: var(--fg);
  font-size: .9rem; padding: 0; min-width: 0;
}
.hdr-search-box input::placeholder { color: var(--muted); opacity: .85; }
.hdr-search-box input:focus { outline: none; }
/* Raccourci clavier « / » — pastille discrète, masquée dès qu'on tape ou focus. */
.hdr-kbd {
  flex: none; font: 600 .72rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--muted); background: var(--chip); border: 1px solid var(--line);
  border-radius: 6px; padding: .2rem .42rem; transition: opacity .15s ease;
}
.hdr-search-box:focus-within .hdr-kbd,
.hdr-search.has-value .hdr-kbd { opacity: 0; }
.hdr-results {
  position: absolute; top: calc(100% + .4rem); left: 0; right: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  overflow: hidden; z-index: 60; box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.hdr-results[hidden] { display: none; }
.hdr-results .result {
  display: flex; align-items: center; gap: .65rem; padding: .6rem .85rem;
  text-decoration: none; color: var(--fg); border-bottom: 1px solid var(--line);
  transition: background .1s;
}
.hdr-results .result:last-child { border-bottom: none; }
.hdr-results .result:hover { background: var(--bg-soft); }
.hdr-results .av { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--chip); flex: none; display: flex; align-items: center; justify-content: center; font-size: .82rem; color: var(--muted); }
.hdr-results .nm { font-weight: 500; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hdr-results .hd { color: var(--muted); font-size: .76rem; }
.hdr-results .no { padding: .75rem .85rem; color: var(--muted); font-size: .85rem; }
@media (max-width: 640px) {
  .hdr-search { max-width: 180px; }
  .hdr-kbd { display: none; }
  /* Sur mobile, la barre de recherche est étroite (180px) : si le menu de
     résultats reste calé sur sa largeur, le texte se retrouve à l'étroit et
     déborde sous le contenu. On le détache en panneau pleine largeur ancré sous
     le header (position fixe), lisible et sans chevauchement. */
  .hdr-results {
    position: fixed; left: .6rem; right: .6rem; top: 3.6rem;
    max-height: 60vh; overflow-y: auto;
  }
}

/* ---- Galerie ---- */
.gal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
.gal-item {
  position: relative; aspect-ratio: 1; overflow: hidden;
  border-radius: var(--r-xs); background: var(--inset); cursor: pointer;
}
.gal-item img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .25s ease;
}
.gal-item:hover img { transform: scale(1.05); }
/* Overlay au survol */
.gal-item::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.55) 0%, transparent 55%);
  opacity: 0; transition: opacity .2s;
  pointer-events: none; /* l'overlay décoratif ne doit pas voler le clic sur la photo */
}
.gal-item:hover::after { opacity: 1; }
/* Bouton supprimer (éditeur, coin haut-droit) */
.gal-del {
  position: absolute; top: 5px; right: 5px; z-index: 2;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,.6); border: none; color: #fff;
  font-size: .7rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .15s;
}
.gal-item:hover .gal-del { opacity: 1; }
/* Bouton like (coin bas-gauche, par dessus l'overlay) */
.gal-like {
  position: absolute; bottom: 6px; left: 6px; z-index: 3;
  display: flex; align-items: center; gap: 3px;
  background: rgba(0,0,0,.55); border: none; border-radius: 999px;
  color: #fff; font-size: .72rem; padding: 3px 7px 3px 5px;
  cursor: pointer; opacity: 0; transition: opacity .15s, background .15s;
  backdrop-filter: blur(4px);
}
.gal-item:hover .gal-like { opacity: 1; }
.gal-like.liked { opacity: 1; background: rgba(220,50,50,.7); }
.gal-like svg { flex: none; }
.gal-count { line-height: 1; }
/* Zone de dépôt (upload) */
.gal-drop {
  border: 1.5px dashed var(--line); border-radius: var(--r-md);
  padding: .9rem; display: flex; align-items: center; justify-content: center;
  gap: .6rem; color: var(--muted); font-size: .85rem;
  transition: border-color .15s, background .15s;
}
.gal-drop.drag-over {
  border-color: var(--accent-ink); background: var(--accent-soft);
  color: var(--accent-ink);
}
.gal-empty { color: var(--muted); font-size: .85rem; text-align: center; padding: 1.5rem 0; }
/* Lightbox */
.gal-lb {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,.88); display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(6px); animation: fadein .2s ease;
}
.gal-lb-inner {
  position: relative; max-width: min(92vw, 900px); max-height: 90vh;
  display: flex; align-items: center; justify-content: center;
}
.gal-lb-inner img {
  max-width: 100%; max-height: 90vh; border-radius: var(--r-sm);
  box-shadow: 0 24px 60px rgba(0,0,0,.8); object-fit: contain;
}
.gal-lb-close {
  position: absolute; top: -12px; right: -12px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--line); color: var(--fg);
  font-size: .9rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.5);
}
.gal-lb-close:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
/* Vue publique du profil */
.gal-public .gal-grid { gap: 3px; }
@keyframes fadein { from { opacity:0 } to { opacity:1 } }

/* ------------------------------- Tags ----------------------------------- */
.tags, .tags-edit { display: flex; flex-wrap: wrap; gap: .4rem; }
.tags { justify-content: center; margin: .15rem 0 .5rem; }
.tag-chip {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .6rem; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-ink);
  border: 1px solid var(--accent-line);
  font-size: .82rem; font-weight: 600; line-height: 1.4;
  transition: border-color var(--dur) var(--ease-out), background var(--dur) var(--ease-out);
}
.tags-edit .tag-chip:hover { border-color: var(--accent-ink); }
.tag-del {
  border: 0; background: transparent; color: inherit; cursor: pointer;
  font-size: .85em; line-height: 1; opacity: .65;
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%; padding: 0; margin-right: -.2rem;
}
.tag-del:hover { opacity: 1; color: var(--danger); }
.tags-empty { color: var(--muted); font-size: .85rem; }

/* ----------------------- Appel audio/vidéo P2P (WebRTC) ----------------- */
/* Boutons « Discuter » + « Appel » dans la colonne profil (contacts). */
.profile-contact-actions {
  display: flex; gap: .5rem;
  margin: 0 0 1rem;
}
.profile-contact-actions .btn { flex: 1; justify-content: center; gap: .35rem; }

/* Overlay d'appel plein écran (au-dessus de tout). */
.call-dock {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(8,10,14,.92); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
  animation: fadein .2s ease;
}
.call-panel {
  position: relative; width: min(900px, 100%); height: min(680px, 100%); max-width: none;
  display: flex; flex-direction: column; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 0; overflow: hidden;
}
.call-stage { position: relative; flex: 1; min-height: 0; background: #05070b; }
.call-video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #05070b;
}
.call-self {
  position: absolute; right: 14px; bottom: 14px; z-index: 3;
  width: 28%; max-width: 200px; aspect-ratio: 4/3; object-fit: cover;
  border: 1px solid var(--line); border-radius: var(--r-md); background: #05070b;
  transform: scaleX(-1); box-shadow: 0 6px 18px rgba(0,0,0,.5);
}
/* Carte de sonnerie / connexion : reste affichée pendant un appel AUDIO (avatar +
   animation), masquée seulement quand une vidéo distante arrive. */
.call-ring {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem;
  text-align: center; color: var(--fg);
}
.call-stage.has-remote-video .call-ring { display: none; }
.call-ring .call-av { width: 92px; height: 92px; font-size: 2rem; position: relative; z-index: 1; }

/* Halo de cercles pulsés autour de l'avatar. */
.call-orb { position: relative; display: grid; place-items: center; margin-bottom: .2rem; }
.call-orb-ring {
  position: absolute; width: 92px; height: 92px; border-radius: 50%;
  border: 2px solid var(--accent, #5B5FC7);
  animation: call-orb-pulse 2.4s cubic-bezier(.22,.61,.36,1) infinite;
}
.call-orb-ring:nth-child(2) { animation-delay: .8s; }
.call-orb-ring:nth-child(3) { animation-delay: 1.6s; }
@keyframes call-orb-pulse {
  0%   { transform: scale(1);   opacity: .55; }
  70%  { opacity: 0; }
  100% { transform: scale(2.4); opacity: 0; }
}
/* Égaliseur animé : visible une fois en communication. */
.call-eq { width: 40px; height: 22px; display: none; }
.call-eq rect { fill: var(--accent, #5B5FC7); transform-box: fill-box; transform-origin: center bottom; animation: call-eq-bar 1s ease-in-out infinite; }
.call-eq rect:nth-child(1) { animation-delay: 0s;    }
.call-eq rect:nth-child(2) { animation-delay: .18s;  }
.call-eq rect:nth-child(3) { animation-delay: .36s;  }
.call-eq rect:nth-child(4) { animation-delay: .12s;  }
.call-eq rect:nth-child(5) { animation-delay: .30s;  }
.call-stage[data-stage="connected"] .call-eq { display: inline-block; }
@keyframes call-eq-bar { 0%,100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) {
  .call-orb-ring, .call-eq rect { animation: none; }
  .call-orb-ring { opacity: .3; }
}
.call-name { font-size: 1.2rem; font-weight: 600; }
.call-status { color: var(--muted); font-size: .95rem; }
.call-e2e { color: var(--muted); font-size: .8rem; opacity: .8; }
.call-ring-actions { display: flex; gap: .6rem; margin-top: .8rem; }
.call-accept { background: var(--accent); color: #0b0d12; border-color: transparent; }
.call-controls {
  display: flex; align-items: center; justify-content: center; gap: 1rem;
  padding: .9rem; border-top: 1px solid var(--line); background: var(--card);
}
.call-ctl {
  width: 52px; height: 52px; border-radius: 999px; font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center;
}
.call-ctl.off { opacity: .45; }
#call-hangup { transform: rotate(135deg); }
@media (max-width: 560px) {
  .call-panel { height: 100%; border-radius: 0; }
  .call-self { width: 34%; }
}

/* ============================================================
   Système de défilement unifié (densité-aware)
   Remplace les 5 conventions de scrollbar disparates par UN comportement :
   1. scroll-shadows  : dégradé haut/bas qui n'apparaît qu'en cas de
      débordement réel → affordance « il y a plus de contenu », sans barre.
      (technique background-attachment: local, position-aware, 0 JS)
   2. barre overlay   : fine, masquée au repos, révélée au hover/focus
      (souris uniquement) ; sur tactile, seules les ombres servent d'indice.
   3. overscroll-behavior: contain → coupe la propagation des scrolls imbriqués.
   --scroll-bg doit refléter le fond RÉEL du conteneur pour que le fondu se fonde.
   ============================================================ */
.col-scroll, .agenda-events, .chat-log,
.picker-list, .notif-list, .bk-slot-grid,
#app[data-view="landing"] .deck .col {
  --scroll-bg: var(--card);
  overscroll-behavior: contain;
  background-image:
    linear-gradient(var(--scroll-bg) 32%, color-mix(in srgb, var(--scroll-bg), transparent 100%)),
    linear-gradient(color-mix(in srgb, var(--scroll-bg), transparent 100%), var(--scroll-bg) 68%),
    radial-gradient(farthest-side at 50% 0,   var(--scroll-shadow), transparent),
    radial-gradient(farthest-side at 50% 100%, var(--scroll-shadow), transparent);
  background-position: 50% 0, 50% 100%, 50% 0, 50% 100%;
  background-size: 100% 30px, 100% 30px, 100% 16px, 100% 16px;
  background-repeat: no-repeat;
  background-attachment: local, local, scroll, scroll;
}
/* Fond réel par conteneur (sinon le fondu vire au gris) */
.chat-log { --scroll-bg: var(--inset); }
#app[data-view="landing"] .deck .col { --scroll-bg: var(--bg); }

/* Tapisserie discrète façon WhatsApp : on REDÉCLARE la pile de fond de .chat-log
   (miroir de la règle scroll-shadow ci-dessus) en ajoutant un motif de points en
   DERNIÈRE couche — peint juste au-dessus de la couleur de fond, sous les fondus
   et ombres de scroll. `local` → le motif pave toute la hauteur défilée. */
.chat-log {
  background-image:
    linear-gradient(var(--scroll-bg) 32%, color-mix(in srgb, var(--scroll-bg), transparent 100%)),
    linear-gradient(color-mix(in srgb, var(--scroll-bg), transparent 100%), var(--scroll-bg) 68%),
    radial-gradient(farthest-side at 50% 0,   var(--scroll-shadow), transparent),
    radial-gradient(farthest-side at 50% 100%, var(--scroll-shadow), transparent),
    radial-gradient(circle, color-mix(in srgb, var(--fg) 5%, transparent) 1.3px, transparent 1.4px);
  background-position: 50% 0, 50% 100%, 50% 0, 50% 100%, 0 0;
  background-size: 100% 30px, 100% 30px, 100% 16px, 100% 16px, 22px 22px;
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, repeat;
  background-attachment: local, local, scroll, scroll, local;
}

/* Scrollbar verticale TOUJOURS visible sur chaque zone scrollable (fine, palette
   caméléon). Le pouce se renforce au survol/focus ; piste discrète au repos. */
.col-scroll, .agenda-events, .chat-log,
.picker-list, .notif-list, .bk-slot-grid,
#app[data-view="landing"] .deck .col {
  scrollbar-width: thin;                         /* Firefox */
  scrollbar-color: var(--accent-line) transparent;
}
.col-scroll::-webkit-scrollbar, .agenda-events::-webkit-scrollbar,
.chat-log::-webkit-scrollbar, .picker-list::-webkit-scrollbar,
.notif-list::-webkit-scrollbar, .bk-slot-grid::-webkit-scrollbar,
#app[data-view="landing"] .deck .col::-webkit-scrollbar {
  width: 9px; height: 9px;
}
.col-scroll::-webkit-scrollbar-track, .agenda-events::-webkit-scrollbar-track,
.chat-log::-webkit-scrollbar-track, .picker-list::-webkit-scrollbar-track,
.notif-list::-webkit-scrollbar-track, .bk-slot-grid::-webkit-scrollbar-track,
#app[data-view="landing"] .deck .col::-webkit-scrollbar-track {
  background: transparent;
}
.col-scroll::-webkit-scrollbar-thumb, .agenda-events::-webkit-scrollbar-thumb,
.chat-log::-webkit-scrollbar-thumb, .picker-list::-webkit-scrollbar-thumb,
.notif-list::-webkit-scrollbar-thumb, .bk-slot-grid::-webkit-scrollbar-thumb,
#app[data-view="landing"] .deck .col::-webkit-scrollbar-thumb {
  background: var(--accent-line); border-radius: var(--r-pill);
  border: 2px solid transparent; background-clip: content-box;
  transition: background .2s ease;
}
.col-scroll:hover::-webkit-scrollbar-thumb, .agenda-events:hover::-webkit-scrollbar-thumb,
.chat-log:hover::-webkit-scrollbar-thumb, .picker-list:hover::-webkit-scrollbar-thumb,
.notif-list:hover::-webkit-scrollbar-thumb, .bk-slot-grid:hover::-webkit-scrollbar-thumb,
#app[data-view="landing"] .deck .col:hover::-webkit-scrollbar-thumb {
  background: var(--accent-ink); background-clip: content-box;
}

/* ============================================================
   Densité-aware (brique 1) — container queries sur la COLONNE
   La largeur d'une colonne (clamp 280→520px) ne suit pas celle de l'écran ;
   on compacte donc selon la largeur réelle de la colonne pour « tenir »
   avant de devoir scroller. Complète (sans remplacer) les @media existants.
   ============================================================ */
@container (max-width: 360px) {
  /* En-tête identité : libère de la hauteur quand la colonne est étroite. */
  .profile-head { gap: .7rem; margin-top: 1.7rem; }
  .id-actions { gap: .35rem; }
  .id-actions .btn-label { display: none; }   /* icônes seules → moins haut */
  .id-actions .btn { padding: .42rem .5rem; }
}
@container (max-width: 320px) {
  /* padding géré en continu par --pad ; ici on ne touche qu'à la grille du menu */
  .menu-grid { gap: .5rem; }
  .menu-tile { min-height: 104px; }
}

/* Mouvement réduit : les ombres restent (statiques), pas de transition de barre. */
@media (prefers-reduced-motion: reduce) {
  .col-scroll, .agenda-events, .chat-log,
  .picker-list, .notif-list, .bk-slot-grid,
  #app[data-view="landing"] .deck .col { transition: none; }
}

/* ========================================================================
   REDESIGN v2 — Navigation par onglets (bottom nav / sidebar)
   Remplace le deck horizontal à swipe par des panneaux verticaux.
   ======================================================================== */

/* — Tokens globaux v2 — */
:root {
  --maxw: 760px;          /* max-width du contenu (↑ vs 460px) */
  --topbar-h: 56px;
  --bnav-h: 62px;
  --bnav-safe: env(safe-area-inset-bottom, 0px);
  /* Hauteur réelle du bandeau « Mise à jour disponible » quand il est affiché
     (sinon 0px). Posée par JS (showUpdateBanner) car la hauteur varie selon le
     retour à la ligne. Le bandeau est un frère EN FLUX avant #app : il décale
     #app vers le bas, mais PAS les chromes en position:fixed (header + rail) ni
     les hauteurs calculées en 100dvh → on les compense via cette variable. */
  --banner-h: 0px;
  --font: "Inter", ui-sans-serif, system-ui, sans-serif;
  /* Échelle de rayons (langage de formes) — un seul vocabulaire au lieu de ~19
     valeurs ad-hoc. Inspirée de Fluent 2 (Teams) : paliers nets, ramp régulière.
       xs  micro (puces mono, ticks, file-button)
       sm  petits éléments (tags, tuiles d'icône, ✕)
       md  CONTRÔLES (boutons, champs, tuiles d'action, items du rail)
       lg  cartes / sections / bannières
       xl  modales & grandes surfaces
       pill capsules & barres de recherche */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;
  /* Tokens historiques re-pointés sur l'échelle (cartes = lg). */
  --radius: var(--r-lg);
  --tab-radius: var(--r-lg);
}

/* Police Inter sur tout l'app */
body { font-family: var(--font); }

/* — Topbar collante et vitrée — */
#app[data-view="private"] .topbar.site-header,
#app[data-view="public"] .topbar.site-header,
#app[data-view="profile"] .topbar.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--topbar-h);
  /* Barre connectée = pleine largeur (le cap 960px de .topbar/.site-header
     ne s'applique qu'aux pages éditoriales/landing). */
  max-width: none;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--line);
  padding: 0 1rem;
}

/* — Espace pour la barre du bas (sauf landing) — */
#app[data-view="private"] {
  padding-bottom: calc(var(--bnav-h) + var(--bnav-safe));
  /* Hauteur disponible pour chaque carte d'onglet */
  --col-h: calc(100dvh - var(--banner-h) - var(--topbar-h) - var(--bnav-h) - var(--bnav-safe));
}

/* — Deck → panneaux verticaux — */
#app[data-view="private"] .deck-title,
#app[data-view="private"] .deck-branch { display: none !important; }

#app[data-view="private"] .deck-back { display: none !important; }

#app[data-view="private"] #deck-viewport {
  overflow-y: auto !important;
  overflow-x: hidden;
  width: 100%;
  /* Plus de plafond --maxw : tout l'app connecté exploite la largeur dispo, avec
     des marges latérales uniformes (= la marge haute, cf. #deck ci-dessous). */
  max-width: none;
  margin: 0 auto;
  /* Conteneur flex colonne → #deck peut remplir la hauteur de façon FIABLE
     (un pourcentage min-height ne se résout pas sur un parent en hauteur flex). */
  display: flex !important;
  flex-direction: column !important;
}

#app[data-view="private"] #deck {
  /* flex:1 (basis:0) : part de 0 et remplit #deck-viewport sans propager de
     taille intrinsèque infinie vers le haut. Chaque onglet défile en interne. */
  display: flex !important;
  flex-direction: column !important;
  flex: 1 !important;
  min-height: 0 !important;
  transform: none !important;
  width: 100% !important;
  height: auto !important;
  padding: 0 !important;
  gap: 0 !important;
}

#app[data-view="private"] #deck .col {
  display: none !important;
  width: 100% !important;
  height: auto !important;
  overflow: visible !important;
  flex: none !important;
  padding: 0 !important;
  opacity: 1 !important;
  transform: none !important;
}

/* Tous les onglets actifs : flex column flex:1 — le contenu gère son défilement en interne. */
#app[data-view="private"] #deck .col.active {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 !important;
  min-height: 0 !important;
}
#app[data-view="private"] #deck .col.active:not([data-deck-label="Chat"]) > .card,
#app[data-view="private"] #deck .col.active:not([data-deck-label="Chat"]) > .hm-dashboard,
#app[data-view="private"] #deck .col.active:not([data-deck-label="Chat"]) > .acc-wrapper {
  flex: none;
  height: var(--col-h);
  max-height: var(--col-h);
  min-height: 0;
}
/* Onglet Options : pas de col-scroll interne → le card lui-même défile. */
#app[data-view="private"] #deck .col.active[data-deck-label="Options"] > .card {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
/* hm-dashboard n'a pas de .card wrapper → lui donner le même padding que les cartes.
   display:flex + .col-scroll interne (comme les autres onglets) : le contenu défile
   à l'intérieur de la colonne au lieu de hijacker la navigation molette du deck. */
#app[data-view="private"] #deck .col.active > .hm-dashboard {
  padding: var(--pad);
  display: flex;
  flex-direction: column;
}

/* Les cartes prennent toute la largeur dans les panneaux */
#app[data-view="private"] #deck .col .card {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

/* col-scroll dans le deck connecté : défile à l'intérieur de la carte
   (la carte est bornée par col.active flex:1 → #deck-viewport).
   Le margin/padding reset annule la compensation négative du mode multi-colonnes. */
#app[data-view="private"] #deck .col-scroll {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
  margin: 0 !important;
  padding: 0 !important;
}
/* Exception — onglet Agenda, sous-onglet « Agenda » (dispo) : la zone scrollable
   redevient un conteneur flex pleine hauteur pour rétablir le maillon
   #agenda-dispo (flex:1) → .calendar-fill (flex:1) → cellules en 1fr. Le
   calendrier s'étire alors proprement, sans grand vide ni débordement du
   viewport. */
#app[data-view="private"] #deck .col.active[data-deck-label="Agenda"]
  .col-scroll:has(> #agenda-dispo:not([hidden])) {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
#app[data-view="private"] #deck .col.active[data-deck-label="Agenda"] > .card {
  height: var(--col-h);
  max-height: var(--col-h);
}

/* — Barre de navigation bottom — */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: calc(var(--bnav-h) + var(--bnav-safe));
  padding-bottom: var(--bnav-safe);
  display: flex;
  align-items: stretch;
  background: color-mix(in srgb, var(--card) 94%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--line);
  transition: transform .2s ease;
}

/* Cachée quand overlay ouvert */
body:has(.overlay.open) .bottom-nav { transform: translateY(100%); }

.bnav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--muted);
  font-size: .65rem;
  font-weight: 500;
  letter-spacing: .015em;
  padding: 6px 2px 4px;
  transition: color .15s, transform .1s;
  text-decoration: none;
  position: relative;
  min-width: 44px;
  touch-action: manipulation;
}

.bnav-item svg { flex: none; transition: transform .15s; }
.bnav-item:active { transform: scale(.92); }
/* Couronne Premium sur l'entrée Compte de la barre du bas (cohérente avec l'avatar). */
.bnav-crown {
  position: absolute; top: 1px; left: 50%; transform: translateX(-50%) rotate(-4deg);
  width: 13px; height: 11px; color: #ffcf3f; pointer-events: none; z-index: 2;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.5));
}
.bnav-crown svg { display: block; width: 100%; height: 100%; }
:root[data-theme="light"] .bnav-crown { color: #eab308; }
.bnav-item.active { color: var(--accent-ink); }

/* Indicateur actif : pill sous l'icône */
.bnav-item .bnav-pip {
  position: absolute;
  top: 5px;
  width: 24px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0;
  transform: scaleX(0);
  transition: opacity .2s, transform .2s;
}
.bnav-item.active .bnav-pip { opacity: 1; transform: scaleX(1); }

/* Badge (non-lus) */
.bnav-badge {
  position: absolute;
  top: 4px;
  right: 50%;
  margin-right: -20px;
  background: var(--danger);
  color: #fff;
  font-size: .58rem;
  font-weight: 700;
  padding: .05rem .28rem;
  border-radius: 999px;
  min-width: 14px;
  text-align: center;
  line-height: 1.4;
}

/* — Améliorations carte v2 — */
#app[data-view="private"] .card {
  border-radius: var(--tab-radius);
  margin-bottom: .75rem;
}

/* Section-title plus claire */
#app[data-view="private"] .section-title {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 600;
  color: var(--muted);
}

/* Menu tiles en 2 colonnes → toujours 2 colonnes (lisible jusqu'à 760px) */
#app[data-view="private"] .menu-grid {
  grid-template-columns: 1fr 1fr;
}

/* — Mobile uniquement (< 840px) : ajustements spécifiques vue connectée — */
@media (max-width: 839px) {
  /* Onglet Compte : cache l'aperçu téléphone (trop grand, bloque le contenu) */
  #app[data-view="private"] #deck .lt-phone { display: none !important; }
  #app[data-view="private"] #deck .lt-phone-cols { display: block !important; }
  /* Cache le titre "APERÇU DE TA PAGE PUBLIQUE" sans preview */
  #app[data-view="private"] #deck .hm-public > .hm-section-title { display: none !important; }
  /* Réordonne : hm-aside (stats/activité) avant les toggles de visibilité */
  #app[data-view="private"] #deck .hm-row-hybrid { display: flex !important; flex-direction: column !important; }
  #app[data-view="private"] #deck .hm-row-hybrid .hm-aside { order: -1; }

  /* Onglet Agenda : le calendrier remplit toute la colonne (le bloc « À venir »
     a été retiré → plus de plafonnement, on garde la chaîne flex pleine hauteur
     comme sur desktop). */
  #app[data-view="private"] #deck .col.active[data-deck-label="Agenda"]
    .col-scroll:has(> #agenda-dispo:not([hidden])) {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }
  #app[data-view="private"] #agenda-dispo:not([hidden]) {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    min-height: 0 !important;
  }
  #app[data-view="private"] #deck .col.active[data-deck-label="Agenda"] .calendar-fill {
    flex: 1 !important;
    min-height: 0 !important;
  }
}

/* — Desktop sidebar (≥ 840px) — */
@media (min-width: 840px) {
  /* Header: fixé en haut, pleine largeur viewport, z-index max */
  #app[data-view="private"] .topbar.site-header {
    position: fixed !important;
    top: var(--banner-h);
    left: 0;
    right: 0;
    width: 100% !important;
    max-width: none !important;
    z-index: 100;
  }

  /* App: compense la hauteur du header fixe */
  #app[data-view="private"] {
    padding-top: var(--topbar-h);
    padding-bottom: 0;
    /* Desktop : pas de bnav en bas → hauteur = viewport - bandeau - topbar */
    --col-h: calc(100dvh - var(--banner-h) - var(--topbar-h));
  }
  /* Sidebar: fixe à gauche, sous le header */
  .bottom-nav {
    position: fixed;
    left: 0;
    top: calc(var(--banner-h) + var(--topbar-h));
    bottom: 0;
    width: 80px;
    height: auto;
    flex-direction: column;
    align-items: stretch;
    border-top: none;
    border-right: 1px solid var(--line);
    border-bottom: none;
    backdrop-filter: none;
    background: var(--bg-soft);
    padding-bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 50;
  }

  /* Contenu décalé pour laisser place à la sidebar, pleine largeur */
  #app[data-view="private"] #deck-viewport {
    padding-left: 80px;
    max-width: none !important;
    margin: 0 !important;
    flex: 1;
    width: 100%;
  }

  /* Cartes et deck : lever la contrainte max-width mobile (760px) */
  #app[data-view="private"] #deck {
    max-width: none !important;
    margin: 0 !important;
    width: 100% !important;
  }

  #app[data-view="private"] #deck .card {
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-top: 0 !important;
  }

  .bnav-item {
    flex: none;
    height: 68px;
    font-size: .67rem;
    /* Surbrillance arrondie façon Teams : un encart à l'intérieur du rail. */
    width: 64px;
    margin: 3px 8px;
    border-radius: var(--r-md);
    transition: color .15s, background .15s, transform .1s;
  }
  /* Survol : remplissage neutre discret (état « hover » Fluent). */
  .bnav-item:hover { background: color-mix(in srgb, var(--fg) 7%, transparent); color: var(--fg); }
  /* Actif : pastille teintée accent + texte accent (état « selected » Teams). */
  .bnav-item.active { background: var(--accent-soft); color: var(--accent-ink); }
  .bnav-item.active:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); }

  .bnav-item .bnav-pip {
    top: 50%;
    left: -8px;
    right: auto;
    width: 3px;
    height: 24px;
    margin-top: -12px;
    border-radius: 0 3px 3px 0;
    transform: scaleY(0);
  }
  .bnav-item.active .bnav-pip { transform: scaleY(1); }
}



/* — Onglet Accueil : tuiles plus compactes et visuellement séparées — */
.menu-tile {
  border-radius: var(--r-md);
  padding: 1rem .8rem;
  min-height: 80px;
}

/* ===== HOME DASHBOARD ===== */

/* Bannière profil */
.hm-banner {
  display: flex; align-items: center; gap: 1.1rem;
  padding: 1.25rem 1.25rem 1rem;
  background: var(--card);
  border-radius: var(--tab-radius);
  margin-bottom: .75rem;
  border: 1px solid var(--line);
  box-shadow: var(--elev-1);
}

/* Toggles confidentialité dans la bannière */
.hm-privacy-toggles {
  margin-top: .85rem;
  padding-top: .8rem;
  border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: .55rem;
}
.hm-toggle {
  display: flex; align-items: center; gap: .55rem;
  cursor: pointer; user-select: none;
  padding: .3rem 0;
}
.hm-toggle-ic { color: var(--muted); flex: none; }
.hm-toggle-label { flex: 1; font-size: .84rem; color: var(--fg); }
.hm-toggle input { display: none; }
.hm-toggle-sw {
  flex: none; width: 38px; height: 21px; border-radius: var(--r-md);
  background: var(--line); position: relative;
  transition: background .18s ease;
}
.hm-toggle-sw::after {
  content: ''; position: absolute;
  top: 2px; left: 2px;
  width: 17px; height: 17px; border-radius: 50%;
  background: #fff; transition: transform .18s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,.35);
}
.hm-toggle input:checked ~ .hm-toggle-sw { background: var(--accent); }
.hm-toggle input:checked ~ .hm-toggle-sw::after { transform: translateX(17px); }
.hm-toggle:hover .hm-toggle-sw { filter: brightness(1.1); }

/* Boutons Discuter/Appel en haut de la col droite : couleur distincte */
.hm-btn-chat { background: color-mix(in srgb, #22d3ee 18%, transparent) !important; border-color: #22d3ee !important; color: #22d3ee !important; }
.hm-btn-chat:hover { background: color-mix(in srgb, #22d3ee 28%, transparent) !important; }
.hm-btn-call { background: color-mix(in srgb, #fb7185 18%, transparent) !important; border-color: #fb7185 !important; color: #fb7185 !important; }
.hm-btn-call:hover { background: color-mix(in srgb, #fb7185 28%, transparent) !important; }

/* Bannière 2 colonnes égales 50/50 */
.hm-banner-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}
.hm-banner-left { display: flex; flex-direction: column; gap: 0; min-width: 0; }
.hm-banner-right {
  display: flex; flex-direction: column; gap: .65rem;
  align-items: stretch;
}
/* Boutons pleine largeur dans la colonne droite */
.hm-banner-right .hm-banner-actions { display: flex; flex-direction: column; gap: .4rem; }
.hm-banner-right .hm-banner-actions .btn { width: 100%; justify-content: flex-start; }
/* Stats 2×2 pleine largeur */
.hm-stats-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: .6rem;
}
.hm-stats-grid .hm-stat {
  padding: 1rem .75rem;
  cursor: pointer;
  border-radius: var(--r-md);
}
.hm-stats-grid .hm-stat b { font-size: 1.6rem; }
.hm-stats-grid .hm-stat span { font-size: .7rem; }
/* Responsive ≤640px : empilé */
@media (max-width: 640px) {
  .hm-banner-2col { grid-template-columns: 1fr; }
}
.hm-av {
  flex: none; width: 72px; height: 72px;
  border-radius: 50%; overflow: hidden;
  border: 2px solid var(--accent-line);
}
.hm-av .photo,
.hm-av .avatar,
.hm-av img { width: 72px; height: 72px; object-fit: cover; border-radius: 50%; display: block; }
.hm-av .avatar { display: flex; align-items: center; justify-content: center; background: var(--chip); font-size: 1.8rem; font-weight: 700; color: var(--accent-ink); }
.hm-info { flex: 1; min-width: 0; }
.hm-displayname { font-weight: 700; font-size: 1.05rem; line-height: 1.2; }
.hm-handle { color: var(--muted); font-size: .82rem; margin: .1rem 0; }
.hm-role { font-size: .82rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-loc { font-size: .78rem; color: var(--muted); margin-top: .2rem; }
.hm-badges { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .4rem; }
.hm-badge {
  display: inline-flex; align-items: center; gap: .25rem;
  font-size: .68rem; font-weight: 600; padding: .18rem .5rem;
  border-radius: 999px; border: 1px solid;
}
.hm-badge.vault { color: var(--accent-ink); border-color: var(--accent-line); background: var(--accent-soft); }
.hm-badge.public { color: var(--success); border-color: rgba(127,220,160,.4); background: rgba(127,220,160,.1); }
.hm-badge.secret { color: var(--muted); border-color: var(--line); background: var(--chip); }
.hm-banner-actions { display: flex; flex-direction: column; gap: .4rem; flex: none; }

/* Stats strip (conservé pour compatibilité, masqué dans la nouvelle bannière 2col) */
.hm-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem;
  margin-bottom: .75rem;
}
.hm-stat {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: .8rem .6rem;
  display: flex; flex-direction: column; align-items: center;
  cursor: pointer; text-decoration: none; color: var(--fg);
  transition: border-color .15s, background .15s;
}
.hm-stat:hover { border-color: var(--accent-line); background: var(--bg-soft); }
.hm-stat b { font-size: 1.4rem; font-weight: 800; color: var(--accent-ink); line-height: 1; }
.hm-stat span { font-size: .65rem; color: var(--muted); margin-top: .25rem; text-align: center; }

/* 2-col row: actions + events */
/* Tableau de bord : colonne flex qui remplit la hauteur ; la dernière rangée
   (Connexions / Activité) grandit pour occuper l'espace, le pied Milo reste en bas. */
.hm-dashboard { padding-bottom: .5rem; display: flex; flex-direction: column; overflow-y: auto; }
.hm-dashboard > .hm-row:last-of-type { flex: 1 1 auto; min-height: 0; }
.hm-dashboard > .hm-row:last-of-type .hm-section { min-height: 0; }
.hm-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: .75rem;
  margin-bottom: .75rem;
}
/* Container queries (2026) : les grilles du tableau de bord répondent à la largeur
   de la COLONNE (.col a container-type:inline-size), pas du viewport. */
@container (max-width: 600px) { .hm-row { grid-template-columns: 1fr; } }
@container (max-width: 440px) { .hm-stats { grid-template-columns: 1fr 1fr; } }

/* Section cards */
.hm-section {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--tab-radius); padding: 1rem;
  box-shadow: var(--elev-1);
}
.hm-section-title {
  font-size: .72rem; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted);
  margin: 0 0 .75rem; display: flex; align-items: center; justify-content: space-between;
}
.hm-section-title a { font-size: .75rem; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--accent-ink); text-decoration: none; }

/* Actions grid dans la home (3 lignes × 2 col) */
.hm-actions-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: .5rem;
}
.hm-action-btn {
  display: flex; align-items: center; gap: .6rem;
  padding: .65rem .75rem; border-radius: var(--r-md);
  background: var(--bg-soft); border: 1px solid var(--line);
  cursor: pointer; text-decoration: none; color: var(--fg);
  font-size: .82rem; font-weight: 500;
  transition: border-color .15s, background .15s;
}
.hm-action-btn:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.hm-action-ic {
  width: 32px; height: 32px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  flex: none; color: #fff;
  /* Petites « tuiles d'app » façon Teams/iOS : relief + liseré interne discret. */
  box-shadow: var(--elev-1), inset 0 1px 0 rgba(255, 255, 255, .22);
}

/* Events list in home */
.hm-events { display: flex; flex-direction: column; gap: .5rem; }
.hm-event {
  display: flex; gap: .6rem; align-items: flex-start;
  padding: .5rem .6rem; border-radius: var(--r-md);
  background: var(--bg-soft); border: 1px solid var(--line);
}
.hm-event-date {
  flex: none; background: var(--accent-soft); color: var(--accent-ink);
  border-radius: var(--r-sm); padding: .3rem .5rem; text-align: center;
  min-width: 38px;
}
.hm-event-day { font-size: 1.1rem; font-weight: 800; line-height: 1; }
.hm-event-mon { font-size: .6rem; font-weight: 600; text-transform: uppercase; }
.hm-event-info { min-width: 0; flex: 1; }
.hm-event-title { font-weight: 600; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-event-meta { font-size: .72rem; color: var(--muted); margin-top: .1rem; }
.hm-empty { color: var(--muted); font-size: .84rem; text-align: center; padding: 1rem 0; }

/* Contacts list in home */
.hm-contacts { display: flex; flex-direction: column; gap: .3rem; }
.hm-contact {
  display: flex; align-items: center; gap: .7rem;
  padding: .5rem .4rem; border-radius: var(--r-sm); cursor: pointer;
  text-decoration: none; color: var(--fg);
  transition: background .12s;
}
.hm-contact:hover { background: var(--bg-soft); }
.hm-contact-av {
  width: 34px; height: 34px; border-radius: 50%; overflow: hidden;
  background: var(--chip); flex: none; display: flex; align-items: center; justify-content: center;
  font-size: .9rem; font-weight: 700; color: var(--accent-ink);
}
.hm-contact-av img { width: 34px; height: 34px; object-fit: cover; border-radius: 50%; }
.hm-contact-name { font-weight: 600; font-size: .88rem; }
.hm-contact-meta { font-size: .72rem; color: var(--muted); }
.hm-contact-tag {
  margin-left: auto; flex: none;
  font-size: .65rem; padding: .1rem .4rem; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted);
}
.hm-contact-tag.amis { color: var(--success); border-color: rgba(127,220,160,.4); }
.hm-contact-tag.pro { color: var(--accent-ink); border-color: var(--accent-line); }

/* Notifs list in home */
.hm-notifs { display: flex; flex-direction: column; gap: .35rem; }
.hm-notif {
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem .4rem; border-radius: var(--r-sm);
  transition: background .12s;
}
.hm-notif:hover { background: var(--bg-soft); }
.hm-notif-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); flex: none; opacity: 0;
}
.hm-notif.unread .hm-notif-dot { opacity: 1; }
.hm-notif-text { flex: 1; font-size: .84rem; min-width: 0; }
.hm-notif-time { font-size: .7rem; color: var(--muted); flex: none; }

/* Requests pending banner */
.hm-requests-banner {
  display: flex; align-items: center; gap: .75rem;
  padding: .85rem 1rem; border-radius: var(--r-md);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid var(--accent-line);
  margin-bottom: .75rem; cursor: pointer;
}
.hm-requests-banner svg { color: var(--accent-ink); flex: none; }
.hm-requests-banner b { color: var(--accent-ink); font-size: .9rem; }
.hm-requests-banner span { color: var(--muted); font-size: .82rem; }

/* ===== ACCUEIL « linktr.ee » : aperçu page publique (gauche) + back-office (droite) ===== */
/* Hybride : colonne aperçu large, colonne coup d'œil plus étroite ; empilées en mobile. */
.hm-row-hybrid {
  grid-template-columns: 2fr 3fr;
  align-items: start;
}
@container (max-width: 760px) { .hm-row-hybrid { grid-template-columns: 1fr; } }

/* Carte d'aperçu public : contenu centré, façon « link in bio ». */
.hm-public { display: flex; flex-direction: column; }
.lt-inner { width: 100%; max-width: 440px; margin: 0 auto; display: flex; flex-direction: column; gap: 1rem; padding-top: .5rem; }

/* ===== Aperçu façon smartphone (colonne Accueil) =====
   La pile linktr.ee est rendue dans un châssis de téléphone, avec une image de
   couverture (champ « cover » sinon image par défaut, cf. home.js). */
.lt-phone {
  position: relative;
  width: 100%; max-width: 300px; margin: .25rem auto 0;
  aspect-ratio: 300 / 620;
  padding: 9px; border-radius: 40px;
  background: linear-gradient(165deg, #1b212b, #0a0c10);
  border: 1px solid #2b323d;
  box-shadow: 0 26px 60px -28px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.04) inset;
}
/* Encoche discrète : assez petite pour laisser voir le caméléon de la couverture. */
.lt-phone-notch {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  width: 62px; height: 18px; border-radius: 999px; background: #05070b; z-index: 5;
}
.lt-phone-screen {
  height: 100%; border-radius: 32px; overflow: hidden;
  background: #000; position: relative;
}
/* Couverture floutée persistante derrière TOUS les écrans (pseudo-élément).
   Écrans 2/3 la laissent transparaître via leur fond semi-transparent. */
.lt-phone-screen::before {
  content: ""; position: absolute; inset: -8px; z-index: 0;
  background: var(--lt-cover, none) center / cover no-repeat;
  filter: blur(22px) brightness(.55) saturate(1.2);
}
/* Les pastilles vivent dans .lt-phone-screen → overlay absolu en bas, centré. */
/* Carrousel horizontal d'écrans (swipe natif via scroll-snap). */
.lt-screens {
  display: flex; height: 100%;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.lt-screens::-webkit-scrollbar { display: none; }
.lt-screen {
  flex: 0 0 100%; width: 100%; height: 100%;
  scroll-snap-align: start;
  overflow-y: auto; overflow-x: hidden; scrollbar-width: none;
  position: relative; z-index: 1;
  background: transparent;
}
.lt-screen::-webkit-scrollbar { display: none; }
/* Écrans secondaires : fond verre dépoli sur la couverture floutée. */
.lt-screen--pad {
  padding: 2.4rem 1rem 2.5rem;
  background: rgba(12, 14, 18, .52);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.lt-screen-h { display: flex; align-items: center; gap: .5rem; font-weight: 800; font-size: 1.02rem; margin: 0 0 .9rem; color: #fff; }
.lt-screen-h svg { color: rgba(255,255,255,.8); }
/* Dans le châssis : la pile prend toute la largeur de l'écran, la couverture
   déborde jusqu'aux bords et l'avatar la chevauche. */
.lt-phone .lt-inner { max-width: none; margin: 0; padding: 0 0 1.1rem; gap: 1rem; height: auto; position: relative; }

/* Écran d'accueil : couverture plein écran + identité en overlay bas. */
.lt-screen--cover { position: relative; overflow: hidden; }
.lt-cover-full {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  z-index: 0;
}
/* Dégradé bas → lisibilité du texte sur la photo. */
.lt-cover-full::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.72) 0%, rgba(0,0,0,.18) 55%, transparent 100%);
}
/* Identité en bas de la couverture (texte blanc sur gradient sombre). */
.lt-identity {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 2;
  padding: 1.2rem 1rem 1.1rem;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: .18rem;
  color: #fff;
}
.lt-screen--cover .lt-name  { color: #fff; font-size: 1.15rem; font-weight: 800; }
.lt-screen--cover .lt-handle { color: rgba(255,255,255,.75); font-size: .88rem; }
.lt-screen--cover .lt-role   { color: rgba(255,255,255,.65); font-size: .82rem; }
.lt-screen--cover .lt-loc    { color: rgba(255,255,255,.6);  font-size: .78rem; }

/* Accès discret au QR code, posé en haut à droite (par-dessus la couverture). */
.lt-qr {
  position: absolute; top: .55rem; right: .55rem; z-index: 4;
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(0,0,0,.45); color: #fff;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  transition: background var(--dur) var(--ease-out);
}
.lt-qr:hover { background: rgba(0,0,0,.62); }
.lt-qr:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* CTA de prise de RDV, sur l'écran Calendrier. */
.lt-book { width: 100%; justify-content: center; margin-top: 1rem; }
.lt-phone .lt-links { padding-inline: 1rem; }

/* Pastilles de pagination sous le téléphone. */
.lt-dots {
  position: absolute; bottom: 12px; left: 0; right: 0; z-index: 10;
  display: flex; justify-content: center; gap: 6px;
  pointer-events: none;
}
.lt-dot {
  width: 7px; height: 7px; border-radius: 50%; padding: 0; border: 0; cursor: pointer;
  pointer-events: auto;
  background: rgba(255,255,255,.45);
  box-shadow: 0 1px 3px rgba(0,0,0,.4);
  transition: background var(--dur) var(--ease-out), transform var(--dur) var(--ease-out), width var(--dur) var(--ease-out);
}
.lt-dot.is-on { background: #fff; width: 18px; border-radius: 999px; transform: none; }
.lt-dot:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Téléphone + toggles côte à côte dans la section aperçu. */
/* Téléphone + contrôles côte à côte. Sur conteneur étroit (< 760px) le téléphone
   est réduit à 130px (≈270px de haut) pour ne pas écraser la section sous lui.
   Sur conteneur large le max-width 300px reste actif (défini dans .lt-phone). */
.lt-phone-cols { display: flex; align-items: flex-start; gap: 1rem; flex-wrap: nowrap; }
.lt-phone-cols .lt-phone { margin: .25rem 0 0; flex: none; }
.lt-controls { flex: 1; min-width: 0; max-width: none; margin: 0; }
.lt-phone-cols .lt-config { border-top: none; padding-top: 0; }
/* Conteneur étroit : téléphone compact (130px ≈ 270px de haut) */
@container (max-width: 760px) {
  .lt-phone-cols .lt-phone { width: 130px; max-width: 130px; }
}
/* Très étroit (mobile ≤440px) : empile le téléphone au-dessus des contrôles */
@container (max-width: 440px) {
  .lt-phone-cols { flex-direction: column; align-items: center; }
  .lt-phone-cols .lt-phone { width: 200px; max-width: 200px; }
  .lt-controls { width: 100%; }
}

/* Mini-calendrier autonome de l'écran « Calendrier ». */
.lt-cal-month { font-size: .82rem; font-weight: 700; color: rgba(255,255,255,.6); text-transform: capitalize; margin-bottom: .5rem; }
.lt-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.lt-cal-dow { text-align: center; font-size: .62rem; font-weight: 700; color: rgba(255,255,255,.45); padding-bottom: .2rem; }
.lt-cal-cell {
  position: relative; aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  font-size: .72rem; color: rgba(255,255,255,.85); border-radius: var(--r-sm, 7px);
}
.lt-cal-cell.is-today { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.lt-cal-cell.has-evt:not(.is-today) { color: #fff; font-weight: 700; }
.lt-cal-dot { position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.lt-cal-cell.is-today .lt-cal-dot { background: var(--on-accent); }
.lt-cal-next { margin-top: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.lt-empty { color: rgba(255,255,255,.5); font-size: .85rem; text-align: center; margin: 1.2rem 0; }
.lt-gallery-slot .gal-grid { grid-template-columns: repeat(3, 1fr); }

.lt-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .15rem; }
.lt-av { width: 96px; height: 96px; margin-bottom: .5rem; }
.lt-av .photo { width: 96px; height: 96px; border-radius: 50%; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.lt-av .photo img, .lt-av .photo svg, .lt-av .photo .avatar-gen { width: 96px; height: 96px; object-fit: cover; border-radius: 50%; display: block; }
/* Anneau discret autour de l'avatar (détachement façon Teams/roster). */
.lt-av .photo { box-shadow: 0 0 0 3px var(--card), 0 0 0 4px var(--line), var(--elev-1); }
.lt-name { font-weight: 800; font-size: 1.2rem; line-height: 1.2; }
.lt-handle { color: var(--muted); font-size: .9rem; }
.lt-role { font-size: .85rem; color: var(--fg); opacity: .8; margin-top: .15rem; }
.lt-loc { font-size: .78rem; color: var(--muted); }
.lt-head .hm-badges { justify-content: center; margin-top: .5rem; }

/* Pile de liens : gros boutons pleine largeur, icône + libellé + chevron. */
.lt-links { display: flex; flex-direction: column; gap: .55rem; }
.lt-link {
  display: flex; align-items: center; gap: .75rem;
  width: 100%; padding: .7rem .85rem; font: inherit; font-weight: 600; font-size: .92rem;
  text-align: left; text-decoration: none; cursor: pointer;
  color: var(--fg); background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--elev-1);
  transition: transform .12s ease, border-color .15s, background .15s, box-shadow .15s;
}
.lt-link:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--lt-brand, var(--accent)) 55%, var(--line));
  box-shadow: var(--elev-2);
}
.lt-link:active { transform: translateY(0); }
.lt-link-ic {
  flex: none; width: 34px; height: 34px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--lt-brand, var(--accent-ink));
  background: color-mix(in srgb, var(--lt-brand, var(--accent)) 16%, transparent);
}
.lt-link-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt-link-ext { color: var(--muted); font-size: .9rem; flex: none; }
.lt-link-go { color: var(--muted); display: inline-flex; flex: none; transition: transform .15s; }
.lt-link:hover .lt-link-go { transform: translateX(2px); color: var(--accent-ink); }
/* « Modifier ma carte » : action de gestion, plus discrète que les liens publics. */
.lt-link-muted { background: transparent; box-shadow: none; border-style: dashed; font-weight: 500; }
.lt-link-muted .lt-link-ic { background: var(--chip); color: var(--muted); }
.lt-link-muted:hover { box-shadow: var(--elev-1); }

/* Bloc de configuration « visible publiquement ». */
.lt-config { border-top: 1px solid var(--line); padding-top: .9rem; display: flex; flex-direction: column; gap: .6rem; }
.lt-config-title { font-size: .68rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.lt-tour {
  align-self: center; margin-top: .2rem; padding: .4rem .9rem; font: inherit; font-size: .82rem; font-weight: 500;
  color: var(--muted); background: none; border: 1px solid var(--line); border-radius: var(--r-pill); cursor: pointer;
  transition: border-color .15s, color .15s;
}
.lt-tour:hover { border-color: var(--accent-ink); color: var(--accent-ink); }

/* Colonne droite : pile de cartes back-office. */
.hm-aside { display: flex; flex-direction: column; gap: .75rem; }
.hm-aside .hm-section { margin: 0; }
/* Section sous-onglets Compte dans l'aside : pas de card wrapper (les panels ont leur propre style). */
.hm-section--tabs { background: none; border: none; padding: 0; box-shadow: none; }
/* opt-v2-grid dans l'aside : toujours 1 colonne (pas assez de place pour 2). */
.hm-aside .opt-v2-grid { grid-template-columns: 1fr; }

@media (prefers-reduced-motion: reduce) {
  .lt-link, .lt-link-go { transition: border-color .15s, background .15s; }
  .lt-link:hover { transform: none; }
  .lt-link:hover .lt-link-go { transform: none; }
}
/* — Accès direct à l'Espace Premium (top de l'aside du dashboard) — */
.hm-space-card {
  display: flex; align-items: center; gap: .75rem;
  padding: .9rem 1.1rem;
  border-radius: var(--radius, 12px);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, var(--surface)), color-mix(in srgb, var(--accent) 6%, var(--surface)));
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  color: inherit; text-decoration: none;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.hm-space-card:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--accent) 18%, transparent);
}
.hm-space-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 25%, transparent);
  color: var(--accent-ink); flex-shrink: 0;
}
.hm-space-body { display: flex; flex-direction: column; line-height: 1.3; flex: 1; min-width: 0; }
.hm-space-body b { font-size: .98rem; }
.hm-space-body span { font-size: .8rem; color: var(--muted); }
.hm-space-arrow { font-size: 1.4rem; opacity: .55; flex-shrink: 0; }
.hm-space-card:hover .hm-space-arrow { opacity: 1; transform: translateX(2px); }

/* — Bloc premium dédié (aside) — */
.hm-prem-card {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, var(--surface)), var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: var(--radius, 12px);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.hm-prem-card--active {
  flex-direction: row;
  align-items: center;
  gap: .65rem;
}
.hm-prem-hd {
  display: flex;
  align-items: center;
  gap: .6rem;
}
.hm-prem-ic { color: var(--accent); flex-shrink: 0; }
.hm-prem-title { font-weight: 700; font-size: .88rem; color: var(--text); }
.hm-prem-sub { font-size: .76rem; color: var(--muted); margin-top: .1rem; }
.hm-prem-features {
  list-style: none;
  padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: .25rem;
}
.hm-prem-features li {
  font-size: .8rem; color: var(--muted);
  padding-left: 1.1rem; position: relative;
}
.hm-prem-features li::before { content: "✓"; color: var(--accent); font-weight: 700; position: absolute; left: 0; }

/* — Activité récente (lignes typées) — */
.hm-activity { display: flex; flex-direction: column; gap: .35rem; }
.hm-act-row {
  display: flex; align-items: flex-start; gap: .5rem;
  padding: .35rem .4rem; border-radius: 6px;
  font-size: .82rem; color: var(--muted);
}
.hm-act-row.unread { color: var(--text); }
.hm-act-ic {
  flex-shrink: 0; width: 1.4rem; height: 1.4rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--chip); font-size: .75rem;
}
.hm-act-ic--subscription { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }
.hm-act-ic--meeting      { background: rgba(127,220,160,.12); color: var(--success); }
.hm-act-ic--message,
.hm-act-ic--call         { background: rgba(100,160,255,.12); color: #64a0ff; }
.hm-act-ic--like         { background: rgba(255,100,130,.12); color: #ff6482; }
.hm-act-text { flex: 1; line-height: 1.4; }

/* ===== fin ACCUEIL linktr.ee ===== */

/* — Sidebar : séparateur + boutons action (Discuter, Appel) — */
/* ===== MON COMPTE (acc-*) ===== */
.acc-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
/* En-tête identité */
.acc-hero {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.acc-av {
  width: 52px; height: 52px; border-radius: 50%;
  overflow: hidden; flex-shrink: 0;
  background: var(--chip);
  display: flex; align-items: center; justify-content: center;
  position: relative; cursor: pointer;
}
.acc-av-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.5); font-size: 1.1rem;
  opacity: 0; transition: opacity .15s;
}
.acc-av:hover .acc-av-overlay { opacity: 1; }
.acc-av-img { width: 100%; height: 100%; object-fit: cover; }
.acc-av-init { font-size: 1.3rem; font-weight: 700; color: var(--muted); }
.acc-hero-body { flex: 1; min-width: 0; }
.acc-hero-name { font-weight: 700; font-size: 1rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-hero-handle { font-size: .82rem; color: var(--muted); }
.acc-hero-role { font-size: .78rem; color: var(--muted); margin-top: .1rem; }
/* Bandeau abonnement — toujours visible au-dessus des onglets */
.acc-sub-banner {
  display: flex; align-items: center; gap: .65rem;
  padding: .6rem .85rem; border-radius: var(--r-md);
  border: 1px solid var(--line);
  margin: 0 10px;
}
/* Séparateur fin dans le subrail vertical (entre accès rapides et onglets). */
.subrail-sep { display: block; height: 1px; margin: .35rem .6rem; background: var(--line); }
.acc-sub-banner--free {
  background: color-mix(in srgb, var(--accent) 8%, var(--card));
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
}
.acc-sub-banner--premium {
  background: color-mix(in srgb, #f5c518 6%, var(--card));
  border-color: color-mix(in srgb, #f5c518 30%, var(--line));
}
.acc-sub-banner-ic { flex-shrink: 0; color: var(--accent-ink); }
.acc-sub-banner--premium .acc-sub-banner-ic { color: #f5c518; }
.acc-sub-banner-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.acc-sub-banner-body b { font-size: .85rem; }
.acc-sub-banner-body span { font-size: .75rem; color: var(--muted); }
/* Badge plan */
.acc-plan-badge {
  flex-shrink: 0;
  font-size: .72rem; font-weight: 600; letter-spacing: .02em;
  padding: .2rem .55rem; border-radius: 99px;
  background: var(--chip); color: var(--muted); border: 1px solid var(--line);
}
.acc-plan-badge.premium { background: var(--accent); color: #0b0d12; border-color: transparent; }
.acc-publink { font-size: .72rem !important; padding: .18rem .5rem !important; flex-shrink: 0; }
/* Onglet « À propos » — liens légaux + licences open source */
.acc-legal-links { display: flex; gap: .4rem; flex-wrap: wrap; }
.acc-legal-links .btn { font-size: .78rem; }
.acc-version {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .78rem; color: var(--muted);
  padding: .15rem .55rem; border: 1px solid var(--line); border-radius: 999px;
}
.acc-version b { color: var(--fg); font-variant-numeric: tabular-nums; }
.acc-version svg { color: var(--accent-ink); }
.acc-licenses {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: .25rem;
  font-size: .8rem; line-height: 1.45; color: var(--text);
}
.acc-licenses li {
  padding: .35rem .55rem;
  background: color-mix(in srgb, var(--text) 3%, transparent);
  border-radius: var(--r-sm, 6px);
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.acc-licenses li b { font-weight: 600; }
.acc-licenses li em {
  font-style: normal; color: var(--muted); font-size: .74rem;
  margin-left: .3rem; white-space: nowrap;
}
/* Blocs section */
.acc-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius, 12px);
  padding: 1rem 1.1rem;
  display: flex; flex-direction: column; gap: .6rem;
}
.acc-block-last { /* pas de style particulier, juste un repère sémantique */ }
.acc-block-title {
  font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); display: flex; align-items: center; gap: .35rem;
  margin-bottom: .15rem;
}
/* Paire clé/valeur */
.acc-kv { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; font-size: .84rem; }
.acc-kv-k { color: var(--muted); flex-shrink: 0; }
.acc-kv-v { color: var(--text); text-align: right; }
.acc-missing { font-style: italic; color: var(--muted); }
/* Promo premium */
.acc-promo-text { font-size: .84rem; color: var(--muted); line-height: 1.5; margin: 0; }
.acc-upgrade-full { width: 100%; justify-content: center; }
/* Avertissement paiement en échec */
.acc-warn {
  display: flex; align-items: center; gap: .5rem;
  background: rgba(255,100,100,.08); border: 1px solid rgba(255,100,100,.25);
  border-radius: 8px; padding: .55rem .75rem;
  font-size: .82rem; color: var(--danger, #ff6464);
}
/* Status E2E (identique à opt-v2-e2e-status) */
.acc-e2e-status {
  display: flex; align-items: flex-start; gap: .65rem;
  border-radius: 8px; padding: .65rem .8rem;
  font-size: .82rem;
}
.acc-e2e-status.ok  { background: rgba(127,220,160,.08); border: 1px solid rgba(127,220,160,.25); color: var(--success, #7fdca0); }
.acc-e2e-status.warn { background: rgba(255,180,60,.08); border: 1px solid rgba(255,180,60,.25); color: #ffb43c; }
.acc-e2e-status b { display: block; margin-bottom: .15rem; color: var(--text); }
.acc-e2e-status p { margin: 0; color: var(--muted); line-height: 1.4; }
/* Rangée de boutons */
.acc-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
/* ===== fin MON COMPTE ===== */

.bnav-divider {
  height: 1px;
  background: var(--line);
  margin: .4rem .75rem;
}
/* Masquer séparateur et boutons action sur mobile (ils sont dans les actions rapides) */
@media (max-width: 839px) {
  .bnav-divider, .bnav-action-btn { display: none; }
}
/* Sur desktop, les boutons action ont une légère teinte accent */
@media (min-width: 840px) {
  .bnav-action-btn { color: var(--muted); }
  .bnav-action-btn:hover { color: var(--accent-ink); background: var(--accent-soft); }
}
/* ===== RECTILINÉAIRE : supprime les arondis partout ===== */
:root {
  --radius: 0px;
  --tab-radius: 0px;
}
*, *::before, *::after {
  border-radius: 0 !important;
}
/* Exceptions légitimes (UX : switch, avatar, badge sont circulaires par convention) */
.hm-toggle-sw,
.hm-toggle-sw::after,
.hm-av, .hm-av img, .hm-contact-av, .hm-contact-av img,
.comm-av, .comm-av img, .comm-av span,
.avatar, .profile-chip-av, .profile-chip-av img,
.av, .av img, .bnav-badge, .menu-badge, .notif-badge,
.hm-badge, .tab-count, .badge, .badge-sm,
.profile-chip { border-radius: 999px !important; }
/* Avatar demi-rond */
.photo, .photo img { border-radius: 50% !important; }
/* ===== END RECTILINÉAIRE ===== */

/* ===== ONGLET OPTIONS ===== */
.opt-v2 { padding: 1.25rem !important; }
.opt-v2-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
/* Container query : répond à la largeur de la colonne Options, pas du viewport. */
@container (max-width: 640px) { .opt-v2-grid { grid-template-columns: 1fr; } }

.opt-v2-block {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 1rem;
}
.opt-v2-account { grid-column: 1 / -1; }
.opt-v2-block--full { grid-column: 1 / -1; }
.opt-swatches { display: flex; flex-wrap: wrap; gap: .55rem; }
.opt-swatches .swatch { width: 26px; height: 26px; }
.opt-v2-search-wrap { margin-bottom: .75rem; }
.opt-search {
  width: 100%; padding: .45rem .75rem; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--inset); color: var(--fg);
  font: inherit; font-size: .875rem; box-sizing: border-box;
}
.opt-search:focus { outline: none; border-color: var(--accent-line); }
.opt-v2-block[hidden] { display: none; }
.opt-v2-dev { border-color: color-mix(in srgb, var(--accent-ink) 40%, var(--line)); background: color-mix(in srgb, var(--accent) 6%, var(--bg-soft)); }
.opt-dev-badge { font-size: .65rem; font-weight: 700; letter-spacing: .08em; padding: .1rem .35rem; border-radius: 4px; background: var(--accent); color: var(--on-accent); margin-left: .3rem; text-transform: uppercase; vertical-align: middle; }
.opt-v2-dev .opt-name { display: flex; align-items: center; gap: .3rem; }
.opt-v2-dev .opt-desc code { font-family: var(--mono); font-size: .75em; color: var(--accent-ink); }

/* Dev : abonnements simulés à des espaces premium */
.opt-dev-subs { margin-top: 1rem; padding-top: .8rem; border-top: 1px dashed color-mix(in srgb, var(--accent-ink) 20%, var(--line)); }
.opt-dev-list { list-style: none; margin: .2rem 0 .6rem; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
.opt-dev-sub-row {
  display: flex; align-items: center; gap: .6rem;
  padding: .4rem .6rem; border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--accent) 5%, var(--bg-soft));
}
.opt-dev-sub-row a { font-weight: 600; text-decoration: none; }
.opt-dev-sub-row .lbl-sm { margin-left: auto; opacity: .7; }
.opt-dev-sub-add { display: flex; gap: .4rem; }
.opt-dev-sub-add input[type="text"] {
  flex: 1; padding: .4rem .6rem; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--bg); color: inherit; font-size: .9rem;
}
.opt-dev-sub-add input[type="text"]:focus { outline: none; border-color: var(--accent-line); }

.opt-v2-head {
  display: flex; align-items: center; gap: .45rem;
  font-size: .78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); margin-bottom: .85rem;
}

.opt-v2-security { display: flex; flex-direction: column; gap: .75rem; }
.opt-v2-e2e-status {
  display: flex; align-items: flex-start; gap: .7rem;
  padding: .75rem; border-radius: var(--r-md);
}
.opt-v2-e2e-status.ok  { background: rgba(127,220,160,.1); border: 1px solid rgba(127,220,160,.3); }
.opt-v2-e2e-status.warn{ background: rgba(251,191,36,.08); border: 1px solid rgba(251,191,36,.3); }
.opt-v2-e2e-status.ok svg  { color: var(--success); }
.opt-v2-e2e-status.warn svg { color: #fbbf24; }
.opt-v2-e2e-status b   { font-size: .84rem; display: block; }
.opt-v2-e2e-status p   { font-size: .74rem; color: var(--muted); margin: .2rem 0 0; }

.opt-v2-account-actions {
  display: flex; flex-wrap: wrap; gap: .5rem;
}
.opt-v2-account-actions .btn.danger { margin-left: auto; }

/* Accès & Appareils : 2 colonnes dans les blocs pleine largeur */
.opt-v2-access-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem;
}
@container (max-width: 600px) { .opt-v2-access-grid { grid-template-columns: 1fr; } }
.opt-v2-access-col { display: flex; flex-direction: column; }

/* Danger block */
.opt-v2-danger-block { border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
/* ===== END ONGLET OPTIONS ===== */
/* ===== COMMUNICATIONS (WhatsApp-like 2-col) ===== */
/* Conteneur externe : garde le padding du deck (respiration visuelle) */
.comm-wrapper {
  /* Hauteur explicite (cross-browser) — Firefox ne résout pas fiablement
     flex:1 dans une chaîne flex imbriquée avec min-height:0. */
  flex: none;
  height: var(--col-h);
  overflow: hidden;
  container-type: inline-size;
  container-name: comms;
}
.comm-layout {
  display: grid;
  /* 3 colonnes : rail vertical (sous-modes) | liste fluide | conv/pane droit.
     Le rail est fixe à 56px, la liste s'adapte (30% de l'espace clampé), le
     reste va à la conv. */
  grid-template-columns: 56px clamp(240px, 30%, 320px) 1fr;
  height: 100%;
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--card);
}
/* Panneau étroit : master-detail (une vue à la fois) piloté par container query.
   Par défaut on voit la LISTE ; dès qu'une conversation est montée dans
   #comm-right (présence d'une .chat-card), elle prend tout l'espace et la liste
   s'efface. La croix de la conversation sert alors de « retour à la liste »
   (elle appelle host.closeDeckColumn → #comm-right repasse à l'état vide). */
@container comms (max-width: 600px) {
  /* Mobile : rail toujours visible (63px), sidebar OU conv en plein écran. */
  .comm-layout { grid-template-columns: 63px 1fr; }
  .comm-right { display: none; }
  .comm-layout:has(#comm-right .chat-card) .comm-sidebar,
  .comm-layout:has(#comm-right .comm-iframe-wrap) .comm-sidebar,
  .comm-layout:has(#comm-right .comm-form-pane) .comm-sidebar { display: none; }
  .comm-layout:has(#comm-right .chat-card) .comm-right,
  .comm-layout:has(#comm-right .comm-iframe-wrap) .comm-right,
  .comm-layout:has(#comm-right .comm-form-pane) .comm-right { display: flex; }
  .comm-layout:has(#comm-right .chat-card) .comm-right .chat-card .close {
    display: inline-flex !important;
    top: .3rem !important;
    right: .3rem !important;
    width: 26px !important;
    height: 26px !important;
    font-size: .85rem !important;
  }
  /* Chat header : nom en 1re ligne, boutons alignés en dessous + espace pour le × */
  .comm-right .chat-head {
    flex-wrap: wrap !important;
    padding-right: 2.4rem !important;
  }
  /* Chat form : boutons plus compacts → plus d'espace pour le champ texte */
  .comm-right .chat-form { gap: .3rem !important; }
  .comm-right .chat-actions .btn,
  .comm-right .chat-input-row .btn { padding: .3rem .45rem !important; font-size: .82rem !important; }
}
/* Pas de conversation montée → on masque le pane droit (placeholder inutile)
   et la sidebar prend toute la largeur restante. Le placeholder ne s'affiche
   plus du tout : on ne le voit que le temps que rien ne soit sélectionné, ce
   qui produit un « bloc noir » disgracieux à côté d'une liste vide. */
.comm-layout:not(:has(#comm-right .chat-card)):not(:has(#comm-right .comm-iframe-wrap)):not(:has(#comm-right .comm-form-pane)) {
  grid-template-columns: 56px 1fr;
}
.comm-layout:not(:has(#comm-right .chat-card)):not(:has(#comm-right .comm-iframe-wrap)):not(:has(#comm-right .comm-form-pane)) .comm-right {
  display: none;
}
@container comms (max-width: 600px) {
  .comm-layout:not(:has(#comm-right .chat-card)):not(:has(#comm-right .comm-iframe-wrap)):not(:has(#comm-right .comm-form-pane)) {
    grid-template-columns: 63px 1fr;
  }
}
/* Barre gauche */
.comm-sidebar {
  display: flex; flex-direction: column;
  border-right: 1px solid var(--line);
  overflow: hidden;
}
.comm-topbar {
  padding: .75rem 1rem;
  font-weight: 700; font-size: .95rem;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.comm-search-wrap {
  padding: .5rem .75rem;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.comm-search-wrap input {
  width: 100%; background: var(--bg-soft);
  border: 1px solid var(--line); padding: .45rem .7rem;
  font: inherit; color: var(--fg); font-size: .84rem;
}
.comm-search-wrap input:focus { outline: none; border-color: var(--accent-ink); }
/* Liste de contacts */
.comm-contacts-list {
  flex: 1; overflow-y: auto; overflow-x: hidden;
}
.comm-contact-item {
  display: flex; align-items: center; gap: .65rem;
  padding: .65rem .85rem; cursor: pointer;
  border-bottom: 1px solid var(--line);
  transition: background .12s;
}
.comm-contact-item:hover { background: var(--bg-soft); }
.comm-contact-item.selected { background: var(--accent-soft); }
.comm-av {
  width: 38px; height: 38px; flex: none;
  position: relative; display: flex;
  align-items: center; justify-content: center;
  border-radius: 50%; overflow: hidden;
}
.comm-av .comm-av-init {
  width: 100%; height: 100%; display: flex;
  align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 700;
}
.comm-av img, .comm-av .comm-av-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.comm-contact-body { flex: 1; min-width: 0; }
.comm-contact-name { font-weight: 600; font-size: .87rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.comm-contact-sub { font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.comm-contact-meta { display: flex; flex-direction: column; align-items: flex-end; gap: .2rem; flex: none; }
.comm-unread { background: var(--accent); color: #0b0d12; font-size: .65rem; font-weight: 700; padding: .1rem .35rem; min-width: 18px; text-align: center; }
.comm-time { font-size: .68rem; color: var(--muted); }
.comm-sep { padding: .35rem .85rem; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--bg-soft); border-bottom: 1px solid var(--line); }

/* ── Rail vertical (sous-modes Chat, style WhatsApp Desktop) ─────────────
   Bande de 56px à gauche de la sidebar contenant un bouton par sous-mode
   (Discussions, Groupes…). Le mode actif est marqué par un accent vertical
   et un fond contrasté. Les libellés sous l'icône restent visibles : un
   rail muet (icon-only) est moins lisible qu'on ne croit. */
.comm-rail {
  flex: none; width: 56px;
  display: flex; flex-direction: column;
  background: var(--bg-soft); border-right: 1px solid var(--line);
  padding: .4rem 0; gap: .2rem;
}
.comm-rail-btn {
  position: relative;
  width: 100%; min-height: 56px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .15rem; padding: .35rem .25rem;
  background: transparent; border: 0; color: var(--muted);
  cursor: pointer; transition: background .12s, color .12s;
  font: inherit;
}
.comm-rail-btn svg { width: 22px; height: 22px; }
.comm-rail-label {
  font-size: .58rem; font-weight: 600; letter-spacing: .02em;
  line-height: 1.1; white-space: nowrap;
}
.comm-rail-btn:hover { background: var(--bg); color: var(--fg); }
.comm-rail-btn:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: -2px; }
.comm-rail-btn.is-active {
  color: var(--accent-ink); background: var(--accent-soft);
}
.comm-rail-badge {
  position: absolute; top: 6px; right: 8px;
  min-width: 18px; height: 16px; padding: 0 .25rem;
  background: var(--danger); color: #fff;
  font-size: .62rem; font-weight: 700; line-height: 16px; text-align: center;
}
/* Vue « Relations » (demandes entrantes à réciproquer) dans la sidebar Échanges. */
.comm-relations-host { height: 100%; overflow-y: auto; }
.comm-relations-intro { padding: .75rem .9rem .25rem; margin: 0; line-height: 1.5; color: var(--muted); }
.comm-relations-list { list-style: none; margin: 0; padding: .4rem .6rem .8rem; }
@media (max-width: 640px) {
  /* Sur mobile, on resserre le rail mais on garde le label : la sidebar passe
     en plein écran quand un mode est actif. */
  .comm-rail { width: 63px; }
  .comm-rail-btn { min-height: 48px; padding: .25rem .15rem; }
  .comm-rail-btn svg { width: 20px; height: 20px; }
  .comm-rail-label { font-size: .55rem; }
}

/* Vues swappables : une seule visible à la fois ; chacune prend tout le reste de la sidebar. */
.comm-view { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.comm-view[hidden] { display: none; }
.comm-groups-list { flex: 1; overflow-y: auto; overflow-x: hidden; }
/* Hôte du plugin Live : on neutralise le wrapper .card (bordure, padding) du
   plugin pour qu'il s'intègre proprement dans la sidebar étroite. Le scroll est
   géré par le conteneur. */
.comm-live-host { flex: 1; overflow-y: auto; overflow-x: hidden; }
.comm-live-host .live-col {
  border: 0; box-shadow: none; background: transparent;
  padding: .75rem .85rem;
}
.comm-live-host .live-col-h h2 { font-size: 1rem; }
.comm-live-host .live-col-body { gap: .85rem; margin-top: .75rem; }

/* ── Subrail vertical générique ──────────────────────────────────────────
   Pattern réutilisable (Agenda, Compte, …) : rail icône-label à gauche, body
   à droite. Reprend l'esthétique de .comm-rail des Échanges. Les classes
   spécifiques (.agenda-tab/.opt-tab) restent inchangées pour ne pas casser le
   wiring existant ; .subrail-btn fournit la nouvelle apparence. */
.subrail-card {
  /* flex-direction: row !important — la règle générique
     `.deck .col > .card { display: flex; flex-direction: column }` (l. 2961)
     a une spécificité supérieure et force la column quand la card est fille
     directe d'une colonne du deck (cas de l'onglet Agenda). On la rétablit
     en row pour que le rail soit À CÔTÉ du body, pas dessus. */
  display: flex !important; flex-direction: row !important;
  align-items: stretch; padding: 0 !important; min-height: 0; overflow: hidden;
}
.subrail {
  /* align-self: stretch (par défaut) → le rail occupe toute la hauteur du
     subrail-card pour que la bande bg-soft s'aligne visuellement sur la
     hauteur du panel (sinon, décalage entre fin du rail et fin du panel). */
  flex: none; width: 56px;
  display: flex; flex-direction: column;
  background: var(--bg-soft); border-right: 1px solid var(--line);
  padding: .4rem 0; gap: .2rem;
}
.subrail-btn {
  /* flex: 0 0 auto → annule un éventuel flex:1 hérité de .agenda-tab/.opt-tab
     (anciens onglets horizontaux où chaque bouton prenait 1fr). Sur un rail
     vertical, on veut des boutons de hauteur fixe (min-height: 56px). */
  flex: 0 0 auto;
  position: relative;
  width: 100%; min-height: 56px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .15rem; padding: .35rem .25rem;
  background: transparent; border: 0; border-radius: 0; color: var(--muted);
  cursor: pointer; transition: background .12s, color .12s;
  font: inherit; font-size: inherit;
}
.subrail-btn svg { width: 22px; height: 22px; }
.subrail-label {
  font-size: .58rem; font-weight: 600; letter-spacing: .02em;
  line-height: 1.1; white-space: nowrap;
}
.subrail-btn:hover { background: var(--bg); color: var(--fg); }
.subrail-btn:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: -2px; }
.subrail-btn.active,
.subrail-btn.is-active {
  color: var(--accent-ink); background: var(--accent-soft);
  /* Annule l'effet pillule (border-radius + box-shadow) hérité de l'ancien
     style .agenda-tab.active / .opt-tab.active — sur un rail vertical, la
     surbrillance pleine largeur est plus lisible. */
  border-radius: 0; box-shadow: none;
}
/* Couleur danger sur Données : visible même au repos (opacité réduite), pleine
   teinte à l'activation — comportement héritage de .opt-tab-danger. */
.subrail-btn.opt-tab-danger { color: var(--danger, #ef4444); opacity: .65; }
.subrail-btn.opt-tab-danger:hover { opacity: .9; }
.subrail-btn.opt-tab-danger.active,
.subrail-btn.opt-tab-danger.is-active { color: var(--danger, #ef4444); opacity: 1; background: color-mix(in srgb, var(--danger, #ef4444) 14%, transparent); }
/* Onglet Premium (upsell) : teinte accent pour le mettre en avant. */
.subrail-btn.opt-tab-premium { color: var(--accent-ink); }
.subrail-btn.opt-tab-premium.active,
.subrail-btn.opt-tab-premium.is-active { color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.subrail-badge {
  position: absolute; top: 6px; right: 8px;
  min-width: 18px; height: 16px; padding: 0 .25rem;
  background: var(--danger); color: #fff;
  font-size: .62rem; font-weight: 700; line-height: 16px; text-align: center;
}
.subrail-body {
  flex: 1; min-width: 0; min-height: 0;
  overflow: hidden;
  display: flex; flex-direction: column;
}
/* Scroll uniquement quand la subrail-body est en mode "scroll" (ex. Compte
   inside hm-section). Pour Agenda, le col-scroll interne gère le scroll. */
.subrail-body { overflow-y: auto; }
/* Badge « doux » (compteur informatif, ex. nb de contacts) — moins criard que
   le badge accent des notifications. */
.subrail-badge.subrail-badge-soft { background: var(--chip); color: var(--muted); font-weight: 600; }

/* ---- Carnet de contacts (vue Contacts du Réseau) ---- */
.contacts-book { display: flex; flex-direction: column; gap: .4rem; }
.contact-card {
  display: flex; align-items: center; gap: .7rem;
  padding: .5rem .6rem; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--card);
}
.contact-card:hover { border-color: var(--accent-line); }
.contact-av-link { flex: none; display: flex; }
.contact-card .av { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--chip); display: flex; align-items: center; justify-content: center; color: var(--muted); overflow: hidden; }
.contact-info { flex: 1; min-width: 0; }
.contact-name { font-weight: 600; display: flex; align-items: center; gap: .3rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-handle { font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: .4rem; margin-top: .1rem; }
.contact-actions { display: flex; gap: .35rem; flex: none; }
.contact-actions .btn.sm { padding: .35rem .5rem; }

/* ---- Réseau → Ajouter : résultats de recherche annuaire (cartes + Relier) ---- */
/* Carte sur 2 lignes (layout aéré) : ligne 1 = avatar + nom/handle ;
   ligne 2 = sélecteur de type + bouton Relier, alignés à droite. */
.rel-add-results { display: flex; flex-direction: column; gap: .5rem; margin-top: .7rem; }
.rel-add-card {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .35rem .65rem;
  padding: .6rem .7rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card);
}
.rel-add-card .av { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: var(--chip); display: flex; align-items: center; justify-content: center; font-size: .82rem; color: var(--muted); overflow: hidden; flex: none; }
.rel-add-card .contact-info { min-width: 0; }
.rel-add-actions {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: flex-end; gap: .5rem;
}
.rel-add-type { flex: 1; min-width: 0; max-width: 9rem; }
.rel-add-actions .btn.sm { flex: none; padding: .4rem .9rem; }
.rel-add-done { font-size: .82rem; color: var(--success); white-space: nowrap; }
/* Padding interne quand le body n'est pas un .col-scroll (Compte) : le rail
   borde directement le panel, on lui donne de l'air. Le .col-scroll a déjà sa
   propre marge horizontale (#deck.col-scroll { margin: 0 -1.2rem; padding: 0 1.2rem }). */
.subrail-body:not(.col-scroll) { padding: 1rem; }

/* Compte > Activité : Prochains événements + Activité récente côte à côte sur
   2 colonnes (responsive : 1 colonne sous 720px). */
.acc-activity-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: .5rem;
}
.acc-activity-col { display: flex; flex-direction: column; min-width: 0; }
@media (max-width: 720px) {
  .acc-activity-grid { grid-template-columns: 1fr; gap: 1rem; }
}

/* ── Compte : layout rail + main (calque du pattern Échanges/.comm-wrapper) ──
   Le rail est enfant direct de .acc-layout, lui-même enfant direct du .col → la
   chaîne de paddings .hm-dashboard/.col-scroll/.hm-aside disparaît, plus besoin
   de marges négatives. Le rail démarre flush au bord gauche de la .col, comme
   Échanges et Agenda. */
.acc-wrapper {
  flex: 1; min-height: 0;
  height: var(--col-h);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.acc-layout {
  display: grid;
  grid-template-columns: 56px 1fr;
  /* Borne la ligne à la hauteur du conteneur : sans ça la ligne implicite est en
     `auto` et grandit avec le contenu — un onglet plus haut que --col-h (ex. Profil :
     intro + 9 attributs) débordait, était coupé par overflow:hidden, et .acc-scroll
     ne scrollait pas (il faisait déjà la hauteur du contenu). minmax(0,1fr) force la
     ligne à remplir le conteneur sans le dépasser → .acc-main borné → .acc-scroll scrolle. */
  grid-template-rows: minmax(0, 1fr);
  height: 100%;
  background: var(--card);
  overflow: hidden;
}
/* Le rail Compte porte aussi .acc-rail pour le contextualiser. Les styles
   .subrail/.subrail-btn (définis plus haut) s'appliquent quand même. */
.acc-rail { /* extension contextuelle de .subrail */ }
.acc-main {
  min-width: 0; min-height: 0;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.acc-scroll {
  flex: 1; min-height: 0;
  overflow-y: auto; overflow-x: hidden;
  /* Marge de contenu plus généreuse sur grand écran pour aérer la page et
     espacer les blocs des sous-menus (Profil, Sécurité, Activité, …). */
  padding: 1.75rem 2rem;
}
.acc-header { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1rem; }
.acc-panels { display: contents; }
/* Panneaux Compte qui embarquent une ancienne colonne entière (Profil = ex-Identité,
   Notifs = ex-Notifications) : on neutralise le chrome de carte et le scroll interne
   pour que le contenu coule dans l'unique scroll du Compte (.acc-scroll). */
.opt-panel--embed > .card { border: none; box-shadow: none; padding: 0; background: none; }
.opt-panel--embed .col-scroll { height: auto; max-height: none; overflow: visible; flex: none; min-height: 0; }
/* Page « Mes espaces » embarquée : on masque sa barre supérieure (bouton Retour +
   titre redondants — on est déjà dans le sous-menu Compte). */
.opt-panel--embed .prem-topbar { display: none; }
.opt-panel--embed .prem-page-view { max-width: none; }
/* Padding horizontal du corps embarqué. `.prem-body` porte aussi `.col-scroll`,
   et la règle `#app[data-view="private"] #deck .col-scroll { padding: 0 !important }`
   force son padding à 0 (full-bleed des colonnes du deck) — d'où le contenu collé
   au bord, contrairement aux autres onglets Compte. On reprend la main avec le même
   préfixe à deux ids + `!important` (spécificité 2,3,0 > 2,2,0) pour ré-insérer le
   contenu. `!important` est requis : la règle du deck l'est aussi. */
#app[data-view="private"] #deck .opt-panel--embed .prem-body { padding: 0 1.2rem 1.5rem !important; }
@media (max-width: 640px) {
  .acc-layout { grid-template-columns: 63px 1fr; }
  .acc-scroll { padding: .75rem 1rem; }
}
@media (max-width: 640px) {
  .subrail { width: 63px; }
  .subrail-btn { min-height: 48px; padding: .25rem .15rem; }
  .subrail-btn svg { width: 20px; height: 20px; }
  .subrail-label { font-size: .55rem; }
}

/* Formulaire « Nouveau groupe » rendu inline dans commRight (pas une modale).
   Layout: head (titre + Annuler) + body (form) + actions. */
.comm-form-pane {
  display: flex; flex-direction: column;
  height: 100%; min-height: 0;
  background: var(--bg);
}
.comm-form-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; padding: .65rem .85rem;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.comm-form-head h2 {
  margin: 0; font-size: 1rem; font-weight: 600;
  display: inline-flex; align-items: center; gap: .5rem;
}
.comm-form-body {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 1rem; display: flex; flex-direction: column; gap: 1rem;
}
.comm-form-field { display: flex; flex-direction: column; gap: .35rem; }
.comm-form-label { font-size: .8rem; font-weight: 600; color: var(--muted); }
.comm-form-field input {
  background: var(--bg-soft); border: 1px solid var(--line); padding: .6rem .75rem;
  font: inherit; color: var(--fg); font-size: .9rem;
}
.comm-form-field input:focus { outline: none; border-color: var(--accent-ink); }
.comm-form-hint { font-size: .72rem; color: var(--muted); line-height: 1.45; }
.comm-form-actions {
  display: flex; gap: .6rem; justify-content: flex-end;
  margin-top: auto; padding-top: 1rem;
  border-top: 1px solid var(--line);
}

/* ── Picker contacts (chips + search + liste) — formulaire Nouveau groupe ── */
.ng-picker {
  display: flex; flex-direction: column; gap: .45rem;
  background: var(--bg-soft); border: 1px solid var(--line);
  padding: .55rem .55rem .35rem;
}
.ng-picker:focus-within { border-color: var(--accent-ink); }
.ng-chips {
  display: flex; flex-wrap: wrap; gap: .35rem;
  min-height: 1.6rem;
}
.ng-chips-empty { color: var(--muted); font-size: .78rem; padding: .2rem 0; }
.ng-chip {
  display: inline-flex; align-items: center; gap: .35rem;
  background: var(--bg); border: 1px solid var(--line);
  padding: .15rem .15rem .15rem .15rem;
  font-size: .78rem;
}
.ng-chip-name { padding-right: .25rem; }
.ng-chip-x {
  border: 0; background: transparent; color: var(--muted);
  font-size: .8rem; line-height: 1; cursor: pointer;
  width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
}
.ng-chip-x:hover { color: var(--danger, #ef4444); }
.ng-picker input {
  background: transparent !important; border: 0 !important;
  padding: .25rem .15rem !important; font-size: .85rem;
  width: 100%;
}
.ng-picker input:focus { outline: none; }

.ng-list-wrap { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.ng-list-head {
  font-size: .72rem; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted);
  padding: .35rem .25rem;
}
.ng-list {
  list-style: none; margin: 0; padding: 0;
  border: 1px solid var(--line); background: var(--bg-soft);
  max-height: 280px; overflow-y: auto;
}
.ng-list-empty { padding: .8rem; color: var(--muted); font-size: .82rem; text-align: center; }
.ng-row {
  display: flex; align-items: center; gap: .65rem;
  padding: .5rem .75rem; cursor: pointer;
  border-bottom: 1px solid var(--line);
  transition: background .12s;
}
.ng-row:last-child { border-bottom: 0; }
.ng-row:hover, .ng-row:focus-visible { background: var(--bg); outline: none; }
.ng-row.ng-row-free { background: color-mix(in srgb, var(--accent-soft) 60%, transparent); }
.ng-av-init, .ng-av-img {
  width: 32px; height: 32px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: .85rem; font-weight: 700;
  object-fit: cover;
}
.ng-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ng-row-name { font-size: .86rem; font-weight: 600; }
.ng-row-sub { font-size: .72rem; color: var(--muted); }
.ng-row-add {
  font-size: 1.1rem; color: var(--accent-ink); font-weight: 700;
  width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: var(--bg);
}
.ng-row:hover .ng-row-add { background: var(--accent); color: #0b0d12; border-color: var(--accent); }

/* Live affiché en iframe dans commRight (broadcast, viewer, page créateur).
   Topbar persistante avec Retour + ouverture en onglet. */
.comm-iframe-wrap {
  display: flex; flex-direction: column;
  height: 100%; min-height: 0;
  background: var(--bg);
}
.comm-iframe-bar {
  display: flex; align-items: center; gap: .5rem;
  padding: .4rem .6rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
  flex: none;
}
.comm-iframe-title {
  flex: 1; min-width: 0;
  font-weight: 600; font-size: .85rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.comm-iframe {
  flex: 1; min-height: 0; width: 100%;
  border: 0; background: var(--bg);
}

/* CTA Premium injecté dans commRight quand l'utilisateur clique « Démarrer un
   live » sans abonnement actif. Remplace l'iframe broadcast. */
.live-cta-premium {
  flex: 1; min-height: 0; overflow: auto;
  padding: 2rem 1.4rem; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: .6rem;
}
.live-cta-premium .live-cta-icon { font-size: 2.6rem; }
.live-cta-premium .live-cta-h { margin: 0; font-size: 1.15rem; }
.live-cta-premium .live-cta-lead { opacity: .85; font-size: .95rem; margin: 0; max-width: 460px; }
.live-cta-premium .live-cta-list {
  list-style: none; padding: 0; margin: .4rem 0 1rem;
  text-align: left; display: inline-block; font-size: .92rem;
}
.live-cta-premium .live-cta-list li { padding: .15rem 0; }

/* Topbar avec bouton d'action à droite (« + Nouveau groupe » en mode Groupes). */
.comm-topbar { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.comm-topbar-btn {
  border: 1px solid var(--line); background: var(--bg); color: var(--fg);
  width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem; line-height: 1; cursor: pointer;
  padding: 0; transition: background .12s, color .12s;
}
.comm-topbar-btn:hover { background: var(--accent); color: #0b0d12; }
.comm-topbar-btn:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
/* Zone droite */
.comm-right {
  display: flex; flex-direction: column;
  overflow: hidden; background: var(--bg);
}
.comm-empty-state {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: .75rem; color: var(--muted); text-align: center;
  padding: 2rem;
}
.comm-empty-state h3 { margin: 0; font-size: 1rem; color: var(--fg); }
.comm-empty-state p { margin: 0; font-size: .84rem; max-width: 280px; line-height: 1.5; }
/* ── Zone droite : chat inline ────────────────────────────────── */
.comm-right {
  display: flex; flex-direction: column;
  overflow: hidden; background: var(--bg);
  min-height: 0;
  height: 100%;
}

/* Supprime TOUTE décoration du card hôte */
.comm-right .chat-card {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  border: none !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  overflow: hidden;
}
.comm-right .chat-card .close { display: none !important; }

/* Header chat : flex, compact, bouton appel inline */
.comm-right .chat-head {
  display: flex !important;
  align-items: center !important;
  gap: .4rem !important;
  padding: .5rem 2.6rem .5rem .75rem !important; /* place à droite pour le bouton ✕ */
  border-bottom: 1px solid var(--line) !important;
  flex: none !important;
  flex-wrap: wrap !important;   /* nom en ligne 1, boutons alignés en dessous */
  row-gap: .45rem !important;
  font-size: .82rem !important;
}
/* Le @handle occupe toute la 1re ligne (flex-basis 100%) → les boutons d'action
   passent ensemble sur la ligne suivante, alignés sous le nom. */
.chat-head .chat-head-name {
  flex: 0 0 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.comm-right .chat-head .btn { flex: none !important; }
.comm-call-actions {
  margin-left: auto; flex: none; display: flex; gap: .3rem;
}
.comm-call-actions .btn {
  padding: .28rem .5rem; font-size: .78rem;
}

/* Texte "Conversation éphémère…" : compact, discret */
.comm-right .chat-card .sub {
  padding: .3rem .9rem !important;
  margin: 0 !important;
  font-size: .72rem !important;
  color: var(--muted) !important;
  border-bottom: 1px solid var(--line) !important;
  flex: none !important;
}

/* Log messages : remplit tout l'espace disponible (pas de cadre/marge interne) */
.comm-right .chat-log {
  flex: 1 !important;
  overflow-y: auto !important;
  padding: .85rem 1rem !important;
  min-height: 0 !important;
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: var(--bg) !important;
}
/* Sur large pane : bulles un peu plus larges + médias qui exploitent la place */
.comm-right .chat-log > .bubble { max-width: 72%; }
.comm-right .chat-log > .bubble .b-att-img img { max-width: min(80%, 380px) !important; }

/* Formulaire : collé en bas, pas de marge supplémentaire */
.comm-right .chat-form {
  flex: none !important;
  border-top: 1px solid var(--line) !important;
  padding: .5rem .75rem !important;
  margin: 0 !important;
  background: var(--card) !important;
  display: flex !important;
  flex-direction: column !important; /* 2 lignes : actions au-dessus, saisie en dessous */
  align-items: stretch !important;
  gap: .4rem !important;
}
.comm-right .chat-form input[type="text"],
.comm-right #ch-input {
  flex: 1 !important;
  min-width: 0 !important;
  padding: .45rem .7rem !important;
  font-size: .88rem !important;
  background: var(--bg-soft) !important;
  border: 1px solid var(--line) !important;
  color: var(--fg) !important;
}

/* Masquer le footer site dans toute l'app connectée : il vit SOUS #app et
   « mangeait » la hauteur (→ #deck-viewport tronqué + vide au-dessus du menu).
   La navigation est assurée par la barre du bas ; « Voir ma page » est déjà
   dans la bannière d'accueil et l'écran Mon ID. */
body:has(#app[data-view="private"]) #footer { display: none !important; }

/* Topbar Communications */
.comm-topbar {
  padding: .65rem .9rem;
  font-weight: 700; font-size: .9rem;
  border-bottom: 1px solid var(--line);
  flex: none; display: flex; align-items: center; gap: .5rem;
  color: var(--fg); background: var(--card);
}

/* Barre de recherche */
.comm-search-wrap {
  padding: .45rem .75rem;
  border-bottom: 1px solid var(--line);
  flex: none; background: var(--card);
}
.comm-search-wrap input {
  width: 100%; background: var(--bg-soft);
  border: 1px solid var(--line);
  padding: .4rem .65rem;
  font: inherit; color: var(--fg); font-size: .84rem;
}
.comm-search-wrap input:focus { outline: none; border-color: var(--accent-ink); }
/* ===== END COMMUNICATIONS ===== */
/* ===== END HOME DASHBOARD ===== */

/* — Top contacts : même style que Android — */
.top-contacts-card { display: flex; flex-direction: column; gap: .75rem; }
.tc-row {
  display: flex; align-items: center; gap: .65rem;
  padding: .35rem 0;
  cursor: pointer; text-decoration: none; color: var(--fg);
}
.tc-rank {
  width: 20px; text-align: center;
  font-size: .72rem; font-weight: 700;
  color: var(--muted);
}
.tc-rank.top { color: var(--accent-ink); }
.tc-meta { flex: 1; min-width: 0; }
.tc-handle { font-weight: 600; font-size: .9rem; }
.tc-chips { display: flex; gap: 4px; margin-top: 3px; }
.tc-chip {
  font-size: .64rem; padding: 1px 5px;
  border-radius: var(--r-xs);
  background: var(--chip);
  color: var(--muted);
  font-weight: 500;
}
.tc-count { text-align: right; }
.tc-count b { font-size: .92rem; color: var(--accent-ink); font-weight: 700; }
.tc-count span { font-size: .62rem; color: var(--muted); display: block; }

/* — Reduced motion — */
@media (prefers-reduced-motion: reduce) {
  .bnav-item, .bnav-item .bnav-pip { transition: none; }
}

/* ===== Section « Clients & universalité » ============================== */
.clients-sec { max-width: 1100px; margin: 0 auto; padding: 1.4rem 1rem; }
.cl-lead { color: var(--muted); max-width: 60ch; margin: .8rem auto 1.6rem; text-align: center; font-size: 1.02rem; }
.cl-grid {
  display: grid; gap: .85rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 1.6rem;
}
.cl-card {
  position: relative; padding: 1rem; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--card);
  transition: transform .2s ease, border-color .2s ease;
}
.cl-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.cl-card-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .4rem; }
.cl-card-head .ic { color: var(--accent-ink); }
.cl-card-head h3 { margin: 0; font-size: 1rem; flex: 1; }
.cl-card-head em {
  font-style: normal; font-size: .68rem; letter-spacing: .02em; text-transform: uppercase;
  padding: .12rem .45rem; border-radius: 999px; background: var(--line); color: var(--muted);
}
.cl-card.is-live em { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent-ink); }
.cl-card.is-beta em { background: color-mix(in srgb, #ffb020 30%, transparent); color: #ffb020; }
.cl-card.is-soon em { background: color-mix(in srgb, var(--muted) 18%, transparent); }
.cl-card p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.4; }

.cl-uni {
  display: flex; gap: .9rem; align-items: flex-start;
  padding: 1rem 1.1rem; border-radius: var(--r-md);
  border: 1px dashed color-mix(in srgb, var(--accent) 40%, var(--line));
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  margin-bottom: 1.1rem;
}
.cl-uni .ic { color: var(--accent-ink); margin-top: .15rem; }
.cl-uni h3 { margin: 0 0 .35rem; font-size: 1.02rem; }
.cl-uni p { margin: 0; color: var(--muted); line-height: 1.5; }
.cl-uni code { background: color-mix(in srgb, var(--fg) 8%, transparent); padding: 0 .25rem; border-radius: var(--r-xs); font-size: .88em; }

.cl-wp {
  padding: 1.1rem 1.2rem; border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--card) 92%, transparent), var(--card));
}
.cl-wp h3 { margin: 0 0 .4rem; display: inline-flex; align-items: center; gap: .4rem; font-size: 1.05rem; }
.cl-wp p { margin: 0 0 .9rem; color: var(--muted); line-height: 1.5; max-width: 70ch; }
.cl-wp-actions { display: flex; flex-wrap: wrap; gap: .55rem; }

/* ============================================================
   Contrôle segmenté « Easy ↔ Geek » — pilule moderne, pouce coulissant
   ============================================================ */
.seg {
  position: relative; display: inline-flex; align-items: stretch;
  padding: 3px; border-radius: 999px;
  background: var(--bg-soft); border: 1px solid var(--line);
  box-shadow: var(--highlight);
  -webkit-tap-highlight-color: transparent;
}
.seg-thumb {
  position: absolute; top: 3px; bottom: 3px; left: 3px;
  width: calc(50% - 3px); border-radius: 999px;
  background: var(--accent); box-shadow: var(--elev-1);
  transition: transform var(--dur) var(--ease-spring);
  pointer-events: none;
}
.seg.is-expert .seg-thumb { transform: translateX(100%); }
.seg-btn {
  position: relative; z-index: 1; flex: 1 1 0;
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  border: 0; background: transparent; cursor: pointer; font: inherit;
  font-size: .85rem; font-weight: 600; color: var(--muted);
  padding: .4rem .9rem; border-radius: 999px; white-space: nowrap;
  transition: color var(--dur) var(--ease-out);
}
.seg-btn svg { flex: none; }
.seg-btn[aria-selected="true"] { color: var(--on-accent); }
.seg-btn:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .seg-thumb { transition: none; } }
/* Compact : on garde l'icône, on masque le libellé (le nom accessible reste via
   aria-label sur le bouton — cf. landingModeSwitchHtml). */
@media (max-width: 600px) {
  .seg-btn span { display: none; }
  .seg-btn { padding: .42rem .7rem; }
}
/* Pointeur tactile : on garantit le minimum 44px sur les contrôles du header
   (switch Easy/Geek + bascule de thème) sans alourdir la souris/desktop. */
@media (pointer: coarse) {
  .seg-btn { min-height: 44px; }
  .theme-toggle-header { width: 44px; height: 44px; }
}


/* ===== Visite guidée (carrousel de captures Android, GSAP) ===== */
.app-tour { margin: 0 0 2.5rem; }
.app-tour-lead { color: var(--muted); margin: .2rem 0 1.4rem; max-width: 52ch; }
.tour-stage {
  display: flex; gap: 2rem; align-items: center; flex-wrap: wrap;
}
.tour-phone {
  position: relative; flex: none;
  width: 270px; aspect-ratio: 380 / 821;
  border-radius: var(--r-xl); padding: 8px;
  background: #0c0e0c; border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(0,0,0,.5), 0 0 0 2px rgba(255,255,255,.03) inset;
}
.tour-screens { position: relative; width: 100%; height: 100%; border-radius: var(--r-lg); overflow: hidden; background: #000; }
.tour-screen {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; transition: opacity .5s ease;
}
.tour-screen.on { opacity: 1; }
.tour-notch {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  width: 64px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.18); z-index: 2;
}
.tour-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; min-width: 240px; }
.tour-step {
  display: flex; align-items: center; gap: .7rem; width: 100%;
  padding: .7rem .9rem; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--bg-soft); color: var(--muted); font: inherit; font-size: .92rem;
  cursor: pointer; text-align: left; transition: color .2s, border-color .2s, background .2s;
}
.tour-step:hover { color: var(--fg); }
.tour-step.on { color: var(--fg); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.tour-pip { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--line); transition: background .2s, box-shadow .2s; }
.tour-step.on .tour-pip { background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
@media (max-width: 560px) {
  .tour-stage { gap: 1.4rem; justify-content: center; }
  .tour-steps { min-width: 0; width: 100%; }
}
/* ============================================================
   Landing « Grand public » — inspirée de telegram.org
   Hero centré bold, sections numérotées alternées colorées,
   CTA pill bleu en dégradé, blobs flottants de fond.
   ============================================================ */
/* Accent EASY = DÉRIVÉ de la palette caméléon (--accent) → le sélecteur de
   couleur agit aussi sur la landing « simple ». (Avant : bleu Telegram figé,
   donc le picker semblait « ne rien faire » en mode EASY.)
   - Clair : on vise --accent-ink (assombri, contraste ≥ 4.5:1 sur fond clair).
   - Sombre : accent vif, avec deux crans plus profonds pour les dégradés. */
:root {
  --tg-blue-1: var(--accent-ink);
  --tg-blue-2: var(--accent-ink);
  --tg-blue-deep: var(--accent-ink);
}
[data-theme="dark"] {
  --tg-blue-1: var(--accent);
  --tg-blue-2: color-mix(in srgb, var(--accent) 80%, #0b0d12);
  --tg-blue-deep: color-mix(in srgb, var(--accent) 64%, #0b0d12);
}

/* Variables de gabarit partagées par les DEUX landings (Easy + Geek) : largeur
   maxi et gouttière cohérentes pour le hero, les bandes, le bandeau P2P et le
   showcase Premium. Déclarées sur `.landing` pour rester scopées à la home. */
.landing {
  --lp-maxw: 1120px;
  --lp-pad: clamp(1.2rem, 4vw, 2.5rem);
}
.landing--simple {
  padding: 0; margin: 0; max-width: none;
}
/* `.landing` est un flex column align-items:center → un enfant sans largeur
   explicite se rétracte à son contenu (c'est ce qui décalait « Take a tour »).
   On force chaque section à occuper la largeur, plafonnée par max-width. */
.landing--simple > .tg-hero,
.landing--simple > .tg-bands,
.landing--simple > .tg-tour-wrap,
.landing--simple > .tg-final { width: 100%; }

/* ---- Fond animé : blobs colorés flottants ---- */
.landing--simple { position: relative; overflow: clip; }
.landing--simple::before,
.landing--simple::after {
  content: "";
  position: absolute; z-index: 0; pointer-events: none;
  width: 520px; height: 520px; border-radius: 50%;
  filter: blur(80px); opacity: .55;
}
.landing--simple::before {
  top: -120px; left: -160px;
  background: radial-gradient(circle, #b3dafd 0%, transparent 70%);
  animation: tg-blob 18s ease-in-out infinite alternate;
}
.landing--simple::after {
  top: 320px; right: -180px;
  background: radial-gradient(circle, #ffd8c4 0%, transparent 70%);
  animation: tg-blob 22s ease-in-out infinite alternate-reverse;
}
[data-theme="dark"] .landing--simple::before,
[data-theme="dark"] .landing--simple::after { opacity: .25; }
@keyframes tg-blob {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(40px, 60px) scale(1.15); }
}
@media (prefers-reduced-motion: reduce) {
  .landing--simple::before,
  .landing--simple::after { animation: none; }
}

/* ============================================================
   HERO Telegram-style — texte gauche + Milo grand droite
   ============================================================ */
.tg-hero {
  position: relative; z-index: 1;
  max-width: var(--lp-maxw); margin: 0 auto;
  padding: clamp(2rem, 7vw, 5rem) var(--lp-pad) clamp(2.5rem, 6vw, 4rem);
  display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
}
.tg-hero-copy { min-width: 0; }
.tg-eyebrow {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--tg-blue-2); background: color-mix(in srgb, var(--tg-blue-1) 18%, transparent);
  padding: .35rem .7rem; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--tg-blue-1) 30%, transparent);
}
.tg-eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--tg-blue-2);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--tg-blue-1) 28%, transparent);
}
.tg-h1 {
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  line-height: 1.04; letter-spacing: -.02em; font-weight: 800;
  margin: 1rem 0 .8rem;
}
.tg-h1 .accent {
  background: linear-gradient(120deg, var(--tg-blue-1), var(--tg-blue-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tg-lead {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: var(--muted); max-width: 32rem; line-height: 1.55; margin: 0 0 1.5rem;
}
.tg-lead code {
  background: color-mix(in srgb, var(--tg-blue-1) 18%, transparent);
  color: var(--tg-blue-deep);
  padding: .06em .4em; border-radius: var(--r-xs); font-weight: 700;
  font-family: var(--font-mono); font-size: .92em;
}
[data-theme="dark"] .tg-lead code { color: var(--tg-blue-1); }

/* CTA pill « Telegram » — dégradé bleu chaud + shadow profonde */
.btn.tg-cta {
  display: inline-flex; align-items: center; gap: .55rem;
  background: linear-gradient(180deg, var(--tg-blue-1), var(--tg-blue-2));
  color: #fff; border: 0; border-radius: 999px;
  padding: .95rem 1.5rem; font-size: 1.05rem; font-weight: 700;
  box-shadow:
    0 1px 0 rgba(255,255,255,.4) inset,
    0 -2px 0 rgba(0,0,0,.12) inset,
    0 10px 24px -8px color-mix(in srgb, var(--tg-blue-2) 55%, transparent);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
  cursor: pointer;
}
.btn.tg-cta:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn.tg-cta:active { transform: translateY(0); filter: brightness(.97); }
.btn.tg-cta:focus-visible { outline: 3px solid color-mix(in srgb, var(--tg-blue-1) 60%, transparent); outline-offset: 2px; }
/* Sombre : le fond CTA devient l'accent VIF (parfois clair) → un blanc codé en
   dur peut passer sous 4.5:1. On utilise le texte apparié à l'accent (--on-accent).
   En clair, le fond est l'accent-ink (foncé) → le blanc reste correct. */
[data-theme="dark"] .btn.tg-cta,
[data-theme="dark"] .tg-search .search-box .go { color: var(--on-accent); }

.btn.tg-ghost {
  display: inline-flex; align-items: center; gap: .5rem;
  background: transparent; color: var(--tg-blue-2);
  border: 1.5px solid color-mix(in srgb, var(--tg-blue-1) 50%, transparent);
  border-radius: 999px; padding: .9rem 1.3rem; font-size: 1rem; font-weight: 600;
  cursor: pointer; transition: background .15s ease, border-color .15s ease;
}
.btn.tg-ghost:hover {
  background: color-mix(in srgb, var(--tg-blue-1) 12%, transparent);
  border-color: var(--tg-blue-2);
}
[data-theme="dark"] .btn.tg-ghost { color: var(--tg-blue-1); }

.tg-actions {
  display: flex; gap: .7rem; flex-wrap: wrap; align-items: center;
}
.tg-lost { margin: 1rem 0 0; font-size: .9rem; color: var(--muted); }
.tg-lost a { color: var(--tg-blue-2); text-decoration: none; border-bottom: 1px dashed currentColor; }
[data-theme="dark"] .tg-lost a { color: var(--tg-blue-1); }

/* Recherche en bas du hero — pilule blanche surélevée */
.tg-search {
  margin-top: 1.4rem; width: 100%; max-width: 28rem;
}
.tg-search .search-box {
  border-radius: 999px; padding: .25rem .25rem .25rem 1.1rem;
  border: 1px solid color-mix(in srgb, var(--tg-blue-1) 28%, var(--line));
  background: var(--card, var(--bg-soft));
  box-shadow: 0 10px 30px -16px rgba(36,129,204,.35);
}
.tg-search .search-box:focus-within {
  border-color: var(--tg-blue-2);
  box-shadow: 0 10px 30px -16px rgba(36,129,204,.6),
              0 0 0 4px color-mix(in srgb, var(--tg-blue-1) 22%, transparent);
}
.tg-search .search-box .go {
  background: linear-gradient(180deg, var(--tg-blue-1), var(--tg-blue-2));
  color: #fff; border-radius: 999px; font-weight: 700;
}
.tg-search .search-box .go:hover { filter: brightness(1.05); }

/* Milo en grand, centré, avec carte de chat flottante derrière */
.tg-hero-visual {
  position: relative; min-height: 320px;
  display: flex; align-items: center; justify-content: center;
}
.tg-milo-disc {
  position: relative; width: clamp(260px, 32vw, 380px); aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 25%, #ffffff 0%, rgba(255,255,255,0) 55%),
    linear-gradient(135deg, #cfe7fc 0%, #e9d6fb 50%, #ffd6c4 100%);
  display: flex; align-items: center; justify-content: center;
  box-shadow:
    0 30px 60px -30px rgba(36,129,204,.45),
    inset 0 -10px 30px rgba(36,129,204,.10);
}
[data-theme="dark"] .tg-milo-disc {
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,.18) 0%, rgba(255,255,255,0) 55%),
    linear-gradient(135deg, #1a2c44 0%, #2a1f3e 50%, #3a2a25 100%);
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.6), inset 0 -10px 30px rgba(0,0,0,.3);
}
.tg-milo {
  animation: tg-bob 4.5s ease-in-out infinite;
  filter: drop-shadow(0 12px 22px rgba(36,129,204,.35));
}
@keyframes tg-bob {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%      { transform: translateY(-10px) rotate(3deg); }
}
@media (prefers-reduced-motion: reduce) {
  .tg-milo { animation: none; }
}
/* Bulles de chat flottantes autour du disque (vibe Telegram) */
.tg-chip {
  position: absolute; font-size: .9rem; font-weight: 600;
  background: var(--card, #fff); color: var(--fg);
  padding: .55rem .8rem; border-radius: var(--r-lg);
  box-shadow: 0 10px 24px -12px rgba(0,0,0,.25);
  border: 1px solid var(--line);
  animation: tg-float 5s ease-in-out infinite;
}
[data-theme="dark"] .tg-chip { background: #1a1f29; }
.tg-chip-1 { top: 8%;  left: -4%; --d: 0s;   transform: rotate(-5deg); }
.tg-chip-2 { top: 50%; right: -6%; --d: 1.2s; transform: rotate(4deg); }
.tg-chip-3 { bottom: 6%; left: 10%; --d: 2.4s; transform: rotate(-3deg); }
.tg-chip { animation-delay: var(--d); }
@keyframes tg-float {
  0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
  50%      { transform: translateY(-8px) rotate(var(--r, 0deg)); }
}
@media (prefers-reduced-motion: reduce) {
  .tg-chip { animation: none; }
}

/* ============================================================
   Trois piliers — grille « bento » homogène (2026)
   Plus de bandes de couleur alternées : surface unique, accent bleu cohérent,
   disque d'icône tinté, numéro mono discret, badge accent.
   ============================================================ */
.tg-bands {
  position: relative; z-index: 1;
  max-width: var(--lp-maxw); margin: 0 auto;
  padding: clamp(2rem, 6vw, 4rem) var(--lp-pad);
}
.tg-bento {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 2vw, 1.4rem);
}
.tg-cell {
  display: flex; flex-direction: column; gap: .65rem;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-xl); padding: clamp(1.4rem, 2.5vw, 2rem);
  box-shadow: var(--elev-1), var(--highlight);
  transition: transform var(--dur-fast) var(--ease-spring),
              box-shadow var(--dur) var(--ease-out),
              border-color var(--dur) var(--ease-out);
}
.tg-cell:hover {
  transform: translateY(-4px);
  box-shadow: var(--elev-2), var(--highlight);
  border-color: color-mix(in srgb, var(--tg-blue-1) 40%, var(--line));
}
.tg-cell-head { display: flex; align-items: center; justify-content: space-between; }
.tg-cell-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--tg-blue-1) 16%, transparent);
  color: var(--tg-blue-2);
}
[data-theme="dark"] .tg-cell-ic { color: var(--tg-blue-1); }
.tg-cell-num {
  font-family: var(--font-mono);
  font-size: 1.7rem; font-weight: 800; line-height: 1; letter-spacing: -.02em;
  color: color-mix(in srgb, var(--fg) 20%, transparent);
  font-variant-numeric: tabular-nums;
}
.tg-cell-h {
  font-size: clamp(1.15rem, 2vw, 1.4rem); font-weight: 800;
  letter-spacing: -.01em; margin: .2rem 0 0;
}
.tg-cell-p {
  font-size: .98rem; line-height: 1.55; color: var(--muted); margin: 0;
}
.tg-cell code {
  background: color-mix(in srgb, var(--tg-blue-1) 16%, transparent);
  color: var(--tg-blue-deep); padding: .05em .35em; border-radius: var(--r-xs);
  font-weight: 700; font-family: var(--font-mono); font-size: .92em;
}
[data-theme="dark"] .tg-cell code { color: var(--tg-blue-1); }
.tg-cell-badge {
  margin-top: auto; align-self: flex-start;
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .78rem; font-weight: 700;
  padding: .32rem .65rem; border-radius: 999px;
  background: color-mix(in srgb, var(--tg-blue-1) 14%, transparent);
  color: var(--tg-blue-2);
  border: 1px solid color-mix(in srgb, var(--tg-blue-1) 24%, transparent);
}
[data-theme="dark"] .tg-cell-badge { color: var(--tg-blue-1); }
.tg-cell-badge svg { flex: none; }
@media (prefers-reduced-motion: reduce) {
  .tg-cell { transition: border-color var(--dur) var(--ease-out); }
  .tg-cell:hover { transform: none; box-shadow: var(--elev-1), var(--highlight); }
}

/* ============================================================
   Bandeau de fin : grosse CTA + lien vers mode geek
   ============================================================ */
.tg-final {
  position: relative; z-index: 1;
  text-align: center;
  padding: clamp(3rem, 7vw, 5rem) var(--lp-pad);
  max-width: var(--lp-maxw); margin: 0 auto;
}
/* CTA de clôture centrée mais à mesure de lecture confortable. */
.tg-final h2, .tg-final p { max-width: 40rem; margin-inline: auto; }
.tg-final h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800; letter-spacing: -.01em; margin: 0 0 .8rem;
}
.tg-final p { color: var(--muted); margin: 0 0 1.4rem; font-size: 1.05rem; }
.tg-final .adoption { margin-top: .8rem; }
/* ============================================================
   Responsive — empile à partir de 820px
   ============================================================ */
@media (max-width: 820px) {
  .tg-hero { grid-template-columns: 1fr; padding-top: 1.5rem; }
  .tg-hero-visual { order: -1; min-height: 280px; }
  .tg-milo-disc { width: clamp(220px, 60vw, 300px); }
  .tg-h1 { font-size: clamp(2rem, 8vw, 2.8rem); }
  .tg-bento { grid-template-columns: 1fr; }
  .tg-actions { justify-content: center; }
  .tg-search { margin-left: auto; margin-right: auto; }
}
/* Palier intermédiaire : 2 colonnes (la 3e passe dessous) avant l'empilement. */
@media (min-width: 821px) and (max-width: 1040px) {
  .tg-bento { grid-template-columns: repeat(2, 1fr); }
  .tg-cell:last-child { grid-column: 1 / -1; }
}

/* Visite guidée — alignée comme le reste : même conteneur, contenu calé à
   gauche (titre + chapô), puis téléphone à gauche et panneau d'étapes qui
   remplit la largeur à droite (cohérent avec le hero et le bento). */
.tg-tour-wrap {
  max-width: var(--lp-maxw); margin: 0 auto;
  padding: clamp(2rem, 6vw, 4rem) var(--lp-pad) 1rem;
}
.tg-tour-wrap .app-tour { text-align: left; margin-bottom: 0; }
.tg-tour-wrap .show-head { justify-content: flex-start; }
.tg-tour-wrap .app-tour-lead { margin-inline: 0; }
.tg-tour-wrap .tour-stage { justify-content: flex-start; align-items: stretch; }
.tg-tour-wrap .tour-steps { flex: 1 1 0; justify-content: center; }
.tg-tour-wrap .tour-step { text-align: left; }
@media (max-width: 560px) {
  /* Empilé et centré sur mobile (le téléphone repasse au-dessus). */
  .tg-tour-wrap .tour-stage { justify-content: center; }
  .tg-tour-wrap .tour-steps { flex: none; }
}



/* ====================================================================
   v3 2026 — REFONTE VISUELLE (couche d'overrides, priorité par la source)
   Cible la vue connectée [data-view="private"]. Trois axes :
   typographie affirmée · surfaces en profondeur · mouvement « spring ».
   Voir design-system/MASTER.md.
   ==================================================================== */

/* — 1. Typographie : hiérarchie nette, plancher 12px sur les micro-labels — */
#app[data-view="private"] { font-size: var(--t-base); }

/* Titres de section : capitales discrètes mais lisibles (12px, plus d'air). */
#app[data-view="private"] .section-title,
.hm-section-title,
.lt-config-title,
.comm-sep {
  font-size: var(--t-2xs);
  letter-spacing: .07em;
  color: var(--muted);
}
.hm-section-title { margin-bottom: .7rem; }

/* Libellés de navigation : 12px et semi-gras (fini le .65rem illisible). */
.bnav-item { font-size: var(--t-2xs); font-weight: 600; letter-spacing: 0; gap: 4px; }

/* Statistiques & nombres : grands, en chiffres tabulaires (pas de saut de largeur). */
.hm-stat b,
.hm-stats-grid .hm-stat b,
.metric b { font-size: var(--t-xl); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.hm-stat span,
.hm-stats-grid .hm-stat span { font-size: var(--t-2xs); color: var(--fg-soft); }

/* Identité de la page publique : nom plus présent, sous-titres en fg-soft. */
.lt-name { font-size: var(--t-lg); letter-spacing: -.015em; }
.lt-handle,
.lt-role,
.hm-event-meta,
.hm-notif-text { color: var(--fg-soft); }
.hm-event-title { font-size: var(--t-sm); }

/* Corps des libellés de lien : 16px, plus confortable au pouce. */
.lt-link-label { font-size: var(--t-base); font-weight: 600; }

/* — 2. Surfaces : profondeur 2026 (filet stable + liseré lumineux haut) — */
#app[data-view="private"] .card,
.hm-section,
.lt-link,
.menu-tile,
.hm-event,
.comm-contact-item:hover {
  border-color: var(--hairline);
}
#app[data-view="private"] .card,
.hm-section {
  box-shadow: var(--elev-1), var(--highlight);
}
/* Sections du tableau de bord : un cran d'élévation au survol (vivant mais sobre). */
.hm-section { transition: box-shadow var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out); }

/* La pile de liens gagne du relief et un ressort discret au survol. */
.lt-link {
  box-shadow: var(--elev-1), var(--highlight);
  transition: transform var(--dur-fast) var(--ease-spring), border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.lt-link:hover { box-shadow: var(--elev-2), var(--highlight); }

/* — 3. Rythme : plus d'air entre les sections du tableau de bord — */
.hm-aside { gap: 1rem; }
.hm-section { padding: 1.15rem 1.15rem 1.25rem; }
.lt-inner { gap: 1.15rem; }

/* — 4. Mouvement : appliquer les courbes/durées unifiées aux interactions clés — */
.btn { transition: border-color var(--dur) var(--ease-out), background var(--dur) var(--ease-out), transform var(--dur-fast) var(--ease-spring), box-shadow var(--dur) var(--ease-out); }
.btn.primary { box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn.primary:hover { transform: translateY(-1px); }
.btn.primary:active { transform: translateY(0); }
.bnav-item svg { transition: transform var(--dur) var(--ease-spring); }
.bnav-item.active svg { transform: translateY(-1px) scale(1.06); }

/* Transition de panneau (View Transitions API, pilotée par setupTabs).
   On NOMME la zone du deck : seule la page active fait un crossfade + montée ;
   le header et le rail (root) restent figés → pas de scintillement des éléments
   fixes. Respecte prefers-reduced-motion (le JS saute la transition). */
#app[data-view="private"] #deck { view-transition-name: deck-panel; }
@media (prefers-reduced-motion: no-preference) {
  /* root = tout sauf le deck (header, rail) → pas d'animation : reste stable. */
  ::view-transition-old(root),
  ::view-transition-new(root) { animation: none; }
  ::view-transition-old(deck-panel) { animation: vt-panel-out var(--dur) var(--ease-out) both; }
  ::view-transition-new(deck-panel) { animation: vt-panel-in var(--dur) var(--ease-out) both; }
}
@keyframes vt-panel-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@keyframes vt-panel-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* — 5. Icônes en ligne (remplacent les emojis 📍/🔒) : alignées au texte — */
.lt-loc,
.comm-contact-sub {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}
.lt-loc svg,
.comm-contact-sub svg { flex: none; color: var(--muted); }

/* La barre de recherche (pilule) gère son propre halo via :focus-within → on évite
   le double anneau sur l'input interne (sans bordure). */
.search-box input:focus { box-shadow: none; }

/* — 6. Typographie fluide (2026) : équilibrage des titres / veuves & orphelines —
   Échelle de breakpoints CANONIQUE du projet (réserver les media queries au
   châssis ; préférer container queries + grilles intrinsèques pour les composants) :
     --bp-sm 480  ·  --bp-md 768  ·  --bp-lg 1024  ·  --bp-xl 1280
   (CSS @custom-media n'étant pas natif, ces valeurs sont une convention : viser
   ces paliers plutôt que 560/600/640/720/760/820/880…). */
h1, h2, h3,
.lp-hero h1, .hero h1, .menu-title, .sov-head h2, .pr-h, .mcp-h {
  text-wrap: balance;
}
.lp-tagline, .sov-lead, .pr-lead, .mcp-lead, p.lead,
.comm-empty-state p, .hm-empty {
  text-wrap: pretty;
}

@media (prefers-reduced-motion: reduce) {
  .lt-link, .btn, .hm-section, .bnav-item svg { transition: none; }
  .btn.primary:hover, .bnav-item.active svg { transform: none; }
}

/* Intro Markdown de l'espace premium (éditeur /me/premium). Max 1/5 de la
   hauteur viewport ; au-delà → scroll vertical à l'intérieur de la textarea. */
.sp-intro-ta {
  width: 100%; box-sizing: border-box;
  min-height: 96px; max-height: 20vh; overflow-y: auto;
  resize: vertical;
  font: inherit; font-size: .92rem; line-height: 1.5;
  background: var(--inset); color: var(--fg);
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: .6rem .75rem;
  transition: border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.sp-intro-ta:focus {
  outline: none; border-color: var(--accent-ink);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.sp-intro-ta::placeholder { color: var(--muted); }

/* Rendu HTML de l'intro sur /@handle (zone bio publique : profil principal +
   bas du slide home en mobile). Pas de surface encadrée — l'intro se fond dans
   le bloc d'accueil et précède la bio. */
.pub-intro {
  margin: 0 0 .85rem;
  color: var(--fg);
  font-size: 1rem; line-height: 1.55;
}
/* Lien discret pour le proprio sous l'intro Markdown, redirige vers l'éditeur. */
.pub-intro-edit-hint {
  margin: -.4rem 0 .9rem; opacity: .7;
}
.pub-intro-edit-hint a {
  display: inline-flex; align-items: center; gap: .3rem;
  color: var(--muted); text-decoration: none;
  font-size: .82rem;
}
.pub-intro-edit-hint a:hover { color: var(--accent-ink); text-decoration: underline; }
/* CTA « Définir mon intro » affiché dans .pub-cover-about quand l'intro est
   vide et qu'on est sur son propre profil. Aspect bouton discret, accent. */
.pub-intro-cta {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .55rem .9rem;
  border-radius: var(--r-sm, 10px);
  background: color-mix(in srgb, var(--accent, var(--accent-ink)) 18%, transparent);
  color: var(--fg);
  text-decoration: none;
  font-weight: 600; font-size: .9rem;
  border: 1px dashed color-mix(in srgb, var(--accent-ink) 55%, transparent);
  transition: background .12s, border-color .12s, transform .08s;
}
.pub-intro-cta:hover {
  background: color-mix(in srgb, var(--accent-ink) 22%, transparent);
  border-color: var(--accent-ink);
}
.pub-intro-cta:active { transform: scale(.98); }
.pub-intro-cta svg { color: var(--accent-ink); flex: none; }
.pub-intro > :first-child { margin-top: 0; }
.pub-intro > :last-child  { margin-bottom: 0; }
.pub-intro h1 { font-size: 1.4rem; font-weight: 700; margin: .9rem 0 .35rem; letter-spacing: -.01em; }
.pub-intro h2 { font-size: 1.15rem; font-weight: 700; margin: .7rem 0 .3rem; }
.pub-intro h3 { font-size: 1rem;    font-weight: 700; margin: .55rem 0 .25rem; }
.pub-intro p  { margin: .35rem 0; }
.pub-intro ul { margin: .35rem 0 .35rem 1.2rem; padding: 0; }
.pub-intro li { margin: .15rem 0; }
.pub-intro strong { font-weight: 700; }
.pub-intro em     { font-style: italic; }

/* Rendu HTML de l'intro sur /@handle/space — typographie douce, marges resserrées. */
.spx-intro {
  margin: 0 auto 1.25rem; max-width: 720px;
  padding: 1rem 1.1rem; border-radius: var(--r-lg);
  background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--elev-1), var(--highlight);
  color: var(--fg);
}
.spx-intro > :first-child { margin-top: 0; }
.spx-intro > :last-child  { margin-bottom: 0; }
.spx-intro h1 { font-size: 1.35rem; margin: .8rem 0 .4rem; }
.spx-intro h2 { font-size: 1.15rem; margin: .7rem 0 .35rem; }
.spx-intro h3 { font-size: 1.02rem; margin: .6rem 0 .3rem; }
.spx-intro p  { margin: .35rem 0; line-height: 1.55; }
.spx-intro ul { margin: .35rem 0 .35rem 1.2rem; padding: 0; }
.spx-intro li { margin: .15rem 0; }

/* ====================================================================
   Landing simple (Easy) — refonte mobile 2026
   Objectif : tailles homogènes, rythme vertical resserré, mieux remplir
   l'espace écran. Toutes les overrides sont scopées à .landing--simple
   et à l'en-tête landing pour ne pas impacter les autres vues.
   Breakpoints canoniques : 768 (md) et 480 (sm). cf. convention plus haut.
   ==================================================================== */

/* — Header landing : normalisation des contrôles sous 768 px —
   On vise une grille d'outils à hauteur unique 40 px (touch 44 garanti
   via min-height en pointer:coarse). Les sauts visuels disparaissent. */
@media (max-width: 768px) {
  #app[data-view="landing"] .topbar.site-header {
    padding-block: .6rem .7rem;
    padding-inline: clamp(.85rem, 3vw, 1.25rem);
  }
  #app[data-view="landing"] .topbar.site-header .editor-head-right {
    gap: .35rem; flex-wrap: nowrap; row-gap: .35rem;
  }
  #app[data-view="landing"] .hd-tools { gap: .3rem; }

  /* Tous les contrôles du header alignés sur 44 px OUTER (a11y touch).
     - .seg : padding 2px + seg-btn 40 px = 44 outer
     - .lang-select : <select> natif → hauteur EXPLICITE (min-height ignoré)
     - .theme-toggle-header : carré 44 */
  #app[data-view="landing"] .seg { padding: 2px; }
  #app[data-view="landing"] .seg-btn { height: 40px; min-height: 0; padding: 0 .55rem; }
  #app[data-view="landing"] .lang-select {
    height: 44px; min-height: 0; box-sizing: border-box;
    font-size: .82rem; padding-block: 0; line-height: 1;
  }
  #app[data-view="landing"] .theme-toggle-header { width: 44px; height: 44px; }
}

/* Sous 480 px : on compacte le sélecteur de langue (chevron seul + 2 lettres). */
@media (max-width: 480px) {
  #app[data-view="landing"] .lang-select {
    padding-right: 1.45rem; background-position: right .45rem center;
    min-width: 0;
  }
  /* Le logo brand-milo reste en zone touch large, mais visuellement
     ramené à 36 px pour libérer de l'espace au profit des outils. */
  #app[data-view="landing"] .brand-milo,
  #app[data-view="landing"] .brand-milo .milo { width: 36px; height: 36px; }
}

/* — Hero landing simple : équilibre vertical et bulles contenues — */
@media (max-width: 768px) {
  .landing--simple .tg-hero {
    padding-top: 1rem; padding-bottom: 1.5rem;
    gap: 1.25rem;
  }
  /* Visuel Milo : descendu (220 px), disc resserré (200 px) → on récupère
     ~80 px de hauteur sans rien sacrifier au charme. */
  .landing--simple .tg-hero-visual { min-height: 220px; }
  .landing--simple .tg-milo-disc { width: clamp(180px, 52vw, 240px); }
  .landing--simple .tg-milo svg { width: 70%; height: 70%; }

  /* Bulles ramenées DANS la zone visuelle (plus de débordement clippé),
     style 2026 « glass » : translucide + flou + bord subtil. */
  .landing--simple .tg-chip {
    font-size: .78rem; padding: .42rem .65rem;
    background: color-mix(in srgb, var(--card) 80%, transparent);
    backdrop-filter: blur(8px) saturate(1.3);
    -webkit-backdrop-filter: blur(8px) saturate(1.3);
    border-color: color-mix(in srgb, var(--fg) 10%, transparent);
    box-shadow: 0 8px 22px -14px rgba(0,0,0,.45);
  }
  [data-theme="dark"] .landing--simple .tg-chip {
    background: color-mix(in srgb, #1a1f29 72%, transparent);
    border-color: color-mix(in srgb, #ffffff 8%, transparent);
  }
  .landing--simple .tg-chip-1 { top: 6%;  left: 2%;  }
  .landing--simple .tg-chip-2 { top: 48%; right: 2%; }
  .landing--simple .tg-chip-3 { bottom: 4%; left: 18%; }

  /* Eyebrow : plus moderne, centré sous le visuel (le hero est désormais
     en 1 colonne, copy après visuel — voir .tg-hero-visual { order: -1 }). */
  .landing--simple .tg-eyebrow {
    align-self: center; margin-inline: auto;
  }

  /* Titre + lead : rythme resserré. */
  .landing--simple .tg-h1 {
    font-size: clamp(1.9rem, 7vw, 2.5rem);
    margin: .8rem 0 .55rem; text-align: center;
  }
  .landing--simple .tg-lead {
    font-size: 1rem; line-height: 1.5;
    margin: 0 auto 1.2rem; max-width: 34rem; text-align: center;
  }

  /* Actions : stack vertical, deux pilules pleine largeur, même hauteur. */
  .landing--simple .tg-actions {
    display: flex; flex-direction: column; align-items: stretch;
    gap: .55rem; width: 100%; max-width: 22rem;
    margin-inline: auto;
  }
  .landing--simple .btn.tg-cta,
  .landing--simple .btn.tg-ghost {
    width: 100%; justify-content: center;
    min-height: 48px; padding: 0 1.25rem;
    font-size: 1rem; line-height: 1;
  }

  /* Search : alignée sur la même largeur que les CTAs, juste en-dessous. */
  .landing--simple .tg-search {
    width: 100%; max-width: 22rem;
    margin: 1rem auto 0;
  }
  .landing--simple .tg-search .search-box { min-height: 48px; padding-left: 1rem; }
  .landing--simple .tg-search .search-box .go { min-height: 40px; padding: 0 1rem; }

  /* Lien « clé perdue » : plat, discret, centré (fini le tiret pointillé). */
  .landing--simple .tg-lost {
    margin: .8rem 0 0; text-align: center;
    font-size: .85rem;
  }
  .landing--simple .tg-lost a {
    border-bottom: 0;
    text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
    text-underline-offset: 3px;
  }
}

/* Sous 480 px : on serre encore le hero pour gagner du gris vertical. */
@media (max-width: 480px) {
  .landing--simple .tg-hero {
    padding-inline: 1rem;
    padding-block: .5rem 1.25rem;
    gap: 1rem;
  }
  .landing--simple .tg-hero-visual { min-height: 200px; }
  .landing--simple .tg-milo-disc { width: clamp(170px, 54vw, 220px); }

  /* Bento : déjà 1 col en < 820 px ; on harmonise juste le padding/gap. */
  .landing--simple .tg-bands { padding-block: 1.25rem; }
  .landing--simple .tg-bento { gap: .75rem; }
  .landing--simple .tg-cell { padding: 1.25rem; }

  /* Final CTA : même pilule pleine largeur que dans le hero. */
  .landing--simple .tg-final { padding-block: 2rem; padding-inline: 1rem; }
  .landing--simple .tg-final .btn.tg-cta {
    width: 100%; max-width: 22rem; justify-content: center;
    min-height: 48px; padding: 0 1.25rem; margin-inline: auto;
  }
}

/* ============================================================
   v3 commercial — Easy landing : price tease, trust strip,
   bandeau P2P, showcase Premium. Tout greffé sur le design
   tg-* (Telegram-like) pour une cohérence visuelle stricte.
   ============================================================ */

/* Sticker prix sous les CTA du hero — passerelle gratuit → premium */
.tg-price-tease {
  display: inline-flex; align-items: center; gap: .45rem;
  margin: .9rem 0 0; font-size: .92rem;
  color: var(--muted);
}
.tg-price-tease strong {
  color: var(--tg-blue-2); font-weight: 700;
  background: color-mix(in srgb, var(--tg-blue-1) 16%, transparent);
  padding: .1em .45em; border-radius: var(--r-xs);
}
[data-theme="dark"] .tg-price-tease strong { color: var(--tg-blue-1); }
.tg-price-tease svg { color: var(--tg-blue-2); flex: none; }
[data-theme="dark"] .tg-price-tease svg { color: var(--tg-blue-1); }

/* Trust strip — 5 promesses souveraineté/E2E/P2P/no-phone/OSS */
.landing--simple > .tg-trust { width: 100%; }
.tg-trust {
  position: relative; z-index: 1;
  max-width: var(--lp-maxw); margin: 0 auto;
  padding: 0 var(--lp-pad);
}
.tg-trust-row {
  display: flex; flex-wrap: wrap; justify-content: center; gap: .55rem;
  padding: .9rem 1rem; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--elev-1);
}
.tg-trust-chip {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .85rem; font-weight: 600; color: var(--fg);
  padding: .35rem .7rem; border-radius: 999px;
  background: color-mix(in srgb, var(--tg-blue-1) 8%, transparent);
}
.tg-trust-chip svg { color: var(--tg-blue-2); flex: none; }
[data-theme="dark"] .tg-trust-chip svg { color: var(--tg-blue-1); }
.tg-trust-chip .flag { font-size: 1.05rem; line-height: 1; }

/* Bandeau P2P — différenciateur clé (anti-interception) */
.landing--simple > .tg-p2p { width: 100%; }
.tg-p2p {
  position: relative; z-index: 1;
  max-width: var(--lp-maxw); margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 2.5rem) var(--lp-pad);
}
.tg-p2p-inner {
  display: grid; grid-template-columns: minmax(220px, 320px) 1fr;
  gap: clamp(1.5rem, 4vw, 3rem); align-items: center;
  background:
    radial-gradient(120% 80% at 0% 0%, color-mix(in srgb, var(--tg-blue-1) 16%, transparent) 0%, transparent 60%),
    var(--card);
  border: 1px solid var(--line); border-radius: var(--r-xl);
  padding: clamp(1.4rem, 3vw, 2.2rem);
  box-shadow: var(--elev-1), var(--highlight);
}
.tg-p2p-copy h2 {
  font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 800;
  letter-spacing: -.01em; margin: 0 0 .6rem;
}
.tg-p2p-copy p { color: var(--muted); margin: 0; line-height: 1.55; font-size: 1rem; }
.tg-p2p-copy strong { color: var(--fg); }

/* Diagramme : appareil A ───── appareil B, mindlog isolé en dessous (barré) */
.tg-p2p-diagram {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 0 2.6rem;
  min-height: 130px;
}
.tg-p2p-node {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(180deg, var(--tg-blue-1), var(--tg-blue-2));
  color: #fff; flex: none;
  box-shadow: 0 8px 20px -10px color-mix(in srgb, var(--tg-blue-2) 60%, transparent);
}
[data-theme="dark"] .tg-p2p-node { color: var(--on-accent); }
.tg-p2p-line {
  flex: 1; height: 3px; margin: 0 .6rem; position: relative;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--tg-blue-1) 60%, transparent),
    color-mix(in srgb, var(--tg-blue-2) 60%, transparent));
  border-radius: 999px;
}
.tg-p2p-line::before,
.tg-p2p-line::after {
  content: ""; position: absolute; top: 50%; transform: translateY(-50%);
  width: 8px; height: 8px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 3px var(--tg-blue-2);
  animation: tg-p2p-pulse 2.4s ease-in-out infinite;
}
.tg-p2p-line::before { left: 12%; animation-delay: 0s; }
.tg-p2p-line::after  { right: 12%; animation-delay: 1.2s; }
@keyframes tg-p2p-pulse {
  0%, 100% { opacity: 1; transform: translateY(-50%) scale(1); }
  50%      { opacity: .35; transform: translateY(-50%) scale(.7); }
}
@media (prefers-reduced-motion: reduce) {
  .tg-p2p-line::before, .tg-p2p-line::after { animation: none; }
}
.tg-p2p-server {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .8rem; font-weight: 700; color: var(--muted);
  padding: .35rem .65rem; border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 8%, transparent);
  border: 1px dashed color-mix(in srgb, var(--muted) 35%, transparent);
}
.tg-p2p-server::after {
  /* Barre rouge fine en travers — « hors du parcours du flux ». */
  content: ""; position: absolute; left: 8px; right: 8px; top: 50%;
  height: 2px; background: #d24a4a; border-radius: 999px;
  transform: rotate(-8deg); opacity: .85;
}
.tg-p2p-server svg { flex: none; }

@media (max-width: 720px) {
  .tg-p2p-inner { grid-template-columns: 1fr; padding: 1.4rem; }
  .tg-p2p-diagram { padding: .5rem 0 2.4rem; }
}

/* Stockage souverain — id.mindlog n'héberge aucun contenu ; BYO storage (Premium) */
.landing--simple > .tg-store { width: 100%; }
.tg-store {
  position: relative; z-index: 1;
  max-width: var(--lp-maxw); margin: 0 auto;
  padding: clamp(1rem, 3vw, 1.5rem) var(--lp-pad) clamp(1.5rem, 4vw, 2.5rem);
}
.tg-store-inner {
  background:
    radial-gradient(120% 80% at 100% 0%, color-mix(in srgb, var(--accent) 14%, transparent) 0%, transparent 60%),
    var(--card);
  border: 1px solid var(--line); border-radius: var(--r-xl);
  padding: clamp(1.4rem, 3vw, 2.2rem); text-align: center;
  box-shadow: var(--elev-1), var(--highlight);
}
.tg-store-inner h2 {
  font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 800;
  letter-spacing: -.01em; margin: .6rem 0 .6rem; max-width: 40rem;
  margin-left: auto; margin-right: auto;
}
.tg-store-inner p {
  color: var(--muted); margin: 0 auto; line-height: 1.55; font-size: 1rem;
  max-width: 46rem;
}
.tg-store-inner strong { color: var(--fg); }
.tg-store-enc {
  max-width: 46rem; margin: 1rem auto 0 !important;
  padding: .8rem 1rem; border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  color: var(--fg); line-height: 1.5; font-size: .95rem;
}
.tg-store-enc svg { vertical-align: -2px; color: var(--accent-ink, var(--accent)); }
.tg-store-enc em { font-style: italic; opacity: .9; }
.tg-store-choice {
  margin: .9rem auto 0 !important; font-weight: 600; color: var(--fg);
}
.tg-store-chips {
  display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center;
  margin: 1.1rem 0 .2rem;
}
.tg-store-note {
  font-size: .85rem; font-weight: 600;
  color: var(--accent-ink, var(--accent)); margin-top: .8rem !important;
}
.tg-store-note svg { vertical-align: -2px; }

/* ── Espace privé : 3 sous-onglets (Galerie / Fichiers / Pages privées) ──── */
.priv-subtabs {
  display: flex; gap: .15rem; flex-wrap: wrap;
  border-bottom: 1px solid var(--line); margin: 1rem 0 .9rem;
}
.priv-subtab {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem .85rem; background: none; border: none; cursor: pointer;
  color: var(--muted); font-weight: 600; font-size: .92rem;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .15s;
}
.priv-subtab:hover { color: var(--fg); }
.priv-subtab.is-on { color: var(--fg); border-bottom-color: var(--accent-ink, var(--accent)); }
.priv-subtab svg { flex: none; }
.priv-subpanel[hidden] { display: none; }
.priv-vis {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .85rem; color: var(--muted); margin-bottom: .7rem; cursor: pointer;
}
.priv-vis input { width: auto; margin: 0; }
.badge-sm {
  font-size: .65rem; font-weight: 700; padding: .08rem .35rem; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-ink, var(--accent));
}
/* Explorateur de fichiers */
.fx-list { display: flex; flex-direction: column; gap: .3rem; }
.fx-row {
  display: flex; align-items: center; gap: .55rem;
  padding: .45rem .55rem; border: 1px solid var(--line); border-radius: 10px; background: var(--card);
}
.fx-ic { display: inline-flex; color: var(--muted); flex: none; }
.fx-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-size { margin-left: auto; color: var(--muted); font-size: .8rem; flex: none; }
.fx-row .fx-dl { flex: none; }

/* ── Onglet Compte → Stockage : sélection guidée du fournisseur ──────────── */
.sp-st-connected {
  display: flex; align-items: center; gap: .45rem;
  padding: .55rem .7rem; border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  font-size: .9rem; margin-bottom: .7rem;
}
.sp-st-connected svg { color: var(--accent-ink, var(--accent)); flex: none; }
.sp-oc-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .6rem; margin: 0 0 .7rem;
}
.sp-oc-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: .75rem .8rem; background: var(--bg-soft);
  display: flex; flex-direction: column;
}
.sp-oc-card.is-on { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.sp-oc-head { display: flex; align-items: center; gap: .4rem; }
.sp-oc-badge {
  font-size: .68rem; font-weight: 700; padding: .1rem .4rem; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent-ink, var(--accent)); white-space: nowrap;
}
.sp-oc-hint { margin: .35rem 0 .6rem; line-height: 1.45; opacity: .82; }
.sp-oc-cta { margin-top: auto; align-self: flex-start; }
.sp-oc-on { display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem; font-weight: 600; color: var(--accent-ink, var(--accent)); }
.sp-oc-empty {
  padding: .6rem .7rem; border-radius: var(--radius);
  background: var(--bg-soft); border: 1px dashed var(--line);
  line-height: 1.5; margin-bottom: .7rem;
}
.sp-st-adv summary, .sp-st-op summary { cursor: pointer; padding: .35rem 0; }
.sp-st-adv-inner { padding: .2rem 0 .4rem; }
.sp-st-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .5rem; }
.sp-st-field { display: flex; flex-direction: column; gap: .2rem; }
.sp-st-field input { width: 100%; }
.sp-st-op { margin-top: .6rem; opacity: .85; }
.sp-st-op code { font-size: .76rem; word-break: break-all; }

/* Showcase Premium — 6 services débloqués par l'abonnement créateur·rice */
.landing--simple > .tg-prem { width: 100%; }
.tg-prem {
  position: relative; z-index: 1;
  max-width: var(--lp-maxw); margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4rem) var(--lp-pad);
}
.tg-prem-head { text-align: center; max-width: 42rem; margin: 0 auto 1.8rem; }
.tg-prem-eyebrow {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--tg-blue-2);
  background: color-mix(in srgb, var(--tg-blue-1) 18%, transparent);
  padding: .35rem .7rem; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--tg-blue-1) 30%, transparent);
}
.tg-prem-eyebrow svg { color: inherit; }
.tg-prem-head h2 {
  font-size: clamp(1.7rem, 3.5vw, 2.4rem); font-weight: 800;
  letter-spacing: -.01em; margin: .9rem 0 .6rem;
}
.tg-prem-lead {
  color: var(--muted); line-height: 1.55; margin: 0;
  font-size: clamp(1rem, 1.5vw, 1.1rem);
}
.tg-prem-lead strong { color: var(--fg); }

.tg-prem-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(.9rem, 1.8vw, 1.3rem);
}
.tg-prem-card {
  display: flex; flex-direction: column; gap: .55rem;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-xl); padding: clamp(1.2rem, 2.2vw, 1.7rem);
  box-shadow: var(--elev-1), var(--highlight);
  transition: transform var(--dur-fast) var(--ease-spring),
              border-color var(--dur) var(--ease-out),
              box-shadow var(--dur) var(--ease-out);
  position: relative; overflow: hidden;
}
.tg-prem-card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 0% 0%,
    color-mix(in srgb, var(--tg-blue-1) 16%, transparent) 0%,
    transparent 55%);
  pointer-events: none; opacity: .7;
}
.tg-prem-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--tg-blue-1) 45%, var(--line));
  box-shadow: var(--elev-2), var(--highlight);
}
.tg-prem-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--tg-blue-1), var(--tg-blue-2));
  color: #fff;
  box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--tg-blue-2) 50%, transparent);
  position: relative; z-index: 1;
}
[data-theme="dark"] .tg-prem-ic { color: var(--on-accent); }
.tg-prem-card h3 {
  font-size: 1.08rem; font-weight: 800; letter-spacing: -.01em;
  margin: .25rem 0 0; position: relative; z-index: 1;
}
.tg-prem-card p {
  color: var(--muted); margin: 0; line-height: 1.5; font-size: .94rem;
  position: relative; z-index: 1;
}

.tg-prem-cta-wrap {
  margin-top: clamp(1.6rem, 3vw, 2.4rem);
  text-align: center;
}
.tg-prem-note {
  margin: .8rem 0 0; color: var(--muted); font-size: .85rem;
}

@media (max-width: 1040px) {
  .tg-prem-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .tg-prem-grid { grid-template-columns: 1fr; }
  .tg-trust-row { padding: .7rem .8rem; gap: .35rem; }
  .tg-trust-chip { font-size: .8rem; padding: .3rem .55rem; }
}
@media (prefers-reduced-motion: reduce) {
  .tg-prem-card { transition: border-color var(--dur) var(--ease-out); }
  .tg-prem-card:hover { transform: none; box-shadow: var(--elev-1), var(--highlight); }
}

/* ===== Plugin LIVE — onglet sidebar ===== */
.live-col { padding: 1rem; }
.live-col-h h2 { font-size: 1.15rem; }
.live-col-h svg { color: #ef4444; }
.live-col-body { display: flex; flex-direction: column; gap: 1.1rem; margin-top: 1rem; }

.live-section {
  display: flex; flex-direction: column; gap: .5rem;
}
.live-section-h {
  margin: 0;
  font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted, #94a3b8);
}

/* Cartes cliquables : ligne dot/icône + body texte */
.live-card {
  display: flex; align-items: center; gap: .75rem;
  padding: .7rem .85rem;
  background: var(--inset, rgba(255,255,255,.04));
  border: 1px solid var(--line, rgba(255,255,255,.06));
  border-radius: 10px;
  color: inherit; text-decoration: none;
  transition: background 150ms var(--ease-out, ease-out),
              border-color 150ms var(--ease-out, ease-out),
              transform 120ms var(--ease-out, ease-out);
}
.live-card:hover { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); transform: translateY(-1px); }
.live-card-body { display: flex; flex-direction: column; gap: .12rem; min-width: 0; }
.live-card-body strong { font-size: .92rem; }
.live-card-body small { font-size: .76rem; opacity: .68; }

.live-card-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  background: rgba(37, 99, 235, .15);
  color: #2563eb;
  border-radius: 50%;
  font-weight: 700; font-size: 14px; flex: none;
}

/* Dot rouge animé pour les lives en cours (mien ou autres) */
.live-dot {
  width: .65rem; height: .65rem; border-radius: 50%;
  background: #ef4444; box-shadow: 0 0 8px #ef4444;
  animation: live-col-pulse 1.4s infinite;
  flex: none;
}
@keyframes live-col-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .45; transform: scale(.85); }
}
@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none; }
}

/* Variantes : ma diffusion en cours (rouge), CTA démarrer (bleu primaire) */
.live-card--mine-on, .live-card--now {
  background: rgba(239, 68, 68, .08);
  border-color: rgba(239, 68, 68, .25);
}
.live-card--mine-on:hover, .live-card--now:hover {
  background: rgba(239, 68, 68, .14);
  border-color: rgba(239, 68, 68, .4);
}
.live-card--mine-on strong, .live-card--now strong { color: #ef4444; }

.live-card--cta {
  background: rgba(37, 99, 235, .08);
  border-color: rgba(37, 99, 235, .25);
}
.live-card--cta:hover {
  background: rgba(37, 99, 235, .14);
  border-color: rgba(37, 99, 235, .4);
}
.live-card--cta strong { color: #2563eb; }
.live-card--cta .live-card-icon { background: rgba(37, 99, 235, .2); color: #2563eb; }

.live-card--sched .live-card-icon { background: rgba(148, 163, 184, .15); color: var(--muted, #94a3b8); }

.live-empty {
  padding: 1.2rem;
  background: var(--inset, rgba(255,255,255,.03));
  border: 1px dashed var(--line, rgba(255,255,255,.1));
  border-radius: 10px;
  text-align: center;
}

/* ── Recherche + barre de tags (style Netflix-lite) ──────────────────────── */
.live-search-bar {
  position: relative;
  margin-top: .9rem;
  display: flex;
  align-items: center;
}
.live-search-bar #live-search {
  width: 100%;
  padding: .55rem .85rem .55rem 2rem;
  background: var(--inset, rgba(255,255,255,.04));
  border: 1px solid var(--line, rgba(255,255,255,.08));
  border-radius: 999px;
  color: inherit;
  font-size: .88rem;
  outline: none;
  transition: border-color 150ms ease;
}
.live-search-bar #live-search:focus { border-color: rgba(239, 68, 68, .5); }
.live-search-bar::before {
  content: "🔍";
  position: absolute;
  left: .65rem; top: 50%;
  transform: translateY(-50%);
  font-size: .85rem; opacity: .55;
  pointer-events: none;
}
.live-search-clear {
  position: absolute; right: .35rem; top: 50%;
  transform: translateY(-50%);
  width: 22px; height: 22px;
  border: 0; background: rgba(255,255,255,.1);
  color: inherit; border-radius: 50%;
  cursor: pointer; font-size: .7rem;
  display: inline-flex; align-items: center; justify-content: center;
}
.live-search-clear:hover { background: rgba(255,255,255,.18); }

.live-tagbar {
  display: flex; gap: .35rem; flex-wrap: wrap;
  margin-top: .6rem;
}
.lv-tag {
  border: 1px solid var(--line, rgba(255,255,255,.1));
  background: var(--inset, rgba(255,255,255,.03));
  color: inherit;
  padding: .2rem .65rem;
  border-radius: 999px;
  font-size: .76rem;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.lv-tag:hover { background: rgba(239, 68, 68, .12); border-color: rgba(239, 68, 68, .35); }
.lv-tag.on { background: #ef4444; border-color: #ef4444; color: white; font-weight: 600; }
.lv-tag-clear { font-weight: 600; opacity: .85; }

/* ── Grille de cartes EN DIRECT (Netflix-style) ──────────────────────────── */
.live-section-h .lv-count {
  display: inline-block;
  margin-left: .4rem;
  padding: .05rem .45rem;
  background: rgba(255,255,255,.08);
  border-radius: 999px;
  color: inherit; opacity: .7;
  font-size: .68rem; font-weight: 600;
  text-transform: none; letter-spacing: 0;
}

.lv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .85rem;
}

.lv-tile {
  display: flex; flex-direction: column;
  background: var(--inset, rgba(255,255,255,.03));
  border: 1px solid var(--line, rgba(255,255,255,.06));
  border-radius: 12px; overflow: hidden;
  color: inherit; text-decoration: none;
  transition: transform 150ms var(--ease-out, ease-out),
              border-color 150ms ease,
              box-shadow 150ms ease;
}
.lv-tile:hover {
  transform: translateY(-3px) scale(1.01);
  border-color: rgba(239, 68, 68, .35);
  box-shadow: 0 8px 24px -10px rgba(239, 68, 68, .35);
}

.lv-poster {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #0c0e14;
  overflow: hidden;
}
.lv-poster-img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.lv-poster-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1f2937, #ef4444);
  color: white; font-size: 2.2rem; font-weight: 700;
}
.lv-badge-live {
  position: absolute; top: .45rem; left: .45rem;
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .15rem .45rem;
  background: #ef4444; color: white;
  border-radius: 4px;
  font-size: .68rem; font-weight: 700; letter-spacing: .04em;
}
.lv-badge-live .live-dot { width: .45rem; height: .45rem; background: white; box-shadow: none; }
.lv-badge-since {
  position: absolute; bottom: .45rem; right: .45rem;
  padding: .1rem .45rem;
  background: rgba(0,0,0,.7); color: white;
  border-radius: 4px;
  font-size: .65rem;
}

.lv-tile-body { padding: .55rem .7rem .65rem; display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.lv-tile-title { font-size: .9rem; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lv-tile-owner { font-size: .72rem; opacity: .7; }
.lv-tile-tags { display: flex; gap: .25rem; flex-wrap: wrap; margin-top: .25rem; }
.lv-tile-tag {
  font-size: .62rem;
  padding: .05rem .35rem;
  background: rgba(255,255,255,.06);
  border-radius: 999px;
  opacity: .85;
}

@media (max-width: 480px) {
  .lv-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .55rem; }
  .lv-tile-title { font-size: .82rem; }
}
