/* ================================================================
   InderApp — Web Application Styles
   Builds on Foundation Sites 6. Matches inderapp.com visual style.
   ================================================================ */

/* ── Skip link (keyboard / agent navigation) ───────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  z-index: 10000;
  padding: .5rem 1rem;
  background: var(--color-primary, #6C63FF);
  color: #fff;
  font-weight: 600;
  border-radius: 0 0 8px 0;
  text-decoration: none;
  transition: top .15s;
}
.skip-link:focus { top: 0; }

/* ── Design tokens ─────────────────────────────────────────────── */
:root {
  --color-primary:      #6C63FF;
  --color-primary-dk:   #574FCC;
  --color-primary-lt:   #EEF0FF;
  --color-accent:       #FF6B9D;
  --color-bg:           #F4F6FB;
  --color-surface:      #FFFFFF;
  --color-border:       #E2E6EF;
  --color-text:         #1A1D2E;
  --color-muted:        #6B7280;
  --color-success:      #10B981;
  --color-danger:       #EF4444;
  --color-warning:      #F59E0B;
  --shadow-sm:          0 1px 3px rgba(0,0,0,.08);
  --shadow-md:          0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:          0 8px 32px rgba(0,0,0,.14);
  --radius-sm:          8px;
  --radius-md:          16px;
  --radius-lg:          24px;
  --radius-pill:        999px;
  --sidebar-w:          260px;
  --mobile-nav-h:       64px;
  --font-main:          'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition:         0.2s ease;
}

/* ── Base ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  background: var(--color-bg);
  color: var(--color-text);
  margin: 0;
  min-height: 100vh;
}

img { max-width: 100%; display: block; }

a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-dk); }

/* ── Utility classes ───────────────────────────────────────────── */
.hidden { display: none !important; }
.text-muted { color: var(--color-muted); font-size: .875rem; }
.text-center { text-align: center; }
.w-full { width: 100%; }

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem;
  background: linear-gradient(135deg, #1E0338 0%, #6D28D9 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: .75rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(109,40,217,.3);
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
}
.btn-primary:hover { background: linear-gradient(135deg, #6D28D9 0%, #1E0338 100%); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(109,40,217,.45); color: #fff; }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .55; pointer-events: none; }

.btn-outline {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  background: transparent;
  color: #6D28D9;
  border: 2px solid #6D28D9;
  border-radius: var(--radius-pill);
  padding: .625rem 1.5rem;
  font-size: .9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  text-decoration: none;
}
.btn-outline:hover { background: linear-gradient(135deg, #1E0338 0%, #6D28D9 100%); color: #fff; border-color: transparent; }
.btn-outline:disabled { opacity: .55; pointer-events: none; }

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: .375rem;
  background: transparent; border: none; cursor: pointer; color: var(--color-muted);
  font-size: .875rem; padding: .375rem .75rem; border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}
.btn-ghost:hover { color: var(--color-primary); background: var(--color-primary-lt); }

.btn-danger {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem; background: var(--color-danger); color: #fff;
  border: none; border-radius: var(--radius-pill);
  padding: .625rem 1.5rem; font-weight: 600; cursor: pointer;
  transition: background var(--transition);
}
.btn-danger:hover { background: #DC2626; }

.card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
}

/* ── Form elements ─────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block; font-weight: 500; margin-bottom: .375rem; font-size: .9375rem;
}
.form-control {
  width: 100%;
  box-sizing: border-box;
  min-width: 0;            /* allow date/number inputs to shrink to the container */
  max-width: 100%;
  padding: .75rem 1rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: var(--font-main);
  background: var(--color-bg);
  color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(108,99,255,.15);
}
.form-control.is-invalid { border-color: var(--color-danger); }
.form-error { color: var(--color-danger); font-size: .8125rem; margin-top: .25rem; }

select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }
/* Date inputs keep a fixed intrinsic width on mobile WebKit — reset it so they
   shrink to the container instead of overflowing the card. */
input[type="date"].form-control {
  -webkit-appearance: none; appearance: none; min-width: 0; max-width: 100%;
}
input[type="date"].form-control::-webkit-date-and-time-value { text-align: left; }

/* ── Toggle switch ─────────────────────────────────────────────── */
.toggle-wrap {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 0; border-bottom: 1px solid var(--color-border);
}
.toggle-wrap:last-child { border-bottom: none; }
.toggle-label { font-weight: 500; }
.toggle-desc { color: var(--color-muted); font-size: .8125rem; margin-top: .125rem; }
.toggle-switch {
  position: relative; width: 48px; height: 26px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--color-border); border-radius: var(--radius-pill);
  transition: background var(--transition);
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 20px; height: 20px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--color-primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(22px); }

/* ── Alert / Toast ─────────────────────────────────────────────── */
.alert {
  padding: .875rem 1.125rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: .9375rem;
}
.alert-error   { background: #FEF2F2; color: #B91C1C; border-left: 4px solid var(--color-danger); }
.alert-success { background: #ECFDF5; color: #065F46; border-left: 4px solid var(--color-success); }

#global-toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  z-index: 2000; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
}
.toast {
  background: #1A1D2E; color: #fff;
  padding: .75rem 1.5rem; border-radius: var(--radius-pill);
  font-size: .9375rem; font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn .25s ease, toastOut .3s ease 2.7s forwards;
}
@keyframes toastIn  { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to   { opacity: 0; transform: translateY(-8px); } }
.toast.toast-success { background: var(--color-success); }
.toast.toast-error   { background: var(--color-danger); }

/* ── Loading spinner ───────────────────────────────────────────── */
.spinner {
  width: 32px; height: 32px; border: 3px solid var(--color-border);
  border-top-color: var(--color-primary); border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-center {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1rem; padding: 3rem; color: var(--color-muted); font-size: .9375rem;
}

/* ═══════════════════════════════════════════════════════════════
   AUTH PAGES (login.html / register.html)
   ═══════════════════════════════════════════════════════════════ */
.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  background:
    linear-gradient(135deg, rgba(30,3,56,.72) 0%, rgba(108,99,255,.42) 100%),
    url('../images/auth-cover.jpg') center / cover no-repeat fixed;
}

.auth-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  width: 100%; max-width: 440px;
}
.auth-card-wide { max-width: 700px; }

.register-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem;
}
.register-grid .span-2 { grid-column: 1 / -1; }

/* 18+/Terms confirmation checkbox */
.age-check {
  display: flex; align-items: flex-start; gap: .6rem;
  font-size: .875rem; color: var(--color-muted); line-height: 1.5; cursor: pointer;
}
.age-check input[type="checkbox"] {
  margin-top: .15rem; width: 17px; height: 17px; flex-shrink: 0;
  accent-color: var(--color-primary); cursor: pointer;
}
@media (max-width: 600px) {
  .register-grid { grid-template-columns: 1fr; }
}

/* Register tabs — horizontal row on top, panels below */
.vtabs { display: flex; flex-direction: column; gap: 1.25rem; text-align: left; }
.vtabs-rail {
  display: flex; flex-direction: row; gap: .5rem;
}
.vtab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .85rem 1rem; border: 1.5px solid var(--color-border); border-radius: var(--radius-sm);
  background: var(--color-bg); cursor: pointer; font-family: var(--font-main);
  font-size: .9rem; font-weight: 600; color: var(--color-text);
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}
.vtab svg { flex-shrink: 0; }
.vtab:hover { border-color: var(--color-primary); }
.vtab.active { border-color: var(--color-primary); background: var(--color-primary-lt); color: var(--color-primary); }
.vtabs-panels { min-width: 0; }
.vtab-panel.hidden { display: none; }
.vpanel-lead { font-weight: 600; margin: 0 0 1.25rem; }
.vpanel-note { font-size: .8125rem; margin-top: 1rem; }
.g-btn-wrap { display: flex; justify-content: flex-start; min-height: 44px; }

@media (max-width: 480px) {
  .vtab span { font-size: .82rem; }
  .vtab { padding: .7rem .5rem; }
}

/* Searchable country dropdown */
.country-wrap { position: relative; }
.country-input-box {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1rem; border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm); cursor: text; background: var(--color-bg);
  transition: border-color var(--transition), box-shadow var(--transition);
  gap: .5rem;
}
.country-input-box:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(108,99,255,.15);
}
.country-input-box.is-invalid { border-color: var(--color-danger); }
.country-search {
  flex: 1; border: none; background: none; outline: none;
  font-size: 1rem; font-family: var(--font-main); color: var(--color-text); min-width: 0;
}
.country-search::placeholder { color: var(--color-muted); }
.country-caret { color: var(--color-muted); flex-shrink: 0; pointer-events: none; transition: transform .2s; }
.country-input-box.open .country-caret { transform: rotate(180deg); }
.country-menu {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 300;
  background: var(--color-surface); border: 1.5px solid var(--color-primary);
  border-radius: var(--radius-sm); max-height: 210px; overflow-y: auto;
  box-shadow: var(--shadow-md);
}
.country-menu.open { display: block; }
.country-opt {
  padding: .625rem 1rem; cursor: pointer; font-size: .9rem;
  transition: background var(--transition); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.country-opt:hover, .country-opt.focused { background: var(--color-primary-lt); color: var(--color-primary); }
.country-opt.hidden { display: none; }
.country-empty { padding: .75rem 1rem; color: var(--color-muted); font-size: .9rem; }

.auth-logo {
  display: flex; align-items: center; justify-content: center; gap: .55rem;
  margin-bottom: 1.75rem; text-decoration: none;
}
.auth-logo-name {
  font-size: 1.5rem; font-weight: 700;
  background: linear-gradient(135deg, #1E0338 0%, #6D28D9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-title { font-size: 1.625rem; font-weight: 700; margin: 0 0 .375rem; }
.auth-subtitle { color: var(--color-muted); margin-bottom: 1.75rem; font-size: .9375rem; }

.auth-divider {
  display: flex; align-items: center; gap: 1rem; margin: 1.25rem 0;
  color: var(--color-muted); font-size: .875rem;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--color-border);
}

.auth-footer { text-align: center; margin-top: 1.5rem; font-size: .9375rem; color: var(--color-muted); }
.auth-footer a { font-weight: 600; }

.gender-radios { display: flex; gap: .75rem; flex-wrap: wrap; }
.gender-radio  {
  flex: 1; min-width: 80px;
  position: relative;
}
.gender-radio input { position: absolute; opacity: 0; width: 0; height: 0; }
.gender-radio label {
  display: flex; align-items: center; justify-content: center; gap: .375rem;
  padding: .625rem 1rem; border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm); cursor: pointer; font-size: .9375rem; font-weight: 500;
  transition: border-color var(--transition), background var(--transition);
  margin: 0;
}
.gender-radio input:checked + label {
  border-color: var(--color-primary); background: var(--color-primary-lt); color: var(--color-primary);
}

/* ═══════════════════════════════════════════════════════════════
   APP SHELL (app.html) — sidebar + main + mobile nav
   ═══════════════════════════════════════════════════════════════ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
  transition: transform var(--transition);
}

.sidebar-brand {
  display: flex; align-items: center; gap: .625rem;
  padding: 1.5rem 1.25rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
}
.sidebar-brand-mark { flex-shrink: 0; display: block; }
.sidebar-brand-name {
  font-size: 1.1875rem; font-weight: 700;
  background: linear-gradient(135deg, #1E0338 0%, #6D28D9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-nav {
  flex: 1; padding: 1rem 0; overflow-y: auto;
}
.nav-item {
  display: flex; align-items: center; gap: .875rem;
  padding: .75rem 1.25rem;
  color: #212529; font-weight: 500; font-size: .9375rem;
  border-radius: var(--radius-sm); margin: .125rem .75rem;
  cursor: pointer; border: none; background: none; width: calc(100% - 1.5rem);
  text-align: left; transition: background var(--transition), color var(--transition);
  position: relative;
  text-decoration: none;
}
.nav-item:hover { background: var(--color-bg); color: var(--color-text); }
.nav-item.active { background: var(--color-primary-lt); color: var(--color-primary); }
.nav-item.active .nav-icon { color: var(--color-primary); }
.nav-icon { width: 20px; height: 20px; flex-shrink: 0; }

.nav-badge {
  margin-left: auto;
  background: var(--color-accent); color: #fff;
  font-size: .6875rem; font-weight: 700;
  padding: .1rem .4rem; border-radius: var(--radius-pill); min-width: 18px; text-align: center;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--color-border);
}
.sidebar-user {
  display: flex; align-items: center; gap: .75rem;
  margin-bottom: .75rem;
}
.sidebar-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--color-primary-lt); object-fit: cover;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.125rem; color: var(--color-primary); font-weight: 600;
  overflow: hidden; flex-shrink: 0;
}
.sidebar-username { font-weight: 600; font-size: .9375rem; color: #212529; }
.sidebar-role     { color: #212529; font-size: .8125rem; }

.btn-logout {
  display: flex; align-items: center; gap: .5rem; width: 100%;
  background: none; border: none; padding: .5rem .75rem; border-radius: var(--radius-sm);
  color: var(--color-danger); font-size: .9rem; font-weight: 500; cursor: pointer;
  transition: background var(--transition);
}
.btn-logout:hover { background: #FEF2F2; }

/* ── Main content ─────────────────────────────────────────────── */
#app-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  overflow-y: auto;
}

.view-section {
  padding: 0 2rem 2rem;
}

.view-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--color-bg);
  padding: 1.5rem 0 1rem;
  margin-bottom: 1rem;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  border-bottom: 1px solid var(--color-border);
}
.view-header h1 { font-size: 1.625rem; font-weight: 700; margin: 0; }

/* ── Mobile bottom nav ────────────────────────────────────────── */
#mobile-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--mobile-nav-h);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  z-index: 100;
  justify-content: space-around; align-items: center;
}
.mobile-nav-item {
  display: flex; flex-direction: column; align-items: center; gap: .25rem;
  cursor: pointer; background: none; border: none;
  color: var(--color-muted); font-size: .6875rem; font-weight: 500;
  padding: .5rem; flex: 1; transition: color var(--transition);
  position: relative;
}
.mobile-nav-item svg { width: 22px; height: 22px; }
.mobile-nav-item.active { color: var(--color-primary); }
.mobile-nav-badge {
  position: absolute; top: 2px; right: calc(50% - 18px);
  background: var(--color-accent); color: #fff;
  font-size: .625rem; font-weight: 700;
  width: 16px; height: 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
}

/* ═══════════════════════════════════════════════════════════════
   DISCOVER / SWAP CARD STACK
   ═══════════════════════════════════════════════════════════════ */
#swap-container {
  display: flex; flex-direction: column; align-items: center; padding: 1rem 0;
}

.card-stack {
  position: relative;
  width: 360px; max-width: 100%;
  height: 560px;
}

.swap-card {
  position: absolute; inset: 0;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  cursor: pointer;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1), opacity .3s ease;
  user-select: none;
}
.swap-card:nth-child(2) { transform: scale(.97) translateY(8px); z-index: 1; }
.swap-card:nth-child(3) { transform: scale(.94) translateY(16px); z-index: 0; }
.swap-card.top          { z-index: 2; }

.swap-card-photo {
  width: 100%; height: 360px; object-fit: cover; background: var(--color-border);
  display: block;
}
.swap-card-photo-placeholder {
  width: 100%; height: 360px;
  background: linear-gradient(135deg, var(--color-primary-lt), var(--color-border));
  display: flex; align-items: center; justify-content: center;
  font-size: 4rem;
}
.swap-card-body { padding: 1.25rem; }
.swap-card-age  { font-size: 1.5rem; font-weight: 700; margin-bottom: .5rem; }
.swap-card-interests {
  display: flex; flex-wrap: wrap; gap: .375rem; margin-bottom: .5rem;
}
.interest-chip {
  background: var(--color-primary-lt); color: var(--color-primary);
  border-radius: var(--radius-pill); padding: .25rem .75rem;
  font-size: .8125rem; font-weight: 500;
}

/* Directional swipe indicators */
.swap-card .swipe-label {
  position: absolute; top: 2rem; padding: .4rem 1rem;
  font-size: 1.5rem; font-weight: 900; border-radius: var(--radius-sm); border: 4px solid;
  opacity: 0; transition: opacity .2s;
}
.swap-card .swipe-label.like  { left: 1.5rem; color: var(--color-success); border-color: var(--color-success); transform: rotate(-15deg); }
.swap-card .swipe-label.nope  { right: 1.5rem; color: var(--color-danger);  border-color: var(--color-danger);  transform: rotate(15deg); }

/* Action buttons below card */
.swap-actions {
  display: flex; align-items: center; justify-content: center;
  gap: 1.25rem; margin-top: 1.5rem;
}
.swap-btn {
  width: 64px; height: 64px; border-radius: 50%; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 1.625rem;
  box-shadow: var(--shadow-md); transition: transform .2s, box-shadow .2s;
}
.swap-btn:hover { transform: scale(1.12); box-shadow: var(--shadow-lg); }
.swap-btn.pass   { background: var(--color-surface); color: var(--color-danger); }
.swap-btn.accept { background: var(--color-primary); color: #fff; }
.swap-btn.accept:hover { background: var(--color-primary-dk); }
.swap-btn.small  { width: 44px; height: 44px; font-size: 1.125rem; }

/* Slide-out animation classes added by JS */
.swap-card.fly-left  { animation: flyLeft  .35s ease forwards; }
.swap-card.fly-right { animation: flyRight .35s ease forwards; }

/* ── Swap detail (2-column: gallery | info) ──────────────────── */
.swap-detail {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  max-width: 760px; margin: 0 auto;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md); overflow: hidden;
}
.swap-detail.fly-left  { animation: flyLeft  .3s ease forwards; }
.swap-detail.fly-right { animation: flyRight .3s ease forwards; }

.swap-gallery { position: relative; background: var(--color-primary-lt); min-height: 420px; }
.swap-gallery-photo {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center; font-size: 4rem; color: var(--color-muted);
}
.gallery-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(0,0,0,.45); color: #fff; font-size: 1.5rem; line-height: 1;
  display: flex; align-items: center; justify-content: center; transition: background var(--transition);
}
.gallery-nav:hover { background: rgba(0,0,0,.7); }
.gallery-nav.prev { left: 10px; }
.gallery-nav.next { right: 10px; }
.gallery-dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 5px; z-index: 3; }
.gdot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.55); }
.gdot.active { background: #fff; }

/* Like / Pass sit on the photo. A scrim keeps them readable on light images. */
.swap-gallery::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 40%;
  background: linear-gradient(to top, rgba(0,0,0,.55) 0%, rgba(0,0,0,.15) 55%, transparent 100%);
  pointer-events: none; z-index: 1;
}
.swap-gallery .swap-actions {
  position: absolute; left: 0; right: 0; bottom: 26px;
  margin-top: 0; z-index: 2;
}

.swap-info { padding: 1.5rem; display: flex; flex-direction: column; }
.swap-info-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.swap-info-name { font-size: 1.5rem; font-weight: 700; margin: 0; }
.swap-info-meta { color: var(--color-muted); margin: .35rem 0 1.25rem; }
.swap-info-section { margin-bottom: 1rem; }
.swap-info-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--color-muted); margin-bottom: .45rem; }
.swap-info .swap-actions { margin-top: auto; }

@media (max-width: 767px) {
  .swap-detail { grid-template-columns: 1fr; max-width: 420px; }
  .swap-gallery { min-height: 0; aspect-ratio: 1 / 1; }
}
@keyframes flyLeft  { to { transform: translateX(-140%) rotate(-30deg); opacity: 0; } }
@keyframes flyRight { to { transform: translateX(140%)  rotate(30deg);  opacity: 0; } }

/* Empty state */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1rem; padding: 3rem 1rem; text-align: center;
}
.empty-state-icon { font-size: 4rem; }
.empty-state h3   { font-size: 1.25rem; font-weight: 600; margin: 0; }
.empty-state p    { color: var(--color-muted); margin: 0; max-width: 280px; }

/* ═══════════════════════════════════════════════════════════════
   PROFILE CARDS GRID (likes / matches)
   ═══════════════════════════════════════════════════════════════ */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.profile-card {
  background: var(--color-surface); border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm); overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.profile-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.profile-card-photo {
  width: 100%; aspect-ratio: 4/5; object-fit: cover;
  background: var(--color-border); display: block;
}
.profile-card-photo-placeholder {
  width: 100%; aspect-ratio: 4/5;
  background: linear-gradient(135deg, var(--color-primary-lt), var(--color-border));
  display: flex; align-items: center; justify-content: center; font-size: 3rem;
}
.profile-card-body { padding: .875rem; }
.profile-card-age  { font-weight: 700; font-size: 1rem; margin-bottom: .375rem; }
.profile-card-meta { color: var(--color-muted); font-size: .8125rem; margin-bottom: .625rem; }
.profile-card-actions { display: flex; gap: .5rem; }
.profile-card-actions .swap-btn { width: 36px; height: 36px; font-size: 1rem; }

/* ═══════════════════════════════════════════════════════════════
   MATCHES / CHAT LIST
   ═══════════════════════════════════════════════════════════════ */
.match-list { display: flex; flex-direction: column; gap: .75rem; }

.match-item {
  background: var(--color-surface); border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm); padding: 1rem 1.25rem;
  display: flex; align-items: center; gap: 1rem;
  transition: box-shadow var(--transition), transform var(--transition);
}
.match-item:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.match-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--color-primary-lt); object-fit: cover; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.375rem; overflow: hidden;
}
.match-info { flex: 1; min-width: 0; }
.match-name { font-weight: 600; margin-bottom: .2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match-preview { color: var(--color-muted); font-size: .875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match-actions { display: flex; gap: .5rem; flex-shrink: 0; }
.match-btn {
  width: 36px; height: 36px; border-radius: 50%; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: .9rem;
  background: var(--color-primary-lt); color: var(--color-primary);
  transition: background var(--transition), transform var(--transition);
}
.match-btn:hover { background: var(--color-primary); color: #fff; transform: scale(1.1); }

/* ═══════════════════════════════════════════════════════════════
   CHAT VIEW
   ═══════════════════════════════════════════════════════════════ */
#view-chat {
  display: flex; flex-direction: column;
  height: 100vh; max-height: 100vh;
  padding: 0; max-width: none;
}

.chat-topbar {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.5rem; border-bottom: 1px solid var(--color-border);
  background: var(--color-surface); flex-shrink: 0;
}
.chat-topbar-back {
  background: none; border: none; cursor: pointer; padding: .25rem;
  color: var(--color-primary); display: flex; align-items: center;
}
.chat-partner-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--color-primary-lt); object-fit: cover; overflow: hidden;
  display: flex; align-items: center; justify-content: center; font-size: 1.125rem; flex-shrink: 0;
}
.chat-partner-name   { font-weight: 600; }
.chat-partner-status { color: var(--color-muted); font-size: .8125rem; }

.chat-messages {
  flex: 1; overflow-y: auto; padding: 1rem 1.5rem;
  display: flex; flex-direction: column; gap: .5rem;
}

.msg-bubble-wrap {
  display: flex; align-items: flex-end; gap: .5rem;
}
.msg-bubble-wrap.mine { flex-direction: row-reverse; }

.msg-bubble {
  max-width: 72%; padding: .625rem 1rem;
  border-radius: 18px; font-size: .9375rem; line-height: 1.45;
  word-break: break-word;
}
.msg-bubble.mine {
  background: var(--color-primary); color: #fff;
  border-bottom-right-radius: 4px;
}
.msg-bubble.theirs {
  background: var(--color-surface); color: var(--color-text);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-sm);
}

.msg-translation {
  font-size: .8rem; opacity: .75; margin-top: .25rem; font-style: italic;
}
.msg-time { font-size: .75rem; color: var(--color-muted); text-align: right; margin-top: .2rem; }

.chat-input-area {
  padding: .875rem 1.5rem 1rem;
  border-top: 1px solid var(--color-border); background: var(--color-surface); flex-shrink: 0;
}
.ai-suggestion-box {
  background: var(--color-primary-lt); border-radius: var(--radius-sm);
  padding: .75rem 1rem; margin-bottom: .75rem;
  display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem;
}
.ai-suggestion-text { font-size: .9375rem; flex: 1; color: var(--color-text); }
.ai-suggestion-actions { display: flex; gap: .5rem; flex-shrink: 0; }

.chat-compose {
  display: flex; align-items: flex-end; gap: .625rem;
}
.chat-textarea {
  flex: 1; resize: none; min-height: 44px; max-height: 120px;
  border: 1.5px solid var(--color-border); border-radius: 22px;
  padding: .625rem 1rem; font-family: var(--font-main); font-size: .9375rem;
  outline: none; background: var(--color-bg); transition: border-color var(--transition);
  line-height: 1.45; overflow-y: hidden;
}
.chat-textarea:focus { border-color: var(--color-primary); }
.chat-send-btn {
  width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--color-primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 1.125rem;
  transition: background var(--transition), transform var(--transition); flex-shrink: 0;
}
.chat-send-btn:hover   { background: var(--color-primary-dk); transform: scale(1.08); }
.chat-send-btn:disabled { opacity: .45; pointer-events: none; }
.chat-ai-btn {
  width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--color-primary-lt); color: var(--color-primary);
  display: flex; align-items: center; justify-content: center; font-size: 1rem;
  transition: background var(--transition); flex-shrink: 0;
}
.chat-ai-btn:hover { background: var(--color-primary); color: #fff; }

/* ═══════════════════════════════════════════════════════════════
   SETTINGS VIEW
   ═══════════════════════════════════════════════════════════════ */
.settings-section {
  background: var(--color-surface); border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm); padding: 1.5rem; margin-bottom: 1.5rem;
}
.settings-section h2 { font-size: 1.125rem; font-weight: 600; margin: 0 0 1.25rem; }

/* Settings tabs */
.settings-tabs {
  display: flex; gap: .25rem; margin-bottom: 1.5rem;
  border-bottom: 1.5px solid var(--color-border);
}
.settings-tab {
  appearance: none; background: none; border: none; cursor: pointer;
  font-family: var(--font-main); font-size: .95rem; font-weight: 600;
  color: var(--color-muted); padding: .75rem 1.25rem;
  border-bottom: 2px solid transparent; margin-bottom: -1.5px;
  transition: color var(--transition), border-color var(--transition);
}
.settings-tab:hover { color: var(--color-text); }
.settings-tab.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.settings-tab-panel.hidden { display: none; }

.profile-photo-picker {
  display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem;
}
.current-photo {
  width: 72px; height: 72px; border-radius: 50%; object-fit: cover;
  background: var(--color-primary-lt);
  display: flex; align-items: center; justify-content: center; font-size: 2rem;
  overflow: hidden; flex-shrink: 0;
}
.photo-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: .5rem; margin-bottom: .75rem;
}
.photo-thumb {
  aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden;
  background: var(--color-surface); position: relative;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-status {
  position: absolute; top: 4px; left: 4px; z-index: 2;
  font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  padding: .15rem .4rem; border-radius: 999px; color: #fff; line-height: 1.3;
}
.photo-status.pending  { background: #f59e0b; }
.photo-status.rejected { background: var(--color-danger, #ef4444); }
.photo-thumb-add {
  aspect-ratio: 1; border-radius: var(--radius-sm);
  border: 2px dashed var(--color-border); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.75rem; color: var(--color-muted);
  background: none; transition: border-color var(--transition), color var(--transition);
}
.photo-thumb-add:hover { border-color: var(--color-primary); color: var(--color-primary); }
.photo-delete-btn {
  position: absolute; top: 4px; right: 4px;
  background: rgba(0,0,0,.5); color: #fff; border: none; border-radius: 50%;
  width: 22px; height: 22px; font-size: .75rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

.interests-grid {
  display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem;
}
.interest-toggle {
  padding: .375rem 1rem; border-radius: var(--radius-pill);
  border: 1.5px solid var(--color-border);
  background: none; cursor: pointer; font-size: .875rem; font-weight: 500;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}
.interest-toggle.selected {
  border-color: var(--color-primary); background: var(--color-primary-lt); color: var(--color-primary);
}

.settings-form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem;
}
.settings-form-grid .form-group { margin-bottom: 0; min-width: 0; }
.settings-form-full { grid-column: 1 / -1; }

.settings-save-bottom {
  display: flex; justify-content: flex-end; padding: 1rem 0 .5rem;
}

/* ═══════════════════════════════════════════════════════════════
   MATCH OVERLAY
   ═══════════════════════════════════════════════════════════════ */
#match-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(108,99,255,.92);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px);
  animation: fadeIn .4s ease;
}
#match-overlay.hidden { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.match-overlay-inner {
  text-align: center; color: #fff; padding: 2rem 1.5rem;
  animation: popIn .5s cubic-bezier(.34,1.56,.64,1);
}
@keyframes popIn { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: scale(1); } }

.match-title  { font-size: 2.25rem; font-weight: 800; margin-bottom: .5rem; }
.match-sub    { font-size: 1.125rem; opacity: .9; margin-bottom: 2rem; }
.match-photos { display: flex; align-items: center; justify-content: center; gap: -1rem; margin-bottom: 2rem; }
.match-photo  {
  width: 100px; height: 100px; border-radius: 50%; border: 4px solid #fff;
  object-fit: cover; overflow: hidden; background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center; font-size: 2.5rem;
}
.match-photo + .match-photo { margin-left: -1.5rem; }
.match-heart  { font-size: 2rem; margin: 0 .5rem; }
.match-overlay-actions { display: flex; flex-direction: column; gap: .875rem; align-items: center; }
.match-overlay-actions .btn-primary {
  background: #fff; color: var(--color-primary); min-width: 220px;
}
.match-overlay-actions .btn-outline {
  color: #fff; border-color: rgba(255,255,255,.6); min-width: 220px;
}
.match-overlay-actions .btn-outline:hover { background: rgba(255,255,255,.15); }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — mobile
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
  #sidebar   { transform: translateX(-100%); }
  #sidebar.open { transform: translateX(0); }
  #app-main  { margin-left: 0; padding-bottom: var(--mobile-nav-h); }
  #mobile-nav { display: flex; }

  .view-section { padding: 1rem; }
  .card-stack { width: 100%; max-width: 340px; height: 520px; }
  .swap-card-photo { height: 300px; }
  .profile-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .photo-grid { grid-template-columns: repeat(3, 1fr); }
  .chat-messages { padding: .75rem 1rem; }
  .chat-input-area { padding: .75rem 1rem; }
  .view-header { flex-wrap: nowrap; gap: .5rem; }
  .view-header h1 { font-size: 1.25rem; min-width: 0; }
  .discover-mode-toggle { flex-shrink: 0; padding: 2px; }
  .dmode-btn { padding: .3rem .7rem; font-size: .78rem; }
  .settings-section { padding: 1.25rem; }
  .settings-form-grid { grid-template-columns: 1fr; }
}

/* ── Confirm modal ─────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1100;
  display: flex; align-items: center; justify-content: center; padding: 1.5rem;
  background: rgba(17,17,27,.55); backdrop-filter: blur(3px);
  animation: fadeIn .15s ease;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: var(--color-surface); border-radius: var(--radius-md);
  box-shadow: var(--shadow-md); padding: 1.75rem; width: min(92vw, 380px);
  animation: popIn .2s cubic-bezier(.34,1.56,.64,1);
}
.modal-title { font-size: 1.2rem; font-weight: 700; margin: 0 0 .5rem; }
.modal-text  { color: var(--color-muted); margin: 0 0 1.5rem; line-height: 1.5; }
.modal-actions { display: flex; justify-content: flex-end; gap: .75rem; }
.modal-actions .btn-primary, .modal-actions .btn-outline, .modal-actions .btn-danger { padding: .55rem 1.25rem; font-size: .9rem; width: auto; }

/* Sidebar overlay on mobile */
.sidebar-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 99;
}
.sidebar-overlay.visible { display: block; }

/* ═══════════════════════════════════════════════════════════════
   ONLINE PRESENCE
   ═══════════════════════════════════════════════════════════════ */
.online-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: var(--color-success, #22c55e); flex-shrink: 0;
  box-shadow: 0 0 0 2px var(--color-surface, #fff);
}
.online-eyebrow {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .75rem; font-weight: 700; letter-spacing: .02em;
  color: var(--color-success, #16a34a); text-transform: uppercase;
}
.avatar-wrap { position: relative; display: inline-block; flex-shrink: 0; }
.avatar-dot { position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; }

/* ═══════════════════════════════════════════════════════════════
   DISCOVER — Swap/Connect toggle
   ═══════════════════════════════════════════════════════════════ */
.discover-mode-toggle {
  display: inline-flex; background: var(--color-border); border-radius: var(--radius-pill);
  padding: 3px; gap: 2px;
}
.dmode-btn {
  appearance: none; border: none; background: none; cursor: pointer;
  font-family: var(--font-main); font-size: .875rem; font-weight: 600;
  color: var(--color-muted); padding: .4rem 1.1rem; border-radius: var(--radius-pill);
  transition: background var(--transition), color var(--transition);
}
.dmode-btn.active { background: var(--color-surface); color: var(--color-primary); box-shadow: var(--shadow-sm); }

.discover-header-right { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; justify-content: flex-end; }
.discover-header-actions { display: flex; align-items: center; gap: .5rem; }
.swap-toolbar { display: flex; justify-content: flex-end; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.auto-badge {
  background: var(--color-success, #22c55e); color: #fff;
  padding: .25rem .75rem; border-radius: 999px; font-size: .8125rem; font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════
   MEDIA CONTROL BUTTONS (shared by connect + calls)
   ═══════════════════════════════════════════════════════════════ */
.media-btn {
  width: 52px; height: 52px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,.18); color: #fff; font-size: 1.25rem;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(6px); transition: background var(--transition), transform var(--transition);
}
.media-btn:hover { background: rgba(255,255,255,.3); transform: translateY(-2px); }
.media-btn.off   { background: var(--color-danger, #ef4444); }
.media-btn.hangup { background: var(--color-danger, #ef4444); }

/* ═══════════════════════════════════════════════════════════════
   CONNECT MODE — live video matchmaking
   ═══════════════════════════════════════════════════════════════ */
.connect-stage {
  position: relative; width: 100%; max-width: 720px; margin: 0 auto;
  aspect-ratio: 3 / 4; max-height: 70vh; background: #11111b;
  border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-md);
}
.connect-remote {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #11111b;
}
.connect-local {
  position: absolute; right: 12px; bottom: 96px; width: 110px; height: 150px;
  object-fit: cover; border-radius: var(--radius-sm); border: 2px solid rgba(255,255,255,.7);
  background: #000; z-index: 3; box-shadow: var(--shadow-md);
}
.connect-status {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem;
  color: #fff; text-align: center; padding: 1rem;
  background: radial-gradient(circle at center, rgba(108,99,255,.25), rgba(17,17,27,.85));
}
.connect-status.hidden { display: none; }
.connect-peer-eyebrow {
  position: absolute; top: 14px; left: 14px; z-index: 3;
  background: rgba(0,0,0,.45); padding: .35rem .7rem; border-radius: 999px; color: #fff;
}
.connect-peer-eyebrow.hidden { display: none; }
.connect-controls {
  position: absolute; left: 0; right: 0; bottom: 14px; z-index: 4;
  display: flex; flex-direction: column; align-items: center; gap: .75rem;
}
.connect-controls.hidden { display: none; }
.connect-controls-row { display: flex; align-items: center; justify-content: center; gap: 1.25rem; }
.connect-controls-row.secondary .media-btn { width: 44px; height: 44px; font-size: 1.05rem; }

/* ═══════════════════════════════════════════════════════════════
   CHAT — call buttons, incoming banner, call overlay
   ═══════════════════════════════════════════════════════════════ */
/* Global incoming-call overlay */
#incoming-call-overlay {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
  background: rgba(17,17,27,.6); backdrop-filter: blur(4px);
}
#incoming-call-overlay.hidden { display: none; }
.incoming-call-card {
  background: var(--color-surface); border-radius: var(--radius-md); box-shadow: var(--shadow-md);
  padding: 2rem 1.75rem; width: min(90vw, 340px); text-align: center;
}
.incoming-call-avatar {
  width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 1rem;
  background: var(--color-primary); color: #fff; font-size: 2.25rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; animation: pulse-ring 1.4s ease-out infinite;
}
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 rgba(108,99,255,.5); } 100% { box-shadow: 0 0 0 18px rgba(108,99,255,0); } }
.incoming-call-name { font-size: 1.25rem; font-weight: 700; }
.incoming-call-sub  { color: var(--color-muted); margin-bottom: 1.5rem; }
.incoming-call-actions { display: flex; gap: 1rem; justify-content: center; }
.btn-call-accept, .btn-call-decline {
  border: none; cursor: pointer; padding: .7rem 1.5rem; border-radius: var(--radius-pill);
  font-family: var(--font-main); font-weight: 600; font-size: .95rem; color: #fff;
}
.btn-call-accept  { background: var(--color-success, #22c55e); }
.btn-call-decline { background: var(--color-danger, #ef4444); }

#view-chat { position: relative; }
.chat-call-actions { display: flex; gap: .25rem; margin-left: auto; }
.chat-call-btn {
  width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--color-primary-lt); color: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), color var(--transition);
}
.chat-call-btn:hover { background: var(--color-primary); color: #fff; }

.incoming-call {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .75rem 1rem; background: var(--color-primary-lt);
  border-bottom: 1px solid var(--color-border); flex-wrap: wrap;
}
.incoming-call.hidden { display: none; }
.incoming-actions { display: flex; gap: .5rem; }
.incoming-actions .btn-primary, .incoming-actions .btn-outline { padding: .4rem 1rem; font-size: .85rem; }

.call-overlay {
  position: absolute; inset: 0; z-index: 50; background: #11111b; overflow: hidden;
}
.call-overlay.hidden { display: none; }
.call-remote { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #11111b; }
.call-local {
  position: absolute; right: 12px; bottom: 100px; width: 110px; height: 150px;
  object-fit: cover; border-radius: var(--radius-sm); border: 2px solid rgba(255,255,255,.7);
  background: #000; z-index: 3; box-shadow: var(--shadow-md);
}
.call-avatar {
  position: absolute; inset: 0; margin: auto; width: 110px; height: 110px; border-radius: 50%;
  display: none; align-items: center; justify-content: center;
  background: var(--color-primary); color: #fff; font-size: 2.75rem; font-weight: 700;
}
.call-overlay.audio-only .call-remote { display: none; }
.call-overlay.audio-only .call-local  { display: none; }
.call-overlay.audio-only .call-avatar { display: flex; }
.call-status {
  position: absolute; top: 18px; left: 0; right: 0; z-index: 4; text-align: center;
  color: #fff; font-weight: 600; text-shadow: 0 1px 4px rgba(0,0,0,.5);
}
.call-controls {
  position: absolute; left: 0; right: 0; bottom: 18px; z-index: 4;
  display: flex; align-items: center; justify-content: center; gap: 1rem;
}

@media (max-width: 767px) {
  .connect-stage { max-height: none; height: calc(100vh - var(--mobile-nav-h) - 130px); aspect-ratio: auto; }
  .connect-local, .call-local { width: 84px; height: 116px; }
}

/* ═══════════════════════════════════════════════════════════════
   Messaging
   ═══════════════════════════════════════════════════════════════ */

/* ── Discover: message a profile without matching ───────────────── */
/* margin-top:auto pins the composer to the bottom of the flex-column card,
   whatever the length of the bio/interests above it. */
.swap-composer {
  display: flex; align-items: center; gap: .5rem;
  margin-top: auto;
  padding-top: 1.25rem;
}
.swap-composer-input {
  flex: 1; min-width: 0;
  padding: .625rem .875rem;
  border: 1px solid var(--color-border); border-radius: var(--radius-pill);
  background: var(--color-bg); font-size: .9375rem; color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.swap-composer-input:focus {
  outline: none; border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-lt);
}
.swap-composer-send {
  flex-shrink: 0;
  width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-primary); color: #fff;
  transition: transform .15s, opacity .15s;
}
.swap-composer-send:hover:not(:disabled) { transform: scale(1.06); }
.swap-composer-send:disabled { opacity: .55; cursor: default; }

.swap-composer-status {
  margin-top: .5rem; font-size: .8125rem; text-align: center;
}
.swap-composer-status.success { color: var(--color-success, #059669); }
.swap-composer-status.error   { color: var(--color-danger, #dc2626); }

/* ── My Messages: conversation list ─────────────────────────────── */
.msg-list { display: flex; flex-direction: column; gap: .75rem; }

.msg-item {
  background: var(--color-surface); border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm); padding: 1rem 1.25rem;
  display: flex; align-items: center; gap: 1rem; cursor: pointer;
  border-left: 3px solid transparent;
  transition: box-shadow var(--transition), transform var(--transition);
}
.msg-item:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.msg-item:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

/* Unread: highlighted until the chat is opened. */
.msg-item.unread {
  background: var(--color-primary-lt);
  border-left-color: var(--color-primary);
}
.msg-item.unread .msg-name,
.msg-item.unread .msg-preview { font-weight: 700; color: var(--color-text); }

.msg-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--color-primary-lt); object-fit: cover; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.375rem; overflow: hidden;
}
.msg-body { flex: 1; min-width: 0; }

.msg-row-top {
  display: flex; align-items: baseline; justify-content: space-between; gap: .5rem;
  margin-bottom: .2rem;
}
.msg-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-time { font-size: .75rem; color: var(--color-muted); flex-shrink: 0; }

.msg-row-bottom { display: flex; align-items: center; gap: .375rem; }
.msg-preview {
  flex: 1; min-width: 0;
  color: var(--color-muted); font-size: .875rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Direction of the last message. */
.msg-dir { display: inline-flex; align-items: center; flex-shrink: 0; }
.msg-dir.sent     { color: var(--color-muted); }
.msg-dir.received { color: var(--color-primary); }

.msg-unread-badge {
  flex-shrink: 0;
  background: var(--color-accent); color: #fff;
  font-size: .6875rem; font-weight: 700;
  padding: .1rem .4rem; border-radius: var(--radius-pill);
  min-width: 18px; text-align: center;
}

/* ── Chat: lazy-loaded history ──────────────────────────────────── */
.chat-older-spinner { display: flex; justify-content: center; padding: .75rem 0; }
.chat-start-note {
  text-align: center; font-size: .75rem; color: var(--color-muted);
  padding: .75rem 0; margin-bottom: .25rem;
}

@media (max-width: 640px) {
  .msg-item { padding: .875rem 1rem; gap: .75rem; }
  .msg-avatar { width: 44px; height: 44px; font-size: 1.125rem; }
}
