/* ─── Variables ──────────────────────────────────────────────────────────── */
:root {
  --bg:         #0a0a0a;
  --panel:      #111111;
  --panel-2:    #1a1a1a;
  --border:     #252525;
  --text:       #f2f2f2;
  --muted:      #888888;
  --accent:     #FFE500;
  --accent-dim: #b8a500;
  --danger:     #ff4444;
  --success:    #22c55e;
  --radius:     16px;
  --radius-sm:  8px;
  --nav-h:      60px;
  --transition: 0.2s ease;
}

/* ─── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  min-height: 100dvh;
  overscroll-behavior: none;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }
button, input, select, textarea {
  font: inherit;
  color: inherit;
}
select { appearance: none; }

/* ─── Nav ────────────────────────────────────────────────────────────────── */
.nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: var(--panel);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  z-index: 100;
}
.nav-logo {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: 0.05em;
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.nav-logo-sub {
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 600;
}
.nav-links {
  display: flex;
  gap: 0.25rem;
}
.nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 500;
  transition: color var(--transition);
  text-decoration: none;
}
.nav-link svg { width: 22px; height: 22px; }
.nav-link:hover, .nav-link.active { color: var(--accent); text-decoration: none; }
.nav-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--accent);
  color: #000;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
  text-decoration: none;
}
.btn-primary:hover { opacity: 0.9; text-decoration: none; color: #000; }
.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color var(--transition);
  text-decoration: none;
}
.btn-secondary:hover { border-color: var(--muted); text-decoration: none; color: var(--text); }

.btn-danger-link {
  display: inline-flex;
  align-items: center;
  color: var(--danger);
  font-size: 0.85rem;
  padding: 0.5rem;
  text-decoration: none;
}
.btn-danger-link:hover { text-decoration: underline; color: var(--danger); }

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: #fff;
  color: #1f1f1f;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: opacity var(--transition);
  text-decoration: none;
  width: 100%;
}
.btn-google:hover { opacity: 0.95; text-decoration: none; color: #1f1f1f; }

.btn-contact {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent);
  color: #000;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: opacity var(--transition);
  min-width: 0;
}
.btn-contact svg { flex-shrink: 0; }
.btn-contact span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-contact:hover { opacity: 0.9; text-decoration: none; color: #000; }

/* ─── Alerts ─────────────────────────────────────────────────────────────── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
.alert-error {
  background: rgba(255,68,68,0.12);
  border: 1px solid rgba(255,68,68,0.3);
  color: #ff8888;
}

/* ─── Login Page ─────────────────────────────────────────────────────────── */
.login-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  gap: 2rem;
}
.login-hero { text-align: center; }
.login-logo {
  font-size: 3rem;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: 0.06em;
  line-height: 1;
}
.login-tagline {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin-top: 0.25rem;
}
.login-desc {
  color: var(--muted);
  font-size: 1rem;
  max-width: 320px;
  margin: 1rem auto 0;
  line-height: 1.5;
}
.login-card {
  width: 100%;
  max-width: 340px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.login-hint {
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}
.login-features {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}
.feature {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.feature-icon { font-size: 1rem; }

/* ─── Swipe Page ─────────────────────────────────────────────────────────── */
.swipe-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 1rem calc(var(--nav-h) + 1rem);
  min-height: 100dvh;
}

#swipe-deck {
  position: relative;
  width: 100%;
  max-width: 400px;
  height: calc(100dvh - var(--nav-h) - 100px - 2rem);
  min-height: 480px;
}

/* ─── Swipe Card ─────────────────────────────────────────────────────────── */
.card {
  position: absolute;
  inset: 0;
  background: var(--panel-2);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: grab;
  touch-action: none;
  user-select: none;
  transform-origin: 50% 110%;
  will-change: transform;
  transition: box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}
.card:active { cursor: grabbing; }

.card-photo {
  position: relative;
  flex: 0 0 52%;
  background: var(--panel);
  overflow: hidden;
}
.card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  font-weight: 900;
  color: var(--accent);
  background: var(--panel);
}
.card-gradient {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: linear-gradient(to top, var(--panel-2) 0%, transparent 100%);
  pointer-events: none;
}

/* Like/Pass overlays */
.card-like-overlay, .card-pass-overlay {
  position: absolute;
  top: 1.25rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  opacity: 0;
  pointer-events: none;
  border: 3px solid;
  transition: opacity 0.1s;
}
.card-like-overlay {
  left: 1.25rem;
  color: var(--success);
  border-color: var(--success);
  transform: rotate(-15deg);
}
.card-pass-overlay {
  right: 1.25rem;
  color: var(--danger);
  border-color: var(--danger);
  transform: rotate(15deg);
}

.card-content {
  padding: 1rem 1.1rem 1.1rem;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: none;
}
.card-content::-webkit-scrollbar { display: none; }

.card-name {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.card-age-group {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: rgba(255,229,0,0.12);
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  white-space: nowrap;
}
.card-location {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  white-space: nowrap;
}
.tag-accent {
  background: rgba(255,229,0,0.1);
  border-color: rgba(255,229,0,0.3);
  color: var(--accent);
}
.tag-pace {
  background: rgba(34,197,94,0.1);
  border-color: rgba(34,197,94,0.3);
  color: var(--success);
}

.card-workouts {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.6rem;
}
.workout-tag {
  font-size: 0.78rem;
  color: var(--muted);
}
.workout-strong { color: var(--success); }
.workout-weak   { color: var(--danger); }

.card-bio {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

/* Stacked cards effect */
.card:nth-last-child(2) {
  transform: scale(0.97) translateY(8px);
  opacity: 0.7;
  pointer-events: none;
}
.card:nth-last-child(3) {
  transform: scale(0.94) translateY(16px);
  opacity: 0.4;
  pointer-events: none;
}
.card:nth-last-child(n+4) {
  display: none;
}

/* ─── Action bar ─────────────────────────────────────────────────────────── */
#action-bar {
  display: flex;
  gap: 2rem;
  justify-content: center;
  align-items: center;
  padding: 1rem 0;
  margin-top: 0.5rem;
}
.action-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition), opacity var(--transition);
}
.action-btn:active { transform: scale(0.92); }
.action-btn svg { width: 26px; height: 26px; }

.action-pass {
  background: var(--panel-2);
  border: 2px solid var(--border);
  color: var(--danger);
}
.action-pass:hover { border-color: var(--danger); }

.action-like {
  background: var(--accent);
  color: #000;
  width: 70px;
  height: 70px;
}
.action-like:hover { opacity: 0.9; }

/* ─── Empty State / Spinner ──────────────────────────────────────────────── */
.empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-align: center;
  padding: 2rem;
}
.empty-icon { font-size: 3rem; }
.empty-state h2 { font-size: 1.2rem; }
.empty-state p { color: var(--muted); font-size: 0.9rem; }

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Match Modal ────────────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(4px);
}
.modal-box {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2rem 1.5rem;
  text-align: center;
  width: 100%;
  max-width: 340px;
  animation: pop-in 0.35s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes pop-in {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}
.modal-spark {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  animation: pulse 1s ease infinite alternate;
}
@keyframes pulse {
  from { transform: scale(1); }
  to   { transform: scale(1.15); }
}
.modal-title {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--accent);
  margin-bottom: 1rem;
}
.modal-avatars {
  display: flex;
  justify-content: center;
  gap: -1rem;
  margin-bottom: 1rem;
}
.modal-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
}
.modal-avatar + .modal-avatar { margin-left: -16px; }
.modal-name {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}
.modal-email {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}
.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ─── Profile Page ───────────────────────────────────────────────────────── */
.profile-page, .matches-page {
  padding: 1.5rem 1rem calc(var(--nav-h) + 1.5rem);
  max-width: 560px;
  margin: 0 auto;
}
.profile-header-create {
  text-align: center;
  padding: 1rem 0 1.5rem;
}
.profile-header-create h1 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0.5rem 0 0.25rem;
}
.profile-header-create p {
  color: var(--muted);
  font-size: 0.9rem;
}

.page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-top: 0.5rem;
}
.page-header h1 { font-size: 1.4rem; font-weight: 700; }

.form-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1rem;
  margin-bottom: 1rem;
}
.form-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 0.85rem;
}

.form-group {
  margin-bottom: 0.85rem;
}
.form-group:last-child { margin-bottom: 0; }
.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.label-hint {
  font-weight: 400;
  color: var(--border);
}
.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
  border-color: var(--danger);
}
.form-error {
  display: block;
  font-size: 0.78rem;
  color: var(--danger);
  margin-top: 0.25rem;
}

input[type="text"],
input[type="email"],
input[type="file"],
select,
textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  font-size: 0.9rem;
  color: var(--text);
  transition: border-color var(--transition);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
}
input[type="file"] {
  padding: 0.65rem 0.75rem;
  cursor: pointer;
}
input[type="file"]::file-selector-button {
  margin-right: 0.75rem;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23888' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}
textarea { resize: vertical; min-height: 80px; }

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text);
}
.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.char-count {
  display: block;
  text-align: right;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.profile-avatar-preview {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 0.6rem;
}

.profile-avatar-image {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.profile-avatar-help {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
  padding-bottom: 1rem;
}

/* ─── Matches Page ───────────────────────────────────────────────────────── */
.match-count {
  font-size: 0.82rem;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
}

.matches-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.match-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.match-photo {
  width: 100%;
  height: 200px;
  background: var(--panel-2);
  flex-shrink: 0;
}
.match-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}
.match-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  font-weight: 900;
  color: var(--accent);
}
.match-info {
  padding: 1.1rem 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.match-name { font-size: 1.15rem; font-weight: 700; }
.match-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.match-location {
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.match-stats {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  background: var(--panel-2);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
}
.match-stat {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.stat-label { font-size: 0.68rem; color: var(--muted); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.stat-value { font-size: 1rem; font-weight: 700; color: var(--accent); }
.match-workouts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.match-bio {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}
.match-contact { margin-top: 0.25rem; }
.match-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.25rem;
}
.match-date { font-size: 0.75rem; color: var(--muted); }
.match-actions { display: flex; align-items: center; gap: 1rem; }
.btn-chat {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--accent);
  color: #000;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  text-decoration: none;
  transition: opacity 0.2s;
}
.btn-chat:hover { opacity: 0.85; }

/* ─── Nav badge ─────────────────────────────────────────────────────────── */
.nav-icon-wrap { position: relative; display: inline-flex; }
.nav-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  background: var(--danger);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

/* ─── Chat page ─────────────────────────────────────────────────────────── */
.chat-page {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - var(--nav-h));
  max-width: 680px;
  margin: 0 auto;
}

/* Mobile: fix input bar above the bottom nav */
@media (max-width: 599px) {
  .chat-input-bar {
    position: fixed;
    bottom: var(--nav-h);
    left: 0;
    right: 0;
    z-index: 50;
  }
  .chat-messages {
    padding-bottom: 80px;
  }
}
.chat-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  flex-shrink: 0;
}
.chat-back {
  color: var(--muted);
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: color 0.2s;
}
.chat-back:hover { color: var(--text); }
.chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.chat-avatar-placeholder {
  background: var(--accent);
  color: #000;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-header-info { display: flex; flex-direction: column; }
.chat-name { font-weight: 700; font-size: 0.95rem; color: var(--text); }
.chat-location { font-size: 0.75rem; color: var(--muted); }
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.chat-bubble {
  display: flex;
  flex-direction: column;
  max-width: 75%;
}
.chat-bubble-mine  { align-self: flex-end; align-items: flex-end; }
.chat-bubble-theirs { align-self: flex-start; align-items: flex-start; }
.bubble-text {
  padding: 0.55rem 0.85rem;
  border-radius: 18px;
  font-size: 0.92rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-bubble-mine .bubble-text {
  background: var(--accent);
  color: #000;
  border-bottom-right-radius: 4px;
}
.chat-bubble-theirs .bubble-text {
  background: var(--panel-2);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.bubble-time {
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 0.2rem;
  padding: 0 0.25rem;
}
.chat-input-bar {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--panel);
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.6rem 1rem;
  color: var(--text);
  font-size: 0.92rem;
  resize: none;
  line-height: 1.4;
  max-height: 120px;
  overflow-y: auto;
  font-family: inherit;
}
.chat-input:focus { outline: none; border-color: var(--accent); }
.chat-send {
  background: var(--accent);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #000;
  flex-shrink: 0;
  transition: opacity 0.2s;
}
.chat-send:hover { opacity: 0.85; }
.chat-send:disabled { opacity: 0.4; cursor: default; }
.match-photo { position: relative; }
.photo-actions {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  flex-direction: row;
  gap: 0.35rem;
  opacity: 0;
  transition: opacity 0.2s;
}
.match-card:hover .photo-actions { opacity: 1; }
.photo-btn {
  background: rgba(0,0,0,0.55);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}
.photo-btn:hover { background: rgba(0,0,0,0.85); }
.photo-btn-danger:hover { background: var(--danger); }
.photo-btn:disabled { opacity: 0.4; cursor: default; }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (min-width: 600px) {
  .nav { top: 0; bottom: auto; border-top: none; border-bottom: 1px solid var(--border); }
  .swipe-page, .profile-page, .matches-page {
    padding-top: calc(var(--nav-h) + 1.5rem);
    padding-bottom: 2rem;
  }
  .chat-page {
    height: calc(100dvh - var(--nav-h));
    padding-top: var(--nav-h);
  }
  #swipe-deck {
    height: calc(100dvh - var(--nav-h) - 100px - 2rem);
  }
}

@media (min-width: 860px) {
  .matches-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}
