:root {
  --bg: #fafafa;
  --card: #ffffff;
  --border: #e2e2e2;
  --text: #1c1c1c;
  --muted: #6b6b6b;
  --accent: #b3475f;
  --accent-dark: #8f3049;
  --danger: #b33a3a;
  --ok: #2f7d4f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

nav {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 24px;
  background: #000;
  border-bottom: 1px solid var(--border);
}

nav a {
  color: #cfcfcf;
  text-decoration: none;
  font-size: 14px;
}

nav a.active, nav a:hover { color: #fff; }

.nav-brand { font-weight: 700; color: var(--accent-dark); letter-spacing: 0.5px; }
.nav-logo { height: 38px; display: block; border-radius: 4px; }

/* Standalone logo lockup for pages with no persistent nav bar (login,
   under-construction) - the logo image (livingtgr_logo.jpeg) is itself
   rendered on a dark backdrop, so this just gives it a seamless black
   frame instead of sitting oddly on the page's white background. */
.logo-block { display: inline-block; background: #000; padding: 14px 20px; border-radius: 10px; }
.logo-block img { display: block; height: 52px; }
.nav-spacer { flex: 1; }
.nav-email { color: #9a9a9a; font-size: 13px; }

main {
  max-width: 720px;
  margin: 32px auto;
  padding: 0 20px;
}

.center-page {
  max-width: 380px;
  margin: 80px auto;
  padding: 0 20px;
}

h1 { font-size: 22px; margin-bottom: 4px; }
h2 { font-size: 17px; margin-top: 28px; }
p.subtitle { color: var(--muted); margin-top: 0; margin-bottom: 24px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
}

label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin: 12px 0 4px;
}

input, textarea, select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}

textarea { min-height: 70px; resize: vertical; }

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.gallery-item { position: relative; width: 90px; height: 90px; border-radius: 8px; overflow: hidden; background: #eee; cursor: pointer; }
.gallery-item img, .gallery-item video { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }

.lightbox-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.85);
  z-index: 1000; align-items: center; justify-content: center;
}
.lightbox-overlay.open { display: flex; }
.lightbox-content { max-width: 90vw; max-height: 90vh; }
.lightbox-content img, .lightbox-content video { max-width: 90vw; max-height: 90vh; border-radius: 6px; }
.lightbox-close {
  position: absolute; top: 16px; right: 24px; background: none; border: none;
  color: white; font-size: 32px; cursor: pointer; line-height: 1; padding: 4px 10px;
}

.preview-banner {
  background: #fff4d6; border: 1px solid #e8c874; border-radius: 8px;
  padding: 10px 14px; margin-bottom: 16px; font-size: 14px;
}

.gallery-item .remove-btn {
  position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,0.6); color: white;
  border: none; border-radius: 50%; width: 20px; height: 20px; font-size: 12px; line-height: 1;
  cursor: pointer; padding: 0;
}

.avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: white;
  font-weight: 600;
  font-size: 18px;
}

button, .btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 9px 16px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  display: inline-block;
  text-decoration: none;
}

button:hover, .btn:hover { background: var(--accent-dark); }
button.secondary { background: #efefef; color: var(--text); }
button.secondary:hover { background: #e2e2e2; }
button:disabled { opacity: 0.5; cursor: default; }

.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

.error { color: var(--danger); font-size: 13px; margin-top: 10px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 6px; }
.tag { display: inline-block; background: #f1e4e8; color: var(--accent-dark); font-size: 11px; padding: 2px 8px; border-radius: 999px; margin: 2px 4px 2px 0; }

.match-card { display: flex; justify-content: space-between; align-items: center; }
.match-card .scores { font-size: 13px; color: var(--muted); }
.match-card .avatar, .match-card .avatar-fallback { width: 144px; height: 144px; font-size: 52px; }
.swipe-actions { display: flex; gap: 8px; }
.swipe-actions button { padding: 6px 12px; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 16px 0; }
.pagination button:disabled { opacity: 0.4; cursor: default; }
.pagination .page-info { font-size: 13px; color: var(--muted); }

.msg { max-width: 75%; padding: 8px 12px; border-radius: 10px; margin: 6px 0; font-size: 14px; }
.msg.mine { background: var(--accent); color: white; margin-left: auto; }
.msg.theirs { background: #eee; }

.insight-box { background: #fbf3f5; border: 1px solid #edd; border-radius: 8px; padding: 14px; margin-top: 10px; font-size: 14px; }
.insight-box .disclaimer { color: var(--danger); font-size: 12px; margin-bottom: 8px; }

.tabs { display: flex; gap: 4px; margin: 20px 0 8px; border-bottom: 1px solid var(--border); }
.tabs button { background: none; color: var(--muted); border-radius: 0; padding: 8px 14px; }
.tabs button.active { color: var(--accent); border-bottom: 2px solid var(--accent); }
.tabs button:hover { background: none; color: var(--accent); }

.other-input { margin-top: 6px; }

/* Profile-setup wizard step bar (see app.js's renderProfileSteps) */
#profile-steps { margin-bottom: 20px; }
.profile-steps-hub { display: inline-block; font-size: 13px; color: var(--muted); text-decoration: none; margin-bottom: 8px; }
.profile-steps-hub:hover { color: var(--accent); }
.profile-steps-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; }
.profile-step { color: var(--muted); text-decoration: none; font-size: 13px; padding: 4px 8px; border-radius: 6px; }
.profile-step:hover { color: var(--accent); }
.profile-step.active { color: white; background: var(--accent); font-weight: 600; }
.profile-step-sep { color: var(--border); font-size: 13px; }

/* "Rewrite with AI" button (see app.js's attachAiRewriteButton) - the row
   replaces the field's plain label with a label+button flex row; the
   status/undo line it also injects reuses .hint/.error as-is. */
.ai-rewrite-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 12px 0 0; }
.ai-rewrite-row label { margin: 0; }
.ai-rewrite-btn { font-size: 12.5px; padding: 5px 11px; }

/* Shared site footer (see app.js's renderFooter) - the important-links menu
   used on public/utility pages. landing.html has its own premium-styled
   footer instead (see its .lp-footer block) rather than this plain one. */
.site-footer { margin-top: 48px; padding: 28px 20px 30px; border-top: 1px solid var(--border); text-align: center; }
.site-footer .footer-menu { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; margin-bottom: 12px; }
.site-footer .footer-menu a { color: var(--muted); text-decoration: none; font-size: 13px; }
.site-footer .footer-menu a:hover { color: var(--accent); }
.site-footer .footer-copy { color: var(--muted); font-size: 12px; }
.site-footer .footer-copy .brand { color: var(--accent-dark); font-weight: 700; }

/* Profile-setup hub (profile.html) section cards */
.setup-section { display: flex; align-items: center; justify-content: space-between; padding: 14px 4px; border-bottom: 1px solid var(--border); }
.setup-section:last-child { border-bottom: none; }
.setup-section-label { font-size: 15px; }
.setup-section-status { font-size: 12px; margin-left: 10px; }
.setup-section-status.done { color: var(--ok); }
.setup-section-status.pending { color: var(--muted); }
.status-badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.status-badge.active { background: #e3f3e9; color: var(--ok); }
.status-badge.inactive { background: #f1e4e8; color: var(--accent-dark); }
