/* ===== Variables ===== */
:root {
  --primary: #e83666;
  --primary-dark: #c81e50;
  --primary-light: #f7a0b8;
  --accent: #ff7a45;
  --accent-soft: #fff1ea;
  --teal: #e83666;
  --bg: #fff8f6;
  --bg-alt: #fff0ec;
  --surface: #ffffff;
  --text: #2c1820;
  --text-muted: #7a6270;
  --border: #f0e0e6;
  --success: #10b981;
  --shadow: 0 4px 24px rgba(232, 54, 102, 0.1);
  --shadow-lg: 0 12px 48px rgba(232, 54, 102, 0.16);
  --radius: 12px;
  --radius-lg: 20px;
  --font: 'DM Sans', system-ui, sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.icon {
  width: 1.15em;
  height: 1.15em;
  aspect-ratio: 1;
  display: block;
  flex-shrink: 0;
  overflow: visible;
  pointer-events: none;
}
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 28px; height: 28px; }

.container { max-width: 1140px; margin: 0 auto; padding: 0 1.25rem; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, border-color 0.2s, color 0.2s;
  white-space: nowrap;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
}
.btn-primary:hover {
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  border-color: var(--primary);
  color: var(--primary);
}
.btn-outline:hover { background: var(--accent-soft); }

.btn-ghost {
  background: transparent;
  color: var(--text);
}
.btn-ghost:hover { background: var(--bg-alt); }

.btn-white {
  background: white;
  color: var(--primary);
}
.btn-white:hover { box-shadow: var(--shadow-lg); }

.btn-lg { padding: 0.875rem 1.75rem; font-size: 1rem; }
.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  gap: 0.35rem;
}
.btn-sm .icon { width: 14px; height: 14px; }
.btn-text {
  background: none;
  border-color: transparent;
  color: var(--text-muted);
  font-weight: 500;
  padding: 0.35rem 0.55rem;
  box-shadow: none;
}
.btn-text:hover {
  background: var(--bg-alt);
  color: var(--primary);
  text-decoration: none;
}
.btn-block { width: 100%; }
.profiles-more { margin: 1.25rem auto 0; max-width: 16rem; }
.profiles-more:not([hidden]) { display: block; }

/* ===== Header ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  min-width: 0;
  gap: 0.75rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--primary);
  text-decoration: none;
}
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 46px;
  height: 34px;
  display: block;
  flex-shrink: 0;
  object-fit: contain;
}
.logo-text {
  font-family: 'Nunito', var(--font);
  font-weight: 800;
  color: #000000;
  letter-spacing: -0.03em;
  line-height: 1;
}

.nav-desktop {
  display: none;
  gap: 1.75rem;
}
.nav-desktop a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.9375rem;
  text-decoration: none;
}
.nav-desktop a:hover,
.nav-desktop a.active { color: var(--primary); }
.nav-desktop a.active { font-weight: 600; }
.nav-desktop .nav-chat {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.nav-badge {
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  box-shadow: 0 0 0 2px #fff;
}

.header-actions { display: flex; align-items: center; gap: 0.5rem; min-width: 0; flex-shrink: 0; }
.header-user { display: flex; align-items: center; gap: 0.5rem; }
.header-user-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}
.header-user-link:hover { text-decoration: none; }
.avatar-xs {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  background: linear-gradient(160deg,
    hsl(var(--hue, 260), 42%, 68%),
    hsl(calc(var(--hue, 260) + 28), 38%, 58%));
}
.header-nickname {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.header-user-link:hover .header-nickname { color: var(--primary); }
.form-error {
  background: #fef2f2;
  color: #b91c1c;
  border-radius: 8px;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}
.demo-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: -0.25rem 0 1rem;
}
.empty-state {
  color: var(--text-muted);
  padding: 1.5rem 0.5rem;
  text-align: center;
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

.nav-mobile {
  display: none;
  flex-direction: column;
  padding: 1rem 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
  background: white;
}
.nav-mobile.open { display: flex; }
.nav-mobile a {
  padding: 0.75rem 0;
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}

@media (min-width: 900px) {
  body.is-logged-in .nav-desktop { display: flex; gap: 1.25rem; }
  .nav-toggle { display: none; }
  .header-actions .btn-ghost { display: inline-flex; }
}

@media (min-width: 1080px) {
  .nav-desktop { gap: 1.75rem; }
}

@media (max-width: 899px) {
  .header-actions .btn-primary,
  .header-actions .btn-ghost {
    font-size: 0.8125rem;
    padding: 0.45rem 0.85rem;
  }
  .header-user .btn-ghost { display: inline-flex; }
}

/* ===== Views ===== */
.view { display: block; padding-bottom: 3rem; min-height: calc(100vh - 64px); }
.view:not(.view-active) {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 2;
  height: 100dvh;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateZ(0);
}
.view-active {
  display: block;
  position: relative;
  z-index: 1;
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.page-header {
  padding: 2.5rem 0 1.5rem;
}
.page-header h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
}
.page-header p { color: var(--text-muted); margin-top: 0.25rem; }

/* ===== Hero ===== */
.hero {
  position: relative;
  padding: 3rem 0 4rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 70% 20%, rgba(244,59,106,0.16), transparent),
    radial-gradient(ellipse 60% 50% at 20% 80%, rgba(255,122,69,0.14), transparent);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  gap: 3rem;
  align-items: center;
  position: relative;
}

@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1fr 1fr; }
  .floating-card { display: flex; }
}

@media (min-width: 900px) and (max-width: 1100px) {
  .card-2 { left: 0; }
}

.badge-privacy {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: white;
  border: 1px solid var(--border);
  padding: 0.375rem 0.875rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--teal);
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}
.badge-privacy .icon { width: 16px; height: 16px; }

.hero-content h1 {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1rem;
}
.hero-content h1 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 520px;
  margin-bottom: 1.75rem;
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 2.5rem; }

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}
.hero-stats strong {
  display: block;
  font-size: 1.5rem;
  font-family: var(--font-display);
  color: var(--primary);
}
.hero-stats span { font-size: 0.8125rem; color: var(--text-muted); }

/* Phone mockup */
.hero-visual { position: relative; display: flex; justify-content: center; }

.phone-mockup {
  width: 280px;
  background: #2a1822;
  border-radius: 36px;
  padding: 12px;
  box-shadow: var(--shadow-lg);
}

.phone-screen {
  background: var(--bg);
  border-radius: 28px;
  overflow: hidden;
  min-height: 420px;
  padding: 1rem;
}

.mock-profile-card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.mock-photo {
  height: 220px;
  position: relative;
  overflow: hidden;
  background: #f3d5c8;
}
.mock-photo > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  display: block;
}

.mock-info { padding: 1rem; }
.mock-info h3 { font-size: 1.125rem; margin-bottom: 0.25rem; }
.mock-info p { font-size: 0.8125rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.mock-tags { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.mock-tags span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  background: var(--bg-alt);
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
}
.mock-tags .icon { width: 12px; height: 12px; color: var(--primary); }

.mock-actions {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding: 1rem;
}
.mock-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
}
.mock-btn .icon { width: 22px; height: 22px; }
.mock-btn.like { border-color: var(--accent); color: var(--accent); }

.floating-card {
  position: absolute;
  background: white;
  padding: 0.625rem 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 0.8125rem;
  font-weight: 600;
  display: none;
  align-items: center;
  gap: 0.5rem;
  animation: float 3s ease-in-out infinite;
}
.floating-card .icon { width: 16px; height: 16px; color: var(--primary); }
.card-1 { top: 10%; right: 0; animation-delay: 0s; }
.card-2 { bottom: 15%; left: -10%; animation-delay: 1.5s; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ===== Sections ===== */
.section { padding: 4rem 0; }
.section-alt { background: var(--bg-alt); }

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  text-align: center;
  margin-bottom: 0.75rem;
}
.section-sub {
  text-align: center;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 2.5rem;
}

.purpose-copy {
  max-width: 40rem;
  margin: 0 auto;
}
.purpose-copy .section-title {
  margin-bottom: 1.5rem;
}
.purpose-lead {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.4vw, 1.45rem);
  line-height: 1.45;
  color: var(--text);
  margin-bottom: 1.25rem;
}
.purpose-copy p {
  font-size: 1.0625rem;
  line-height: 1.75;
  margin-bottom: 1.1rem;
}
.purpose-note {
  margin-top: 1.5rem;
  margin-bottom: 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9375rem;
}
.faq-list { display: grid; gap: 1.25rem; margin-top: 1.5rem; text-align: left; }
.faq-list h3 { font-size: 1.05rem; margin-bottom: 0.35rem; }
.faq-list p { margin: 0; color: var(--text); }
.city-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin: 1.25rem 0 1.5rem;
  padding: 0;
  list-style: none;
}

.features-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.feature-card {
  background: white;
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
}
@media (hover: hover) {
  .feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
  }
}
.feature-art {
  width: 120px;
  height: 120px;
  object-fit: contain;
  display: block;
  margin: -0.35rem 0 0.85rem -0.4rem;
}
.feature-card h3 { font-size: 1.125rem; margin-bottom: 0.5rem; }
.feature-card p { font-size: 0.9375rem; color: var(--text-muted); }

.testimonials-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.testimonial {
  background: white;
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--primary);
  box-shadow: var(--shadow);
}
.testimonial p { font-style: italic; margin-bottom: 1rem; color: var(--text); }
.testimonial footer { font-size: 0.875rem; color: var(--text-muted); font-style: normal; }

.cta-banner {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  text-align: center;
}
.cta-inner h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.cta-inner p { opacity: 0.9; margin-bottom: 1.5rem; }

/* ===== Discover ===== */
.discover-layout {
  display: grid;
  gap: 1.5rem;
  padding-top: 2rem;
}
.discover-heading {
  text-align: left;
}
.discover-heading h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}
.discover-heading p {
  color: var(--text-muted);
  margin: 0.35rem 0 0;
  line-height: 1.45;
}
.discover-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

@media (min-width: 900px) {
  .discover-layout {
    grid-template-columns: 260px 1fr;
    padding-top: 2.5rem;
  }
  .discover-heading,
  .discover-tabs {
    grid-column: 1 / -1;
  }
  .discover-layout.is-list {
    grid-template-columns: 1fr;
  }
}

.discover-layout.is-list .filters-panel,
.discover-layout.is-list .filters-toggle,
.discover-layout.is-list #discover-people-toolbar,
.discover-layout.is-list #profiles-grid {
  display: none !important;
}

.discover-matches {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
}

.filters-panel {
  background: white;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  height: fit-content;
  position: sticky;
  top: 80px;
}
.filters-panel h3 { margin-bottom: 1.25rem; font-size: 1rem; }

.filter-group { margin-bottom: 1rem; }
.filter-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.375rem;
}
.filter-group select,
.filter-group input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.875rem;
}
.range-row { display: flex; align-items: center; gap: 0.5rem; }
.range-row input { flex: 1; min-width: 0; width: auto; }
.filter-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}
.filter-note .icon { width: 14px; height: 14px; }

.profiles-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.profiles-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.results-count { font-size: 0.875rem; color: var(--text-muted); }
.view-toggle { display: flex; gap: 0.25rem; }
.view-toggle button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.view-toggle button .icon { width: 16px; height: 16px; }
.view-toggle button.active { background: var(--primary); color: white; border-color: var(--primary); }

.profiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.profiles-grid > .empty-state,
.people-grid > .empty-state,
.swipe-stack > .empty-state {
  grid-column: 1 / -1;
}

.profile-card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.profile-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.profile-card-photo {
  height: 200px;
  background: linear-gradient(160deg,
    hsl(var(--hue, 280), 55%, 72%),
    hsl(calc(var(--hue, 280) + 30), 50%, 62%));
  position: relative;
}
.profile-card-photo .online-dot {
  z-index: 2;
  position: absolute;
  top: 10px;
  right: 10px;
  width: 10px;
  height: 10px;
  background: var(--success);
  border: 2px solid white;
  border-radius: 50%;
}
.profile-card-photo .verified {
  z-index: 2;
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(255,255,255,0.95);
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}
.profile-card-photo .verified .icon { width: 12px; height: 12px; color: var(--teal); }

.new-badge {
  z-index: 3;
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  background: var(--primary);
  color: white;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.2;
  box-shadow: 0 2px 8px rgba(232, 54, 102, 0.35);
  pointer-events: none;
}

.profile-card-body { padding: 1rem; }
.profile-card-body h3 {
  font-size: 1rem;
  margin-bottom: 0.125rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-card-body .meta { font-size: 0.8125rem; color: var(--text-muted); }
.profile-card-body .tags { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-top: 0.5rem; }
.profile-card-body .tags span {
  font-size: 0.6875rem;
  background: var(--bg-alt);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

/* ===== Swipe ===== */
#view-swipe.view-active {
  padding-bottom: 1rem;
}
#view-messages.view-active {
  padding-bottom: 0;
}
.swipe-container {
  max-width: 460px;
  margin: 0 auto;
  padding: 1rem 1.25rem 1.25rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 64px - 2rem);
}

.swipe-stack {
  position: relative;
  flex: 1;
  min-height: min(640px, calc(100dvh - 220px));
  margin-bottom: 1.25rem;
}

.swipe-card {
  position: absolute;
  inset: 0;
  background: #2a1822;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transition: transform 0.3s, opacity 0.3s;
  cursor: grab;
  user-select: none;
}
.swipe-card.swipe-left { transform: translateX(-120%) rotate(-15deg); opacity: 0; }
.swipe-card.swipe-right { transform: translateX(120%) rotate(15deg); opacity: 0; }

.swipe-card-photo {
  position: absolute;
  inset: 0;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(160deg,
    hsl(var(--hue, 280), 55%, 72%),
    hsl(calc(var(--hue, 280) + 30), 50%, 62%));
}
.swipe-card-photo .new-badge {
  top: 16px;
  left: 16px;
  font-size: 0.75rem;
}

.swipe-card-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 4.5rem 1.35rem 1.4rem;
  text-align: left;
  color: white;
  background: linear-gradient(180deg, transparent 0%, rgba(20, 16, 32, 0.82) 55%);
}
.swipe-card-info h3 {
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1.15;
  margin-bottom: 0.35rem;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}
.swipe-card-info p { color: rgba(255, 255, 255, 0.88); font-size: 0.95rem; }
.swipe-card-info .bio {
  margin-top: 0.55rem;
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.92);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.incoming-like {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.5rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(232, 54, 102, 0.95);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}
.incoming-like .icon { width: 12px; height: 12px; }
.incoming-like.incoming-super {
  background: rgba(255, 122, 69, 0.95);
}
.incoming-like-banner {
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  background: #ffe8ef;
  color: #b42356;
  font-size: 0.9rem;
  font-weight: 600;
}
.incoming-like-banner.super {
  background: #fff1ea;
  color: #c2410c;
}
.preview-banner {
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  background: #ffe8ef;
  color: #b42356;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
}
.view-profile-actions.is-preview {
  pointer-events: none;
}
.view-profile-actions.is-preview .btn {
  opacity: 0.55;
}

.swipe-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 0.75rem;
}

.swipe-btn {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: white;
  cursor: pointer;
  transition: box-shadow 0.15s;
  box-shadow: var(--shadow);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.swipe-btn .icon { width: 28px; height: 28px; }
.swipe-btn:hover { box-shadow: var(--shadow-lg); }
.swipe-btn.skip { color: #ef4444; border-color: #fecaca; }
.swipe-btn.like {
  width: 76px;
  height: 76px;
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.swipe-btn.like .icon { width: 32px; height: 32px; }
.swipe-btn.super { color: var(--primary); border-color: var(--primary-light); }
.swipe-btn.super .icon { width: 26px; height: 26px; }
.swipe-btn.undo {
  width: 52px;
  height: 52px;
  color: #d97706;
  border-color: #fde68a;
}
.swipe-btn.undo .icon { width: 22px; height: 22px; }

.swipe-remaining { font-size: 0.8125rem; color: var(--text-muted); }

.account-advanced {
  grid-column: 1 / -1;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1.25rem;
}
.account-advanced summary {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  list-style: none;
}
.account-advanced summary::-webkit-details-marker { display: none; }
.account-advanced summary::after {
  content: ' ▾';
  font-size: 0.75rem;
}
.skipped-box { margin-top: 1rem; }
.skipped-box h4 { font-size: 0.9375rem; margin-bottom: 0.25rem; }
.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 1rem;
  min-width: 0;
}
.people-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.people-card:hover {
  border-color: #f7c2d0;
  box-shadow: var(--shadow);
}
.people-card-photo {
  height: 180px;
  cursor: pointer;
  background: linear-gradient(160deg,
    hsl(var(--hue, 280), 55%, 72%),
    hsl(calc(var(--hue, 280) + 30), 50%, 62%));
}
.people-card-body { padding: 0.85rem 0.95rem 0.9rem; min-width: 0; }
.people-card-body h3 {
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.people-card-body p { font-size: 0.8125rem; color: var(--text-muted); }
.people-card-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.15rem 0.2rem;
  margin-top: 0.65rem;
}
.people-card-actions .btn {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  text-align: center;
}
.people-card-actions .btn-primary {
  background: var(--primary);
  box-shadow: none;
}
.people-card-actions .btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: none;
}

/* ===== Messages ===== */
.messages-layout {
  display: grid;
  grid-template-columns: 1fr;
  min-height: calc(100vh - 64px);
  max-width: 100%;
  padding: 0;
}

@media (min-width: 900px) {
  .messages-layout {
    grid-template-columns: 320px 1fr;
    min-height: calc(100vh - 64px);
    height: calc(100vh - 64px);
  }
  .conversations-list,
  .chat-panel {
    min-height: 0;
    height: 100%;
  }
}

.conversations-list {
  background: white;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.conv-header { padding: 1.25rem; border-bottom: 1px solid var(--border); }
.conv-header h2 { font-size: 1.25rem; margin-bottom: 0.75rem; }
.conv-search {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.875rem;
}

.conv-items { overflow-y: auto; flex: 1; }
.conv-items > .empty-state {
  font-size: 0.875rem;
  line-height: 1.45;
  font-weight: 500;
  padding: 1.25rem 1rem;
}
.new-matches {
  padding: 0.85rem 1.25rem 0.35rem;
  border-bottom: 1px solid var(--border);
}
.new-matches-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}
.new-matches-rail {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  overflow-x: auto;
  padding: 6px 4px 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.new-matches-rail::-webkit-scrollbar { height: 6px; }
.new-matches-rail::-webkit-scrollbar-track { background: transparent; }
.new-matches-rail::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}
.new-match {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 72px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.new-match:hover,
.new-match:focus {
  background: transparent;
}
.new-match:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 12px;
}
.new-match .avatar-sm {
  width: 64px;
  height: 64px;
  margin: 0 0 0.35rem;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent);
}
.new-match span {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.like-pill {
  display: inline-block;
  margin-top: 0.3rem;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.6875rem;
  font-weight: 600;
}
.like-pill.super { background: #ffe8ef; color: var(--primary); }
.onboard-photo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.onboard-hero {
  width: min(100%, 240px);
  aspect-ratio: 3 / 4;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(160deg,
    hsl(var(--hue, 260), 48%, 62%),
    hsl(calc(var(--hue, 260) + 28), 42%, 48%));
}
.onboard-hero > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#btn-unsafe {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fef2f2;
  color: #b91c1c;
  font-weight: 800;
}

.conv-item {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.conv-item:hover, .conv-item.active { background: var(--bg-alt); }

.conv-item .conv-preview { flex: 1; min-width: 0; }
.conv-item strong {
  display: block;
  font-size: 0.9375rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conv-item .last-msg {
  font-size: 0.8125rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-item .time { font-size: 0.75rem; color: var(--text-muted); }
.conv-item .unread {
  background: var(--accent);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-sm {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(160deg,
    hsl(var(--hue, 260), 42%, 68%),
    hsl(calc(var(--hue, 260) + 28), 38%, 58%));
}

.chat-panel {
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: white;
  border-bottom: 1px solid var(--border);
}
.chat-user { display: flex; align-items: center; gap: 0.75rem; }
.chat-user > div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  min-width: 0;
  line-height: 1.05;
}
.chat-user strong {
  display: block;
  line-height: 1.15;
}
.chat-user .online {
  line-height: 1;
  margin-top: 0.05rem;
}
.chat-user .avatar-sm,
.chat-user.is-clickable,
#chat-avatar.is-clickable {
  cursor: pointer;
}
.conv-item .avatar-sm { cursor: pointer; }
.online { font-size: 0.75rem; color: var(--success); display: inline-flex; align-items: center; gap: 0.3rem; }
.online .icon { width: 8px; height: 8px; }
.chat-actions { display: flex; align-items: center; gap: 0.1rem; }
.chat-actions button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.chat-actions button .icon { width: 20px; height: 20px; }
.chat-actions button:hover { background: var(--bg-alt); }

.chat-messages {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 300px;
}

.msg {
  max-width: 75%;
  padding: 0.75rem 1rem;
  border-radius: 16px;
  font-size: 0.9375rem;
  line-height: 1.5;
}
.msg.them {
  background: white;
  border: 1px solid var(--border);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.msg.me {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.msg-stamp {
  align-self: center;
  max-width: 92%;
  margin: 0.35rem 0 0.05rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.3;
  text-align: center;
  text-transform: uppercase;
  color: var(--text-muted);
}

.chat-input {
  display: flex;
  gap: 0.5rem;
  min-width: 0;
  padding: 1rem 1.25rem;
  background: white;
  border-top: 1px solid var(--border);
}
.chat-input input {
  flex: 1 1 0;
  min-width: 0;
  width: 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.9375rem;
}

/* ===== Community ===== */
.community-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.tab {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--border);
  background: white;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
}
.tab.active { background: var(--primary); color: white; border-color: var(--primary); }

.tab-content { display: none; }
.tab-content.active { display: block; }

.forum-list { display: flex; flex-direction: column; gap: 1rem; }

.forum-post {
  background: white;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: box-shadow 0.2s;
}
.forum-post:hover { box-shadow: var(--shadow); }
.forum-meta { font-size: 0.8125rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.forum-tag {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
}
.forum-post h3 { font-size: 1.125rem; margin-bottom: 0.5rem; }
.forum-post p { font-size: 0.9375rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.forum-author { font-size: 0.8125rem; color: var(--text-muted); }

.stories-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.story-card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}
.story-img {
  height: 160px;
  background: linear-gradient(135deg,
    hsl(var(--hue, 200), 50%, 70%),
    hsl(calc(var(--hue, 200) + 40), 45%, 60%));
}
.story-card h3 { padding: 1rem 1rem 0.5rem; font-size: 1.0625rem; }
.story-card p { padding: 0 1rem; font-size: 0.9375rem; color: var(--text-muted); }
.story-author {
  display: block;
  padding: 1rem;
  font-size: 0.8125rem;
  color: var(--primary);
  font-weight: 600;
}

/* ===== Profile page ===== */
.profile-page { padding: 2rem 0; }

.profile-header-card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
  min-width: 0;
  max-width: 100%;
}

.profile-hero {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: auto;
  aspect-ratio: 3 / 4;
  min-height: 0;
  overflow: hidden;
  cursor: pointer;
  background: linear-gradient(160deg,
    hsl(var(--hue, 260), 48%, 62%),
    hsl(calc(var(--hue, 260) + 28), 42%, 48%));
}
.profile-hero > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.profile-main {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.25rem 1.5rem 1.5rem;
  align-items: stretch;
  min-width: 0;
  max-width: 100%;
}

.verified-badge {
  z-index: 3;
  position: absolute;
  left: 14px;
  bottom: 14px;
  width: 28px;
  height: 28px;
  background: var(--teal);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(30, 27, 46, 0.25);
  pointer-events: none;
}
.verified-badge .icon { width: 14px; height: 14px; }

.profile-details { min-width: 0; max-width: 100%; }
.profile-details h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  overflow-wrap: anywhere;
}
.profile-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.profile-header-actions .btn {
  flex: 1 1 9rem;
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  text-align: center;
}
.profile-location {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin: 0.25rem 0 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.profile-location .icon { width: 15px; height: 15px; color: var(--primary); }

.profile-badges { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-bottom: 0.75rem; }
.profile-badges:empty,
.profile-interests:empty { display: none; }
.badge {
  font-size: 0.75rem;
  background: var(--bg-alt);
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.badge .icon { width: 12px; height: 12px; }
.badge-private { background: #ecfdf5; color: var(--teal); }

.profile-bio { font-size: 0.9375rem; margin-bottom: 0.75rem; max-width: 560px; }
.profile-interests { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.profile-interests span {
  font-size: 0.8125rem;
  background: var(--accent-soft);
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
}

.profile-essentials {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1rem;
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}
.profile-essentials:empty { display: none; }
.profile-essential {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}
.profile-essential-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #ffe8ef;
  color: var(--primary);
  flex-shrink: 0;
}
.profile-essential-icon .icon {
  width: 1.15rem;
  height: 1.15rem;
}
.profile-essential-copy {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  line-height: 1.25;
}
.profile-essential-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.profile-essential-value {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  overflow-wrap: anywhere;
}
.profile-info-card .profile-bio { margin-bottom: 0; }
.profile-info-card .profile-bio + .profile-essentials { margin-top: 0.75rem; }

.form-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0.35rem 0 0.9rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.profile-sections {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.profile-sections section {
  background: white;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.profile-sections h3 { margin-bottom: 1rem; font-size: 1rem; }

@media (min-width: 900px) {
  .profile-page {
    max-width: 520px;
    margin-inline: auto;
  }
  .profile-hero {
    height: auto;
    aspect-ratio: 3 / 4;
    min-height: 0;
  }
  .profile-sections {
    grid-template-columns: 1fr;
  }
}
#account-security { grid-column: 1 / -1; }
.account-forms { display: grid; gap: 1.5rem; }
.account-forms h4 { margin: 0 0 0.35rem; font-size: 1rem; }
.account-forms .form-group { margin-bottom: 0.75rem; }
input[readonly] { background: var(--bg-alt); color: var(--text-muted); }
.form-note { margin: 0.75rem 0; font-size: 0.875rem; color: var(--text-muted); }

.privacy-list { list-style: none; }
.privacy-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.privacy-list li:last-child { border-bottom: none; }
.privacy-list span { color: var(--text-muted); }

.plan-card {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.plan-card p { font-size: 0.8125rem; color: var(--text-muted); margin-top: 0.25rem; }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30, 27, 46, 0.5);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }

.modal {
  background: white;
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 440px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
}

.modal h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 0.375rem;
}
.modal-sub { color: var(--text-muted); font-size: 0.9375rem; margin-bottom: 1.5rem; }

.signup-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.birth-date {
  display: grid;
  grid-template-columns: 4.25rem minmax(0, 1fr) 5.5rem;
  gap: 0.5rem;
}
.birth-date select {
  min-width: 0;
  padding-left: 0.55rem;
  padding-right: 1.35rem;
}
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9375rem;
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(232, 54, 102, 0.18);
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  cursor: pointer;
}
.checkbox-label input { margin-top: 3px; flex-shrink: 0; }

.field-hint {
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text-muted);
  margin: 1rem 0 0;
}
label + .field-hint {
  margin-top: 0;
  margin-bottom: 1rem;
}

.city-combo { position: relative; }
.city-suggest {
  position: fixed;
  z-index: 400;
  margin: 0;
  padding: 0.25rem;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  max-height: 240px;
  overflow-y: auto;
}
.city-suggest button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-radius: 6px;
  padding: 0.45rem 0.65rem;
  font-family: inherit;
  color: inherit;
  cursor: pointer;
}
.city-suggest button[aria-selected="true"],
.city-suggest button:hover {
  background: rgba(232, 54, 102, 0.1);
}
.city-suggest .city-name {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
}
.city-suggest .city-state {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
}
.city-suggest .city-empty {
  padding: 0.55rem 0.65rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.condition-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem 1rem;
}
.check-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.22rem 0;
  border: 0;
  background: none;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.check-chip:has(input:checked) {
  color: var(--primary);
  font-weight: 600;
}
.check-chip input {
  margin: 0;
  width: 0.9rem;
  height: 0.9rem;
  flex-shrink: 0;
  accent-color: var(--primary);
}

.modal-footer {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.modal-match { text-align: center; }
.match-animation {
  color: var(--accent);
  animation: pulse 0.6s ease;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: center;
}
.match-animation .icon { width: 64px; height: 64px; }
@keyframes pulse {
  0% { transform: scale(0.5); opacity: 0; }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}
.match-avatars {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 1.5rem 0;
}
.match-avatars .avatar-sm { width: 72px; height: 72px; }

/* ===== Footer ===== */
.footer {
  background: #ffffff;
  color: var(--text-muted);
  padding: 3rem 0 0;
  margin-top: auto;
  border-top: 1px solid var(--border);
}
body[data-view="swipe"] .footer,
body[data-view="messages"] .footer {
  display: none;
}

.footer-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  padding-bottom: 2rem;
}

.footer-logo { margin-bottom: 0.75rem; }

.footer h4 {
  color: var(--text);
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}
.footer a {
  display: block;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 0.375rem;
  text-decoration: none;
}
.footer a:hover { color: var(--primary); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 1.25rem 0;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.privacy-list select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  font-family: inherit;
  font-size: 0.8125rem;
  max-width: 180px;
}
.switch { position: relative; display: inline-flex; }
.switch input { position: absolute; opacity: 0; }
.switch span {
  width: 40px;
  height: 22px;
  background: var(--border);
  border-radius: 999px;
  display: inline-block;
  position: relative;
  cursor: pointer;
}
.switch span::after {
  content: '';
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: 0.15s;
}
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { left: 21px; }

.forum-compose {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.forum-compose h3 { font-size: 1rem; margin-bottom: 0.75rem; }
.forum-compose .form-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0.75rem;
}
.filter-check { margin: 0.5rem 0 1rem; }
.lock-hint { color: var(--accent); font-size: 0.75rem; font-weight: 600; }
.modal-wide { max-width: 640px; }
.modal-legal { max-width: 720px; }
.page-body { color: var(--text-muted); line-height: 1.7; }
.page-body.is-plain { white-space: pre-line; }
.legal { color: var(--text); }
.legal .legal-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.legal .legal-lead {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 1rem;
}
.legal h3 {
  font-family: var(--font-display);
  font-size: 1.125rem;
  color: var(--text);
  margin: 1.5rem 0 0.5rem;
}
.legal h4 {
  font-size: 0.9375rem;
  color: var(--text);
  margin: 1rem 0 0.4rem;
}
.legal p { margin-bottom: 0.75rem; }
.legal ul {
  margin: 0 0 0.85rem 1.15rem;
}
.legal li { margin-bottom: 0.35rem; }
.legal a { font-weight: 600; }
.footer-studio {
  margin-top: 0.65rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.legal-account {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.legal-account h4 { margin-bottom: 0.5rem; }
.legal-account a {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.thread-replies { display: flex; flex-direction: column; gap: 0.75rem; margin: 1rem 0; }
.thread-reply {
  background: var(--bg-alt);
  padding: 0.75rem 1rem;
  border-radius: 12px;
}
.thread-reply strong { display: block; font-size: 0.8125rem; margin-bottom: 0.25rem; }
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.photos-section {
  grid-column: 1 / -1;
}
.photos-section-head h3 { margin-bottom: 0.35rem; }
.photo-album { margin-top: 1.25rem; }
.photo-album:first-of-type { margin-top: 0.75rem; }
.photo-album-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}
.photo-album-head h4 {
  font-size: 0.9375rem;
  margin: 0;
}
.photo-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}
.album-photo {
  aspect-ratio: 3 / 4;
  border-radius: 14px;
  background: linear-gradient(135deg, hsl(var(--hue, 280), 55%, 72%), hsl(calc(var(--hue, 280) + 30), 50%, 62%));
}
.profile-card-photo,
.people-card-photo,
.avatar-sm,
.avatar-xs,
.album-photo,
.profile-hero,
.onboard-hero {
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}
.profile-card-photo > img,
.swipe-card-photo > img,
.people-card-photo > img,
.avatar-sm > img,
.avatar-xs > img,
.album-photo > img,
.profile-hero > img,
.onboard-hero > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-help { font-size: 0.8125rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.photo-subtitle { font-size: 0.875rem; margin: 0.75rem 0 0.35rem; }
.photo-upload {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.photo-upload input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 4rem;
}
.photo-tile {
  position: relative;
}
.photo-tile.is-avatar {
  box-shadow: 0 0 0 3px var(--primary);
}
.photo-badge-main {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 2;
  background: rgba(255, 255, 255, 0.95);
  color: var(--primary);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(30, 27, 46, 0.18);
}
.photo-badge-review {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 2;
  background: #fff7ed;
  color: #9a3412;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
}
.photo-tile .photo-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  left: auto;
  bottom: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0;
  background: none;
  z-index: 2;
}
.photo-icon-btn {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  box-shadow: 0 2px 10px rgba(30, 27, 46, 0.18);
  transition: background 0.15s;
}
.photo-icon-btn:hover { background: #fff; }
.photo-icon-btn.star { color: var(--primary); }
.photo-icon-btn.delete { color: #dc2626; }
.photo-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0;
  appearance: none;
  border: 2px dashed var(--border);
  background: var(--bg-alt);
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.photo-add:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--accent-soft);
}
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  z-index: 300;
  font-size: 0.875rem;
  box-shadow: var(--shadow-lg);
}
.profile-card { cursor: pointer; }
.story-card { cursor: pointer; }
.view-profile-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding-top: 0.15rem;
  min-width: 0;
  max-width: 100%;
}
.view-profile-actions .btn {
  justify-content: center;
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  text-align: center;
}
.view-profile-actions .btn-primary,
.view-profile-actions .btn-outline {
  flex: 1 1 calc(50% - 0.25rem);
}
.view-profile-actions .btn-text {
  flex: 0 0 auto;
}
.view-profile-actions .btn-primary {
  background: var(--primary);
  box-shadow: none;
}
.view-profile-actions .btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: none;
}
.view-profile-actions .btn-ghost {
  color: var(--text-muted);
  font-weight: 500;
}

.modal-profile {
  width: min(100%, 480px);
  max-width: 100%;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
}
.modal-profile .modal-close {
  z-index: 6;
  top: 0.75rem;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}
.other-profile { display: flex; flex-direction: column; min-width: 0; max-width: 100%; }
.other-hero {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: auto;
  aspect-ratio: 3 / 4;
  min-height: 0;
  overflow: hidden;
  background: linear-gradient(160deg,
    hsl(var(--hue, 280), 55%, 72%),
    hsl(calc(var(--hue, 280) + 30), 50%, 62%));
}
.other-hero > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 1;
}
.other-hero .online-dot {
  z-index: 2;
  position: absolute;
  top: 14px;
  left: 14px;
  width: 12px;
  height: 12px;
  background: var(--success);
  border: 2px solid white;
  border-radius: 50%;
}
.other-hero .verified {
  z-index: 2;
  position: absolute;
  top: 12px;
  left: 14px;
  background: rgba(255,255,255,0.95);
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.other-hero .verified .icon { width: 12px; height: 12px; color: var(--teal); }
.other-hero .online-dot + .verified { left: 36px; }
.other-hero .new-badge { top: 14px; left: 14px; }
.other-hero .new-badge ~ .online-dot,
.other-hero .new-badge ~ .verified { top: 46px; }
.photo-tile { cursor: pointer; }
.photo-engagement {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: rgba(20, 16, 28, 0.72);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
}
.photo-engagement .icon { width: 12px; height: 12px; }
.photo-engagement-gap { width: 0.35rem; }
.photo-social-slot,
#modal-photo-social { padding: 0.85rem 1.15rem 0.2rem; }
#modal-photo-social { background: #fff; }
.photo-social-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.photo-like-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  font-weight: 700;
  cursor: pointer;
}
.photo-like-btn .icon { width: 16px; height: 16px; }
.photo-like-btn.is-on {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}
.photo-like-count { color: var(--text-muted); font-size: 0.875rem; font-weight: 600; }
.photo-comments { display: flex; flex-direction: column; gap: 0.65rem; margin-bottom: 0.75rem; }
.photo-comment-meta { margin: 0 0 0.15rem; font-size: 0.8125rem; color: var(--text-muted); }
.photo-comment-meta strong { color: var(--text); }
.photo-comment p:last-child { margin: 0; }
.photo-comments-empty { margin: 0; color: var(--text-muted); font-size: 0.875rem; }
.photo-comment-form { display: flex; gap: 0.5rem; }
.photo-comment-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  font: inherit;
}
.modal.modal-photo {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  width: min(96vw, 520px);
  max-width: min(96vw, 520px);
  max-height: min(92vh, 920px);
  background: #141018;
}
.modal-photo .modal-close {
  z-index: 3;
  top: 0.75rem;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}
.modal-photo-img {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-height: min(74vh, 780px);
  background: #141018;
}
.modal-photo-img img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(74vh, 780px);
  object-fit: contain;
}
.profile-hero > img,
.other-hero > img,
.onboard-hero > img,
.album-photo > img {
  object-fit: contain;
}
#modal-crop { z-index: 260; }
.modal-crop { max-width: 440px; }
.crop-ratios {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}
.crop-ratio {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
}
.crop-ratio.is-on {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.crop-stage {
  position: relative;
  margin: 0 auto 0.9rem;
  overflow: hidden;
  border-radius: 16px;
  background: #141018;
  touch-action: none;
  cursor: grab;
  user-select: none;
}
.crop-stage.is-dragging { cursor: grabbing; }
.crop-stage img {
  position: absolute;
  max-width: none;
  user-select: none;
  -webkit-user-drag: none;
}
.crop-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.92);
  background:
    linear-gradient(to right, transparent calc(33.33% - 0.5px), rgba(255, 255, 255, 0.45) 33.33%, transparent calc(33.33% + 0.5px)),
    linear-gradient(to right, transparent calc(66.66% - 0.5px), rgba(255, 255, 255, 0.45) 66.66%, transparent calc(66.66% + 0.5px)),
    linear-gradient(to bottom, transparent calc(33.33% - 0.5px), rgba(255, 255, 255, 0.45) 33.33%, transparent calc(33.33% + 0.5px)),
    linear-gradient(to bottom, transparent calc(66.66% - 0.5px), rgba(255, 255, 255, 0.45) 66.66%, transparent calc(66.66% + 0.5px));
}
.crop-zoom {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1rem;
  font-size: 0.8125rem;
  font-weight: 700;
}
.crop-zoom input { flex: 1; min-width: 0; accent-color: var(--primary); }
.crop-actions { display: flex; gap: 0.5rem; }
.crop-actions .btn { flex: 1; }
#modal-photo-social { padding-bottom: 1.1rem; }
.other-thumbs {
  display: flex;
  gap: 0.45rem;
  padding: 0.7rem 1rem 0;
  overflow-x: auto;
}
.other-thumb {
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-alt);
  cursor: pointer;
}
.other-thumb.active { border-color: var(--primary); }
.other-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.other-body { padding: 1rem 1.25rem 1.4rem; min-width: 0; max-width: 100%; }
.other-identity { margin-bottom: 0.35rem; min-width: 0; max-width: 100%; }
.other-body h2,
.other-identity h2 {
  font-family: var(--font-display);
  font-size: 1.7rem;
  line-height: 1.15;
  margin: 0 0 0.3rem;
  overflow-wrap: anywhere;
}
.other-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem;
}
.other-meta .icon { width: 15px; height: 15px; color: var(--primary); flex-shrink: 0; }
.other-flags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  margin-top: 0.35rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.other-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0.85rem 0 0.4rem;
}
.other-block {
  margin-top: 1rem;
  padding-top: 0.95rem;
  border-top: 1px solid var(--border);
}
.other-block h3 {
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.65rem;
}
.other-block .profile-essentials { margin-bottom: 0; }
.other-block .profile-bio {
  margin: 0;
  text-align: left;
  color: var(--text);
  line-height: 1.55;
}
.other-block .profile-bio + .profile-essentials { margin-top: 0.75rem; }
.other-about { margin-top: 0.85rem; }
.other-ist-list { margin: 0; }
.other-ist-list + .profile-essentials { margin-top: 0.75rem; }
.other-ist-list .badge {
  background: #ffe8ef;
  color: var(--primary);
}
.other-block .profile-interests { margin: 0; }
.other-block .profile-essential-icon {
  width: 2.15rem;
  height: 2.15rem;
}
.album-status {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0.85rem 0 0;
}
.album-status .icon { width: 14px; height: 14px; color: var(--teal); }

.filters-toggle { display: none; }
.chat-back { display: none; }
.bottom-nav { display: none; }
.hide-mobile { display: inline; }

@media (max-width: 899px) {
  .hide-mobile { display: none; }

  .header {
    padding-top: env(safe-area-inset-top);
  }
  .header-inner { height: 56px; }
  .logo-text { font-size: 1.2rem; }
  .logo-mark { width: 40px; height: 30px; }
  .nav-toggle,
  .nav-mobile { display: none !important; }
  .header-nickname { max-width: 88px; font-size: 0.875rem; }
  .header-user { min-width: 0; }
  .header-actions .btn-ghost { display: inline-flex; }

  body.is-logged-in .bottom-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 150;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    justify-content: space-around;
    padding: 0.3rem 0.15rem calc(0.3rem + env(safe-area-inset-bottom));
  }
  .bottom-nav a {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.35rem 0.2rem;
    color: var(--text-muted);
    font-size: 0.625rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    line-height: 1.15;
    -webkit-tap-highlight-color: transparent;
  }
  .bottom-nav a:hover { text-decoration: none; color: var(--primary); }
  .bottom-nav a.active { color: var(--primary); }
  .bottom-nav .icon {
    width: 22px;
    height: 22px;
  }
  .bottom-nav .nav-badge {
    position: absolute;
    top: -5px;
    right: -9px;
  }

  .view {
    min-height: calc(100dvh - 56px - env(safe-area-inset-top));
    padding-bottom: calc(5.5rem + env(safe-area-inset-bottom));
  }
  body[data-view="messages"] {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }
  body[data-view="messages"] .header {
    position: relative;
    top: auto;
    flex-shrink: 0;
    background: #fff;
  }
  body[data-view="messages"] main {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  #view-messages.view-active {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: auto;
    max-height: 100%;
    padding-bottom: 0;
    overflow: hidden;
  }
  #view-messages .messages-layout {
    flex: 1 1 auto;
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    min-height: 0;
    height: auto;
    max-height: 100%;
    width: 100%;
    max-width: none;
    padding: 0 0 calc(3.7rem + env(safe-area-inset-bottom));
    box-sizing: border-box;
    overflow: hidden;
  }

  .hero {
    padding: 1.5rem 0 2rem;
  }
  .hero-grid { gap: 1.75rem; }
  .hero-content h1 { font-size: clamp(1.85rem, 9vw, 2.35rem); }
  .hero-sub { font-size: 1rem; margin-bottom: 1.25rem; }
  .hero-cta {
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 1.5rem;
  }
  .hero-cta .btn { width: 100%; }
  .hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem 0.85rem;
  }
  .hero-stats span { line-height: 1.3; }
  .phone-mockup {
    width: min(260px, 78vw);
    border-radius: 28px;
    padding: 10px;
  }
  .phone-screen {
    min-height: 340px;
    border-radius: 22px;
  }
  .mock-photo { height: 180px; }

  .section { padding: 2.5rem 0; }
  .section-title { font-size: 1.6rem; }
  .cta-inner h2 { font-size: 1.5rem; }
  .page-header { padding: 1.25rem 0 1rem; }
  .page-header h1 { font-size: 1.5rem; }

  .features-grid,
  .testimonials-grid,
  .stories-grid,
  .profile-sections,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .filters-toggle { display: flex; }
  .filters-panel {
    display: none;
    position: static;
    top: auto;
    padding: 1.1rem;
  }
  .filters-panel.open { display: block; }

  .discover-layout { padding-top: 1.25rem; gap: 1rem; }
  .discover-heading h1 { font-size: 1.5rem; }
  .discover-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    margin: 0 -0.25rem;
    padding-bottom: 0.15rem;
  }
  .discover-tabs::-webkit-scrollbar { display: none; }
  .discover-tabs .tab { flex: 0 0 auto; }
  .profiles-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }
  .profile-card-photo { height: 150px; }
  .profile-card-body { padding: 0.75rem; }
  .profile-card-body h3 { font-size: 0.9rem; }
  .profile-card-body .tags span:nth-child(n+2) { display: none; }
  .profile-card-body .meta {
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body[data-view="swipe"] .header { display: none; }
  #view-swipe.view-active {
    overflow: hidden;
    padding-bottom: 0;
    min-height: 100dvh;
  }
  body[data-view="swipe"] #view-swipe.view-active {
    min-height: 100dvh;
  }
  .swipe-container {
    max-width: none;
    width: 100%;
    height: calc(100dvh - 4.15rem - env(safe-area-inset-bottom));
    min-height: 0;
    padding: calc(0.45rem + env(safe-area-inset-top)) 0.55rem 0.35rem;
  }
  .swipe-remaining {
    display: block;
    font-size: 0.75rem;
    line-height: 1.3;
    margin: 0.15rem 0 0;
  }
  .swipe-stack {
    min-height: 0;
    margin-bottom: 0.85rem;
  }
  .swipe-card { border-radius: 20px; }
  .swipe-card-photo { height: 100%; min-height: 0; }
  .swipe-card-info { padding: 4rem 1.1rem 1.15rem; }
  .swipe-card-info h3 { font-size: 1.7rem; }
  .swipe-btn {
    width: 62px;
    height: 62px;
  }
  .swipe-buttons { gap: 1rem; }
  .swipe-btn.like {
    width: 72px;
    height: 72px;
  }

  .conversations-list { border-right: none; }
  .chat-panel { display: none; }
  #view-messages.chat-open .conversations-list { display: none; }
  #view-messages.chat-open .chat-panel {
    display: flex;
    min-height: 0;
    height: 100%;
    max-height: 100%;
  }
  .conversations-list,
  .chat-panel {
    height: 100%;
    max-height: 100%;
    min-height: 0;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }
  .chat-user { min-width: 0; flex: 1; }
  .chat-user > div { min-width: 0; }
  .chat-user strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .swipe-card { touch-action: none; }
  .chat-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-right: 0.25rem;
    border: none;
    background: var(--bg-alt);
    border-radius: 10px;
    color: var(--text);
    cursor: pointer;
    flex-shrink: 0;
  }
  .chat-back .icon { width: 20px; height: 20px; }
  .chat-header {
    flex-shrink: 0;
    min-width: 0;
    max-width: 100%;
    padding: 0.65rem 0.85rem;
    gap: 0.35rem;
    background: #fff;
    position: relative;
    z-index: 2;
  }
  .chat-actions { flex-shrink: 0; }
  .chat-actions button { padding: 0.4rem; }
  .chat-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .chat-input {
    flex-shrink: 0;
    align-self: center;
    width: min(100% - 2.5rem, 22rem);
    max-width: calc(100% - 2.5rem);
    margin: 0.2rem auto calc(0.55rem + var(--kb, 0px));
    padding: 0;
    gap: 0.4rem;
    background: transparent;
    border-top: none;
    box-sizing: border-box;
  }
  .chat-input input {
    font-size: 16px;
    padding: 0.62rem 0.85rem;
  }
  .chat-input .btn {
    flex: 0 0 auto;
    padding: 0.55rem 0.75rem;
    font-size: 0.8125rem;
  }
  body.chat-typing .bottom-nav { display: none !important; }
  body.chat-typing #view-messages .messages-layout {
    padding-bottom: 0;
  }
  .msg { max-width: 86%; }

  .signup-form .form-row,
  .forum-compose .form-row {
    grid-template-columns: 1fr;
  }
  .form-group input,
  .form-group select,
  .form-group textarea,
  .filter-group select,
  .filter-group input,
  .conv-search {
    font-size: 16px;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .modal {
    max-width: 100%;
    width: 100%;
    border-radius: 20px 20px 0 0;
    max-height: min(92dvh, 100%);
    padding: 1.25rem 1.15rem calc(1.25rem + env(safe-area-inset-bottom));
  }
  .modal-wide { max-width: 100%; }

  .profile-page { padding: 1rem 0 0; }
  .album-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
  }
  .modal.modal-photo {
    width: 100%;
    max-width: 100%;
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom);
    max-height: min(94dvh, 100%);
    border-radius: 20px 20px 0 0;
  }
  .modal-photo-img,
  .modal-photo-img img {
    max-height: min(68dvh, 720px);
  }
  .profile-main {
    gap: 0.75rem;
    padding: 1rem 1rem 1.05rem;
  }
  .profile-details {
    width: 100%;
    padding-top: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }
  .profile-details h1 {
    font-size: 1.3rem;
    line-height: 1.2;
  }
  .profile-header-card {
    border-radius: 16px;
  }
  .profile-location {
    margin: 0.2rem 0 0.55rem;
    justify-content: flex-start;
  }
  .profile-details .profile-badges {
    justify-content: flex-start;
    margin-bottom: 0.45rem;
  }
  .profile-details .profile-interests {
    justify-content: flex-start;
    margin-top: 0.15rem;
  }
  .profile-details .profile-bio {
    text-align: left;
    margin-bottom: 0.5rem;
  }
  .profile-essentials { grid-template-columns: 1fr; }
  .other-block .profile-essentials {
    grid-template-columns: 1fr 1fr;
    gap: 0.7rem 0.65rem;
  }
  .other-body { padding: 0.85rem 1rem calc(1.1rem + env(safe-area-inset-bottom)); }
  .other-identity h2 { font-size: 1.45rem; }
  .profile-header-actions { margin-top: 0.15rem; }
  .modal-profile {
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom);
    max-height: min(94dvh, 100%);
    border-radius: 20px 20px 0 0;
  }
  .privacy-list li {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .privacy-list select { max-width: 100%; }

  .forum-post { padding: 1.1rem; }
  .community-tabs { gap: 0.4rem; }
  .tab { flex: 1; text-align: center; padding: 0.55rem 0.75rem; }

  .footer {
    padding: 2rem 0 calc(5.5rem + env(safe-area-inset-bottom));
  }
  .toast {
    bottom: calc(5.25rem + env(safe-area-inset-bottom));
    max-width: calc(100% - 2rem);
    text-align: center;
  }

  body:not([data-view="landing"]) .footer { display: none; }

  .people-grid { grid-template-columns: 1fr; }
  .people-card-photo { height: 160px; }
}

@media (max-width: 420px) {
  .header-nickname { display: none; }
}

@media (max-width: 380px) {
  .profiles-grid { gap: 0.5rem; }
  .profile-card-photo { height: 128px; }
  .header-inner { gap: 0.4rem; }
  .header-actions { gap: 0.25rem; }
  .header-actions .btn { padding: 0.4rem 0.6rem; font-size: 0.75rem; }
  .logo-mark { width: 36px; height: 27px; }
  .logo-text { font-size: 1.05rem; }
  .swipe-buttons { gap: 0.65rem; }
  .swipe-btn { width: 54px; height: 54px; }
  .swipe-btn.like { width: 64px; height: 64px; }
  .swipe-btn.undo { width: 46px; height: 46px; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .hero-stats > div:last-child { grid-column: 1 / -1; }
}
