:root {
  --bg: #f6f8ee;
  --card: #ffffff;
  --text: #20281a;
  --muted: #7c8570;
  --line: #dfe6c9;
  --accent: #6f9138;
  --accent-soft: #e4ecd2;
  --accent-text: #4f6b23;
  --secondary: #e2792c;
  --secondary-soft: #fbe6d3;
  --live: #4c9a6a;
  --shadow: 0 12px 28px rgba(32, 40, 26, 0.06);
}

:root[data-theme='dark'] {
  --bg: #171d13;
  --card: #202b19;
  --text: #eef3e3;
  --muted: #a5ad97;
  --line: #37432c;
  --accent: #94c05a;
  --accent-soft: #2c3822;
  --accent-text: #b8dd85;
  --secondary: #e89a5c;
  --secondary-soft: #3a2d1e;
  --live: #6cb98a;
  --shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.2s ease, color 0.2s ease;
}

.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 72px;
}

/* Desktop reading order is brand, search, sort toggle, nav — the toggle
   sits right of the search bar. `order` (not DOM order) drives this so the
   860px breakpoint below can reset it back to source order for the stacked
   mobile layout without duplicating markup. */
.business-search-wrap {
  order: 1;
}

.sort-toggle {
  order: 2;
}

.nav-actions {
  order: 3;
  margin-left: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  text-decoration: none;
}

.sort-toggle {
  display: flex;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
}

.business-search-wrap {
  position: relative;
  width: 320px;
  max-width: 100%;
}

.business-search-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 54px 10px 18px;
  font: inherit;
  font-size: 0.9rem;
  background: var(--bg);
  color: var(--text);
}

/* Smaller than the typed-text size so the full "zip code, city, or category"
   hint fits without getting clipped at the input's fixed 320px width. */
.business-search-input::placeholder {
  font-size: 0.78rem;
}

.business-search-clear {
  position: absolute;
  right: 34px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  padding: 4px;
  line-height: 1;
  font-size: 0.8rem;
  color: var(--muted, #888);
  cursor: pointer;
  border-radius: 50%;
}

.business-search-clear:hover {
  color: var(--text);
}

.business-search-spinner {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 0.9rem;
}

.search-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 4px;
  max-height: 260px;
  overflow-y: auto;
  z-index: 20;
}

.search-suggestion-item {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  background: none;
  border: none;
  border-radius: 10px;
  padding: 9px 12px;
  font: inherit;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
}

.search-suggestion-item:hover,
.search-suggestion-item:focus {
  background: var(--accent-soft);
  color: var(--accent-text);
  outline: none;
}

/* Set apart from plain location suggestions below it, since picking this one
   applies a category filter rather than searching by location. */
.search-suggestion-category {
  font-weight: 700;
  color: var(--accent-text);
  border-bottom: 1px solid var(--line);
  border-radius: 10px 10px 0 0;
  margin-bottom: 2px;
}

.sort-btn {
  border: none;
  background: transparent;
  padding: 8px 16px;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--muted);
  cursor: pointer;
}

.sort-btn.active {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.nav-actions {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.nav-actions a,
.nav-actions .nav-link-btn {
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
}

.account-menu {
  position: relative;
  display: flex;
  align-items: center;
}

.account-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--secondary));
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.account-avatar-lg {
  width: 44px;
  height: 44px;
  font-size: 1rem;
  cursor: default;
}

.account-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 240px;
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  padding: 8px;
  z-index: 60;
}

.account-dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px 14px;
}

.account-dropdown-info {
  min-width: 0;
}

.account-name {
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-email {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-dropdown-divider {
  height: 1px;
  background: var(--line);
  margin: 0 0 8px;
}

.account-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 10px;
  border-radius: 8px;
  border: none;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
}

.account-dropdown-item:hover {
  background: var(--accent-soft);
}

.nav-cta {
  background: var(--accent);
  color: white;
  padding: 9px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: none;
}

.nav-link-btn {
  background: none;
  border: none;
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}

.icon-btn {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  font-size: 1rem;
  cursor: pointer;
}

.hero-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 28px 20px 16px;
  text-align: center;
}

.visitor-counter-hero {
  display: inline-block;
  margin-bottom: 14px;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 0.82rem;
  font-weight: 700;
}

.hero-section h1 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 4.5vw, 2.9rem);
  font-weight: 800;
  line-height: 1.1;
}

.hero-sub {
  color: var(--muted);
  margin: 0;
  font-size: 1.02rem;
}

.hero-sub strong {
  color: var(--accent-text);
}

.post-form {
  display: grid;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 12px;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.how-it-works {
  max-width: 1080px;
  margin: 0 auto;
  padding: 50px 20px 60px;
}

.how-it-works h2 {
  text-align: center;
  font-size: 1.5rem;
  margin: 0 0 8px;
}

.how-it-works-sub {
  text-align: center;
  color: var(--muted);
  margin: 0 0 32px;
}

.how-it-works-steps {
  display: grid;
  gap: 18px;
}

.how-step-row {
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px 24px;
  text-align: left;
}

.how-step-row:nth-child(even) {
  flex-direction: row-reverse;
}

.how-step-visual {
  flex: 0 0 auto;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}

.how-step-content {
  flex: 1 1 auto;
  min-width: 0;
}

.how-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.how-step-title {
  font-weight: 700;
  margin-bottom: 4px;
  font-size: 1.05rem;
}

.how-step-text {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.how-it-works-cta {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .how-step-row,
  .how-step-row:nth-child(even) {
    flex-direction: column;
    text-align: center;
  }
}

.my-business-list {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  text-align: left;
}

.my-business-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.my-business-card-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.my-business-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.status-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--muted);
}

.status-badge.approved {
  color: var(--accent-text);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.status-badge.pending {
  color: #b8860b;
  border-color: #b8860b;
}

.status-badge.rejected {
  color: crimson;
  border-color: crimson;
}

.add-business-btn {
  margin-bottom: 16px;
}

.business-form-heading {
  text-align: left;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.posting-for-label {
  text-align: left;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-text);
  background: var(--accent-soft);
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.business-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.link-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}

.business-info-body {
  text-align: left;
  font-size: 0.9rem;
  color: var(--muted);
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.business-info-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.link-icon {
  flex: 0 0 auto;
  display: block;
}

.link-chip .link-icon,
.link-chip .share-icon {
  width: 15px;
  height: 15px;
}

.share-business-btn {
  font: inherit;
  cursor: pointer;
}

.trust-badge {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-text);
}

.business-info-images {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}

.business-info-images img {
  width: 100px;
  height: 100px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--line);
  cursor: pointer;
}

.business-info-placeholder {
  width: 100%;
  height: 100px;
  border-radius: 12px;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  margin-bottom: 2px;
}

.business-info-section-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-top: 2px;
}

.sales-chart-empty {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  padding: 14px 14px 10px;
}

.sales-chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 48px;
}

.sales-chart-bars span {
  flex: 1;
  height: 30%;
  background: var(--line);
  border-radius: 3px 3px 0 0;
}

.sales-chart-empty-label {
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 8px;
}

.business-name-btn {
  border: none;
  background: transparent;
  color: inherit;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  text-align: left;
}

.business-name-btn:hover,
.business-name-btn:focus-visible {
  color: var(--accent-text);
  text-decoration: underline;
}

.comments-modal-business {
  color: var(--accent-text);
  font-weight: 800;
}

.postbar,
.postbar-extra {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.postbar-extra {
  border-top: 1px dashed var(--line);
  padding-top: 10px;
}

.postbar input,
.postbar select,
.postbar-extra input,
.postbar-extra select,
.postbar-extra textarea {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 14px;
  font: inherit;
  background: var(--bg);
  color: var(--text);
}

.postbar-extra textarea {
  width: 100%;
  resize: vertical;
  box-sizing: border-box;
}

.whatsapp-field {
  display: flex;
  gap: 6px;
  flex: 1 1 220px;
  min-width: 0;
}

.whatsapp-field input {
  flex: 1 1 auto;
  min-width: 0;
}

.flag-icon {
  display: inline-block;
  width: 18px;
  height: 13px;
  border-radius: 2px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.flag-us {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 14'%3E%3Crect width='20' height='14' fill='%23B22234'/%3E%3Crect y='1.08' width='20' height='1.08' fill='%23fff'/%3E%3Crect y='3.23' width='20' height='1.08' fill='%23fff'/%3E%3Crect y='5.38' width='20' height='1.08' fill='%23fff'/%3E%3Crect y='7.54' width='20' height='1.08' fill='%23fff'/%3E%3Crect y='9.69' width='20' height='1.08' fill='%23fff'/%3E%3Crect y='11.85' width='20' height='1.08' fill='%23fff'/%3E%3Crect width='8' height='7.54' fill='%233C3B6E'/%3E%3C/svg%3E");
}

.flag-in {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 14'%3E%3Crect width='20' height='4.67' fill='%23FF9933'/%3E%3Crect y='4.67' width='20' height='4.67' fill='%23fff'/%3E%3Crect y='9.33' width='20' height='4.67' fill='%23138808'/%3E%3Ccircle cx='10' cy='7' r='1.6' fill='none' stroke='%23000080' stroke-width='0.3'/%3E%3C/svg%3E");
}

.country-select {
  position: relative;
  flex: 0 0 auto;
}

.country-select-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.country-select-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 20;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  min-width: 180px;
  overflow: hidden;
}

.country-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: none;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
}

.country-option:hover {
  background: var(--accent-soft);
}

#locationInput {
  flex: 1 1 200px;
  min-width: 0;
}

#postContentInput,
#businessNameInput {
  flex: 1 1 260px;
  min-width: 0;
}

#zoomInput {
  flex: 1 1 220px;
  min-width: 0;
}

.image-preview {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.image-preview:empty {
  display: none;
}

.image-preview-item {
  position: relative;
  width: 56px;
  height: 56px;
}

.image-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.image-preview-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: white;
  font-size: 0.7rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}

#nameInput {
  flex: 0 0 140px;
}

#dishInput {
  flex: 1 1 260px;
  min-width: 0;
}

#categorySelect {
  flex: 0 0 150px;
}

.photo-btn {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  padding: 13px 16px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
}

.post-btn {
  flex: 0 0 auto;
  border: none;
  background: var(--accent);
  color: white;
  padding: 13px 26px;
  border-radius: 12px;
  font-weight: 700;
  font: inherit;
  cursor: pointer;
}

.post-btn:hover {
  filter: brightness(1.05);
}

.form-message {
  margin-top: 0;
  font-weight: 600;
  color: var(--accent-text);
}

.form-message:not(:empty) {
  margin-top: 10px;
}

.main-content {
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px 20px 60px;
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 24px;
  align-items: start;
}

.sidebar {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 110px);
  display: flex;
  flex-direction: column;
}

.mobile-filter-toggle,
.mobile-filter-close {
  display: none;
}

.sidebar-heading {
  font-weight: 800;
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.sidebar-heading-spaced {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.business-online-toggle-row {
  padding-top: 0;
  border-top: none;
}

.online-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
}

.online-toggle-label input[type='checkbox'] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

#businessCountrySelect {
  flex: 1 1 260px;
  min-width: 0;
}

.location-line-online {
  display: inline-block;
  color: var(--muted);
  font-size: 0.86rem;
}

.tag-online {
  background: var(--accent-soft);
  color: var(--accent-text);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.78rem;
  font-weight: 700;
}

.location-autocomplete-wrap {
  width: 100%;
  margin-bottom: 8px;
}

.location-autocomplete-wrap gmp-place-autocomplete {
  width: 100%;
}

.postbar-extra .location-autocomplete-wrap {
  flex: 1 1 200px;
  min-width: 0;
  margin-bottom: 0;
}

.nearby-section {
  transition: opacity 0.15s ease;
}

.nearby-section.inactive {
  opacity: 0.45;
}

.radius-slider-wrap {
  margin-bottom: 8px;
}

.radius-slider-label {
  display: block;
  font-size: 0.86rem;
  color: var(--text);
  margin-bottom: 6px;
}

.radius-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: var(--line);
  outline: none;
  margin: 0;
}

.radius-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px var(--accent);
  cursor: pointer;
}

.radius-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px var(--accent);
  cursor: pointer;
}

.radius-slider::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: var(--line);
}

.nearby-status {
  font-size: 0.8rem;
  min-height: 16px;
}

.location-map-wrap {
  border-top: 1px dashed var(--line);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.location-map {
  width: 100%;
  height: 220px;
  border-radius: 12px;
  border: 1px solid var(--line);
  overflow: hidden;
}

.location-map-hint {
  font-size: 0.8rem;
}

.category-list {
  display: grid;
  gap: 4px;
}

#categoryList {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.category-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: none;
  background: transparent;
  padding: 9px 10px;
  border-radius: 10px;
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.category-item:hover {
  background: var(--bg);
}

.category-item.active {
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 700;
}

.category-item .count {
  color: var(--muted);
  font-size: 0.82rem;
}

.category-item.active .count {
  color: var(--accent-text);
}

.leaderboard-meta {
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 14px;
  font-weight: 600;
}

.post-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 18px;
  align-items: stretch;
}

.post-list-sentinel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
  padding: 16px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.post-list-sentinel .spinner {
  border-color: var(--line);
  border-top-color: var(--accent);
}

.post-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}

.post-card.rank-1 {
  border-color: var(--accent);
}

.post-card.rank-2,
.post-card.rank-3 {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}

.post-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--bg);
  flex: 0 0 auto;
}

.rank-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.76rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

/* Gold/silver/bronze so the top 3 read as an actual ranking against any photo,
   not just another dark overlay chip. */
.post-card.rank-1 .rank-badge {
  width: 34px;
  height: 34px;
  font-size: 0.85rem;
  background: linear-gradient(135deg, #ffe08a, #d79f1e);
  color: #4a3200;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85), 0 2px 8px rgba(0, 0, 0, 0.3);
}

.post-card.rank-2 .rank-badge {
  background: linear-gradient(135deg, #eef0f3, #b7bcc6);
  color: #3a3f47;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85), 0 2px 8px rgba(0, 0, 0, 0.25);
}

.post-card.rank-3 .rank-badge {
  background: linear-gradient(135deg, #e3a877, #a9673a);
  color: #3a1f0d;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85), 0 2px 8px rgba(0, 0, 0, 0.25);
}

.post-icon {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 2.4rem;
  background: var(--accent-soft);
}

.post-thumbs {
  width: 100%;
  height: 100%;
}

.post-thumb {
  width: 100%;
  height: 100%;
  /* contain, not cover — a cropped-to-fill logo/wordmark image (common for
     these listings) can slice off the edges of its own text; showing the
     whole image with letterboxing on the card's background is safer. */
  object-fit: contain;
  cursor: pointer;
  display: block;
}

.post-photo-count {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.55);
  color: white;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}

.by .user-rating {
  color: var(--accent-text);
  font-weight: 700;
}

.location-line {
  color: var(--muted);
}

.distance-line {
  color: inherit;
  text-decoration: none;
}

.distance-line:hover {
  color: var(--accent-text);
  text-decoration: underline;
}

.post-card-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 12px 16px 16px;
}

.post-card-source {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.98rem;
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}

.post-card-source .business-name-btn {
  /* flex items don't shrink below their content's natural width by default,
     so without min-width:0 a long name pushes past the card edge instead of
     the ellipsis ever kicking in */
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-card-time {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.8rem;
  flex: 0 0 auto;
}

.post-description {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 6px;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-content {
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 6px;
  overflow-wrap: anywhere;
}

.post-content-label {
  margin-right: 4px;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.post-meta .tag {
  background: var(--accent-soft);
  color: var(--accent-text);
  border-radius: 999px;
  padding: 3px 10px;
  font-weight: 700;
}

.post-meta .dot {
  color: var(--line);
}

.post-card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.whatsapp-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 6px;
  padding: 2px;
  line-height: 0;
}

.whatsapp-chip:hover {
  border-color: #25d366;
  background: rgba(37, 211, 102, 0.08);
}

.share-post-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 6px;
  padding: 2px;
  line-height: 0;
  color: var(--muted);
  cursor: pointer;
}

.share-post-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-text);
}

.share-icon {
  flex: 0 0 auto;
  display: block;
}

.whatsapp-icon {
  flex: 0 0 auto;
  display: block;
}

.link-chip .whatsapp-icon {
  width: 15px;
  height: 15px;
}

.comments-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 0.9rem;
  cursor: pointer;
  font: inherit;
  line-height: 1;
}

.comments-toggle-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-text);
}

.reaction-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reaction-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  font: inherit;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.reaction-btn:hover {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.reaction-btn.endorse.active {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.report-btn {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 0.78rem;
  cursor: pointer;
  font: inherit;
  padding: 2px 4px;
  text-align: right;
  margin-left: auto;
}

.report-btn:disabled {
  cursor: default;
  opacity: 0.7;
}

.sales-badge {
  color: var(--accent-text);
  font-weight: 600;
}

.report-sales-btn {
  border: none;
  background: transparent;
  color: var(--accent-text);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0;
  font: inherit;
  text-decoration: underline;
}

#salesForm {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

#salesForm input[type='text'],
#salesForm input[type='number'],
#salesForm select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 14px;
  font: inherit;
  background: var(--bg);
  color: var(--text);
}

/* Matches the logged-in .reaction-btn look (flat, compact) rather than a
   loud solid CTA repeated down the whole feed — shows the real trust count
   as social proof instead of identical text on every card. */
.show-interest-btn:hover {
  color: var(--accent-text);
  background: var(--accent-soft);
}

.empty-state {
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: 18px;
  padding: 30px;
  text-align: center;
  color: var(--muted);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: grid;
  place-items: center;
  z-index: 50;
  padding: 20px;
}

.hidden {
  display: none !important;
}

.modal {
  background: var(--card);
  border-radius: 18px;
  padding: 26px;
  max-width: 420px;
  position: relative;
  box-shadow: var(--shadow);
}

.modal h3 {
  margin-top: 0;
}

.modal p {
  color: var(--muted);
  line-height: 1.5;
}

.modal .subtle {
  font-size: 0.85rem;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  border: none;
  background: transparent;
  font-size: 1rem;
  cursor: pointer;
  color: var(--muted);
}

.nav-link-btn {
  background: none;
  border: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  padding: 0;
}

.contact-modal {
  max-width: 440px;
  width: 100%;
}

.confirm-modal {
  max-width: 360px;
  width: 100%;
}

.confirm-modal p {
  margin: 0 0 20px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text);
}

.confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.confirm-modal-ok {
  border: none;
  background: #c0392b;
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}

.confirm-modal-ok:hover {
  background: #a5311f;
}

.business-info-modal {
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
}

.business-info-description {
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
}

.comments-modal {
  max-width: 480px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  text-align: left;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0;
  max-height: 320px;
  overflow-y: auto;
}

.comment-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.comment-avatar {
  width: 32px;
  height: 32px;
  font-size: 0.72rem;
}

.comment-body {
  flex: 1 1 auto;
  min-width: 0;
}

.comment-bubble {
  display: inline-block;
  background: var(--accent-soft);
  border-radius: 16px;
  padding: 8px 14px;
  max-width: 100%;
}

.comment-name {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--accent-text);
  margin-bottom: 2px;
}

.comment-content {
  color: var(--text);
  font-weight: 400;
  font-size: 0.94rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.comment-time {
  font-size: 0.72rem;
  margin: 3px 0 0 14px;
}

.comment-delete-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.72rem;
  cursor: pointer;
  padding: 0;
  margin-left: 8px;
  text-decoration: underline;
}

.comment-delete-btn:hover {
  color: #c0392b;
}

.comment-delete-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.comment-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.comment-input-pill {
  flex: 1 1 auto;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit;
  background: var(--bg);
  color: var(--text);
  resize: none;
}

.comment-send-btn {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.contact-field label {
  font-size: 0.8rem;
  font-weight: 600;
}

.contact-field .required {
  color: var(--secondary);
}

.contact-field input,
.contact-field textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 14px;
  font: inherit;
  background: var(--bg);
  color: var(--text);
  resize: vertical;
}

.contact-field input:focus,
.contact-field textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.error-box {
  font-size: 0.75rem;
  padding: 8px 12px;
  border-radius: 8px;
  color: #c0392b;
  background: rgba(192, 57, 43, 0.08);
  border: 1px solid rgba(192, 57, 43, 0.2);
  margin-bottom: 16px;
}

.info-box {
  font-size: 0.75rem;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--accent-text);
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  margin-bottom: 16px;
}

.submit-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 0;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.9rem;
  background: linear-gradient(135deg, var(--accent), var(--secondary));
  color: #fff;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.2s, transform 0.1s;
}

.submit-btn:hover {
  opacity: 0.9;
}

.submit-btn:active {
  transform: scale(0.98);
}

.submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: contact-spin 0.7s linear infinite;
}

@keyframes contact-spin {
  to { transform: rotate(360deg); }
}

.image-modal {
  padding: 14px;
  max-width: 560px;
  width: 100%;
}

.image-modal img {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 12px;
  display: block;
}

.image-modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}

.image-modal-prev {
  left: 8px;
}

.image-modal-next {
  right: 8px;
}

.image-modal-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.55);
  color: white;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(380px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 32px 28px;
  box-shadow: var(--shadow);
  text-align: center;
}

.auth-card .brand {
  justify-content: center;
  display: flex;
  margin-bottom: 18px;
}

.auth-card h1 {
  font-size: 1.5rem;
  margin: 0 0 6px;
}

.auth-card .subtle {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 22px;
}

.auth-form {
  display: grid;
  gap: 14px;
  text-align: left;
}

.auth-form label {
  display: grid;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--muted);
}

.auth-form input {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  background: var(--bg);
  color: var(--text);
}

.auth-form .post-btn {
  width: 100%;
  padding: 13px;
}

.auth-switch {
  margin-top: 20px;
  font-size: 0.88rem;
  color: var(--muted);
}

.auth-switch a,
.link-btn {
  color: var(--accent-text);
  font-weight: 700;
  text-decoration: none;
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
  padding: 0;
}

.auth-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 14px;
}

.auth-bar a,
.auth-bar button {
  color: var(--accent-text);
  font-weight: 700;
  text-decoration: none;
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
  padding: 0;
}

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 40px;
  padding: 28px 20px 40px;
}

.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  gap: 12px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.1rem;
}

.footer-blurb {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.65;
  max-width: 680px;
  margin: 0;
}

.footer-blurb strong {
  color: var(--accent-text);
}

.footer-blurb a {
  color: var(--accent-text);
  font-weight: 600;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 4px;
}

.footer-links a,
.footer-links .nav-link-btn {
  color: var(--accent-text);
  font-weight: 600;
  font-size: 0.86rem;
  text-decoration: none;
}

.footer-links a:hover,
.footer-links .nav-link-btn:hover {
  text-decoration: underline;
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.footer-copy {
  color: var(--muted);
  font-size: 0.82rem;
}

@media (max-width: 860px) {
  .topbar-inner {
    flex-direction: column;
    padding: 12px 20px;
    align-items: center;
    gap: 10px;
  }

  .business-search-wrap,
  .sort-toggle,
  .nav-actions {
    order: 0;
  }

  .nav-actions {
    margin-left: 0;
    justify-content: center;
  }

  /* The avatar can end up centered in the stacked topbar here, so anchoring
     the dropdown to it via `right: 0` (desktop's rule) can push it off-screen.
     Anchor to the viewport instead — JS supplies `top` on open. */
  .account-dropdown {
    position: fixed;
    left: 16px;
    right: 16px;
    width: auto;
    min-width: 0;
  }

  .main-content {
    grid-template-columns: 1fr;
  }

  /* Desktop's minmax(380px, 1fr) forces every card to at least 380px wide —
     wider than the available content area on any phone (iPhone included,
     390-430px viewport minus page padding), which was forcing horizontal
     scroll to see the rest of each card. One column, full width, no minimum. */
  .post-list {
    grid-template-columns: 1fr;
  }

  .leaderboard {
    order: 1;
  }

  .mobile-filter-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    order: 0;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 16px;
    font: inherit;
    font-weight: 700;
    color: inherit;
    cursor: pointer;
  }

  .mobile-filter-summary {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.85rem;
    max-width: 55%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar {
    order: 2;
    display: none;
  }

  .sidebar.mobile-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0;
    top: 0;
    z-index: 60;
    border-radius: 0;
    max-height: 100vh;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar.mobile-open #categoryList {
    -webkit-overflow-scrolling: touch;
  }

  .mobile-filter-close {
    display: block;
    position: sticky;
    top: 0;
    width: calc(100% + 36px);
    margin: -18px -18px 16px;
    padding: 14px 18px;
    background: var(--card);
    border: none;
    border-bottom: 1px solid var(--line);
    font: inherit;
    font-weight: 700;
    text-align: right;
    cursor: pointer;
    color: inherit;
    z-index: 1;
  }

  #nameInput,
  #categorySelect,
  #locationInput,
  #zoomInput,
  #useLocationBtn,
  .photo-btn {
    flex: 1 1 45%;
    text-align: center;
  }

}
