:root {
  --bg: #011F1F;
  --bg-soft: #0a2e2e;
  --cream: #eeede7;
  --accent: #00B388;
  --accent-dark: #00906e;
  --ink: #f7f7f2;
  --muted: rgba(247, 247, 242, 0.72);
  --card: #ffffff;
  --card-ink: #122;
  --line: #e5e2d9;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --radius: 14px;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  background:
    radial-gradient(circle at top right, rgba(0, 179, 136, 0.18), transparent 40%),
    linear-gradient(165deg, var(--bg), var(--bg-soft));
  color: var(--ink);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.page { padding: 1.25rem 1rem 3rem; }
.container { max-width: 960px; margin: 0 auto; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.brand-link { display: inline-flex; align-items: baseline; gap: 0.35rem; color: inherit; text-decoration: none; }
.brand {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
}
.cross { color: var(--accent); font-size: 1.2rem; }
.nav { display: flex; gap: 0.85rem; align-items: center; }
.nav a { color: var(--ink); font-weight: 600; }

.hero {
  text-align: center;
  padding: 2.5rem 1rem 2rem;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  margin: 0 0 0.75rem;
  line-height: 1.15;
}
.hero p { color: var(--muted); font-size: 1.1rem; max-width: 36rem; margin: 0 auto 1.5rem; }

.panel {
  background: var(--card);
  color: var(--card-ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.panel h2, .panel h3 { margin-top: 0; font-family: var(--font-display); }

.stack { display: grid; gap: 0.85rem; }
label { display: grid; gap: 0.35rem; font-weight: 600; font-size: 0.92rem; }
input, textarea, select {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid #d5d1c7;
  border-radius: 10px;
  font: inherit;
  background: #fff;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 179, 136, 0.18);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 10px;
  padding: 0.8rem 1.2rem;
  font-weight: 700;
  cursor: pointer;
  font: inherit;
}
.btn-primary { background: var(--accent); color: #042; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary { background: #e8e5dc; color: #122; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid rgba(255,255,255,0.25); }
.btn-sm { padding: 0.45rem 0.8rem; font-size: 0.9rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
  background: rgba(255,255,255,0.06);
  padding: 0.35rem;
  border-radius: 999px;
}
.tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 0.65rem;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}
.tab.active { background: var(--cream); color: #122; }

.card-list { display: grid; gap: 0.75rem; }
.item-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}
.item-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.item-card h3 { margin: 0 0 0.35rem; }
.hub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  text-decoration: none;
  color: var(--card-ink);
}
.hub-row h3 { margin: 0 0 0.2rem; font-family: var(--font-display); }
.hub-row .hub-chevron { color: var(--accent); font-size: 1.5rem; font-weight: 700; }
.hub-row:hover .hub-chevron { transform: translateX(2px); }
.listing-card {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.15s, transform 0.15s;
}
.listing-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.listing-media {
  min-height: 112px;
  background: #e8f5f1;
  overflow: hidden;
}
.listing-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  min-height: 112px;
}
.listing-media-empty {
  display: grid;
  place-items: center;
  color: #067a5c;
  font-weight: 700;
  font-size: 0.85rem;
}
.listing-body { padding: 0.85rem 0.85rem 0.85rem 0; }
.listing-body h3 { margin: 0 0 0.25rem; font-size: 1.05rem; }
.listing-body p { margin: 0.2rem 0; }
.listing-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-top: 0.45rem;
}
.stars { color: #d4a017; letter-spacing: 0.05em; }
.stars .dim { color: #ddd; }
.badge-open { background: rgba(0, 179, 136, 0.18); }
.detail-hero {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 12px;
  margin: 0.75rem 0 1rem;
}
.hours-list {
  margin: 0;
  padding-left: 1.1rem;
  color: #445;
}
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
.photo-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
}
.muted { color: #667; }
.link-faint {
  display: block;
  width: 100%;
  margin-top: 1rem;
  padding: 0.5rem;
  border: none;
  background: none;
  color: #9aa0a6;
  font-size: 0.85rem;
  text-align: center;
  cursor: pointer;
  opacity: 0.75;
}
.link-faint:hover { opacity: 1; color: #667; }
.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(0, 179, 136, 0.12);
  color: #067a5c;
}
.alert {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
}
.alert-error { background: var(--danger-bg); color: var(--danger); border: 1px solid #fecaca; }
.alert-info { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.hidden { display: none !important; }
.row { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.grow { flex: 1; min-width: 180px; }
.search-results { max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.search-results button {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 0.75rem 1rem;
  cursor: pointer;
}
.search-results button:hover { background: #f7f5ef; }
.step-dots { display: flex; gap: 0.35rem; margin-bottom: 1rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #ddd; }
.dot.on { background: var(--accent); }

.church-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem;
  margin-bottom: 1.1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f7f5ef;
}
.church-card-photo {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  background: #e8e4d8;
}
.church-card-photo-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: #8a8678;
}
.church-card-addr {
  margin: 0.2rem 0 0;
  font-size: 0.88rem;
}

/* List / Map toggle */
.view-toggle {
  display: inline-flex;
  gap: 0.25rem;
  background: #f0eee7;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem;
  margin-bottom: 0.9rem;
}
.view-btn {
  border: none;
  background: none;
  color: #667;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.4rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
}
.view-btn.active { background: var(--accent); color: #042018; }
.map-canvas {
  width: 100%;
  height: 420px;
  border-radius: var(--radius);
  overflow: hidden;
  background: #dfeee9;
}

/* Activity feed (Home) */
.feed-composer {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.feed-composer textarea {
  min-height: 84px;
  resize: vertical;
}
.feed-composer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}
.feed-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.7rem;
  cursor: default;
  transition: border-color 0.15s, transform 0.15s;
}
.feed-card[data-clickable="1"] { cursor: pointer; }
.feed-card[data-clickable="1"]:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.feed-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}
.feed-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #067a5c;
}
.feed-label-deal_added { color: #a67c00; }
.feed-label-job_added { color: #2563eb; }
.feed-label-event_added { color: #c2410c; }
.feed-label-post { color: #6d28d9; }
.event-when {
  font-weight: 700;
  color: #067a5c;
  font-size: 0.9rem;
}
.feed-card-body {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  align-items: start;
}
.feed-card-body:not(:has(.feed-thumb)) { grid-template-columns: 1fr; }
.feed-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 12px;
  background: #e8f5f1;
}
.feed-card h3 { margin: 0 0 0.2rem; font-size: 1.05rem; }
.feed-card p { margin: 0.2rem 0; }

/* Business profile page */
.business-profile { margin-bottom: 2rem; }
.profile-hero {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 7;
}
.profile-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-head {
  background: var(--card);
  color: var(--card-ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-top: -2.75rem;
  margin-left: 1rem;
  margin-right: 1rem;
  position: relative;
}
.profile-head h1 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.9rem;
  line-height: 1.1;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.75rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.1rem; }
.profile-address { margin: 1rem 0 0; }
.badge-closed { background: rgba(185, 28, 28, 0.12); color: #b91c1c; }
.profile-section {
  background: var(--card);
  color: var(--card-ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.5rem;
  margin: 1rem 0;
}
.profile-section h2 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
}
.profile-section p { color: #334; line-height: 1.6; margin: 0.35rem 0; }
.review { border-top: 1px solid var(--line); padding: 0.9rem 0; }
.review:first-of-type { border-top: none; padding-top: 0; }
.review-head { display: flex; gap: 0.65rem; align-items: center; margin-bottom: 0.5rem; }
.review-avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.review-avatar-empty { display: inline-block; background: #e3e0d7; }
.owner-avatar-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: #556;
  flex: 0 0 auto;
}
.owner-note .review-head strong { font-size: 1rem; }
.mini-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.6rem;
}
.mini-card h3 { margin: 0 0 0.25rem; font-size: 1.02rem; }
.mini-card:last-child { margin-bottom: 0; }

@media (max-width: 700px) {
  .topbar { flex-direction: column; align-items: flex-start; }
  .nav { width: 100%; justify-content: space-between; }
  .profile-head { margin-left: 0; margin-right: 0; }
}
