/* ══════════════════════════════════════════════════════
   auberge.css — L'Auberge · Espace communautaire
   ══════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════
   HÉRO
   ═══════════════════════════════════════════ */
.auberge-hero {
  position: relative;
  overflow: hidden;
  background: var(--accent-light);
  border-bottom: 1px solid var(--border);
  padding: 56px 24px 52px;
  text-align: center;
}

/* Boiseries décoratives en arrière-plan */
.auberge-hero-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 119px,
      rgba(92, 74, 58, .045) 119px,
      rgba(92, 74, 58, .045) 120px
    ),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 59px,
      rgba(92, 74, 58, .03) 59px,
      rgba(92, 74, 58, .03) 60px
    );
}
.auberge-hero-deco::after {
  content: '⚜';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 18rem;
  line-height: 1;
  color: rgba(92, 74, 58, .035);
  pointer-events: none;
}

.auberge-hero-inner {
  position: relative;
  max-width: 680px;
  margin: 0 auto;
}

.auberge-hero-eyebrow {
  font-family: var(--font-ui);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent-mid);
  margin-bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.auberge-hero-eyebrow::before,
.auberge-hero-eyebrow::after {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: var(--accent-mid);
}

.auberge-hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 12px;
  line-height: 1.1;
  letter-spacing: -.025em;
}
.auberge-hero-title em {
  font-style: italic;
  color: var(--accent);
}

.auberge-hero-sub {
  font-family: var(--font-body);
  font-style: italic;
  color: var(--text-muted);
  font-size: 1rem;
  margin: 0;
  line-height: 1.65;
}

/* ═══════════════════════════════════════════
   NAVIGATION SECTIONS (onglets)
   ═══════════════════════════════════════════ */
.auberge-nav-wrap {
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 60px;
  z-index: 20;
  box-shadow: 0 2px 8px rgba(42, 37, 32, .06);
}

.auberge-nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: center;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.auberge-nav::-webkit-scrollbar { display: none; }

.auberge-nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 14px 24px 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: border-color .18s, background .18s;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
}

.auberge-nav-tab:hover {
  background: var(--accent-light);
}

.auberge-nav-tab.active {
  border-bottom-color: var(--accent);
  background: var(--accent-light);
}

.auberge-nav-tab-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.auberge-nav-tab-label {
  font-family: var(--font-ui);
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-mid);
  transition: color .18s;
}

.auberge-nav-tab.active .auberge-nav-tab-label,
.auberge-nav-tab:hover .auberge-nav-tab-label {
  color: var(--accent);
}

.auberge-nav-tab-sub {
  font-family: var(--font-ui);
  font-size: .68rem;
  color: var(--text-muted);
  line-height: 1;
}

@media (max-width: 600px) {
  /* Plus de scroll horizontal : onglets icône-seulement + actif avec label */
  .auberge-nav {
    justify-content: flex-start;
    padding: 0;
    overflow-x: visible;
  }

  /* Supprime le fondu de scroll — devenu inutile */
  .auberge-nav-wrap {
    -webkit-mask-image: none;
    mask-image: none;
  }

  /* Onglet inactif : icône seule, largeur fixe */
  .auberge-nav-tab {
    flex: 0 0 44px;
    padding: 10px 0 8px;
  }

  /* Onglet actif : prend tout l'espace restant pour afficher le label */
  .auberge-nav-tab.active {
    flex: 1 1 auto;
    padding: 10px 10px 8px;
  }

  /* Cache le label sur les onglets inactifs */
  .auberge-nav-tab:not(.active) .auberge-nav-tab-label { display: none; }

  .auberge-nav-tab-sub   { display: none; }
  .auberge-nav-tab-icon  { font-size: 1.1rem; }
  .auberge-nav-tab-label { font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* ═══════════════════════════════════════════
   CORPS DE PAGE
   ═══════════════════════════════════════════ */
.auberge-body {
  max-width: 900px;
  margin: 0 auto;
  padding: 36px 20px 64px;
}

/* ═══════════════════════════════════════════
   SECTION (conteneur de chaque onglet)
   ═══════════════════════════════════════════ */
.auberge-section { display: block; }

.auberge-section--hidden { display: none; }

.auberge-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1.5px solid var(--border);
  flex-wrap: wrap;
}

.auberge-section-title {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 6px;
  line-height: 1.2;
}

.auberge-section-desc {
  font-family: var(--font-ui);
  font-size: .88rem;
  color: var(--text-muted);
  margin: 0;
  font-style: italic;
  line-height: 1.5;
  max-width: 540px;
}

.auberge-admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  border: 1.5px solid var(--border-strong);
  border-radius: 8px;
  font-family: var(--font-ui);
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-mid);
  text-decoration: none;
  white-space: nowrap;
  transition: border-color .15s, color .15s, background .15s;
  flex-shrink: 0;
}
.auberge-admin-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* ═══════════════════════════════════════════
   SECTION LA CRIÉE — liste d'annonces
   ═══════════════════════════════════════════ */
.auberge-card-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auberge-announce-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 0 18px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
  text-decoration: none;
  color: inherit;
  transition: border-color .18s, box-shadow .18s, transform .15s;
  position: relative;
  overflow: hidden;
}

.auberge-announce-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: 0;
  transition: opacity .18s;
}

.auberge-announce-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(92, 74, 58, .10);
  transform: translateY(-2px);
}
.auberge-announce-card:hover::before { opacity: 1; }

.auberge-announce-card-icon {
  font-size: 1.5rem;
  line-height: 1;
  padding-top: 2px;
  flex-shrink: 0;
}

.auberge-announce-card-body { min-width: 0; }

.auberge-announce-card-kind {
  font-family: var(--font-ui);
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent);
  margin-bottom: 5px;
}

.auberge-announce-card-title {
  font-family: var(--font-body);
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 7px;
  line-height: 1.35;
}

.auberge-announce-card-excerpt {
  font-family: var(--font-ui);
  font-size: .84rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.auberge-announce-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-family: var(--font-ui);
  font-size: .75rem;
  color: var(--text-muted);
}

.auberge-badge-closed {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(192, 57, 43, .08);
  color: var(--danger);
  font-size: .7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.auberge-announce-card-arrow {
  font-size: .85rem;
  color: var(--text-muted);
  align-self: center;
  transition: transform .15s, color .15s;
  flex-shrink: 0;
}
.auberge-announce-card:hover .auberge-announce-card-arrow {
  transform: translateX(3px);
  color: var(--accent);
}

/* ═══════════════════════════════════════════
   ÉTAT VIDE (criée sans annonces)
   ═══════════════════════════════════════════ */
.auberge-empty {
  text-align: center;
  padding: 64px 24px;
}
.auberge-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}
.auberge-empty-text {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-mid);
  margin: 0 0 8px;
}
.auberge-empty-sub {
  font-family: var(--font-ui);
  font-size: .875rem;
  color: var(--text-muted);
  font-style: italic;
  margin: 0;
}

/* ═══════════════════════════════════════════
   PLACEHOLDER "BIENTÔT DISPONIBLE"
   (sections Plat du Jour, Comptoir, Tables)
   ═══════════════════════════════════════════ */
.auberge-coming-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 72px 24px;
  background: var(--surface);
  border: 1.5px dashed var(--border-strong);
  border-radius: 16px;
}

.auberge-coming-soon-plate {
  font-size: 3rem;
  margin-bottom: 20px;
  filter: grayscale(20%);
}

.auberge-coming-soon-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 12px;
  font-style: italic;
}

.auberge-coming-soon-text {
  font-family: var(--font-ui);
  font-size: .9rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0 0 24px;
  max-width: 480px;
}

.auberge-coming-soon-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-light);
  color: var(--accent);
  border: 1.5px solid rgba(92, 74, 58, .2);
  font-family: var(--font-ui);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 999px;
}
.auberge-coming-soon-badge::before {
  content: '⏳';
  font-size: .85rem;
}

/* ═══════════════════════════════════════════
   BADGE (!) SUR LES ONGLETS
   ═══════════════════════════════════════════ */
.auberge-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: var(--danger, #c0392b);
  color: #fff;
  font-size: .6rem;
  font-weight: 800;
  border-radius: 999px;
  line-height: 1;
  margin-left: 5px;
  vertical-align: middle;
  flex-shrink: 0;
  animation: tdn-badge-pulse 2.4s ease-in-out infinite;
}

@keyframes tdn-badge-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(192, 57, 43, .45); }
  50%       { box-shadow: 0 0 0 5px rgba(192, 57, 43, 0); }
}

/* ═══════════════════════════════════════════
   COMPTEUR D'ARRIVANTS
   ═══════════════════════════════════════════ */
.tdn-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--accent-light);
  color: var(--accent);
  border: 1.5px solid rgba(92, 74, 58, .2);
  font-family: var(--font-ui);
  font-size: .75rem;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.tdn-count-badge::before { content: '🪑'; font-size: .8rem; }

/* ═══════════════════════════════════════════
   ÉTAT "PORTE FERMÉE" — formulaire de présentation
   ═══════════════════════════════════════════ */
.tdn-gate {
  position: relative;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  max-width: 740px;
  margin: 0 auto;
}

/* Lanternes décoratives */
.tdn-gate-deco {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: linear-gradient(90deg,
    var(--accent) 0%,
    rgba(92, 74, 58, .35) 40%,
    rgba(92, 74, 58, .35) 60%,
    var(--accent) 100%
  );
}

.tdn-gate-lantern {
  position: absolute;
  top: -1px;
  left: 32px;
  width: 2px;
  height: 22px;
  background: var(--accent);
  opacity: .5;
}
.tdn-gate-lantern--right {
  left: auto;
  right: 32px;
}

.tdn-gate-inner {
  padding: 48px 44px 44px;
  text-align: center;
}

.tdn-gate-icon {
  font-size: 2.8rem;
  margin-bottom: 16px;
  display: block;
  line-height: 1;
}

.tdn-gate-title {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3vw, 1.65rem);
  font-weight: 700;
  color: var(--accent);
  font-style: italic;
  margin: 0 0 12px;
  line-height: 1.2;
}

.tdn-gate-sub {
  font-family: var(--font-ui);
  font-size: .92rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0 0 36px;
}
.tdn-gate-sub strong { color: var(--text); }

/* ─── Formulaire ──── */
.tdn-form {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.tdn-form-question {
  background: var(--bg, #faf7f4);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px 20px;
  transition: border-color .18s;
}
.tdn-form-question:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(92, 74, 58, .08);
}

.tdn-form-question-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.tdn-form-question-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  line-height: 1;
}

.tdn-form-question-label {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
}

.tdn-form-question-hint {
  font-family: var(--font-ui);
  font-size: .8rem;
  color: var(--text-muted);
  font-style: italic;
  margin: 0 0 14px 30px;
  line-height: 1.55;
}

.tdn-form textarea {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: .92rem;
  color: var(--text);
  line-height: 1.6;
  resize: vertical;
  min-height: 80px;
  transition: border-color .15s;
  box-sizing: border-box;
}
.tdn-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.tdn-form textarea::placeholder { color: var(--text-muted); font-style: italic; }

.tdn-form-error {
  font-family: var(--font-ui);
  font-size: .78rem;
  color: var(--danger, #c0392b);
  margin: 6px 0 0;
}

.tdn-form-footer {
  display: flex;
  justify-content: center;
  padding-top: 4px;
}

.tdn-form-submit {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px 32px;
  font-family: var(--font-ui);
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s, transform .15s, box-shadow .18s;
  box-shadow: 0 4px 16px rgba(92, 74, 58, .22);
}
.tdn-form-submit:hover {
  background: var(--accent-dark, #4a3a2e);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(92, 74, 58, .32);
}
.tdn-form-submit-arrow {
  font-size: 1.1rem;
  transition: transform .18s;
}
.tdn-form-submit:hover .tdn-form-submit-arrow { transform: translateX(4px); }

/* ═══════════════════════════════════════════
   FIL DES PRÉSENTATIONS
   ═══════════════════════════════════════════ */
.tdn-feed {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ─── Carte de présentation (accordéon) ──── */
.tdn-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color .18s, box-shadow .18s;
}
.tdn-card:hover { border-color: rgba(92, 74, 58, .28); }
.tdn-card--mine {
  border-color: var(--accent);
  border-width: 2px;
}
.tdn-card--open {
  box-shadow: 0 4px 24px rgba(92, 74, 58, .10);
}

/* ── Barre de résumé (toujours visible) ── */
.tdn-card-summary {
  width: 100%;
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background .15s;
}
.tdn-card-summary:hover { background: var(--accent-light); }
.tdn-card--open .tdn-card-summary {
  background: linear-gradient(to right, var(--accent-light), transparent 70%);
  border-bottom: 1px solid var(--border);
}

.tdn-card-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: block;
}
.tdn-card-avatar--placeholder {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ui);
  font-size: .95rem;
  font-weight: 700;
  border: 2px solid var(--border);
  flex-shrink: 0;
}

.tdn-card-identity {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 110px;
}

.tdn-card-username {
  font-family: var(--font-body);
  font-size: .9rem;
  font-weight: 700;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.tdn-verified {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-size: .58rem;
  font-weight: 800;
  flex-shrink: 0;
}

.tdn-card-mine-badge {
  font-family: var(--font-ui);
  font-size: .65rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-light);
  border: 1px solid rgba(92, 74, 58, .2);
  padding: 1px 7px;
  border-radius: 999px;
}

.tdn-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.tdn-card-level {
  font-family: var(--font-ui);
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--accent);
  background: var(--accent-light);
  padding: 1px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

.tdn-card-date {
  font-family: var(--font-ui);
  font-size: .7rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Extrait (au centre, prend tout l'espace restant) */
.tdn-card-excerpt {
  font-family: var(--font-body);
  font-size: .84rem;
  color: var(--text-muted);
  margin: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-style: italic;
  min-width: 0;
}

/* Côté droit : compteur + chevron */
.tdn-card-summary-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.tdn-card-msg-count {
  font-family: var(--font-ui);
  font-size: .75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.tdn-card-chevron {
  font-size: .62rem;
  color: var(--text-muted);
  transition: transform .22s;
  flex-shrink: 0;
}
.tdn-card--open .tdn-card-chevron { transform: rotate(180deg); }
.tdn-card--open .tdn-card-msg-count { display: none; }

/* ── Détail accordéon ── */
.tdn-card-detail {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .28s ease;
}
.tdn-card--open .tdn-card-detail {
  grid-template-rows: 1fr;
}
.tdn-card-detail-inner {
  overflow: hidden;
}

/* ── Barre de lien profil ── */
.tdn-card-profile-bar {
  padding: 10px 18px 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.tdn-card-profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-ui);
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: color .15s, border-color .15s, background .15s;
}
.tdn-card-profile-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-light);
}

.tdn-card-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-ui);
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.tdn-card-edit-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-light);
}

/* ── Formulaire d'édition inline ── */
.tdn-edit-form {
  margin: 16px 18px 0;
  padding: 16px;
  background: var(--bg-alt, #f8f6f1);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.tdn-edit-form-inner .tdn-form-question { margin-bottom: 14px; }
.tdn-edit-form-inner .tdn-form-question:last-child { margin-bottom: 0; }
.tdn-edit-form-actions { margin-top: 16px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }


/* Corps : les 4 réponses */
.tdn-card-body {
  padding: 18px 20px 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  border-bottom: 1px solid var(--border);
}

@media (max-width: 640px) {
  .tdn-card-summary { grid-template-columns: auto 1fr auto; }
  .tdn-card-excerpt { display: none; }
  .tdn-card-body { grid-template-columns: 1fr; gap: 10px; }
}

.tdn-card-answer {
  background: var(--bg, #faf7f4);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}

.tdn-card-answer-q {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-ui);
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--accent);
  margin-bottom: 6px;
}

.tdn-card-answer-text {
  font-family: var(--font-body);
  font-size: .86rem;
  color: var(--text);
  line-height: 1.6;
  margin: 0;
  white-space: pre-wrap;
}

/* ═══════════════════════════════════════════
   ZONE DE COMMENTAIRES
   ═══════════════════════════════════════════ */

/* ── En-tête compact ── */
.tdn-comments-zone {
  padding: 16px 20px 22px;
}

.tdn-comments-zone-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.tdn-comments-zone-label {
  font-family: var(--font-ui);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
}

.tdn-msg-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--border);
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: .68rem;
  font-weight: 700;
}

/* ── Zone de saisie (légère, sans card-in-card) ── */
.tdn-write-area {
  background: var(--bg-alt, #f5f0eb);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.tdn-write-area .form-control {
  background: var(--surface);
}

/* ── (legacy, conservé pour rétrocompatibilité) ── */
.tdn-comments {
  padding: 18px 20px 20px;
  background: var(--surface);
}

.tdn-comments-header {
  font-family: var(--font-ui);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.tdn-comments-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 18px;
}

.tdn-comments-empty {
  font-family: var(--font-ui);
  font-size: .85rem;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: 12px 0;
  margin: 0;
}

/* Commentaire individuel */
.tdn-comment { position: relative; }
.tdn-comment--reply { margin-left: 44px; margin-top: 10px; }
.tdn-comment--deleted { opacity: .55; }

.tdn-comment-inner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.tdn-comment-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid var(--border);
}
.tdn-comment-avatar--placeholder {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ui);
  font-size: .8rem;
  font-weight: 700;
  flex-shrink: 0;
  border: 1.5px solid var(--border);
}

.tdn-comment-bubble {
  flex: 1;
  background: var(--bg, #faf7f4);
  border: 1px solid var(--border);
  border-radius: 0 10px 10px 10px;
  padding: 10px 14px;
  min-width: 0;
}

.tdn-comment-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.tdn-comment-author {
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.tdn-comment-author:hover { color: var(--accent); }

.tdn-comment-date {
  font-family: var(--font-ui);
  font-size: .72rem;
  color: var(--text-muted);
}

.tdn-comment-delete {
  margin-left: auto;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: .9rem;
  color: var(--text-muted);
  padding: 0 2px;
  line-height: 1;
  transition: color .15s;
}
.tdn-comment-delete:hover { color: var(--danger, #c0392b); }

.tdn-comment-text {
  font-family: var(--font-body);
  font-size: .88rem;
  color: var(--text);
  line-height: 1.6;
  margin: 0 0 6px;
  white-space: pre-wrap;
}

.tdn-comment-deleted-text {
  font-family: var(--font-ui);
  font-size: .82rem;
  color: var(--text-muted);
}

.tdn-comment-reply-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: .75rem;
  font-weight: 600;
  color: var(--accent);
  padding: 0;
  transition: opacity .15s;
}
.tdn-comment-reply-btn:hover { opacity: .75; }

/* Formulaire de commentaire */
.tdn-comment-form-wrap {
  margin-top: 4px;
}

.tdn-comment-form-inner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.tdn-comment-form-field { flex: 1; }

.tdn-comment-textarea {
  width: 100%;
  background: var(--bg, #faf7f4);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: .88rem;
  color: var(--text);
  line-height: 1.55;
  resize: vertical;
  box-sizing: border-box;
  transition: border-color .15s;
}
.tdn-comment-textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.tdn-comment-textarea::placeholder { color: var(--text-muted); font-style: italic; }

.tdn-comment-form-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  align-items: center;
}

.tdn-comment-submit {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 7px 18px;
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.tdn-comment-submit:hover { background: var(--accent-dark, #4a3a2e); }
.tdn-comment-submit:disabled { opacity: .5; cursor: not-allowed; }

.tdn-reply-cancel {
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: .8rem;
  color: var(--text-muted);
  padding: 0;
  transition: color .15s;
}
.tdn-reply-cancel:hover { color: var(--text); }

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 600px) {
  .auberge-body { padding: 24px 12px 48px; }
  .tdn-gate-inner { padding: 32px 16px 28px; }
  .tdn-form-question { padding: 18px 16px 16px; }
  .tdn-form-question-hint { margin-left: 0; }
  .tdn-card-summary { padding: 12px 14px; gap: 10px; }
  .tdn-card-body { padding: 14px; }
  .tdn-comments { padding: 14px; }
  .tdn-comment--reply { margin-left: 28px; }
  .tdn-modal { margin: 0 10px; max-width: calc(100vw - 20px); }
  .tdn-modal-head { padding: 18px 16px 16px; }
  .tdn-modal-body { padding: 16px; }
  .tdn-modal-slot { padding: 0 2px; }
  .tdn-c-registre { margin-left: 0; margin-right: 0; }
}

/* ═══════════════════════════════════════════
   DARK MODE
   ═══════════════════════════════════════════ */
[data-theme="dark"] .auberge-hero {
  background: rgba(92, 74, 58, .12);
}
[data-theme="dark"] .auberge-coming-soon {
  background: rgba(255, 255, 255, .03);
}
[data-theme="dark"] .auberge-nav-wrap {
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}

/* ═══════════════════════════════════════════
   TABLE DES NOUVEAUX — TABLE EN PERSPECTIVE
   + REGISTRE DU FORESTIER + MODAL PARCHEMIN
   ═══════════════════════════════════════════ */

/* ── Scène 3D ── */
.tdn-scene {
  perspective: 1000px;
  padding: 24px 0 64px;
}

.tdn-table {
  position: relative;
  background:
    repeating-linear-gradient(88deg, transparent, transparent 34px, rgba(0,0,0,.08) 34px, rgba(0,0,0,.08) 36px),
    repeating-linear-gradient(2deg, transparent, transparent 54px, rgba(0,0,0,.05) 54px, rgba(0,0,0,.05) 56px),
    linear-gradient(155deg, #3a2208 0%, #5c3820 45%, #432810 100%);
  border-radius: 10px;
  padding: 52px 40px 64px;
  transform: rotateX(16deg);
  transform-origin: top center;
  box-shadow:
    0 0 0 14px #2a1608,
    0 0 0 17px #7a5230,
    0 0 0 20px #4a2f10,
    0 28px 70px rgba(0,0,0,.7);
  min-height: 280px;
  display: flex;
  flex-wrap: wrap;
  gap: 32px 40px;
  align-items: center;
  justify-content: center;
}

.tdn-table::before {
  content: '';
  position: absolute; inset: 0; border-radius: 10px;
  background:
    radial-gradient(ellipse at 25% 30%, rgba(255,200,80,.06) 0%, transparent 55%),
    radial-gradient(ellipse at 75% 70%, rgba(255,180,60,.04) 0%, transparent 45%);
  pointer-events: none;
}

/* ── Bougies ── */
.tdn-candles {
  position: absolute;
  top: 18px; left: 28px;
  display: flex; gap: 20px;
}
.tdn-candle { display: flex; flex-direction: column; align-items: center; position: relative; }
.tdn-flame {
  width: 9px; height: 16px;
  background: radial-gradient(ellipse at 50% 85%, #fff8e1 0%, #ffe066 30%, #ff8c00 60%, transparent 100%);
  border-radius: 50% 50% 30% 30%;
  animation: tdn-flicker 2.1s ease-in-out infinite alternate;
  filter: blur(.3px);
  margin-bottom: -1px;
}
.tdn-candle-body {
  width: 12px; height: 34px;
  background: linear-gradient(180deg, #f5f0e0 0%, #c8b88a 100%);
  border-radius: 2px;
  box-shadow: inset -2px 0 4px rgba(0,0,0,.2);
}
.tdn-candle-glow {
  position: absolute; top: -14px; left: 50%;
  transform: translateX(-50%);
  width: 60px; height: 60px;
  background: radial-gradient(ellipse, rgba(255,210,60,.22) 0%, transparent 70%);
  animation: tdn-glow-pulse 2.1s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes tdn-flicker {
  0%   { transform: scaleX(1)   scaleY(1)    rotate(0deg); }
  25%  { transform: scaleX(.88) scaleY(1.06) rotate(-1.5deg); }
  60%  { transform: scaleX(1.1) scaleY(.94)  rotate(1deg); }
  100% { transform: scaleX(.92) scaleY(1.09) rotate(-0.5deg); }
}
@keyframes tdn-glow-pulse {
  0%   { opacity: .7; transform: translateX(-50%) scale(1); }
  100% { opacity: 1;  transform: translateX(-50%) scale(1.18); }
}

/* ── Objet posé sur la table ── */
.tdn-obj {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  cursor: pointer;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1);
  user-select: none;
}
.tdn-obj:hover { transform: translateY(-10px) scale(1.08); }

/* ── Assiette en céramique ── */
.tdn-plate {
  position: relative;
  width: 72px; height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #f5f2ec 0%, #e4ddd0 50%, #c8c0b0 100%);
  box-shadow:
    inset 0 0 0 6px rgba(160,145,120,.22),
    inset 0 0 0 11px rgba(200,190,170,.10),
    0 6px 18px rgba(0,0,0,.65),
    0 2px 4px rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center;
  transition: filter .25s;
}
.tdn-obj:hover .tdn-plate {
  filter: drop-shadow(0 0 14px rgba(255,210,80,.5)) drop-shadow(0 4px 10px rgba(0,0,0,.5));
}
.tdn-obj.tdn-obj--selected .tdn-plate {
  filter: drop-shadow(0 0 20px rgba(255,210,80,.85)) drop-shadow(0 4px 10px rgba(0,0,0,.5));
}

/* ── Petite lettre / menu sur l'assiette ── */
.tdn-letter {
  position: relative;
  width: 38px; height: 29px;
  background: #f8f4ea;
  border: 1px solid rgba(120,90,40,.22);
  border-radius: 1px;
  box-shadow: 1px 2px 8px rgba(0,0,0,.5), 0 1px 2px rgba(0,0,0,.25);
  display: flex; flex-direction: column;
  align-items: flex-start;
  padding: 5px 5px 4px; gap: 3px;
  overflow: hidden;
}
.tdn-letter::after {
  content: '';
  position: absolute; top: 0; right: 0;
  width: 9px; height: 9px;
  background: linear-gradient(225deg, rgba(160,120,60,.3) 0%, transparent 65%);
}
.tdn-letter-initial {
  font-family: var(--font-display);
  font-size: .62rem; font-weight: 700; font-style: italic;
  color: rgba(80,50,20,.52); line-height: 1;
}
.tdn-letter-line { height: 1.5px; background: rgba(80,50,20,.16); border-radius: 1px; width: 90%; }
.tdn-letter-line:nth-child(3) { width: 72%; }
.tdn-letter-line:nth-child(4) { width: 82%; }

/* Rotations des lettres (cycle dans le template) */
.tdn-letter--r1 { transform: rotate(-4deg); }
.tdn-letter--r2 { transform: rotate(3deg); }
.tdn-letter--r3 { transform: rotate(-6deg); }
.tdn-letter--r4 { transform: rotate(2deg); }
.tdn-letter--r5 { transform: rotate(-5deg); }
.tdn-letter--r6 { transform: rotate(4deg); }
.tdn-letter--r7 { transform: rotate(-7deg); }
.tdn-letter--r8 { transform: rotate(-2deg); }

/* ── Avatar photo sur l'assiette ── */
.tdn-plate-avatar {
  width: 54px; height: 54px; border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,.35);
  box-shadow: 0 2px 8px rgba(0,0,0,.5);
}

/* ── Label sous l'assiette ── */
.tdn-obj-label {
  font-family: var(--font-ui); font-size: .62rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  color: rgba(255,245,228,.85);
  text-shadow: 0 1px 4px rgba(0,0,0,.95), 0 0 10px rgba(0,0,0,.8);
  white-space: nowrap;
}

/* ── Note manuscrite (styles visuels partagés) ── */
.tdn-obj-note {
  width: 210px;
  background: #f8f3e8;
  border: 1px solid #c8b48a;
  border-radius: 2px;
  padding: 16px 18px 14px;
  box-shadow: 3px 3px 0 rgba(180,150,100,.25), 0 10px 28px rgba(0,0,0,.5);
  pointer-events: none;
  opacity: 0;
}
.tdn-obj-note::after {
  content: '';
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 7px solid transparent; border-top-color: #c8b48a;
}

/* ── Tooltip flottant (position:fixed — échappe au stacking context 3D) ── */
#tdn-tooltip {
  position: fixed;
  z-index: 1070;
  transition: opacity .18s;
}
#tdn-tooltip.is-visible { opacity: 1; }

/* Rotation calée sur la lettre dans l'assiette */
.tdn-obj-note--r1 { --note-rot: -4deg; }
.tdn-obj-note--r2 { --note-rot:  3deg; }
.tdn-obj-note--r3 { --note-rot: -6deg; }
.tdn-obj-note--r4 { --note-rot:  2deg; }
.tdn-obj-note--r5 { --note-rot: -5deg; }
.tdn-obj-note--r6 { --note-rot:  4deg; }
.tdn-obj-note--r7 { --note-rot: -7deg; }
.tdn-obj-note--r8 { --note-rot: -2deg; }
.note-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent-dark, #5c3d1e); color: #f5f0e8;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-ui); font-size: .9rem; font-weight: 700;
  float: right; margin: 0 0 8px 10px; border: 2px solid #c8b48a;
}
.note-avatar--img {
  object-fit: cover; display: block;
  background: none; font-size: 0;
}
.note-name {
  font-family: var(--font-display); font-size: .92rem; font-weight: 700;
  color: #2a1608; margin-bottom: 2px; line-height: 1.2;
}
.note-level {
  font-family: var(--font-ui); font-size: .58rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: #8b6030; margin-bottom: 8px;
}
.note-text {
  font-size: .76rem; color: #4a3020; font-style: italic; line-height: 1.55; clear: both;
}
.note-join {
  font-family: var(--font-ui); font-size: .58rem; color: #a08050; margin-top: 8px; text-align: right;
}

/* ═══════════════════════════════════════════
   REGISTRE DU FORESTIER
   ═══════════════════════════════════════════ */
.tdn-c-registre {
  position: relative;
  background: var(--surface);
  border-radius: 4px;
  box-shadow:
    0 0 0 10px #2a1608,
    0 0 0 13px #7a5230,
    0 0 0 15px #4a2f10,
    0 16px 48px rgba(0,0,0,.6);
  overflow: hidden;
  margin-top: 56px;
}

.tdn-c-spine {
  position: absolute; left: 0; top: 0; bottom: 0; width: 32px;
  background: linear-gradient(180deg, #3a2208 0%, #5c3820 50%, #2a1608 100%);
  border-right: 1px solid rgba(255,200,80,.1);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  z-index: 2;
}
.tdn-c-spine-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(200,160,80,.35); box-shadow: 0 0 4px rgba(200,160,80,.2);
}

.tdn-c-header {
  padding: 22px 28px 20px 52px;
  border-bottom: 2px solid rgba(92,61,30,.5);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: linear-gradient(135deg, #261408 0%, #3d2210 55%, #2a1608 100%);
}
.tdn-c-title-wrap { min-width: 0; }
.tdn-c-eyebrow {
  font-family: var(--font-ui); font-size: .6rem; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase;
  color: rgba(200,170,110,.65); margin-bottom: 4px;
}
.tdn-c-title {
  font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; font-style: italic;
  color: #d4b878;
}
.tdn-c-seal-large {
  flex-shrink: 0;
  width: 60px; height: 60px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #9a3a28 0%, #7a2818 50%, #4a1008 100%);
  display: flex; align-items: center; justify-content: center; font-size: 1.6rem;
  box-shadow: inset -3px -3px 8px rgba(0,0,0,.5), inset 2px 2px 5px rgba(255,120,80,.12), 0 4px 12px rgba(0,0,0,.6);
}

.tdn-c-entries { padding: 0 28px 0 52px; }

.tdn-c-entry {
  position: relative;
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(92,61,30,.18);
  cursor: pointer;
  transition: background .15s, padding-left .15s;
}
.tdn-c-entry:hover { background: rgba(92,61,30,.07); padding-left: 6px; }
.tdn-c-entry:last-child { border-bottom: none; }

.tdn-c-entry-avatar {
  flex-shrink: 0; margin-top: 2px;
  width: 36px; height: 36px; border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(92,61,30,.28);
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
}
.tdn-c-entry-avatar--initial {
  background: var(--accent-dark, #5c3d1e); color: #f5f0e8;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-ui); font-size: .82rem; font-weight: 700;
}
.tdn-c-entry-body { flex: 1; min-width: 0; }

.tdn-c-entry-num {
  position: absolute; left: -38px; top: 18px;
  font-family: var(--font-ui); font-size: .58rem; color: rgba(200,160,80,.25); letter-spacing: .04em;
}
.tdn-c-entry-top {
  display: flex; align-items: baseline; gap: 14px; margin-bottom: 8px; flex-wrap: wrap;
}
.tdn-c-entry-name {
  font-family: var(--font-display); font-size: 1rem; font-weight: 700; font-style: italic; color: var(--text-primary);
}
.tdn-c-entry-dash { color: var(--border-strong); flex-shrink: 0; }
.tdn-c-entry-level {
  font-family: var(--font-ui); font-size: .62rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: var(--accent-mid);
}
.tdn-c-entry-date {
  font-family: var(--font-ui); font-size: .68rem; color: var(--text-muted); margin-left: auto; white-space: nowrap;
}
.tdn-c-entry-excerpt {
  font-family: var(--font-body); font-size: .85rem;
  color: var(--text-muted); font-style: italic; line-height: 1.6;
  padding-left: 12px; border-left: 2px solid rgba(92,61,30,.25);
}

/* ═══════════════════════════════════════════
   SÉPARATEUR ÉCHANGES
   ═══════════════════════════════════════════ */
.tdn-exchanges-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin: 64px 0 24px;
  padding: 0 0 16px;
  border-bottom: 1.5px solid var(--border);
  font-family: var(--font-display); font-size: 1.2rem;
  font-weight: 700; font-style: italic; color: var(--accent-mid);
}

/* ═══════════════════════════════════════════
   MODAL PARCHEMIN
   ═══════════════════════════════════════════ */
.tdn-modal-backdrop {
  position: fixed; inset: 0; z-index: 1100;
  background: rgba(10,7,4,.78);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.tdn-modal-backdrop.open { opacity: 1; pointer-events: all; }

.tdn-modal {
  position: relative;
  max-width: 640px; width: 100%;
  max-height: 88vh; overflow-y: auto;
  background: #f5f0e4; border-radius: 2px; padding: 0;
  box-shadow: 0 0 0 1px #c8b48a, 4px 4px 0 rgba(180,150,100,.3), 0 24px 64px rgba(0,0,0,.7);
  transform: translateY(18px) rotate(.4deg);
  transition: transform .28s cubic-bezier(.34,1.56,.64,1);
}
.tdn-modal-backdrop.open .tdn-modal { transform: translateY(0) rotate(.4deg); }

.tdn-modal::before {
  content: '';
  position: absolute; inset: 0; border-radius: 2px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.68' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23p)' opacity='0.07'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 220px 220px;
  pointer-events: none; z-index: 0;
}

.tdn-modal-ribbon {
  background: linear-gradient(90deg, #7a2818 0%, #a03828 50%, #7a2818 100%);
  height: 6px; width: 100%; border-radius: 2px 2px 0 0; position: relative; z-index: 1;
}

.tdn-modal-head {
  position: relative; z-index: 1;
  padding: 24px 28px 20px;
  border-bottom: 1px solid rgba(120,90,40,.25);
  display: flex; align-items: flex-start; gap: 18px;
}
.tdn-modal-medallion {
  flex-shrink: 0; width: 64px; height: 64px; border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #a04030 0%, #7a2820 55%, #4a1008 100%);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 700;
  color: rgba(255,220,200,.85); font-style: italic;
  box-shadow: inset -3px -3px 8px rgba(0,0,0,.45), inset 2px 2px 6px rgba(255,120,80,.12), 0 4px 12px rgba(0,0,0,.45);
}
.tdn-modal-head-text { flex: 1; min-width: 0; }
.tdn-modal-name {
  font-family: var(--font-display); font-size: 1.35rem; font-weight: 700;
  color: #2a1608; margin-bottom: 4px; line-height: 1.2;
}
.tdn-modal-meta {
  font-family: var(--font-ui); font-size: .72rem; color: #7a5030;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.tdn-modal-level {
  background: rgba(120,80,30,.15); border: 1px solid rgba(120,80,30,.3);
  padding: 2px 9px; border-radius: 999px;
  font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
}
.tdn-modal-close {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  background: transparent; border: none; cursor: pointer;
  font-size: 1.1rem; color: #a08060; transition: color .15s; line-height: 1; padding: 4px;
}
.tdn-modal-close:hover { color: #5a2010; }

.tdn-modal-body {
  position: relative; z-index: 1;
  padding: 22px 28px 24px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
@media (max-width: 520px) { .tdn-modal-body { grid-template-columns: 1fr; } }

.tdn-modal-qa {
  background: #ede8d8; border: 1px solid rgba(120,90,40,.2);
  border-radius: 3px; padding: 14px 16px;
  position: relative; z-index: 1;
}
.tdn-modal-qa-q {
  font-family: var(--font-ui); font-size: .62rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em; color: #8b5030; margin-bottom: 8px;
}
.tdn-modal-qa-a {
  font-family: var(--font-body); font-size: .88rem;
  color: #3a2010; line-height: 1.7; white-space: pre-wrap;
}

/* Lien profil dans l'en-tête du modal */
.tdn-modal-head-profile {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 8px;
  padding: 2px 10px; border-radius: 999px;
  background: rgba(120,80,30,.1); border: 1px solid rgba(120,80,30,.28);
  font-family: var(--font-ui); font-size: .67rem; font-weight: 600; letter-spacing: .04em;
  color: #7a5030; text-decoration: none;
  transition: background .15s, color .15s;
}
.tdn-modal-head-profile:hover {
  background: rgba(120,80,30,.2); color: #4a2810; text-decoration: none;
}

/* ── Modal slot (commentaires + édition dans la lettre) ── */
.tdn-modal-slot {
  position: relative; z-index: 1;
  padding: 0 14px 16px;
  border-top: 1px solid rgba(120,90,40,.18);
}
.tdn-modal-slot .tdn-card-profile-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 0 10px;
  border-bottom: 1px solid rgba(120,90,40,.12);
  margin-bottom: 12px;
}
.tdn-modal-slot .tdn-card-profile-btn,
.tdn-modal-slot .tdn-card-edit-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: 999px;
  font-family: var(--font-ui); font-size: .72rem; font-weight: 600;
  text-decoration: none; cursor: pointer; transition: background .15s; border: none;
}
.tdn-modal-slot .tdn-card-profile-btn {
  background: rgba(120,80,30,.12); border: 1px solid rgba(120,80,30,.28); color: #5a3010;
}
.tdn-modal-slot .tdn-card-profile-btn:hover { background: rgba(120,80,30,.22); color: #5a3010; }
.tdn-modal-slot .tdn-card-edit-btn {
  background: rgba(92,61,30,.08); border: 1px solid rgba(92,61,30,.22); color: #4a2808;
}
.tdn-modal-slot .tdn-card-edit-btn:hover { background: rgba(92,61,30,.18); }
.tdn-modal-slot .tdn-edit-form { margin-bottom: 14px; }
.tdn-modal-slot .tdn-comments-zone-header {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-ui); font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: #8b5030;
  margin-bottom: 10px;
}
.tdn-modal-slot .tdn-write-area { margin-bottom: 12px; }
.tdn-modal-slot .tdn-write-area textarea {
  background: rgba(245,240,228,.8); border: 1px solid rgba(120,90,40,.3);
  font-family: var(--font-body); font-size: .875rem; color: #2a1608;
  border-radius: 4px; width: 100%;
}
.tdn-modal-slot .tdn-write-area textarea:focus {
  background: #fff9ef; border-color: rgba(120,80,30,.5);
  box-shadow: 0 0 0 3px rgba(120,80,30,.12); outline: none;
}

/* Avatars réduits dans le slot pour économiser de la largeur */
.tdn-modal-slot .comment-avatar img,
.tdn-modal-slot .comment-avatar .avatar-placeholder { width: 32px !important; height: 32px !important; }
.tdn-modal-slot .comment-avatar { margin-right: .6rem !important; }
.tdn-modal-slot .reply-avatar img,
.tdn-modal-slot .reply-avatar .avatar-placeholder-small { width: 24px !important; height: 24px !important; }
.tdn-modal-slot .reply-avatar { margin-right: .5rem !important; }

.tdn-modal-slot .comment-item,
.tdn-modal-slot .comment-reply { font-size: .84rem; }

/* Formulaire de réponse pleine largeur — brise l'indentation de l'avatar */
.tdn-modal-slot .reply-form {
  margin-left: calc(-32px - .6rem);
  width: calc(100% + 32px + .6rem);
}

/* ── Vide du registre ── */
.tdn-c-empty {
  padding: 20px 0;
  font-family: var(--font-ui); font-size: .8rem; color: #8b7050; font-style: italic;
  text-align: center;
}

/* ── Responsive ── */
@media (max-width: 700px) {
  .tdn-table { transform: rotateX(8deg); padding: 36px 16px 44px; gap: 20px 24px; }
  .tdn-candles { display: none; }
  .tdn-c-header { padding: 18px 16px 16px 48px; }
  .tdn-c-entries { padding: 0 16px 0 48px; }
  .tdn-c-entry-date { display: none; }
  .tdn-c-registre { margin-top: 40px; }
  .tdn-scene { margin: 0 -4px; }
}


/* ══════════════════════════════════════════════════════════════
   LE COMPTOIR — liste des conversations éphémères
   ══════════════════════════════════════════════════════════════ */

.cpt-section { overflow: hidden; }

.cpt-intro {
  text-align: center;
  margin-bottom: 1.5rem;
}
.cpt-intro-text {
  font-family: var(--font-body);
  font-style: italic;
  color: var(--text-muted);
  font-size: .9rem;
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ── Scène du bar ──────────────────────────────────────────── */
.cpt-scene-wrap {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #221208;
  box-shadow: 0 8px 32px rgba(0,0,0,.22);
}

/* ── Mur du fond ─────────────────────────────────────────── */
.cpt-backwall {
  background: linear-gradient(180deg, #1a0e06 0%, #281608 60%, #361e0e 100%);
  padding: 1.25rem 2rem 1rem;
  position: relative;
  overflow: hidden;
}
.cpt-backwall::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(255,255,255,.018) 39px, rgba(255,255,255,.018) 40px);
  pointer-events: none;
}
.cpt-backwall::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #3a1a08, #6a3010, #8a4818, #6a3010, #3a1a08);
}
.cpt-backwall-shelf {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .5rem 1.25rem;
  margin-bottom: .6rem;
}
.cpt-deco {
  font-size: 1.35rem;
  line-height: 1;
  animation: cpt-deco-sway 3s ease-in-out infinite;
  animation-delay: var(--d, 0s);
  display: inline-block;
}
@keyframes cpt-deco-sway {
  0%, 100% { transform: rotate(-1.5deg) translateY(0); }
  50%       { transform: rotate(1.5deg) translateY(-2px); }
}
.cpt-backwall-sign {
  text-align: center;
  font-family: var(--font-display);
  font-size: .74rem;
  font-style: italic;
  color: rgba(218,190,140,.65);
  letter-spacing: .1em;
}

/* ── Zone bar (scrollable horizontalement) ──────────────── */
.cpt-bar-area {
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: thin;
  scrollbar-color: #3a1a08 transparent;
  padding-bottom: .5rem;
}
.cpt-bar-area::-webkit-scrollbar { height: 4px; }
.cpt-bar-area::-webkit-scrollbar-track { background: transparent; }
.cpt-bar-area::-webkit-scrollbar-thumb { background: #3a1a08; border-radius: 2px; }

.cpt-stations-row {
  display: flex;
  gap: 1.1rem;
  min-width: min-content;
  padding-top: 0;
}

/* ── Station individuelle ──────────────────────────────── */
.cpt-station {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  flex: 0 0 auto;
  width: 140px;
  transition: transform .22s ease, box-shadow .22s ease;
  position: relative;
}
.cpt-station:hover {
  transform: translateY(-6px);
  box-shadow:
    0 12px 32px rgba(0,0,0,.55),
    0 4px 10px rgba(0,0,0,.35);
  text-decoration: none;
  color: inherit;
}
.cpt-station--expired { opacity: .55; filter: grayscale(.4); }

/* Dessus du bar (set de table + bougie) — hauteur égale grâce à flex:1 */
.cpt-station-top {
  flex: 1;
  width: 100%;
  background: #5c3a1e;
  border-radius: 6px 6px 0 0;
  border-top: 2px solid #7a4a24;
  border-left: 1px solid #4a2e12;
  border-right: 1px solid #4a2e12;
  padding: .6rem .55rem .5rem;
  display: flex;
  align-items: flex-start;
  gap: .4rem;
  position: relative;
  min-height: 110px;
  isolation: isolate; /* stacking context local pour z-index ::after vs bougie */
}
/* Lueur chaude de la bougie sur le bois */
.cpt-station-top::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 6px 6px 0 0;
  background: radial-gradient(ellipse at 82% 55%, rgba(255,150,30,.28) 0%, rgba(255,90,10,.08) 40%, transparent 68%);
  animation: cpt-light-flicker 1.8s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0; /* derrière la bougie (z-index:1) et le set de table (z-index:1) */
}
.cpt-station--expired .cpt-station-top::after { opacity: 0; }
@keyframes cpt-light-flicker {
  0%   { opacity: .65; }
  30%  { opacity: 1;   }
  60%  { opacity: .5;  }
  100% { opacity: .8;  }
}
.cpt-station-top--new {
  justify-content: space-between;
  background: #3a2210;
  border-color: #5a3414;
  border-style: dashed;
}

/* Infos de la conversation — "set de table" sur le bois */
.cpt-station-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;

  /* Placemat parcheminé */
  background: linear-gradient(155deg, #f9eed8 0%, #eedcc2 100%);
  border-radius: 10px;
  padding: 9px 10px 8px;
  border: 1px solid rgba(140,90,35,.3);
  box-shadow:
    0 2px 6px rgba(0,0,0,.25),
    inset 0 1px 0 rgba(255,255,255,.6),
    -2px 3px 12px rgba(160,65,10,.28);
  text-align: center;
  animation: cpt-shadow-flicker 1.8s ease-in-out infinite alternate;
}
@keyframes cpt-shadow-flicker {
  0%   { box-shadow: 0 2px 6px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.6), -2px  3px 12px rgba(160,65,10,.28); }
  30%  { box-shadow: 0 2px 8px rgba(0,0,0,.30), inset 0 1px 0 rgba(255,255,255,.6), -3px  4px 16px rgba(200,85,15,.38); }
  60%  { box-shadow: 0 2px 5px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.6), -1px  2px  9px rgba(130,50, 8,.20); }
  100% { box-shadow: 0 2px 7px rgba(0,0,0,.26), inset 0 1px 0 rgba(255,255,255,.6), -2px  3px 11px rgba(175,70,12,.30); }
}
/* Filet intérieur (nappe) */
.cpt-station-info::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 7px;
  border: 1px dashed rgba(140,90,35,.18);
  pointer-events: none;
}
.cpt-station-sujet {
  font-family: var(--font-display);
  font-size: .78rem;
  font-style: italic;
  color: #2c1608;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cpt-station-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .2rem .35rem;
  font-size: .62rem;
  color: rgba(80, 45, 12, .65);
  font-family: var(--font-ui);
}
.cpt-full-badge {
  background: #8a2020;
  color: #ffd0d0;
  font-size: .56rem;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* Tranche avant du bar */
.cpt-station-edge {
  flex: 0 0 auto;
  width: 100%;
  height: 14px;
  background: linear-gradient(180deg, #4a2a10 0%, #3a1e08 100%);
  border-left: 1px solid #2a1208;
  border-right: 1px solid #2a1208;
}
.cpt-station-edge--new {
  background: linear-gradient(180deg, #2a1a08 0%, #1e1208 100%);
}

/* Zone tabouret */
.cpt-station-stool {
  flex: 0 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
  padding-top: .3rem;
}
.cpt-stool-slot { flex: 0 0 120px; }

.cpt-tabouret-seat {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #4a2e14;
  border: 3px solid #6a4020;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.cpt-tabouret-seat--empty {
  background: #2a1a08;
  border-style: dashed;
  border-color: #5a3818;
}
.cpt-tabouret-empty-icon {
  font-size: 1.4rem;
  color: rgba(180,130,70,.5);
  line-height: 1;
}
.cpt-tabouret-avatar {
  width: 100%; height: 100%;
  object-fit: cover;
}
.cpt-tabouret-initial {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: .95rem;
  color: #dba070;
  text-transform: uppercase;
}

.cpt-tabouret-legs {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.cpt-tabouret-legs-pair {
  display: flex;
  gap: 16px;
}
.cpt-tabouret-leg {
  width: 5px;
  height: 28px;
  background: linear-gradient(180deg, #6a4020, #3a2010);
  border-radius: 2px 2px 3px 3px;
  transform: skewX(var(--skew, 0deg));
}
.cpt-tabouret-legs-pair .cpt-tabouret-leg:first-child { --skew: -4deg; }
.cpt-tabouret-legs-pair .cpt-tabouret-leg:last-child  { --skew: 4deg; }
.cpt-tabouret-rung {
  width: 26px;
  height: 3px;
  background: #5a3018;
  border-radius: 2px;
  margin-top: -16px;
}
.cpt-stool-name {
  font-family: var(--font-ui);
  font-size: .6rem;
  color: rgba(200,160,100,.7);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}
.cpt-stool-name--muted { color: rgba(180,130,70,.4); font-style: italic; }

/* Nouvelle conversation */
.cpt-new-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: .3rem;
}
.cpt-new-plus {
  font-size: 2rem;
  line-height: 1;
  color: rgba(180,130,70,.5);
  font-weight: 300;
}
.cpt-new-label {
  font-family: var(--font-ui);
  font-size: .68rem;
  color: rgba(180,130,70,.55);
  text-align: center;
  line-height: 1.3;
}

/* ── Bougie (indicateur temps restant) ───────────────────── */
.cpt-bougie {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin-top: auto;
  position: relative;
  z-index: 1;
}
.cpt-bougie--eteinte .cpt-flamme    { opacity: 0; }
.cpt-bougie--eteinte .cpt-lueur     { opacity: 0; }
.cpt-bougie--eteinte .cpt-lueur-amb { opacity: 0; animation: none; }
.cpt-bougie--eteinte .cpt-cire      { opacity: .55; filter: grayscale(.6); }
.cpt-bougie--virgin  .cpt-flamme    { opacity: .35; }
.cpt-bougie--virgin  .cpt-lueur     { opacity: .35; }
.cpt-bougie--virgin  .cpt-lueur-amb { opacity: .4; }

/* Halo ambiant pulsant — chaleur rayonnante de la flamme */
.cpt-lueur-amb {
  position: absolute;
  width: 48px;
  height: 52px;
  left: 50%;
  top: -38%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(215, 88, 8, .42);
  filter: blur(14px);
  pointer-events: none;
  z-index: 0;
  animation: cpt-blink-amb .13s infinite;
}
@keyframes cpt-blink-amb { 50% { opacity: .70; } }

/* Flamme — forme larme réaliste, cœur blanc, extérieur orange */
.cpt-flamme {
  width:  calc(5px  + var(--candle-h, 80) * 0.065px);
  height: calc(8px  + var(--candle-h, 80) * 0.115px);
  background: linear-gradient(white 62%, rgba(255,160,0,.18) 100%);
  border-radius: 50% 50% 20% 20%;
  transform-origin: 50% 100%;
  animation: cpt-flicker 1.8s ease-in-out infinite alternate;
  opacity: clamp(.45, calc(var(--candle-h, 80) / 100 + .35), 1);
  position: relative;
  z-index: 3;
  filter:
    drop-shadow(0 0 4px rgba(255,110,0,.82))
    drop-shadow(0 -2px 6px rgba(255,200,0,.58));
}
/* Halo orange externe */
.cpt-flamme::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow:
    0 0 8px 2px rgba(247, 93, 0, .45),
    0 -5px 4px rgba(247,140, 0, .65);
}
/* Cœur blanc interne */
.cpt-flamme::after {
  content: '';
  position: absolute;
  width: 36%;
  height: 54%;
  left: 32%;
  bottom: 9%;
  border-radius: 50% 50% 25% 25%;
  background: rgba(255,255,240,.82);
}
@keyframes cpt-flicker {
  0%   { transform: scaleX(1)    scaleY(1)    rotate(-1.5deg);
         filter: drop-shadow(0 0 3px rgba(255,120,0,.80)) drop-shadow(0 -2px 5px rgba(255,200,0,.50)); }
  20%  { transform: scaleX(.88)  scaleY(1.08) rotate(1.8deg); }
  50%  { transform: scaleX(1.07) scaleY(.94)  rotate(-2deg);
         filter: drop-shadow(0 0 5px rgba(255, 78,0,.88)) drop-shadow(0 -3px 7px rgba(255,220,0,.60)); }
  75%  { transform: scaleX(.93)  scaleY(1.05) rotate(1deg); }
  100% { transform: scaleX(1.02) scaleY(.98)  rotate(.5deg);
         filter: drop-shadow(0 0 4px rgba(255,100,0,.82)) drop-shadow(0 -2px 6px rgba(255,210,0,.54)); }
}

/* Lueur bleue à la base de la flamme (réaliste — le bas d'une vraie flamme est bleu) */
.cpt-lueur {
  width:  calc(7px + var(--candle-h, 80) * 0.050px);
  height: calc(4px + var(--candle-h, 80) * 0.033px);
  border-radius: 50% 50% 35% 35%;
  background: rgba(65, 130, 255, .52);
  box-shadow:
    0 -8px 10px rgba(220,138,12,.62),
    0  6px 14px rgba(220,138,12,.48);
  position: relative;
  z-index: 2;
  margin-top: -1px;
}
.cpt-lueur::before {
  content: '';
  position: absolute;
  width: 58%;
  height: 52%;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(0,0,0,.26);
}

/* Mèche — fil tressé aux tons chauds */
.cpt-meche {
  width: 2px;
  height: clamp(3px, calc(2px + var(--candle-h, 80) * 0.045px), 7px);
  border-radius: 40% 40% 0 0;
  background: linear-gradient(180deg, #d69448 0%, #3c1e28 48%, #0e0a06 100%);
  position: relative;
  z-index: 2;
  margin-top:    -1px;
  margin-bottom: -1px;
}

/* Corps de cire — gradient chaud inspiré de la référence */
.cpt-cire {
  width: 14px;
  background: linear-gradient(180deg,
    #e48825  0%,
    #c47010 18%,
    #8e3c08 40%,
    #4c1a03 65%,
    #1c0900 100%
  );
  height: calc(4px + var(--candle-h, 80) * 0.40px);
  min-height: 4px;
  max-height: 38px;
  border-radius: 2px 2px 1px 1px;
  position: relative;
  box-shadow:
    inset -3px 0 5px rgba(0,0,0,.42),
    inset  1px 0 3px rgba(255,185,70,.14),
    /* mare de cire fondue sur le dessus */
    0 -3px 0 clamp(1px, calc(1px + (100 - var(--candle-h,80)) * 0.045px), 5px) rgba(210,130,32,.60);
}
.cpt-cire--full { height: 38px; }

/* Traînée gauche */
.cpt-cire::before {
  content: '';
  position: absolute;
  top: 0;
  left: -2px;
  width: 3px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(180deg, rgba(228,172,74,.95) 0%, rgba(210,148,58,.70) 55%, transparent 100%);
  height: clamp(0px, calc((100 - var(--candle-h, 80)) * 0.36px), 28px);
  opacity: clamp(0, calc((100 - var(--candle-h, 80)) / 38), 1);
  box-shadow: 7px 3px 0 -1px rgba(215,155,65,.55);
  pointer-events: none;
}

/* Traînée droite */
.cpt-cire::after {
  content: '';
  position: absolute;
  top: 2px;
  right: -2px;
  width: 3px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(180deg, rgba(222,165,68,.88) 0%, rgba(204,140,52,.62) 52%, transparent 100%);
  height: clamp(0px, calc((100 - var(--candle-h, 80)) * 0.25px), 20px);
  opacity: clamp(0, calc((100 - var(--candle-h, 80)) / 52), 1);
  pointer-events: none;
}

/* Base de la bougie */
.cpt-cire-base {
  width: calc(22px + (100 - var(--candle-h, 80)) * 0.08px);
  max-width: 30px;
  height: 5px;
  background: linear-gradient(180deg, #a07030 0%, #7a4818 65%, #4c2808 100%);
  border-radius: 3px 3px 2px 2px;
  box-shadow:
    0 2px 5px rgba(0,0,0,.30),
    0 0 0 clamp(0px, calc((100 - var(--candle-h, 80)) * 0.08px), 7px) rgba(208,130,42,.44);
}

/* ── Tooltip de station (survol comptoir) ────────────────── */
@keyframes cpt-tt-in {
  0%   { opacity: 0; transform: translateX(-50%) translateY(10px) scale(.93); }
  62%  { opacity: 1; transform: translateX(-50%) translateY(-3px) scale(1.01); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0)    scale(1); }
}
@keyframes cpt-tt-out {
  from { opacity: 1; transform: translateX(-50%) translateY(0)   scale(1); }
  to   { opacity: 0; transform: translateX(-50%) translateY(6px) scale(.96); }
}

#cpt-tooltip {
  position: fixed;
  z-index: 1200;
  pointer-events: none;
  width: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  visibility: hidden;
  opacity: 0;
  will-change: transform, opacity;
}
#cpt-tooltip.cpt-tt--visible {
  visibility: visible;
  animation: cpt-tt-in .22s cubic-bezier(.34,1.4,.64,1) forwards;
}
#cpt-tooltip.cpt-tt--hiding {
  visibility: visible;
  animation: cpt-tt-out .15s ease-in forwards;
}

/* Boîte principale */
.cpt-tt-box {
  width: 100%;
  background: linear-gradient(158deg, #331a08 0%, #1e0e05 52%, #2b1507 100%);
  border: 1px solid rgba(195,133,52,.40);
  border-radius: 11px;
  padding: 11px 13px 10px;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 18px 52px rgba(0,0,0,.75),
    0 5px 16px rgba(0,0,0,.55),
    inset 0 1px 0 rgba(228,172,72,.13),
    inset 0 -1px 0 rgba(0,0,0,.32);
}

/* Grain de bois en filigrane */
.cpt-tt-box::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: repeating-linear-gradient(
    93deg,
    transparent 0, transparent 21px,
    rgba(175,108,38,.04) 21px, rgba(175,108,38,.04) 22px
  );
  pointer-events: none;
}

/* Filet ambre en haut */
.cpt-tt-box::after {
  content: '';
  position: absolute;
  top: 0; left: 14px; right: 14px;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: linear-gradient(90deg, transparent, rgba(215,152,58,.65), transparent);
}

/* ⚜ Ornement */
.cpt-tt-ornament {
  font-size: .58rem;
  letter-spacing: .18em;
  color: rgba(195,140,52,.42);
  text-align: center;
  line-height: 1;
  margin-bottom: 7px;
  user-select: none;
}

/* Badge + timer sur une ligne */
.cpt-tt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 7px;
}

/* Titre complet */
.cpt-tt-sujet {
  font-family: var(--font-display);
  font-style: italic;
  font-size: .85rem;
  line-height: 1.46;
  color: rgba(243,221,170,.97);
  margin-bottom: 9px;
}

/* Filet séparateur */
.cpt-tt-sep {
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(155,95,36,.40) 25%,
    rgba(155,95,36,.40) 75%,
    transparent
  );
  margin-bottom: 9px;
}

/* Ligne avatars + timer */
.cpt-tt-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 22px;
}

/* Avatars empilés */
.cpt-tt-avatars {
  display: flex;
  align-items: center;
}
.cpt-tt-av {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid #1e0e05;
  overflow: hidden;
  margin-left: -6px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #8a4a18, #5a2808);
  display: flex; align-items: center; justify-content: center;
  font-size: .56rem; font-weight: 700;
  color: rgba(235,205,155,.85);
  box-shadow: 0 0 0 1px rgba(165,105,38,.28);
}
.cpt-tt-av:first-child { margin-left: 0; }
.cpt-tt-av img { width: 100%; height: 100%; object-fit: cover; }
.cpt-tt-av--more {
  background: rgba(175,108,38,.22);
  color: rgba(200,155,78,.88);
  font-size: .5rem;
}

/* Timer restant */
.cpt-tt-timer {
  font-size: .63rem;
  color: rgba(178,128,55,.78);
  display: flex; align-items: center; gap: 3px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Flèche (pointe vers la station en bas par défaut = tooltip au-dessus) */
.cpt-tt-arrow {
  width: 14px; height: 8px;
  flex-shrink: 0;
  position: relative;
  left: var(--tt-arrow-dx, 0px); /* compense le clamping horizontal */
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  background: rgba(195,133,52,.42);
}
.cpt-tt-arrow::before {
  content: '';
  position: absolute;
  top: 0; left: 1px; right: 1px;
  bottom: 1px;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  background: linear-gradient(158deg, #331a08, #1e0e05);
}

/* Tooltip en-dessous : flèche en haut */
#cpt-tooltip.cpt-tt--below .cpt-tt-arrow {
  order: -1;
  transform: rotate(180deg);
}

/* ── Badges de type ──────────────────────────────────────── */
.cpt-type-badge {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: .58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 2px 6px;
  border-radius: 3px;
  line-height: 1.4;
  flex-shrink: 0;
}
.cpt-type-leger       { background: #1a4a1a; color: #80d080; border: 1px solid #2a6a2a; }
.cpt-type-absurde     { background: #4a1a4a; color: #d080d0; border: 1px solid #6a2a6a; }
.cpt-type-introspectif { background: #1a2a4a; color: #80a0d8; border: 1px solid #2a4a6a; }
.cpt-type-serieux     { background: #3a2a10; color: #d0a050; border: 1px solid #5a4020; }

/* ── Dot de notification non-lu ─────────────────────────── */
.cpt-station-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger, #c0392b);
  display: inline-block;
  box-shadow: 0 0 4px #3cb869;
  animation: cpt-dot-pulse 2.2s ease-in-out infinite;
  margin-left: auto;
}
@keyframes cpt-dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .55; transform: scale(.75); }
}

/* ── Message vide du comptoir ────────────────────────────── */
.cpt-empty-cue {
  text-align: center;
  font-style: italic;
  color: var(--text-muted);
  font-size: .88rem;
  padding: 1.5rem 0 .5rem;
}

/* ── Modal nouvelle conversation ─────────────────────────── */
.cpt-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 900;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.cpt-modal-backdrop.open { display: flex; }

.cpt-modal {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 2rem 2.25rem;
  max-width: 520px;
  width: 100%;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,.22);
}
.cpt-modal-close {
  position: absolute;
  top: 1rem; right: 1rem;
  background: none; border: none;
  font-size: 1.1rem; cursor: pointer;
  color: var(--text-muted);
  line-height: 1; padding: .2rem .4rem;
  border-radius: 4px;
  transition: background .15s, color .15s;
}
.cpt-modal-close:hover { background: var(--accent-light); color: var(--accent); }
.cpt-modal-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 .3rem;
}
.cpt-modal-sub {
  font-style: italic;
  color: var(--text-muted);
  font-size: .82rem;
  margin: 0 0 1.5rem;
}
.cpt-modal-field { margin-bottom: 1.25rem; }
.cpt-modal-label {
  display: block;
  font-family: var(--font-ui);
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-mid);
  margin-bottom: .4rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.cpt-modal-counter {
  font-size: .68rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: .2rem;
}
.cpt-modal-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1.5rem;
}

/* Picker de type */
.cpt-type-picker {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.cpt-type-option input { display: none; }
.cpt-type-option input:checked + .cpt-type-badge {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.cpt-type-option { cursor: pointer; }

/* Picker de durée */
.cpt-duree-picker {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
}
.cpt-duree-option input { display: none; }
.cpt-duree-btn {
  display: inline-block;
  padding: .3rem .65rem;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-ui);
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-mid);
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.cpt-duree-option input:checked + .cpt-duree-btn {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}
.cpt-duree-hint {
  font-size: .72rem;
  color: var(--text-muted);
  font-style: italic;
  margin: .4rem 0 0;
}
.cpt-modal-error { display: block; }


/* ══════════════════════════════════════════════════════════════
   CHAT DÉTAIL — page de conversation au Comptoir
   ══════════════════════════════════════════════════════════════ */

/* Lien retour */
.chat-back-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-family: var(--font-ui);
  font-size: .78rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: .3rem .6rem;
  border-radius: 6px;
  transition: background .15s, color .15s;
  margin-bottom: .5rem;
}
.chat-back-btn:hover { background: var(--accent-light); color: var(--accent); }

/* ── En-tête : bulle de conversation ─────────────────────── */
.chat-conv-header { margin-bottom: 1.25rem; }

.chat-header-bubble-row {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
}

/* Avatar du créateur */
.chat-creator-avatar-link { flex-shrink: 0; text-decoration: none; }
.chat-creator-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  display: block;
}
.chat-creator-initial {
  background: var(--accent-light);
  color: var(--accent);
  font-size: 1.3rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ui);
}

/* Bulle de dialogue */
.chat-subject-bubble {
  flex: 1;
  background: var(--accent-light);
  border: 1.5px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: 0 12px 12px 12px;
  padding: .85rem 1.1rem .8rem;
  position: relative;
}
.chat-subject-bubble::before {
  content: '';
  position: absolute;
  top: 8px;
  left: -10px;
  border-width: 8px 10px 0 0;
  border-style: solid;
  border-color: transparent var(--accent) transparent transparent;
}
.chat-subject-bubble::after {
  content: '';
  position: absolute;
  top: 10px;
  left: -7px;
  border-width: 6px 8px 0 0;
  border-style: solid;
  border-color: transparent var(--accent-light) transparent transparent;
}

.chat-subject-bubble-top {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .35rem;
  flex-wrap: wrap;
}
.chat-header-sujet {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0;
  line-height: 1.25;
  flex: 1;
}
.chat-header-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .2rem .45rem;
  font-family: var(--font-ui);
  font-size: .72rem;
  color: var(--text-muted);
  margin-bottom: .5rem;
}
.chat-header-sep { opacity: .4; }
.chat-header-creator { font-style: italic; }
.chat-header-expired {
  font-weight: 600;
  color: #a05030;
  font-size: .72rem;
}
.chat-header-candle {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

/* Mini bougie dans l'en-tête */
.chat-mini-candle {
  display: inline-flex;
  align-items: flex-end;
  gap: 0;
  transform: scale(.7);
  transform-origin: bottom center;
  vertical-align: middle;
}
.chat-candle-label { font-size: .72rem; font-style: italic; }

/* Avatars participants dans la bulle */
.chat-participants-avatars {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}
.chat-participant-avatar {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--accent-light);
  margin-left: -5px;
  text-decoration: none;
  transition: transform .15s;
  position: relative;
}
.chat-participant-avatar:first-child { margin-left: 0; }
.chat-participant-avatar:hover { transform: scale(1.12) translateY(-2px); z-index: 1; }
.chat-participant-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-participant-initial {
  width: 100%; height: 100%;
  background: var(--accent);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ui);
}

/* ── Nuage de chat ────────────────────────────────────────── */
.chat-cloud-outer {
  margin-bottom: 1rem;
}

/* drop-shadow dessine le contour de la silhouette composée */
.chat-cloud-shape {
  filter:
    drop-shadow(0 6px 22px rgba(0,0,0,.10))
    drop-shadow(0 2px 5px rgba(0,0,0,.07));
}

/* Bosses du nuage (cercles qui débordent au-dessus/dessous du corps) */
.chat-cloud-bumps {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  margin-bottom: -14px;
  position: relative;
  z-index: 1;
  padding: 0 .5rem;
  pointer-events: none;
}

/* Bosses inférieures : miroir vertical des bosses du haut */
.chat-cloud-bumps--bottom {
  transform: scaleY(-1);
  margin-top: -14px;
  margin-bottom: 0;
  z-index: 1;
}

.ccb {
  border-radius: 50%;
  background: var(--accent-light);
  flex-shrink: 0;
}
.ccb:nth-child(1) { width: 48px; height: 48px; margin: 0 -7px; }
.ccb:nth-child(2) { width: 70px; height: 70px; margin: 0 -9px; z-index: 1; }
.ccb:nth-child(3) { width: 56px; height: 56px; margin: 0 -7px; }
.ccb:nth-child(4) { width: 82px; height: 82px; margin: 0 -10px; z-index: 2; }
.ccb:nth-child(5) { width: 62px; height: 62px; margin: 0 -8px; }
.ccb:nth-child(6) { width: 68px; height: 68px; margin: 0 -9px; z-index: 1; }
.ccb:nth-child(7) { width: 46px; height: 46px; margin: 0 -6px; }

/* Corps du nuage */
.chat-cloud-body {
  position: relative;
  z-index: 0;
  background: var(--accent-light);
  border-radius: 0;
  overflow: hidden;
  /* Hauteur contrainte à la viewport : messages scrollent, barre reste visible */
  height: clamp(380px, calc(100dvh - 310px), 680px);
  display: flex;
  flex-direction: column;
}

/* ── Messages ─────────────────────────────────────────────── */
.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1.5rem 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .85rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* Message row */
.chat-msg {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 80%;
}
.chat-msg--me    { align-self: flex-end;   flex-direction: row-reverse; }
.chat-msg--other { align-self: flex-start; }

/* Avatar */
.chat-msg-avatar-link { flex-shrink: 0; text-decoration: none; }
.chat-msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 2px solid var(--border);
}
.chat-msg-avatar--initial {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ui);
  border: 2px solid var(--border);
}

/* Wrap auteur + bulle */
.chat-bubble-wrap { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.chat-msg--me .chat-bubble-wrap    { align-items: flex-end; }
.chat-msg--other .chat-bubble-wrap { align-items: flex-start; }

.chat-msg-author {
  font-size: .7rem;
  font-family: var(--font-ui);
  font-weight: 600;
  color: var(--text-muted);
  padding: 0 .4rem;
}

/* ── Bulles ───────────────────────────────────────────────── */
.chat-bubble {
  padding: .65rem .9rem .5rem;
  max-width: 420px;
  position: relative;
  word-break: break-word;
}

/* Forme arrondie */
.chat-bubble--arrondie { border-radius: 18px 18px 18px 4px; }
.chat-bubble--arrondie.chat-bubble--mine { border-radius: 18px 18px 4px 18px; }

/* Forme carrée */
.chat-bubble--carree { border-radius: 6px 6px 6px 2px; }
.chat-bubble--carree.chat-bubble--mine { border-radius: 6px 6px 2px 6px; }

/* Forme speech (BD) */
.chat-bubble--speech { border-radius: 16px; }
.chat-bubble--speech::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 18px;
  width: 20px;
  height: 16px;
  background: var(--bubble-bg, #e8d5b7);
  /* Arrondi fort en haut, effilé vers le bas-gauche */
  border-radius: 50% 50% 8% 92% / 50% 50% 85% 30%;
  transform: rotate(8deg);
}
.chat-bubble--speech.chat-bubble--mine::after {
  left: auto;
  right: 18px;
  /* Miroir : effilé vers le bas-droit */
  border-radius: 50% 50% 92% 8% / 50% 50% 30% 85%;
  transform: rotate(-8deg);
}

/* Forme poétique */
.chat-bubble--poetique {
  border-radius: 22px 6px 22px 6px;
  font-style: italic;
  border: 1px solid rgba(0,0,0,.08);
}
.chat-bubble--poetique.chat-bubble--mine { border-radius: 6px 22px 6px 22px; }

/* Texte et heure */
.chat-bubble-text {
  margin: 0 0 .25rem;
  font-size: .88rem;
  line-height: 1.5;
  color: var(--bubble-text, #1a0e08);
}
.chat-bubble-text br { line-height: .5; }
.chat-bubble-time {
  display: block;
  font-size: .62rem;
  font-family: var(--font-ui);
  color: var(--bubble-text, #1a0e08);
  opacity: .45;
  text-align: right;
}

/* Séparateur "messages non lus" */
.chat-unread-separator {
  position: relative;
  text-align: center;
  margin: .75rem 0 .5rem;
  user-select: none;
}
.chat-unread-separator::before {
  content: '';
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 1px;
  background: var(--accent, #8b5e3c);
  opacity: .25;
}
.chat-unread-separator span {
  position: relative;
  background: var(--bg-alt, #f5ede0);
  padding: 0 .65rem;
  font-size: .65rem;
  font-family: var(--font-ui);
  color: var(--accent, #8b5e3c);
  text-transform: uppercase;
  letter-spacing: .07em;
  opacity: .75;
}

/* Message d'invite vide */
.chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: 2.5rem 1rem;
  margin: auto;
  color: var(--text-muted);
  font-style: italic;
  font-size: .88rem;
  text-align: center;
}
.chat-empty-icon { font-size: 2.5rem; line-height: 1; }

/* Bannière conversation expirée */
.chat-expired-banner {
  text-align: center;
  padding: 2rem 1.5rem;
  background: var(--accent-light);
  border-radius: 12px;
  border: 1px solid var(--border);
}
.chat-expired-icon { font-size: 2.5rem; margin-bottom: .5rem; }
.chat-expired-text {
  font-style: italic;
  color: var(--text-muted);
  font-size: .9rem;
  margin: 0 0 1rem;
}
.chat-expired-archive { text-align: left; max-width: 600px; margin: 0 auto 1.5rem; }
.chat-expired-archive-label {
  font-family: var(--font-ui);
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .5rem;
}
.chat-expired-msg {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  padding: .3rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .82rem;
}
.chat-expired-msg-author { font-weight: 600; color: var(--accent); flex-shrink: 0; }
.chat-expired-msg-text   { flex: 1; color: var(--text-mid); }
.chat-expired-msg-time   { font-size: .65rem; color: var(--text-muted); flex-shrink: 0; }

/* ── Barre de saisie ─────────────────────────────────────── */
.chat-input-bar {
  padding: .75rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.chat-input-wrap {
  display: flex;
  gap: .5rem;
  align-items: flex-end;
}
.chat-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .55rem .8rem;
  font-family: var(--font-body);
  font-size: .88rem;
  resize: none;
  background: var(--surface);
  color: var(--text);
  line-height: 1.45;
  overflow: hidden;
  min-height: 38px;
  max-height: 120px;
}
.chat-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(92,74,58,.1);
}
.chat-send-btn {
  flex-shrink: 0;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, transform .1s;
}
.chat-send-btn:hover   { background: var(--accent-dark, #4a3020); transform: scale(1.06); }
.chat-send-btn:disabled { opacity: .5; cursor: not-allowed; }

.chat-input-actions {
  display: flex;
  gap: .75rem;
  align-items: center;
}
.chat-customize-btn {
  background: none; border: none;
  font-size: .72rem; cursor: pointer;
  color: var(--text-muted);
  padding: .2rem .4rem;
  border-radius: 4px;
  font-family: var(--font-ui);
  transition: background .15s, color .15s;
}
.chat-customize-btn:hover { background: var(--accent-light); color: var(--accent); }
.chat-leave-btn {
  margin-left: auto;
  background: none; border: none;
  font-size: .72rem; cursor: pointer;
  color: var(--text-muted);
  padding: .2rem .4rem;
  border-radius: 4px;
  font-family: var(--font-ui);
  transition: background .15s, color .15s;
}
.chat-leave-btn:hover { background: #fde8e8; color: #c0392b; }

/* ── Barre "rejoindre" ───────────────────────────────────── */
.chat-join-bar {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  text-align: center;
}
.chat-join-text {
  font-size: .85rem;
  color: var(--text-muted);
  font-style: italic;
  margin: 0;
}
.chat-join-btn { min-width: 200px; }

/* ── Panel personnalisation des bulles ───────────────────── */
.cpt-bulle-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1040;  /* au-dessus du panel plein écran (1036) */
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.cpt-bulle-backdrop.open { display: flex; }

.cpt-bulle-panel {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 1.75rem 2rem;
  max-width: 480px;
  width: 100%;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,.2);
}
.cpt-bulle-close {
  position: absolute; top: 1rem; right: 1rem;
  background: none; border: none;
  font-size: 1.1rem; cursor: pointer;
  color: var(--text-muted); padding: .2rem .4rem; border-radius: 4px;
  transition: background .15s, color .15s;
}
.cpt-bulle-close:hover { background: var(--accent-light); color: var(--accent); }
.cpt-bulle-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 .25rem;
}
.cpt-bulle-sub {
  font-style: italic;
  color: var(--text-muted);
  font-size: .8rem;
  margin: 0 0 1.25rem;
}
.cpt-bulle-field { margin-bottom: 1.1rem; }
.cpt-bulle-label {
  display: block;
  font-family: var(--font-ui);
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-mid);
  margin-bottom: .4rem;
}
.cpt-bulle-label-sm {
  font-family: var(--font-ui);
  font-size: .72rem;
  color: var(--text-muted);
}

/* Sélection de forme */
.cpt-bulle-formes { display: flex; flex-wrap: wrap; gap: .4rem; }
.cpt-forme-opt { cursor: pointer; }
.cpt-forme-opt input { display: none; }
.cpt-forme-preview {
  display: inline-block;
  padding: .35rem .7rem;
  font-size: .78rem;
  cursor: pointer;
  border: 1.5px solid var(--border);
  transition: border-color .15s, background .15s;
}
.cpt-forme-opt input:checked + .cpt-forme-preview {
  border-color: var(--accent);
  background: var(--accent-light);
}
.cpt-forme-preview--arrondie     { border-radius: 16px 16px 16px 4px; }
.cpt-forme-preview--carree       { border-radius: 4px; }
.cpt-forme-preview--speech       { border-radius: 12px; }
.cpt-forme-preview--poetique     { border-radius: 16px 4px 16px 4px; font-style: italic; }

/* Couleurs */
.cpt-couleur-presets { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .6rem; }
.cpt-couleur-swatch {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,.15);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.cpt-couleur-swatch:hover { transform: scale(1.15); box-shadow: 0 0 0 2px var(--accent); }
.cpt-couleur-custom { display: flex; align-items: center; gap: .6rem; margin-top: .4rem; }
.cpt-couleur-custom input[type="color"] {
  width: 36px; height: 36px;
  border: 2px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
}

/* Police */
.cpt-polices { display: flex; flex-direction: column; gap: .4rem; }
.cpt-police-opt { cursor: pointer; display: flex; align-items: center; gap: .5rem; font-size: .85rem; }
.cpt-police-opt input { accent-color: var(--accent); }

/* Aperçu */
.cpt-bulle-preview-wrap { margin-top: .5rem; margin-bottom: .75rem; }
.cpt-bulle-preview {
  background: var(--bg-alt);
  border-radius: 8px;
  padding: .75rem 1rem;
  margin-top: .4rem;
  display: flex;
  justify-content: flex-end;
}

/* Pied du panel */
.cpt-bulle-footer { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }


/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — Le Comptoir
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .cpt-stool-slot { flex: 0 0 134px; }
  .cpt-tabouret-seat { width: 58px; height: 58px; }
  .chat-msg { max-width: 92%; }
  .chat-header { flex-direction: column; }
  .cpt-bulle-panel { padding: 1.25rem; }
}

@media (max-width: 600px) {
  .cpt-modal { padding: 1.25rem 1.25rem; }
  /* .chat-messages height is handled by .chat-cloud-body flex constraint */
  .ccb:nth-child(1) { width: 36px; height: 36px; }
  .ccb:nth-child(2) { width: 54px; height: 54px; }
  .ccb:nth-child(3) { width: 44px; height: 44px; }
  .ccb:nth-child(4) { width: 64px; height: 64px; }
  .ccb:nth-child(5) { width: 48px; height: 48px; }
  .ccb:nth-child(6) { width: 52px; height: 52px; }
  .ccb:nth-child(7) { width: 36px; height: 36px; }
}


/* ═══════════════════════════════════════════════════════════════
   COMPTOIR UNIFIÉ — panneau détail inline
   ═══════════════════════════════════════════════════════════════ */

/* Zone conteneur — glisse vers le bas */
.cpt-detail-zone {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  margin-top: 0;
  transition: max-height .38s cubic-bezier(.4,0,.2,1), opacity .28s, margin-top .38s;
}
.cpt-detail-zone.open {
  max-height: 580px;
  opacity: 1;
  margin-top: 1.5rem;
}

/* Station active (sélectionnée) */
.cpt-station--active {
  outline: 2px solid rgba(245,192,74,.45);
  outline-offset: 3px;
  border-radius: 8px;
}
.cpt-station--active .cpt-flamme { animation-duration: .5s; }

/* Panneau principal */
.cpt-panel {
  position: relative;
  height: 520px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,.35), 0 2px 8px rgba(0,0,0,.2);
}

/* Spinner de chargement */
.cpt-panel-loading {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(245,220,160,.3);
  font-family: var(--font-ui);
  font-size: .85rem;
  background: #221208;
}

/* ── En-tête compact ── */
.cpt-panel-head {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .55rem .9rem;
  background: linear-gradient(135deg, #2e1606 0%, #3e2010 100%);
  border-bottom: 2px solid #150a02;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}
.cpt-panel-head::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(2deg, transparent 0, transparent 14px,
    rgba(255,200,100,.012) 14px, rgba(255,200,100,.012) 15px);
}

.cpt-panel-close {
  background: transparent;
  border: none;
  color: rgba(200,150,80,.45);
  font-size: .8rem;
  cursor: pointer;
  padding: .2rem .4rem;
  border-radius: 4px;
  transition: all .18s;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.cpt-panel-close:hover { color: rgba(200,150,80,.9); background: rgba(200,150,80,.1); }

.cpt-panel-sujet {
  font-family: var(--font-display);
  font-style: italic;
  font-size: .88rem;
  color: #f2e4c8;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
  z-index: 1;
}

.cpt-panel-parts {
  display: flex;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.cpt-panel-part { display: contents; }
.cpt-panel-av {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(30,10,2,.6);
  margin-right: -5px;
  flex-shrink: 0;
  display: block;
  transition: transform .15s;
}
.cpt-panel-av:hover { transform: scale(1.15); z-index: 2; position: relative; }
.cpt-panel-av.cpt-panel-av--initial {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .6rem;
  font-weight: 700;
  color: rgba(245,220,160,.8);
  background: rgba(200,150,80,.3);
}

.cpt-panel-count {
  font-size: .68rem;
  color: rgba(200,150,80,.4);
  font-family: var(--font-ui);
  flex-shrink: 0;
  margin-left: .35rem;
  position: relative;
  z-index: 1;
}
.cpt-panel-timer {
  font-size: .68rem;
  color: rgba(245,200,120,.55);
  font-family: var(--font-ui);
  flex-shrink: 0;
  white-space: nowrap;
  position: relative;
  z-index: 1;
}
.cpt-panel-timer--expired { color: rgba(200,150,80,.28); }

.cpt-panel-action {
  background: transparent;
  border: 1px solid rgba(200,150,80,.18);
  border-radius: 4px;
  color: rgba(200,150,80,.5);
  font-size: .72rem;
  padding: .18rem .42rem;
  cursor: pointer;
  font-family: var(--font-ui);
  text-decoration: none;
  flex-shrink: 0;
  transition: all .18s;
  position: relative;
  z-index: 1;
}
.cpt-panel-action:hover { color: rgba(200,150,80,.9); border-color: rgba(200,150,80,.45); }
.cpt-panel-action--leave:hover { color: rgba(220,130,130,.8); border-color: rgba(220,100,100,.3); }
.cpt-panel-nav { font-size: .85rem; padding: 0 5px; letter-spacing: 0; }
.cpt-panel-nav:disabled { opacity: .22; cursor: default; pointer-events: none; }
.cpt-panel-nav:disabled:hover { color: inherit; border-color: inherit; }
#cpt-panel-expand-btn { margin-left: auto; font-size: .7rem; letter-spacing: .02em; }

/* ── Zone messages — parquet ── */
.cpt-panel-msgs {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1.1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .65rem;
  background-color: #7a4518;
  background-image:
    repeating-linear-gradient(0deg, transparent 0, transparent 53px, rgba(20,8,2,.5) 53px, rgba(20,8,2,.5) 54px),
    repeating-linear-gradient(0deg, rgba(255,210,130,.07) 0, rgba(255,210,130,.07) 27px, rgba(50,20,5,.07) 27px, rgba(50,20,5,.07) 54px),
    repeating-linear-gradient(92deg, transparent 0, transparent 88px, rgba(0,0,0,.04) 88px, rgba(0,0,0,.04) 91px),
    repeating-linear-gradient(88deg, transparent 0, transparent 155px, rgba(0,0,0,.03) 155px, rgba(0,0,0,.03) 158px);
  scrollbar-width: thin;
  scrollbar-color: rgba(200,150,80,.3) transparent;
  box-shadow: inset 0 4px 12px rgba(0,0,0,.18);
}
.cpt-panel-msgs::-webkit-scrollbar { width: 5px; }
.cpt-panel-msgs::-webkit-scrollbar-track { background: transparent; }
.cpt-panel-msgs::-webkit-scrollbar-thumb { background: rgba(200,150,80,.3); border-radius: 3px; }

/* Bulles style notes sur parquet */
.cpt-panel-msgs .chat-msg { max-width: 74%; }
.cpt-panel-msgs .chat-bubble {
  border: 1px solid rgba(180,130,60,.2) !important;
  border-radius: 4px 14px 14px 14px !important;
  box-shadow: 2px 4px 10px rgba(0,0,0,.22) !important;
  transform: rotate(-.3deg);
  transition: transform .25s;
}
.cpt-panel-msgs .chat-msg--me .chat-bubble {
  border-radius: 14px 4px 14px 14px !important;
  transform: rotate(.3deg);
}
.cpt-panel-msgs .chat-bubble:hover { transform: rotate(0) !important; }
.cpt-panel-msgs .chat-bubble-text { color: var(--bubble-text, #2a1608); }
.cpt-panel-msgs .chat-bubble-time { opacity: 1; }
.cpt-panel-msgs .chat-empty   { color: rgba(245,220,160,.7); }
.cpt-panel-msgs .alcove-empty {
  background: rgba(0,0,0,.28);
  border-radius: 10px;
  padding: 1.25rem 1.75rem;
}
.cpt-panel-msgs .alcove-empty,
.cpt-panel-msgs .alcove-empty p {
  color: rgba(245,220,160,.88);
}

/* Bulles plus larges en mode plein écran */
body.cpt-panel-is-fullscreen .cpt-panel-msgs .chat-msg { max-width: 82% !important; }
body.cpt-panel-is-fullscreen .cpt-panel-msgs { padding: 1.25rem 3rem !important; }
body.cpt-panel-is-fullscreen .cpt-panel-bar { padding-left: 2rem !important; padding-right: 2rem !important; max-width: none !important; }

@media (max-width: 768px) {
  body.cpt-panel-is-fullscreen .cpt-panel-msgs { padding: .75rem .65rem !important; }
  body.cpt-panel-is-fullscreen .cpt-panel-bar { padding-left: .65rem !important; padding-right: .65rem !important; }
}
.cpt-panel-msgs .chat-msg--me .chat-msg-avatar-link { display: none; }
.cpt-panel-msgs .chat-msg-avatar { border-color: rgba(255,255,255,.15); }
.cpt-panel-msgs .chat-msg-avatar--initial { background: var(--accent); }
.cpt-panel-msgs .chat-unread-separator::before { background: rgba(245,192,74,.4); }
.cpt-panel-msgs .chat-unread-separator span {
  background: rgba(139,94,46,.75);
  color: rgba(245,220,160,.85);
  border-color: transparent;
}

/* ── Barre saisie ── */
.cpt-panel-bar {
  background: rgba(10,5,2,.55);
  backdrop-filter: blur(4px);
  border-top: 1px solid rgba(200,150,80,.1);
  padding: .6rem 1.2rem;
  display: flex;
  gap: .5rem;
  flex-shrink: 0;
}

/* ── Barre rejoindre ── */
.cpt-panel-join {
  background: rgba(10,5,2,.55);
  backdrop-filter: blur(4px);
  border-top: 1px solid rgba(200,150,80,.1);
  padding: .65rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}
.cpt-panel-join-text {
  color: rgba(245,220,160,.5);
  font-size: .85rem;
  font-family: var(--font-ui);
}
.cpt-panel-join-text a { color: rgba(245,192,74,.7); }

/* ── État expiré ── */
.cpt-panel-expired {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 2rem 1.5rem;
  overflow-y: auto;
  background-color: #7a4518;
  background-image:
    repeating-linear-gradient(0deg, transparent 0, transparent 53px, rgba(20,8,2,.5) 53px, rgba(20,8,2,.5) 54px),
    repeating-linear-gradient(0deg, rgba(255,210,130,.05) 0, rgba(255,210,130,.05) 27px, transparent 27px, transparent 54px);
}
.cpt-panel-expired-icon { font-size: 2rem; opacity: .6; margin-bottom: .5rem; }
.cpt-panel-expired-text {
  color: rgba(245,220,160,.75);
  font-size: .88rem;
  font-family: var(--font-ui);
  text-align: center;
  margin-bottom: .75rem;
}
.cpt-panel-archive {
  width: 100%;
  max-width: 580px;
  background: rgba(0,0,0,.12);
  border-radius: 8px;
  padding: .65rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.cpt-panel-archive-row {
  display: flex;
  gap: .55rem;
  font-size: .8rem;
  font-family: var(--font-ui);
  padding: .22rem 0;
  border-bottom: 1px solid rgba(200,150,80,.07);
}
.cpt-panel-archive-row:last-child { border-bottom: none; }
.cpt-panel-archive-author { font-weight: 600; min-width: 80px; color: rgba(245,200,120,.9); flex-shrink: 0; }
.cpt-panel-archive-text   { flex: 1; color: rgba(245,220,160,.85); }
.cpt-panel-archive-time   { color: rgba(200,150,80,.65); flex-shrink: 0; }

/* Bannière expiration en direct */
.cpt-panel-expired-live {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  padding: 1.25rem;
  color: rgba(245,220,160,.75);
  font-size: .88rem;
  font-family: var(--font-ui);
  text-align: center;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .cpt-detail-zone.open { max-height: 520px; }
  .cpt-panel { height: 460px; }
  .cpt-panel-head { gap: .35rem; padding: .45rem .7rem; }
  .cpt-panel-sujet { font-size: .78rem; }
  .cpt-panel-parts { display: none; }
  .cpt-panel-count { display: none; }
  .cpt-panel-msgs { padding: .75rem .65rem; gap: .5rem; }
  .cpt-panel-msgs .chat-msg { max-width: 88%; }
  .cpt-panel-bar { padding: .5rem .65rem; }
  .cpt-panel-join { padding: .5rem .65rem; }
}

/* ═══════════════════════════════════════════════════════════════
   ALCÔVE — Vue détail conversation
   ═══════════════════════════════════════════════════════════════ */

.alcove-wrap {
  display: flex;
  height: calc(100dvh - 60px);
  overflow: hidden;
}

/* ── Colonne latérale boisée ── */
.alcove-side {
  width: 220px;
  flex-shrink: 0;
  background: linear-gradient(160deg, #2e1606 0%, #3e2010 70%, #2e1606 100%);
  border-right: 4px solid #150a02;
  padding: 1.2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .9rem;
  position: relative;
  box-shadow: inset -15px 0 25px rgba(0,0,0,.35), 5px 0 20px rgba(0,0,0,.5);
  overflow-y: auto;
  scrollbar-width: none;
}
.alcove-side::-webkit-scrollbar { display: none; }

.alcove-side-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(2deg,  transparent 0, transparent 45px, rgba(255,255,255,.018) 45px, rgba(255,255,255,.018) 46px),
    repeating-linear-gradient(-1deg, transparent 0, transparent 75px, rgba(0,0,0,.05)         75px, rgba(0,0,0,.05)         76px);
}

.alcove-back {
  color: rgba(200,150,80,.5);
  text-decoration: none;
  font-size: .75rem;
  font-family: var(--font-ui);
  letter-spacing: .04em;
  position: relative;
  z-index: 1;
  transition: color .2s;
}
.alcove-back:hover { color: rgba(200,150,80,.85); }

/* Bougie + halo */
.alcove-candle-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  padding-bottom: .8rem;
  border-bottom: 1px solid rgba(200,150,80,.12);
  position: relative;
  z-index: 1;
}
.alcove-candle-glow {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(245,192,74,.22) 0%, transparent 70%);
  animation: cpt-light-flicker 1.8s ease-in-out infinite alternate;
  pointer-events: none;
}
.alcove-candle-zone .cpt-bougie {
  transform: scale(.62);
  transform-origin: bottom center;
}
.alcove-candle-label {
  font-size: .7rem;
  color: rgba(245,200,120,.6);
  font-family: var(--font-ui);
  text-align: center;
  position: relative;
  z-index: 1;
}
.alcove-candle-expired { color: rgba(200,150,80,.35); }

.alcove-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(200,150,80,.22), transparent);
  flex-shrink: 0;
}

.alcove-type-wrap { position: relative; z-index: 1; }

.alcove-sujet {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: .95rem;
  line-height: 1.45;
  color: #f2e4c8;
  position: relative;
  z-index: 1;
  margin: 0;
}

.alcove-parts-label {
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(200,150,80,.4);
  position: relative;
  z-index: 1;
}

.alcove-parts {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  position: relative;
  z-index: 1;
}

.alcove-part {
  display: flex;
  align-items: center;
  gap: .4rem;
  text-decoration: none;
  transition: opacity .15s;
}
.alcove-part:hover { opacity: .8; }

.alcove-part-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(255,255,255,.18);
  flex-shrink: 0;
  display: block;
}
.alcove-part-avatar.alcove-part-initial {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(200,150,80,.28);
  color: rgba(245,220,160,.75);
  font-size: .7rem;
  font-weight: 700;
}

.alcove-part-name {
  font-size: .78rem;
  color: rgba(245,215,150,.6);
  font-family: var(--font-ui);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.alcove-foot {
  margin-top: auto;
  position: relative;
  z-index: 1;
  border-top: 1px solid rgba(200,150,80,.12);
  padding-top: .8rem;
  display: flex;
  flex-direction: column;
  gap: .45rem;
}

.alcove-part-count {
  font-size: .7rem;
  color: rgba(200,150,80,.4);
  font-family: var(--font-ui);
}

.alcove-btn {
  background: transparent;
  border: 1px solid rgba(200,150,80,.2);
  border-radius: 6px;
  color: rgba(200,150,80,.55);
  font-size: .75rem;
  padding: .35rem .6rem;
  cursor: pointer;
  font-family: var(--font-ui);
  text-align: center;
  transition: all .2s;
  width: 100%;
}
.alcove-btn:hover { border-color: rgba(200,150,80,.45); color: rgba(200,150,80,.85); }
.alcove-btn--leave:hover { border-color: rgba(220,100,100,.35); color: rgba(230,150,150,.7); }
.alcove-btn--join {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
}
.alcove-btn--join:hover { background: var(--accent-dark, #7a4518); border-color: transparent; color: #fff; }

.alcove-full-msg {
  font-size: .72rem;
  color: rgba(200,150,80,.35);
  font-family: var(--font-ui);
  text-align: center;
}

/* ── Zone parquet principale ── */
.alcove-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: #8B5E2E;
  background-image:
    repeating-linear-gradient(0deg, transparent 0, transparent 53px, rgba(20,8,2,.5) 53px, rgba(20,8,2,.5) 54px),
    repeating-linear-gradient(0deg, rgba(255,210,130,.07) 0, rgba(255,210,130,.07) 27px, rgba(50,20,5,.07) 27px, rgba(50,20,5,.07) 54px),
    repeating-linear-gradient(92deg, transparent 0, transparent 88px, rgba(0,0,0,.04) 88px, rgba(0,0,0,.04) 91px),
    repeating-linear-gradient(88deg, transparent 0, transparent 155px, rgba(0,0,0,.03) 155px, rgba(0,0,0,.03) 158px);
  box-shadow: inset 18px 0 35px rgba(0,0,0,.25);
}

.alcove-glow-top {
  height: 6px;
  background: linear-gradient(to bottom, rgba(245,192,74,.13), transparent);
  flex-shrink: 0;
}

.alcove-msgs {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1.1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .65rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(200,150,80,.3) transparent;
}
.alcove-msgs::-webkit-scrollbar { width: 5px; }
.alcove-msgs::-webkit-scrollbar-track { background: transparent; }
.alcove-msgs::-webkit-scrollbar-thumb { background: rgba(200,150,80,.3); border-radius: 3px; }

/* Bulles façon notes sur parquet */
.alcove-msgs .chat-msg { max-width: 76%; }

.alcove-msgs .chat-bubble {
  border: 1px solid rgba(180,130,60,.2) !important;
  border-radius: 4px 14px 14px 14px !important;
  box-shadow: 2px 4px 10px rgba(0,0,0,.22) !important;
  transform: rotate(-.3deg);
  transition: transform .25s;
}
.alcove-msgs .chat-msg--me .chat-bubble {
  border-radius: 14px 4px 14px 14px !important;
  transform: rotate(.3deg);
}
.alcove-msgs .chat-bubble:hover { transform: rotate(0) !important; }

.alcove-msgs .chat-bubble-text { color: var(--bubble-text, #2a1608); }
.alcove-msgs .chat-bubble-time { opacity: 1; }
.alcove-msgs .chat-msg-avatar { border-color: rgba(255,255,255,.15); }
.alcove-msgs .chat-msg-avatar--initial { background: var(--accent); }

/* Séparateur messages non lus sur parquet */
.alcove-msgs .chat-unread-separator::before { background: rgba(245,192,74,.4); }
.alcove-msgs .chat-unread-separator span {
  background: rgba(139,94,46,.75);
  color: rgba(245,220,160,.85);
  border-color: transparent;
}

/* État vide */
.alcove-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  padding: 3rem 1.5rem;
  color: rgba(245,220,160,.4);
  font-size: .88rem;
  text-align: center;
  font-family: var(--font-ui);
  line-height: 1.55;
  margin: auto;
}

/* Barre de saisie */
.alcove-bar {
  background: rgba(10,5,2,.5);
  backdrop-filter: blur(4px);
  border-top: 1px solid rgba(200,150,80,.1);
  padding: .65rem 1.25rem;
  display: flex;
  gap: .55rem;
  flex-shrink: 0;
}

.alcove-input {
  flex: 1;
  background: rgba(245,228,190,.9);
  border: 1px solid rgba(160,100,40,.3);
  border-radius: 6px;
  padding: .5rem .8rem;
  font-size: .87rem;
  color: #2a1608;
  resize: none;
  outline: none;
  font-family: var(--font-ui);
  min-height: 38px;
  max-height: 100px;
}
.alcove-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(139,94,46,.18);
}
.alcove-input::placeholder { color: rgba(80,45,15,.38); }

.alcove-send {
  width: 38px;
  height: 38px;
  background: #7a4518;
  border: none;
  border-radius: 6px;
  color: rgba(245,220,160,.9);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
  flex-shrink: 0;
}
.alcove-send:hover { background: var(--accent); }
.alcove-send:disabled { opacity: .5; cursor: default; }

/* Barre rejoindre */
.alcove-join-bar {
  background: rgba(10,5,2,.5);
  backdrop-filter: blur(4px);
  border-top: 1px solid rgba(200,150,80,.1);
  padding: .75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}
.alcove-join-text {
  color: rgba(245,220,160,.5);
  font-size: .85rem;
  font-family: var(--font-ui);
}

/* État expiré */
.alcove-expired {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 2.5rem 1.5rem;
  overflow-y: auto;
  gap: .75rem;
}
.alcove-expired-icon { font-size: 2.5rem; opacity: .4; }
.alcove-expired-text {
  color: rgba(245,220,160,.45);
  font-size: .9rem;
  font-family: var(--font-ui);
  text-align: center;
}
.alcove-expired-archive {
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  margin-top: .75rem;
  background: rgba(0,0,0,.1);
  border-radius: 8px;
  padding: .75rem 1rem;
}
.alcove-expired-msg {
  display: flex;
  gap: .6rem;
  font-size: .82rem;
  color: rgba(245,220,160,.5);
  font-family: var(--font-ui);
  padding: .28rem 0;
  border-bottom: 1px solid rgba(200,150,80,.07);
}
.alcove-expired-msg:last-child { border-bottom: none; }
.alcove-expired-msg-author { font-weight: 600; min-width: 80px; color: rgba(245,200,120,.6); }
.alcove-expired-msg-text { flex: 1; }
.alcove-expired-msg-time { color: rgba(200,150,80,.3); flex-shrink: 0; }

/* Bannière expiration en direct */
.alcove-expired-live {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  padding: 1.5rem;
  color: rgba(245,220,160,.45);
  font-size: .9rem;
  font-family: var(--font-ui);
  text-align: center;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .alcove-side {
    width: 52px;
    padding: .6rem .3rem;
  }
  .alcove-sujet,
  .alcove-parts-label,
  .alcove-part-name,
  .alcove-part-count,
  .alcove-type-wrap,
  .alcove-btn,
  .alcove-full-msg,
  .alcove-back { display: none; }
  .alcove-candle-label { display: none; }
  .alcove-candle-zone .cpt-bougie { transform: scale(.5); }
  .alcove-msgs .chat-msg { max-width: 90%; }
}


/* ═══════════════════════════════════════════════════════════════
   LES ÉCHOS DES CONVERSATIONS OUBLIÉES
   ═══════════════════════════════════════════════════════════════ */

/* Section mode jour — parchemin et lumière diurne */
.cpt-echos {
  margin-top: 2.5rem;
  padding: 2.5rem 2rem 3rem;
  position: relative;
  background: linear-gradient(160deg, #f8edd8 0%, #f1e3c6 55%, #f6ebd4 100%);
  border-radius: 12px;
  border: 1px solid rgba(160,100,30,.22);
  box-shadow:
    inset 0 1px 0 rgba(220,160,60,.15),
    0 6px 28px rgba(120,70,10,.1);
}
/* Grain de vieux papier très subtil */
.cpt-echos::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: repeating-linear-gradient(
    135deg,
    transparent 0, transparent 22px,
    rgba(100,55,10,.018) 22px, rgba(100,55,10,.018) 23px
  );
  pointer-events: none;
}

/* Séparateur/en-tête */
.cpt-echos-header {
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
}
.cpt-echos-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.1rem;
}
.cpt-echos-divider::before,
.cpt-echos-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(160,100,30,.35), transparent);
}
.cpt-echos-embers {
  font-size: .9rem;
  opacity: .5;
  filter: grayscale(.5);
  letter-spacing: .15em;
}
.cpt-echos-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 400;
  font-style: italic;
  color: rgba(75,42,10,.82);
  margin: 0 0 .4rem;
  letter-spacing: .02em;
}
.cpt-echos-sub {
  font-family: var(--font-ui);
  font-size: .78rem;
  color: rgba(120,72,22,.52);
  margin: 0;
}

/* Grille de cartes */
.cpt-echos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: .85rem;
  position: relative;
}

/* Carte écho individuelle */
.cpt-echo-card {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  padding: .9rem 1rem 1rem;
  background: rgba(255,255,255,.45);
  border: 1px solid rgba(150,90,25,.2);
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
  position: relative;
  overflow: hidden;
}
.cpt-echo-card:hover {
  background: rgba(255,255,255,.7);
  border-color: rgba(160,95,25,.38);
  box-shadow: 0 3px 16px rgba(120,65,10,.12), inset 0 0 18px rgba(200,140,40,.04);
}
.cpt-echo-card--active {
  border-color: rgba(170,105,30,.5);
  box-shadow: 0 3px 20px rgba(120,65,10,.16);
  background: rgba(255,255,255,.75);
}

/* Ligne supérieure : bougie éteinte + badge */
.cpt-echo-card-top {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.cpt-echo-flame {
  font-size: .9rem;
  opacity: .4;
  filter: grayscale(1);
  line-height: 1;
}

/* Badge type désaturé dans contexte Échos */
.cpt-echo-card .cpt-type-badge {
  opacity: .7;
  filter: saturate(.4) brightness(.85);
  font-size: .65rem;
  padding: .15em .5em;
}

/* Sujet */
.cpt-echo-sujet {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: .85rem;
  color: rgba(65,35,8,.82);
  margin: 0;
  line-height: 1.45;
}

/* Pied de carte */
.cpt-echo-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .4rem;
  margin-top: auto;
  padding-top: .5rem;
  border-top: 1px solid rgba(140,85,20,.16);
}
.cpt-echo-author {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-family: var(--font-ui);
  font-size: .72rem;
  color: rgba(100,58,16,.65);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cpt-echo-avatar {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  object-fit: cover;
  opacity: .7;
  flex-shrink: 0;
}
.cpt-echo-meta-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .1rem;
  flex-shrink: 0;
}
.cpt-echo-msgs {
  font-family: var(--font-ui);
  font-size: .67rem;
  color: rgba(110,65,18,.55);
}
.cpt-echo-age {
  font-family: var(--font-ui);
  font-size: .67rem;
  color: rgba(100,58,16,.48);
}

/* Message vide */
.cpt-echos-empty {
  font-family: var(--font-ui);
  font-style: italic;
  font-size: .85rem;
  color: rgba(110,65,18,.5);
  text-align: center;
  padding: 1.5rem 0;
}

/* Responsive */
@media (max-width: 600px) {
  .cpt-echos-grid {
    grid-template-columns: 1fr 1fr;
    gap: .6rem;
  }
  .cpt-echo-footer { flex-direction: column; align-items: flex-start; gap: .25rem; }
  .cpt-echo-meta-right { align-items: flex-start; flex-direction: row; gap: .5rem; }
}
@media (max-width: 400px) {
  .cpt-echos-grid { grid-template-columns: 1fr; }
}

/* Échos — surcharge mode nuit */
[data-theme="dark"] .cpt-echos {
  background: linear-gradient(160deg, #1e0e04 0%, #140802 55%, #1c0c04 100%);
  border-color: rgba(100,55,15,.3);
  box-shadow:
    inset 0 1px 0 rgba(255,200,100,.04),
    0 6px 28px rgba(0,0,0,.18);
}
[data-theme="dark"] .cpt-echos::before {
  background: repeating-linear-gradient(
    135deg,
    transparent 0, transparent 22px,
    rgba(255,220,150,.015) 22px, rgba(255,220,150,.015) 23px
  );
}
[data-theme="dark"] .cpt-echos-divider::before,
[data-theme="dark"] .cpt-echos-divider::after {
  background: linear-gradient(to right, transparent, rgba(180,110,40,.35), transparent);
}
[data-theme="dark"] .cpt-echos-title  { color: rgba(220,170,90,.82); }
[data-theme="dark"] .cpt-echos-sub    { color: rgba(180,130,65,.52); }
[data-theme="dark"] .cpt-echos-empty  { color: rgba(150,100,50,.35); }
[data-theme="dark"] .cpt-echo-card {
  background: rgba(255,255,255,.04);
  border-color: rgba(150,85,25,.22);
}
[data-theme="dark"] .cpt-echo-card:hover {
  background: rgba(255,255,255,.07);
  border-color: rgba(190,115,40,.38);
  box-shadow: 0 3px 16px rgba(160,70,10,.18), inset 0 0 18px rgba(220,110,20,.05);
}
[data-theme="dark"] .cpt-echo-card--active {
  background: rgba(255,255,255,.09);
  border-color: rgba(210,140,55,.5);
  box-shadow: 0 3px 20px rgba(190,95,15,.25);
}
[data-theme="dark"] .cpt-echo-sujet   { color: rgba(235,200,145,.82); }
[data-theme="dark"] .cpt-echo-footer  { border-top-color: rgba(150,85,25,.18); }
[data-theme="dark"] .cpt-echo-author  { color: rgba(200,150,80,.65); }
[data-theme="dark"] .cpt-echo-msgs    { color: rgba(180,125,55,.55); }
[data-theme="dark"] .cpt-echo-age     { color: rgba(160,110,50,.48); }

/* ═══════════════════════════════════════════
   MESSAGES SYSTÈME DANS LE FIL (ARRIVÉE / DÉPART)
   ═══════════════════════════════════════════ */
@keyframes chat-event-in {
  from { opacity: 0; transform: translateY(6px) scale(.96); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}
.chat-event {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  align-self: center;
  margin: 6px auto;
  padding: 5px 14px 5px 10px;
  background: linear-gradient(135deg, #2a1305 0%, #3d1e08 100%);
  border: 1px solid rgba(210,155,60,.28);
  border-radius: 20px;
  font-family: var(--font-ui);
  font-size: .72rem;
  color: rgba(245,215,145,.82);
  white-space: nowrap;
  pointer-events: none;
  animation: chat-event-in .3s cubic-bezier(.34,1.56,.64,1) forwards;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.chat-event-icon { font-size: .88rem; line-height: 1; }

/* ═══════════════════════════════════════════
   TOAST "QUELQU'UN A REJOINT LE COMPTOIR"
   ═══════════════════════════════════════════ */
@keyframes cpt-join-in {
  from { opacity: 0; transform: translateX(-50%) translateY(16px) scale(.9); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0)    scale(1); }
}
@keyframes cpt-join-out {
  from { opacity: 1; transform: translateX(-50%) translateY(0)     scale(1); }
  to   { opacity: 0; transform: translateX(-50%) translateY(-12px) scale(.95); }
}
@keyframes cpt-clink-left {
  0%   { transform: scaleX(-1) rotate(0deg)   translateX(0px); }
  25%  { transform: scaleX(-1) rotate(-28deg) translateX(-5px); }
  55%  { transform: scaleX(-1) rotate(8deg)   translateX(2px); }
  75%  { transform: scaleX(-1) rotate(-4deg)  translateX(-1px); }
  100% { transform: scaleX(-1) rotate(0deg)   translateX(0px); }
}
@keyframes cpt-clink-right {
  0%   { transform: rotate(0deg)  translateX(0px); }
  25%  { transform: rotate(28deg) translateX(5px); }
  55%  { transform: rotate(-8deg) translateX(-2px); }
  75%  { transform: rotate(4deg)  translateX(1px); }
  100% { transform: rotate(0deg)  translateX(0px); }
}

.cpt-join-toast {
  position: absolute;
  bottom: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  white-space: nowrap;
  background: linear-gradient(135deg, #2a1305 0%, #3d1e08 100%);
  border: 1px solid rgba(210,155,60,.4);
  border-radius: 14px;
  padding: 10px 22px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  box-shadow: 0 6px 24px rgba(0,0,0,.55), 0 0 0 1px rgba(200,140,50,.12) inset;
  pointer-events: none;
  animation: cpt-join-in .4s cubic-bezier(.34,1.56,.64,1) forwards;
}
.cpt-join-toast--out {
  animation: cpt-join-out .35s ease-in forwards !important;
}
.cpt-join-pintes {
  display: flex;
  gap: 2px;
  font-size: 1.6rem;
  line-height: 1;
}
.cpt-join-pinte-l {
  display: inline-block;
  transform-origin: bottom center;
  animation: cpt-clink-left .55s ease-in-out .15s both;
}
.cpt-join-pinte-r {
  display: inline-block;
  transform-origin: bottom center;
  animation: cpt-clink-right .55s ease-in-out .15s both;
}
.cpt-join-msg {
  font-family: var(--font-ui);
  font-size: .78rem;
  color: rgba(245,215,145,.9);
  text-align: center;
  margin: 0;
}
