* {
  box-sizing: border-box;
}

/* Logo shield green (accent); primary CTAs stay blue — see `button` / `.btn*`. */
:root {
  color-scheme: light;
  /* Homepage hero / nav / welcome column (920px) */
  --home-hero-max: 57.5rem;

  /* Theme: surfaces */
  --bg-page: #f6f8fa;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --bg-muted: #f3f4f6;
  --bg-elevated: #f9fafb;
  --bg-row-hover: #f0f9ff;
  --bg-row-highlight: #fefce8;
  --bg-row-highlight-hover: #fef9c3;

  /* Theme: text */
  --text-primary: #111827;
  --text-heading: #0f172a;
  --text-body: #374151;
  --text-muted: #6b7280;
  --text-label: #334155;
  --text-subtle: #5f6b7a;

  /* Theme: borders */
  --border-default: #d1d5db;
  --border-subtle: #e5e7eb;
  --border-input: #cbd5e1;
  --border-input-alt: #cfd8e3;
  --border-card: #d9dee7;

  /* Theme: accents (info banners, active chips) */
  --accent-info-bg: #eff6ff;
  --accent-info-border: #bfdbfe;
  --accent-info-text: #1e40af;
  --accent-active-bg: #eff6ff;
  --accent-active-text: #1e40af;
  --accent-row-hover-border: #bae6fd;

  /* Brand */
  --brand-green: #43a047;
  --brand-green-hover: #2e7d32;
  --brand-green-soft: #e8f5e9;

  /* Primary actions */
  --btn-primary-bg: #2563eb;
  --btn-primary-border: #2563eb;
  --btn-primary-hover: #1d4ed8;
  --link: #2563eb;
  --link-hover: #1d4ed8;

  /* Status */
  --color-success: #059669;
  --color-error: #dc2626;
  --color-info: #2563eb;
  --color-warning: #b45309;

  /* Nav / chrome */
  --nav-icon: #6b7280;
  --nav-toggle-fg: #374151;
  --nav-toggle-hover-bg: #f3f4f6;
  --bnav-bg: #ffffff;
  --bnav-shadow: rgba(0, 0, 0, 0.07);

  /* Effects */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-card: 0 4px 14px rgba(15, 23, 42, 0.06);
  --shadow-hero-cta: rgba(15, 23, 42, 0.08);
  --focus-ring: rgba(37, 99, 235, 0.3);
  --focus-border: #93c5fd;

  /* Misc tokens */
  --invite-border: #e2e8f0;
  --home-green-hint-text: #1b4332;
  --home-green-hint-border: #c8e6c9;
  --table-header-bg: #f3f4f6;
  --modal-body: #374151;
  --code-bg: #111827;
  --code-fg: #d1fae5;
  --bnav-inactive: #9ca3af;
  --alert-error-bg: #fef2f2;
  --alert-error-border: #fecaca;
  --alert-error-text: #b91c1c;
  --admin-hint-success-bg: #f0fdf4;
  --admin-hint-success-border: #bbf7d0;
  --divider-soft: #e8edf3;
  --star-muted: #d1d5db;
  --amenity-on-bg: #ecfdf5;
  --amenity-on-text: #065f46;
  --amenity-on-border: #a7f3d0;
  --lb-row-top-border: #fde68a;
  /* Input placeholders: dimmer than body / secondary copy */
  --input-placeholder: #6b7280;
}

/* Dark theme: class on html (early) and/or body — variables inherit to the page */
html.dark-mode,
body.dark-mode {
  color-scheme: dark;

  /* Surfaces: slate-900 page, slate-800 cards, lifted muted panels */
  --bg-page: #0f172a;
  --bg-card: #1e293b;
  --bg-input: #0f172a;
  --bg-muted: #243247;
  --bg-elevated: #243247;
  --bg-row-hover: rgba(59, 130, 246, 0.18);
  --bg-row-highlight: rgba(250, 204, 21, 0.16);
  --bg-row-highlight-hover: rgba(250, 204, 21, 0.24);

  /* Text: high-contrast body; muted/subtle still readable on #1e293b cards */
  --text-primary: #f8fafc;
  --text-heading: #f8fafc;
  --text-body: #f1f5f9;
  --text-muted: #d1d5db;
  --text-label: #f1f5f9;
  --text-subtle: #94a3b8;

  --border-default: #334155;
  --border-subtle: #2d3b4f;
  --border-input: #475569;
  --border-input-alt: #475569;
  --border-card: #334155;

  --accent-info-bg: rgba(59, 130, 246, 0.14);
  --accent-info-border: rgba(96, 165, 250, 0.4);
  --accent-info-text: #bfdbfe;
  --accent-active-bg: rgba(59, 130, 246, 0.18);
  --accent-active-text: #e0f2fe;
  --accent-row-hover-border: rgba(96, 165, 250, 0.5);

  --brand-green: #22c55e;
  --brand-green-hover: #16a34a;
  --brand-green-soft: rgba(6, 78, 59, 0.5);

  --btn-primary-bg: #3b82f6;
  --btn-primary-border: #3b82f6;
  --btn-primary-hover: #2563eb;
  --link: #60a5fa;
  --link-hover: #93c5fd;

  --color-success: #22c55e;
  --color-error: #f87171;
  --color-info: #60a5fa;
  --color-warning: #fbbf24;

  --nav-icon: #d1d5db;
  --nav-toggle-fg: #f8fafc;
  --nav-toggle-hover-bg: #243247;
  --bnav-bg: #1e293b;
  --bnav-shadow: rgba(0, 0, 0, 0.45);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-hero-cta: rgba(0, 0, 0, 0.35);
  --focus-ring: rgba(96, 165, 250, 0.45);
  --focus-border: #60a5fa;

  --invite-border: #334155;
  --home-green-hint-text: #ecfdf5;
  --home-green-hint-border: rgba(34, 197, 94, 0.4);
  --table-header-bg: #243247;
  --modal-body: #f1f5f9;
  --code-bg: #020617;
  --code-fg: #86efac;
  --bnav-inactive: #94a3b8;
  --alert-error-bg: rgba(248, 113, 113, 0.12);
  --alert-error-border: rgba(248, 113, 113, 0.35);
  --alert-error-text: #fca5a5;
  --admin-hint-success-bg: rgba(34, 197, 94, 0.14);
  --admin-hint-success-border: rgba(34, 197, 94, 0.35);
  --divider-soft: #334155;
  --star-muted: #94a3b8;
  --amenity-on-bg: rgba(34, 197, 94, 0.16);
  --amenity-on-text: #86efac;
  --amenity-on-border: rgba(34, 197, 94, 0.45);
  --lb-row-top-border: rgba(250, 204, 21, 0.45);
  --input-placeholder: #64748b;
}

/* Placeholders stay softer than .muted / helper paragraphs (see --input-placeholder) */
input::placeholder,
textarea::placeholder {
  color: var(--input-placeholder);
  opacity: 1;
}

html.dark-mode .geocode-results {
  border-color: var(--border-input);
  background: var(--bg-card);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

html.dark-mode .geocode-results li {
  border-bottom-color: var(--border-subtle);
  color: var(--text-body);
}

html.dark-mode .geocode-results li:hover {
  background: var(--bg-muted);
}

html.dark-mode .amenity-fieldset {
  border-color: var(--border-default);
}

html.dark-mode .leaderboard-cta-panel {
  background: var(--accent-info-bg);
  border-color: var(--accent-info-border);
}

html.dark-mode .leaderboard-cta-title {
  color: var(--text-heading);
}

html.dark-mode .profile-item-card {
  border-color: var(--border-default);
  background: var(--bg-elevated);
}

html.dark-mode .profile-card-link:hover .profile-item-card {
  background: var(--bg-row-hover);
  border-color: var(--accent-row-hover-border);
}

html.dark-mode .lb-name {
  color: var(--link);
}

html.dark-mode .admin-stat-card {
  background: var(--bg-card);
  border-color: var(--border-default);
}

html.dark-mode .admin-stat-card--warn {
  border-color: rgba(250, 204, 21, 0.45);
  background: var(--bg-row-highlight);
}

html.dark-mode .admin-stat-card--pts {
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(6, 78, 59, 0.4);
}

html.dark-mode select {
  background: var(--bg-input);
  color: var(--text-primary);
  border-color: var(--border-input);
}

/* Honeypot field — hidden from users, not display:none (some bots skip that). */
.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
}

/* ── Homepage: full-width main + shared responsive page shell (index) ── */
body.home-page main.container {
  max-width: none;
  width: 100%;
  margin: 0 auto;
  padding: 0;
  box-sizing: border-box;
}

body.home-page .page-shell {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  body.home-page .page-shell {
    padding: 0 24px;
  }
}

@media (min-width: 1024px) {
  body.home-page .page-shell {
    max-width: 1180px;
    padding: 0 32px;
  }
}

body.home-page .hero-shell {
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 0;
  padding-right: 0;
}

body.home-page .hero-section {
  max-width: 820px;
  margin: 0 auto 2rem;
}

body.home-page .site-nav-home-inner {
  max-width: 820px;
  padding-left: 0;
  padding-right: 0;
}

body.home-page .home-auth-section {
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 0;
  padding-right: 0;
}

/* Logged-in cards: align to wide column inside shell */
body.home-page #appSections > .card {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1.5rem;
  width: 100%;
  box-sizing: border-box;
}

/* ── Site header / home hero ── */
.site-header {
  margin: 0.75rem 0 1rem;
}

.site-header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.75rem;
}

.site-header.home-hero {
  margin-top: 0;
  margin-bottom: 0.65rem;
}

.home-hero {
  text-align: center;
}

/* Logo + headline + CTAs share one centered column (matches --home-hero-max). */
.hero-shell {
  max-width: var(--home-hero-max);
  margin: 0 auto;
  padding: 0 20px;
  text-align: center;
}

.hero-shell .site-logo {
  margin-top: 0;
  margin-bottom: 0.125rem;
}

.hero-section {
  margin: 0 auto 0;
  padding: 0;
  text-align: center;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-title {
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  color: var(--text-heading);
  max-width: 100%;
}

/* Mobile: force a clean two-line headline; desktop: one flowing line. */
.hero-title .mobile-break {
  display: block;
}

@media (min-width: 768px) {
  .hero-title .mobile-break {
    display: inline;
  }
}

.hero-subtext.tagline,
.hero-subtext {
  max-width: 620px;
  margin: 0 auto 16px;
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
}

.hero-actions .hero-cta {
  flex: 1 1 auto;
  min-width: min(100%, 10.5rem);
  max-width: 17.5rem;
}

.hero-actions .hero-cta-primary,
.hero-actions .hero-cta-secondary {
  font-weight: 800;
  box-shadow: 0 2px 10px var(--shadow-hero-cta);
}

.hero-actions .hero-cta-primary {
  box-shadow: 0 2px 12px rgba(37, 99, 235, 0.28);
}

.hero-actions .hero-cta-secondary {
  box-shadow: 0 2px 10px rgba(46, 125, 50, 0.22);
}

/* Shared pill button base (homepage hero + compact variants elsewhere). */
.hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-sizing: border-box;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, background 0.15s ease;
  width: auto !important;
}

.hero-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px var(--shadow-hero-cta);
}

.hero-cta-primary {
  background: var(--btn-primary-bg);
  color: #ffffff !important;
}

.hero-cta-primary:hover {
  background: var(--btn-primary-hover);
  opacity: 0.96;
}

.hero-actions .hero-cta-primary:hover {
  box-shadow: 0 5px 18px rgba(37, 99, 235, 0.38);
}

.hero-cta-secondary {
  background: #43a047;
  color: #ffffff !important;
}

.hero-cta-secondary:hover {
  background: var(--brand-green-hover);
  opacity: 0.96;
}

.hero-actions .hero-cta-secondary:hover {
  box-shadow: 0 4px 16px rgba(46, 125, 50, 0.32);
}

.hero-cta--compact {
  min-height: auto;
  padding: 0.35rem 0.9rem;
  font-size: 0.875rem;
  font-weight: 700;
  border-radius: 8px;
}

.hero-cta--blue {
  background: var(--btn-primary-bg);
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.hero-cta--blue:hover {
  background: var(--btn-primary-hover);
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  opacity: 1;
}

.hero-cta--green {
  background: var(--brand-green);
  color: #fff !important;
  box-shadow: 0 2px 6px rgba(46, 125, 50, 0.22);
}

.hero-cta--green:hover {
  background: var(--brand-green-hover);
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3);
  opacity: 1;
}

button.hero-cta {
  font-family: inherit;
}

button.invite-copy-btn {
  border-width: 2px;
}

/* Guest auth block: same horizontal rhythm as .hero-shell → flows into welcome card. */
.home-auth-section {
  margin-top: 0;
  max-width: var(--home-hero-max);
  margin-left: auto;
  margin-right: auto;
  padding: 0 20px;
  box-sizing: border-box;
}

#appSections {
  margin-top: 0;
}

.tagline {
  margin: 0;
  color: var(--text-muted);
}

/* ── Invite friends (referral link) ── */
.invite-friends-card {
  margin-bottom: 1rem;
  max-width: var(--home-hero-max);
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 4px 14px var(--shadow-card);
  border-color: var(--invite-border);
}

.invite-friends-title {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
}

.invite-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
}

.invite-link-input {
  flex: 1;
  min-width: 12rem;
  padding: 0.5rem 0.65rem;
  font-size: 0.875rem;
  border: 1px solid var(--border-default);
  border-radius: 6px;
  background: var(--bg-input);
  color: var(--text-primary);
}

.ref-banner {
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--accent-info-bg);
  border: 1px solid var(--accent-info-border);
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--accent-info-text);
}

/* ── User banner (logged-in state) ── */
.user-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  background: var(--accent-info-bg);
  border-color: var(--accent-info-border);
  margin-bottom: 1rem;
}

.user-banner-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.user-banner-email,
.user-banner-name-link {
  font-weight: 700;
  color: var(--accent-info-text);
  word-break: break-all;
  text-decoration: none;
}

.user-banner-name-link:hover {
  text-decoration: underline;
}

.user-banner-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-banner-pts {
  font-weight: 600;
  color: var(--color-success);
  font-size: 0.95rem;
}

.user-banner--polish {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  background: var(--bg-card);
  box-shadow: 0 4px 14px var(--shadow-card);
  border-color: var(--invite-border);
  max-width: var(--home-hero-max);
  margin-left: auto;
  margin-right: auto;
}

.user-banner-main {
  flex: 1 1 12rem;
  min-width: 0;
  text-align: left;
}

.user-banner-line1 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-heading);
}

.user-banner-greeting {
  font-weight: 600;
  color: var(--text-body);
}

.user-banner-wave {
  margin-left: 0.15rem;
}

.user-banner-line2 {
  margin: 0.35rem 0 0;
}

.user-banner-pts-inline {
  color: var(--brand-green);
  font-weight: 800;
}

.user-banner-badge-row {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.user-banner-badge-row .contributor-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.user-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
}

.user-banner-logout {
  background: var(--bg-card);
  color: var(--text-body) !important;
  border: 1px solid var(--border-default);
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.user-banner-logout:hover {
  background: var(--bg-muted);
  border-color: var(--border-default);
  color: var(--text-primary) !important;
}

/* Logged-in hint: submit location (+3) */
.home-submit-hint {
  max-width: var(--home-hero-max);
  margin-left: auto;
  margin-right: auto;
  background: var(--brand-green-soft);
  border-color: var(--home-green-hint-border);
  box-shadow: 0 2px 8px rgba(46, 125, 50, 0.06);
}

.home-submit-hint-badge {
  display: inline-block;
  background: var(--brand-green);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  text-transform: uppercase;
}

.home-submit-hint-text {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--home-green-hint-text);
}

.small-btn {
  padding: 0.35rem 0.75rem !important;
  font-size: 0.85rem !important;
}

/* ── Inline form messages ── */
.form-msg {
  min-height: 1.3em;
  font-size: 0.875rem;
  margin: 0.4rem 0 0;
  padding: 0;
  border: none;
  background: none;
}

.form-msg.success { color: var(--color-success); }
.form-msg.error   { color: var(--color-error); }
.form-msg.info    { color: var(--color-info); }
.form-msg.warning { color: var(--color-warning); }

.business-claim-thanks-cta {
  margin-top: 1.25rem;
}

/* ── Site footer (legal links) ── */
.site-footer {
  margin-top: 2rem;
  padding: 1rem 0 0.5rem;
  border-top: 1px solid var(--invite-border);
  text-align: center;
}

.site-footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  justify-content: center;
  align-items: center;
}

.site-footer-nav a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-footer-nav a:hover {
  color: var(--link-hover);
}

/* ── Legal pages (privacy / terms) ── */
.legal-prose h2 {
  font-size: 1.05rem;
  margin: 1.25rem 0 0.5rem;
  font-weight: 700;
}

.legal-prose p {
  margin: 0 0 0.85rem;
  line-height: 1.55;
}

.legal-prose ul {
  margin: 0 0 0.85rem;
  padding-left: 1.25rem;
  line-height: 1.55;
}

.legal-prose li {
  margin-bottom: 0.35rem;
}

.legal-prose p:last-child,
.legal-prose .legal-prose-last {
  margin-bottom: 0;
}

/* ── Debug details ── */
.debug-details {
  margin-top: 1rem;
  padding: 0.6rem 1rem;
}

.debug-details summary {
  cursor: pointer;
  user-select: none;
}

.debug-details pre {
  margin: 0.5rem 0 0;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
}

.grid {
  display: grid;
  gap: 1rem;
  margin: 1rem 0;
}

.grid.two {
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .grid.two {
    grid-template-columns: 1fr 1fr;
  }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  padding: 1rem;
}

.disclaimer-prose p {
  margin: 0 0 0.85rem;
  line-height: 1.55;
}

.disclaimer-prose p:last-child,
.disclaimer-prose .disclaimer-prose-last {
  margin-bottom: 0;
}

form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

input,
textarea {
  padding: 0.6rem 0.7rem;
  border-radius: 6px;
  border: 1px solid var(--border-input);
  font-size: 0.95rem;
  background: var(--bg-input);
  color: var(--text-primary);
}

button {
  padding: 0.6rem 0.7rem;
  border-radius: 6px;
  font-size: 0.95rem;
  cursor: pointer;
  background: var(--btn-primary-bg);
  color: #fff;
  border: 1px solid var(--btn-primary-border);
}

button.secondary {
  background: var(--brand-green);
  color: #fff;
  border-color: var(--brand-green);
}

button.secondary:hover:not(:disabled) {
  background: var(--brand-green-hover);
  border-color: var(--brand-green-hover);
  color: #fff;
}

button.secondary:focus-visible {
  outline: 2px solid var(--brand-green);
  outline-offset: 2px;
}

button.secondary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Banner / leaderboard: link styled like small secondary button */
a.small-btn.secondary {
  display: inline-block;
  text-align: center;
  text-decoration: none;
  background: var(--brand-green);
  color: #fff !important;
  border: 1px solid var(--brand-green);
  border-radius: 6px;
  font-weight: 600;
}

a.small-btn.secondary:hover {
  background: var(--brand-green-hover);
  border-color: var(--brand-green-hover);
  color: #fff !important;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.4rem 0;
}

pre {
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 0.8rem;
  border-radius: 8px;
  overflow: auto;
  min-height: 80px;
}

.muted {
  color: var(--text-muted);
}

ul {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
}

.site-nav {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  align-items: center;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--link);
  text-decoration: none;
  font-weight: 600;
}

.site-nav a:hover {
  text-decoration: underline;
  color: var(--link-hover);
}

/* ── Theme toggle (mounted by common.js into .site-nav) ── */
.theme-toggle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  margin: 0;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.theme-toggle:hover {
  background: var(--bg-muted);
  border-color: var(--border-input);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--btn-primary-bg);
  outline-offset: 2px;
}

.site-nav .theme-toggle {
  width: 2.35rem !important;
  min-width: 2.35rem;
}

/* Account (and any page): System / Light / Dark theme picker */
.theme-mode-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.theme-mode-btn {
  flex: 1;
  min-width: 5.5rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid var(--border-default);
  background: var(--bg-muted);
  color: var(--text-primary);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  width: auto !important;
}

.theme-mode-btn:hover {
  border-color: var(--border-input);
  background: var(--bg-card);
}

.theme-mode-btn--active {
  border-color: var(--btn-primary-bg);
  background: var(--accent-active-bg);
  color: var(--accent-active-text);
}

.theme-mode-btn:focus-visible {
  outline: 2px solid var(--btn-primary-bg);
  outline-offset: 2px;
}

/* ── Homepage top bar: hero logo only; slim nav + mobile hamburger ── */
body.home-page .site-nav--home {
  display: block;
  margin-bottom: 0.45rem;
  padding: 0;
  border-bottom: 1px solid var(--border-subtle);
}

body.home-page .site-nav-home-inner {
  max-width: 820px;
  margin: 0 auto;
  padding: 0.5rem 0 0.55rem;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem 1rem;
  box-sizing: border-box;
}

body.home-page .site-nav--home .nav-menu-toggle {
  display: none;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  color: var(--nav-toggle-fg);
  -webkit-tap-highlight-color: transparent;
}

body.home-page .site-nav--home .nav-menu-toggle:hover {
  background: var(--nav-toggle-hover-bg);
}

body.home-page .site-nav--home .nav-menu-toggle:focus-visible {
  outline: 2px solid var(--btn-primary-bg);
  outline-offset: 2px;
}

body.home-page .site-nav--home .nav-menu-toggle-inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}

body.home-page .site-nav--home .nav-menu-toggle-bar {
  display: block;
  width: 1.35rem;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

body.home-page .site-nav--home.is-menu-open .nav-menu-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

body.home-page .site-nav--home.is-menu-open .nav-menu-toggle-bar:nth-child(2) {
  opacity: 0;
}

body.home-page .site-nav--home.is-menu-open .nav-menu-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

body.home-page .site-nav--home .site-nav-home-links {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1.15rem;
  min-width: 0;
  justify-content: flex-start;
}

body.home-page .site-nav--home .site-nav-home-links > span {
  display: contents;
}

body.home-page .site-nav--home .nav-refresh-btn {
  flex-shrink: 0;
  margin-left: auto;
}

@media (max-width: 768px) {
  body.home-page .site-nav--home {
    margin-bottom: 0.35rem;
  }

  body.home-page .site-nav-home-inner {
    flex-wrap: wrap;
    padding: 0.28rem 0 0.32rem;
    gap: 0.25rem 0.5rem;
  }

  body.home-page .site-nav--home .nav-menu-toggle {
    display: inline-flex;
    order: 1;
    width: 2.35rem;
    height: 2.35rem;
  }

  body.home-page .site-nav--home .theme-toggle {
    order: 2;
    margin-left: auto;
  }

  body.home-page .site-nav--home .nav-refresh-btn {
    order: 3;
    margin-left: 0;
  }

  body.home-page .site-nav--home .site-nav-home-links {
    order: 10;
    display: none;
    flex: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-top: 0.35rem;
    margin-top: 0.15rem;
    border-top: 1px solid var(--border-subtle);
  }

  body.home-page .site-nav--home.is-menu-open .site-nav-home-links {
    display: flex;
  }

  body.home-page .site-nav--home .site-nav-home-links a {
    padding: 0.55rem 0.35rem;
    border-radius: 8px;
  }

  body.home-page .site-nav--home .site-nav-home-links a:active {
    background: var(--bg-muted);
  }

  body.home-page .container {
    padding-top: 0.45rem;
  }
}

@media (min-width: 769px) {
  body.home-page .site-nav--home .nav-menu-toggle {
    display: none !important;
  }

  body.home-page .site-nav--home .site-nav-home-links {
    display: flex !important;
  }

  body.home-page .site-nav-home-inner {
    align-items: center;
    justify-content: flex-start;
    padding: 0.875rem 0;
    gap: 1rem 1.25rem;
  }

  /* Link cluster left; margin-right:auto sends refresh to the far right. */
  body.home-page .site-nav--home .site-nav-home-links {
    flex: 0 1 auto;
    gap: 0.35rem 1.25rem;
    margin-right: auto;
    min-width: 0;
  }

  body.home-page .site-nav--home .nav-refresh-btn {
    flex-shrink: 0;
    margin-left: 0;
    font-size: 1.35rem;
    padding: 0.2rem 0.45rem;
  }

  body.home-page .site-nav--home .site-nav-home-links a {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-decoration: none;
  }

  body.home-page .site-nav--home .site-nav-home-links a:hover {
    text-decoration: underline;
    opacity: 0.88;
  }

  body.home-page .hero-shell {
    padding: 0;
  }

  body.home-page .hero-shell .site-logo {
    margin-bottom: 0.35rem;
  }

  body.home-page .site-header.home-hero {
    margin-bottom: 1.15rem;
  }

  body.home-page .hero-title {
    margin-bottom: 1.125rem;
  }

  body.home-page .hero-subtext.tagline,
  body.home-page .hero-subtext {
    max-width: 42rem;
    margin-bottom: 1.75rem;
    font-size: 1.08rem;
    line-height: 1.55;
  }

  body.home-page .hero-actions {
    gap: 1.125rem 1.35rem;
    margin-bottom: 0.35rem;
  }

  body.home-page .home-auth-section {
    padding: 0;
    margin-top: 0.5rem;
  }

  body.home-page #appSections {
    margin-top: 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.home-page .site-nav--home .nav-menu-toggle-bar {
    transition: none;
  }
}

.small {
  font-size: 0.88rem;
}

.error-text {
  color: var(--color-error);
  font-weight: 600;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.data-table th,
.data-table td {
  border: 1px solid var(--border-subtle);
  padding: 0.45rem 0.6rem;
  text-align: left;
}

.data-table thead {
  background: var(--table-header-bg);
}

.table-wrap {
  overflow: auto;
  margin: 0.5rem 0;
}

.raw-dump {
  font-size: 0.8rem;
  max-height: 200px;
}

.location-links li {
  margin: 0.25rem 0;
}

.location-header h2 {
  margin-bottom: 0.25rem;
}

.location-verified-line {
  margin: 0.35rem 0 0.5rem;
  font-size: 0.95rem;
}

.badge-verified-location {
  display: inline-block;
  font-weight: 700;
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  border-radius: 6px;
  padding: 0.15rem 0.5rem;
  font-size: 0.85rem;
}

.verified-owner-name {
  font-weight: 600;
  color: var(--text-body);
}

.owner-response-block {
  margin-top: 0.75rem;
  padding: 0.65rem 0.75rem;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
}

.owner-response-label {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #0369a1;
}

.owner-response-body {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.45;
}

.owner-response-date {
  margin: 0.35rem 0 0;
}

.owner-response-compose {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px dashed #d1d5db;
}

.owner-response-compose .owner-response-textarea {
  width: 100%;
  margin-bottom: 0.5rem;
}

.business-intro {
  margin-bottom: 1rem;
  line-height: 1.5;
}

.business-claims-table {
  font-size: 0.9rem;
}

.business-operator-card h3 {
  margin-top: 0;
  font-size: 1.05rem;
}

.business-operator-actions {
  margin: 0.75rem 0 0;
}

.map-popup-business-link {
  font-size: 0.9rem;
  font-weight: 600;
}

.leaflet-popup-content .map-popup-business-link {
  display: inline-block;
  margin-top: 0.25rem;
}

.avg-line {
  margin: 0.5rem 0;
}

.avg-label {
  margin: 0.4rem 0 0;
}

.rating-primary {
  display: inline-block;
  font-weight: 600;
}

.rating-sub {
  display: block;
  font-size: 0.9rem;
  color: var(--color-success);
  margin-top: 0.2rem;
}

.review-card {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  background: var(--bg-elevated);
}

.review-meta {
  font-weight: 600;
}

.review-comment {
  margin: 0.35rem 0;
  white-space: pre-wrap;
}

.review-label {
  margin-top: 0.35rem;
}

.map-root {
  height: min(420px, 55vh);
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border-default);
  z-index: 0;
}

.map-card .map-container {
  width: 100%;
  height: 420px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-default);
  box-sizing: border-box;
}

@media (min-width: 1024px) {
  .map-card .map-container {
    height: 520px;
  }
}

.map-card .map-container .map-root {
  height: 100% !important;
  min-height: 100%;
  border: none;
  border-radius: 8px;
}

.map-card .leaflet-container {
  font-family: inherit;
  background: var(--bg-muted);
}

/* ── Home logged-in: route, locations, map (lower half polish) ── */
body.home-page .route-card.card,
body.home-page .locations-card.card,
body.home-page .map-card--home.card,
body.home-page .nearby-card.card,
body.home-page .nearby-partner-card.card {
  border-color: var(--border-card);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

/* ── Home: helpful nearby partner (non-ad tone; config: nearby-partners.json) ── */
body.home-page .nearby-partner-card {
  max-width: var(--home-hero-max);
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1.25rem;
  padding: 0.95rem 1.15rem 1.05rem;
  background: var(--bg-card);
}

.nearby-partner-inner {
  margin: 0;
}

.nearby-partner-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin: 0 0 0.4rem;
  line-height: 1.3;
}

.nearby-partner-message {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-body);
  margin: 0 0 0.55rem;
}

.nearby-partner-link {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--link);
  text-decoration: none;
}

.nearby-partner-link:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.nearby-partner-row + .nearby-partner-row {
  margin-top: 0.95rem;
  padding-top: 0.95rem;
  border-top: 1px solid var(--border-subtle);
}

/* Home: map + helpful nearby — desktop side-by-side, mobile stack (map first)
   Match #appSections > .card width (1100px) so left/right edges line up with other boxes */
body.home-page .map-section-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1.25rem;
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 769px) {
  body.home-page .map-section-grid.map-section-grid--with-partner {
    grid-template-columns: 2fr 1fr;
  }
}

body.home-page .map-section-grid .map-card--home {
  min-width: 0;
  width: 100%;
}

body.home-page .map-section-grid .map-card--home .map-container {
  height: 360px;
}

@media (min-width: 769px) {
  body.home-page .map-section-grid .map-card--home .map-container {
    height: 420px;
  }
}

body.home-page .map-section-grid .nearby-partner-card.nearby-service-card {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  margin-bottom: 0;
  width: 100%;
  min-width: 0;
  height: fit-content;
  align-self: start;
}

@media (min-width: 769px) {
  body.home-page .map-section-grid.map-section-grid--with-partner .nearby-partner-card.nearby-service-card {
    justify-self: center;
    width: fit-content;
    max-width: 100%;
  }
}

.nearby-partner-slot--guest {
  max-width: var(--home-hero-max);
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1.25rem;
}

.nearby-partner-slot--guest > .nearby-partner-card {
  margin-bottom: 0;
}

.route-card-title,
.locations-card-title,
.map-card-title,
.nearby-title {
  margin: 0 0 0.45rem;
  font-size: clamp(1.35rem, 2.2vw, 1.65rem);
  font-weight: 800;
  color: var(--text-heading);
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-align: left;
}

.route-card-lead,
.locations-card-lead,
.map-card-lead,
.nearby-helper {
  margin: 0 0 1.25rem;
  line-height: 1.55;
  max-width: 48rem;
}

.route-form {
  margin: 0;
}

.route-address-grid {
  display: grid;
  gap: 1.35rem 1.75rem;
  margin-bottom: 1.35rem;
}

@media (min-width: 900px) {
  .route-address-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.route-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.route-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-label);
}

.route-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

.route-search-row input[type="text"] {
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--border-input-alt);
  border-radius: 10px;
  font-size: 0.98rem;
  color: var(--text-heading);
  background: var(--bg-input);
  box-sizing: border-box;
  width: 100%;
}

.route-search-row input[type="text"]:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
  border-color: var(--focus-border);
}

.route-find-btn {
  min-height: 46px;
  padding: 0 16px;
  border: none;
  border-radius: 10px;
  background: var(--brand-green);
  color: #fff !important;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  width: auto !important;
  transition: background 0.15s ease;
}

.route-find-btn:hover {
  background: var(--brand-green-hover);
}

.route-field-status {
  min-height: 1.25em;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
}

.route-corridor-field {
  margin-bottom: 1.4rem;
  max-width: 18rem;
}

.route-corridor-field input {
  width: 100%;
  margin-top: 0.35rem;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--border-input-alt);
  border-radius: 10px;
  font-size: 0.98rem;
  box-sizing: border-box;
  background: var(--bg-input);
  color: var(--text-primary);
}

.route-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0;
}

.route-submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.65rem 1.5rem;
  border: none;
  border-radius: 12px;
  background: var(--btn-primary-bg);
  color: #fff !important;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  width: auto !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.22);
  transition: background 0.15s ease, transform 0.12s ease;
}

.route-submit-btn:hover {
  background: var(--btn-primary-hover);
  transform: translateY(-1px);
}

.locations-filters.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.75rem;
  margin: 0 0 1.35rem;
  padding: 1rem 1.1rem;
  background: var(--bg-muted);
  border: 1px solid var(--invite-border);
  border-radius: 12px;
}

.locations-filter-chip {
  padding: 0.4rem 0.55rem;
  margin: 0;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  font-size: 0.92rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.locations-filter-chip:hover {
  border-color: var(--border-input);
  background: var(--bg-muted);
}

.locations-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0 0 1.15rem;
}

.locations-load-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.65rem 1.35rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  border: none;
  width: auto !important;
  transition: opacity 0.15s ease, transform 0.12s ease;
}

.locations-load-btn-primary {
  background: var(--btn-primary-bg);
  color: #fff !important;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.2);
}

.locations-load-btn-primary:hover:not(:disabled) {
  background: var(--btn-primary-hover);
}

.locations-load-btn-secondary {
  background: var(--brand-green);
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(46, 125, 50, 0.18);
}

.locations-load-btn-secondary:hover:not(:disabled) {
  background: var(--brand-green-hover);
}

.location-load-error {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0.75rem 1rem;
  background: var(--alert-error-bg);
  border: 1px solid var(--alert-error-border);
  border-radius: 10px;
  color: var(--alert-error-text);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.45;
}

body.home-page .map-card--home .map-card-lead {
  margin-bottom: 1rem;
}

body.home-page .map-card--home .map-container {
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.07);
  border-color: var(--border-input);
}

@media (max-width: 640px) {
  .route-search-row {
    grid-template-columns: 1fr;
  }

  .route-search-row .route-find-btn {
    width: 100% !important;
  }

  .route-corridor-field {
    max-width: none;
  }

  .locations-filters.filter-row {
    flex-direction: column;
    align-items: stretch;
  }

  .locations-filter-chip {
    width: 100%;
    box-sizing: border-box;
  }

  .locations-actions {
    flex-direction: column;
  }

  .locations-load-btn {
    width: 100% !important;
    justify-content: center;
  }

  .route-submit-btn {
    width: 100% !important;
  }
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  cursor: pointer;
}

.checkbox-label input {
  width: auto;
  margin: 0;
}

.amenity-list {
  margin: 0.35rem 0 0;
  padding-left: 1.2rem;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 0.5rem 0 0.75rem;
}

.admin-dashboard-hint {
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.85rem;
  background: var(--admin-hint-success-bg);
  border: 1px solid var(--admin-hint-success-border);
  border-radius: 8px;
  line-height: 1.45;
  font-size: 0.88rem;
}

.admin-dashboard-hint kbd {
  font-size: 0.8em;
  padding: 0.1rem 0.35rem;
  border: 1px solid var(--border-input);
  border-radius: 4px;
  background: var(--bg-card);
  color: var(--text-primary);
}

.admin-build-fingerprint {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.admin-users-db-notice {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.85rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--accent-info-text);
  background: var(--accent-info-bg);
  border: 1px solid var(--accent-info-border);
  border-radius: 8px;
}

.admin-table-host {
  margin: 1rem 0;
}

.admin-table-title {
  font-size: 1.05rem;
  margin: 1rem 0 0.35rem;
}

.admin-table-host .admin-table-title:first-child {
  margin-top: 0;
}

.admin-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

/* Users table: stack dashboard admin / pwd / badge sections vertically */
/* Two classes ↑ specificity so a later single-class `.admin-inline-actions` rule
   can never squash flex-direction or gap again. */
.admin-inline-actions.admin-inline-actions--users {
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
  max-width: none;
  width: 100%;
  box-sizing: border-box;
  padding: 1rem 1.1rem;
  border: 1px solid var(--invite-border);
  border-radius: 10px;
  border-left: 4px solid var(--btn-primary-bg);
  background: var(--bg-card);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

/* Scope to Users admin table only — last column is Actions */
.admin-table-host .data-table.admin-users-table {
  table-layout: auto;
  width: 100%;
}

.admin-table-host .data-table.admin-users-table th:last-child,
.admin-table-host .data-table.admin-users-table td:last-child {
  min-width: min(23rem, 100%);
  max-width: 32rem;
  vertical-align: top;
  padding: 0.65rem 0.75rem;
}

@media (min-width: 960px) {
  .admin-table-host .data-table.admin-users-table th:last-child,
  .admin-table-host .data-table.admin-users-table td:last-child {
    min-width: 26rem;
  }
}

.admin-inline-actions button {
  padding: 0.35rem 0.55rem;
  font-size: 0.85rem;
}

button.danger {
  background: var(--color-error);
  border-color: var(--color-error);
  color: #fff;
}

button.danger:hover {
  filter: brightness(0.92);
}

.geocode-row {
  display: flex;
  gap: 0.4rem;
  align-items: stretch;
}

.geocode-row input {
  flex: 1;
}

.geocode-row button {
  white-space: nowrap;
  flex-shrink: 0;
}

.geocode-status {
  min-height: 1.2em;
  margin: 0.2rem 0 0.1rem;
}

.always-location-pref {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin: 0.85rem 0 0;
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--text-body);
  cursor: pointer;
}

.always-location-pref input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.always-location-hint {
  margin: 0.35rem 0 0;
  max-width: 36rem;
  line-height: 1.4;
}

.geocode-results {
  list-style: none;
  padding: 0;
  margin: 0 0 0.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.geocode-results li {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.875rem;
  border-bottom: 1px solid #f1f5f9;
  line-height: 1.4;
}

.geocode-results li:last-child {
  border-bottom: none;
}

.geocode-results li:hover {
  background: #eff6ff;
}

/* ── Reviewer link on location detail ── */
.reviewer-link {
  color: var(--link);
  text-decoration: none;
  font-weight: 500;
}
.reviewer-link:hover {
  text-decoration: underline;
}

/* ── Profile page ── */
.profile-hero {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.profile-avatar {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-username {
  margin: 0 0 0.15rem;
  font-size: 1.35rem;
}

.profile-points {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-success);
  margin: 0 0 0.2rem;
}

.profile-info {
  flex: 1;
}

.profile-stats-row {
  display: flex;
  gap: 0.75rem;
  margin: 0 0 1rem;
  flex-wrap: wrap;
}

.profile-followup-note {
  margin: -0.35rem 0 1rem;
  line-height: 1.45;
}

.visitor-trust-accent {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: #0f766e;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.visitor-trust-accent::before {
  content: "✓ ";
}

.profile-stat-card {
  flex: 1;
  min-width: 7rem;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.stat-num {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.3;
}

.profile-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  margin-bottom: 0.6rem;
}

.profile-item-card {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  background: #fafafa;
  transition: background 0.1s;
}

.profile-card-link:hover .profile-item-card {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.profile-review-loc {
  font-weight: 600;
  font-size: 0.95rem;
}

.profile-review-rating {
  font-size: 0.88rem;
  color: var(--link);
}

.profile-review-comment {
  margin: 0.25rem 0 0;
  color: var(--text-body);
  font-size: 0.9rem;
  white-space: pre-wrap;
}

/* ── Admin dashboard ── */
.admin-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 1rem;
}

.admin-header h1 {
  margin: 0 0 0.15rem;
}

.admin-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.admin-stat-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.admin-stat-card--warn {
  border-color: #fde68a;
  background: #fefce8;
}

.admin-stat-card--pts {
  border-color: #a7f3d0;
  background: #ecfdf5;
}

.admin-stat-card--active-warn .admin-stat-num {
  color: #b45309;
}

.admin-stat-num {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
}

.admin-stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-toolbar-card {
  padding: 0.85rem 1rem;
  margin-bottom: 0;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-tool-btn {
  flex: 1 1 auto;
  min-width: 8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.admin-badge {
  background: #ef4444;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 9999px;
  padding: 0.1rem 0.42rem;
  line-height: 1.4;
}

.admin-table-host {
  margin-top: 1rem;
}

.admin-table-title {
  font-size: 1.05rem;
  margin: 1.25rem 0 0.5rem;
  color: #1e3a5f;
}

/* Do not repeat bare `.admin-inline-actions { gap: … }` here — it matches elements
   that also have `.admin-inline-actions--users` and would override their column gap. */

.admin-inline-actions button {
  padding: 0.28rem 0.65rem;
  font-size: 0.82rem;
}

.admin-approve-btn {
  background: #059669;
  color: #fff;
  border-color: #059669;
}

.admin-approve-btn:hover {
  background: #047857;
}

.admin-user-link {
  color: #1e40af;
  font-weight: 600;
  text-decoration: none;
}

.admin-user-link:hover {
  text-decoration: underline;
}

.admin-suspended-tag {
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  border: 1px solid #fecaca;
}

.admin-role-tag {
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  border: 1px solid #bfdbfe;
}

.admin-decision-approved {
  color: #059669;
  font-weight: 600;
}

.admin-decision-rejected {
  color: #b91c1c;
  font-weight: 600;
}

/* Site admin (dashboard) vs profile Founder/Flagged — keep visually separate */
.admin-site-admin-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  width: 100%;
  margin: 0;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid #e2e8f0;
}

.admin-site-admin-label {
  display: block;
  width: 100%;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.35;
  color: #334155;
  margin: 0 0 0.15rem;
}

/* Second line / note under “Dashboard admin” (e.g. You · admin) */
.admin-site-admin-secondary {
  display: block;
  line-height: 1.55;
  font-size: 0.875rem;
  color: #475569;
  margin: 0;
}

.admin-make-admin-btn {
  background: #059669 !important;
  color: #fff !important;
  border-color: #059669 !important;
  font-weight: 600;
}

.admin-make-admin-btn:hover {
  background: #047857 !important;
  border-color: #047857 !important;
}

.admin-user-quick-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.admin-badge-section-label {
  width: 100%;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 0.4rem;
}

.admin-badge-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0;
  padding-top: 0.65rem;
  border-top: 1px solid var(--divider-soft);
}

.admin-badge-select {
  min-width: 11.5rem;
  max-width: 100%;
  font-size: 0.8rem;
  padding: 0.28rem 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--border-input);
  background: var(--bg-input);
  color: var(--text-heading);
}

/* ── Confirmation modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

/* Ensure [hidden] always wins, even when display is set in CSS */
[hidden] {
  display: none !important;
}

.modal-box {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 26rem;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  border: 1px solid var(--border-subtle);
}

.modal-title {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.modal-body {
  margin: 0 0 1.25rem;
  color: var(--modal-body);
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
}

/* ── Location detail page ── */
.location-name {
  margin: 0 0 0.25rem;
  font-size: 1.4rem;
}

.location-addr {
  margin: 0 0 0.75rem;
}

.avg-rating-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

.stars-display {
  color: #f59e0b;
  font-size: 1.25rem;
  letter-spacing: 0.05em;
  line-height: 1;
}

.avg-score {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
}

.review-score {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Amenity chips */
.amenity-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.amenity-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid transparent;
}

.amenity-chip--on {
  background: var(--amenity-on-bg);
  color: var(--amenity-on-text);
  border-color: var(--amenity-on-border);
}

.amenity-chip--off {
  background: var(--bg-elevated);
  color: var(--text-muted);
  border-color: var(--border-subtle);
  text-decoration: line-through;
  opacity: 0.6;
}

/* Star picker (review form) */
.star-picker {
  display: flex;
  gap: 0.2rem;
  margin-bottom: 0.1rem;
}

.star-btn {
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--star-muted);
  cursor: pointer;
  padding: 0.1rem 0.15rem;
  line-height: 1;
  transition: color 0.1s, transform 0.1s;
  width: auto !important;
}

.star-btn--on,
.star-btn--hover {
  color: #f59e0b;
}

.star-btn:hover {
  transform: scale(1.15);
}

/* ── Auth panel toggle buttons ── */
.auth-btn-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.auth-toggle-btn {
  flex: 1;
  padding: 0.7rem 1rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  width: auto !important;
}

.auth-toggle-btn--active,
.auth-toggle-btn:not(.auth-toggle-btn--outline) {
  background: var(--btn-primary-bg);
  color: #fff;
  border: 2px solid var(--btn-primary-border);
}

.auth-toggle-btn--outline {
  background: transparent;
  color: var(--link);
  border: 2px solid var(--link);
}

.auth-toggle-btn--outline:hover {
  background: var(--accent-active-bg);
}

.auth-panel {
  animation: panelIn 0.18s ease;
}

.auth-panel-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
}

@keyframes panelIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Hero "Search Near Me" button ── */
.hero-search {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.hero-near-me-btn {
  font-size: 1.1rem;
  font-weight: 700;
  padding: 0.75rem 2rem;
  border-radius: 9999px;
  background: var(--btn-primary-bg);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  width: auto !important;
  letter-spacing: 0.01em;
}

.hero-near-me-btn:hover:not(:disabled) {
  background: var(--btn-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
}

.hero-near-me-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.hero-near-me-status {
  text-align: center;
  min-height: 1.2em;
}

/* ── Home: mobile search launcher (Find nearby / Route / All) ── */
.search-mode-launcher {
  display: none;
}

.search-mode-launcher-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}

.search-mode-launcher-sub {
  margin: 0 0 0.25rem;
}

.search-mode-btn-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.search-mode-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  text-align: left;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 2px solid var(--invite-border);
  background: var(--bg-muted);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.search-mode-btn:hover {
  border-color: var(--border-input);
  background: var(--bg-card);
}

.search-mode-btn.is-active {
  border-color: var(--btn-primary-bg);
  background: var(--accent-active-bg);
  color: var(--accent-active-text);
}

.search-mode-btn-icon {
  font-size: 1.35rem;
  line-height: 1;
  flex-shrink: 0;
}

.search-mode-btn-label {
  flex: 1;
}

@media (max-width: 768px) {
  #searchModeLauncher.search-mode-launcher {
    display: block;
    margin-bottom: 0.5rem;
  }

  .search-discover-panel:not(.is-mobile-open) {
    display: none !important;
  }

  .search-discover-panel.is-mobile-open {
    display: block !important;
  }

  #searchPanelNearby.nearby-card .nearby-form-actions {
    margin-top: 0.25rem;
  }
}

@media (min-width: 769px) {
  #searchModeLauncher.search-mode-launcher {
    display: none !important;
  }
}

/* ── Find Nearby card (logged-in home) ──
   Uses .card + body.home-page #appSections > .card for same width/padding as Invite / Route. */
.nearby-card-inner {
  max-width: none;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Top row: Search Near Me + Use my location + Search by address */
.nearby-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 12px;
}

.nearby-primary-btn {
  min-height: 40px;
  padding: 8px 14px;
  border: none;
  border-radius: 10px;
  background: var(--btn-primary-bg);
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.14);
  cursor: pointer;
  width: auto !important;
  font-family: inherit;
  transition: background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.nearby-primary-btn:hover:not(:disabled) {
  background: var(--btn-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.24);
}

.nearby-primary-btn:disabled {
  opacity: 0.72;
  cursor: not-allowed;
  transform: none;
}

/* .nearby-helper: spacing/typography aligned via .route-card-lead group; keep color/size */
.nearby-helper {
  font-size: 0.92rem;
  color: var(--text-muted);
}

#searchPanelNearby.nearby-card #nearbyForm,
form#nearbyForm.nearby-form {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  align-items: stretch;
  text-align: left;
}

.nearby-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.nearby-input {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--border-input-alt);
  border-radius: 10px;
  font-size: 0.95rem;
  color: var(--text-heading);
  background: var(--bg-input);
  box-sizing: border-box;
  font-family: inherit;
}

.nearby-input:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
  border-color: var(--focus-border);
}

.nearby-find-btn {
  min-height: 40px;
  padding: 0 16px;
  border: none;
  border-radius: 10px;
  background: #43a047;
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  width: auto !important;
  transition: background 0.15s ease, transform 0.12s ease;
}

.nearby-find-btn:hover {
  background: var(--brand-green-hover);
}

.nearby-status {
  margin: 0 0 8px;
  text-align: left;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text-muted);
  min-height: 1.2em;
}

.nearby-field {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

/* Compact radius row: label + narrow number input */
.nearby-radius-row {
  flex-wrap: wrap;
}

.nearby-radius-row .nearby-label {
  margin: 0;
  white-space: nowrap;
}

.nearby-input.nearby-radius-input,
.nearby-radius-select {
  width: 90px;
  min-width: 90px;
  max-width: 90px;
  flex: 0 0 auto;
}

.nearby-label {
  display: block;
  margin: 0 0 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-label);
}

.nearby-secondary-btn {
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  border: none;
  width: auto !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, opacity 0.15s ease, transform 0.12s ease;
}

.nearby-secondary-btn-primary {
  background: var(--btn-primary-bg);
  color: #ffffff;
}

.nearby-secondary-btn-primary:hover:not(:disabled) {
  background: var(--btn-primary-hover);
}

.nearby-secondary-btn-secondary {
  background: #43a047;
  color: #ffffff;
}

.nearby-secondary-btn-secondary:hover:not(:disabled) {
  background: var(--brand-green-hover);
}

.nearby-secondary-btn:disabled {
  opacity: 0.75;
  cursor: wait;
}

.nearby-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text-body);
  cursor: pointer;
}

.nearby-checkbox-row input {
  margin-top: 2px;
  flex-shrink: 0;
}

.nearby-footnote {
  margin: 0;
  text-align: left;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text-muted);
  max-width: 42.5rem;
}

.nearby-checkbox-row {
  text-align: left;
}

@media (max-width: 640px) {
  .nearby-form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .nearby-form-actions .nearby-primary-btn,
  .nearby-form-actions .nearby-secondary-btn {
    width: 100% !important;
    justify-content: center;
  }

  .nearby-search-row {
    grid-template-columns: 1fr;
  }

  .nearby-find-btn {
    width: 100% !important;
    justify-content: center;
  }

  .nearby-radius-row {
    flex-wrap: wrap;
    align-items: center;
  }

  .nearby-input.nearby-radius-input,
  .nearby-radius-select {
    width: 100%;
    min-width: 0;
    max-width: 120px;
  }
}

/* ── Password show/hide toggle ── */
.pwd-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.pwd-wrapper input[type="password"],
.pwd-wrapper input[type="text"] {
  flex: 1;
  padding-right: 2.5rem !important;
  margin-bottom: 0;
}

.pwd-eye-btn {
  position: absolute;
  right: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-muted);
  padding: 0.25rem;
  width: auto !important;
  line-height: 1;
  opacity: 0.75;
  transition: opacity 0.15s, color 0.15s;
}

.pwd-eye-btn:hover,
.pwd-eye-btn--active {
  opacity: 1;
  color: var(--text-primary);
}

/* ── Reset link display box ── */
.reset-link-box {
  background: var(--bg-muted);
  border: 1px solid var(--invite-border);
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  word-break: break-all;
  font-size: 0.8rem;
  color: var(--text-primary);
}

/* ── Site logo (homepage hero) ── */
.site-logo {
  display: block;
  /* width % is what caps size on phones; max-width lifts the ceiling on wide screens */
  width: min(92%, 640px);
  max-width: 640px;
  margin: 0 auto 0.5rem;
  height: auto;
}

/* ── Nav logo (inline in nav bar) ── */
.nav-logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

/* logo-icon.png is high-res; constrain even if stylesheet order/cache glitches */
.nav-logo {
  height: 72px;
  max-height: 72px;
  width: auto;
  max-width: min(200px, 45vw);
  object-fit: contain;
  display: block;
  vertical-align: middle;
}

/* ── Nav refresh button ── */
.nav-refresh-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--nav-icon);
  cursor: pointer;
  padding: 0.1rem 0.3rem;
  width: auto !important;
  line-height: 1;
  border-radius: 4px;
  transition: color 0.15s, transform 0.3s;
}

.nav-refresh-btn:hover {
  color: var(--link);
  transform: rotate(180deg);
}

/* ── Pull-to-refresh indicator ── */
.pull-indicator {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  background: var(--btn-primary-bg);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 1.2rem;
  border-radius: 0 0 20px 20px;
  opacity: 0;
  pointer-events: none;
  z-index: 999;
  transition: opacity 0.15s;
  white-space: nowrap;
}

/* ── Nav logout button ── */
.nav-logout-btn {
  background: none;
  border: 1px solid var(--border-default);
  color: var(--nav-icon);
  font-size: 0.85rem;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  width: auto !important;
  line-height: 1.4;
}

.nav-logout-btn:hover {
  background: var(--bg-muted);
  border-color: var(--border-default);
  color: var(--text-body);
}

/* ── Account settings page ── */
.page-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0 0 1.25rem;
}

.card-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
}

.field-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0.75rem 0 0.25rem;
  color: var(--text-label);
}

.success-text { color: var(--color-success); }

/* ── Review edit form ── */
.review-edit-form {
  padding: 0.5rem 0;
}

.review-edit-timer,
.review-edit-timer-inline {
  font-size: 0.8rem;
}

.btn-sm {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid var(--btn-primary-border);
  background: var(--btn-primary-bg);
  color: #fff;
  width: auto !important;
}

.btn-sm.secondary {
  background: var(--brand-green);
  color: #fff;
  border-color: var(--brand-green);
}

.btn-sm.secondary:hover {
  background: var(--brand-green-hover);
  border-color: var(--brand-green-hover);
  color: #fff;
}

/* ── .btn (anchor that looks like a button) ── */
.btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background: var(--btn-primary-bg);
  color: #fff;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--btn-primary-border);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn:hover {
  background: var(--btn-primary-hover);
  border-color: var(--btn-primary-hover);
  color: #fff;
}

.btn.btn-outline {
  background: transparent;
  color: var(--link);
  border-color: var(--link);
}

.btn.btn-outline:hover {
  background: var(--accent-active-bg);
}

/* ── btn-link (anchor styled as a button) ── */
.btn-link {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  background: var(--btn-primary-bg);
  color: #fff;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s;
}

.btn-link:hover {
  background: var(--btn-primary-hover);
}

.btn-link.secondary {
  background: var(--bg-card);
  color: var(--brand-green-hover);
  border: 1px solid var(--brand-green);
}

.btn-link.secondary:hover {
  background: var(--brand-green-soft);
  color: var(--brand-green-hover);
}

/* ── Leaderboard page ── */
.lb-card {
  padding: 1.25rem;
  margin-bottom: 0;
}

.lb-header-row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.15rem;
}

.lb-title {
  margin: 0;
}

.lb-count {
  flex-shrink: 0;
}

.lb-earn-note {
  margin: 0 0 1.1rem;
}

.lb-auth-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  background: var(--accent-info-bg);
  border: 1px solid var(--accent-info-border);
  border-radius: 8px;
  padding: 0.65rem 1rem;
  margin-bottom: 1rem;
}

.lb-auth-name {
  font-weight: 600;
  color: var(--accent-info-text);
}

.lb-auth-rank {
  flex: 1;
}

.lb-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.lb-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  transition: background 0.1s;
}

.lb-row:hover {
  background: var(--bg-row-hover);
  border-color: var(--accent-row-hover-border);
}

.lb-row--top {
  background: var(--bg-row-highlight);
  border-color: var(--lb-row-top-border);
}

.lb-row--top:hover {
  background: var(--bg-row-highlight-hover);
}

.lb-rank {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-muted);
  min-width: 2rem;
  text-align: center;
  flex-shrink: 0;
}

.lb-medal {
  font-size: 1.2rem;
}

.lb-avatar {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
  color: #fff;
}

.lb-avatar--rank1 { background: #f59e0b; }
.lb-avatar--rank2 { background: #6b7280; }
.lb-avatar--rank3 { background: #b45309; }
.lb-avatar--rank4 { background: #2563eb; }

.lb-user {
  flex: 1;
  min-width: 0;
}

.lb-name {
  font-weight: 600;
  color: #1e40af;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.lb-name:hover {
  text-decoration: underline;
}

.lb-pts {
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-success);
  flex-shrink: 0;
  text-align: right;
}

.lb-pts-label {
  font-size: 0.8rem;
  font-weight: 400;
}

.leaderboard-cta-panel {
  max-width: 100%;
  margin: 24px auto 8px;
  padding: 30px 24px;
  border-radius: 16px;
  background: #f8fbff;
  border: 1px solid #dbe7f5;
  text-align: center;
  box-sizing: border-box;
}

.leaderboard-cta-title {
  margin: 0 0 8px;
  font-size: clamp(1.35rem, 3.5vw, 2rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-heading);
  letter-spacing: -0.02em;
}

.leaderboard-cta-text {
  margin: 0 auto 18px;
  max-width: 36rem;
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.leaderboard-cta-actions {
  display: flex;
  justify-content: center;
  align-items: center;
}

.leaderboard-cta-button {
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: #2563eb;
  color: #ffffff !important;
  border: none;
  cursor: pointer;
  box-sizing: border-box;
  width: 100%;
  max-width: 22rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

.leaderboard-cta-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.25);
  background: #1d4ed8;
  opacity: 0.96;
}

@media (max-width: 520px) {
  .hero-shell {
    padding: 0 16px;
  }

  .home-auth-section {
    padding: 0 16px;
  }

  .hero-actions .hero-cta {
    min-width: 100%;
    max-width: none;
  }

  .leaderboard-cta-panel {
    margin-top: 18px;
    padding: 22px 16px 24px;
    border-radius: 14px;
  }

  .leaderboard-cta-text {
    margin-bottom: 14px;
    font-size: 1rem;
  }

  .leaderboard-cta-button {
    max-width: none;
    width: 100%;
  }
}

/* ── Submit page ── */
.submit-auth-gate {
  text-align: center;
  padding: 2rem;
}

.submit-auth-gate p {
  margin: 0 0 1rem;
  color: var(--text-body);
}

.submit-points-note {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--brand-green-soft);
  border-color: var(--home-green-hint-border);
  color: var(--text-primary);
  flex-wrap: wrap;
}

.submit-points-note .muted {
  color: var(--text-muted);
}

.submit-pts-badge {
  background: #059669;
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  flex-shrink: 0;
}

.submit-success {
  text-align: center;
  padding: 2rem;
}

.submit-success-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.submit-success h2 {
  margin: 0 0 0.5rem;
}

.submit-success p {
  margin: 0 0 1.5rem;
  color: var(--text-body);
}

.submit-cta-btn {
  margin-top: 0.5rem;
  width: 100%;
}

.submit-page .field-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-label);
  margin-bottom: 0.2rem;
}

.required-star {
  color: #ef4444;
}

.amenity-fieldset {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin: 0.25rem 0 0.75rem;
}

.amenity-fieldset legend {
  padding: 0 0.4rem;
}

/* ── User badges (Founder, etc.) ── */
.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  white-space: nowrap;
  vertical-align: middle;
  letter-spacing: 0.02em;
}

.user-badge--founder {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
  border: 1px solid #fcd34d;
  box-shadow: 0 1px 3px rgba(251, 191, 36, 0.3);
}

.user-badge--flagged {
  background: linear-gradient(135deg, #fef2f2, #fecaca);
  color: #991b1b;
  border: 1px solid #f87171;
  box-shadow: 0 1px 3px rgba(239, 68, 68, 0.2);
}

.admin-user-badge-hint {
  font-size: 0.75rem;
  color: #92400e;
  font-weight: 600;
}

/* ── Point-based contributor tiers (GasBuddy-style trust ladder) ── */
.contributor-stack {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.4rem;
  vertical-align: middle;
}

.tier-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.12rem 0.5rem;
  border-radius: 9999px;
  white-space: nowrap;
  border: 1px solid transparent;
  line-height: 1.2;
}

.tier-band {
  font-size: 0.85em;
}

.tier-blurb {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  line-height: 1.35;
}

.tier-pill--tier_new {
  background: #fffbeb;
  color: #854d0e;
  border-color: #fcd34d;
}

.tier-pill--tier_verified {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #93c5fd;
}

.tier-pill--tier_scout {
  background: #faf5ff;
  color: #6b21a8;
  border-color: #d8b4fe;
}

.tier-pill--tier_trusted {
  background: #ecfdf5;
  color: #047857;
  border-color: #6ee7b7;
}

.tier-pill--tier_top {
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
  color: #9a3412;
  border-color: #fdba74;
}

.profile-tier-block {
  margin: 0.5rem 0 1rem;
}

.lb-tier {
  margin-top: 0.25rem;
}

.lb-tier .contributor-stack {
  flex-direction: column;
  align-items: flex-start;
}

.reviewer-block {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  vertical-align: middle;
}

.review-helpful-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.65rem;
  padding-top: 0.5rem;
  border-top: 1px solid #e2e8f0;
}

.review-helpful-row--readonly {
  border-top: 1px solid #e2e8f0;
  margin-top: 0.65rem;
  padding-top: 0.5rem;
}

.review-helpful-btn {
  font-size: 0.78rem;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  cursor: pointer;
  font-weight: 600;
}

.review-helpful-btn:hover:not(:disabled) {
  border-color: #94a3b8;
  background: #f8fafc;
}

.review-helpful-btn--on {
  background: #ecfdf5;
  border-color: #34d399;
  color: #047857;
}

.review-helpful-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.review-followup-block {
  margin-top: 0.65rem;
  padding-top: 0.5rem;
  border-top: 1px dashed #cbd5e1;
}

.review-followup-block--readonly {
  border-top: 1px dashed #e2e8f0;
}

.review-followup-freshness {
  margin: 0 0 0.35rem;
  line-height: 1.35;
}

.review-followup-counts {
  margin: 0 0 0.5rem;
}

.review-followup-hint {
  display: block;
  margin-bottom: 0.35rem;
}

.review-followup-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.review-followup-btn {
  font-size: 0.72rem;
  padding: 0.22rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border-input);
  background: var(--bg-muted);
  color: var(--text-label);
  cursor: pointer;
  font-weight: 600;
}

.review-followup-btn:hover:not(:disabled) {
  border-color: var(--text-muted);
  background: var(--bg-card);
}

.review-followup-btn--on {
  background: var(--amenity-on-bg);
  border-color: var(--amenity-on-border);
  color: var(--amenity-on-text);
}

.review-followup-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.review-followup-yours {
  margin: 0.35rem 0 0;
}

.review-followup-err {
  margin-top: 0.35rem;
  margin-bottom: 0;
}

/* ── Bottom navigation bar (mobile app-style) ── */
.bottom-nav {
  display: none; /* desktop: hidden; shown only on mobile below */
}

@media (max-width: 768px) {
  /* Extra bottom padding so content clears the fixed nav */
  .container {
    padding-bottom: 5.5rem;
  }

  /* Top nav → keep only logo + refresh (+ Admin when shown — see below) */
  .site-nav > a:not(.nav-logo-link):not(#adminLink) {
    display: none !important;
  }
  .site-nav > span:not(#navAdminLink) {
    display: none !important;
  }

  .site-nav {
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0.25rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-subtle);
  }

  /* Fixed bottom nav bar */
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: var(--bnav-bg);
    border-top: 1px solid var(--border-subtle);
    z-index: 200;
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -2px 10px var(--bnav-shadow);
  }

  .bnav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 0.25rem 0.4rem;
    text-decoration: none;
    color: var(--bnav-inactive);
    gap: 0.18rem;
    transition: color 0.15s;
    -webkit-tap-highlight-color: transparent;
    min-width: 0;
  }

  .bnav-item--active {
    color: var(--link);
  }

  .bnav-item:active {
    color: var(--link-hover);
  }

  .bnav-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
  }

  .bnav-label {
    font-size: 0.65rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.01em;
    white-space: nowrap;
  }

  /* Highlight the "Near Me" tab slightly to draw attention */
  .bnav-item[data-page="nearme"] .bnav-icon {
    color: inherit;
  }
}

/* ── Mobile-first responsive adjustments ── */
@media (max-width: 600px) {
  .container {
    padding: 0.6rem;
  }

  .card {
    padding: 0.85rem;
    border-radius: 8px;
  }

  .site-header h1 {
    font-size: 1.4rem;
  }

  input,
  textarea,
  button {
    font-size: 1rem;    /* prevent iOS auto-zoom (needs >= 16px; this is a step up) */
    padding: 0.65rem 0.7rem;
  }

  button {
    width: 100%;
  }

  .actions {
    flex-direction: column;
  }

  .actions button {
    width: 100%;
  }

  .geocode-row button {
    width: auto;        /* keep "Find" button inline */
  }

  .user-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .user-banner-meta {
    flex-wrap: wrap;
  }

  .small-btn {
    width: auto !important;
  }

  .profile-stats-row {
    gap: 0.5rem;
  }

  .profile-stat-card {
    min-width: 5.5rem;
    padding: 0.65rem 0.5rem;
  }

  .stat-num {
    font-size: 1.4rem;
  }

  .data-table {
    font-size: 0.85rem;
  }

  .data-table th,
  .data-table td {
    padding: 0.35rem 0.4rem;
  }
}
