/* ============================================================
   Elidia — Design System
   Palette: Abyss #0A1628 · Teal #00BFB3 · Navy #0D2035
            Ice #E8F8F7 · Soft Teal #7DDBD6 · Pink #FF5CA8
   Fonts: Manrope (display) · Inter (UI)
   ============================================================ */
:root {
  --teal:  #00BFB3;
  --teal2: #7DDBD6;
  --pink:  #FF5CA8;
  --abyss: #0A1628;
  --navy:  #0D2035;
  --ice:   #E8F8F7;
}

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

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--abyss);
  color: var(--ice);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

#app {
  width: 100vw;
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--abyss);
  /* Push content below the Android/iOS status bar in standalone PWA mode */
  padding-top: env(safe-area-inset-top);
}

/* ── Typography ──────────────────────────────────────────── */
.display         { font-family: 'Manrope', sans-serif; font-weight: 800; letter-spacing: -0.02em; }
.display-sm      { font-family: 'Manrope', sans-serif; font-weight: 700; letter-spacing: -0.01em; }
h1               { font-family: 'Manrope', sans-serif; font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
h2               { font-family: 'Manrope', sans-serif; font-size: 1.2rem; font-weight: 700; }
h3               { font-family: 'Inter', sans-serif; font-size: 1.1rem; font-weight: 600; }
p                { line-height: 1.6; }
a                { color: #00BFB3; text-decoration: none; }
a:hover          { color: #7DDBD6; }

/* ── Splash ──────────────────────────────────────────────── */
.splash {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100dvh;
  background: var(--abyss);
}
.splash-logo {
  width: 240px;
  animation: fadeIn 0.6s ease;
}
.splash-loader {
  display: flex;
  gap: 6px;
  margin-top: 2rem;
}
.splash-loader span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #00BFB3;
  opacity: 0.3;
  animation: splashDot 1.2s ease-in-out infinite;
}
.splash-loader span:nth-child(2) { animation-delay: 0.2s; }
.splash-loader span:nth-child(3) { animation-delay: 0.4s; }
@keyframes splashDot {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40%           { opacity: 1;   transform: scale(1.15); }
}

/* ── Screen wrapper ──────────────────────────────────────── */
.screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0;
  animation: fadeIn 0.3s ease;
}

.screen-padded {
  padding: 2rem 1.5rem;
}

/* ── Animations ──────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: block;
  width: 100%;
  padding: 0.9rem 1.5rem;
  border: none;
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: linear-gradient(135deg, #00BFB3, #FF5CA8);
  color: #fff;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 0 24px rgba(255,92,168,0.2);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #00D4C7, #FF79B8);
  box-shadow: 0 0 32px rgba(255,92,168,0.35);
}

.btn-secondary {
  background: transparent;
  border: 1.5px solid #00BFB3;
  color: #00BFB3;
}
.btn-secondary:hover { background: rgba(0,191,179,0.08); }

.btn-ghost {
  background: transparent;
  color: #7DDBD6;
  font-size: 0.9rem;
  padding: 0.5rem;
}

.btn-google {
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.15);
  color: #E8F8F7;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}
.btn-google:hover { background: rgba(255,255,255,0.1); }

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ── Inputs ──────────────────────────────────────────────── */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.input-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: #7DDBD6;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
input, select, textarea {
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  color: #E8F8F7;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  padding: 0.85rem 1rem;
  width: 100%;
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}
input::placeholder { color: rgba(232,248,247,0.55); }
input:focus, select:focus {
  border-color: #00BFB3;
  background: rgba(0,191,179,0.06);
}
select option { background: var(--navy); color: #E8F8F7; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--navy);
  border: 1px solid rgba(0,191,179,0.15);
  border-radius: 16px;
  overflow: hidden;
}

/* ── Welcome Screen ──────────────────────────────────────── */
.welcome-screen {
  background: linear-gradient(180deg, var(--abyss) 0%, var(--navy) 50%, var(--abyss) 100%);
  padding: 3rem 2rem 2rem;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0;
}
.welcome-logo {
  width: 200px;
  margin-bottom: 2rem;
}
.welcome-tagline {
  font-family: 'Manrope', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  color: #7DDBD6;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}
.welcome-features {
  list-style: none;
  text-align: left;
  width: 100%;
  max-width: 320px;
  margin-top: 1.75rem;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.welcome-features li {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-size: 0.95rem;
  color: #E8F8F7;
  opacity: 0.85;
}
.welcome-features .feat-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  background: rgba(0,191,179,0.12);
  border: 1px solid rgba(0,191,179,0.25);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
.welcome-footer {
  margin-top: 0;
  padding-top: 0;
  width: 100%;
  max-width: 320px;
}
.welcome-footer .btn { margin-bottom: 1rem; }
.welcome-login-link {
  font-size: 0.85rem;
  color: rgba(232,248,247,0.75);
  text-align: center;
}
.welcome-login-link a { color: #00BFB3; }

/* ── Age Gate ────────────────────────────────────────────── */
.age-gate-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,22,40,0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 2rem;
  animation: fadeIn 0.2s ease;
}
.age-gate-box {
  background: var(--navy);
  border: 1px solid rgba(0,191,179,0.2);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  max-width: 380px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.age-gate-logo { width: 52px; height: 52px; margin: 0 auto; border-radius: 12px; }
.age-gate-heading { font-family: 'Manrope', sans-serif; font-size: 1.4rem; color: #E8F8F7; }
.age-gate-sub { font-size: 0.88rem; color: rgba(232,248,247,0.75); line-height: 1.6; }
.age-gate-confirm { margin-top: 0.5rem; }
.age-gate-exit { font-size: 0.8rem; opacity: 0.5; }

/* ── Google button ───────────────────────────────────────── */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: #fff;
  color: #1f1f1f;
  border: none;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 0.75rem;
}
.btn-google:hover { background: #f5f5f5; }
.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  color: rgba(232,248,247,0.45);
  font-size: 0.78rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(232,248,247,0.1);
}

/* ── Auth Screen ─────────────────────────────────────────── */
.auth-screen {
  padding: 2.5rem 1.75rem;
  gap: 1.5rem;
}
.auth-back {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #7DDBD6;
  font-size: 0.9rem;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}
.auth-header { margin-bottom: 0.5rem; text-align: center; }
.auth-header h1 { margin-bottom: 0.5rem; }
.auth-header p { color: rgba(232,248,247,0.75); font-size: 0.9rem; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: rgba(232,248,247,0.50);
  font-size: 0.8rem;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.1);
}

.auth-footer {
  text-align: center;
  font-size: 0.85rem;
  color: rgba(232,248,247,0.70);
  margin-top: auto;
  padding-top: 1rem;
}
.auth-footer a { color: #00BFB3; }

.auth-error {
  background: rgba(255,80,80,0.12);
  border: 1px solid rgba(255,80,80,0.3);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: #ff9090;
  margin-bottom: 1rem;
}
.auth-success {
  background: rgba(0,191,179,0.1);
  border: 1px solid rgba(0,191,179,0.3);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: #7DDBD6;
  margin-bottom: 1rem;
}
.auth-forgot {
  text-align: right;
  margin-top: -0.25rem;
  margin-bottom: 1rem;
  font-size: 0.82rem;
}
.auth-forgot a { color: rgba(0,191,179,0.7); }

/* ── Custom checkbox ─────────────────────────────────────── */
.custom-checkbox-wrap {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  cursor: pointer;
}
.custom-checkbox-wrap input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.custom-checkbox-box {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border: 2px solid rgba(232,248,247,0.3);
  border-radius: 5px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.custom-checkbox-box svg { opacity: 0; transition: opacity 0.15s ease; }
.custom-checkbox-wrap input[type="checkbox"]:checked + .custom-checkbox-box {
  background: var(--teal);
  border-color: var(--teal);
}
.custom-checkbox-wrap input[type="checkbox"]:checked + .custom-checkbox-box svg {
  opacity: 1;
}
.custom-checkbox-label {
  font-size: 0.8rem;
  color: rgba(232,248,247,0.6);
  line-height: 1.5;
}

/* ── Welcome intro slides ────────────────────────────────── */
.intro-screen {
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.75rem 2rem;
  min-height: 100%;
}
.intro-skip-row {
  display: flex;
  justify-content: flex-end;
  min-height: 2rem;
  align-items: center;
}
.intro-skip-btn {
  background: none;
  border: none;
  color: rgba(232,248,247,0.60);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.25rem 0;
}
.intro-skip-btn:hover { color: rgba(232,248,247,0.7); }
.intro-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0;
  padding: 1rem 0;
}
.intro-logo-wrap { margin-bottom: 2rem; }
.intro-logo      { width: 120px; height: auto; }
.intro-heading {
  font-family: 'Manrope', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: #E8F8F7;
  line-height: 1.25;
  margin-bottom: 1rem;
}
.intro-sub {
  font-size: 0.95rem;
  color: rgba(232,248,247,0.6);
  line-height: 1.6;
  max-width: 280px;
  margin: 0 auto;
}
.intro-sub strong { color: #E8F8F7; }

/* How it works feature list */
.intro-features {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
  text-align: left;
}
.intro-feature {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.intro-feature-icon {
  font-size: 1.5rem;
  width: 40px;
  text-align: center;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.intro-feature strong {
  display: block;
  font-size: 0.95rem;
  color: #E8F8F7;
  margin-bottom: 0.2rem;
}
.intro-feature span {
  font-size: 0.82rem;
  color: rgba(232,248,247,0.70);
  line-height: 1.45;
}

/* Support links */
.intro-support {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  margin-bottom: 1.25rem;
}
.intro-support-link {
  display: block;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 0.65rem 1rem;
  text-decoration: none;
  color: rgba(232,248,247,0.8);
  font-size: 0.85rem;
  text-align: left;
}
.intro-support-link strong { color: #E8F8F7; }
.intro-support-link span   { color: rgba(232,248,247,0.65); font-size: 0.78rem; }
.intro-support-link:hover  { border-color: rgba(0,191,179,0.3); background: rgba(0,191,179,0.05); }

.intro-legal {
  font-size: 0.75rem;
  color: rgba(232,248,247,0.55);
  line-height: 1.5;
  text-align: center;
}
.intro-legal a { color: rgba(0,191,179,0.7); text-decoration: underline; }

/* Footer: dots + button */
.intro-footer {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 1rem;
}
.intro-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 0.25rem;
}
.intro-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  transition: background 0.3s;
}
.intro-dot.active { background: #00BFB3; }
.intro-back-btn   { margin-top: -0.25rem; }

/* ── Onboarding ──────────────────────────────────────────── */
.onboarding-screen {
  padding: 2.5rem 1.75rem;
  gap: 1.5rem;
}
.onboarding-progress {
  display: flex;
  gap: 6px;
  margin-bottom: 0.5rem;
}
.onboarding-progress span {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,0.12);
  transition: background 0.3s;
}
.onboarding-progress span.active { background: #00BFB3; }

.onboarding-header h1 { margin-bottom: 0.5rem; }
.onboarding-header p  { color: rgba(232,248,247,0.75); font-size: 0.9rem; }

.options-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}
.option-card {
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.2s;
}
.option-card:hover  { border-color: rgba(0,191,179,0.4); background: rgba(0,191,179,0.05); }
.option-card.selected {
  border-color: #00BFB3;
  background: rgba(0,191,179,0.1);
}
.option-icon {
  font-size: 1.4rem;
  width: 42px;
  text-align: center;
}
.option-text strong { display: block; font-size: 0.95rem; margin-bottom: 0.1rem; }
.option-text span   { font-size: 0.8rem; color: rgba(232,248,247,0.70); }

/* ── Browse Screen ───────────────────────────────────────── */
.browse-screen {
  background: var(--abyss);
}
.browse-header {
  padding: 1.5rem 1.5rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.browse-header h2 { font-family: 'Manrope', sans-serif; font-size: 1.1rem; letter-spacing: 0.06em; }
.browse-sub { color: rgba(232,248,247,0.65); font-size: 0.8rem; margin-top: 0.2rem; }

.browse-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem 6rem;
}
.character-card {
  background: var(--navy);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid rgba(210,225,35,0.35);
  box-shadow: 0 0 14px rgba(210,225,35,0.06);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  position: relative;
}
.character-card:active { transform: scale(0.97); }
.character-card:hover  { border-color: rgba(210,225,35,0.75); box-shadow: 0 8px 28px rgba(210,225,35,0.15); }

.character-card img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  object-position: top;
  display: block;
}
.character-card-info {
  padding: 0.65rem 0.75rem 0.75rem;
}
.character-card-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: #E8F8F7;
}
.character-card-sub {
  font-size: 0.75rem;
  color: rgba(232,248,247,0.65);
  margin-top: 0.1rem;
}

.character-loading {
  grid-column: 1/-1;
  text-align: center;
  padding: 3rem;
  color: rgba(232,248,247,0.60);
}
.loading-spinner {
  width: 32px;
  height: 32px;
  border: 2px solid rgba(0,191,179,0.2);
  border-top-color: #00BFB3;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

/* ── Character Profile (full screen) ────────────────────── */
.profile-screen {
  position: relative;
  min-height: 100dvh;
  background: var(--abyss);
}
.profile-hero {
  position: relative;
  width: 100%;
  height: 65dvh;
}
.profile-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}
.profile-hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: linear-gradient(to top, var(--abyss) 0%, transparent 100%);
}
.profile-back {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: rgba(10,22,40,0.7);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
  color: #E8F8F7;
  font-size: 1rem;
}
.profile-content {
  padding: 0 1.5rem 2rem;
  margin-top: -2rem;
  position: relative;
}
.profile-name {
  font-family: 'Manrope', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 0.25rem;
}
.profile-meta {
  color: rgba(232,248,247,0.70);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}
.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.profile-tag {
  background: rgba(0,191,179,0.1);
  border: 1px solid rgba(0,191,179,0.25);
  border-radius: 100px;
  padding: 0.3rem 0.8rem;
  font-size: 0.75rem;
  color: #7DDBD6;
}
.profile-overview {
  font-size: 0.9rem;
  line-height: 1.7;
  color: rgba(232,248,247,0.75);
  margin-bottom: 1.5rem;
}
.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ── Chat Screen ─────────────────────────────────────────── */
.chat-screen {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  background: var(--abyss);
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--navy);
  border-bottom: 1px solid rgba(0,191,179,0.1);
  flex-shrink: 0;
}
.chat-header-back {
  background: none;
  border: none;
  color: #7DDBD6;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.25rem;
}
.chat-header-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  border: 1.5px solid rgba(0,191,179,0.4);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}
.chat-header-avatar:hover { transform: scale(1.08); border-color: var(--teal); }

/* ── Character profile slide-up overlay ─────────────────────── */
.char-profile-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: flex-end;
  opacity: 0; transition: opacity 0.25s;
}
.char-profile-overlay--open { opacity: 1; }
.char-profile-sheet {
  width: 100%; max-height: 80dvh;
  background: var(--navy);
  border-radius: 20px 20px 0 0;
  overflow: hidden;
  transform: translateY(40px);
  transition: transform 0.3s cubic-bezier(.22,.68,0,1.2);
  position: relative;
}
.char-profile-overlay--open .char-profile-sheet { transform: translateY(0); }
.char-profile-close {
  position: absolute; top: 12px; right: 14px; z-index: 2;
  background: rgba(0,0,0,0.45); border: none; border-radius: 50%;
  width: 30px; height: 30px; color: #fff; font-size: 0.9rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.char-profile-photo {
  width: 100%; aspect-ratio: 4/3; position: relative; overflow: hidden;
}
.char-profile-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.char-profile-gradient {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(13,32,53,0.95) 0%, transparent 55%);
}
.char-profile-name-block {
  position: absolute; bottom: 14px; left: 16px; right: 16px;
}
.char-profile-name-block h2 { margin: 0; font-size: 1.5rem; font-weight: 700; color: #fff; }
.char-profile-name-block p  { margin: 2px 0 0; font-size: 0.88rem; color: rgba(255,255,255,0.65); }
.char-profile-body { padding: 14px 18px 22px; color: rgba(232,248,247,0.8); font-size: 0.92rem; line-height: 1.6; }
.chat-header-info { flex: 1; }
.chat-header-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: #E8F8F7;
}
.chat-header-status {
  font-size: 0.75rem;
  color: #00BFB3;
}
.chat-header-timer {
  font-family: 'Inter', monospace;
  font-size: 0.85rem;
  color: rgba(232,248,247,0.70);
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  padding: 0.3rem 0.6rem;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  scroll-behavior: smooth;
}

.chat-bubble {
  max-width: 80%;
  padding: 0.75rem 1rem;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.55;
  animation: fadeIn 0.2s ease;
}
.chat-bubble.user {
  background: linear-gradient(135deg, #00BFB3, #0097A7);
  color: #0A1628;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}
.chat-bubble.assistant {
  background: var(--navy);
  color: #E8F8F7;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(0,191,179,0.1);
}
.chat-bubble.typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 0.85rem 1.1rem;
}
.chat-bubble.typing span {
  width: 7px;
  height: 7px;
  background: #00BFB3;
  border-radius: 50%;
  animation: pulse 1.2s ease-in-out infinite;
}
.chat-bubble.typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-bubble.typing span:nth-child(3) { animation-delay: 0.4s; }

.chat-input-area {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.85rem;
  background: var(--navy);
  border-top: 1px solid rgba(0,191,179,0.08);
  flex-shrink: 0;
}
.chat-input {
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 24px;
  padding: 0.7rem 1.1rem;
  color: #E8F8F7;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  resize: none;
  outline: none;
  max-height: 120px;
  overflow-y: auto;
  transition: border-color 0.2s;
}
.chat-input:focus { border-color: #00BFB3; }
.chat-input::placeholder { color: rgba(232,248,247,0.50); }

.chat-send-btn {
  width: 42px;
  height: 42px;
  min-width: 42px;
  background: linear-gradient(135deg, #00BFB3, #FF5CA8);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: opacity 0.15s, transform 0.15s;
  box-shadow: 0 2px 14px rgba(255,92,168,0.3);
  flex-shrink: 0;
}
.chat-send-btn:active { transform: scale(0.92); }
.chat-send-btn:disabled { opacity: 0.35; cursor: not-allowed; box-shadow: none; }

.chat-settings-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  margin-left: auto;
  color: rgba(232,248,247,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}
.chat-settings-btn:hover { color: #E8F8F7; }

/* ── Chat settings overlay ───────────────────────────────── */
.chat-settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 400;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.chat-settings-box {
  background: var(--navy);
  border: 1px solid rgba(0,191,179,0.2);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 480px;
  padding: 1.25rem 1.25rem 2rem;
}
.chat-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  color: #E8F8F7;
}
.chat-settings-close {
  background: none;
  border: none;
  color: rgba(232,248,247,0.70);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.25rem 0.4rem;
  line-height: 1;
}
.chat-settings-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.chat-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.chat-settings-row.chat-settings-locked { opacity: 0.45; }
.chat-settings-label { display: flex; flex-direction: column; gap: 0.15rem; }
.chat-settings-label-title { font-size: 0.95rem; color: #E8F8F7; }
.chat-settings-label-sub   { font-size: 0.75rem; color: rgba(232,248,247,0.65); }
.chat-settings-upgrade {
  font-size: 0.8rem;
  color: #00BFB3;
  cursor: pointer;
  padding: 0.25rem 0;
  text-decoration: none;
}
.chat-settings-upgrade:hover { text-decoration: underline; }

/* Toggle switch */
.voice-toggle {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}
.voice-toggle input { opacity: 0; width: 0; height: 0; }
.voice-toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.15);
  border-radius: 26px;
  cursor: pointer;
  transition: background 0.2s;
}
.voice-toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
}
.voice-toggle input:checked + .voice-toggle-slider { background: linear-gradient(135deg, #00BFB3, #FF5CA8); }
.voice-toggle input:checked + .voice-toggle-slider::before { transform: translateX(20px); }
.voice-toggle-disabled .voice-toggle-slider { cursor: not-allowed; }

/* Wrap textarea + mic together */
.chat-input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.chat-input {
  width: 100%;
  padding-right: 2.8rem; /* room for mic button inside */
}

.chat-mic-btn {
  position: absolute;
  right: 10px;
  bottom: 8px;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  opacity: 0.55;
  transition: opacity 0.15s, transform 0.1s;
  padding: 0;
}
.chat-mic-btn:hover  { opacity: 0.9; }
.chat-mic-btn:active { transform: scale(0.9); }
.chat-mic-btn.mic-listening {
  opacity: 1;
  animation: pulse 1s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,80,80,0.4); }
  50%       { box-shadow: 0 0 0 8px rgba(255,80,80,0); }
}

/* ── Mic waveform (recording indicator) ──────────────────────────────── */
.mic-waveform {
  display: none;
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  align-items: flex-end;
  gap: 3px;
  height: 20px;
  pointer-events: none;
}
.mic-waveform span {
  display: block;
  width: 3px;
  border-radius: 2px;
  background: #00BFB3;
  animation: waveBar 0.8s ease-in-out infinite;
}
.mic-waveform span:nth-child(1) { animation-delay: 0s;    }
.mic-waveform span:nth-child(2) { animation-delay: 0.15s; }
.mic-waveform span:nth-child(3) { animation-delay: 0.30s; }
.mic-waveform span:nth-child(4) { animation-delay: 0.15s; }
.mic-waveform span:nth-child(5) { animation-delay: 0s;    }
@keyframes waveBar {
  0%, 100% { height: 4px;  opacity: 0.45; }
  50%       { height: 18px; opacity: 1;    }
}
.chat-input-wrap.is-listening .mic-waveform { display: flex; }
.chat-input-wrap.is-listening .chat-input   { caret-color: transparent; }

.chat-photo-btn {
  width: 42px;
  height: 42px;
  min-width: 42px;
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(232,248,247,0.75);
  transition: background 0.18s, color 0.18s, transform 0.15s;
  flex-shrink: 0;
}
.chat-photo-btn:hover  { background: rgba(255,255,255,0.13); color: #E8F8F7; }
.chat-photo-btn:active { transform: scale(0.92); }
.chat-photo-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Photo bubble — no padding, no border, just wraps the fixed-size thumbnail */
.chat-image-bubble {
  padding: 0 !important;
  overflow: hidden !important;
  background: none !important;
  border: none !important;
  max-width: none !important;
}

.chat-photo-wrap {
  position: relative;
  display: inline-block;
  width: 180px;
  height: 270px;               /* fixed 2:3 portrait — same approach as conv list */
  cursor: pointer;
  background: #081421;
  border-radius: 12px;
  overflow: hidden;
  line-height: 0;
  flex-shrink: 0;
}

/* ── Image lightbox (tap to save) ─────────────────────────── */
.chat-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.chat-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.92);
}
.chat-lightbox-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  max-width: 100vw;
}
.chat-lightbox-img {
  max-width: min(90vw, 480px);
  max-height: 70vh;
  border-radius: 16px;
  object-fit: contain;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}
.chat-lightbox-actions {
  display: flex;
  gap: 0.75rem;
}
.chat-lightbox-close {
  opacity: 0.7;
}

.chat-photo-img {
  width: 180px;
  height: 270px;
  display: block;
  object-fit: cover;
  object-position: top center;
  border-radius: 0;
}

.chat-photo-watermark {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  opacity: 0.75;
  pointer-events: none;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.6));
}

/* ── Photo request prompt overlay ─────────────────────────── */
.photo-prompt-overlay {
  position: fixed;
  inset: 0;
  z-index: 8000;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 0 env(safe-area-inset-bottom);
}
.photo-prompt-box {
  background: var(--navy);
  border: 1px solid rgba(0,191,179,0.2);
  border-radius: 20px 20px 0 0;
  padding: 1.5rem 1.25rem 1.75rem;
  width: 100%;
  max-width: 520px;
}
.photo-prompt-title {
  font-size: 1rem;
  font-weight: 600;
  color: #E8F8F7;
  margin-bottom: 1rem;
  text-align: center;
}
.photo-prompt-input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  color: #E8F8F7;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}
.photo-prompt-input:focus { border-color: #00BFB3; }
.photo-prompt-input::placeholder { color: rgba(232,248,247,0.50); }
.photo-prompt-hint {
  font-size: 0.75rem;
  color: rgba(232,248,247,0.55);
  margin: 0.4rem 0 1rem;
  text-align: center;
}
.photo-prompt-btns {
  display: flex;
  gap: 0.75rem;
}
.photo-prompt-btns .btn { flex: 1; }

/* ── User photo sharing — action sheet + placeholder ────────── */
.chat-photo-action-sheet {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: flex-end;
  animation: fadeIn 0.15s ease;
}
.chat-photo-action-box {
  width: 100%;
  background: var(--navy);
  border-radius: 22px 22px 0 0;
  padding: 0 0.75rem 2rem;
}
/* drag handle */
.chat-photo-action-handle {
  width: 36px; height: 4px;
  background: rgba(232,248,247,0.18);
  border-radius: 2px;
  margin: 10px auto 14px;
}
.chat-photo-action-btn {
  display: flex; align-items: center; gap: 1rem;
  width: 100%; padding: 0.85rem 0.5rem;
  background: none; border: none; cursor: pointer;
  color: #E8F8F7;
  border-radius: 12px;
  text-align: left;
  transition: background 0.12s;
}
.chat-photo-action-btn:hover,
.chat-photo-action-btn:active { background: rgba(232,248,247,0.06); }
.chat-photo-action-btn + .chat-photo-action-btn {
  border-top: 1px solid rgba(232,248,247,0.06);
}
/* icon tile — rounded square, coloured background */
.chat-photo-action-btn-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.12s;
}
.chat-photo-action-btn-icon.icon-teal {
  background: rgba(0,191,179,0.14);
  color: #00BFB3;
}
.chat-photo-action-btn-icon.icon-pink {
  background: rgba(255,92,168,0.14);
  color: #FF5CA8;
}
.chat-photo-action-btn-icon.icon-purple {
  background: rgba(149,97,255,0.14);
  color: #9561FF;
}
.chat-photo-action-btn-icon.icon-gold {
  background: rgba(255,200,80,0.14);
  color: #ffc850;
}
.chat-photo-action-btn:active .chat-photo-action-btn-icon { opacity: 0.75; }

/* Document reading indicator */
.chat-doc-reading {
  display: flex; align-items: center; gap: 0.6rem;
  align-self: center;
  background: rgba(255,200,80,0.08);
  border: 1px solid rgba(255,200,80,0.18);
  border-radius: 12px;
  padding: 0.6rem 1rem;
  margin: 0.25rem 0;
  font-size: 0.85rem;
  animation: pulse 1.4s ease-in-out infinite;
}
.chat-doc-icon { font-size: 1.1rem; }
.chat-doc-name { color: rgba(232,248,247,0.7); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.chat-doc-status { color: #ffc850; font-size: 0.78rem; white-space: nowrap; }

/* Document bubble shown in the chat after a file is successfully uploaded */
.chat-doc-bubble { display: flex; align-items: center; gap: 0.5rem; font-size: 0.88rem; }
.chat-doc-bubble-icon { font-size: 1rem; flex-shrink: 0; }
.chat-doc-bubble-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; opacity: 0.9; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.55; }
}
.chat-photo-action-btn-text {
  display: flex; flex-direction: column; gap: 2px;
}
.chat-photo-action-btn-label {
  font-size: 1rem; font-weight: 500; color: #E8F8F7;
}
.chat-photo-action-btn-sub {
  font-size: 0.78rem; color: rgba(232,248,247,0.4);
}
.chat-photo-action-cancel {
  width: 100%; margin-top: 0.75rem;
  padding: 0.9rem;
  background: rgba(232,248,247,0.07); border: none; cursor: pointer;
  color: rgba(232,248,247,0.5); font-size: 1rem; font-weight: 500;
  border-radius: 14px;
  transition: background 0.12s;
}
.chat-photo-action-cancel:hover { background: rgba(232,248,247,0.11); }

/* placeholder shown in history when a user photo was sent */
.user-photo-placeholder {
  align-self: flex-end;
  width: 150px;
  background: rgba(232,248,247,0.04);
  border: 1.5px solid rgba(232,248,247,0.12);
  border-radius: 14px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 0.5rem;
  padding: 1.1rem 0.75rem;
  text-align: center;
  margin: 2px 0;
}
.user-photo-placeholder-icon { opacity: 0.25; }
.user-photo-placeholder-text {
  font-size: 0.72rem;
  color: rgba(232,248,247,0.4);
  line-height: 1.45;
}

/* user photo bubble — current session (real image) */
.user-photo-bubble {
  align-self: flex-end;
  width: 160px; height: 160px;
  border-radius: 14px;
  overflow: hidden;
  margin: 2px 0;
  flex-shrink: 0;
}
.user-photo-bubble img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.chat-limit-bar {
  background: rgba(0,191,179,0.06);
  border-top: 1px solid rgba(0,191,179,0.1);
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  color: rgba(232,248,247,0.65);
  text-align: center;
  flex-shrink: 0;
}
.chat-limit-bar a { color: #00BFB3; }

.chat-history-notice {
  text-align: center;
  font-size: 0.72rem;
  color: rgba(232,248,247,0.55);
  padding: 0.6rem 1rem 0.25rem;
  letter-spacing: 0.02em;
}
.chat-history-notice a { color: rgba(0,191,179,0.7); text-decoration: none; }
.chat-history-notice a:hover { color: #00BFB3; }

.chat-session-end {
  background: rgba(0,191,179,0.06);
  border: 1px solid rgba(0,191,179,0.2);
  border-radius: 12px;
  margin: 0 1rem;
  padding: 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(232,248,247,0.6);
}
.chat-session-end strong { display: block; color: #00BFB3; margin-bottom: 0.5rem; }
.chat-session-end .btn { margin-top: 0.75rem; }

/* ── Upgrade Screen ──────────────────────────────────────── */
.upgrade-screen {
  padding: 2rem 1.5rem;
  background: linear-gradient(180deg, var(--abyss), var(--navy));
}
.upgrade-header {
  text-align: center;
  margin-bottom: 2rem;
}
.upgrade-header h1 { margin-bottom: 0.5rem; }
.upgrade-header p  { color: rgba(232,248,247,0.75); font-size: 0.9rem; }

.tier-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}
.tier-card {
  background: var(--navy);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 1.25rem;
  cursor: pointer;
  transition: border-color 0.2s;
  position: relative;
}
.tier-card:hover    { border-color: rgba(0,191,179,0.4); }
.tier-card.popular  { border-color: #00BFB3; }
.tier-card.selected { border-color: #00BFB3; background: rgba(0,191,179,0.06); }

.tier-badge {
  position: absolute;
  top: -1px;
  right: 1rem;
  background: #00BFB3;
  color: #0A1628;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 0 0 8px 8px;
}
.tier-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.tier-name  { font-family: 'Manrope', sans-serif; font-size: 1rem; font-weight: 600; margin-bottom: 0.15rem; }
.tier-price { font-size: 1.4rem; font-weight: 700; color: #00BFB3; }
.tier-price span { font-size: 0.8rem; color: rgba(232,248,247,0.65); font-weight: 400; }
.tier-companions-badge {
  background: rgba(0,191,179,0.1);
  border: 1px solid rgba(0,191,179,0.2);
  border-radius: 100px;
  padding: 0.25rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #7DDBD6;
  white-space: nowrap;
  flex-shrink: 0;
  align-self: center;
}
.tier-coins-row {
  font-size: 0.82rem;
  font-weight: 600;
  color: #ffc850;
  margin-bottom: 0.75rem;
}
.tier-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  border-top: 1px solid rgba(232,248,247,0.07);
  padding-top: 0.75rem;
}
.tier-features li {
  font-size: 0.82rem;
  color: rgba(232,248,247,0.65);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.tier-feat-icon { font-style: normal; font-weight: 700; width: 1rem; text-align: center; flex-shrink: 0; }
.tier-features li:not(.tier-feature-na) .tier-feat-icon { color: #00BFB3; }
.tier-features li.tier-feature-na { color: rgba(232,248,247,0.50); }
.tier-features li.tier-feature-na .tier-feat-icon { color: rgba(232,248,247,0.40); }

.upgrade-footer {
  text-align: center;
  font-size: 0.8rem;
  color: rgba(232,248,247,0.55);
  margin-top: 1rem;
}

/* Coins explainer on upgrade screen */
.coins-explainer {
  background: rgba(0,191,179,0.06);
  border: 1px solid rgba(0,191,179,0.15);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  margin-bottom: 1.25rem;
}
.coins-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #7DDBD6;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}
.coins-grid { display: flex; flex-direction: column; gap: 0.35rem; }
.coin-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
}
.coin-action { color: rgba(232,248,247,0.6); }
.coin-cost { color: #00BFB3; font-weight: 600; }
.coin-cost.free { color: rgba(232,248,247,0.55); font-weight: 400; }
.coins-reset-note {
  margin-top: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(0,191,179,0.1);
  font-size: 0.75rem;
  color: rgba(232,248,247,0.50);
  font-style: italic;
}

/* Coin balance badge in chat */
.chat-coin-badge {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #ffc850;
  background: rgba(255,200,80,0.1);
  border: 1px solid rgba(255,200,80,0.2);
  border-radius: 20px;
  padding: 0.2rem 0.55rem;
  cursor: default;
}

/* Locked / N/A feature row in tier cards */
.tier-feature-na {
  opacity: 0.3;
}
.tier-feature-na::before { color: rgba(232,248,247,0.40) !important; }

/* ── Account locked overlay ─────────────────────────────────── */
.account-locked-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,22,40,0.97);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.account-locked-box {
  max-width: 360px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.account-locked-icon { font-size: 3rem; }
.account-locked-title {
  font-family: 'Manrope', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #E8F8F7;
}
.account-locked-body {
  font-size: 0.9rem;
  color: rgba(232,248,247,0.6);
  line-height: 1.65;
  margin: 0;
}
.account-locked-body a { color: #00BFB3; }
.account-locked-btn {
  margin-top: 0.5rem;
  width: 100%;
  text-decoration: none;
  display: block;
}

/* ── Crisis banner ───────────────────────────────────────────── */
.crisis-banner {
  margin: 0.75rem 0;
  border-radius: 10px;
  overflow: hidden;
}
.crisis-banner-inner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: rgba(255,90,90,0.08);
  border: 1px solid rgba(255,90,90,0.3);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  font-size: 0.84rem;
  color: rgba(232,248,247,0.75);
  line-height: 1.55;
}
.crisis-banner-inner strong { color: #E8F8F7; }
.crisis-banner-inner a { color: #ff9090; }
.crisis-banner-icon { font-size: 1.25rem; flex-shrink: 0; }
.crisis-banner-dismiss {
  background: none;
  border: none;
  color: rgba(232,248,247,0.35);
  font-size: 1rem;
  cursor: pointer;
  padding: 0;
  margin-left: auto;
  flex-shrink: 0;
  align-self: flex-start;
}
.crisis-banner-dismiss:hover { color: rgba(232,248,247,0.7); }

/* ── Coin shop overlay ──────────────────────────────────────── */
.coin-shop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 300;
  padding: 1rem;
}
.coin-shop-box {
  background: var(--navy);
  border: 1px solid rgba(255,200,80,0.25);
  border-radius: 20px 20px 16px 16px;
  padding: 1.5rem 1.25rem 1.25rem;
  width: 100%;
  max-width: 480px;
}
.coin-shop-title {
  font-family: 'Manrope', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffc850;
  margin-bottom: 0.35rem;
}
.coin-shop-sub {
  font-size: 0.85rem;
  color: rgba(232,248,247,0.75);
  margin-bottom: 1.1rem;
}
.coin-shop-packages {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.coin-pkg-btn {
  background: rgba(255,200,80,0.07);
  border: 1.5px solid rgba(255,200,80,0.2);
  border-radius: 12px;
  padding: 0.75rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.coin-pkg-btn:hover { border-color: #ffc850; background: rgba(255,200,80,0.12); }
.coin-pkg-amount { font-size: 1rem; font-weight: 700; color: #ffc850; }
.coin-pkg-label  { font-size: 0.7rem; color: rgba(232,248,247,0.60); text-transform: uppercase; letter-spacing: 0.05em; }
.coin-pkg-price  { font-size: 0.85rem; color: rgba(232,248,247,0.75); font-weight: 600; margin-top: 0.1rem; }
.coin-shop-upgrade {
  width: 100%;
  font-size: 0.82rem;
  color: rgba(0,191,179,0.7);
  margin-bottom: 0.4rem;
}
.coin-shop-dismiss {
  width: 100%;
  font-size: 0.8rem;
  color: rgba(232,248,247,0.50);
}

.upgrade-cta-btn {
  width: 100%;
  margin-top: 1.5rem;
  margin-bottom: 0.25rem;
}
.upgrade-accessibility {
  text-align: center;
  font-size: 0.75rem;
  color: rgba(232,248,247,0.50);
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.upgrade-accessibility a { color: rgba(0,191,179,0.6); }

/* Voice locked — shown for free tier users */
.voice-locked {
  opacity: 0.3;
}

/* ── Conversation swipe-to-reveal ───────────────────────── */
.conv-swipe-wrap {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.conv-actions-reveal {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  display: flex;
  align-items: stretch;
  width: 140px;
}
.conv-action-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: #fff;
}
.conv-action-btn span { font-size: 0.65rem; font-weight: 600; letter-spacing: 0.03em; }
.conv-archive-btn { background: #2a6496; }
.conv-delete-btn  { background: #c0392b; }
.conv-item        { background: var(--abyss); position: relative; z-index: 1; will-change: transform; }

/* ── Delete / Archive confirm overlay ───────────────────── */
.delete-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 1.5rem;
}
.delete-confirm-box {
  background: var(--navy);
  border: 1px solid rgba(0,191,179,0.2);
  border-radius: 16px;
  padding: 1.5rem;
  max-width: 340px;
  width: 100%;
  text-align: center;
}
.delete-confirm-box p {
  margin-bottom: 1.25rem;
  color: rgba(232,248,247,0.8);
  line-height: 1.5;
}
.delete-confirm-btns {
  display: flex;
  gap: 0.75rem;
}
.delete-confirm-btns .btn { flex: 1; }
.btn-danger {
  background: #c0392b;
  color: #fff;
  border: none;
}
.btn-danger:hover { background: #e74c3c; }

/* ── Chat limit overlay ──────────────────────────────────── */
.chat-limit-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 1.5rem;
}
.chat-limit-box {
  background: var(--navy);
  border: 1px solid rgba(0,191,179,0.2);
  border-radius: 20px;
  padding: 2rem 1.5rem 1.5rem;
  max-width: 340px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.chat-limit-icon  { font-size: 2.5rem; line-height: 1; }
.chat-limit-title { font-size: 1.1rem; font-weight: 700; color: #E8F8F7; margin: 0; }
.chat-limit-body  { font-size: 0.875rem; color: rgba(232,248,247,0.7); line-height: 1.55; margin: 0; }
.chat-limit-body strong { color: #E8F8F7; }

/* ── Restart archived chat overlay ──────────────────────── */
.restart-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 1.5rem;
}
.restart-confirm-box {
  background: var(--navy);
  border: 1px solid rgba(0,191,179,0.2);
  border-radius: 20px;
  padding: 2rem 1.5rem 1.5rem;
  max-width: 340px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}
.restart-confirm-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  margin-bottom: 0.25rem;
}
.restart-confirm-title { font-size: 1.1rem; font-weight: 700; color: #E8F8F7; margin: 0; }
.restart-confirm-body  { font-size: 0.875rem; color: rgba(232,248,247,0.65); line-height: 1.5; margin: 0 0 0.5rem; }
.restart-confirm-body strong { color: #E8F8F7; }
.restart-confirm-btns  { display: flex; gap: 0.75rem; width: 100%; }
.restart-confirm-btns .btn { flex: 1; }

/* ── Chat header menu button + popup ────────────────────── */
.chat-menu-btn {
  background: none;
  border: none;
  color: rgba(232,248,247,0.70);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0.25rem 0.4rem;
  line-height: 1;
}
.chat-menu-popup {
  position: absolute;
  top: 56px;
  right: 0.75rem;
  background: var(--navy);
  border: 1px solid rgba(0,191,179,0.2);
  border-radius: 12px;
  overflow: hidden;
  z-index: 200;
  min-width: 210px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.chat-menu-popup button {
  display: block;
  width: 100%;
  padding: 0.85rem 1.1rem;
  text-align: left;
  background: none;
  border: none;
  color: rgba(232,248,247,0.8);
  font-size: 0.9rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.chat-menu-popup button:last-child { border-bottom: none; }
.chat-menu-popup button:hover { background: rgba(0,191,179,0.07); color: #E8F8F7; }

/* ── Wellbeing card ──────────────────────────────────────── */
.wellbeing-card {
  align-self: stretch;
  background: rgba(0,191,179,0.05);
  border: 1px solid rgba(0,191,179,0.22);
  border-radius: 14px;
  padding: 1.1rem 1.25rem;
  margin: 0.75rem 0;
  font-size: 0.875rem;
  line-height: 1.55;
}
.wb-from {
  font-family: 'Manrope', sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #00BFB3;
  margin-bottom: 0.75rem;
}
.wb-body {
  color: rgba(232,248,247,0.75);
  margin-bottom: 0.6rem;
}
.wb-body:last-of-type { margin-bottom: 0.75rem; }
.wb-helplines {
  background: rgba(0,0,0,0.15);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}
.wb-line {
  color: rgba(232,248,247,0.7);
  font-size: 0.82rem;
  margin-bottom: 0.35rem;
}
.wb-line:last-child { margin-bottom: 0; }
.wb-line a { color: #7DDBD6; }
.wb-line strong { color: rgba(232,248,247,0.9); }
.wb-more { font-size: 0.82rem; color: #00BFB3; display: inline-block; }
.wb-more:hover { color: #7DDBD6; }

/* ── Enforced break overlay ──────────────────────────────── */
.break-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(10,22,40,0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.break-box {
  max-width: 360px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.break-icon { font-size: 3rem; line-height: 1; }
.break-title {
  font-family: 'Manrope', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #E8F8F7;
  margin: 0;
}
.break-body {
  font-size: 0.92rem;
  color: rgba(232,248,247,0.65);
  line-height: 1.6;
  margin: 0;
}
.break-countdown {
  font-family: 'Manrope', sans-serif;
  font-size: 3rem;
  font-weight: 700;
  color: #00BFB3;
  letter-spacing: 0.05em;
  line-height: 1;
  margin-top: 0.5rem;
}
.break-suggestions { font-style: italic; }
.break-countdown-label {
  font-size: 0.78rem;
  color: rgba(232,248,247,0.60);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin: 0;
}

/* ── Toast notifications ─────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  border: 1px solid rgba(0,191,179,0.3);
  border-radius: 12px;
  padding: 0.75rem 1.25rem;
  font-size: 0.85rem;
  color: #E8F8F7;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
  white-space: nowrap;
}
.toast.error { border-color: rgba(255,80,80,0.4); }

/* ── Utility ─────────────────────────────────────────────── */
.mt-auto  { margin-top: auto; }
.text-dim { color: rgba(232,248,247,0.70); }
.text-teal { color: #00BFB3; }
.spacer   { flex: 1; }
.divider  { height: 1px; background: rgba(255,255,255,0.07); margin: 0.5rem 0; }

/* ── Swipe / Browse Screen ───────────────────────────────── */
.swipe-screen {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--abyss);
  overflow: hidden;
}
.swipe-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.25rem;
  flex-shrink: 0;
}
.swipe-logo { height: 28px; }

.swipe-stack-wrap {
  flex: 1;
  position: relative;
  padding: 0 1rem;
  overflow: hidden;
}
.swipe-loading {
  display: flex; align-items: center; justify-content: center;
  height: 100%;
}

/* ── Swipe card ───────────────────────────────── */
.swipe-card {
  position: absolute;
  inset: 0;
  margin: 0 auto;
  max-width: 420px;
  width: 100%;
  background: var(--navy);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(0,191,179,0.12);
  cursor: grab;
  user-select: none;
  will-change: transform;
  transition: transform 0.15s ease;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.swipe-card:active { cursor: grabbing; }

.card-photo-wrap {
  position: relative;
  width: 100%;
  height: 72%;
}
.card-photo {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
  pointer-events: none;
}
.card-photo-gradient {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 55%;
  background: linear-gradient(to top, var(--navy) 0%, transparent 100%);
}
.identity-badge {
  position: absolute;
  top: 0.75rem; left: 0.75rem;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.6rem;
  border-radius: 100px;
}

.card-info {
  padding: 0.75rem 1.25rem 1rem;
  position: absolute;
  bottom: 0; left: 0; right: 0;
}
.card-name-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.1rem;
}
.card-name {
  font-family: 'Manrope', sans-serif;
  font-size: 1.5rem; font-weight: 700;
  color: #E8F8F7;
}
.card-age {
  font-size: 1.25rem;
  color: rgba(232,248,247,0.7);
  font-weight: 400;
}
.card-new-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #fff;
  background: linear-gradient(90deg, #FF6400, #FF9A3C);
  padding: 0.15em 0.55em;
  border-radius: 20px;
  white-space: nowrap;
  align-self: center;
}
.card-occupation {
  font-size: 0.82rem;
  color: #7DDBD6;
  margin-bottom: 0.3rem;
}
.card-blurb {
  font-size: 0.82rem;
  color: rgba(232,248,247,0.6);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.card-tap-hint {
  font-size: 0.7rem;
  color: rgba(232,248,247,0.50);
  text-align: center;
}

/* Swipe hint overlay */
.card-swipe-hint {
  position: absolute;
  top: 1.5rem; left: 50%;
  transform: translateX(-50%);
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  font-family: 'Manrope', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  pointer-events: none;
}
.hint-date {
  background: rgba(0,191,179,0.85);
  color: #0A1628;
  border: 2px solid #00BFB3;
}
.hint-skip {
  background: rgba(255,80,80,0.8);
  color: white;
  border: 2px solid #ff5050;
}

/* ── Bottom action buttons ────────────────────── */
.swipe-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 0.85rem 1.25rem 1rem;
  flex-shrink: 0;
}
.swipe-btn {
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, box-shadow 0.15s;
}
.swipe-btn:active { transform: scale(0.9); }
.swipe-btn svg { pointer-events: none; }

.swipe-btn-skip {
  width: 52px; height: 52px;
  background: var(--navy);
  border: 2px solid rgba(255,80,80,0.4);
  color: #ff7070;
}
.swipe-btn-skip svg { width: 20px; height: 20px; }
.swipe-btn-skip:hover { border-color: #ff5050; box-shadow: 0 0 16px rgba(255,80,80,0.2); }

.swipe-btn-info {
  width: 44px; height: 44px;
  background: var(--navy);
  border: 2px solid rgba(255,255,255,0.1);
  color: rgba(232,248,247,0.70);
}
.swipe-btn-info svg { width: 18px; height: 18px; }

.swipe-btn-date {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, #00BFB3, #0097A7);
  color: white;
  box-shadow: 0 4px 20px rgba(0,191,179,0.4);
}
.swipe-btn-date svg { width: 26px; height: 26px; }
.swipe-btn-date:hover { box-shadow: 0 6px 28px rgba(0,191,179,0.55); }

.swipe-end-card {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}

/* ── Full profile screen ──────────────────────── */
.profile-screen-full {
  min-height: 100dvh;
  background: var(--abyss);
  animation: fadeIn 0.3s ease;
  overflow-y: auto;
}
.profile-full-photo {
  position: relative;
  width: 100%;
  height: 65dvh;
}
.profile-full-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: top;
}
.profile-full-gradient {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 60%;
  background: linear-gradient(to top, var(--abyss), transparent);
}
.profile-full-back {
  position: absolute;
  top: 1rem; left: 1rem;
  width: 40px; height: 40px;
  background: rgba(10,22,40,0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: #E8F8F7;
}
.profile-full-name-block {
  position: absolute;
  bottom: 1.25rem; left: 1.5rem; right: 1.5rem;
}
.profile-full-name-block h1 {
  font-family: 'Manrope', sans-serif;
  font-size: 2rem; font-weight: 700;
  display: flex; align-items: baseline; gap: 0.5rem;
  margin-bottom: 0.25rem;
}
.profile-full-name-block h1 span {
  font-size: 1.4rem;
  color: rgba(232,248,247,0.65);
  font-weight: 400;
}
.profile-full-name-block p {
  color: #7DDBD6;
  font-size: 0.9rem;
}

.profile-full-body {
  padding: 1.25rem 1.5rem 3rem;
}
.profile-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.profile-pill {
  background: rgba(0,191,179,0.08);
  border: 1px solid rgba(0,191,179,0.2);
  border-radius: 100px;
  padding: 0.3rem 0.85rem;
  font-size: 0.78rem;
  color: #7DDBD6;
}

.profile-section {
  margin-bottom: 1.5rem;
}
.profile-section-label {
  display: flex; align-items: center; gap: 0.5rem;
  font-weight: 600; font-size: 0.9rem;
  color: #E8F8F7; margin-bottom: 0.6rem;
}
.profile-section p {
  font-size: 0.9rem;
  line-height: 1.75;
  color: rgba(232,248,247,0.7);
}
.profile-interests {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
}
.interest-tag {
  background: var(--navy);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 100px;
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
  color: rgba(232,248,247,0.65);
}

.profile-full-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 2rem;
}

/* Heart + chat button row on profile screen */
.profile-action-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.profile-chat-btn { flex: 1; }

.profile-fav-btn {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(232,248,247,0.06);
  border: 1.5px solid rgba(232,248,247,0.15);
  border-radius: 50%;
  cursor: pointer;
  color: rgba(232,248,247,0.75);
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}

.profile-fav-btn:hover  { background: rgba(255,107,138,0.12); border-color: rgba(255,107,138,0.4); color: #ff6b8a; }
.profile-fav-btn:active { transform: scale(0.93); }

.profile-fav-btn.profile-fav-active {
  background: rgba(255,107,138,0.15);
  border-color: rgba(255,107,138,0.5);
  color: #ff6b8a;
}

/* Chevron indicator on favourites list items */
.fav-chevron {
  font-size: 1.5rem;
  color: rgba(232,248,247,0.40);
  margin-left: auto;
  padding-left: 0.5rem;
  line-height: 1;
}

/* ── Bottom tab bar ──────────────────────────────────────── */
.tab-bar {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: var(--navy);
  border-top: 1px solid rgba(0,191,179,0.12);
  padding: 0.5rem 0 0.6rem;
  flex-shrink: 0;
}
.tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(232,248,247,0.55);
  flex: 1;
  padding: 0.3rem 0;
  transition: color 0.15s;
}
.tab-btn svg {
  width: 22px; height: 22px;
}
.tab-btn span {
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  font-weight: 500;
}
.tab-btn-active {
  background: linear-gradient(135deg, #00BFB3, #FF5CA8);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  border-top: 2px solid #d2e123;
  margin-top: -1px;
}
.tab-btn:hover { color: #7DDBD6; }

/* Unread badge on Messages tab */
.tab-icon-wrap { position: relative; display: inline-flex; }
.tab-unread-badge {
  position: absolute;
  top: -4px; right: -6px;
  background: #FF5CA8;
  color: #fff;
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1;
  min-width: 14px;
  height: 14px;
  border-radius: 7px;
  padding: 0 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--navy);
}

/* Logo icon in the Browse tab */
.tab-btn-logo {
  color: rgba(232,248,247,0.65);
}
.tab-btn-logo.tab-btn-active .tab-logo-icon,
.tab-btn-logo .tab-logo-icon {
  filter: none;
}
.tab-logo-icon {
  width: 28px;
  height: 26px;
  object-fit: contain;
  opacity: 0.5;
  transition: opacity 0.15s;
}
.tab-btn-active .tab-logo-icon {
  opacity: 1;
  filter: drop-shadow(0 0 4px rgba(0,191,179,0.6));
}

/* Small logo in chat headers (instead of text wordmark) */
.chat-header-logo {
  height: 20px;
  object-fit: contain;
  flex: 1;
  margin: 0 0.5rem;
}

/* ── Conversations screen ────────────────────────────────── */
.conv-screen {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--abyss);
  overflow: hidden;
}
.conv-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.25rem;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.conv-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
}
.conv-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.conv-item:hover, .conv-item:active {
  background: rgba(0,191,179,0.05);
}
.conv-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.conv-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  border: 2px solid rgba(0,191,179,0.2);
}
.conv-online-dot {
  position: absolute;
  bottom: 2px; right: 2px;
  width: 10px; height: 10px;
  background: #00BFB3;
  border-radius: 50%;
  border: 2px solid var(--abyss);
}
.conv-info {
  flex: 1;
  min-width: 0;
}
.conv-name-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.2rem;
}
.conv-name {
  font-family: 'Manrope', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #E8F8F7;
}
.conv-time {
  font-size: 0.7rem;
  color: rgba(232,248,247,0.55);
  flex-shrink: 0;
}
.conv-preview-wrap {
  display: flex;
  align-items: center;
  min-height: 1.2em;
}
.conv-preview {
  font-size: 0.82rem;
  color: rgba(232,248,247,0.65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-preview-char {
  color: rgba(0,191,179,0.7);
}
.conv-photo-thumb {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  object-position: top center;
  border: 1px solid rgba(255,255,255,0.1);
}
.conv-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 3rem 2rem;
  text-align: center;
  gap: 0.75rem;
}
.conv-empty-icon { font-size: 3rem; }
.conv-empty h3 {
  font-family: 'Manrope', sans-serif;
  font-size: 1.1rem;
  color: #E8F8F7;
}
.conv-empty p {
  color: rgba(232,248,247,0.65);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

/* ── Safe area (iPhone notch/home bar) ───────────────────── */
@supports (padding: env(safe-area-inset-bottom)) {
  .chat-input-area { padding-bottom: calc(0.75rem + env(safe-area-inset-bottom)); }
  .tab-bar         { padding-bottom: calc(0.6rem + env(safe-area-inset-bottom)); }
  /* Ensure top safe area is also covered on devices where @supports resolves it */
  #app             { padding-top: env(safe-area-inset-top); }
}

/* ── Conversations header gear button ────────────────────── */
.conv-header {
  justify-content: space-between;
}
.conv-header-spacer {
  width: 36px;
}
.conv-settings-btn {
  background: none;
  border: none;
  color: rgba(232,248,247,0.70);
  cursor: pointer;
  padding: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 0.15s, background 0.15s;
}
.conv-settings-btn:hover, .conv-settings-btn:active {
  color: #00BFB3;
  background: rgba(0,191,179,0.1);
}

/* ── Settings Screen ─────────────────────────────────────── */
.settings-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--abyss);
  color: #E8F8F7;
}
.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}
.settings-header h2 {
  font-family: 'Manrope', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #E8F8F7;
  margin: 0;
}
.settings-header-spacer {
  width: 36px;
}
.settings-back-btn {
  background: none;
  border: none;
  color: rgba(232,248,247,0.6);
  cursor: pointer;
  padding: 0.4rem;
  display: flex;
  align-items: center;
  border-radius: 50%;
  transition: color 0.15s;
}
.settings-back-btn:hover { color: #00BFB3; }
.settings-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.settings-loading {
  display: flex;
  justify-content: center;
  padding: 3rem;
}
.settings-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.settings-section-title {
  font-family: 'Manrope', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(232,248,247,0.60);
  margin: 0 0 0.25rem;
}
.settings-error {
  color: #e74c3c;
  font-size: 0.85rem;
  padding: 0.5rem 0;
}
.settings-toast-inline {
  background: rgba(0,191,179,0.12);
  border: 1px solid rgba(0,191,179,0.3);
  border-radius: 8px;
  color: #00BFB3;
  font-size: 0.85rem;
  padding: 0.65rem 1rem;
  text-align: center;
}
.settings-section-account {
  border-top: 1px solid rgba(255,255,255,0.07);
  padding-top: 1.5rem;
}
.settings-account-email {
  font-size: 0.85rem;
  color: rgba(232,248,247,0.65);
  margin: 0;
}
.settings-signout-btn {
  color: #e74c3c;
  border-color: rgba(231,76,60,0.3);
}
.settings-signout-btn:hover {
  background: rgba(231,76,60,0.08);
  border-color: rgba(231,76,60,0.5);
}

/* ── Danger zone ─────────────────────────────────────────── */
.settings-danger-zone {
  border-top: 1px solid rgba(231,76,60,0.15) !important;
}
.settings-danger-desc {
  font-size: 0.82rem;
  color: rgba(232,248,247,0.65);
  line-height: 1.5;
  margin-bottom: 1rem;
}
.settings-delete-btn {
  background: none;
  border: 1.5px solid rgba(231,76,60,0.4);
  color: #e74c3c;
  border-radius: 12px;
  padding: 0.7rem 1.25rem;
  font-size: 0.9rem;
  cursor: pointer;
  width: 100%;
  font-family: 'Inter', sans-serif;
  transition: background 0.15s, border-color 0.15s;
}
.settings-delete-btn:hover {
  background: rgba(231,76,60,0.08);
  border-color: rgba(231,76,60,0.7);
}

/* ── Delete account confirm overlay ─────────────────────── */
/* ── Plan change overlay ────────────────────────────────────── */
/* ── "Change plan" button under plan badge ─────────────────── */
.settings-change-plan-btn {
  display: block;
  text-align: left;
  background: none;
  border: none;
  color: rgba(232,248,247,0.50);
  font-size: 0.80rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  margin-top: 0.2rem;
  letter-spacing: 0.01em;
}
.settings-change-plan-btn:hover { color: rgba(232,248,247,0.85); text-decoration: underline; }

/* ── Plan selector overlay (full 5-plan picker) ────────────── */
.plan-selector-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 1.5rem;
}
.plan-selector-box {
  background: #0f1e35;
  border: 1px solid rgba(232,248,247,0.12);
  border-radius: 18px;
  padding: 1.75rem 1.5rem 1.5rem;
  width: 100%;
  max-width: 380px;
  position: relative;
}
.plan-selector-close {
  position: absolute;
  top: 1rem; right: 1rem;
  background: none; border: none;
  color: rgba(232,248,247,0.4);
  font-size: 1rem; cursor: pointer;
  padding: 0.25rem 0.5rem;
}
.plan-selector-close:hover { color: rgba(232,248,247,0.9); }
.plan-selector-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: rgba(232,248,247,0.95);
  margin: 0 0 0.5rem;
}
.plan-selector-current {
  font-size: 0.88rem;
  color: rgba(232,248,247,0.55);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.plan-selector-current-price {
  color: rgba(232,248,247,0.35);
}
.plan-selector-grid {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.plan-selector-pill {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1.5px solid var(--tc, rgba(232,248,247,0.15));
  background: rgba(255,255,255,0.04);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  text-align: left;
}
.plan-selector-pill:not([disabled]):hover {
  background: rgba(255,255,255,0.09);
  border-color: var(--tc, rgba(232,248,247,0.4));
}
.plan-selector-pill[disabled] {
  cursor: default;
  opacity: 0.7;
}
.plan-selector-pill-active {
  background: rgba(255,255,255,0.07);
}
.psp-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--tc, rgba(232,248,247,0.9));
}
.psp-price {
  font-size: 0.8rem;
  color: rgba(232,248,247,0.45);
}
.plan-selector-pill-active .psp-price {
  color: var(--tc, rgba(232,248,247,0.6));
}

.plan-change-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 1.5rem;
}
.plan-change-box {
  background: #0f1e35;
  border: 1px solid rgba(232,248,247,0.12);
  border-radius: 18px;
  padding: 1.75rem 1.5rem 1.5rem;
  width: 100%;
  max-width: 380px;
}
.plan-change-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 1rem;
  color: rgba(232,248,247,0.95);
}
.plan-change-price-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  font-weight: 600;
}
.plan-change-arrow {
  color: rgba(232,248,247,0.35);
  font-size: 1rem;
}
.plan-change-bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.plan-change-bullets li {
  font-size: 0.85rem;
  color: rgba(232,248,247,0.75);
  padding-left: 1rem;
  position: relative;
}
.plan-change-bullets li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #00BFB3;
  font-size: 0.75rem;
}
.plan-change-note {
  font-size: 0.8rem;
  color: rgba(232,248,247,0.5);
  margin: 0 0 1rem;
  line-height: 1.5;
}
.plan-change-coming-soon {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  background: rgba(232,248,247,0.05);
  border: 1px solid rgba(232,248,247,0.1);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  margin-bottom: 1.25rem;
  font-size: 0.8rem;
  color: rgba(232,248,247,0.55);
  line-height: 1.5;
}
.plan-change-btns {
  display: flex;
  gap: 0.75rem;
}
.plan-change-btns .btn {
  flex: 1;
  font-size: 0.88rem;
}
.plan-change-btns .btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.delete-account-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 1.5rem;
}
.delete-account-box {
  background: var(--navy);
  border: 1px solid rgba(231,76,60,0.3);
  border-radius: 20px;
  padding: 2rem 1.5rem 1.5rem;
  max-width: 340px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.delete-account-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #E8F8F7;
  margin: 0;
}
.delete-account-body {
  font-size: 0.875rem;
  color: rgba(232,248,247,0.65);
  line-height: 1.5;
  margin: 0;
}
.delete-account-body strong { color: #E8F8F7; }
.delete-account-input {
  background: rgba(255,255,255,0.05);
  border: 1.5px solid rgba(231,76,60,0.3);
  border-radius: 10px;
  padding: 0.7rem 1rem;
  color: #E8F8F7;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  outline: none;
  margin-top: 0.25rem;
}
.delete-account-input:focus { border-color: #e74c3c; }
.delete-account-error {
  font-size: 0.8rem;
  color: #e74c3c;
}
.delete-account-btns {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.25rem;
}
.delete-account-btns .btn { flex: 1; }

/* ── Archived toggle link at bottom of conv list ─────────── */
.conv-archive-back-btn {
  background: none;
  border: none;
  color: var(--teal);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.25rem 0;
}
.conv-archive-back-btn:hover { color: var(--teal2); }

.conv-archive-toggle {
  padding: 1.25rem;
  text-align: center;
}
.conv-archive-toggle-btn {
  font-size: 0.82rem;
  color: rgba(232,248,247,0.60);
  border-color: rgba(255,255,255,0.08);
}
.conv-archive-toggle-btn:hover {
  color: rgba(232,248,247,0.7);
}

/* ── Browse screen header (account icon) ─────────────────── */
.swipe-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Settings plan row ───────────────────────────────────── */
.settings-plan-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0.25rem 0 0.5rem;
}
.settings-plan-badge {
  border: 1.5px solid;
  border-radius: 20px;
  padding: 0.2rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.settings-plan-detail {
  font-size: 0.82rem;
  color: rgba(232,248,247,0.70);
}
/* ── Save changes section (between Personalise and Account) ─── */
.settings-section-save {
  background: none;
  border: none;
  padding: 0 0 0.25rem;
  margin-bottom: 0;
}
.settings-section-save .btn-primary {
  width: 100%;
}

/* ── Tier selector ──────────────────────────────────────────── */
.settings-tier-selector {
  margin: 1rem 0 0.75rem;
  border-top: 1px solid rgba(232,248,247,0.08);
  padding-top: 1rem;
}
.settings-tier-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(232,248,247,0.45);
  margin: 0 0 0.65rem;
}
.settings-tier-grid {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.tier-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.6rem 0.85rem;
  border-radius: 10px;
  border: 1.5px solid rgba(232,248,247,0.12);
  background: rgba(232,248,247,0.04);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: left;
}
.tier-pill:not([disabled]):hover {
  border-color: var(--tier-color, rgba(232,248,247,0.35));
  background: rgba(232,248,247,0.07);
}
.tier-pill[disabled] {
  border-color: var(--tier-color, rgba(232,248,247,0.35));
  background: rgba(232,248,247,0.06);
  cursor: default;
  opacity: 1;
}
.tier-pill-active {
  border-color: var(--tier-color) !important;
}
.tier-pill-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--tier-color, rgba(232,248,247,0.9));
}
.tier-pill-price {
  font-size: 0.78rem;
  color: rgba(232,248,247,0.50);
}
.tier-pill-active .tier-pill-price {
  color: rgba(232,248,247,0.65);
  font-style: italic;
}
.settings-tier-note {
  font-size: 0.8rem;
  color: rgba(232,248,247,0.55);
  margin: 0.6rem 0 0;
  line-height: 1.5;
}

/* ── Settings row (toggle rows) ──────────────────────────── */
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.settings-row-label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}
.settings-row-title {
  font-size: 0.92rem;
  font-weight: 500;
  color: #E8F8F7;
}
.settings-row-sub {
  font-size: 0.78rem;
  color: rgba(232,248,247,0.70);
  line-height: 1.4;
}
.settings-section-desc {
  font-size: 0.82rem;
  color: rgba(232,248,247,0.70);
  line-height: 1.5;
  margin-top: -0.25rem;
}
.settings-sub-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem 0 0.25rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.settings-time-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0 0.6rem 0;
}
.settings-time-label {
  font-size: 0.8rem;
  color: rgba(232,248,247,0.70);
}
.settings-time-input {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(0,191,179,0.25);
  border-radius: 8px;
  color: #E8F8F7;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  padding: 0.35rem 0.65rem;
  outline: none;
  color-scheme: dark;
}
.settings-time-input:focus {
  border-color: #00BFB3;
}

/* ── Proactive message / selfie count controls ────────────── */
.settings-proactive-block {
  padding: 1rem 0 0.5rem;
  border-top: 1px solid rgba(232,248,247,0.06);
  margin-top: 0.5rem;
}
.settings-proactive-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(232,248,247,0.75);
  margin-bottom: 0.65rem;
}
.settings-count-selector {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.count-btn {
  width: 40px; height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(232,248,247,0.15);
  background: rgba(255,255,255,0.04);
  color: rgba(232,248,247,0.6);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  display: flex; align-items: center; justify-content: center;
}
.count-btn-active {
  background: rgba(0,191,179,0.15);
  border-color: #00BFB3;
  color: #00BFB3;
}
.count-btn:hover:not(.count-btn-active) {
  border-color: rgba(232,248,247,0.35);
  color: rgba(232,248,247,0.85);
}
.settings-selfie-select {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255,255,255,0.04) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2300BFB3' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 0.75rem center;
  border: 1px solid rgba(232,248,247,0.15);
  border-radius: 10px;
  color: rgba(232,248,247,0.85);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.55rem 2.25rem 0.55rem 0.9rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  min-width: 110px;
  transition: border-color 0.15s;
}
.settings-selfie-select:focus {
  outline: none;
  border-color: #00BFB3;
}
.settings-selfie-select option {
  background: #0d1f35;
  color: #e8f8f7;
}
.settings-proactive-hint {
  font-size: 0.76rem;
  color: rgba(232,248,247,0.4);
  margin-bottom: 0.6rem;
  line-height: 1.5;
}
.settings-time-slot {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.settings-time-slot-label {
  font-size: 0.8rem;
  color: rgba(232,248,247,0.5);
  min-width: 70px;
}
.settings-coin-note {
  font-size: 0.72rem;
  color: rgba(232,248,247,0.3);
  margin-top: 0.5rem;
}
.settings-row-hint {
  font-size: 0.76rem;
  color: rgba(232,248,247,0.4);
  padding: 0 0 0.75rem;
  line-height: 1.5;
}


/* ══════════════════════════════════════════════════════════════
   THEMES  —  applied via data-theme on <html>
   Free = navy (default). Spark+ unlock the rest.
   ══════════════════════════════════════════════════════════════ */

/* Each theme: rich coloured background (soft gradient) that fully replaces
   the default, surfaces (--navy) tuned to match, and the flat theme colour
   driving buttons. Text stays light for legibility. */

/* ── Obsidian ─── all black + dark grey, gothic ─────────────── */
html[data-theme="obsidian"] {
  --abyss: #000000;
  --navy:  #141416;
  --teal:  #AAAAAA;
  --teal2: #888888;
  --pink:  #C9C9D6;
  --pink2: #E0E0EA;
  --ice:   #ECECF2;
}
html[data-theme="obsidian"] body,
html[data-theme="obsidian"] #app,
html[data-theme="obsidian"] .splash { background: linear-gradient(160deg, #0B0B0D 0%, #000000 100%); }
html[data-theme="obsidian"] .btn-primary,
html[data-theme="obsidian"] .chat-send-btn,
html[data-theme="obsidian"] .browse-match-btn { background: linear-gradient(135deg,#3A3A42,#17171A) !important; color:#ECECF2 !important; }

/* ── Warm Rose ─── actual dusky rose background ─────────────── */
html[data-theme="rose"] {
  --abyss: #5C2A3C;
  --navy:  #6B3447;
  --teal:  #F2A0B0;
  --teal2: #F8C4CF;
  --pink:  #FF8FB0;
  --pink2: #FFB8CE;
  --ice:   #FFF0F4;
}
html[data-theme="rose"] body,
html[data-theme="rose"] #app,
html[data-theme="rose"] .splash { background: linear-gradient(160deg, #743A4C 0%, #3F1D2B 100%); }
html[data-theme="rose"] .btn-primary,
html[data-theme="rose"] .chat-send-btn,
html[data-theme="rose"] .browse-match-btn { background: linear-gradient(135deg,#E8899A,#C2546E) !important; color:#fff !important; }

/* ── Blue ─── deep ocean blue, #1689B3 accent ────────────────── */
html[data-theme="forest"] {
  --abyss: #0A2D42;
  --navy:  #113D57;
  --teal:  #1689B3;
  --teal2: #41A8CC;
  --pink:  #5EC4E8;
  --pink2: #8ED8F0;
  --ice:   #EEF8FC;
}
html[data-theme="forest"] body,
html[data-theme="forest"] #app,
html[data-theme="forest"] .splash { background: linear-gradient(160deg, #071828 0%, #030B14 100%); }
html[data-theme="forest"] .btn-primary,
html[data-theme="forest"] .chat-send-btn,
html[data-theme="forest"] .browse-match-btn { background: linear-gradient(135deg,#1689B3,#0E6A90) !important; color:#fff !important; }

/* ── Pride ─── full vivid rainbow + purple interior ─────────── */
html[data-theme="pride"] {
  --abyss: #190A30;
  --navy:  #261545;
  --teal:  #FF71CE;
  --teal2: #FFD700;
  --pink:  #C084FC;
  --pink2: #E879F9;
  --ice:   #FFFFFF;
}
html[data-theme="pride"],
html[data-theme="pride"] body,
html[data-theme="pride"] #app,
html[data-theme="pride"] .splash {
  background: linear-gradient(160deg,
    #FF0055 0%, #FF6600 18%, #FFD700 36%,
    #00CC44 54%, #0066FF 72%, #AA00FF 100%
  ) !important;
}
html[data-theme="pride"] .btn-primary,
html[data-theme="pride"] .chat-send-btn,
html[data-theme="pride"] .browse-match-btn { background: linear-gradient(135deg,#FF0044,#FF6600,#FFD700,#00CC44,#0055FF,#AA00FF) !important; color:#fff !important; }
/* All screens transparent so the rainbow body shows through */
html[data-theme="pride"] .browse-screen,
html[data-theme="pride"] .swipe-screen,
html[data-theme="pride"] .conv-screen,
html[data-theme="pride"] .chat-screen { background: transparent !important; }
/* Individual conversation items get a frosted purple card */
html[data-theme="pride"] .conv-item { background: rgba(38,21,69,0.85) !important; }

/* ── Theme picker in Settings ─────────────────────────────────── */
.settings-theme-grid {
  display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.25rem;
}
.theme-swatch {
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
  background: none; border: none; cursor: pointer; padding: 0;
}
.theme-swatch-bg {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid rgba(255,255,255,0.12);
  transition: border-color 0.2s, transform 0.15s;
  position: relative; overflow: hidden;
}
.theme-swatch-active .theme-swatch-bg {
  border-color: var(--teal);
  transform: scale(1.08);
  box-shadow: 0 0 12px rgba(0,0,0,0.4);
}
.theme-swatch-bg::after {
  content: '';
  position: absolute; bottom: 6px; right: 6px;
  width: 16px; height: 16px; border-radius: 50%;
}
.theme-swatch-dot {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
}
.theme-swatch-active .theme-swatch-bg::before {
  content: '✓';
  position: absolute; top: 3px; right: 5px;
  font-size: 0.65rem; font-weight: 700; color: #fff;
}
.theme-swatch-label {
  font-size: 0.68rem; color: rgba(232,248,247,0.55);
  font-weight: 500; text-align: center; max-width: 56px;
  line-height: 1.2;
}
.theme-swatch-active .theme-swatch-label { color: var(--teal); font-weight: 700; }
.settings-theme-locked {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px; padding: 1rem;
}

/* ── Collapsible settings section ─────────────────────────────── */
.settings-collapse { cursor: default; }
.settings-collapse-summary {
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; list-style: none; user-select: none;
}
.settings-collapse-summary::-webkit-details-marker { display: none; }
.settings-collapse-chevron {
  color: var(--teal); font-size: 0.9rem; transition: transform 0.2s ease;
}
.settings-collapse[open] .settings-collapse-chevron { transform: rotate(180deg); }

/* ── Make them yours (chat personalisation) ───────────────────── */
.chat-personalise-toggle {
  background: rgba(0,191,179,0.12); color: var(--teal);
  border: 1px solid rgba(0,191,179,0.3); border-radius: 100px;
  font-size: 0.82rem; font-weight: 700; padding: 0.35rem 0.9rem; cursor: pointer;
  white-space: nowrap; flex-shrink: 0;
}
#personalise-panel { padding: 0.5rem 0 0.25rem; }
.personalise-ctrl { margin-bottom: 0.85rem; }
.personalise-ctrl-label {
  display: block; font-size: 0.8rem; color: rgba(232,248,247,0.6);
  margin-bottom: 0.4rem;
}
.personalise-seg {
  display: flex; flex-wrap: wrap; gap: 0.35rem;
}
.personalise-opt {
  background: rgba(255,255,255,0.05); color: rgba(232,248,247,0.7);
  border: 1px solid rgba(255,255,255,0.1); border-radius: 100px;
  font-size: 0.78rem; padding: 0.3rem 0.7rem; cursor: pointer;
  transition: all 0.15s ease;
}
.personalise-opt-active {
  background: linear-gradient(135deg, var(--teal), var(--pink));
  color: #0A1628; font-weight: 700; border-color: transparent;
}
.personalise-reset {
  background: none; border: none; color: rgba(232,248,247,0.4);
  font-size: 0.78rem; text-decoration: underline; cursor: pointer;
  padding: 0.25rem 0; margin-top: 0.25rem;
}
.personalise-reset:hover { color: rgba(232,248,247,0.7); }

/* ============================================================
   Games
   ============================================================ */
.games-screen {
    padding: 16px;
}

.games-header {
    margin-bottom: 24px;
}

.games-header h1 {
    margin: 0;
}

.games-header p {
    opacity: .8;
}

.games-section {
    margin-bottom: 32px;
}

.games-section-title {
    font-weight: 700;
    margin-bottom: 12px;
}

.game-card,
.session-card {
    width: 100%;
    border: 1px solid rgba(0,191,179,0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    margin-bottom: 12px;
    border-radius: 16px;
    background: var(--navy);
    color: inherit;
}

.game-card-icon {
    font-size: 32px;
}

.game-card-content {
    flex: 1;
    text-align: left;
}

.game-card-content h3 {
    margin: 0 0 4px;
}

.game-card-content p {
    margin: 0;
    opacity: .75;
}

.achievement-card {
    display: flex;
    gap: 16px;
    padding: 16px;
    border-radius: 16px;
    margin-bottom: 12px;
    background: var(--navy);
    border: 1px solid rgba(0,191,179,0.15);
}

.achievement-icon {
    font-size: 28px;
}

.games-empty {
    opacity: .6;
}
/* ============================================================
   General game screen (full-screen route)
   ============================================================ */
.game-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  gap: 16px;
}
.game-status {
  font-weight: 600;
  font-size: .95rem;
  text-align: center;
  padding: 8px 20px;
  background: rgba(0,191,179,0.1);
  border-radius: 999px;
  color: var(--teal2);
}
.game-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* ============================================================
   Tic-Tac-Toe
   ============================================================ */
.ttt-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: 100%;
  max-width: 280px;
}
.ttt-cell {
  aspect-ratio: 1;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  font-size: 2rem;
  font-weight: 700;
  color: var(--ice);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s;
}
.ttt-cell:hover:not([disabled]) { background: rgba(0,191,179,0.12); }
.ttt-cell[disabled] { cursor: default; }
.ttt-cell--winning {
  background: rgba(0,191,179,0.2);
  border-color: var(--teal);
  box-shadow: 0 0 10px rgba(0,191,179,0.4);
}

/* ============================================================
   Connect Four
   ============================================================ */

.c4-container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

.c4-columns {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}

.c4-drop-btn {
  border: none;
  background: transparent;
  color: var(--teal);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 8px 0;
}

.c4-board-wrap {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}
.c4-col-buttons {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  padding: 0 10px;
  margin-bottom: 4px;
}
.c4-board {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  padding: 10px;
  border-radius: 16px;
  background: var(--navy);
  border: 1px solid rgba(0,191,179,0.15);
}

.c4-cell {
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
}

/* BEM names used by ConnectFourBoard component */
.c4-cell--user      { background: #ff5a5a; }
.c4-cell--companion { background: #ffd43b; }
.c4-cell--winning   { box-shadow: 0 0 12px rgba(255,255,255,0.8); }

@keyframes game-piece-in {
  0%   { transform: scale(0.35); opacity: 0.4; }
  65%  { transform: scale(1.18); }
  100% { transform: scale(1);    opacity: 1; }
}
.ttt-cell--new { animation: game-piece-in 0.32s cubic-bezier(.22,.68,0,1.2) both; }
.c4-cell--new  { animation: game-piece-in 0.32s cubic-bezier(.22,.68,0,1.2) both; }

/* legacy class names */
.c4-red    { background: #ff5a5a; }
.c4-yellow { background: #ffd43b; }
.c4-winning { box-shadow: 0 0 12px rgba(255,255,255,0.8); }
/* ============================================================
   Battleships
   ============================================================ */

.bs-board {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 3px;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}

.bs-board-title {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  opacity: 0.5;
  margin: 4px 0 2px;
}

.bs-cell {
  aspect-ratio: 1;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 3px;
  background: rgba(0, 80, 120, 0.55);
  cursor: default;
  padding: 0;
}

/* BEM names used by BattleshipsBoard component */
.bs-cell--ship  { background: rgba(0,191,179,0.4); border-color: rgba(0,191,179,0.5); }
.bs-cell--hit   { background: #e05268; border-color: #e05268; }
.bs-cell--miss  { background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.2); }
.bs-cell--clickable { cursor: crosshair; }
.bs-cell--clickable:hover { background: rgba(0,191,179,0.25); border-color: var(--teal); }

/* ── Battleships score bar ───────────────────────────────── */
.bs-score-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 0.5rem auto 1rem;
  max-width: 360px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 0.6rem 1rem;
}
.bs-score-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.bs-score-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.55;
}
.bs-score-ships { font-size: 1rem; letter-spacing: 1px; }
.bs-score-num {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--teal);
}
.bs-score-vs {
  font-size: 0.7rem;
  font-weight: 800;
  opacity: 0.35;
  letter-spacing: 0.08em;
}

/* Legacy names (ShipPlacementBoard uses .bs-ship) */
.bs-ship  { background: rgba(0,191,179,0.4); border-color: rgba(0,191,179,0.5); }
.bs-hit   { background: #e05268; border-color: #e05268; }
.bs-miss  { background: rgba(255,255,255,0.18); }

.bs-placement {
  margin-bottom: 1rem;
}

.bs-ships {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1rem;
}

.bs-ship-btn {
  padding: 8px 12px;
  border-radius: 999px;
  border: none;
  background: var(--navy);
  color: var(--ice);
  cursor: pointer;
}
/* ============================================================
   Rock Paper Scissors
   ============================================================ */

.rps-selector {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
}

.rps-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  background: var(--navy);
  color: var(--ice);
}

.rps-choice span {
  font-size: .85rem;
}

.rps-scoreboard {
  display: flex;
  justify-content: space-around;
  margin: 20px 0;
}

.rps-result {
  margin: 20px 0;
  text-align: center;
}
.rps-score { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.rps-score-label { font-size: .78rem; opacity: 0.55; }
.rps-score-value { font-size: 1.6rem; font-weight: 700; }
.rps-result-row  { display: flex; align-items: center; justify-content: center; gap: 16px; font-size: 1.8rem; }
.rps-emoji { font-size: 2rem; }
.rps-emoji--red { filter: hue-rotate(-55deg) saturate(1.4); }
.rps-vs    { font-size: .85rem; opacity: 0.5; }
.rps-outcome { font-weight: 600; margin-top: 8px; }
.rps-prompt  { font-size: .9rem; opacity: 0.7; text-align: center; }

.rps-color-picker {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; margin-bottom: 8px;
}
.rps-color-label { font-size: 0.78rem; opacity: 0.55; }
.rps-color-btn {
  font-size: 0.78rem; padding: 4px 10px; border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.15);
  background: transparent; color: var(--ice); cursor: pointer;
  opacity: 0.6; transition: opacity 0.15s, border-color 0.15s;
}
.rps-color-btn.active {
  opacity: 1; border-color: var(--teal);
  background: rgba(100,220,200,0.08);
}

/* Connect Four legend */
.c4-legend { display: flex; gap: 16px; font-size: .85rem; opacity: 0.75; }
.c4-legend-user, .c4-legend-companion { display: flex; align-items: center; gap: 4px; }
/* ============================================================
   Mystery Night
   ============================================================ */

/* Case picker cards — same family as .game-card */
.mystery-case-card {
  width: 100%;
  border: 1px solid rgba(0,191,179,0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  margin-bottom: 12px;
  border-radius: 16px;
  background: var(--navy);
  color: inherit;
  text-align: left;
}

.mystery-case-card h3 { margin: 0 0 4px; }
.mystery-case-card p  { margin: 4px 0 0; opacity: .75; font-size: .9rem; }

.mystery-case-type {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--teal);
  background: rgba(0,191,179,0.12);
  border-radius: 999px;
  padding: 2px 10px;
}

.mystery-surprise {
  border-color: rgba(0,191,179,0.4);
  background: linear-gradient(135deg, rgba(0,191,179,0.12), rgba(255,92,168,0.08));
}

/* Active-case banner under the chat header */
.mystery-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 14px;
  border: none;
  border-bottom: 1px solid rgba(0,191,179,0.25);
  background: linear-gradient(90deg, rgba(0,191,179,0.14), rgba(255,92,168,0.08));
  color: inherit;
  cursor: pointer;
  font-size: .85rem;
}

.mystery-banner-icon  { font-size: 1rem; }
.mystery-banner-title {
  flex: 1;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mystery-banner-chevron { opacity: .6; font-size: 1.1rem; }

/* Case-file sheet */
.mystery-sheet-case {
  text-align: center;
  padding: 4px 16px 14px;
}
.mystery-sheet-icon { font-size: 2.2rem; }
.mystery-sheet-case h3 { margin: 8px 0 6px; }
.mystery-sheet-case p  { margin: 10px 0 0; opacity: .8; font-size: .9rem; }
.mystery-sheet-tip {
  font-size: .82rem !important;
  opacity: .65 !important;
}

/* ============================================================
   Game Sheet — slide-up in-chat game panel
   ============================================================ */

.game-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.game-sheet-backdrop.visible { opacity: 1; }

.game-reaction-overlay {
  position: fixed;
  left: 50%;
  bottom: calc(88dvh - 60px);
  transform: translateX(-50%) translateY(12px);
  z-index: 300;
  background: var(--navy);
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 18px 18px 4px 18px;
  padding: 11px 16px;
  max-width: min(300px, 82vw);
  color: var(--ice);
  font-size: 0.92rem;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.game-reaction-overlay.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.game-reaction-overlay.fading {
  opacity: 0;
  transform: translateX(-50%) translateY(-8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.bs-score {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--teal);
  margin-left: 8px;
  opacity: 0.85;
}

.game-sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 201;
  background: var(--navy);
  border-radius: 20px 20px 0 0;
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.game-sheet.visible { transform: translateY(0); }

.game-sheet-handle-area {
  padding: 10px 0 4px;
  display: flex;
  justify-content: center;
  cursor: grab;
  touch-action: none;
  flex-shrink: 0;
}
.game-sheet-handle {
  width: 36px; height: 4px;
  background: rgba(255,255,255,0.18);
  border-radius: 2px;
}

.game-sheet-header {
  display: flex;
  align-items: center;
  padding: 4px 16px 12px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.game-sheet-title {
  flex: 1;
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
}
.game-sheet-close {
  background: none; border: none;
  color: var(--ice); opacity: 0.45;
  font-size: 1.3rem; cursor: pointer;
  padding: 4px 8px; line-height: 1;
}
.game-sheet-close:hover { opacity: 1; }

.game-sheet-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 16px 24px;
}

/* ── Game picker grid ─────────────────────────────────────── */
.game-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.game-picker-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 14px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  transition: background 0.15s, border-color 0.15s;
  color: inherit;
  text-align: left;
}
.game-picker-card:hover,
.game-picker-card:active {
  background: rgba(0,191,179,0.1);
  border-color: rgba(0,191,179,0.3);
}
.game-picker-card-icon { font-size: 1.8rem; }
.game-picker-card-name {
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: .88rem;
}
.game-picker-card-desc {
  font-size: .76rem;
  opacity: 0.55;
  line-height: 1.35;
}
.game-picker-card.game-picker-wide {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  gap: 14px;
}
.game-picker-card.game-picker-wide .game-picker-card-icon { font-size: 1.5rem; }
.game-picker-card.game-picker-wide .game-picker-card-text { flex: 1; }

/* ── In-sheet game board ──────────────────────────────────── */
.game-sheet-game {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding-bottom: 8px;
}
.game-sheet-status {
  font-weight: 600;
  text-align: center;
  font-size: .9rem;
  padding: 7px 18px;
  background: rgba(0,191,179,0.1);
  border-radius: 999px;
  color: var(--teal2);
  width: 100%;
}
.game-sheet-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
}

/* ── Settings nudge — pulsing dot on the chat gear until first opened ──── */
.settings-nudge-dot {
  position: relative;
}
.settings-nudge-dot::after {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal, #00BFB3);
  animation: nudge-pulse 1.6s ease-in-out infinite;
}
@keyframes nudge-pulse {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%      { transform: scale(1.5); opacity: 0.45; }
}

/* ── Battleships manual placement — ship selector states ───────────────── */
.bs-ship-btn.bs-ship-selected {
  background: var(--teal, #00BFB3);
  color: #0A1628;
  font-weight: 700;
}
.bs-ship-btn.bs-ship-placed:not(.bs-ship-selected) {
  background: rgba(0,191,179,0.18);
  color: var(--teal, #00BFB3);
  border: 1px solid rgba(0,191,179,0.4);
}
.bs-placement-actions {
  display: flex;
  gap: 8px;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.bs-placement-actions .btn { flex: 1; min-width: 110px; }

/* ── RPS countdown ───────────────────────────────────────────────────────── */
.rps-countdown {
  font-size: 3.5rem;
  font-weight: 800;
  text-align: center;
  margin: 2rem 0;
  color: var(--teal, #00BFB3);
  animation: rps-pop 0.9s ease-in-out infinite;
}
@keyframes rps-pop {
  0%   { transform: scale(0.6); opacity: 0.3; }
  35%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 0.9; }
}
