:root {
  --coral: #ff5a73;
  --coral-dark: #e14361;
  --cream: #fff8f5;
  --plum: #2e1f27;
  --gray: #8a7a80;
  --border: #f0e0e2;
  --success: #2f9e6b;
  --radius: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--plum);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  box-shadow: 0 0 40px rgba(0,0,0,0.05);
}

header.topbar {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

header.topbar .logo {
  font-weight: 800;
  font-size: 22px;
  color: var(--coral-dark);
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}
header.topbar .logo img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.view { display: none; flex: 1; padding: 20px; overflow-y: auto; }
.view.active { display: flex; flex-direction: column; }

h1, h2 { margin: 0 0 8px; }
p.subtitle { color: var(--gray); margin: 0 0 20px; font-size: 14px; }

label { font-size: 13px; font-weight: 600; margin-top: 14px; margin-bottom: 4px; display: block; }

input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 15px;
  background: var(--cream);
}

textarea { min-height: 80px; resize: vertical; }

.btn {
  border: none;
  border-radius: 999px;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 16px;
}

.btn-primary { background: var(--coral); color: white; }
.btn-primary:active { background: var(--coral-dark); }
.btn-secondary { background: var(--border); color: var(--plum); }
.btn-link { background: none; color: var(--coral-dark); padding: 8px; }

.photo-picker { display: flex; align-items: center; gap: 12px; }
.photo-preview {
  width: 64px; height: 64px; border-radius: 50%;
  object-fit: cover; background: var(--border); flex-shrink: 0;
}

.error { color: #c0392b; font-size: 13px; margin-top: 8px; }
.hint { color: var(--gray); font-size: 12px; margin-top: 4px; }

.checkbox-row { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.checkbox-row input { width: auto; }

/* Discover / swipe cards */
.card-stack { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; }
.profile-card {
  width: 100%;
  border-radius: var(--radius);
  background: var(--cream);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.profile-card .photo {
  height: 320px;
  background-size: cover;
  background-position: center;
  background-color: #eee;
  display: flex; align-items: flex-end;
}
.profile-card .info { padding: 16px; }
.profile-card .name-age { font-size: 20px; font-weight: 800; }
.profile-card .meta { color: var(--gray); font-size: 13px; margin-top: 4px; }
.profile-card .badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.badge {
  background: #ffe8ec; color: var(--coral-dark);
  font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
}
.profile-card .bio { margin-top: 10px; font-size: 14px; }

.swipe-actions {
  display: flex; justify-content: center; gap: 20px; padding: 20px 0 4px;
}
.swipe-btn {
  width: 62px; height: 62px; border-radius: 50%;
  border: none; font-size: 26px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}
.swipe-btn.pass { background: white; color: #c0392b; }
.swipe-btn.like { background: var(--coral); color: white; }

.empty-state { text-align: center; color: var(--gray); margin-top: 60px; }

/* Matches list */
.match-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 4px; border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background-size: cover; background-position: center; background-color: #eee;
  flex-shrink: 0;
}
.match-item .match-name { font-weight: 700; }
.match-item .match-last { color: var(--gray); font-size: 13px; }

/* Chat */
.chat-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-bottom: 10px; }
.msg { max-width: 75%; padding: 10px 14px; border-radius: 16px; font-size: 14px; }
.msg.mine { align-self: flex-end; background: var(--coral); color: white; border-bottom-right-radius: 4px; }
.msg.theirs { align-self: flex-start; background: var(--border); border-bottom-left-radius: 4px; }
.chat-input-row { display: flex; gap: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.chat-input-row input { flex: 1; }
.chat-input-row .btn { margin-top: 0; padding: 12px 20px; }

nav.bottombar {
  display: flex; border-top: 1px solid var(--border);
}
nav.bottombar button {
  flex: 1; background: none; border: none; padding: 12px 0;
  font-size: 12px; font-weight: 600; color: var(--gray); cursor: pointer;
}
nav.bottombar button.active { color: var(--coral-dark); }
nav.bottombar .icon { display: block; font-size: 20px; margin-bottom: 2px; }

.install-banner {
  background: #fff0e8; border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; font-size: 13px; margin-bottom: 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.install-banner button { flex-shrink: 0; }