/* ================================================================
   ZUUUR Design System — CI3 Integration
   Warm & Playful: Coral #E63946 · Cream #FFF8F0 · DM Serif + Manrope
   ================================================================ */
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Manrope:wght@400;500;600;700;800&family=Caveat+Brush&display=swap');

/* ── Design tokens ── */
:root {
  --bg:            #FFF8F0;
  --bg-2:          #FFEFDF;
  --bg-card:       #FFFFFF;
  --bg-surface:    #F5EDE0;
  --bg-input:      #FFFFFF;
  --surface:       #FFFFFF;

  --ink:           #1A1410;
  --ink-2:         #4A3F38;
  --ink-3:         #8A7A6E;
  --text:          #1A1410;
  --text-secondary:#4A3F38;
  --text-muted:    #8A7A6E;

  --border:        rgba(26,20,16,0.10);
  --line:          rgba(26,20,16,0.08);
  --line-2:        rgba(26,20,16,0.14);

  --primary:       #E63946;
  --primary-deep:  #C5202E;
  --accent:        #F4A261;
  --accent-deep:   #E07A3C;
  --gold:          #E8B949;
  --like:          #6FBF73;
  --nope:          #E63946;
  --super:         #F4A261;

  --grad-sunset:   linear-gradient(135deg, #FF7B6B 0%, #E63946 55%, #C5202E 100%);
  --grad-warm:     linear-gradient(135deg, #FFD4A3 0%, #F4A261 50%, #E63946 100%);
  --gradient:      linear-gradient(135deg, #FF7B6B 0%, #E63946 100%);
  --gradient-rev:  linear-gradient(315deg, #FF7B6B 0%, #E63946 100%);

  --r-sm:   10px;
  --r-md:   16px;
  --r-lg:   22px;
  --r-xl:   28px;
  --r-xxl:  36px;
  --radius-sm:  10px;
  --radius-md:  16px;
  --radius-lg:  22px;
  --radius-xl:  28px;
  --radius-full:9999px;

  --shadow-sm:    0 1px 3px rgba(26,20,16,0.06), 0 2px 8px rgba(26,20,16,0.04);
  --shadow-md:    0 4px 16px rgba(26,20,16,0.08), 0 12px 32px rgba(26,20,16,0.05);
  --shadow-lg:    0 10px 30px rgba(230,57,70,0.18), 0 20px 60px rgba(26,20,16,0.10);
  --shadow-coral: 0 8px 24px rgba(230,57,70,0.35);

  --font-display: "DM Serif Display", Georgia, serif;
  --font-ui:      "Manrope", -apple-system, system-ui, sans-serif;

  --nav-height:  68px;
  --nav-width:   240px;
  --header-height: 62px;
  --transition: 0.18s ease;
  --transition-slow: 0.35s cubic-bezier(0.34,1.56,0.64,1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100dvh;
}
::-webkit-scrollbar { width: 0; height: 0; }
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
button { font-family: var(--font-ui); cursor: pointer; border: none; background: none; }

/* ── Logo ── */
.zuuur-logo, .sidebar-logo, .brand-logo, .logo {
  font-family: 'Caveat Brush', cursive;
  font-weight: 400;
  font-size: 30px;
  letter-spacing: 0.02em;
  background: var(--grad-sunset);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
  transform: rotate(-2deg);
  display: inline-block;
  user-select: none;
}
.sidebar-logo { font-size: 26px; transform: none; margin-bottom: 32px; padding: 0 8px; }

/* ── App Shell ── */
.app-shell {
  position: relative;
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
@media (min-width: 768px) {
  .app-shell {
    max-width: none;
    margin-left: var(--nav-width);
    min-height: 100dvh;
  }
  body { background: var(--bg-2); }
}

/* ── Sidebar Nav (desktop) ── */
.sidebar-nav {
  display: none;
}
@media (min-width: 768px) {
  .sidebar-nav {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--nav-width);
    background: var(--surface);
    border-right: 1px solid var(--line);
    padding: 32px 16px 24px;
    z-index: 100;
    box-shadow: 2px 0 20px rgba(26,20,16,0.06);
  }
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-radius: var(--r-lg);
  color: var(--ink-3);
  font-size: 15px;
  font-weight: 600;
  transition: all var(--transition);
  margin-bottom: 4px;
}
.sidebar-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.sidebar-item:hover { background: var(--bg-2); color: var(--ink); }
.sidebar-item.active {
  background: rgba(230,57,70,0.10);
  color: var(--primary);
}

/* ── App Header ── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.app-header h1 {
  font-family: var(--font-ui);
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.3px;
}
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--bg-2);
  color: var(--ink-2);
  transition: all var(--transition);
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { background: rgba(230,57,70,0.12); color: var(--primary); }
.count-badge {
  background: var(--grad-sunset);
  color: white;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

/* ── Bottom Nav (mobile) ── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  max-width: 480px;
  margin: 0 auto;
  background: var(--surface);
  border-top: 1px solid var(--line);
  display: flex;
  height: var(--nav-height);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 80;
  box-shadow: 0 -4px 20px rgba(26,20,16,0.07);
}
@media (min-width: 768px) { .bottom-nav { display: none; } }
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: all var(--transition);
  padding-top: 8px;
}
.nav-item svg { width: 22px; height: 22px; }
.nav-item span { font-size: 10px; }
.nav-item.active { color: var(--primary); }
.nav-item:hover { color: var(--primary); }

/* ── Page Content ── */
.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 calc(var(--nav-height) + env(safe-area-inset-bottom) + 8px);
}
@media (min-width: 768px) {
  .page-content { padding-bottom: 24px; }
}

/* ═══════════════════════════════════════
   AUTH PAGE
   ═══════════════════════════════════════ */
body[data-page="auth"] {
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  overflow: hidden;
}
.auth-blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
  pointer-events: none;
  animation: blobPulse 6s ease-in-out infinite;
}
.auth-blob-1 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #FF7B6B, #E63946);
  top: -100px; right: -80px;
}
.auth-blob-2 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, #F4A261, #FFD4A3);
  bottom: -80px; left: -60px;
  animation-delay: -3s;
}
@keyframes blobPulse {
  0%,100% { transform: scale(1) translate(0,0); }
  33%      { transform: scale(1.08) translate(10px,-8px); }
  66%      { transform: scale(0.94) translate(-6px,6px); }
}
.auth-page {
  width: 100%;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  position: relative;
  z-index: 1;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: var(--r-xxl);
  padding: 36px 32px;
  box-shadow: 0 24px 64px rgba(230,57,70,0.12), 0 4px 16px rgba(26,20,16,0.08);
  border: 1px solid var(--line);
}
@media (max-width: 440px) {
  .auth-card { padding: 28px 22px; border-radius: var(--r-xl); }
}
.auth-brand { text-align: center; margin-bottom: 28px; }
.auth-brand .brand-logo {
  font-size: 48px;
  display: block;
  margin-bottom: 6px;
  transform: rotate(-3deg);
}
.brand-tagline {
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--ink-3);
  font-weight: 500;
}
.auth-tabs {
  display: flex;
  background: var(--bg-2);
  border-radius: var(--r-lg);
  padding: 4px;
  margin-bottom: 24px;
  gap: 4px;
}
.auth-tab {
  flex: 1;
  padding: 11px 0;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-3);
  transition: all var(--transition);
  background: none;
}
.auth-tab.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.auth-error {
  min-height: 0;
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 4px;
  text-align: center;
  transition: all var(--transition);
}
.auth-error:not(:empty) { margin-bottom: 12px; }
.auth-form { display: none; }
.auth-form.active { display: block; }
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
  margin-bottom: 7px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.form-input {
  font-family: var(--font-ui);
  font-size: 16px;
  color: var(--ink);
  background: var(--bg-2);
  border: 1.5px solid var(--line-2);
  border-radius: var(--r-md);
  padding: 14px 16px;
  width: 100%;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(230,57,70,0.12);
  background: var(--surface);
}
.form-input::placeholder { color: var(--ink-3); }
.gender-toggle {
  display: flex;
  gap: 10px;
}
.gender-btn {
  flex: 1;
  padding: 13px 12px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--line-2);
  background: var(--bg-2);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition);
}
.gender-btn.active, .gender-btn[data-selected="true"] {
  background: rgba(230,57,70,0.10);
  border-color: var(--primary);
  color: var(--primary);
}
.gender-btn:hover:not(.active) { border-color: var(--accent); color: var(--ink); }
.btn-primary {
  width: 100%;
  padding: 16px;
  border-radius: 999px;
  background: var(--grad-sunset);
  color: white;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-coral);
  transition: transform var(--transition), box-shadow var(--transition);
  margin-top: 6px;
  border: none;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 32px rgba(230,57,70,0.45); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.6; pointer-events: none; }

/* ═══════════════════════════════════════
   DISCOVER / SWIPE
   ═══════════════════════════════════════ */
.discover-page {
  background: var(--bg);
  overflow: hidden;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}
.card-area {
  flex: 1;
  position: relative;
  margin: 12px 16px 0;
  min-height: 0;
}
.profile-card {
  position: absolute;
  inset: 0;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  user-select: none;
  touch-action: none;
}
.card-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  display: block;
}
.card-gradient {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 60%;
  background: linear-gradient(to top, rgba(26,20,16,0.88) 0%, rgba(26,20,16,0.2) 60%, transparent 100%);
  pointer-events: none;
}
.card-photo-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #FFD4A3, #F4A261);
  color: rgba(26,20,16,0.25);
}
.card-info {
  position: absolute;
  bottom: 24px; left: 22px; right: 22px;
  pointer-events: none;
}
.card-name {
  font-family: var(--font-display);
  font-size: 26px;
  font-style: italic;
  color: white;
  margin-bottom: 4px;
  text-shadow: 0 1px 6px rgba(0,0,0,0.3);
}
.card-city {
  display: flex;
  align-items: center;
  gap: 5px;
  color: rgba(255,255,255,0.88);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 10px;
}
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.card-tag {
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(8px);
  color: white;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.25);
}
.card-indicator {
  position: absolute;
  top: 28px;
  padding: 7px 16px;
  border-radius: var(--r-sm);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.08em;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
  border: 3px solid;
}
.card-indicator.like  { left: 20px; color: #6FBF73; border-color: #6FBF73; transform: rotate(-15deg); }
.card-indicator.nope  { right: 20px; color: #E63946; border-color: #E63946; transform: rotate(15deg); }
.card-indicator.super { left: 50%; transform: translateX(-50%); color: #F4A261; border-color: #F4A261; }

/* Skeleton card */
.skeleton { animation: shimmer 1.6s infinite linear; }
.skeleton-card {
  border-radius: var(--r-xl);
  background: linear-gradient(90deg, #FFE8D5 0%, #FFF0E5 40%, #FFE8D5 80%);
  background-size: 200% 100%;
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Action buttons */
.action-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 16px 20px calc(var(--nav-height) + env(safe-area-inset-bottom) + 8px);
}
@media (min-width: 768px) {
  .action-buttons { padding-bottom: 24px; }
}
.action-btn {
  width: 58px; height: 58px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: transform var(--transition-slow), box-shadow var(--transition);
  flex-shrink: 0;
}
.action-btn svg { width: 24px; height: 24px; }
.action-btn:active { transform: scale(0.9) !important; }
#btn-rewind {
  width: 48px; height: 48px;
  background: var(--surface);
  color: var(--gold);
  box-shadow: var(--shadow-md);
  border: 1.5px solid var(--line-2);
}
#btn-rewind:hover { transform: scale(1.06); }
#btn-nope {
  background: var(--surface);
  color: var(--nope);
  box-shadow: 0 6px 20px rgba(230,57,70,0.22);
  border: 1.5px solid rgba(230,57,70,0.18);
}
#btn-nope:hover { transform: scale(1.08); box-shadow: 0 8px 28px rgba(230,57,70,0.35); }
#btn-like {
  width: 70px; height: 70px;
  background: var(--grad-sunset);
  color: white;
  box-shadow: var(--shadow-coral);
}
#btn-like:hover { transform: scale(1.1); box-shadow: 0 12px 32px rgba(230,57,70,0.5); }
#btn-super {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 6px 20px rgba(244,162,97,0.22);
  border: 1.5px solid rgba(244,162,97,0.2);
}
#btn-super:hover { transform: scale(1.08); }
.action-btn:disabled { opacity: 0.35; pointer-events: none; }

/* Match overlay */
#match-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(230,57,70,0.96) 0%, rgba(26,20,16,0.95) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s;
  padding: 32px 24px;
}
#match-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}
.match-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 40px;
  color: white;
  margin-bottom: 8px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.25);
}
.match-subtitle {
  font-size: 16px;
  color: rgba(255,255,255,0.85);
  margin-bottom: 36px;
  font-weight: 500;
}
.match-avatars {
  display: flex;
  gap: -20px;
  margin-bottom: 36px;
}
.match-avatar {
  width: 110px; height: 110px;
  border-radius: 50%;
  border: 4px solid white;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}
.match-avatar:last-child { margin-left: -20px; }
.match-actions { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 280px; }
.btn-match-message {
  padding: 16px;
  border-radius: 999px;
  background: white;
  color: var(--primary);
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  transition: transform var(--transition);
}
.btn-match-message:hover { transform: translateY(-1px); }
.btn-keep-swiping {
  padding: 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
  color: white;
  font-size: 15px;
  font-weight: 600;
  border: 1.5px solid rgba(255,255,255,0.35);
  transition: background var(--transition);
}
.btn-keep-swiping:hover { background: rgba(255,255,255,0.28); }

/* ═══════════════════════════════════════
   MATCHES PAGE
   ═══════════════════════════════════════ */
.matches-page .page-content { padding: 16px 16px calc(var(--nav-height) + env(safe-area-inset-bottom) + 16px); }
@media (min-width: 768px) { .matches-page .page-content { padding-bottom: 32px; } }

/* List-style match cards */
#matches-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.match-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.match-card:hover {
  border-color: rgba(230,57,70,0.2);
  box-shadow: var(--shadow-sm);
  transform: translateX(2px);
}
.match-card img {
  width: 60px; height: 60px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--line-2);
}
.match-card-placeholder {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--bg-surface);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3);
}
.match-card-overlay {
  flex: 1;
  min-width: 0;
}
.match-card-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.match-card-age {
  font-size: 13px;
  color: var(--ink-3);
  font-weight: 500;
  display: block;
  margin-top: 2px;
}

/* ═══════════════════════════════════════
   INBOX / MESSAGES
   ═══════════════════════════════════════ */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-2);
  border: 1.5px solid var(--line);
  border-radius: var(--r-xl);
  padding: 11px 16px;
  margin: 12px 16px 16px;
  transition: border-color var(--transition);
}
.search-bar:focus-within { border-color: var(--primary); }
.search-bar svg { width: 18px; height: 18px; color: var(--ink-3); flex-shrink: 0; }
.search-bar input {
  flex: 1;
  font-family: var(--font-ui);
  font-size: 15px;
  color: var(--ink);
  background: none;
  border: none;
  outline: none;
}
.search-bar input::placeholder { color: var(--ink-3); }
#inbox-list {
  display: flex;
  flex-direction: column;
  padding: 0 8px;
  gap: 2px;
}
.convo-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 12px;
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: background var(--transition);
}
.convo-item:hover { background: var(--bg-2); }
.convo-avatar-wrap { position: relative; flex-shrink: 0; }
.convo-avatar {
  width: 54px; height: 54px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--line-2);
}
.online-dot {
  width: 13px; height: 13px;
  background: #6FBF73;
  border-radius: 50%;
  border: 2.5px solid var(--surface);
  position: absolute;
  bottom: 1px; right: 1px;
}
.convo-info { flex: 1; min-width: 0; }
.convo-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.convo-last-msg {
  font-size: 13px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 400;
}
.convo-last-msg.unread { color: var(--ink-2); font-weight: 600; }
.convo-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex-shrink: 0;
}
.convo-time {
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 500;
}
.unread-badge {
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
}

/* ═══════════════════════════════════════
   CHAT PAGE
   ═══════════════════════════════════════ */
body[data-page="chat"] { background: var(--bg); }
.chat-page {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
}
@media (min-width: 768px) {
  .chat-page { margin-left: var(--nav-width); max-width: none; }
}
.chat-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  height: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.chat-back-btn {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--ink-2);
  background: var(--bg-2);
  flex-shrink: 0;
  transition: all var(--transition);
}
.chat-back-btn svg { width: 20px; height: 20px; }
.chat-back-btn:hover { background: rgba(230,57,70,0.1); color: var(--primary); }
.chat-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.chat-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--line-2);
  flex-shrink: 0;
}
.chat-user-text { min-width: 0; }
.chat-user-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-user-status {
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 500;
  display: block;
}
.chat-user-status.online { color: #6FBF73; }

#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg);
}
.msg-date-divider {
  text-align: center;
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 8px 0;
}
.msg-bubble {
  max-width: 72%;
  padding: 10px 14px 6px;
  border-radius: var(--r-lg);
  font-size: 15px;
  line-height: 1.5;
  position: relative;
  word-break: break-word;
}
.msg-bubble.mine {
  align-self: flex-end;
  background: var(--grad-sunset);
  color: white;
  border-bottom-right-radius: 6px;
}
.msg-bubble.theirs {
  align-self: flex-start;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-2);
  border-bottom-left-radius: 6px;
}
.msg-time {
  font-size: 10px;
  display: block;
  text-align: right;
  margin-top: 3px;
  opacity: 0.65;
}
.chat-input-area {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.chat-textarea {
  flex: 1;
  font-family: var(--font-ui);
  font-size: 15px;
  color: var(--ink);
  background: var(--bg-2);
  border: 1.5px solid var(--line-2);
  border-radius: var(--r-xl);
  padding: 11px 16px;
  resize: none;
  outline: none;
  overflow-y: hidden;
  line-height: 1.5;
  max-height: 120px;
  transition: border-color var(--transition);
}
.chat-textarea:focus { border-color: var(--primary); }
.chat-textarea::placeholder { color: var(--ink-3); }
.chat-send-btn {
  width: 44px; height: 44px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--grad-sunset);
  color: white;
  box-shadow: var(--shadow-coral);
  transition: transform var(--transition), box-shadow var(--transition);
}
.chat-send-btn svg { width: 20px; height: 20px; }
.chat-send-btn:hover { transform: scale(1.08); box-shadow: 0 8px 24px rgba(230,57,70,0.45); }
.chat-send-btn:disabled { opacity: 0.5; pointer-events: none; }

/* ═══════════════════════════════════════
   PROFILE PAGE
   ═══════════════════════════════════════ */
.profile-cover {
  position: relative;
  height: 220px;
  background: linear-gradient(135deg, #FFD4A3, #F4A261, #E63946);
  overflow: visible;
}
.profile-cover-img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.profile-cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(26,20,16,0.35) 100%);
}
.profile-avatar-wrap {
  position: absolute;
  bottom: -42px;
  left: 50%;
  transform: translateX(-50%);
}
.profile-avatar {
  width: 88px; height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--surface);
  background: var(--bg-surface);
  box-shadow: var(--shadow-md);
  display: block;
}
.edit-avatar-btn {
  position: absolute;
  bottom: 0; right: 0;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--grad-sunset);
  color: white;
  box-shadow: var(--shadow-sm);
}
.edit-avatar-btn svg { width: 14px; height: 14px; }

.profile-info-section {
  padding: 56px 20px 24px;
}
.profile-name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 6px;
}
.profile-name {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 26px;
  color: var(--ink);
  font-weight: 400;
}
.subscription-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(232,185,73,0.15);
  color: #B8860B;
  border: 1px solid rgba(232,185,73,0.35);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.profile-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 24px;
}
.meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 500;
}
.meta-item svg { width: 15px; height: 15px; color: var(--primary); }
.meta-item .meta-val { color: var(--ink-2); font-weight: 600; }
.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}
.about-section { margin-bottom: 24px; }
.about-text {
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-2);
}
#photos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 28px;
}
#photos-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--r-md);
}
.btn-edit-profile {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px;
  border-radius: 999px;
  background: var(--surface);
  border: 1.5px solid var(--line-2);
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  transition: all var(--transition);
}
.btn-edit-profile svg { width: 18px; height: 18px; }
.btn-edit-profile:hover { border-color: var(--primary); color: var(--primary); background: rgba(230,57,70,0.05); }
.btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px;
  border-radius: 999px;
  background: rgba(230,57,70,0.07);
  color: var(--primary);
  font-size: 15px;
  font-weight: 700;
  border: 1.5px solid rgba(230,57,70,0.18);
  transition: all var(--transition);
}
.btn-logout svg { width: 18px; height: 18px; }
.btn-logout:hover { background: rgba(230,57,70,0.14); }

/* ── Bottom Sheet Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(26,20,16,0.45);
  backdrop-filter: blur(4px);
  z-index: 150;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.modal-overlay.visible { opacity: 1; pointer-events: auto; }
.bottom-sheet {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  max-width: 480px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  z-index: 160;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.34,1.1,0.64,1);
  max-height: 90dvh;
  overflow-y: auto;
  box-shadow: 0 -12px 40px rgba(26,20,16,0.15);
}
.bottom-sheet.visible { transform: translateY(0); }
.sheet-handle {
  width: 40px; height: 5px;
  background: var(--line-2);
  border-radius: 999px;
  margin: 14px auto 0;
}
.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--line);
}
.sheet-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 20px;
  color: var(--ink);
  font-weight: 400;
}
.sheet-close {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--bg-2);
  color: var(--ink-3);
  transition: all var(--transition);
}
.sheet-close svg { width: 16px; height: 16px; }
.sheet-close:hover { background: rgba(230,57,70,0.1); color: var(--primary); }
.sheet-body { padding: 20px 20px calc(24px + env(safe-area-inset-bottom)); }
.sheet-save-btn {
  width: 100%;
  padding: 16px;
  border-radius: 999px;
  background: var(--grad-sunset);
  color: white;
  font-size: 16px;
  font-weight: 700;
  box-shadow: var(--shadow-coral);
  margin-top: 8px;
  transition: transform var(--transition), box-shadow var(--transition);
  border: none;
}
.sheet-save-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 32px rgba(230,57,70,0.45); }
select.form-input { appearance: none; -webkit-appearance: none; cursor: pointer; }
textarea.form-input { resize: vertical; line-height: 1.5; }

/* ═══════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════ */
#toast-container {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: min(400px, calc(100vw - 32px));
}
.toast {
  background: var(--ink);
  color: var(--bg);
  padding: 13px 18px;
  border-radius: var(--r-lg);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(26,20,16,0.2);
  animation: toastIn 0.3s var(--transition-slow) forwards;
  pointer-events: auto;
}
.toast.success { background: #6FBF73; color: white; }
.toast.error   { background: var(--primary); color: white; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ═══════════════════════════════════════
   UTILITIES & ANIMATIONS
   ═══════════════════════════════════════ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.3s ease forwards; }

@keyframes heartPulse {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.18); }
}

/* Responsive desktop enhancements */
@media (min-width: 768px) {
  .app-header { padding: 0 32px; }
  .matches-page .page-content { padding: 24px 24px 32px; }
  #matches-grid { gap: 4px; }
  .chat-page { border-left: 1px solid var(--line); }
}
@media (min-width: 1024px) {
  :root { --nav-width: 260px; }
  .sidebar-logo { font-size: 30px; }
}
