:root {
  --background: #F5F1ED;
  --foreground: #2B2723;
  --card: #FDFBF9;
  --muted: #D4C4B9;
  --input-bg: #EFE8E1;
  --coral: #E85D4A;
  --marigold: #E8A83C;
  --sage: #7DB88F;
  --destructive: #B03A2A;
  --border: #948578;
  --radius: 1.25rem;
  --radius-sm: 0.85rem;
  --radius-lg: 1.5rem;
  --shadow-soft: 0 8px 24px rgba(43, 39, 35, 0.08);
  --shadow-lift: 0 20px 48px rgba(43, 39, 35, 0.18);
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --muted-fg: #6E645C;
}

* { box-sizing: border-box; }

/* WebKit (Safari/Brave on iOS — Apple forces every iOS browser onto its
   engine) auto-boosts font sizes on mobile in some layouts, inflating the
   whole page well past what's actually set in CSS. This override is the
   standard fix — Chromium doesn't have the same quirk, which is why it
   never shows up testing in a desktop/Chromium browser. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

[hidden] { display: none !important; }

h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--background);
  color: var(--foreground);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  height: 100vh;
  height: 100dvh;
  background: var(--background);
  position: relative;
  box-shadow: 0 0 40px rgba(43, 39, 35, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.screen { display: none; flex: 1; flex-direction: column; min-height: 0; }
.screen.active { display: flex; }

/* ---------- Buttons ---------- */
.btn {
  cursor: pointer;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 22px;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease, background 0.12s ease;
}
.btn:active { transform: scale(0.97); }

/* Nearly every interactive element in this app is already a real <button>
   (tag choices, nav, action row, match rows, etc.), so one broad rule
   covers the keyboard-navigation floor instead of enumerating classes. */
button:focus-visible {
  outline: 3px solid var(--marigold);
  outline-offset: 2px;
}
.btn-primary {
  background: var(--foreground);
  color: var(--background);
  box-shadow: var(--shadow-soft);
}
.btn-primary:hover { background: #221E1A; }
/* Celebratory role — marigold fill, charcoal ink, 7.1:1. Reserved for the
   Like button, Send Woof, and the verification submit — the moments the
   brief names explicitly. Everyday primary actions stay .btn-primary. */
.btn-celebratory {
  background: var(--marigold);
  color: var(--foreground);
  box-shadow: var(--shadow-soft);
}
.btn-celebratory:hover { background: #D89830; }
.btn-secondary {
  background: var(--card);
  color: var(--foreground);
  border: 2px solid var(--foreground);
}
.btn-secondary:hover { background: var(--input-bg); }
/* Destructive role is outlined, not filled — matches .btn-secondary's
   shape, 5.8:1 with the darkened destructive red. */
.btn-danger {
  background: transparent;
  color: var(--destructive);
  border: 2px solid var(--destructive);
}
.btn-danger:hover { background: rgba(176, 58, 42, 0.08); }
.btn-block { width: 100%; }
.btn-icon {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--muted-fg);
  padding: 6px 10px;
  border-radius: 50%;
  /* 44px floor — was landing closer to 32px, below the recommended tap
     target size. */
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-icon:hover { background: var(--input-bg); }
/* previewMyProfile()'s labeled back button ("← Back to Editing") — the
   plain .btn-icon shape is a 44px circle sized for a single glyph, which
   breaks against a multi-word label; this widens it into a pill instead. */
#btn-view-profile-back.btn-view-profile-back-labeled {
  width: auto;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 14px;
  color: var(--foreground);
}
/* Logout used to be an icon-only ⎋ glyph — an ESC-key symbol most people
   have never seen, and no brand SVG covers "log out" either. A short text
   label is clearer than guessing at a new icon. */
/* Sizing for the hand-authored icon set (Filters, Settings, Logout, Pass,
   Save, Flag) — matches how the imported brand SVGs are sized elsewhere,
   just smaller since these sit in compact icon-only buttons. */
.ui-icon-svg { width: 20px; height: 20px; display: block; }
.btn-text {
  display: block;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--muted-fg);
  padding: 10px 0 0;
}
.btn-text:hover { color: var(--foreground); }

/* ---------- Auth Screen ---------- */
.auth-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 28px;
}
.logo { text-align: center; margin-bottom: 6px; }

/* Brand mark + wordmark lockup — see assets/logo/README.md for the source
   spec (gap, mark size, and wordmark tracking are all specified there;
   don't eyeball new values). */
.logo-lockup { display: flex; align-items: center; justify-content: center; gap: 16px; }
.logo-mark { width: 64px; height: 64px; flex-shrink: 0; }
.logo-wordmark {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 44px;
  letter-spacing: -0.05em;
  line-height: 0.86;
  color: var(--foreground);
}
.logo .logo-lockup { gap: 32px; }
.logo .logo-mark { width: 128px; height: 128px; }
.logo .logo-wordmark { font-size: 88px; }
.app-superlative {
  color: var(--marigold);
  margin-top: 10px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.tagline {
  color: var(--foreground);
  margin-top: 6px;
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.auth-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 24px;
}
.confirmed-banner {
  background: #E6F4EA;
  color: #1E7A34;
  border: 1px solid #1E7A34;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  padding: 10px 12px;
  margin: 0 0 16px;
}
.welcome-back-banner {
  background: var(--coral);
  color: var(--background);
  border: 1px solid var(--coral);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  padding: 10px 12px;
  margin: 0 0 16px;
}
.auth-tabs {
  display: flex;
  background: var(--input-bg);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 20px;
}
.auth-tab {
  flex: 1;
  border: none;
  background: none;
  padding: 10px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-weight: 700;
  cursor: pointer;
  color: var(--muted-fg);
}
.auth-tab.active {
  background: var(--card);
  color: var(--foreground);
  box-shadow: 0 2px 6px rgba(43, 39, 35, 0.1);
}
.auth-form { display: none; flex-direction: column; gap: 14px; }
.auth-form.active { display: flex; }
.otp-form { display: flex; flex-direction: column; gap: 14px; }

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  color: var(--muted-fg);
}
.hint { font-weight: 400; font-size: 12px; }

.system-wrap p { font-size: 14px; line-height: 1.5; color: var(--foreground); margin: 0 0 12px; }
.system-wrap p:last-child { margin-bottom: 0; }
.faq-item { margin-bottom: 16px; }
.faq-item:last-child { margin-bottom: 0; }
.faq-question { font-weight: 700; color: var(--foreground); margin: 0 0 4px; font-size: 14px; }
.faq-item p:not(.faq-question) { color: var(--muted-fg); }
.system-wrap .settings-section { margin-bottom: 16px; }
#btn-system-notifications, #btn-system-account { margin-top: 10px; }

.location-detect-btn {
  align-self: flex-start;
  padding: 0;
  border: none;
  background: none;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  color: var(--foreground);
  cursor: pointer;
}
.location-detect-btn:hover { text-decoration: underline; }

.password-field { position: relative; }
.password-field input { width: 100%; padding-right: 44px; }
.password-toggle-btn {
  position: absolute;
  top: 50%;
  right: 2px;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.password-toggle-btn .ui-icon-svg { width: 20px; height: 20px; }

input, textarea, select {
  font-family: var(--font-sans);
  /* 16px is the iOS Safari threshold below which focusing an input
     triggers an automatic page zoom that doesn't reliably reset —
     exactly the "zooms in and cuts off the sides" symptom. */
  font-size: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  background: var(--input-bg);
  color: var(--foreground);
  outline: none;
  resize: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--foreground);
  box-shadow: 0 0 0 3px rgba(232, 168, 60, 0.25);
}

.form-error {
  color: var(--destructive);
  font-size: 13px;
  min-height: 16px;
  margin: -6px 0 0;
  font-weight: 600;
}

/* ---------- Onboarding Wizard ---------- */
.onboarding-wrap {
  padding: 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}
.onboarding-progress { margin-bottom: 24px; }
.onboarding-progress-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--input-bg);
  overflow: hidden;
}
.onboarding-progress-fill {
  height: 100%;
  background: var(--marigold);
  border-radius: 999px;
  transition: width 0.2s ease;
}
.onboarding-progress-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted-fg);
  margin: 8px 0 0;
}
.onboarding-step { display: flex; flex-direction: column; gap: 16px; flex: 1; }
.onboarding-step h2 {
  font-family: var(--font-sans);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 4px;
  color: var(--foreground);
  font-size: 26px;
}
.onboarding-photo-preview {
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  overflow: hidden;
  margin-bottom: 4px;
}
.onboarding-photo-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.radio-choice-group { display: flex; gap: 20px; }
.radio-choice {
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  color: var(--foreground) !important;
}
.radio-choice input[type="radio"] { width: auto; padding: 0; accent-color: var(--foreground); }
.looking-for-choice-group { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.looking-for-choice {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  color: var(--foreground);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.looking-for-choice:has(input:checked) { border-color: var(--foreground); background: var(--input-bg); }
.looking-for-choice input[type="radio"] { width: auto; padding: 0; accent-color: var(--foreground); }

.onboarding-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 20px;
}
.onboarding-actions .btn-text { width: auto; flex-shrink: 0; padding: 14px 4px; }
.onboarding-actions .btn { flex: 1; }
.onboarding-actions .btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Setup Screen ---------- */
.setup-wrap { padding: 28px; overflow-y: auto; flex: 1; min-height: 0; }
.setup-wrap h2 {
  font-family: var(--font-sans);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 4px;
  color: var(--foreground);
  font-size: 28px;
}
.subtle { color: var(--muted-fg); margin: 0 0 20px; font-size: 15px; }

.setup-form { display: flex; flex-direction: column; gap: 16px; padding-bottom: 40px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
/* Grid items default to min-width:auto, so a text input's intrinsic width
   can push its column wider than the 1fr track on narrow screens — the
   overflow then gets silently clipped by an ancestor's overflow:hidden
   instead of scrolling. min-width:0 lets them actually shrink to fit. */
.grid-2 > * { min-width: 0; }

.avatar-picker { text-align: center; margin-bottom: 4px; }
.avatar-preview {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--muted);
  font-size: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  border: 3px solid var(--card);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

#photo-avatar-hint, #emoji-fallback-hint { text-align: center; margin: 0 0 8px; }

.park-suggestions {
  margin-top: 8px;
  max-height: 240px;
  overflow-y: auto;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
}
.park-suggestion-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: none;
  cursor: pointer;
  font-family: var(--font-sans);
}
.park-suggestion-item:last-child { border-bottom: none; }
.park-suggestion-item:hover { background: var(--input-bg); }
.park-suggestion-name { display: block; font-size: 14px; font-weight: 700; color: var(--foreground); }
.park-suggestion-suburb { display: block; font-size: 12px; color: var(--muted-fg); }
.park-suggestions-empty { padding: 12px 14px; font-size: 13px; color: var(--muted-fg); }

.park-selected-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(232, 93, 74, 0.1);
  border: 1.5px solid var(--coral);
  font-size: 14px;
  font-weight: 700;
  color: var(--foreground);
}
.park-selected-chip button {
  border: none;
  background: none;
  color: var(--foreground);
  font-size: 15px;
  cursor: pointer;
  /* 44px tap target without growing the compact chip itself — the added
     padding is offset by an equal negative margin, so the glyph stays put
     and the chip's own layout is unaffected. */
  padding: 14px;
  margin: -14px;
}

.breed-mode-toggle { display: flex; gap: 8px; margin-bottom: 8px; }

.mixed-breed-building {
  margin-top: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mixed-breed-building .hint { margin: 0; }
#mixed-breed-preview { font-weight: 700; color: var(--foreground); }

.breed-chip-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.breed-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 6px 6px 12px;
  border-radius: 999px;
  background: rgba(232, 93, 74, 0.1);
  border: 1.5px solid var(--coral);
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground);
}
.breed-chip-remove {
  border: none;
  background: none;
  color: var(--foreground);
  font-size: 13px;
  cursor: pointer;
  line-height: 1;
  padding: 8px;
  margin: -8px -4px -8px 0;
}

.location-chip {
  display: flex;
  align-items: center;
  margin-top: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(232, 93, 74, 0.1);
  border: 1.5px solid var(--coral);
  font-size: 14px;
  font-weight: 700;
  color: var(--foreground);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.photo-tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--input-bg);
  padding: 0;
  border: none;
}
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-primary-badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(43, 39, 35, 0.7);
  color: white;
}
.photo-remove-btn {
  position: absolute;
  /* Was 22×22px — a destructive action at a quarter of the recommended
     hit area. The glyph stays the same visual size; only the tappable
     box grows. */
  top: 0;
  right: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(43, 39, 35, 0.7);
  color: white;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-add-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 300;
  color: var(--muted-fg);
  border: 2px dashed var(--border);
  background: none;
  cursor: pointer;
}

.emoji-choices { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.emoji-choice {
  font-size: 22px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  cursor: pointer;
}
.emoji-choice.selected { border-color: var(--foreground); background: var(--input-bg); }

.interest-tags, .tag-choice-group { display: flex; flex-wrap: wrap; gap: 8px; }
.interest-other-input { margin-top: 8px; }
.tag-choice {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  color: var(--muted-fg);
}
.tag-choice.selected {
  background: var(--foreground);
  border-color: var(--foreground);
  color: var(--background);
}

/* Any/All/Either pills — a distinct green so "this matches everyone" reads
   at a glance instead of blending in with a specific choice. Pale green
   unselected, vibrant dark green when active. Covers both the standalone
   "Any X" reset buttons (Preferred Breed, Age, Interested In, Radius,
   Partner Age) and the blank-value "Either" option inside a normal
   tag-choice group (Preferred Personality, Connection Type). */
.pill-any, .tag-choice-any {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  background: #E6F4EA;
  border: 1.5px solid #A8D5B5;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  color: #1E7A34;
}
.pill-any {
  display: inline-flex;
  width: auto;
  margin-top: 8px;
}
.pill-any:hover, .tag-choice-any:hover { border-color: #1E7A34; }
.pill-any.selected, .tag-choice-any.selected {
  background: #1E7A34;
  border-color: #1E7A34;
  color: #F5F1ED;
}

/* ---------- Matching Preference Questions ---------- */
.avatar-picker-photos { display: flex; flex-direction: column; gap: 16px; }

/* One-time dismissible explainer banner — the matching-preferences one
   below, plus the Browse and Chat coach-marks that replaced the app tour's
   two-track and safety-expectations steps when the tour was removed. */
.coach-mark {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(232, 168, 60, 0.12);
  border: 1.5px solid var(--marigold);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.coach-mark p { margin: 0; font-size: 13px; font-weight: 600; color: var(--foreground); }
.coach-mark .btn-text { width: auto; align-self: flex-end; padding: 0; color: var(--foreground); font-size: 13px; }
#browse-coach-mark { margin: 12px 20px 0; }
#chat-safety-coach-mark { margin: 10px 16px 0; }

.settings-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.settings-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  font-family: var(--font-sans);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 17px;
  cursor: pointer;
  user-select: none;
  list-style: none;
}
.settings-section-title::-webkit-details-marker { display: none; }
.settings-section-title::after {
  /* Was a bare "⌄" character — a Unicode modifier letter that renders at
     a different size on every platform. A small inline SVG renders
     identically everywhere; the color is baked in since CSS variables
     don't resolve inside a data URI. */
  content: "";
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236E645C' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.settings-section[open] .settings-section-title::after { transform: rotate(180deg); }
.settings-section-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0 20px 20px;
}

.prompt-slot {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.prompt-slot:last-child { padding-bottom: 0; border-bottom: none; }

.question-block { display: flex; flex-direction: column; gap: 6px; }
.question-label {
  font-family: var(--font-sans);
  font-size: 17px;
  letter-spacing: -0.03em;
  color: var(--foreground);
  font-weight: 700;
}
.question-copy { margin: 0; font-size: 13px; color: var(--muted-fg); }

.yesno-toggle { display: flex; gap: 10px; }
.yesno-btn {
  flex: 1;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: pointer;
  color: var(--muted-fg);
}
.yesno-btn.selected {
  background: var(--foreground);
  border-color: var(--foreground);
  color: var(--background);
}

.match-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.reason-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(232, 93, 74, 0.1);
  color: var(--foreground);
  border: 1px solid var(--coral);
}

.verified-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: #E6F4EA;
  color: #1E7A34;
  border: 1px solid #1E7A34;
  vertical-align: middle;
  margin-left: 6px;
}

.profile-card.verification-card { text-align: left; margin-top: 16px; }

.profile-card.completeness-card { text-align: left; }
.completeness-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}
.completeness-header h3 { font-family: var(--font-sans); font-weight: 700; letter-spacing: -0.03em; font-size: 18px; margin: 0; }
.completeness-percent { font-family: var(--font-sans); font-size: 18px; font-weight: 800; color: var(--foreground); }
.completeness-bar-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: var(--input-bg);
  overflow: hidden;
}
.completeness-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--marigold);
  transition: width 0.25s ease;
}
.completeness-hint { font-size: 13px; color: var(--muted-fg); margin: 10px 0 14px; }

.disabled-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--input-bg);
  color: var(--muted-fg);
  border: 1px solid var(--border);
  vertical-align: middle;
  margin-left: 6px;
}
.match-row-disabled { opacity: 0.55; }
.match-row-disabled .avatar { filter: grayscale(1); }

.ai-bot-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: #EDE7FA;
  color: #5B3FBF;
  border: 1px solid #5B3FBF;
  vertical-align: middle;
  margin-left: 6px;
}
.disabled-note { font-style: italic; }
.danger-zone { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.btn-text-danger { color: var(--destructive); }

.settings-menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}
.settings-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  font-family: var(--font-sans);
  color: inherit;
  transition: box-shadow 0.15s ease;
}
.settings-row:hover { box-shadow: var(--shadow-soft); }
.settings-row-label { flex: 1; font-size: 15px; font-weight: 700; }
.settings-row-chevron { color: var(--muted-fg); font-size: 20px; flex-shrink: 0; }

.profile-card.notifications-card { text-align: left; margin-top: 16px; }
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.switch-row:first-of-type { border-top: none; }
.switch-label { display: block; font-family: var(--font-sans); font-size: 14px; font-weight: 700; color: var(--foreground); }
.switch-hint { display: block; font-size: 12px; font-weight: 400; color: var(--muted-fg); margin-top: 2px; }
.switch { position: relative; display: inline-block; width: 44px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch-track {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.switch-track::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s ease;
  box-shadow: var(--shadow-soft);
}
.switch input:checked + .switch-track { background: var(--foreground); }
.switch input:checked + .switch-track::before { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 3px rgba(232, 168, 60, 0.35); }
.verification-card h3 { font-family: var(--font-sans); font-weight: 700; letter-spacing: -0.03em; font-size: 20px; margin: 0 0 8px; }
.verification-status-line { font-size: 14px; color: var(--muted-fg); margin: 0 0 10px; }
.verification-notes-line {
  font-size: 13px;
  background: var(--input-bg);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin: 0 0 12px;
}

.verification-form { display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; }

/* ---------- Main App / Topbar / Nav ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(4px + env(safe-area-inset-top, 0px)) 20px 4px;
  border-bottom: 1px solid var(--border);
  background: var(--background);
}
.topbar-logo { gap: 8px; }
.topbar-actions { display: flex; align-items: center; gap: 2px; }
.topbar-logo .logo-mark { width: 28px; height: 28px; }
.topbar-logo .logo-wordmark { font-size: 20px; }
/* The main-app topbar's logo is a real button (Back to Browse) — reset
   the default button chrome so it still reads as the plain logo lockup
   it always was. The auth screen's own (non-interactive) .logo-lockup is
   a <div> and untouched by this. */
button.topbar-logo {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

.tab-panel { display: none; flex: 1; flex-direction: column; overflow: hidden; }
.tab-panel.active { display: flex; }

.bottom-nav {
  display: flex;
  border-top: 1px solid var(--border);
  background: var(--background);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
}
.nav-btn {
  flex: 1;
  border: none;
  background: none;
  padding: 6px 0 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted-fg);
  cursor: pointer;
}
.nav-icon-wrap {
  position: relative;
  width: 36px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.nav-icon-wrap.has-badge::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--destructive);
  border: 2px solid var(--background);
}
.nav-icon { font-size: 17px; line-height: 1; }
.nav-icon-svg { width: 24px; height: 24px; display: block; }
.nav-btn.active { color: var(--foreground); }
.nav-btn.active .nav-icon-wrap { background: rgba(232, 168, 60, 0.22); }

/* ---------- Card Stack (Browse) ---------- */
.profile-scroll {
  flex: 1;
  overflow-y: auto;
}
.profile-view { display: flex; flex-direction: column; }

.profile-header {
  position: relative;
  padding: 20px 20px 4px;
  background: var(--card);
}
.profile-safety-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--input-bg);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.profile-safety-btn:hover { background: var(--border); }
.profile-info-block {
  padding: 14px 20px;
  background: var(--card);
}
.profile-header-name {
  font-family: var(--font-sans);
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0;
  color: var(--foreground);
}
.profile-header-age { font-family: var(--font-sans); font-weight: 400; font-size: 18px; margin-left: 6px; color: var(--muted-fg); }
.profile-header-dog { color: var(--foreground); font-weight: 700; margin: 4px 0 0; font-size: 16px; }
.profile-header-loc { color: var(--muted-fg); font-size: 15px; margin: 2px 0 12px; }
.profile-traits { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.profile-traits span {
  background: var(--card);
  border: 1.5px solid var(--border);
  color: var(--foreground);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 999px;
}
.profile-bio { font-size: 17px; line-height: 1.5; margin: 0 0 12px; color: var(--foreground); }
.prompt-card { margin: 0 0 4px; }
.prompt-question { font-size: 15px; font-weight: 600; color: var(--muted-fg); margin: 0 0 4px; }
.prompt-answer { font-size: 23px; font-weight: 700; line-height: 1.25; color: var(--foreground); margin: 0; }
/* Same like-with-a-comment mechanic as a photo's Reply button, just static-
   positioned (not an overlay) since a prompt card has no photo underneath
   to float over). */
.prompt-reply-btn {
  display: inline-flex;
  align-items: center;
  margin-top: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--card);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 13px;
  color: var(--foreground);
  cursor: pointer;
}
.prompt-reply-btn:hover { background: var(--input-bg); }
.profile-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.profile-tags span {
  background: var(--input-bg);
  color: var(--muted-fg);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 999px;
}

.profile-photo-block {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  margin-top: 14px;
  background: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.profile-photo-emoji { font-size: 120px; filter: drop-shadow(0 12px 20px rgba(43, 39, 35, 0.2)); }
.profile-photo-img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Name/dog-line-overlaid-on-photo treatment — tried on a test build
   2026-09-02, not adopted for now (Trent kept the plain header block
   below). Left in place unused since he may revisit after more tester
   feedback; buildProfileView() in app.js currently never emits these
   classes, so this has no effect until it does again. */
.profile-photo-block.has-header-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(43, 39, 35, 0.82) 0%, rgba(43, 39, 35, 0.32) 42%, rgba(43, 39, 35, 0) 65%);
  pointer-events: none;
  z-index: 1;
}
.profile-header-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  z-index: 2;
  padding: 0 18px;
}
.profile-photo-block.has-action-row .profile-header-overlay { bottom: 82px; }
.overlay-name {
  font-family: var(--font-sans);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0;
  color: var(--background);
}
.overlay-age { font-family: var(--font-sans); font-weight: 400; font-size: 16px; margin-left: 6px; color: rgba(245, 241, 237, 0.75); }
.overlay-dog { color: rgba(245, 241, 237, 0.9); font-weight: 700; margin: 3px 0 0; font-size: 13px; }
.profile-safety-btn.on-photo { top: 14px; left: 14px; right: auto; z-index: 3; background: rgba(255, 255, 255, 0.85); }
.profile-safety-btn.on-photo:hover { background: white; }

.photo-reply-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 13px;
  color: var(--foreground);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}
.photo-reply-btn:hover { background: white; }

/* Pass/Save/Like float directly on every photo now (bottom-left/middle/
   right) instead of a fixed row below the deck — see PHOTO_ACTION_ROW_MARKUP
   in app.js. */
.photo-action-row {
  position: absolute;
  bottom: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}
.photo-action-btn {
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(43, 39, 35, 0.28);
  transition: transform 0.15s ease, background 0.15s ease;
}
.photo-action-btn:active { transform: scale(0.9); }
.photo-action-btn.pass,
.photo-action-btn.save {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
}
.photo-action-btn.pass:hover,
.photo-action-btn.save:hover { background: white; }
.photo-action-btn.pass { width: 44px; height: 44px; }
.photo-action-btn.pass .pass-icon-svg { width: 28px; height: 28px; display: block; }
.photo-action-btn.save { width: 40px; height: 40px; }
.photo-action-btn.save .ui-icon-svg { width: 16px; height: 16px; }
.photo-action-btn.like { width: 52px; height: 52px; background: var(--marigold); }
.photo-action-btn.like:hover { background: #D89830; }
.photo-action-btn.like .like-icon-svg { width: 32px; height: 32px; display: block; }

.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  padding: 20px;
}
.empty-state-headline { font-family: var(--font-sans); font-size: 20px; font-weight: 700; margin: 0; }
.empty-state .btn { margin-top: 8px; }

/* ---------- Matches ---------- */
.panel-title {
  font-family: var(--font-sans);
  font-weight: 800;
  letter-spacing: -0.03em;
  padding: 20px 20px 0;
  margin: 0 0 8px;
  font-size: 24px;
}
/* The Profile tab pads itself 20px horizontally; .panel-title's own 20px
   would double it there ("Your Profile" sitting at 40px while the card
   beneath it sits at 20px). Matches has no container padding of its own,
   so .panel-title's 20px is the only — and correct — source there. Scoped
   override rather than a global change. */
#tab-profile .panel-title { padding-left: 0; padding-right: 0; }
.panel-subtitle {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-fg);
  padding: 8px 20px 0;
  margin: 0 0 8px;
}
.matches-list {
  padding: 0 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.match-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  transition: box-shadow 0.15s ease;
  /* Matches/Saved rows are real <button> elements now (Wave 2) — a few
     resets a <div> never needed, since a bare button doesn't inherit
     these the way a div implicitly does. */
  width: 100%;
  text-align: left;
  font-family: inherit;
  color: inherit;
}
.match-row:hover { box-shadow: var(--shadow-soft); }
.match-row .avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  overflow: hidden;
}
.match-row .avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.match-row .info { flex: 1; min-width: 0; }
.match-row .info h4 { margin: 0; font-size: 15px; font-weight: 700; }
.match-row .info p { margin: 2px 0 0; font-size: 13px; color: var(--muted-fg); }
.match-row .info p.like-comment { color: var(--foreground); font-style: italic; }
.empty-hint { text-align: center; color: var(--muted-fg); padding: 20px 20px 0; }
.match-row .info p.last-message { color: var(--foreground); }
.match-row .info p.last-message .me-prefix { color: var(--muted-fg); }

/* Likes You's photo-reply card — taller than a plain like row (photo +
   comment + two actions), so it drops the plain row's vertical centering
   and pointer cursor (this row itself has no click handler — View Profile
   and Reply & Sniff are the two real actions, nested buttons). */
.match-row.like-reply-row { align-items: flex-start; cursor: default; }
.like-reply-preview { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.like-reply-photo {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}
.like-reply-preview .like-comment { margin: 0; }
.like-reply-actions { display: flex; align-items: center; gap: 4px; margin-top: 10px; }
.like-reply-actions .btn-text { width: auto; padding: 8px 4px; }
.like-reply-actions .btn { padding: 8px 14px; font-size: 13px; box-shadow: none; }

.unsave-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--input-bg);
  color: var(--muted-fg);
  font-size: 15px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.unsave-btn:hover { background: var(--muted); color: var(--foreground); }
.unsave-btn:active { transform: scale(0.9); }

/* ---------- Connections segments (Likes / Chats / Saved) ---------- */
.connections-segments {
  display: flex;
  gap: 2px;
  background: var(--input-bg);
  border-radius: 999px;
  padding: 4px;
  margin: 0 20px 16px;
}
.segment-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  background: none;
  padding: 10px 6px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  color: var(--muted-fg);
  cursor: pointer;
}
.segment-btn.active {
  background: var(--card);
  color: var(--foreground);
  box-shadow: var(--shadow-soft);
}
.segment-count {
  min-width: 18px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--card);
  color: var(--muted-fg);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}
.segment-btn.active .segment-count { background: var(--marigold); color: var(--foreground); }
.connections-segment-body[hidden] { display: none; }

/* ---------- Chat thread ---------- */
.matches-list-view { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }
.chat-thread { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--background);
}
.chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  padding: 0;
  text-align: left;
  font-family: inherit;
  color: inherit;
  cursor: pointer;
}
.chat-header-info .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  overflow: hidden;
}
.chat-header-info .avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.chat-header-info h3 { margin: 0; font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-thread-disabled .chat-header-info .avatar { filter: grayscale(1); opacity: 0.6; }
.chat-thread-disabled .chat-header-info h3 { color: var(--muted-fg); }
.chat-disabled-notice {
  margin: 0;
  padding: 8px 20px;
  font-size: 12px;
  text-align: center;
  color: var(--muted-fg);
  background: var(--input-bg);
  border-bottom: 1px solid var(--border);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-empty-hint { text-align: center; color: var(--muted-fg); margin-top: 20px; }
.message-bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
}
.message-bubble.sent {
  align-self: flex-end;
  background: var(--foreground);
  color: var(--background);
  border-bottom-right-radius: 4px;
}
.message-bubble.received {
  align-self: flex-start;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--foreground);
  border-bottom-left-radius: 4px;
}
.chat-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  background: var(--background);
}
.chat-input-row input { flex: 1; margin: 0; }
.chat-input-row .btn { padding: 12px 20px; }

.like-back-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--marigold);
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
}
.like-back-btn svg { width: 20px; height: 20px; }
.like-back-btn:hover { background: #D89830; }
.like-back-btn:active { transform: scale(0.9); }

/* ---------- Profile tab ---------- */
#tab-profile { padding: 0 20px 20px; overflow-y: auto; }
.profile-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 24px;
  text-align: center;
  margin-bottom: 16px;
}
.profile-card .avatar-preview { margin: 0 auto 14px; }
.profile-card h3 { font-family: var(--font-sans); font-weight: 700; letter-spacing: -0.03em; font-size: 22px; margin: 0 0 2px; }
.profile-card .dog-line { color: var(--foreground); font-weight: 700; margin: 0 0 6px; }
.profile-card .loc-line { color: var(--muted-fg); font-size: 13px; margin: 0 0 12px; }
.profile-card .bio { font-size: 15px; line-height: 1.5; margin: 0 0 14px; text-align: left; }
.profile-card .card-tags { justify-content: center; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.card-tags span {
  background: var(--input-bg);
  color: var(--muted-fg);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
}

/* ---------- Match Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(43, 39, 35, 0.6);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}
.modal-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 0;
  text-align: center;
  max-width: 360px;
  width: 100%;
  max-height: 88vh;
  max-height: 88dvh;
  box-shadow: var(--shadow-lift);
  overflow-y: auto;
}

/* ---------- Terms & Safety acceptance gate ---------- */
.terms-gate-card {
  max-width: 420px;
  padding: 24px 20px 20px;
  text-align: left;
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  max-height: 85dvh;
  overflow: hidden;
}
.terms-gate-header h2 { font-family: var(--font-sans); font-weight: 800; font-size: 20px; margin: 0 0 6px; letter-spacing: -0.03em; }
.terms-gate-header p { font-size: 13px; color: var(--muted-fg); margin: 0 0 14px; }
.terms-gate-scroll {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  background: var(--input-bg);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.terms-gate-scroll h3 { font-family: var(--font-sans); font-size: 14px; font-weight: 700; margin: 16px 0 6px; }
.terms-gate-scroll h3:first-child { margin-top: 0; }
.terms-gate-scroll p { font-size: 13px; line-height: 1.45; margin: 0 0 10px; }
.terms-gate-footer { display: flex; flex-direction: column; gap: 8px; }
.terms-gate-footer .btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------- Filter sheet (bottom sheet, distinct from centered modals) ---------- */
.sheet-overlay { align-items: flex-end; padding: 0; }
.sheet-card {
  max-width: 480px;
  width: 100%;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 10px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  text-align: left;
  max-height: 80vh;
  max-height: 80dvh;
}
.sheet-title {
  font-family: var(--font-sans);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 20px;
  margin: 8px 0 18px;
  text-align: center;
}
.filter-radius-value { font-family: var(--font-sans); font-weight: 700; font-size: 15px; color: var(--foreground); margin: 4px 0 10px; }
.filter-radius-slider {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--input-bg);
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  cursor: pointer;
  margin: 0 0 8px;
}
.filter-radius-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--marigold);
  border: 3px solid var(--card);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}
.filter-radius-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--marigold);
  border: none;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}
.filter-radius-slider:focus-visible { box-shadow: 0 0 0 3px rgba(232, 168, 60, 0.35); }
#filter-sheet-modal .switch-row { border-top: 1px solid var(--border); padding: 16px 0; }
#btn-filter-sheet-apply { margin-top: 20px; }

.safety-menu-card { max-width: 380px; padding: 20px 22px 22px; text-align: left; }
.safety-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.safety-menu-header h2 { font-family: var(--font-sans); font-weight: 700; letter-spacing: -0.03em; font-size: 20px; margin: 0; }
.safety-menu-actions { display: flex; flex-direction: column; gap: 10px; }
.safety-report-form { display: flex; flex-direction: column; gap: 14px; }
.report-also-block-row {
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--foreground) !important;
}
.report-also-block-row input[type="checkbox"] { width: auto; padding: 0; accent-color: var(--foreground); }

.match-card { position: relative; }
.match-card-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(232, 93, 74, 0.12), rgba(232, 168, 60, 0.12));
  pointer-events: none;
}
.match-card-content { position: relative; padding: 32px 26px 26px; display: flex; flex-direction: column; gap: 10px; }
.match-icon { width: 52px; height: 52px; margin: 0 auto 4px; display: block; }
.match-kicker {
  font-size: 13px;
  font-weight: 800;
  color: var(--foreground);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin: 0 0 4px;
}
.match-heading {
  font-family: var(--font-sans);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 32px;
  margin: 0 0 6px;
  color: var(--foreground);
}
.match-subtext { color: var(--muted-fg); font-size: 15px; margin: 0 0 22px; }

.info-card-content { padding: 32px 26px; }
.info-card-heading {
  font-family: var(--font-sans);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 22px;
  margin: 0 0 10px;
  color: var(--foreground);
}
.info-card-body { color: var(--muted-fg); font-size: 15px; line-height: 1.5; margin: 0 0 22px; }
.info-card-body strong { color: var(--foreground); }
.match-avatar-ring {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  margin: 0 auto 22px;
  padding: 4px;
  box-shadow: 0 0 0 4px rgba(232, 168, 60, 0.18);
  background: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.match-avatar-big {
  font-size: 44px;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
}
.match-avatar-big img { width: 100%; height: 100%; object-fit: cover; }

.match-park-suggestion {
  background: var(--input-bg);
  border-radius: 14px;
  padding: 12px 16px;
  margin: 0 0 22px;
  text-align: center;
}
.match-park-suggestion-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-fg);
  margin: 0 0 4px;
}
.match-park-suggestion-name { font-size: 15px; font-weight: 700; color: var(--foreground); margin: 0; }
.match-park-suggestion-suburb { font-size: 13px; color: var(--muted-fg); margin: 2px 0 0; }
.match-park-suggestion-tip { font-size: 12px; color: var(--muted-fg); margin: 8px 0 0; font-style: italic; }

/* ---------- Reply-to-photo Modal ---------- */
.reply-card { max-width: 380px; padding: 0; }
.reply-photo-preview {
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: 46vh;
  object-fit: cover;
  display: block;
}
.reply-card-content { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 12px; }
.reply-card-content textarea { width: 100%; }
/* Shown only for "Reply & Sniff" — quotes the incoming photo-comment this
   reply is responding to, so it's clear what's being replied to before the
   textarea below it. */
.reply-quote {
  margin: 0;
  padding: 10px 12px;
  background: var(--input-bg);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-style: italic;
  color: var(--foreground);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  /* Matches the inset variable .bottom-nav already uses, so the toast
     clears a large-home-indicator nav bar instead of overlapping it. */
  bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  background: var(--foreground);
  color: white;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  z-index: 60;
  opacity: 0.96;
  max-width: 90%;
  text-align: center;
}

@media (max-width: 480px) {
  #app { max-width: 100%; }
}
