/* Éclore App — Premium Redesign */

/* ═══ DESIGN TOKENS (shared with theme.css for consistency) ══════ */
:root {
  --night-deep:    #0E0B1A;
  --night-mid:     #1A1333;
  --night-card:    #221840;
  --night-soft:    #2D2055;
  --rose-deep:     #C25B7A;
  --rose-mid:      #E8849A;
  --rose-soft:     #F5B8C4;
  --plum-deep:     #7B4FA2;
  --plum-soft:     #A97FC8;
  --gold:          #D4A96A;
  --border:        rgba(255,255,255,0.08);
  --border-light:  rgba(255,255,255,0.12);
  --text-bright:   #FFFFFF;
  --text-mid:      rgba(255,255,255,0.75);
  --text-muted:    rgba(255,255,255,0.45);
  --text-dark:     #1E1612;
  --text-muted-dark: #7A6F67;
  --radius-sm:  8px;
  --radius-md:  16px;
  --radius-lg:  24px;
  --radius-xl:  32px;
  --focus-ring: 0 0 0 3px rgba(245,184,196,0.38);
  --muted: var(--text-muted);
  --ink: var(--text-bright);
  --deep-plum: var(--plum-deep);
  --terracotta: var(--rose-deep);
  --danger: var(--rose-soft);
  --cream: var(--night-soft);
  --warm-white: var(--night-card);
  --warm-brown: var(--gold);
  --shadow-card:   0 8px 40px rgba(0,0,0,0.35);
  --shadow-lift:   0 16px 60px rgba(0,0,0,0.4);
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--night-deep);
  color: var(--text-bright);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  height: 100vh;
  overflow: hidden;
}

:where(button, a, input, textarea, select):focus-visible {
  outline: 2px solid var(--rose-soft);
  outline-offset: 3px;
}

:where(button, .btn, .feed-room-item, .feed-persona-card, .room-item, .persona-btn) {
  min-height: 44px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

::selection { background: var(--rose-deep); color: white; }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--night-deep); }
::-webkit-scrollbar-thumb { background: var(--night-soft); border-radius: 3px; }

/* ═══ AUTH SCREEN — Premium ════════════════════════════════════════ */
.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(194,91,122,0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(123,79,162,0.1) 0%, transparent 50%),
    var(--night-deep);
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
}

.auth-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.015'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.auth-card {
  background: rgba(34, 24, 64, 0.85);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 3rem 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lift), 0 0 80px rgba(194,91,122,0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: relative;
  z-index: 1;
  animation: authFadeIn 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-card--pricing {
  max-width: 980px;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

@keyframes authFadeIn {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-card__logo {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 500;
  color: var(--text-bright);
  text-align: center;
  margin-bottom: 0.25rem;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 24px rgba(194,91,122,0.4);
}

.auth-card__tagline {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 2.5rem;
}

.auth-card h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 1.75rem;
  color: var(--text-bright);
}

/* Form elements */
.form-group { margin-bottom: 1.1rem; }

.form-group label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  letter-spacing: 0.04em;
}

.form-group input {
  width: 100%;
  padding: 0.85rem 1.1rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  background: rgba(255,255,255,0.06);
  color: var(--text-bright);
  font-family: var(--font-body);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.form-group input::placeholder { color: var(--text-muted); }

.form-group input:focus {
  outline: none;
  border-color: var(--rose-deep);
  box-shadow: 0 0 0 3px rgba(194,91,122,0.15);
  background: rgba(255,255,255,0.08);
}

.couples-intent {
  min-width: 0;
  margin: 0 0 1.1rem;
  padding: 0;
  border: 0;
}

.couples-intent legend {
  width: 100%;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

.couples-intent__optional {
  color: var(--text-muted);
  font-size: 0.7rem;
  letter-spacing: 0;
}

.couples-intent__options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 7rem), 1fr));
  gap: 0.6rem;
  width: 100%;
}

.couples-intent__label {
  position: relative;
  display: flex;
  min-width: 0;
  cursor: pointer;
}

.couples-intent__input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.couples-intent__card {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3.25rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.04);
  color: var(--text-mid);
  font-size: 0.82rem;
  line-height: 1.25;
  text-align: center;
  overflow-wrap: anywhere;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s;
}

.couples-intent__label:hover .couples-intent__card {
  border-color: var(--rose-deep);
  background: rgba(255,255,255,0.07);
}

.couples-intent__input:checked + .couples-intent__card {
  border-color: var(--rose-mid);
  background: rgba(194,91,122,0.16);
  color: var(--text-bright);
  box-shadow: 0 0 0 2px rgba(194,91,122,0.15);
}

.couples-intent__input:focus-visible + .couples-intent__card {
  outline: 2px solid var(--rose-soft);
  outline-offset: 2px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border-radius: 100px;
  font-size: 0.95rem;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--rose-deep), var(--plum-deep));
  color: white;
  width: 100%;
  box-shadow: 0 4px 20px rgba(194,91,122,0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(194,91,122,0.5);
}

.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--night-soft);
  color: var(--text-mid);
  border: 1px solid var(--border-light);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
}
.btn-ghost:hover { color: var(--text-bright); }

/* Messages */
.error-msg, .success-msg {
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  display: none;
  animation: shake 0.3s ease;
}

.error-msg {
  background: rgba(194,91,122,0.15);
  border: 1px solid rgba(194,91,122,0.3);
  color: var(--rose-soft);
}

.success-msg {
  background: rgba(138,158,138,0.15);
  border: 1px solid rgba(138,158,138,0.3);
  color: #a0c8a0;
}

.invite-status { margin-top: 0.5rem; margin-bottom: 0; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.auth-switch {
  text-align: center;
  margin-top: 1.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.auth-switch button, .auth-switch a {
  background: none;
  border: none;
  color: var(--rose-mid);
  cursor: pointer;
  font-size: 0.85rem;
  font-family: var(--font-body);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
}
.auth-switch button:hover, .auth-switch a:hover { color: var(--rose-soft); }

/* ═══ APP SHELL ════════════════════════════════════════════════════ */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--night-deep);
}

/* Top bar */
.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: rgba(14,11,26,0.9);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 1rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.app-topbar__logo {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--text-bright);
  letter-spacing: 0.02em;
  text-shadow: 0 2px 20px rgba(194,91,122,0.3);
}

.app-topbar__user {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.app-topbar__pseudo {
  font-size: 0.875rem;
  color: var(--text-mid);
}

.app-topbar__subbadge {
  font-size: 0.7rem;
  padding: 0.25rem 0.75rem;
  background: linear-gradient(135deg, var(--plum-deep), var(--rose-deep));
  color: white;
  border-radius: 100px;
  letter-spacing: 0.04em;
  font-weight: 500;
}

.app-topbar__subbadge--locked {
  background: var(--night-soft);
  color: var(--text-muted);
}

.logout-btn {
  background: none;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  font-family: var(--font-body);
  padding: 0.35rem 0.85rem;
  border-radius: 100px;
  transition: all 0.2s;
}
.logout-btn:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text-bright);
  border-color: rgba(255,255,255,0.2);
}

/* Main layout */
.app-main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebar — Glassmorphism */
.sidebar {
  width: 260px;
  background: rgba(26,19,51,0.85);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex-shrink: 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 1rem 0;
}

.sidebar__section { padding: 0 0.75rem 0.5rem; }

.sidebar__section--ai {
  margin-top: 0.25rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.sidebar__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius-sm);
}

.sidebar__header--community { background: rgba(194,91,122,0.08); }
.sidebar__header--ai         { background: rgba(123,79,162,0.1); }

.sidebar__header-icon { font-size: 0.75rem; }
.sidebar__header-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sidebar__header--community .sidebar__header-label { color: var(--rose-mid); }
.sidebar__header--ai .sidebar__header-label { color: var(--plum-soft); }

.room-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.room-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-mid);
  transition: all 0.2s;
  border: 1px solid transparent;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-body);
}

.room-item:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-bright);
  border-color: var(--border-light);
}

.room-item.active {
  background: linear-gradient(135deg, rgba(194,91,122,0.2), rgba(123,79,162,0.15));
  color: var(--text-bright);
  border-color: rgba(194,91,122,0.25);
}

.room-item__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
}

.room-item__label { flex: 1; }

.room-item__badge {
  font-size: 0.6rem;
  padding: 0.15rem 0.5rem;
  background: rgba(194,91,122,0.12);
  color: var(--rose-soft);
  border-radius: 100px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.persona-badge {
  font-size: 0.6rem;
  padding: 0.15rem 0.5rem;
  background: rgba(123,79,162,0.2);
  color: var(--plum-soft);
  border-radius: 100px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  margin-left: auto;
}

.persona-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--plum-soft);
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  transition: all 0.2s;
  font-family: var(--font-body);
}

.persona-btn:hover {
  background: rgba(123,79,162,0.1);
  color: var(--text-bright);
}

.persona-btn__icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--plum-deep), var(--rose-deep));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}

/* Content area */
.content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--night-deep);
}

/* Paywall */
.paywall-banner {
  background: linear-gradient(90deg, rgba(194,91,122,0.15), rgba(123,79,162,0.1));
  border-bottom: 1px solid rgba(194,91,122,0.2);
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-shrink: 0;
}

.paywall-banner__text { font-size: 0.85rem; color: var(--rose-soft); }

.paywall-banner__cta {
  padding: 0.45rem 1.25rem;
  background: linear-gradient(135deg, var(--rose-deep), var(--plum-deep));
  color: white;
  border-radius: 100px;
  font-size: 0.8rem;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 500;
  transition: opacity 0.2s, transform 0.2s;
}

.paywall-banner__cta:hover { opacity: 0.9; transform: translateY(-1px); }

/* Lock icon */
.lock-icon {
  font-size: 0.7rem;
  opacity: 0.7;
  margin-left: auto;
  flex-shrink: 0;
}

/* Locked state */
.locked {
  opacity: 0.6;
  cursor: pointer;
  position: relative;
}
.locked:hover { opacity: 0.75; }

/* Paywall modal overlay */
.paywall-overlay {
  position: fixed;
  inset: 0;
  background: rgba(14, 11, 26, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
  animation: paywallFadeIn 0.25s ease;
}

@keyframes paywallFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.paywall-modal {
  background: var(--night-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lift);
  position: relative;
}

.paywall-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem;
}
.paywall-modal__close:hover { color: var(--text-bright); }

.paywall-modal__icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
}

.paywall-modal__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text-bright);
  margin-bottom: 0.75rem;
}

.paywall-modal__body {
  font-size: 0.9rem;
  color: var(--text-mid);
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

.paywall-modal__features {
  list-style: none;
  text-align: left;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.paywall-modal__features li {
  font-size: 0.85rem;
  color: var(--text-mid);
  padding: 0.3rem 0;
}

.paywall-modal__cta {
  width: 100%;
  padding: 0.85rem;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.paywall-modal__sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Chat container */
.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(194,91,122,0.04) 0%, transparent 60%),
    var(--night-deep);
}

.chat-header {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border);
  background: rgba(26,19,51,0.7);
  flex-shrink: 0;
  backdrop-filter: blur(8px);
}

.chat-header__title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--text-bright);
  margin-bottom: 0.15rem;
}

.chat-header__desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Messages */
.messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1.25rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  scroll-behavior: smooth;
}

.message {
  display: flex;
  flex-direction: column;
  max-width: 72%;
  animation: msgIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.message--mine  { align-self: flex-end; align-items: flex-end; }
.message--theirs{ align-self: flex-start; align-items: flex-start; }

.message__author {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0 0.35rem;
  margin-bottom: 0.3rem;
}

.message__pseudo {
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.message__badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.1rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.58rem;
  line-height: 1.2;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.message__badge--ai {
  background: rgba(169,127,200,0.2);
  color: var(--plum-soft);
  border: 1px solid rgba(169,127,200,0.35);
}

.message__badge--original {
  background: rgba(232,132,154,0.14);
  color: var(--rose-soft);
  border: 1px solid rgba(232,132,154,0.3);
}

.message__bubble {
  padding: 0.7rem 1.1rem;
  border-radius: 18px;
  font-size: 0.9rem;
  line-height: 1.55;
  word-break: break-word;
}

.message--mine .message__bubble {
  background: linear-gradient(135deg, var(--plum-deep), var(--rose-deep));
  color: white;
  border-bottom-right-radius: 6px;
}

.message--theirs .message__bubble {
  background: var(--night-card);
  color: var(--text-bright);
  border: 1px solid var(--border-light);
  border-bottom-left-radius: 6px;
}

.message--lea .message__bubble {
  background: linear-gradient(135deg, rgba(123,79,162,0.6), rgba(194,91,122,0.4));
  color: white;
  border-bottom-left-radius: 6px;
  backdrop-filter: blur(4px);
}

.message--user-sending .message__bubble,
.message--user-generating .message__bubble {
  opacity: 0.82;
}

.message__status {
  padding: 0.25rem 0.35rem 0;
  color: var(--text-muted);
  font-size: 0.68rem;
}

.message__error {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
  padding: 0.55rem 0.35rem 0;
  color: var(--rose-soft);
  font-size: 0.75rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.message__error > span {
  flex: 1 1 12rem;
  min-width: 0;
}

.message__retry {
  min-height: 44px;
  padding: 0.45rem 0.8rem;
  border: 1px solid rgba(245,184,196,0.45);
  border-radius: 999px;
  background: rgba(245,184,196,0.08);
  color: var(--text-bright);
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.message__retry:hover {
  border-color: var(--rose-soft);
  background: rgba(245,184,196,0.16);
}

.message__retry:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.ai-feedback {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.35rem 0.35rem 0;
}

.ai-feedback__button {
  min-height: 30px;
  padding: 0.3rem 0.65rem;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.68rem;
  line-height: 1.2;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.ai-feedback__button:hover {
  color: var(--text-bright);
  border-color: rgba(245,184,196,0.5);
  background: rgba(245,184,196,0.08);
}

.ai-feedback__button:disabled {
  color: var(--text-muted);
  border-color: rgba(255,255,255,0.08);
  cursor: wait;
  opacity: 0.65;
}

.ai-feedback__confirmation {
  padding: 0.45rem 0.35rem 0;
  color: var(--rose-soft);
  font-size: 0.7rem;
}

.message__time {
  font-size: 0.62rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  padding: 0 0.35rem;
}

/* Chat input — Premium */
.chat-input-bar {
  padding: 1rem 1.5rem;
  background: var(--night-deep);
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  flex-shrink: 0;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.2);
  position: relative;
  z-index: 1;
}

.chat-input-bar textarea {
  flex: 1;
  flex-shrink: 0;
  padding: 0.75rem 1.1rem;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  font-family: var(--font-body);
  background: rgba(255,255,255,0.08);
  color: var(--text-bright);
  resize: none;
  min-height: 46px;
  max-height: 120px;
  overflow-y: auto;
  line-height: 1.5;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.chat-input-bar textarea::placeholder { color: var(--text-muted); }

.chat-input-bar textarea:focus {
  outline: none;
  border-color: var(--rose-deep);
  box-shadow: 0 0 0 3px rgba(194,91,122,0.12);
}

/* Send button — Animated */
.send-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose-deep), var(--plum-deep));
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 16px rgba(194,91,122,0.4);
}

.send-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(194,91,122,0.6);
}

.send-btn:active {
  transform: scale(0.95);
}

.send-btn:disabled {
  background: var(--night-soft);
  box-shadow: none;
  cursor: default;
}

.send-btn svg { transition: transform 0.15s; }
.send-btn:hover svg { transform: translateX(2px); }

/* Typing indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  animation: fadeIn 0.2s ease;
}

.typing-dots {
  display: flex;
  gap: 4px;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rose-mid);
  animation: typingBounce 1.2s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* Welcome state */
.chat-welcome {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: var(--text-muted);
  padding: 2rem;
  text-align: center;
  background: radial-gradient(ellipse at 50% 50%, rgba(194,91,122,0.06) 0%, transparent 60%);
}

.chat-welcome__icon {
  font-size: 3rem;
  opacity: 0.5;
  animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50%       { opacity: 0.7; transform: scale(1.05); }
}

.chat-welcome__title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--text-bright);
  font-weight: 400;
}

.chat-welcome__desc {
  font-size: 0.9rem;
  max-width: 320px;
  line-height: 1.65;
  color: var(--text-muted);
}

/* Léa/persona card */
.lea-card {
  background: linear-gradient(135deg, rgba(123,79,162,0.25), rgba(194,91,122,0.15));
  border: 1px solid rgba(194,91,122,0.2);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 0 1.5rem 0.75rem;
  backdrop-filter: blur(8px);
}

.lea-card__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--plum-deep), var(--rose-deep));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  box-shadow: 0 0 20px rgba(194,91,122,0.3);
}

.lea-card__name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-bright);
}

.lea-card__desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.persona-starters {
  flex-shrink: 0;
  margin: 0 1.5rem 0.75rem;
}

.persona-starters[hidden] {
  display: none;
}

.persona-starters__title {
  margin-bottom: 0.55rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.persona-starters__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.persona-starter {
  min-width: 0;
  min-height: 44px;
  padding: 0.7rem 0.85rem;
  border: 1px solid rgba(245,184,196,0.2);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.055);
  color: var(--text-mid);
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.4;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.2s;
}

.persona-starter:hover {
  border-color: rgba(245,184,196,0.5);
  background: rgba(245,184,196,0.1);
  color: var(--text-bright);
  transform: translateY(-1px);
}

.persona-starter:active {
  background: rgba(245,184,196,0.16);
  transform: translateY(0);
}

.persona-starter:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Email confirm banner */
.email-confirm-banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: linear-gradient(90deg, rgba(123,79,162,0.25), rgba(194,91,122,0.18));
  color: white;
  padding: 0.7rem 1.5rem;
  font-size: 0.8125rem;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.email-confirm-banner__icon { font-size: 1rem; flex-shrink: 0; }
.email-confirm-banner__text { flex: 1; }

.email-confirm-banner__btn {
  background: rgba(255,255,255,0.15);
  color: white;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 100px;
  padding: 0.3rem 0.85rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
  font-family: var(--font-body);
}
.email-confirm-banner__btn:hover { background: rgba(255,255,255,0.25); }

/* Back button */
.back-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-body);
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  margin-bottom: 0.5rem;
}
.back-btn:hover { background: rgba(255,255,255,0.06); color: var(--text-bright); }

/* Subscribe page */
.subscribe-page {
  height: 100vh;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(194,91,122,0.15) 0%, transparent 60%),
    var(--night-deep);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  gap: 1rem;
  overflow-y: auto;
}

.subscribe-page__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 1.25rem;
  width: min(100%, 920px);
}

.checkout-summary {
  width: min(100%, 920px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: rgba(34,24,64,0.85);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.checkout-summary__details {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  min-width: 0;
}

.checkout-summary__eyebrow {
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.checkout-summary__plan-name {
  color: var(--text-bright);
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
}

.checkout-summary__price {
  color: var(--rose-soft);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  white-space: nowrap;
}

.checkout-summary__price span {
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 300;
}

.checkout-summary__cta {
  flex: 0 0 auto;
  min-width: 230px;
}

.subscribe-page__note {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-align: center;
}

.subscribe-card {
  background: rgba(34,24,64,0.85);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 3rem 2.5rem;
  width: 100%;
  max-width: none;
  text-align: center;
  box-shadow: var(--shadow-lift);
  backdrop-filter: blur(20px);
  animation: authFadeIn 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
}

.subscribe-card--premium {
  border-color: rgba(212,169,106,0.55);
  background: linear-gradient(160deg, rgba(45,32,85,0.92), rgba(34,24,64,0.88));
  box-shadow: var(--shadow-lift), 0 0 32px rgba(212,169,106,0.1);
}

.subscribe-card__badge {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.subscribe-card__name {
  color: var(--rose-soft);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
}

.subscribe-card__icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--plum-deep), var(--rose-deep));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 1.6rem;
  box-shadow: 0 8px 30px rgba(194,91,122,0.4);
}

.subscribe-card__title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--text-bright);
  margin-bottom: 0.5rem;
}

.subscribe-card__price {
  font-size: 2.2rem;
  font-weight: 500;
  color: var(--text-bright);
  margin-bottom: 0.25rem;
  font-family: var(--font-display);
}

.subscribe-card__price span {
  font-size: 1rem;
  font-weight: 300;
  color: var(--text-muted);
}

.subscribe-card__features {
  list-style: none;
  text-align: left;
  margin: 1.75rem 0 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.subscribe-card__features li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.9rem;
  color: var(--text-mid);
}

.subscribe-card__features li::before {
  content: '✓';
  color: var(--rose-mid);
  font-weight: 500;
  font-size: 0.85rem;
}

.subscribe-card__features { flex: 1; }

.subscribe-card .btn-primary,
.subscribe-card__cta {
  font-size: 1rem;
  min-height: 3.1rem;
  padding: 0.95rem 1.75rem;
}

.subscribe-card__cta:focus-visible,
.subscribe-card__cta:hover {
  outline: 2px solid var(--rose-soft);
  outline-offset: 3px;
}

.subscribe-card--premium .subscribe-card__cta {
  background: linear-gradient(135deg, var(--gold), var(--rose-deep));
  box-shadow: 0 4px 20px rgba(212,169,106,0.25);
}

.subscribe-card__cta:disabled,
.subscribe-card__cta:disabled:hover {
  cursor: not-allowed;
  opacity: 0.55;
  outline: none;
  transform: none;
}

.subscribe-card--selected {
  border-color: var(--rose-mid);
  box-shadow: var(--shadow-lift), 0 0 32px rgba(232,132,154,0.18);
}

.subscribe-card--premium.subscribe-card--selected {
  border-color: var(--gold);
  box-shadow: var(--shadow-lift), 0 0 32px rgba(212,169,106,0.25);
}

.subscribe-card__cta[aria-pressed="true"] {
  outline: 2px solid var(--rose-soft);
  outline-offset: 3px;
}

/* Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-light);
  border-top-color: var(--rose-mid);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Mobile room picker */
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.mobile-room-picker {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--night-card);
  border-top: 1px solid var(--border-light);
  border-radius: 20px 20px 0 0;
  z-index: 150;
  padding-bottom: env(safe-area-inset-bottom, 1rem);
  animation: slideUp 0.25s ease;
  backdrop-filter: blur(20px);
}

.mobile-room-picker__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem 0.75rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-bright);
  font-family: var(--font-display);
}

.mobile-room-picker__close {
  background: none;
  border: none;
  font-size: 1rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
}

.mobile-room-pick-list {
  list-style: none;
  padding: 0 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mobile-room-pick-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-bright);
  font-family: var(--font-body);
  width: 100%;
  text-align: left;
  transition: background 0.15s;
}
.mobile-room-pick-item:hover { background: rgba(255,255,255,0.06); }

.mobile-room-pick-item__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Shared animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* mobile-nav removed — navigation handled by sidebar drawer */

/* Toast — dark theme (first definition above) */

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Lea profile card — already defined earlier with premium gradient style */

/* ─── Dropdown menu ─── */
.topbar-menu-trigger {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  font-size: 1rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: background 0.12s, color 0.12s;
  font-family: 'DM Sans', sans-serif;
}

.topbar-menu-trigger:hover {
  background: var(--border);
  color: var(--ink);
}

.topbar-menu-trigger .avatar-initials {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--deep-plum);
  color: white;
  font-size: 0.75rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.topbar-dropdown {
  position: fixed;
  top: 58px;
  right: 1rem;
  width: 280px;
  background: var(--warm-white);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  z-index: 200;
  overflow: hidden;
  animation: dropdownIn 0.18s ease;
}

@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.topbar-dropdown__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.topbar-dropdown__avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--deep-plum);
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.topbar-dropdown__info {
  flex: 1;
  min-width: 0;
}

.topbar-dropdown__pseudo {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-dropdown__meta {
  font-size: 0.75rem;
  color: var(--muted);
}

.topbar-dropdown__account-link {
  display: block;
  font-size: 0.8rem;
  color: var(--terracotta);
  text-decoration: none;
  padding: 0.35rem 1rem 0.5rem;
  cursor: pointer;
}

.topbar-dropdown__account-link:hover {
  color: var(--warm-brown);
}

.topbar-dropdown__section-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1rem 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.topbar-dropdown__section-header--community {
  color: var(--warm-brown);
}

.topbar-dropdown__section-header--ai {
  color: var(--deep-plum);
  padding-top: 0.5rem;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  color: var(--muted);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: 'DM Sans', sans-serif;
  transition: background 0.12s, color 0.12s;
  border-radius: 0;
}

.dropdown-item:hover {
  background: var(--cream);
  color: var(--ink);
}

.dropdown-item__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dropdown-item__icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  flex-shrink: 0;
}

.dropdown-item--community .dropdown-item__icon {
  background: rgba(196, 112, 74, 0.12);
  color: var(--warm-brown);
}

.dropdown-item--ai .dropdown-item__icon {
  background: rgba(92, 58, 107, 0.12);
  color: var(--deep-plum);
}

.dropdown-item__badge {
  margin-left: auto;
  font-size: 0.6rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.dropdown-item--community .dropdown-item__badge {
  background: rgba(196, 112, 74, 0.1);
  color: var(--warm-brown);
}

.dropdown-item--ai .dropdown-item__badge {
  background: rgba(92, 58, 107, 0.1);
  color: var(--deep-plum);
}

.topbar-dropdown__footer {
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--border);
}

.dropdown-item--logout {
  color: var(--danger);
  font-size: 0.85rem;
}

.dropdown-item--logout:hover {
  background: #FDF0EE;
  color: var(--danger);
}

/* Mobile room picker */
.mobile-room-picker {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--warm-white);
  border-top: 1px solid var(--border);
  border-radius: 16px 16px 0 0;
  z-index: 150;
  padding-bottom: env(safe-area-inset-bottom, 1rem);
  animation: slideUp 0.2s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.mobile-room-picker__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
}

.mobile-room-picker__close {
  background: none;
  border: none;
  font-size: 1rem;
  color: var(--muted);
  cursor: pointer;
  padding: 0.25rem;
}

.mobile-room-pick-list {
  list-style: none;
  padding: 0 0.75rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mobile-room-pick-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
  width: 100%;
  text-align: left;
  transition: background 0.12s;
}

.mobile-room-pick-item:hover {
  background: var(--border);
}

.mobile-room-pick-item__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Loading / empty / error states for messages */
.messages-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 2rem;
  color: var(--muted);
}

.messages-loading__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: messagesLoadingBounce 1s infinite;
  opacity: 0.5;
}

.messages-loading__dot:nth-child(2) { animation-delay: 0.15s; }
.messages-loading__dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes messagesLoadingBounce {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}

.messages-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 3rem 1.5rem;
  color: var(--muted);
  text-align: center;
  flex: 1;
}

.messages-empty__icon {
  font-size: 2rem;
  display: block;
}

.messages-empty__text {
  font-size: 0.9rem;
  color: var(--muted);
}

.messages-empty__sub {
  font-size: 0.8rem;
  color: var(--muted);
  opacity: 0.7;
}

/* ═══ HOME FEED ════════════════════════════════════════════════════════ */
.home-feed {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--night-deep);
}

.home-feed__scroll {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* Hero */
.feed-hero {
  padding: 1.5rem 1.25rem;
  background: linear-gradient(135deg, rgba(194,91,122,0.1), rgba(123,79,162,0.08));
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  animation: fadeUp 0.5s ease;
}

.feed-hero__eyebrow {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.feed-hero__greeting {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.feed-hero__name {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--text-bright);
  line-height: 1.1;
}

.feed-hero__tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-top: 0.25rem;
}

/* Feed sections */
.feed-section { display: flex; flex-direction: column; gap: 0.75rem; }

.feed-section__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.feed-section__icon { font-size: 0.85rem; }

.feed-section__label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.feed-section__scroll-row {
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 0.25rem;
}
.feed-section__scroll-row::-webkit-scrollbar { display: none; }

/* Article cards */
.article-scroll-track {
  display: flex;
  gap: 1rem;
  min-width: min-content;
}

.article-card {
  flex: 0 0 240px;
  background: var(--night-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s, border-color 0.2s;
  font-family: var(--font-body);
  color: var(--text-bright);
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
  border-color: rgba(194,91,122,0.25);
}

.article-card__image { height: 120px; overflow: hidden; }
.article-card__image img { width: 100%; height: 100%; object-fit: cover; }

.article-card__image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.article-card__body { padding: 1rem; }

.article-card__category {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  margin-bottom: 0.5rem;
}

.article-card__title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 0.35rem;
  color: var(--text-bright);
}

.article-card__excerpt {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card__meta {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Feed room items */
.feed-rooms-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.feed-room-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--night-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
  text-align: left;
  font-family: var(--font-body);
  color: var(--text-bright);
  width: 100%;
}

.feed-room-item:hover {
  background: var(--night-soft);
  border-color: var(--border-light);
  transform: translateX(3px);
}

.feed-room-item__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
}

.feed-room-item__text { flex: 1; }
.feed-room-item__name { font-size: 0.9rem; font-weight: 500; margin-bottom: 0.1rem; }
.feed-room-item__desc { font-size: 0.78rem; color: var(--text-muted); }

.feed-room-item__arrow {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: transform 0.15s, color 0.15s;
}

.feed-room-item:hover .feed-room-item__arrow {
  transform: translateX(3px);
  color: var(--rose-mid);
}

/* Feed personas */
.feed-personas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.feed-persona-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--night-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
  text-align: left;
  font-family: var(--font-body);
  color: var(--text-bright);
  width: 100%;
}

.feed-persona-card:hover {
  background: var(--night-soft);
  border-color: rgba(123,79,162,0.3);
  transform: translateY(-2px);
}

.feed-persona-card__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--plum-deep), var(--rose-deep));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.feed-persona-card__name { font-size: 0.875rem; font-weight: 500; }
.feed-persona-card__role { font-size: 0.65rem; color: var(--plum-soft); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.1rem; }
.feed-persona-card__desc { font-size: 0.75rem; color: var(--text-muted); }

/* Feed upsell */
.feed-upsell {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, rgba(194,91,122,0.12), rgba(123,79,162,0.08));
  border: 1px solid rgba(194,91,122,0.2);
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
}

.feed-upsell__icon { font-size: 1.5rem; flex-shrink: 0; }
.feed-upsell__text { flex: 1; }
.feed-upsell__title { font-size: 0.875rem; font-weight: 500; color: var(--text-bright); margin-bottom: 0.15rem; }
.feed-upsell__sub { font-size: 0.75rem; color: var(--text-muted); }

.feed-upsell__cta {
  padding: 0.45rem 1.25rem;
  background: linear-gradient(135deg, var(--rose-deep), var(--plum-deep));
  color: white;
  border: none;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: var(--font-body);
  transition: opacity 0.2s, transform 0.2s;
}

.feed-upsell__cta:hover { opacity: 0.9; transform: translateY(-1px); }

/* ═══ ARTICLE MODAL ═══════════════════════════════════════════════════ */
.article-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(14,11,26,0.85);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(8px);
  animation: fadeIn 0.2s ease;
}

.article-modal {
  background: var(--night-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 2rem;
  position: relative;
  animation: slideUp 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.article-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--night-soft);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: background 0.15s, color 0.15s;
  font-family: var(--font-body);
}

.article-modal__close:hover { background: rgba(255,255,255,0.1); color: var(--text-bright); }

.article-modal__category {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  margin-bottom: 0.75rem;
}

.article-modal__title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--text-bright);
  margin-bottom: 0.4rem;
}

.article-modal__meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.article-modal__content {
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--text-mid);
}

.article-modal__content em { color: var(--text-muted); font-size: 0.85rem; }

.article-modal__footer {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.article-modal__chat-btn {
  width: 100%;
  padding: 0.85rem 1.25rem;
  background: linear-gradient(135deg, rgba(123,79,162,0.25), rgba(194,91,122,0.15));
  border: 1px solid rgba(194,91,122,0.25);
  border-radius: var(--radius-md);
  color: var(--text-bright);
  font-size: 0.9rem;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 500;
  transition: background 0.2s, transform 0.2s;
}

.article-modal__chat-btn:hover {
  background: linear-gradient(135deg, rgba(123,79,162,0.35), rgba(194,91,122,0.25));
  transform: translateY(-1px);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══ MOBILE DRAWER — replaces sidebar on small screens ══════════════════ */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-mid);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem;
  flex-shrink: 0;
  line-height: 1;
}

.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(14,11,26,0.7);
  z-index: 200;
  backdrop-filter: blur(2px);
}

.drawer-overlay.open { display: block; }

.mobile-drawer {
  /* Desktop: static sidebar, always visible */
  display: block;
  position: static;
  width: auto;
  background: transparent;
  z-index: auto;
  transform: none;
  transition: none;
  overflow-y: visible;
  border-right: none;
}

.mobile-drawer__header {
  /* Hide the drawer header (close button) on desktop */
}

.mobile-drawer.open {
  transform: translateX(0);
}

.mobile-drawer__header {
  display: none; /* Hidden on desktop, shown on mobile via media query */
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: rgba(14,11,26,0.5);
}

.mobile-drawer__title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text-bright);
}

.mobile-drawer__close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.25rem;
}

/* ═══ RESPONSIVE BREAKPOINTS ════════════════════════════════ */
@media (max-width: 768px) {
  .auth-card--pricing {
    max-width: 560px;
    max-height: calc(100vh - 1.5rem);
  }

  .subscribe-page {
    align-items: stretch;
    justify-content: flex-start;
    padding: 1.25rem;
  }

  .subscribe-page__grid {
    grid-template-columns: 1fr;
    max-width: 540px;
    margin: 0 auto;
  }

  .subscribe-card {
    padding: 2.25rem 1.75rem;
  }

  .checkout-summary {
    max-width: 540px;
    align-items: stretch;
    flex-direction: column;
    gap: 1rem;
  }

  .checkout-summary__details {
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .checkout-summary__cta {
    width: 100%;
  }

  /* Hide desktop sidebar content, show hamburger */
  .mobile-drawer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    background: var(--night-mid);
    z-index: 250;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
    border-right: 1px solid var(--border);
  }
  .mobile-drawer.open {
    display: block;
    transform: translateX(0);
  }
  .mobile-drawer__header {
    display: flex !important;
  }
  .hamburger-btn { display: block; }

  /* Full-width content area */
  .app-main {
    display: block;
    width: 100%;
  }

  .content-area {
    height: calc(100vh - 52px); /* topbar only — mobile nav removed */
  }

  /* Ensure chat messages and input fit without overflow */
  .messages {
    padding: 0.75rem 1rem;
  }

  .message {
    max-width: 90%;
  }

  .ai-feedback {
    width: 100%;
  }

  .ai-feedback__button {
    flex: 1 1 7rem;
  }

  .message__error {
    align-items: stretch;
  }

  .message__retry {
    flex: 1 1 7rem;
  }

  /* Message input area */
  .message-input-wrapper {
    padding: 0.6rem 0.75rem;
    gap: 0.5rem;
  }

  .message-input {
    font-size: 0.9rem;
    min-height: 44px;
    max-height: 120px;
    padding: 0.6rem 0.85rem;
  }

  .send-btn {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
  }

  /* Chat header */
  .chat-header {
    padding: 0.9rem 1rem;
  }

  /* Compact topbar on mobile */
  .app-topbar {
    padding: 0.65rem 0.85rem;
    gap: 0.5rem;
  }

  .app-topbar__logo {
    font-size: 1.1rem;
  }

  /* Paywall banner compact */
  .paywall-banner {
    padding: 0.7rem 0.85rem;
    font-size: 0.8rem;
  }

  /* Email confirm banner compact */
  .email-confirm-banner {
    font-size: 0.75rem;
    padding: 0.5rem 0.85rem;
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  /* Lea card compact */
  .lea-card {
    margin: 0 0.75rem 0.5rem;
    padding: 0.75rem;
  }

  .persona-starters {
    margin: 0 0.75rem 0.5rem;
  }

  .persona-starters__list {
    grid-template-columns: 1fr;
  }

  /* Home card grid: 1 column on very small screens */
  .home-grid {
    grid-template-columns: 1fr;
    padding: 0.75rem;
    gap: 0.75rem;
  }

  .home-card__title {
    font-size: 1rem;
  }

  .home-card__desc {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .auth-card {
    padding: 2rem 1.25rem;
  }

  .auth-card--pricing {
    padding: 2rem 1rem;
    max-height: calc(100vh - 1rem);
  }

  .subscribe-page {
    padding: 0.75rem;
  }

  .subscribe-page__grid {
    gap: 0.75rem;
  }

  .subscribe-card {
    padding: 2rem 1.25rem;
  }

  .subscribe-card__title {
    font-size: 1.5rem;
  }

  .subscribe-card__features {
    margin: 1.25rem 0 1.5rem;
  }

  .checkout-summary {
    padding: 1rem;
  }

  .checkout-summary__details {
    align-items: center;
    gap: 0.45rem;
  }

  .checkout-summary__eyebrow {
    width: 100%;
  }

  .checkout-summary__plan-name {
    font-size: 1.2rem;
  }

  .checkout-summary__price {
    font-size: 1.35rem;
  }

  /* Extra small: tighten spacing further */
  .app-topbar {
    padding: 0.6rem 0.75rem;
  }

  .avatar-initials {
    width: 28px;
    height: 28px;
    font-size: 0.7rem;
  }

  .content-area {
    height: calc(100vh - 48px); /* topbar only — mobile nav removed */
  }

  .chat-header {
    padding: 0.75rem;
  }

  .chat-header__title {
    font-size: 1.1rem;
  }

  .messages {
    padding: 0.6rem;
  }

  .message__bubble {
    padding: 0.55rem 0.85rem;
    font-size: 0.875rem;
  }
}

@media (max-height: 700px) {
  .auth-screen {
    align-items: flex-start;
  }

  .auth-card {
    margin-top: 1rem;
    margin-bottom: 1rem;
  }
}

/* ═══ EMAIL CONFIRM BANNER (SPA) ══════════════════════════════ */
.email-confirm-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  background: rgba(194, 91, 122, 0.92);
  backdrop-filter: blur(8px);
  font-size: 0.82rem;
  color: white;
  text-align: center;
}
.email-confirm-banner__icon { font-size: 1rem; }
.email-confirm-banner__text { font-weight: 300; }
.email-confirm-banner__btn {
  padding: 0.3rem 0.9rem;
  background: white;
  color: #C25B7A;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
}
.email-confirm-banner__btn:hover { opacity: 0.9; }

/* ═══ HOME FEED EMAIL CONFIRM BANNER ══════════════════════════════ */
.home-email-confirm-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.85rem 1.5rem;
  margin: 1rem 1rem 0;
  border-radius: 12px;
  background: rgba(194, 91, 122, 0.92);
  backdrop-filter: blur(8px);
  font-size: 0.82rem;
  color: white;
  text-align: center;
  flex-wrap: wrap;
}
.home-email-confirm-banner__btn {
  padding: 0.35rem 1rem;
  background: white;
  color: #C25B7A;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
}
.home-email-confirm-banner__btn:hover { opacity: 0.9; }

/* Accessibilité et confort de lecture — overrides kept close to the app
   primitives so the existing dark Éclore palette remains unchanged. */
.btn:disabled,
.send-btn:disabled,
.feed-upsell__cta:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
  box-shadow: none;
}

.auth-card .form-group input,
.auth-card .form-group button,
.auth-card .btn { min-height: 44px; }

.auth-card .form-group input[aria-invalid="true"] {
  border-color: var(--rose-mid);
  box-shadow: var(--focus-ring);
}

.auth-card h1:focus { outline: none; }
.feed-hero__cta { width: auto; margin-top: 1rem; }
.feed-room-item__desc,
.feed-persona-card__desc { overflow-wrap: anywhere; }

.topbar-menu-trigger,
.hamburger-btn,
.mobile-drawer__close,
.article-modal__close,
.paywall-modal__close,
.mobile-room-picker__close { min-width: 44px; min-height: 44px; }

.topbar-dropdown {
  background: var(--night-card);
  border-color: var(--border-light);
}
.topbar-dropdown__pseudo,
.topbar-dropdown__account-link,
.dropdown-item { color: var(--text-mid); }
.topbar-dropdown__meta,
.topbar-dropdown__section-header { color: var(--text-muted); }
.dropdown-item:hover { background: var(--night-soft); color: var(--text-bright); }
.topbar-dropdown__footer { border-color: var(--border); }

.drawer-is-open { overflow: hidden; }
.mobile-drawer { max-height: 100dvh; }
.chat-input-bar { padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); }
.message__bubble { overflow-wrap: anywhere; white-space: pre-wrap; }
.article-modal__content p { margin-bottom: 1rem; }
.article-modal__close:focus-visible,
.paywall-modal__close:focus-visible { box-shadow: var(--focus-ring); }

@media (max-width: 768px) {
  .home-feed__scroll { padding: 1rem; gap: 1.25rem; }
  .feed-personas { grid-template-columns: 1fr; }
  .feed-upsell { align-items: flex-start; flex-wrap: wrap; }
  .feed-upsell__cta { margin-left: auto; }
  .article-modal { max-height: calc(100dvh - 1rem); padding: 1.5rem 1rem; }
  .chat-input-bar { padding-left: 0.75rem; padding-right: 0.75rem; }
  .mobile-drawer { height: 100dvh; max-height: 100dvh; }
}

@media (max-width: 480px) {
  .auth-screen { padding: 0.5rem; }
  .auth-card { padding: 1.5rem 1rem; border-radius: var(--radius-lg); }
  .auth-card__tagline { margin-bottom: 1.75rem; }
  .feed-hero__cta { width: 100%; }
  .feed-room-item { padding: 0.75rem; }
  .feed-room-item__desc { font-size: 0.75rem; }
  .paywall-banner { align-items: flex-start; flex-direction: column; }
  .paywall-banner__cta { width: 100%; text-align: center; }
}

@media (max-height: 700px) {
  .auth-card { padding-top: 1.5rem; padding-bottom: 1.5rem; }
  .article-modal { align-self: flex-start; margin-top: 0.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
