* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  /*background: #F8FAFC;*/
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
header {
  background: #1a73e8;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.header-left {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
}

.header-center {
  flex: 1;
  text-align: center;
  min-width: 0;
  justify-self: center;
}

.header-right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

header h1 {
  color: white;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

header p {
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  margin-top: 2px;
}

@media (max-width: 480px) {
  header p {
    display: none;
  }

  header h1 {
    font-size: 20px;
  }
}

/* ── + Add button ── */
.btn-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  color: white;
  font-size: 22px;
  font-weight: 300;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.15s;
  line-height: 1;
  flex-shrink: 0;
}

.btn-add:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: scale(1.08);
}

.help-menu {
  position: relative;
}

.btn-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.6);
  color: white;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.15s;
  line-height: 1;
  flex-shrink: 0;
  padding: 0;
}

.btn-help:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.08);
}

.help-menu:hover .dropdown,
.help-menu:focus-within .dropdown {
  display: block;
}

/* Google sign-in button */
.btn-google {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: white;
  color: #333;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  transition: box-shadow 0.15s, opacity 0.15s;
}

.btn-google:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
  opacity: 0.95;
}

.btn-google svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.page-top {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 16px;
  margin: 28px 16px 18px;
  flex-wrap: wrap;
}

.actions-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.page-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 24px;
  max-width: 1100px;
  margin: 0 auto 32px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.auth-container {
  padding: 24px 16px 48px;
  display: flex;
  justify-content: center;
}

.grid-2,
.grid-3 {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

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

.empty-state {
  text-align: center;
  padding: 52px 32px;
  max-width: 760px;
  margin: 24px auto 48px;
}

.tag-list {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  background: #eef6ff;
  color: #1d4ed8;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.mt-1 {
  margin-top: 0.75rem;
}

@media (max-width: 400px) {
  .btn-label {
    display: none;
  }

  .btn-google {
    padding: 8px 10px;
  }
}

/* User avatar pill */
.user-menu {
  position: relative;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 4px 12px 4px 4px;
  cursor: pointer;
}

.user-pill img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.user-pill span {
  color: white;
  font-size: 13px;
  font-weight: 500;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* User welcome pill (no avatar, no border) */
.user-welcome-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: none;
  padding: 4px 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.user-welcome-pill span {
  color: white;
  font-size: 13px;
  font-weight: 500;
}

.user-welcome-pill:hover {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 6px;
}

@media (max-width: 400px) {
  .user-pill span {
    display: none;
  }

  .user-pill {
    padding: 4px;
  }
}

/* Dropdown */
.dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.14);
  min-width: 200px;
  z-index: 100;
  overflow: hidden;
}

.user-menu:hover .dropdown,
.user-menu:focus-within .dropdown {
  display: block;
}

.user-menu.is-closed .dropdown {
  display: none !important;
}

.dropdown-info {
  padding: 14px 16px;
  border-bottom: 1px solid #eee;
}

.dropdown-info .d-name {
  font-size: 14px;
  font-weight: 600;
  color: #111;
}

.dropdown-info .d-email {
  font-size: 12px;
  color: #888;
  margin-top: 2px;
}

.dropdown a {
  display: block;
  padding: 11px 16px;
  font-size: 13.5px;
  color: #333;
  text-decoration: none;
  transition: background 0.1s;
}

.dropdown a:hover {
  background: #f5f5f5;
}

.dropdown .dropdown-link {
  cursor: pointer;
}

.dropdown-link:hover {
  background: #f5f5f5;
}

.dropdown .logout {
  color: #d32f2f;
}

/* ── Banner ── */
.banner {
  background: #ffc107;
  text-align: center;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 700;
  color: #1a1a1a;
}

/* ── Search ── */
.search-section {
  padding: 10px 1px 5px;
  display: flex;
  justify-content: center;
}

.search-row {
  display: flex;
  justify-content: right;
  align-items: right;
  gap: 16px;
  width: 100%;
  max-width: 1300px;
  padding: 0 16px;
  flex-wrap: wrap;
}

.search-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.nearby-control {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nearby-radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #333;
  cursor: pointer;
  white-space: nowrap;
}

.nearby-radio input[type="radio"] {
  accent-color: #1a73e8;
  width: auto;
  height: auto;
  margin: 0;
}

.nearby-menu-btn {
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  padding: 5px 5px;
  font-size: 12px;
  cursor: pointer;
  color: #666;
  transition: all 0.2s ease;
}

.nearby-menu-btn:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.nearby-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 12px;
  min-width: 200px;
  display: none;
  z-index: 1000;
  margin-top: 8px;
}

.nearby-dropdown.show {
  display: block;
}

.dropdown-section {
  display: flex;
  flex-direction: column;
  /*gap: 8px;*/
}

.dropdown-title {
  font-size: 12px;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 4px;
}

.dropdown-section label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #333;
  cursor: pointer;
  padding: 6px 0;
}

.dropdown-section input[type="radio"] {
  accent-color: #1a73e8;
  width: auto;
  height: auto;
  margin: 0;
  cursor: pointer;
}

.dropdown-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 8px 0;
}

/* ── Custom dropdown (sort-by / status filters) ── */
.dropdown-control {
  position: relative;
  display: inline-flex;
}

.dropdown-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  color: #333;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.dropdown-trigger-btn:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.dropdown-arrow {
  font-size: 10px;
  color: #888;
  line-height: 1;
}

.custom-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 12px;
  min-width: 200px;
  display: none;
  z-index: 1000;
  margin-top: 8px;
}

.custom-dropdown.show {
  display: block;
}

.search-radio-group {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.search-radio-group label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  white-space: nowrap;
}

.search-radio-group input[type="radio"] {
  accent-color: #1a73e8;
  width: auto;
  height: auto;
  margin: 0;
}

#sortFilter,
#statusFilter {
  padding: 5px 5px;
  border-radius: 5px;
  border: 1px solid #d1d5db;
  font-size: 12px;
  min-width: 125px;
  background: white;
  color: #111827;
  cursor: pointer;
}

.search-box {
  display: flex;
  align-items: center;
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px 16px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
}

.search-box input {
  border: none;
  outline: none;
  font-size: 14px;
  color: #333;
  width: 100%;
  background: transparent;
}

.search-box input::placeholder {
  color: #aaa;
}

.search-box svg {
  width: 17px;
  height: 17px;
  color: #aaa;
  margin-right: 10px;
  flex-shrink: 0;
}

/* ── Section label ── */
.section-label {
  display: flex;
  flex-wrap: wrap;
  padding: 15px 7px 5px;
  max-width: 1300px;
  margin: 0 auto;
  width: 100%;
  font-size: 12px;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  align-items: center;
  gap: 10px;
}

/* ── Listings grid ── */
.listings {
  padding: 0 16px 48px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  max-width: 1300px;
  margin: 0 auto;
  width: 100%;
}

@media (max-width: 480px) {
  .listings {
    grid-template-columns: 1fr;
    padding: 0 12px 40px;
    gap: 12px;
  }
}

@media (min-width: 481px) and (max-width: 700px) {
  .listings {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Load More */
.load-more-btn {
  display: none;
  margin: 18px auto 32px;
  padding: 11px 26px;
  border: none;
  border-radius: 999px;
  background: #1a73e8;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(26, 115, 232, 0.22);
  transition: transform 0.15s, opacity 0.15s, box-shadow 0.15s;
}

.load-more-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(26, 115, 232, 0.28);
}

.load-more-btn:active {
  transform: translateY(0);
  opacity: 0.92;
}

/* ── Card ── */
.card {
  background: white;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.15s, transform 0.15s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.card:hover {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.card-accent {
  height: 5px;
  width: 100%;
  background: #e6e6d5;
}

.card-body {
  padding: 10px 5px 5px;
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}

.card-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: 10px;
  margin-top: 5px;
  margin-left: 5px;
  width: fit-content;
  background: #e6e6d5;
  color: #444;
}

.card h3 {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 6px;
  line-height: 1.35;
  padding-left: 10px;
}

.card p {
  font-size: 13px;
  color: #666;
  line-height: 1.55;
  margin-bottom: 10px;
}

.card-description {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 5px;
  min-height: 3.1em;
  padding: 5px 10px 20px 10px;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #f2f2f2;
  padding: 5px;
  margin-top: auto;
  gap: 10px;
}

.card-views {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  margin-left: auto;
}

.card-rating {
  position: absolute;
  /*top: 14px;*/
  right: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #ffffff;
  z-index: 3;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 5px 1px;
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.08);
  white-space: nowrap;
  min-width: 90px;
}

.rating-stars {
  display: flex;
  gap: 1px;
}

.rating-stars span {
  font-size: 12px;
  color: #f59e0b;
  line-height: 1;
}

.rating-value {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #444;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-footer-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: none;
  background: #f8fafc;
  color: #111;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.15s, transform 0.15s;
  padding: 6px;
}

.card-footer-icon:hover {
  background: #e2e8f0;
  transform: translateY(-1px);
}

.location {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  color: #888;
}

.location svg {
  width: 13px;
  height: 13px;
  color: #e53935;
  flex-shrink: 0;
}

.card-cta {
  font-size: 12px;
  font-weight: 600;
  color: #1a73e8;
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid #1a73e8;
  border-radius: 5px;
  transition: background 0.15s, color 0.15s;
}

.card-cta:hover {
  background: #1a73e8;
  color: white;
}

/* Category colour themes */
.cat-housing .card-accent {
  background: #1a73e8;
}

.cat-housing .card-badge {
  background: #e8f0fe;
  color: #1a73e8;
}

.cat-food .card-accent {
  background: #34a853;
}

.cat-food .card-badge {
  background: #e6f4ea;
  color: #1e7e34;
}

.cat-education .card-accent {
  background: #f9ab00;
}

.cat-education .card-badge {
  background: #fef8e1;
  color: #b06000;
}

.cat-auto .card-accent {
  background: #ea4335;
}

.cat-auto .card-badge {
  background: #fce8e6;
  color: #c5221f;
}

.cat-pg .card-accent {
  background: #9c27b0;
}

.cat-pg .card-badge {
  background: #f3e5f5;
  color: #7b1fa2;
}

.cat-mobile .card-accent {
  background: #00897b;
}

.cat-mobile .card-badge {
  background: #e0f2f1;
  color: #00695c;
}

/* ── Modal overlay ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.open {
  display: flex;
}

.welcome-open {
  overflow: hidden;
}

.welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 13000;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 8% 13%, rgba(255, 213, 149, 0.38), transparent 25%),
    radial-gradient(ellipse at 91% 85%, rgba(187, 225, 185, 0.42), transparent 28%),
    radial-gradient(circle, rgba(239, 154, 53, 0.13) 1.3px, transparent 1.7px) 0 0 / 23px 23px,
    rgba(255, 248, 236, 0.68);
  -webkit-backdrop-filter: blur(1px);
  backdrop-filter: blur(1px);
  animation: welcomeFadeIn 0.25s ease-out;
}

.welcome-sticker-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
}

.welcome-sticker {
  position: absolute;
  color: #64748b;
  font-size: clamp(26px, 3vw, 42px);
  line-height: 1;
  filter: grayscale(0.45);
  opacity: 0.22;
}

.welcome-sticker:nth-child(1) { top: 7%; left: 8%; transform: rotate(-12deg); }
.welcome-sticker:nth-child(2) { top: 17%; left: 22%; transform: rotate(9deg); }
.welcome-sticker:nth-child(3) { top: 8%; right: 9%; transform: rotate(8deg); }
.welcome-sticker:nth-child(4) { top: 22%; right: 20%; transform: rotate(-9deg); }
.welcome-sticker:nth-child(5) { top: 34%; left: 4%; transform: rotate(7deg); }
.welcome-sticker:nth-child(6) { top: 39%; right: 4%; transform: rotate(-11deg); }
.welcome-sticker:nth-child(7) { top: 52%; left: 15%; transform: rotate(12deg); }
.welcome-sticker:nth-child(8) { top: 55%; right: 14%; transform: rotate(-7deg); }
.welcome-sticker:nth-child(9) { top: 66%; left: 5%; transform: rotate(-8deg); }
.welcome-sticker:nth-child(10) { top: 69%; right: 6%; transform: rotate(10deg); }
.welcome-sticker:nth-child(11) { bottom: 12%; left: 16%; transform: rotate(-10deg); }
.welcome-sticker:nth-child(12) { right: 15%; bottom: 8%; transform: rotate(8deg); }
.welcome-sticker:nth-child(13) { top: 30%; left: 48%; transform: rotate(-7deg); }
.welcome-sticker:nth-child(14) { top: 78%; left: 46%; transform: rotate(12deg); }
.welcome-sticker:nth-child(15) { bottom: 43%; left: 3%; transform: rotate(8deg); }
.welcome-sticker:nth-child(16) { right: 3%; bottom: 40%; transform: rotate(-12deg); }

.welcome-dialog {
  position: relative;
  z-index: 1;
  width: min(940px, 100%);
  max-height: min(92vh, 900px);
  overflow: auto;
  border: 1px solid #f0dfc7;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 16px 52px rgba(91, 69, 37, 0.2);
  animation: welcomeRiseIn 0.35s cubic-bezier(.2, .8, .2, 1);
}

.welcome-close {
  position: absolute;
  z-index: 2;
  top: 17px;
  right: 18px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #f0dfc7;
  border-radius: 50%;
  background: #fff8ec;
  color: #5b6472;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}

.welcome-close:hover {
  transform: rotate(90deg);
  background: #ffedd8;
}

.welcome-hero {
  position: relative;
  padding: 22px 34px 21px;
  border-bottom: 1px solid #f3e8d8;
  background: linear-gradient(110deg, rgba(255, 250, 242, 0.68) 0%, rgba(255, 255, 255, 0.66) 58%, rgba(245, 250, 239, 0.68) 100%);
}

.welcome-brand {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 17px;
}

.welcome-brand img {
  display: block;
  width: 106px;
  height: auto;
}

.welcome-brand > span {
  padding-left: 12px;
  border-left: 1px solid #e9d7bd;
  color: #8a7458;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.1px;
}

.welcome-hero-copy {
  position: relative;
  z-index: 2;
  max-width: 680px;
}

.welcome-hero h1 {
  margin: 0 0 7px;
  color: #e87700;
  font-size: clamp(25px, 3.6vw, 33px);
  line-height: 1.15;
}

.welcome-hero-copy p {
  max-width: 620px;
  margin: 0;
  color: #5d6571;
  font-size: 14px;
  line-height: 1.5;
}

.welcome-content {
  position: relative;
  padding: 24px 34px 28px;
}

.welcome-content > .welcome-lead,
.welcome-content > .welcome-tip,
.welcome-content > .welcome-error,
.welcome-content > .welcome-actions,
.welcome-feature > * {
  position: relative;
  z-index: 2;
}

.welcome-lead {
  margin: 0 0 15px;
  color: #26364a;
  font-size: 15px;
  font-weight: 700;
}

.welcome-features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.welcome-feature {
  display: flex;
  min-width: 0;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid #e8edf4;
  border-radius: 14px;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.7) 45%, rgba(247, 250, 255, 0.7));
}

.welcome-feature-icon {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: #eaf3ff;
  color: #1a73e8;
  font-size: 21px;
}

.welcome-feature:nth-child(3n + 2) .welcome-feature-icon {
  background: #e7f7f4;
  color: #078579;
}

.welcome-feature:nth-child(3n) .welcome-feature-icon {
  background: #fff3df;
  color: #e38300;
}

.welcome-feature h2 {
  margin: 0 0 4px;
  color: #182b43;
  font-size: 13px;
  line-height: 1.35;
}

.welcome-feature p {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

.welcome-tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 15px 0 0;
  color: #53657a;
  font-size: 12px;
  line-height: 1.5;
}

.welcome-tip-icon {
  flex: 0 0 auto;
  font-size: 18px;
  line-height: 1;
}

.welcome-error {
  margin: 13px 0 0;
  color: #b42318;
  font-size: 13px;
}

.welcome-actions {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 20px;
  padding-top: 17px;
  border-top: 1px solid #edf0f4;
}

.welcome-profile-link {
  display: inline-flex;
  min-height: 43px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  border: 1px solid #cfe1f8;
  border-radius: 12px;
  background: #f2f7ff;
  color: #1765b1;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.welcome-profile-link:hover {
  border-color: #9fc5f0;
  background: #e7f1ff;
}

.welcome-profile-icon {
  font-size: 16px;
  line-height: 1;
}

.welcome-help-link {
  color: #1765b1;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.welcome-help-link:hover {
  text-decoration: underline;
}

.welcome-start-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 43px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(120deg, #fe8500, #f27600);
  box-shadow: 0 7px 17px rgba(242, 118, 0, 0.22);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.welcome-start-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 9px 22px rgba(242, 118, 0, 0.3);
}

.welcome-start-arrow {
  font-size: 18px;
  line-height: 1;
}

.welcome-actions [aria-disabled="true"] {
  opacity: 0.6;
  pointer-events: none;
}

@keyframes welcomeFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes welcomeRiseIn {
  from { opacity: 0; transform: translateY(18px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 640px) {
  .welcome-overlay { padding: 8px; }
  .welcome-dialog { max-height: 96vh; border-radius: 18px; }
  .welcome-sticker { font-size: 30px; }
  .welcome-hero { padding: 19px 20px 17px; }
  .welcome-brand { gap: 9px; margin-bottom: 13px; }
  .welcome-brand img { width: 82px; }
  .welcome-brand > span { max-width: 185px; padding-left: 9px; font-size: 8px; }
  .welcome-hero h1 { max-width: calc(100% - 22px); font-size: 25px; }
  .welcome-hero-copy p { max-width: calc(100% - 12px); font-size: 13px; }
  .welcome-close { top: 13px; right: 13px; width: 31px; height: 31px; }
  .welcome-content { padding: 18px 16px 18px; }
  .welcome-features { grid-template-columns: 1fr; gap: 8px; }
  .welcome-feature { padding: 10px 11px; }
  .welcome-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    margin: 14px -16px -18px;
    padding: 12px 16px 14px;
    background: #fff;
    box-shadow: 0 -8px 16px rgba(33, 45, 60, 0.08);
  }
  .welcome-profile-link { width: 100%; min-height: 46px; }
  .welcome-start-btn { width: 100%; min-height: 46px; }
  .welcome-help-link { align-self: center; }
}

@media (prefers-reduced-motion: reduce) {
  .welcome-overlay,
  .welcome-dialog { animation: none; }
  .welcome-close,
  .welcome-start-btn { transition: none; }
}

.modal {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  animation: slideUp 0.2s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(24px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  background: #1a73e8;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  color: white;
  font-size: 17px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.15s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

.modal-body {
  padding: 22px 22px 8px;
}

/* Login prompt inside modal */
.login-prompt {
  text-align: center;
  padding: 12px 0 20px;
}

.login-prompt p {
  color: #555;
  font-size: 14px;
  margin-bottom: 18px;
  line-height: 1.6;
}

/* Form fields */
.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: #444;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  color: #222;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: #fafafa;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
  background: white;
}

.field textarea {
  resize: vertical;
  min-height: 80px;
}

/* Category select with colour preview dot */
.cat-select-wrap {
  position: relative;
}

.cat-dot {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ccc;
  pointer-events: none;
  transition: background 0.15s;
}

.cat-select-wrap select {
  padding-left: 28px;
}

.modal-footer {
  padding: 14px 22px 20px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.btn-cancel {
  padding: 9px 18px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 500;
  border: 1.5px solid #ddd;
  background: white;
  color: #555;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-cancel:hover {
  background: #f5f5f5;
}

.btn-publish {
  padding: 9px 22px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  background: #1a73e8;
  color: white;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.btn-publish:hover {
  background: #1558b0;
}

.btn-publish:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-secondary {
  padding: 9px 20px;
  border-radius: 7px;
  font-size: 14px;
  border: 1px solid #d1d5db;
  background: #f8fafc;
  color: #111827;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-secondary:hover {
  background: #eff6ff;
}

/* ── Icon buttons ── */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  padding: 5px 5px;
  border-radius: 8px;
  transition: background 0.15s, transform 0.15s;
  background: transparent;
}

.icon-btn:hover {
  background: rgba(26, 115, 232, 0.1);
  transform: scale(1.15);
}

/* ── Card edit icon ── */
.card {
  position: relative;
}

.card-icons {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
  align-items: center;
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  padding: 2px 2px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.85);
  color: white;
  border: none;
  transition: background 0.15s, transform 0.15s;
}

.card-icon:hover {
  background: #ffffff;
  transform: scale(1.1);
}

.card-delete-btn {
  background: rgba(255, 255, 255, 0.85);
}

.card-delete-btn:hover {
  background: #ffffff;
}

.help-page {
  max-width: 1300px;
  margin: 0 auto;
  padding: 2px 10px 10px;
}

.help-page .page-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin: 2px 10px 10px;
}

.my-listings-page {
  max-width: 1300px;
  margin: 0 auto;
  padding: 20px 10px 10px;
}

.my-listings-page .page-top {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 16px;
  margin: 2px 10px 10px;
}

.add-business-page {
  max-width: 1300px;
  margin: 0 auto;
  padding: 2px 10px 10px;
}

.add-business-page .page-top {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 16px;
  margin: 2px 10px 10px;
}

.my-listings-page .page-end-actions {
  margin-left: auto;
}

.my-listings-page .page-top > div:not(.actions-row),
.add-business-page .page-top > div:not(.actions-row) {
  flex: 1;
  min-width: 0;
}

.my-listings-page .page-top .section-label,
.add-business-page .page-top .section-label {
  width: auto;
  margin: 0;
}

.my-listings-page .page-back-btn,
.add-business-page .page-back-btn,
.listing-page .page-back-btn,
.help-page .page-back-btn,
.admin-page .page-back-btn,
.edit-profile-page .page-back-btn {
  font-size: 30px;
  width: 34px;
  height: 34px;
  font-weight: 700;
  color: #1a73e8;
}

.edit-profile-page .page-top {
  display: flex;
  margin: 2px 10px 10px;
}
.help-page .page-top:has(.page-back-btn),
.admin-page .page-top:has(.page-back-btn),
.edit-profile-page .page-top:has(.page-back-btn) {
  justify-content: flex-start;
  align-items: center;
}

.help-page .page-top > div:not(.actions-row),
.admin-page .page-top > div:not(.actions-row),
.edit-profile-page .page-top > div:not(.actions-row) {
  flex: 1;
  min-width: 0;
}

.listing-page {
  max-width: 1300px;
  /*min-width: 900px;*/
  margin: 0 auto;
  padding: 20px 10px 10px;
}

.listing-page .page-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1px;
  margin: 2px 10px 10px;
}

.listing-page .page-title {
  margin: 4px 0 0;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.listing-grid {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 15px;
  margin-bottom: 32px;
}

.listing-main,
.listing-side {
  width: 100%;
}

.listing-side {
  display: grid;
  gap: 15px;
}

.listing-card,
.listing-side-card {
  background: white;
  /*border-bottom: 2px solid #a8a8a8;
  border-radius: 18px;*/
  padding: 1px 5px 1px 10px;
  /*box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);*/
}

.listing-card-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 22px;
}

.listing-header-main {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  /*flex-wrap: wrap;*/
}

.listing-header-info {
  flex: 1;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 1px;
}

.listing-header-info .page-title {
  font-size: 28px;
  font-weight: 400;
  color: #111827;
  line-height: 1.2;
  margin: 0;
}

.listing-header-info .listing-subtitle {
  font-size: 14px;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 8px;
}

.listing-header-info .listing-owner-row {
  margin-top: 4px;
}

.listing-header-info .listing-owner-label {
  font-size: 13px;
}

.listing-header-info .listing-owner-link {
  font-size: 14px;
}

.listing-rating-row {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

@media (max-width: 580px) {
  .listing-header-main {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .listing-header-info {
    min-width: unset;
  }

  .listing-rating-row {
    align-items: flex-start;
    margin-left: 0;
    width: 100%;
    border-top: 1px solid #f3f4f6;
    padding-top: 12px;
  }
}

.icon-btn-sm {
  width: 30px !important;
  height: 30px !important;
  font-size: 14px !important;
  padding: 0 !important;
  min-width: unset !important;
  border: 1px solid #d1d5db !important;
  border-radius: 50% !important;
  background: #ffffff !important;
  color: #111827 !important;
}

.listing-card-header .icon-btn-sm:hover {
  background: #eff6ff !important;
  transform: scale(1.05);
}

.follow-update-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #2e7d32;
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  border-radius: 999px;
  padding: 3px 10px 3px 6px;
  white-space: nowrap;
}

.follow-update-badge .banner-icon {
  font-size: 12px;
  line-height: 1;
}

.listings-loading-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  color: #5f6b7a;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1px;
  white-space: nowrap;
}

.listings-loading-indicator[hidden] {
  display: none;
}

.listings-loading-spinner {
  width: 11px;
  height: 11px;
  border: 2px solid #d8e1ec;
  border-top-color: #1a73e8;
  border-radius: 50%;
}

.listings-loading-indicator.is-loading .listings-loading-spinner {
  animation: listings-loading-spin .75s linear infinite;
}

.listings-loading-indicator.is-error {
  color: #b42318;
}

.listings-loading-indicator.is-error .listings-loading-spinner {
  border: 0;
  animation: none;
  position: relative;
}

.listings-loading-indicator.is-error .listings-loading-spinner::before {
  content: '×';
  display: block;
  color: #d92d20;
  font-size: 19px;
  font-weight: 800;
  line-height: 11px;
}

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

.follow-update-badge a {
  color: #1a73e8;
  font-weight: 700;
  text-decoration: none;
}

.follow-update-badge a:hover {
  text-decoration: underline;
}

.listing-card-header .icon-btn {
  font-size: 15px;
  padding: 10px 14px;
  border: none;
  background: #ffffff;
  color: #111827;
  border-radius: 12px;
  min-width: 132px;
  transition: background 0.15s, transform 0.15s;
}

.listing-card-header .icon-btn:hover {
  background: #eff6ff;
  transform: scale(1.03);
}

#listingActions {
  display: flex;
  gap: 10px;
  align-items: center;
  /*margin-top: 10px;*/
}

#listingActions .icon-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  font-size: 12px;
  color: #1f2937;
  transition: background 0.15s, transform 0.15s, border-color 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#listingActions .icon-btn:hover {
  background: rgba(59, 130, 246, 0.1);
  transform: scale(1.05);
}

#listingActions .icon-btn.active {
  background: rgba(96, 165, 250, 0.2);
  border-color: rgba(59, 130, 246, 0.3);
  color: #1d4ed8;
}

.listing-owner-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.listing-owner-label {
  font-size: 12px;
  font-weight: 600;
  color: #888;
  letter-spacing: 0.4px;
}

.listing-owner-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: #1a73e8;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.15s;
}

.listing-owner-link:hover {
  color: #1558b0;
  text-decoration: underline;
}

.owner-profile-header {
  margin-top: 4px;
}

.owner-profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.owner-avatar-profile {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: #eef2ff;
  display: grid;
  place-items: center;
  color: #1d4ed8;
  font-size: 28px;
  font-weight: 700;
  overflow: hidden;
  flex-shrink: 0;
}

.owner-profile-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.owner-profile-name {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
}

.owner-profile-email {
  font-size: 13px;
  color: #6b7280;
}

.owner-avatar-lg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #eef2ff;
  color: #1a73e8;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}

.owner-avatar-lg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.owner-profile-summary {
  display: flex;
  align-items: center;
  gap: 10px;
}

.owner-email-text {
  font-size: 13px;
  color: #6b7280;
}

.listing-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1a56db;
  margin-bottom: 6px;
  font-weight: 600;
  align-self: flex-start;
  /* Now a sibling of the title block rather than a row of its own, it is
     pinned to the right edge opposite the logo/title. Without this it would
     sit immediately after the title and read as part of the heading. */
  margin-left: auto;
  flex: 0 0 auto;
}

/* The badge inherits the 10px label size, which renders most emoji as an
   unreadable dark blob. Give the glyph its own size so the pill reads as
   icon + text at the same size the card badges use. */
.listing-badge .cat-icon {
  font-size: 13px;
  line-height: 1;
  flex: 0 0 auto;
}

.listing-subtitle {
  font-size: 14px;
  color: #6b7280;
  margin-top: 4px;
  max-width: 620px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.location-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e0f2fe;
  color: #0284c7;
  font-size: 12px;
}

.listing-rating-large {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  /*border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;*/
  padding: 10px 16px;
  min-width: 140px;
  justify-content: center;
}

.listing-logo {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: #eef2ff;
  display: grid;
  place-items: center;
  color: #1d4ed8;
  font-size: 28px;
  font-weight: 700;
  overflow: hidden;
  flex-shrink: 0;
}

.listing-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.listing-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.listing-images img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
}

/*
.listing-rating-large {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  padding: 10px 16px;
  min-width: 140px;
  justify-content: center;
}*/

.rating-stars-large {
  display: flex;
  gap: 3px;
}

.rating-stars-large span {
  color: #f59e0b;
  font-size: 16px;
  line-height: 1;
}

.muted {
  color: #d1d5db;
}

.rating-number {
  font-size: 14px;
  color: #111;
}

.listing-description h2,
.reviews-section h2 {
  font-size: 18px;
  margin-bottom: 12px;
  color: #111827;
}

.listing-description div,
.listing-description p {
  color: #374151;
  font-size: 15px;
  line-height: 1.9;
  white-space: pre-wrap;
  margin: 0;
}

.listing-description strong {
  font-weight: 700;
  color: #111827;
}

.listing-description em {
  font-style: italic;
}

.listing-description a {
  color: #1d4ed8;
  text-decoration: none;
  word-break: break-word;
}

.listing-description a:hover {
  text-decoration: underline;
}

.listing-description table {
  width: 100%;
  margin: 12px 0;
  border-collapse: collapse;
  border-spacing: 0;
  table-layout: fixed;
}

.listing-description th,
.listing-description td {
  min-width: 0;
  border: 1px solid #cbd5e1;
  padding: 7px 4px;
  vertical-align: top;
  text-align: left;
  overflow-wrap: anywhere;
}

.listing-description th {
  background: #f8fafc;
  font-weight: 700;
}

.listing-description ul,
.listing-description ol {
  padding-left: 18px;
  margin: 12px 0;
}

.listing-description li {
  margin-bottom: 6px;
}

.listing-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.listing-info-item {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid #f3f4f6;
  border-radius: 14px;
  background: #fafafa;
}

.listing-info-item span {
  font-size: 12px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.listing-info-item strong {
  font-size: 14px;
  color: #111827;
  font-weight: 700;
  word-break: break-word;
}

.listing-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.link-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  color: #111827;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.link-pill:hover {
  background: #eff6ff;
  border-color: #dbeafe;
}

.listing-side-card h2 {
  margin: 0 0 12px;
  font-size: 15px;
  color: #111827;
  font-weight: 600;
}

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #f1f5f9;
  transition: all 0.2s ease;
}

.contact-item:hover {
  background: #f1f5f9;
  transform: translateY(-1px);
}

.contact-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  flex-shrink: 0;
  color: white;
}

.contact-icon-link {
  text-decoration: none;
}

/* Brand specific icon backgrounds */
.contact-phone-icon {
  background: #3b82f6;
}

.contact-website-icon {
  background: #6b7280;
}

.contact-whatsapp-icon {
  background: #22c55e;
}

.contact-facebook-icon {
  background: #1877F2;
}

.contact-linkedin-icon {
  background: #0A66C2;
}

.contact-address-icon {
  background: #ea580c;
}

.contact-icon-wrapper svg {
  stroke: currentColor;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.contact-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.05em;
  line-height: 1;
}

/* Short label used only by the one-line mobile tiles; the desktop row has room
   for the full wording. Hidden by default so it never doubles up. */
.contact-label-sm {
  display: none;
}

.contact-value-container {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  word-break: break-all;
}

.contact-value-container a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

.contact-value-container a:hover {
  color: #3b82f6;
  text-decoration: underline;
}

.listing-side-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-top: 1px solid #f3f4f6;
  color: #4b5563;
  font-size: 13px;
}

.listing-side-row:first-of-type {
  border-top: none;
  padding-top: 0;
}

.listing-side-row strong {
  color: #111827;
  font-weight: 600;
  font-size: 13px;
}

.listing-dates {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.date-item {
  font-size: 11px;
  color: #9ca3af;
}

.date-item strong {
  color: #6b7280;
  font-weight: 600;
}

.reviews-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.listing-social-tabs {
  margin-top: 22px;
  background: white;
  border-top: 1px solid #a8a8a8;
  /*border-radius: 18px;*/
  padding: 22px;
  /*box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);*/
}

.tab-bar {
  display: flex;
  gap: 18px;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 20px;
  /*overflow-x: auto;*/
}

.tab-list {
  display: flex;
  gap: 18px;
}

.tab-refresh-btn {
  /* Aligns with the tab labels. The previous -6px top margin hoisted the button
     above the tab row, which is what made it look clipped against the tab bar's
     bottom border. */
  margin: -3px 0 0 auto;
  width: 32px;
  height: 32px;
  border: 1px solid #ffffff;
  border-radius: 50%;
  background: #fff;
  color: #4b5563;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}

.tab-refresh-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tab-refresh-btn:hover {
  color: #1a73e8;
  border-color: #1a73e8;
  background: #f0f7ff;
  transform: rotate(-25deg);
}

.tab-refresh-btn:focus-visible {
  outline: 2px solid #1a73e8;
  outline-offset: 2px;
}

.tab-btn {
  position: relative;
  border: none;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 0 0 12px;
  white-space: nowrap;
}

.tab-btn.is-active {
  color: #111827;
  font-weight: 800;
}

.tab-btn.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  border-radius: 999px;
  background: #1a73e8;
}

.tab-panel {
  display: none;
  width: 100%;
}

.tab-panel.is-active {
  display: block;
}

.social-heading {
  margin-bottom: 14px;
}

.social-heading h2 {
  font-size: 18px;
  color: #111827;
}

.chat-thread {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px 16px;
  background: #f8fafc;
  min-height: 320px;
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.thread-list-panel {
  width: 100%;
  min-width: 0;
  max-height: 100%;
  border: none;
  border-right: 1px solid #e9edef;
  display: flex;
  flex-direction: column;
  background: #ffffff;
}

.thread-list-panel[hidden] {
  display: none !important;
}

.thread-list-heading {
  background: #f0f2f5;
  padding: 16px;
  font-size: 16px;
  font-weight: 700;
  color: #111b21;
  border-bottom: 1px solid #e9edef;
}

.thread-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  flex: 1;
}

.thread-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
  padding: 12px 16px;
  border: none;
  border-bottom: 1px solid #f0f2f5;
  background: #ffffff;
  color: #111b21;
  cursor: pointer;
  transition: background 0.15s ease;
  min-height: 72px;
  text-align: left;
}

.thread-tab:hover {
  background: #f5f6f6;
}

.thread-tab-active {
  background: #eaebeb;
}

.thread-tab-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: #00a884;
  color: white;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}

.thread-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.thread-details-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.thread-name {
  font-size: 15px;
  font-weight: 600;
  color: #111b21;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-time {
  font-size: 12px;
  color: #667781;
  flex-shrink: 0;
}

.thread-details-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.thread-snippet {
  font-size: 13px;
  color: #667781;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.thread-badge-container {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.thread-unread-badge {
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #25d366;
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 0 6px;
}

.owner-chat-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  /*height: 620px;*/
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  overflow: hidden;
  background: #ffffff;
}

.owner-chat-shell .thread-list-panel {
  grid-column: 1;
  order: 1;
}

.owner-chat-shell .chat-pane {
  grid-column: 2;
  order: 2;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100%;
}

.owner-chat-shell .chat-header {
  border-radius: 0;
  border: none;
  background: #f0f2f5;
  border-bottom: 1px solid #e9edef;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 59px;
  flex-shrink: 0;
}

.owner-chat-shell .chat-thread {
  border: none;
  border-radius: 0;
  background-color: #efeae2;
  padding: 20px 20px 0;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.owner-chat-shell .chat-thread> :last-child {
  margin-bottom: 20px;
}

.owner-chat-shell .chat-thread:empty {
  padding: 20px;
}

.owner-chat-shell .chat-thread .empty-state-card {
  margin: auto;
}

.owner-chat-shell .pagination-row {
  padding: 6px 16px;
  margin: 0;
  background: #f0f2f5;
  border-top: 1px solid #e9edef;
  flex-shrink: 0;
}

.owner-chat-shell .chat-composer {
  border: none;
  border-top: 1px solid #e9edef;
  border-radius: 0;
  margin: 0;
  padding: 12px 16px;
  background: #f0f2f5;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.owner-chat-shell .chat-composer textarea {
  background: #ffffff;
  border: none;
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 15px;
  flex: 13;
  resize: none;
  outline: none;
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  margin: 0;
}

.owner-chat-shell .chat-composer .primary-btn {
  background: #00a884;
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s;
  height: 40px;
  min-height: 40px;
  margin: 0;
  flex: 1;
}

.owner-chat-shell .chat-composer .primary-btn:hover {
  background: #008f72;
}

.owner-chat-shell .chat-composer .chat-send-btn {
  display: grid;
  flex: 0 0 44px;
  place-items: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
}

.chat-send-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.owner-chat-shell.chat-shell-fullwidth {
  grid-template-columns: 1fr;
}

.owner-chat-shell.chat-shell-fullwidth .thread-list-panel {
  display: none !important;
}

.owner-chat-shell.chat-shell-fullwidth .chat-pane {
  grid-column: 1;
  order: 1;
}

@media (max-width: 900px) {
  .owner-chat-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 500px;
  }

  .owner-chat-shell .thread-list-panel {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    min-width: 0;
    max-height: 240px;
    border-right: none;
    border-bottom: 1px solid #e9edef;
  }

  .owner-chat-shell .chat-pane {
    grid-column: 1;
    grid-row: 2;
    height: 480px;
  }

}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: white;
}

.chat-header h3 {
  margin: 0;
  font-size: 16px;
  color: #111827;
}

.chat-header .small-text {
  margin: 4px 0 0;
  color: #6b7280;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.chat-open-label {
  display: none;
}

.chat-header-info .small-text {
  margin: 0;
}

/* Green dot for unread messages in thread list */
.thread-unread-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}



.admin-page {
  padding: 20px 24px;
}

.admin-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: 1fr;
}

.admin-summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.summary-card {
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 18px;
  background: white;
  display: grid;
  gap: 8px;
}

.summary-card--blue {
  background: linear-gradient(180deg, #eef2ff 0%, #ffffff 100%);
  border-color: #dbeafe;
}

.summary-card--green {
  background: linear-gradient(180deg, #ecfdf5 0%, #ffffff 100%);
  border-color: #bbf7d0;
}

.summary-card--yellow {
  background: linear-gradient(180deg, #fffbeb 0%, #ffffff 100%);
  border-color: #fde68a;
}

.summary-card--purple {
  background: linear-gradient(180deg, #f5f3ff 0%, #ffffff 100%);
  border-color: #e9d5ff;
}

.summary-card--blue .summary-card-value {
  color: #1a73e8;
}

.summary-card--green .summary-card-value {
  color: #047857;
}

.summary-card--yellow .summary-card-value {
  color: #b45309;
}

.summary-card--purple .summary-card-value {
  color: #6b21a8;
}

.summary-card-title {
  font-size: 13px;
  color: #6b7280;
}

.summary-card-value {
  font-size: 28px;
  font-weight: 700;
  color: #111827;
}

.admin-charts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

@media (max-width: 1100px) {
  .admin-charts {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .admin-charts {
    grid-template-columns: 1fr;
  }
}

.chart-card {
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: white;
  padding: 18px;
}

.chart-card h2 {
  margin: 0 0 12px;
  font-size: 16px;
  color: #111827;
}

.admin-moderation {
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 18px;
  background: white;
}

/* Admin users panel */
.admin-users {
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 14px;
  background: white;
}

.admin-users-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 14px;
  margin-top: 12px;
}

.user-list {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 8px;
  max-height: 520px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fff;
}

.admin-user-item {
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: #f8fafc;
  cursor: pointer;
  font-weight: 700;
  color: #111827;
}

.admin-user-item:hover {
  background: #eff6ff;
  border-color: #dbeafe;
}

.user-details {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px;
  min-height: 160px;
  background: #fff;
}

/* ── Admin moderation workspace ───────────────────────────────
   The original admin page had no table, no search and no paging: a scrolling
   list of names on the left and a <pre> of three JSON fields on the right.
   Moderating a marketplace means scanning rows and acting on one, so these are
   real table controls rather than cards.

   Every destructive control routes through .adm-danger so the "this cannot be
   undone" weight is consistent, and .adm-btn keeps hit targets at 32px+ for
   the mobile case. */
.adm-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.adm-search {
  flex: 1 1 220px;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
}

.adm-search:focus {
  outline: none;
  border-color: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

.adm-select {
  padding: 9px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 13.5px;
  font-family: inherit;
  background: #fff;
  max-width: 190px;
}

.adm-btn {
  padding: 8px 12px;
  min-height: 34px;
  border-radius: 9px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #374151;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.adm-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.adm-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.adm-btn--primary {
  background: #1a73e8;
  border-color: #1a73e8;
  color: #fff;
}

.adm-btn--primary:hover {
  background: #1765cc;
  border-color: #1765cc;
}

.adm-btn--danger {
  background: #fee2e2;
  border-color: #fecaca;
  color: #b91c1c;
}

.adm-btn--danger:hover {
  background: #fecaca;
}

.adm-table-wrap {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: auto;
  background: #fff;
  -webkit-overflow-scrolling: touch;
}

.adm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 620px;
}

.adm-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #6b7280;
  background: #f8fafc;
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

.adm-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
  color: #374151;
}

.adm-table tbody tr:hover {
  background: #f8fafc;
}

.adm-table tbody tr:last-child td {
  border-bottom: none;
}

.adm-cell-main {
  font-weight: 700;
  color: #111827;
}

.adm-cell-sub {
  color: #6b7280;
  font-size: 12px;
  margin-top: 2px;
}

/* Clamp long free text (review bodies, messages). One line in the table; the
   full text stays available on the listing page. */
.adm-cell-text {
  color: #4b5563;
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.adm-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  white-space: nowrap;
}

.adm-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: 13px;
  color: #6b7280;
}

.adm-pager-btns {
  display: flex;
  gap: 6px;
}

.adm-count-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.adm-count {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 9px 11px;
  background: #f8fafc;
}

.adm-count-value {
  font-size: 19px;
  font-weight: 800;
  color: #111827;
  line-height: 1.1;
}

.adm-count-label {
  font-size: 11px;
  color: #6b7280;
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Deleting a user cascades through listings into their reviews, media and
   chats. The dialog has to state the real blast radius rather than a generic
   "cannot be undone". */
.adm-impact-list {
  text-align: left;
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  font-size: 13px;
  color: #7f1d1d;
  list-style: none;
}

.adm-impact-list li {
  padding: 2px 0;
}

.adm-empty {
  padding: 26px 16px;
  text-align: center;
  color: #6b7280;
  font-size: 14px;
}

/* ── Three-pane moderation workspace ──────────────────────
   Users (left) -> Listings (middle) -> Listing detail (right), with the
   selection carried in the URL hash so drill-down is linkable and the browser
   Back button moves up a level instead of leaving the console. Each pane owns
   its own scroll; only the listing drawer scrolls as a whole. */
.adm-workspace {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(280px, 1.4fr) minmax(340px, 2fr);
  gap: 12px;
  align-items: start;
  min-height: 62vh;
}

.adm-pane {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  display: flex;
  flex-direction: column;
  max-height: 72vh;
  overflow: hidden;
}

.adm-pane-head {
  padding: 11px 13px;
  border-bottom: 1px solid #e5e7eb;
  background: #f8fafc;
  border-radius: 12px 12px 0 0;
  flex-shrink: 0;
}

.adm-pane-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #475569;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.adm-pane-count {
  font-weight: 700;
  color: #64748b;
  text-transform: none;
  letter-spacing: 0;
}

.adm-pane-body {
  overflow-y: auto;
  padding: 8px;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

/* A selectable row in the left/middle panes. Replaces the old button cards so
   scanning a long user list is a single glance down one column. */
.adm-pick {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: #f8fafc;
  cursor: pointer;
  font-family: inherit;
  margin-bottom: 6px;
}

.adm-pick:hover {
  background: #eff6ff;
  border-color: #dbeafe;
}

.adm-pick.is-active {
  background: #eff6ff;
  border-color: #93c5fd;
  box-shadow: inset 3px 0 0 #1a73e8;
}

.adm-pick-name {
  font-weight: 700;
  font-size: 13.5px;
  color: #111827;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.adm-pick-sub {
  font-size: 12px;
  color: #6b7280;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}

/* Badge counts on a pick row tell the admin which listings need attention
   without opening each one. */
.adm-pick-counts {
  display: flex;
  gap: 5px;
  margin-top: 5px;
  flex-wrap: wrap;
}

.adm-chip {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: #eef2f7;
  color: #475569;
  white-space: nowrap;
}

.adm-chip--hot {
  background: #fee2e2;
  color: #b91c1c;
}

.adm-chip--warn {
  background: #fef3c7;
  color: #92400e;
}

/* Breadcrumb: replaces clicking "back" through the public listing page, which
   lost every bit of console state. */
.adm-crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: #6b7280;
  margin-bottom: 10px;
}

.adm-crumb {
  background: none;
  border: none;
  padding: 2px 4px;
  border-radius: 6px;
  font: inherit;
  font-weight: 600;
  color: #1a73e8;
  cursor: pointer;
}

.adm-crumb:hover {
  background: #eff6ff;
}

.adm-crumb:disabled {
  color: #475569;
  cursor: default;
  font-weight: 700;
}

.adm-crumb-sep {
  color: #cbd5e1;
}

.adm-detail-head {
  padding: 12px 13px;
  border-bottom: 1px solid #e5e7eb;
}

.adm-detail-name {
  font-size: 16px;
  font-weight: 800;
  color: #111827;
}

.adm-detail-meta {
  font-size: 12px;
  color: #6b7280;
  margin-top: 3px;
}

.adm-detail-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* Section groups inside the drawer: reviews, images, discussions, chats. */
.adm-section {
  border-top: 1px solid #f1f5f9;
  padding: 11px 13px;
}

.adm-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #475569;
  margin-bottom: 9px;
}

.adm-item {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 9px 10px;
  margin-bottom: 7px;
  background: #fff;
}

.adm-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.adm-item-who {
  font-size: 12.5px;
  font-weight: 700;
  color: #1f2937;
}

.adm-item-when {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
}

.adm-item-text {
  font-size: 13px;
  color: #374151;
  line-height: 1.45;
  word-break: break-word;
}

/* ─── Inbox tables (feedback + support) ────────────────────────────────────
   The unread dot is the primary scanning signal, so an unread row is also
   tinted and bolded: an admin triaging a queue should be able to find the
   unanswered items without reading any text. */
.adm-row--unread {
  background: #f0f9ff;
}

.adm-row--unread .adm-cell-main {
  font-weight: 600;
  color: #0c4a6e;
}

.adm-unread-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0ea5e9;
  margin-right: 7px;
  vertical-align: middle;
  flex: 0 0 auto;
}

.adm-table--clickable tbody tr {
  cursor: pointer;
}

.adm-table--clickable tbody tr:hover {
  background: #f1f5f9;
}

/* Keep the unread tint visible on hover, otherwise hovering an unread row makes
   it indistinguishable from a read one. */
.adm-table--clickable tbody tr.adm-row--unread:hover {
  background: #e0f2fe;
}

.adm-filter-note {
  font-size: 12px;
  color: #6b7280;
  margin: 0 0 10px;
}

/* The user's own words, quoted so it is clear this is their text and not an
   admin note. */
.adm-quote {
  border-left: 3px solid #cbd5e1;
  background: #f8fafc;
  padding: 10px 12px;
  border-radius: 0 8px 8px 0;
  margin-bottom: 14px;
  white-space: pre-wrap;
}

/* Staff replies are tinted differently from user replies so the thread reads
   at a glance as a conversation rather than a wall of equal blocks. */
.adm-msg--staff {
  background: #f0fdf4;
  border-left-color: #22c55e;
  border-radius: 0 8px 8px 0;
  padding-right: 10px;
}

.adm-reply {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e5e7eb;
}

.adm-textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  box-sizing: border-box;
}

.adm-textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

.adm-inline-field {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

.adm-toolbar--tight {
  gap: 12px;
  margin: 12px 0;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 8px;
}

.adm-btn.is-active {
  background: #0ea5e9;
  border-color: #0ea5e9;
  color: #fff;
}

.adm-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* ─── Inbox layout: table + right-hand drawer ──────────────────────────────────
   The detail used to render below the table, so clicking a row looked like a
   no-op until you scrolled down to find it. The drawer is a sibling column, so
   opening an item is visible the instant you click it. */
.adm-inbox {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 16px;
  align-items: start;
}

.adm-inbox-list {
  min-width: 0;
}

.adm-drawer {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Only the thread scrolls; the controls and reply box stay put so an admin can
   always see the action bar without scrolling back up. */
.adm-drawer-scroll {
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.adm-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e5e7eb;
}

.adm-drawer-title {
  min-width: 0;
}

.adm-drawer-head .adm-detail-name {
  overflow-wrap: anywhere;
}

.adm-drawer-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
}

.adm-drawer-controls .adm-select {
  max-width: 130px;
}

.adm-reply {
  margin-top: 0;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

.adm-reply-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

/* Square icon-only button. Sized to match the line-height of the select and
   text controls beside it so the toolbar stays on one baseline. */
.adm-btn--icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  flex: 0 0 auto;
}

.adm-btn--icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The unread toggle and send button carry meaning in the fill only; keep the
   filled shape for the send arrow so it reads as the primary action. */
.adm-btn--primary.adm-btn--icon svg {
  fill: currentColor;
}

@media (max-width: 900px) {
  /* Below this width two columns squeeze the table past usefulness, so the
     drawer becomes a full-height overlay instead.

     It must be hidden until an item is actually open: an always-on fixed
     overlay would sit on top of the tab bar and the whole page, swallowing
     every click. */
  .adm-inbox {
    grid-template-columns: minmax(0, 1fr);
  }

  .adm-drawer {
    display: none;
    position: fixed;
    inset: 0 0 0 auto;
    width: min(440px, 100%);
    max-height: none;
    /* Above the sticky site header (z-index 1000), which is otherwise the top
       layer and would swallow clicks on the drawer's own close button. Kept
       below the confirm modal (1600) so destructive dialogs still win. */
    z-index: 1100;
    border-radius: 0;
    box-shadow: -8px 0 24px rgba(15, 23, 42, .18);
  }

  .adm-drawer.is-open {
    display: flex;
  }
}

@media (max-width: 640px) {
  /* The table scrolls sideways rather than reflowing: a status column that
     wraps mid-word is harder to scan than one you scroll to. */
  .adm-table--clickable {
    min-width: 720px;
  }
  .adm-inline-field {
    flex-wrap: wrap;
  }
}

/* Individual chat messages, nested inside a thread. Indented and lightly
   ruled so a conversation reads as a sequence rather than a flat list, and so
   each message keeps its own Delete control. */
.adm-msg {
  border-left: 2px solid #e2e8f0;
  padding: 7px 0 7px 10px;
  margin-top: 7px;
}

.adm-msg:first-of-type {
  margin-top: 2px;
  border-left-color: #93c5fd;
}

.adm-msg .adm-item-actions {
  margin-top: 5px;
}

.adm-item-actions {
  display: flex;
  gap: 6px;
  margin-top: 7px;
  justify-content: flex-end;
}

/* Thumbnail grid. Each tile is individually removable: an admin removing one
   bad photo should not have to delete the whole listing. */
.adm-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
}

.adm-media-tile {
  position: relative;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 1;
  background: #f8fafc;
}

.adm-media-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.adm-media-del {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.adm-media-del:hover {
  background: #dc2626;
}

.adm-user-head {
  padding: 12px 13px;
  border-bottom: 1px solid #e5e7eb;
  background: #f8fafc;
}

.adm-report-row {
  border: 1px solid #e5e7eb;
  border-left: 3px solid #f59e0b;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: #fff;
}

.adm-report-reason {
  font-weight: 800;
  font-size: 13px;
  color: #111827;
}

@media (max-width: 1100px) {
  .adm-workspace {
    grid-template-columns: minmax(180px, 1fr) minmax(0, 1.6fr);
  }

  /* The detail pane spans the full width beneath the two lists: three columns
     at tablet width leaves each pane too narrow to read. */
  .adm-pane--detail {
    grid-column: 1 / -1;
    max-height: none;
  }
}

@media (max-width: 720px) {
  .adm-workspace {
    grid-template-columns: 1fr;
  }

  .adm-pane {
    max-height: 44vh;
  }

  .adm-pane--detail {
    max-height: none;
  }
}

.adm-note {
  font-size: 12px;
  color: #6b7280;
  margin-top: 10px;
}

.adm-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
}

.adm-modal-backdrop.is-open {
  display: flex;
}

.adm-modal {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.adm-modal h3 {
  margin: 0 0 8px;
  font-size: 16px;
  color: #111827;
}

.adm-modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
  flex-wrap: wrap;
}

@media (max-width: 680px) {
  .adm-table {
    min-width: 540px;
    font-size: 12.5px;
  }

  .adm-table th,
  .adm-table td {
    padding: 9px 10px;
  }

  .adm-toolbar > .adm-select,
  .adm-toolbar > .adm-btn {
    flex: 1 1 auto;
  }

  .adm-cell-text {
    max-width: 200px;
  }
}

@media (max-width: 900px) {
  .admin-users-grid {
    grid-template-columns: 1fr;
  }
}

.admin-moderation h2 {
  margin-top: 0;
  font-size: 18px;
  color: #111827;
}

.admin-moderation ul {
  margin: 12px 0 0;
  padding-left: 20px;
  color: #374151;
}

.admin-moderation code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 13px;
}

.chat-composer,
.discussion-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
}

.discussion-composer {
  margin-bottom: 14px;
}

.chat-composer textarea,
.discussion-composer textarea {
  width: 100%;
  min-height: 46px;
  max-height: 160px;
  resize: vertical;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 11px 12px;
  font: inherit;
  font-size: 14px;
  color: #111827;
  background: white;
  outline: none;
}

.chat-composer textarea:focus,
.discussion-composer textarea:focus {
  border-color: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
}

.primary-btn {
  min-height: 46px;
  border: none;
  border-radius: 10px;
  background: #1a73e8;
  color: white;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 0 18px;
  transition: background 0.15s;
}

.primary-btn:hover {
  background: #1558b0;
}

.chat-bubble {
  padding: 6px 12px 8px;
  border-radius: 7.5px 7.5px 7.5px 0;
  margin-bottom: 2px;
  background: #ffffff;
  border: none;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
  max-width: min(75%, 560px);
  width: fit-content;
  align-self: flex-start;
  position: relative;
}

.chat-bubble.mine {
  align-self: flex-end;
  background: #d9fdd3;
  border: none;
  border-radius: 7.5px 7.5px 0 7.5px;
}

.chat-avatar-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #00a884;
  color: white;
  font-size: 9px;
  font-weight: 700;
  flex-shrink: 0;
  margin-right: 4px;
}

.chat-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  justify-content: flex-end;
}

.chat-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  transition: background 0.15s, border-color 0.15s;
  opacity: 0.6;
}

.chat-action-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.12);
  opacity: 1;
}

.chat-bubble.mine .chat-action-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.15);
}

.chat-edit-area {
  margin-top: 6px;
}

.chat-edit-textarea {
  width: 100%;
  min-height: 46px;
  max-height: 120px;
  resize: vertical;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 14px;
  color: #111827;
  background: white;
  outline: none;
}

.chat-edit-textarea:focus {
  border-color: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
}

.chat-edit-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.chat-save-btn,
.chat-cancel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  transition: background 0.15s, border-color 0.15s;
}

.chat-save-btn:hover {
  background: #e6f4ea;
  border-color: #34a853;
}

.chat-cancel-btn:hover {
  background: #fce8e6;
  border-color: #ea4335;
}

.chat-meta {
  font-size: 12.5px;
  color: #1fa855;
  margin-bottom: 3px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.chat-text {
  color: #111827;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.chat-time {
  font-size: 11px;
  color: #667781;
  margin-top: 4px;
  text-align: right;
}

.discussion-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.discussion-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px;
  background: white;
}

.discussion-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.discussion-name {
  font-weight: 700;
  color: #111827;
}

.discussion-time {
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}

.discussion-badge {
  font-size: 12px;
  font-weight: 700;
  color: #1d4ed8;
  background: #eff6ff;
  border-radius: 999px;
  padding: 4px 9px;
}

.discussion-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  transition: background 0.15s, border-color 0.15s;
  opacity: 0.6;
}

.discussion-action-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.12);
  opacity: 1;
}

.discussion-edit-area {
  margin-top: 8px;
}

.discussion-edit-textarea {
  width: 100%;
  min-height: 46px;
  max-height: 120px;
  resize: vertical;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 14px;
  color: #111827;
  background: white;
  outline: none;
}

.discussion-edit-textarea:focus {
  border-color: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
}

.discussion-edit-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.disc-save-btn,
.disc-cancel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  transition: background 0.15s, border-color 0.15s;
}

.disc-save-btn:hover {
  background: #e6f4ea;
  border-color: #34a853;
}

.disc-cancel-btn:hover {
  background: #fce8e6;
  border-color: #ea4335;
}

.discussion-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin-top: 10px;
  color: #374151;
  line-height: 1.7;
}

.review-edit-area {
  margin-top: 12px;
}

.review-edit-title,
.review-edit-content {
  width: 100%;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  color: #222;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: #fafafa;
}

.review-edit-title:focus,
.review-edit-content:focus {
  border-color: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
  background: white;
}

.review-edit-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.review-save-btn,
.review-cancel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  transition: background 0.15s, border-color 0.15s;
}

.review-save-btn:hover {
  background: #e6f4ea;
  border-color: #34a853;
}

.review-cancel-btn:hover {
  background: #fce8e6;
  border-color: #ea4335;
}

.discussion-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.reaction-btn {
  border: 1px solid #e5e7eb;
  background: #fff;
  padding: 7px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  color: #374151;
}

.reaction-btn.active {
  background: #eef6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.reaction-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pagination-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.pager-status {
  font-size: 13px;
  color: #6b7280;
  font-weight: 600;
}

/* ── Nearby fell back to global: say so out loud ── */
.nearby-warning {
  margin: 12px auto 4px;
  padding: 10px 14px;
  max-width: 1300px;
  border: 1px solid #fcd34d;
  border-radius: 10px;
  background: #fffbeb;
  color: #92400e;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
}

/* ── Centered numbered page selector ── */
.page-pager {
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 18px auto 28px;
}

.page-num,
.page-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid #e5e7eb;
  border-radius: 9px;
  background: #fff;
  color: #374151;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}

/* Mirrors the icon-btn hover language used by the top-left back control. */
.page-num:hover,
.page-step:hover {
  background: rgba(26, 115, 232, 0.1);
  border-color: rgba(26, 115, 232, 0.35);
  color: #1a73e8;
  transform: scale(1.06);
}

.page-num:focus-visible,
.page-step:focus-visible {
  outline: 2px solid #1a73e8;
  outline-offset: 2px;
}

.page-num.is-current {
  background: #1a73e8;
  border-color: #1a73e8;
  color: #fff;
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.28);
  cursor: default;
}

.page-num.is-current:hover {
  background: #1a73e8;
  color: #fff;
  transform: none;
}

.page-step {
  min-width: 34px;
  font-size: 22px;
  font-weight: 700;
  color: #1a73e8;
  line-height: 0.7;
  padding-bottom: 4px;
}

.page-step.is-disabled {
  background: #f8fafc;
  border-color: #eef1f4;
  color: #cbd5e1;
  cursor: default;
  transform: none;
}

.page-gap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 34px;
  color: #9ca3af;
  font-size: 15px;
  font-weight: 700;
  user-select: none;
}

@media (max-width: 640px) {
  .page-pager {
    gap: 4px;
  }

  .page-num,
  .page-step {
    min-width: 30px;
    height: 30px;
    font-size: 13px;
  }

  .page-step {
    font-size: 19px;
  }
}

.pager-btn {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: white;
  color: #111827;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  min-height: 36px;
  padding: 0 12px;
}

.pager-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.review-sort {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.review-sort label {
  font-size: 13px;
  color: #6b7280;
}

.review-sort select {
  padding: 5px 5px;
  border-radius: 5px;
  border: 1px solid #d1d5db;
  font-size: 12px;
  min-width: 125px;
  background: white;
  color: #111827;
}

.review-list {
  display: grid;
  gap: 16px;
}

.review-card {
  padding: 20px;
  /*border-radius: 16px;*/
  border-top: 1px solid #e5e7eb;
  background: white;
  /*box-shadow: 0 3px 12px rgba(0, 0, 0, 0.04);*/
}

.review-card.is-pending,
.discussion-card.is-pending {
  background: #f8fafc;
  border-left: 3px solid #94a3b8;
}

.review-pending-status {
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}

.chat-bubble.is-pending {
  opacity: 0.72;
}

.review-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.review-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.review-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #ffffff;
  border: 0px solid #e5e7eb;
  color: #374151;
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.review-action-icon:hover {
  background: #eff3f8;
  border-color: #d1d5db;
}

.review-delete-btn {
  border: none;
  padding: 0;
  background: transparent;
}

.review-card .review-action-icon {
  min-width: 34px;
}

.review-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #1d4ed8;
  color: white;
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.15s;
}

.review-add-btn:hover {
  background: #2563eb;
}

.review-stars {
  display: flex;
  gap: 4px;
}

.review-stars span {
  color: #f59e0b;
  font-size: 14px;
}

.review-rating {
  font-size: 13px;
  color: #374151;
}

/* Review media grid */
.review-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.review-media-item {
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
}

.review-media-item img,
.review-media-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.review-media-clickable {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.review-media-clickable:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.review-card {
  padding: 10px 16px;
  border: none;
  border-bottom: 1px solid #f0f0f0;
  border-radius: 0;
  background: #fff;
}

.review-card:last-child {
  border-bottom: none;
}

/* Reviewer user row */
.review-user-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.review-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #eef2ff;
  color: #1a73e8;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.review-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.review-user-name {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
}

.review-own-badge {
  font-size: 11px;
  color: #6b7280;
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 500;
}

/* Title + Rating + Date row */
.review-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.review-stars {
  display: inline-flex;
  gap: 1px;
  flex-shrink: 0;
  align-self: center;
  margin-top: 0;
  vertical-align: middle;
}

.review-stars span {
  color: #f59e0b;
  font-size: 12px;
  line-height: 1;
}

.review-title {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  margin: 0;
  flex: 1;
  min-width: 0;
  align-self: center;
}

.review-date {
  font-size: 11px;
  color: #9ca3af;
  white-space: nowrap;
  padding-left: 4px;
}

/* Reactions bar */
.review-reactions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding-top: 0;
  border-top: none;
}

.review-reaction-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  color: #6b7280;
  transition: all 0.15s ease;
}

.review-reaction-btn:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

.review-reaction-btn.is-active {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}

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

.reaction-count {
  font-weight: 500;
  min-width: 12px;
}

.review-own-actions {
  margin-left: auto;
  display: flex;
  gap: 4px;
}

/* Override old review-card-top layout */
.review-card-top {
  display: none;
}

/* Override old review-meta */
.review-meta {
  display: none;
}

/* Override old review-text-area h3 */
.review-text-area {
  margin-top: 0;
}

.review-card h3 {
  margin: 0 0 10px;
  font-size: 16px;
  color: #111827;
}

.review-card p {
  margin: 0 0 12px;
  color: #4b5563;
  line-height: 1.8;
  font-size: 14px;
}

.review-meta {
  font-size: 13px;
  color: #6b7280;
}

.small-text {
  margin: 6px 0 0;
  color: #6b7280;
  font-size: 13px;
}

.empty-state-card {
  padding: 24px;
  border-radius: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #4b5563;
}

/* ── Category picker ────────────────────────────────────────────────
   A grid of tiles rather than a <select>. A dropdown hides the twenty
   options behind one click and gives no hint of what is inside each bucket;
   tiles show the whole taxonomy at once, which is the point when someone
   has to pick one in a few seconds. The search box matters more than it
   looks -- people arrive typing "dentist", not "hospital". */
.cat-picker {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.cat-search-wrap {
  position: relative;
  margin-bottom: 10px;
}

.cat-search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  opacity: 0.55;
  pointer-events: none;
}

.cat-search {
  width: 100%;
  padding: 10px 12px 10px 34px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
}

.cat-search:focus {
  outline: none;
  border-color: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  padding: 2px;
}

.cat-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 11px 6px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.cat-tile:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.cat-tile:focus-visible {
  outline: 2px solid #1a73e8;
  outline-offset: 1px;
}

.cat-tile.is-selected {
  border-color: #1a73e8;
  background: #eff6ff;
  box-shadow: 0 0 0 1px #1a73e8;
}

.cat-tile-icon {
  font-size: 21px;
  line-height: 1;
}

.cat-tile-label {
  font-size: 11.5px;
  font-weight: 600;
  color: #334155;
  line-height: 1.25;
  /* Two-line clamp: "Hardware & Construction" is the longest label and must
     not stretch its tile taller than the row it sits in. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cat-empty {
  margin: 12px 2px 2px;
  font-size: 13px;
  color: #64748b;
}

.cat-selected {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.cat-selected-icon {
  font-size: 22px;
  line-height: 1;
}

.cat-selected-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.cat-selected-body strong {
  font-size: 13.5px;
  color: #1e3a8a;
}

.cat-selected-body small {
  font-size: 12px;
  color: #475569;
}

@media (max-width: 680px) {
  .cat-grid {
    grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
    gap: 6px;
    max-height: 230px;
  }

  .cat-tile {
    padding: 10px 4px;
  }

  .cat-tile-icon {
    font-size: 19px;
  }
}

/* ── Signed-out gate for the login-only tabs ──
   Messages and Discussions share one card so the two tabs feel like the same
   feature. It replaces the panel body entirely rather than sitting above it:
   leaving the chat shell or the discussion composer on screen under a "please
   login" line reads as a page that failed to load, not as a deliberate gate. */
.auth-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 40px 24px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #f8fafc;
}

.auth-gate[hidden] {
  display: none;
}

.auth-gate-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #e0eaff;
  color: #1a73e8;
}

.auth-gate-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #111b21;
}

.auth-gate-text {
  margin: 0;
  max-width: 360px;
  font-size: 13.5px;
  line-height: 1.55;
  color: #667781;
}

.auth-gate-btn {
  display: inline-flex;
  align-items: center;
  margin-top: 4px;
  padding: 10px 22px;
  border-radius: 24px;
  background: #1a73e8;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease;
}

.auth-gate-btn:hover {
  background: #1765cc;
  color: #ffffff;
}

/* The two gated bodies opt back in from JS once the user turns out to be
   signed in. Both carry an explicit display value in CSS (.owner-chat-shell
   is a grid, #discussionsLoggedInBody is a block wrapper), and an explicit
   display beats the UA stylesheet's [hidden] { display: none } -- so without
   this the JS would set hidden=true and the panel would stay visible. */
.owner-chat-shell[hidden],
#discussionsLoggedInBody[hidden] {
  display: none !important;
}

@media (max-width: 680px) {
  .auth-gate {
    padding: 32px 18px;
    gap: 10px;
  }
}

/* ── Global Chat Dock ── */
.chat-dock {
  position: fixed;
  inset: 0;
  z-index: 1600;
  pointer-events: none;
}

.chat-dock-windows {
  position: absolute;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-end;
  gap: 12px;
  pointer-events: none;
}

.chat-dock-windows dialog.floating-win {
  pointer-events: auto;
}

.chat-floating-window {
  width: 420px;
  /*height: 560px;*/
  max-height: calc(100vh - 80px);
  max-width: calc(100vw - 40px);
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px 14px 0 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  transition: height 0.2s ease, opacity 0.2s ease;
  animation: chatSlideUp 0.2s ease;
}

/* Wider when in owner mode for better message readability */
.chat-floating-window.is-owner-mode {
  width: 520px;
  max-width: calc(100vw - 40px);
}

@keyframes chatSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-floating-window.is-minimized {
  height: 48px !important;
  min-height: 48px;
  overflow: hidden;
  border-radius: 14px;
}

.chat-floating-window.is-minimized .chat-floating-body {
  display: none;
}

.chat-floating-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #1a73e8;
  color: white;
  cursor: move;
  user-select: none;
  flex-shrink: 0;
  min-height: 48px;
}

.chat-floating-header-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.chat-floating-listing-name {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-floating-owner-name {
  font-size: 11px;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-floating-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.chat-floating-minimize-btn,
.chat-floating-close-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: background 0.15s;
}

.chat-floating-minimize-btn:hover,
.chat-floating-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.chat-floating-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
}

.chat-floating-resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 20px;
  height: 20px;
  cursor: nwse-resize;
  z-index: 10;
  background: linear-gradient(135deg, transparent 50%, rgba(0, 0, 0, 0.15) 50%);
  border-radius: 0 0 14px 0;
}

.chat-floating-inner {
  display: flex;
  flex-direction: row;
  flex: 1;
  min-height: 0;
}

.chat-floating-thread-panel {
  width: 260px;
  min-width: 220px;
  max-width: 320px;
  border-right: 1px solid #e9edef;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.chat-floating-pane {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.chat-floating-thread-list {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid #e9edef;
  background: #ffffff;
  max-height: 180px;
  overflow-y: auto;
  flex-shrink: 0;
}

.chat-floating-thread-list .thread-list-heading {
  background: #f0f2f5;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #111b21;
  border-bottom: 1px solid #e9edef;
  flex-shrink: 0;
}

.chat-floating-threads {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.chat-thread-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  border-bottom: 1px solid #f0f2f5;
  background: #ffffff;
  color: #111b21;
  cursor: pointer;
  text-align: left;
  min-height: 60px;
  transition: background 0.15s ease;
}

.chat-thread-tab:hover {
  background: #f5f6f6;
}

.chat-thread-tab.is-active {
  background: #eaebeb;
}

.chat-thread-tab .thread-tab-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #00a884;
  color: white;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.chat-thread-tab .thread-details {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.chat-thread-tab .thread-details-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.chat-thread-tab .thread-name {
  font-size: 14px;
  font-weight: 600;
  color: #111b21;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-thread-tab .thread-time {
  font-size: 11px;
  color: #667781;
  flex-shrink: 0;
}

.chat-thread-tab .thread-details-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.chat-thread-tab .thread-snippet {
  font-size: 12px;
  color: #667781;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.chat-thread-tab .thread-unread-badge {
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #25d366;
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 0 5px;
  flex-shrink: 0;
}

.chat-floating-thread {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-floating-composer {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
  flex-shrink: 0;
}

.chat-floating-input {
  flex: 1;
  border: 1px solid #d1d5db;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 13px;
  outline: none;
  resize: none;
  font-family: inherit;
  min-height: 36px;
  max-height: 80px;
  line-height: 1.4;
}

.chat-floating-input:focus {
  border-color: #1a73e8;
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.12);
}

.chat-floating-send-btn {
  flex-shrink: 0;
  align-self: flex-end;
}

/* ── Detached chat floating window (legacy, kept for compatibility) ── */
.detached-chat-window {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 420px;
  max-width: calc(100vw - 32px);
  height: 620px;
  max-height: calc(100vh - 96px);
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  z-index: 1600;
}

.detached-chat-window[hidden] {
  display: none !important;
}

.detached-chat-window-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.detached-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #f0f2f5;
  border-bottom: 1px solid #e9edef;
  cursor: move;
  user-select: none;
  flex-shrink: 0;
}

.detached-chat-header-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.detached-chat-header-title-text {
  font-size: 15px;
  font-weight: 800;
  color: #111827;
}

.detached-chat-header-sub {
  font-size: 12px;
  color: #6b7280;
}

.detached-chat-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.detached-chat-header-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #d1d5db;
  background: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background 0.15s, border-color 0.15s;
}

.detached-chat-header-btn:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.detached-chat-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.detached-chat-shell-container {
  height: 100%;
}

.detached-chat-window.is-minimized {
  height: 56px;
}

.detached-chat-window.is-minimized .detached-chat-body {
  display: none;
}

@media (max-width: 480px) {
  .detached-chat-window {
    width: calc(100vw - 24px);
    height: calc(100vh - 120px);
    right: 12px;
    bottom: 12px;
  }
}


@media (max-width: 980px) {
  .listing-grid {
    grid-template-columns: 1fr;
  }

  .listing-links {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .listing-page {
    padding: 18px 12px 36px;
  }

  .page-top {
    flex-direction: column;
    align-items: stretch;
  }

  .listing-card,
  .listing-side-card {
    padding: 18px;
  }

  .listing-social-tabs {
    padding: 18px;
    border-radius: 14px;
  }

  /* Ensure chat composer textarea remains visible in Messages tab on mobile */
  .chat-composer {
    grid-template-columns: 1fr auto !important;
  }

  .chat-composer textarea {
    display: block;
    height: auto;
    min-height: 44px;
    max-height: 160px;
    resize: vertical;
  }

  .discussion-composer {
    grid-template-columns: 1fr;
  }

  .primary-btn {
    width: 100%;
  }

  /* Keep the numbered pager centred on mobile too (it is not a
     Previous/Next pair, so space-between would push it off-axis). */
  .pagination-row:not(.page-pager) {
    justify-content: space-between;
  }

  .review-sort {
    width: 100%;
    justify-content: space-between;
  }
}


.error-message {
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  display: none;
  font-size: 13px;
}

.error-message.show {
  display: block;
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #323232;
  color: white;
  padding: 12px 22px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  z-index: 300;
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  white-space: nowrap;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.success {
  background: #1e7e34;
}

.toast.error {
  background: #c5221f;
}

/* ── Footer ── */
footer {
  background: #222;
  color: #ccc;
  text-align: center;
  padding: 24px 16px;
  margin-top: auto;
  font-size: 13px;
  line-height: 1.9;
}

footer strong {
  color: white;
}

/* Media + Lightbox */
.media-preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.media-thumb {
  width: 110px;
  height: 110px;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  background: #eef2ff;
  border: 1px solid #e5e7eb;
}

.media-thumb img,
.media-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, .55);
  color: white;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}

.listing-images {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  padding: 10px 0;
}

.listing-media-item {
  aspect-ratio: 16/10;
  border-radius: 10px;
  overflow: hidden;
  background: #eef2ff;
  border: 1px solid #e5e7eb;
  cursor: pointer;
}

.listing-media-item img,
.listing-media-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .85);
}

.lightbox-media {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-media img,
.lightbox-media video {
  max-height: 80vh;
  max-width: 90vw;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}

.lightbox-toolbar {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, .6);
  border-radius: 999px;
  color: white;
  font-size: 13px;
}

.lightbox-btn {
  background: rgba(255, 255, 255, .15);
  border: 1px solid rgba(255, 255, 255, .3);
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
}

.lightbox-btn:hover {
  background: rgba(255, 255, 255, .35);
}

.lightbox-index {
  min-width: 50px;
  text-align: center;
}

.media-remove:hover {
  background: rgba(0, 0, 0, .8);
}

/* ── Drag & Drop Upload Zone ── */
.dropzone-wrapper {
  margin-top: 6px;
}

.dropzone {
  position: relative;
  border: 2px dashed #cbd5e1;
  border-radius: 14px;
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #f8fafc;
}

.dropzone:hover {
  border-color: #1a73e8;
  background: #f0f7ff;
}

.dropzone.drag-over {
  border-color: #1a73e8;
  background: #edf4ff;
  border-style: solid;
  transform: scale(1.01);
  box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.1);
}

.dropzone.has-files {
  border-style: solid;
  border-color: #93c5fd;
  background: #f8fafc;
  padding: 16px 20px;
}

.dropzone-icon {
  font-size: 42px;
  line-height: 1;
  margin-bottom: 10px;
  display: block;
  color: #94a3b8;
}

.dropzone.has-files .dropzone-icon {
  display: none;
}

.dropzone-title {
  font-size: 15px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 4px;
}

.dropzone-sub {
  font-size: 12.5px;
  color: #94a3b8;
  margin-bottom: 6px;
}

.dropzone-hint {
  font-size: 11px;
  color: #a0aec0;
  margin-top: 8px;
}

.dropzone-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone-limits {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 10px;
  flex-wrap: wrap;
}

.dropzone-limit-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #94a3b8;
  background: #f1f5f9;
  padding: 4px 10px;
  border-radius: 999px;
}

.dropzone-limit-item .limit-icon {
  font-size: 12px;
  line-height: 1;
}

/* Media preview with count */
.media-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.media-thumb {
  width: 100%;
  height: 100px;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  background: #eef2ff;
  border: 1px solid #e5e7eb;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.media-thumb:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.media-thumb img,
.media-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-thumb .media-type-badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.media-thumb .media-size-label {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.55);
  color: white;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}

.media-thumb.existing {
  border: 1.5px solid #93c5fd;
}

.media-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, .55);
  color: white;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  z-index: 2;
  transition: all 0.15s;
}

.media-remove:hover {
  background: #dc2626;
  transform: scale(1.1);
}

.media-upload-error {
  color: #dc2626;
  font-size: 12px;
  margin-top: 8px;
  display: none;
}

.media-upload-error.show {
  display: block;
}

.media-count-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 11px;
  color: #94a3b8;
}

.media-count-info .count-label {
  font-weight: 600;
}

.media-count-info .count-badge {
  padding: 2px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-weight: 600;
}

.media-count-info .count-badge.warning {
  background: #fef3c7;
  color: #b45309;
}

.media-count-info .count-badge.full {
  background: #dcfce7;
  color: #166534;
}

/* Reorder handle for thumbnails */
.media-thumb .reorder-handle {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.4);
  color: white;
  cursor: grab;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.15s;
}

.media-thumb:hover .reorder-handle {
  opacity: 1;
}

@media (max-width: 480px) {
  .dropzone {
    padding: 24px 16px;
  }
  
  .dropzone-icon {
    font-size: 32px;
  }

  .dropzone-title {
    font-size: 13px;
  }

  .media-preview-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
  }

  .media-thumb {
    height: 80px;
  }
}

.rte-icon-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.rich-editor-controls {
  position: relative;
  z-index: 5;
}

.rich-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 7px 8px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  user-select: none;
  overflow: hidden;
  margin-bottom: 0;
}

.rich-editor-toolbar:focus-within {
  border-color: #93c5fd;
}

.rich-editor-toolbar button,
.rich-editor-toolbar select,
.rich-editor-toolbar input[type="color"] {
  flex: 0 0 auto;
  height: 32px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  color: #334155;
  background: #fff;
  cursor: pointer;
  transition: color .15s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.rich-editor-toolbar button {
  width: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.rich-editor-toolbar button svg,
.rte-color-tool svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.rich-editor-toolbar button:hover,
.rich-editor-toolbar select:hover {
  border-color: #93c5fd;
  color: #1d4ed8;
  background: #eff6ff;
}

.rich-editor-toolbar button:focus-visible,
.rich-editor-toolbar select:focus-visible,
.rich-editor-toolbar input[type="color"]:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 1px;
}

.rich-editor-toolbar button.is-active,
.rich-editor-toolbar button[aria-pressed="true"] {
  border-color: #93c5fd;
  color: #1d4ed8;
  background: #dbeafe;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .08);
}

.rich-editor-toolbar select {
  width: 120px;
  min-width: 0;
  max-width: 140px;
  padding: 0 5px;
  font-size: 12px;
}

.rich-editor-toolbar select.rte-size-select {
  width: 58px;
  max-width: 58px;
}

.rich-editor-toolbar input[type="color"] {
  width: 28px;
  padding: 3px;
}

.rich-editor-toolbar .rte-color-tool {
  position: relative;
  margin-left: -5px;
  width: 27px;
  border-left: 0;
  border-radius: 0 6px 6px 0;
}

.color-swatch {
  position: absolute;
  bottom: 3px;
  left: 6px;
  right: 6px;
  height: 3px;
  border-radius: 2px;
  background: #111827;
}

#bodyHiliteColorSwatch {
  background: #fff176;
}

.toolbar-sep {
  width: 1px;
  height: 20px;
  background: #d1d5db;
  margin: 0 3px;
  display: inline-block;
  flex: 0 0 1px;
}

.rte-popover {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 30;
  display: flex;
  align-items: end;
  gap: 10px;
  padding: 12px;
  max-width: calc(100% - 16px);
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .18);
}

.rte-popover[hidden] {
  display: none;
}

.rte-popover label {
  display: grid;
  gap: 4px;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
}

.rte-popover input,
.rte-popover select {
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #1f2937;
  background: #fff;
  font: inherit;
}

.rte-table-popover {
  width: 228px;
  padding: 12px;
}

.rte-table-picker {
  display: grid;
  justify-items: center;
  gap: 9px;
  width: 100%;
}

.rte-table-picker-title {
  justify-self: start;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.rte-table-grid {
  display: grid;
  grid-template-columns: repeat(8, 22px);
  gap: 3px;
}

.rte-table-grid-cell {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
}

.rte-table-grid-cell.is-highlighted {
  border-color: #3b82f6;
  background: #dbeafe;
}

.rte-table-grid-cell:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid #2563eb;
  outline-offset: 1px;
}

.rte-table-grid-size {
  min-height: 16px;
  color: #64748b;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.rte-table-alignment-popover {
  align-items: center;
  gap: 5px;
  padding: 6px;
  width: max-content;
}

.rte-table-alignment-popover button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  color: #334155;
  background: #fff;
  cursor: pointer;
  transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}

.rte-table-alignment-popover button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.rte-table-alignment-popover button:hover,
.rte-table-alignment-popover button.is-active {
  border-color: #93c5fd;
  color: #1d4ed8;
  background: #dbeafe;
}

.rte-table-alignment-popover button:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 1px;
}

.rte-table-alignment-popover button:disabled {
  color: #94a3b8;
  cursor: not-allowed;
}

.rte-link-popover {
  align-items: center;
  flex-wrap: wrap;
  width: min(440px, 100%);
}

.rte-link-popover label {
  flex: 1 0 100%;
}

.rte-link-popover input {
  flex: 1 1 220px;
}

.rte-popover-primary {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #1d4ed8;
  border-radius: 6px;
  color: #fff;
  background: #2563eb;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.rte-popover-primary:hover {
  background: #1d4ed8;
}

.rte-popover-hint {
  flex: 1 0 100%;
  color: #64748b;
  font-size: 11px;
}

.rte-emoji-popover {
  display: block;
  width: min(340px, 100%);
}

.rte-emoji-popover > input {
  width: 100%;
  margin-bottom: 8px;
}

.rte-emoji-grid {
  max-height: 250px;
  overflow: auto;
}

.rte-emoji-group-title {
  margin: 7px 0 4px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.rte-emoji-choice {
  width: 36px;
  height: 36px;
  margin: 1px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
}

.rte-emoji-choice:hover,
.rte-emoji-choice:focus-visible {
  background: #eff6ff;
}

.rich-editor {
  min-height: 150px;
  border: 1px solid #ccc;
  border-top: none;
  border-radius: 0 0 6px 6px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.6;
  outline: none;
  overflow-y: auto;
  background: #fff;
  margin-top: 0;
}

.rich-editor:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, .15);
}

.rich-editor[data-empty="true"]:before {
  content: attr(data-placeholder);
  color: #999;
  pointer-events: none;
}

.rich-editor h1 {
  font-size: 22px;
  margin: 0 0 8px;
}

.rich-editor h2 {
  font-size: 18px;
  margin: 0 0 6px;
}

.rich-editor h3 {
  font-size: 16px;
  margin: 0 0 4px;
}

.rich-editor p {
  margin: 0 0 8px;
}

.rich-editor ul,
.rich-editor ol {
  padding-left: 20px;
  margin: 0 0 8px;
}

.rich-editor table {
  border-collapse: collapse;
  width: 100%;
  margin: 0 0 8px;
  border-spacing: 0;
  table-layout: fixed;
}

.rich-editor table.rich-editor-table {
  max-width: 100%;
}

.rich-editor th {
  background: #f8fafc;
  font-weight: 700;
  text-align: left;
}

.rich-editor td,
.rich-editor th {
  position: relative;
  border: 1px solid #cbd5e1;
  padding: 6px 4px;
  min-width: 0;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.rich-editor table.rich-editor-table tr:first-child > td:not(:last-child)::after,
.rich-editor table.rich-editor-table tr:first-child > th:not(:last-child)::after {
  content: "";
  position: absolute;
  z-index: 2;
  top: 0;
  right: -6px;
  bottom: 0;
  width: 12px;
  background: rgba(37, 99, 235, .12);
  cursor: col-resize;
  touch-action: none;
}

.rich-editor table.rich-editor-table tr:first-child > td:not(:last-child):hover::after,
.rich-editor table.rich-editor-table tr:first-child > th:not(:last-child):hover::after {
  background: rgba(37, 99, 235, .4);
}

.rich-editor table.rich-editor-table tr:last-child > td:last-child::before,
.rich-editor table.rich-editor-table tr:last-child > th:last-child::before {
  content: "";
  position: absolute;
  z-index: 3;
  right: -1px;
  bottom: -1px;
  width: 16px;
  height: 16px;
  background: linear-gradient(135deg, transparent 45%, #2563eb 46%, #2563eb 58%, transparent 59%);
  cursor: nwse-resize;
  touch-action: none;
}

.rich-editor.is-resizing-table,
.rich-editor.is-resizing-table * {
  user-select: none;
}

.rich-select {
  border: 1px solid #ccc;
  background: #fff;
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 11px;
  height: 24px;
  cursor: pointer;
  margin: 0 1px;
}

.rich-select-sm {
  min-width: 36px;
  max-width: 52px;
  padding: 1px 2px;
  font-size: 10px;
}

.material-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  color: #222;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: #fff;
  border: 1px solid #d0d0d0;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
  cursor: pointer;
}

.material-icon-btn:hover {
  background: #e0e0e0;
  color: #1a73e8;
  border-color: #b0b0b0;
}

.material-icons {
  font-size: 18px;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.color-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid #ccc;
  background: #fff;
  border-radius: 3px;
  cursor: pointer;
  padding: 0;
  margin: 0 1px;
}

.color-btn:hover {
  background: #e8e8e8;
}

.color-swatch {
  position: absolute;
  bottom: 1px;
  left: 3px;
  right: 3px;
  height: 3px;
  border-radius: 1px;
}

/* ── Tools Menu (Hamburger) ── */
.tools-menu {
  position: relative;
}

.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  padding: 6px 5px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: background 0.15s;
}

.hamburger:hover {
  background: rgba(255, 255, 255, 0.25);
}

.hamburger span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: white;
  transition: transform 0.2s, opacity 0.2s;
}

.tools-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  min-width: 210px;
  z-index: 150;
  overflow: hidden;
  animation: slideUp 0.15s ease;
}

.tools-dropdown.open {
  display: block;
}

.tools-dropdown-header {
  padding: 12px 14px;
  font-size: 12px;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #eee;
  background: #fafafa;
}

.tools-link {
  display: block;
  padding: 10px 14px;
  font-size: 13px;
  color: #333;
  text-decoration: none;
  transition: background 0.1s;
  border-bottom: 1px solid #f5f5f5;
}

.tools-link:hover {
  background: #e8f0fe;
  color: #1a73e8;
}

.tools-dropdown-footer {
  padding: 10px 14px;
  font-size: 11px;
  color: #aaa;
  text-align: center;
  background: #fafafa;
  border-top: 1px solid #eee;
}

@media (max-width: 640px) {
  .tools-dropdown {
    min-width: 180px;
  }

  .tools-link {
    font-size: 12px;
    padding: 8px 12px;
  }
}

/* ── Date/Time Widget ── */
.datetime-widget {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  background: transparent;
  border: none;
  transition: background 0.15s;
  user-select: none;
  line-height: 1.2;
  min-width: 82px;
}

.datetime-widget:hover {
  background: rgba(255, 255, 255, 0.12);
}

.dt-time {
  color: white;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.dt-date {
  color: rgba(255, 255, 255, 0.8);
  font-size: 9px;
  font-weight: 500;
  margin-top: 1px;
  white-space: nowrap;
}

/* ── Floating Calendar ── */
.datetime-widget-wrap,
.weather-widget-wrap {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
}

.calendar-floating {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  width: 280px;
  padding: 14px;
  z-index: 150;
  animation: slideUp 0.15s ease;
}

.calendar-floating.open {
  display: block;
}

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cal-nav {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #555;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
  transition: background 0.15s;
}

.cal-nav:hover {
  background: #f0f0f0;
}

.cal-month-year {
  font-size: 14px;
  font-weight: 700;
  color: #111;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #333;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.1s;
}

.cal-day:hover {
  background: #e8f0fe;
}

.cal-day.other-month {
  color: #ccc;
}

.cal-day.today {
  background: #1a73e8;
  color: white;
  font-weight: 700;
}

.cal-day.today:hover {
  background: #1558b0;
}

/* ── Weather Widget ── */
.weather-widget {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  background: transparent;
  border: none;
  transition: background 0.15s;
  user-select: none;
  white-space: nowrap;
}

.weather-widget:hover {
  background: rgba(255, 255, 255, 0.12);
}

.weather-icon {
  font-size: 16px;
  line-height: 1;
}

.weather-temp {
  color: white;
  font-size: 13px;
  font-weight: 700;
}

.weather-location {
  color: rgba(255, 255, 255, 0.75);
  font-size: 9px;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Weather Dialog ── */
.weather-dialog {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: white;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  width: 340px;
  max-width: calc(100vw - 32px);
  z-index: 150;
  overflow: hidden;
  animation: slideUp 0.15s ease;
}

.weather-dialog.open {
  display: block;
}

.weather-dialog-header {
  background: linear-gradient(135deg, #1a73e8, #4a90d9);
  color: white;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}

.weather-dialog-location {
  font-size: 11px;
  font-weight: 400;
  opacity: 0.8;
  flex: 1;
  text-align: right;
}

.weather-dialog-close {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.15s;
  flex-shrink: 0;
}

.weather-dialog-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.weather-dialog-body {
  padding: 16px;
  max-height: 480px;
  overflow-y: auto;
}

.weather-today-big {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.weather-today-icon {
  font-size: 42px;
  line-height: 1;
}

.weather-today-temp {
  font-size: 32px;
  font-weight: 700;
  color: #111;
}

.weather-today-details {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
  color: #666;
}

.weather-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 14px 0;
}

.weather-week-title {
  font-size: 13px;
  font-weight: 700;
  color: #111;
  margin-bottom: 10px;
}

.weather-week-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.weather-day-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8f9fb;
}

.weather-day-name {
  font-size: 12px;
  font-weight: 600;
  color: #444;
  width: 36px;
  flex-shrink: 0;
}

.weather-day-icon {
  font-size: 16px;
  width: 24px;
  text-align: center;
}

.weather-day-temps {
  display: flex;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}

.weather-day-high {
  color: #111;
}

.weather-day-low {
  color: #999;
}

.weather-day-precip {
  margin-left: auto;
  font-size: 11px;
  color: #1a73e8;
}

/* ── Header mobile adjustments ── */
@media (max-width: 640px) {
  header {
    padding: 10px 12px;
    gap: 8px;
    flex-wrap: nowrap;
  }

  .header-left {
    gap: 6px;
  }

  .datetime-widget {
    display: none;
  }

  .weather-widget {
    display: none;
  }

  .calendar-floating {
    width: 240px;
  }

  .weather-dialog {
    width: 290px;
  }
}

@media (max-width: 480px) {
  .header-left {
    gap: 4px;
  }
}

/* ── Header Search Box ── */
.header-search-box {
  margin: 0;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 20px;
  padding: 6px 14px;
  width: 100%;
  max-width: 480px;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
  /*justify-self: center;*/
}

.header-search-box:focus-within {
  background: white;
  border-color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.header-search-box svg {
  width: 16px;
  height: 16px;
  stroke: rgba(255, 255, 255, 0.8);
  margin-right: 8px;
  flex-shrink: 0;
  transition: stroke 0.2s;
}

.header-search-box:focus-within svg {
  stroke: #666;
}

.header-search-box input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: white;
  font-size: 13.5px;
  transition: color 0.2s;
  /* Remove the native search chrome (rounded corners + cancel button) that
     browsers apply to type="search". We provide our own glyph + clear button. */
  -webkit-appearance: none;
  appearance: none;
}

.search-category-control {
  position: relative;
  flex: 0 0 auto;
}

.search-category-trigger {
  display: inline-flex;
  max-width: 150px;
  align-items: center;
  gap: 5px;
  padding: 3px 1px 3px 5px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.95);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.search-category-trigger:hover,
.search-category-trigger[aria-expanded="true"] {
  color: #fff;
}

.header-search-box:focus-within .search-category-trigger {
  color: #334155;
}

.search-category-trigger svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  margin: 0;
  stroke: currentColor;
}

.search-category-label {
  overflow: hidden;
  max-width: 96px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-category-arrow {
  flex: 0 0 auto;
  font-size: 10px;
}

.search-category-popup,
.search-category-popup[hidden] {
  display: none;
}

.search-category-popup:not([hidden]) {
  position: absolute;
  z-index: 1100;
  top: calc(100% + 9px);
  right: 0;
  display: block;
  width: min(340px, calc(100vw - 20px));
  padding: 14px;
  border: 1px solid #dbe3ed;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.2);
  color: #26364a;
  text-align: left;
}

.search-category-popup-header,
.search-category-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.search-category-popup-header strong {
  font-size: 14px;
}

.search-category-popup button {
  border: 0;
  background: transparent;
  color: #1765b1;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.search-category-help {
  margin: 5px 0 10px;
  color: #64748b;
  font-size: 11px;
  line-height: 1.4;
}

.search-category-options {
  display: grid;
  max-height: min(52vh, 340px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 8px;
  overflow-y: auto;
  padding: 2px;
}

.search-category-option {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  padding: 7px 5px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #334155;
  cursor: pointer;
}

.search-category-option:hover {
  background: #f1f6fc;
}

.search-category-option.is-selected {
  border-color: #a9c9f5;
  background: #eaf2ff;
  color: #174a86;
}

.search-category-option.is-selected:hover {
  background: #dfebfc;
}

.search-category-option input {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  margin: 0;
  accent-color: #1a73e8;
}

.search-category-option-icon {
  flex: 0 0 auto;
  font-size: 16px;
}

.search-category-option-label {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-category-option.is-selected .search-category-option-label {
  font-weight: 700;
}

.search-category-status {
  margin: 10px 0 0;
  color: #b42318;
  font-size: 12px;
}

.search-category-actions {
  justify-content: flex-end;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #edf0f4;
}

.search-category-actions #searchCategoryApplyBtn {
  padding: 7px 14px;
  border-radius: 8px;
  background: #1a73e8;
  color: #fff;
}

.search-category-actions #searchCategoryApplyBtn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.clear-search-btn {
  border: 0;
  padding: 0 0 1px;
  margin-left: 6px;
  background: transparent;
  color: #777;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.clear-search-btn:hover {
  color: #222;
}

.header-search-box:focus-within input {
  color: #333;
}

.header-search-box input::placeholder {
  color: rgba(255, 255, 255, 0.8);
  transition: color 0.2s;
}

.header-search-box:focus-within input::placeholder {
  color: #999;
}

/* Hide the native clear button that Browsers add for type="search",
   so our custom clear-search-btn remains the single clear control.
   (appearance:none alone is not enough on iOS Safari / some builds, so we
   also force the pseudo-elements to display:none and disable the legacy
   Edge/IE -ms-clear control.) */
.header-search-box input::-webkit-search-cancel-button,
.header-search-box input::-webkit-search-decoration,
.header-search-box input::-webkit-search-results-button,
.header-search-box input::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none !important;
}

.header-search-box input::-ms-clear {
  display: none !important;
  width: 0;
  height: 0;
}

/* ── Footer Redesign ── */
.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.footer-link {
  color: #ccc;
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
  transition: color 0.15s;
  cursor: pointer;
}

.footer-link:hover {
  color: #fe8500;
}

.footer-sep {
  color: #444;
  user-select: none;
}

.footer-info {
  font-size: 12px;
  color: #888;
}

.footer-tools-menu {
  position: relative;
  display: inline-block;
}

.footer-tools-dropdown {
  display: none;
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border-radius: 10px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
  min-width: 180px;
  z-index: 150;
  overflow: hidden;
  text-align: left;
  animation: slideUp 0.15s ease;
}

.footer-tools-dropdown.open {
  display: block;
}

.footer-tools-dropdown .tools-link {
  border-bottom: 1px solid #f0f0f0;
}

.footer-tools-dropdown .tools-link:hover {
  background: #fff3e0;
  color: #fe8500;
}

/* ── Compact Review Summary Row ── */
.review-summary-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.review-summary-stars {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: default;
}

.summary-avg-rating {
  font-size: 20px;
  font-weight: 800;
  color: #111827;
  line-height: 1;
}

.summary-stars-display {
  display: flex;
  gap: 2px;
  line-height: 1;
}

.summary-stars-display span {
  color: #f59e0b;
  font-size: 14px;
  line-height: 1;
}

.summary-total {
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
}

.review-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Rating Distribution Popup ── */
.rating-distribution-popup {
  display: block;
  position: absolute;
  z-index: 500;
  top: calc(100% + 6px);
  left: 100%;
  margin-left: 8px;
}

.review-distribution-control {
  position: relative;
  display: inline-flex;
}

.rating-distribution-popup[hidden] {
  display: none !important;
}

.rating-distribution-backdrop {
  display: none;
}

.rating-distribution-card {
  position: relative;
  background: white;
  border-radius: 12px;
  padding: 16px 18px;
  min-width: 280px;
  max-width: 360px;
  width: max-content;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
  border: 1px solid #e5e7eb;
  animation: popIn 0.12s ease;
}

@keyframes popIn {
  from {
    transform: translateY(-4px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.rating-dist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.rating-dist-title {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
}

.rating-dist-close {
  border: none;
  background: #f3f4f6;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  transition: background 0.15s;
}

.rating-dist-close:hover {
  background: #e5e7eb;
}

.rating-dist-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rating-dist-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rating-dist-label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  min-width: 42px;
}

.rating-dist-bar-track {
  flex: 1;
  height: 10px;
  background: #f3f4f6;
  border-radius: 999px;
  overflow: hidden;
}

.rating-dist-bar-fill {
  height: 100%;
  background: #f59e0b;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.rating-dist-count {
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  min-width: 28px;
  text-align: right;
}

.review-distribution-btn {
  border: none;
  background: #f3f4f6;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  transition: background 0.15s;
  flex-shrink: 0;
}

.review-distribution-btn:hover {
  background: #e5e7eb;
  color: #374151;
}

/* Scrollable area for reviews and discussions */
.scroll-area {
  max-height: 480px;
  overflow-y: auto;
  /*border: 1px solid #f0f0f0;*/
  border-radius: 0;
  width: 100%;
}

.scroll-area::-webkit-scrollbar {
  width: 6px;
}

.scroll-area::-webkit-scrollbar-track {
  background: #f5f5f5;
}

.scroll-area::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 999px;
}

.scroll-area::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Discussion composer placed on top */
.discussion-composer-wrap {
  margin-bottom: 12px;
}

.discussion-composer-wrap .discussion-composer {
  margin-top: 0;
  margin-bottom: 0;
}

/* Discussion area styled like chat/messages */
.discussion-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background-color: #efeae2;
  border-radius: 12px;
  padding: 20px;
  min-height: 320px;
  max-height: 400px;
  overflow-y: auto;
}

.discussion-card {
  border: none;
  border-radius: 7.5px 7.5px 7.5px 0;
  padding: 6px 12px 8px;
  background: #ffffff;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
  max-width: min(75%, 560px);
  width: fit-content;
  align-self: flex-start;
  position: relative;
}

.discussion-card:has(.review-own-badge) {
  align-self: flex-end;
  background: #d9fdd3;
  border-radius: 7.5px 7.5px 0 7.5px;
}

.discussion-card .review-user-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.discussion-card .review-user-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #00a884;
  color: white;
  font-size: 9px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}

.discussion-card .review-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.discussion-card .review-user-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #1fa855;
}

.discussion-card .review-date {
  font-size: 11px;
  color: #667781;
  margin-top: 4px;
  text-align: right;
}

.discussion-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin-top: 0;
  color: #111827;
  line-height: 1.5;
  font-size: 14px;
}

.discussion-card .review-reactions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  justify-content: flex-end;
}

/* Discussion reactions use standard review reaction buttons */

.discussion-card .review-own-actions {
  display: flex;
  gap: 4px;
}

.discussion-card .review-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  transition: background 0.15s, border-color 0.15s;
  opacity: 0.6;
}

.discussion-card .review-action-icon:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.12);
  opacity: 1;
}

.discussion-card .reaction-count {
  font-size: 11px;
  color: #667781;
  margin-left: 1px;
}

.discussion-edit-area {
  margin-top: 6px;
}

/* ── Review Owner Reply Section (Inline, hidden by default, toggled by Reply button) ── */
/* Reply wrapper for the on-demand reply form (hidden by default) */
.review-owner-reply-wrapper {
  display: none;
}

.review-owner-reply-wrapper.show {
  display: block;
}

/* Compact meta row for owner reply: signature + date + delete */
.review-reply-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.review-owner-reply {
  margin-top: 12px;
  padding: 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
}

.review-owner-reply-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: #15803d;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}

.review-owner-reply-indicator svg {
  color: #15803d;
}

.review-owner-reply-body .review-user-avatar {
  width: 24px;
  height: 24px;
  font-size: 10px;
}

.review-owner-reply-body .review-user-name {
  font-size: 12px;
  color: #00a884;
}

.review-owner-reply-text {
  font-size: 14px;
  color: #374151;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin-top: 2px;
}

.review-reply-textarea:focus {
  border-color: #1a73e8 !important;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
}


/* Reply toggle button inline within review card */
.review-reply-actions {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.review-reply-toggle-btn {
  border: 1px solid #e5e7eb;
  background: #fff;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: #15803d;
  transition: background 0.15s, border-color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.review-reply-toggle-btn:hover {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

/* Override reviews-heading for compact layout */
.reviews-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* ── Floating Chat Dialog Styles ── */
dialog.floating-win {
  position: fixed;
  margin: 0;
  padding: 0;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.22);
  z-index: 1600;
  width: 420px;
  max-width: calc(100vw - 40px);
  height: 520px;
  min-height: 420px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

dialog.floating-win[open] {
  display: flex;
}

dialog.floating-win::backdrop {
  display: none;
}

.floating-win.is-minimized {
  height: 56px !important;
  min-height: 56px !important;
  overflow: hidden;
}

.floating-win.is-minimized .win-body {
  display: none !important;
}

.floating-win .win-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #f0f2f5;
  color: #111827;
  border-bottom: 1px solid #e5e7eb;
  cursor: move;
  user-select: none;
  flex-shrink: 0;
  min-height: 52px;
}

.floating-win .win-header-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.floating-win .win-title {
  font-weight: bold;
  font-size: 14px;
}

.floating-win .win-subtitle {
  font-size: 11px;
  opacity: 0.85;
}

.floating-win .win-controls {
  display: flex;
  gap: 8px;
}

.floating-win .win-btn {
  background: transparent;
  border: none;
  color: #4b5563;
  cursor: pointer;
  font-size: 14px;
  padding: 6px 8px;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}

.floating-win .win-btn:hover {
  background: rgba(17, 24, 39, 0.08);
  color: #111827;
}

.floating-win .win-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.floating-win .win-inner {
  display: flex;
  flex-direction: row;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.floating-win.is-minimized .win-body {
  display: none !important;
}

.floating-win .win-inner {
  display: flex;
  flex-direction: row;
  flex: 1;
  min-height: 0;
}

.floating-win .win-thread-panel {
  width: 260px;
  min-width: 220px;
  max-width: 320px;
  border-right: 1px solid #e9edef;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  min-height: 0;
}

.floating-win.is-owner-mode {
  width: 760px;
  max-width: calc(100vw - 40px);
}

.floating-win .win-thread-panel .thread-list-heading {
  background: #f0f2f5;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #111b21;
  border-bottom: 1px solid #e9edef;
  flex-shrink: 0;
}

.floating-win .win-threads {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex: 1;
}

.floating-win .win-pane {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.floating-win .win-thread {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background-color: #efeae2;
  min-height: 0;
}

.floating-win .win-composer {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid #e5e7eb;
  background: #f0f2f5;
  flex-shrink: 0;
}

.floating-win .win-refresh-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 12px;
  background: #fff7ed;
  color: #7c2d12;
  font-size: 12px;
  flex-shrink: 0;
}

.floating-win .win-refresh-status[hidden] {
  display: none !important;
}

.floating-win .win-refresh-btn {
  flex-shrink: 0;
  padding: 5px 10px;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  background: #fff;
  color: #9a3412;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.floating-win .win-status {
  padding: 4px 14px;
  background: #f0f2f5;
  color: #475569;
  font-size: 12px;
}

.floating-win .win-status.is-error {
  color: #b91c1c;
}

.floating-win .win-input {
  flex: 1;
  width: 100%;
  min-width: 0;
  border: 1px solid #d1d5db;
  border-radius: 20px;
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
  resize: none;
  font-family: inherit;
  min-height: 42px;
  max-height: 100px;
  line-height: 1.4;
  background: #fff;
  scrollbar-width: none;
}

.floating-win .win-input::-webkit-scrollbar {
  display: none;
}

.floating-win .win-input:focus {
  border-color: #1a73e8;
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.12);
}

.floating-win .win-send-btn {
  display: grid;
  flex: 0 0 44px;
  place-items: center;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
  background: #00a884;
  flex-shrink: 0;
  align-self: flex-end;
}

.floating-win .win-send-label {
  display: none;
}

.emoji-textarea-wrap {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.emoji-control {
  display: none;
  flex: 0 0 auto;
}

.emoji-trigger {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 8px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  color: #475569;
  background: #fff;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.emoji-trigger:hover,
.emoji-trigger[aria-expanded="true"] {
  color: #1a73e8;
  border-color: #93c5fd;
  background: #eff6ff;
}

.emoji-trigger svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.emoji-picker-popover {
  position: fixed;
  inset: auto;
  margin: 0;
  z-index: 12000;
  width: 292px;
  max-width: calc(100vw - 16px);
  max-height: min(340px, 55vh);
  overflow: auto;
  padding: 10px;
  border: 1px solid #dbe2ea;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.2);
}

.emoji-picker-search {
  width: 100%;
  height: 34px;
  margin-bottom: 8px;
  padding: 6px 9px;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  color: #111827;
  font: inherit;
  font-size: 13px;
}

.emoji-picker-group + .emoji-picker-group {
  margin-top: 10px;
}

.emoji-picker-group h4 {
  margin: 0 0 6px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.emoji-picker-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 2px;
}

.emoji-picker-choice {
  display: grid;
  place-items: center;
  min-width: 0;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font-size: 21px;
  line-height: 1;
}

.emoji-picker-choice:hover,
.emoji-picker-choice:focus-visible {
  outline: none;
  background: #eff6ff;
}

.owner-chat-shell .chat-composer .emoji-textarea-wrap {
  flex: 13;
}

.owner-chat-shell .chat-composer .emoji-textarea-wrap textarea {
  flex: 1;
  width: 100%;
  min-width: 0;
}

.discussion-composer .emoji-textarea-wrap {
  grid-column: 1;
}

.floating-win .win-composer .emoji-textarea-wrap {
  flex: 1 1 0%;
  width: auto;
  min-width: 0;
}

.floating-win .win-composer .emoji-trigger {
  width: 38px;
  height: 42px;
  border-radius: 50%;
}

.floating-win .win-send-icon {
  display: block;
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-open-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.chat-open-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.review-emoji-textarea-wrap textarea {
  flex: 1;
  min-width: 0;
}

.review-title-emoji-wrap input {
  flex: 1;
  min-width: 0;
}

@media (min-width: 768px) {
  .emoji-control {
    display: block;
  }
}

.floating-win .win-resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 20px;
  height: 20px;
  cursor: nwse-resize;
  z-index: 10;
  background: linear-gradient(135deg, transparent 50%, rgba(0, 0, 0, 0.15) 50%);
  border-radius: 0 0 14px 0;
}

html.mobile-chat-open,
html.mobile-chat-open body {
  overflow: hidden !important;
}

@media (max-width: 767px) {
  #globalChatDock {
    z-index: 3000;
  }

  #globalChatDock,
  #chatDockWindows {
    inset: 0;
  }

  #detachChatBtn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 36px;
    padding: 6px 10px;
    border: 1px solid #b7e4d1 !important;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
  }

  #detachChatBtn .chat-open-icon {
    width: 18px;
    height: 18px;
  }

  #detachChatBtn .chat-open-label {
    display: inline;
  }

  dialog.floating-win {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 0 !important;
    max-width: 100vw !important;
    max-height: 100dvh !important;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    z-index: 3000;
  }

  dialog.floating-win.is-minimized {
    inset: auto 12px calc(12px + env(safe-area-inset-bottom)) !important;
    width: calc(100vw - 24px) !important;
    height: 56px !important;
    min-height: 56px !important;
    max-height: 56px !important;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.22);
  }

  .floating-win .win-header {
    min-height: calc(62px + env(safe-area-inset-top));
    padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
    background: #075e54;
    color: #fff;
    cursor: default;
  }

  .floating-win .win-header-info {
    gap: 3px;
  }

  .floating-win .win-title {
    color: #fff;
    font-size: 15px;
  }

  .floating-win .win-subtitle {
    color: #d1fae5;
    font-size: 12px;
  }

  .floating-win .win-controls {
    gap: 2px;
  }

  .floating-win .win-minimize-btn {
    display: none !important;
  }

  .floating-win .win-btn,
  .floating-win .win-btn:hover {
    color: #fff;
  }

  .floating-win .win-btn:hover {
    background: rgba(255, 255, 255, 0.16);
  }

  .floating-win .win-inner {
    flex-direction: column;
  }

  .floating-win .win-thread-panel {
    width: 100%;
    min-width: 0;
    max-width: none;
    max-height: 27dvh;
    min-height: 100px;
    border-right: 0;
    border-bottom: 1px solid #e9edef;
  }

  .floating-win .win-thread-panel .thread-list-heading {
    padding: 8px 12px;
  }

  .floating-win .win-thread {
    padding: 14px 12px;
    gap: 8px;
    background-color: #efeae2 !important;
  }

  .floating-win .win-thread,
  .floating-win .win-threads {
    overscroll-behavior: contain;
    scrollbar-width: none;
  }

  .floating-win .win-thread::-webkit-scrollbar,
  .floating-win .win-threads::-webkit-scrollbar {
    display: none;
  }

  .floating-win .chat-bubble {
    max-width: 88%;
    padding: 7px 10px;
  }

  .floating-win .win-refresh-status {
    align-items: flex-start;
    padding: 8px 10px;
    font-size: 11px;
  }

  .floating-win .win-composer {
    align-items: center;
    gap: 6px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  }

  .floating-win .win-composer .emoji-textarea-wrap {
    flex: 1 1 0%;
    width: auto;
    min-width: 0;
  }

  .floating-win .win-input {
    flex: 1 1 0%;
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: 9px 12px;
    overflow-y: auto;
    resize: none;
  }

  .floating-win .win-send-btn {
    display: grid;
    flex: 0 0 44px;
    place-items: center;
    width: 44px !important;
    height: 44px;
    min-height: 44px;
    align-self: center;
    padding: 0 !important;
    border-radius: 999px;
    background: #00a884;
  }

  .floating-win .win-send-icon {
    display: block;
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .floating-win .win-send-btn:hover {
    background: #008f72;
  }

  .owner-chat-shell .chat-composer .chat-send-btn {
    width: 44px !important;
    height: 44px;
    min-height: 44px;
    flex: 0 0 44px;
  }

  .floating-win .win-resize-handle {
    display: none;
  }
}

/* ── Map View Modal ── */
.map-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
}

.map-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 0;
}

.map-modal-container {
  position: relative;
  z-index: 1;
  width: 90vw;
  max-width: 1100px;
  height: 85vh;
  max-height: 750px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.map-modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
  flex-shrink: 0;
}

.map-modal-title {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  /*flex: 1;*/
  min-width: 0;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-modal-subtitle {
  font-size: 13px;
  color: #6b7280;
  flex-shrink: 0;
  text-align: right;
  min-width: 0;
  width: auto;
}

.map-modal-refresh {
  background: none;
  border: none;
  font-size: 23px;
  color: #2563eb;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 6px;
  line-height: 1;
  flex-shrink: 0;
}

.map-modal-refresh:hover:not(:disabled) {
  background: #e5e7eb;
  color: #1d4ed8;
}

.map-modal-refresh:disabled {
  cursor: wait;
  opacity: 0.55;
}

.map-modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: #6b7280;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
  flex-shrink: 0;
  margin-left: auto;
}

.map-modal-close:hover {
  background: #e5e7eb;
  color: #111827;
}

.map-container {
  flex: 1;
  min-height: 300px;
  width: 100%;
}

/* Map marker popup styles */
.map-listing-popup {
  min-width: 200px;
  max-width: 280px;
}

.map-listing-popup h3 {
  font-size: 14px;
  margin: 0 0 4px;
  color: #1f2937;
}

.map-listing-popup .popup-rating {
  color: #f59e0b;
  font-size: 13px;
  margin-bottom: 4px;
}

.map-listing-popup .popup-rating .rating-number {
  color: #6b7280;
  font-size: 12px;
  margin-left: 4px;
}

.map-listing-popup .popup-category {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* The glyph in a popup category line. Emoji render as an unreadable blob at
   12px, so it gets its own size. */
.map-listing-popup .popup-category-icon {
  font-size: 14px;
  line-height: 1;
  flex: 0 0 auto;
}

/* A glyph leading the title line, in place of a label: the listing-detail
   popup sits over a page that already names the category, so only the icon is
   shown. Slightly larger so it reads as a lead rather than a bullet. */
.map-listing-popup .popup-category-icon-lead {
  font-size: 16px;
  margin-right: 5px;
  vertical-align: -1px;
}

.map-listing-popup .popup-distance {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 8px;
}

.map-listing-popup .popup-link {
  display: inline-block;
  padding: 4px 12px;
  background: #1a73e8;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}

.map-listing-popup .popup-link:hover {
  background: #1557b0;
}

/* ── Popup action row ──────────────────────────────────────────────
   Icon-led buttons. The word pair ("View Details →" + "Directions") ran to
   roughly 300px inside a 200px popup, forcing the popup wider than a phone.
   The label stays in the DOM and only collapses under 680px, so desktop still
   gets spelled-out actions and a phone gets two square tap targets that cost
   nothing in width. */
.map-listing-popup .popup-actions {
  display: flex;
  /* nowrap, not wrap: with a short listing title the popup content can end up
     narrower than the two buttons side by side, and wrapping then stacked them
     and shrank the whole popup to ~51px. They must stay on one line. */
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  margin-top: 2px;
}

.map-listing-popup .popup-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 11px;
  background: #1a73e8;
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  /* Leaflet does not reset tap behaviour, but without this the row
     text-selects on a tap instead of behaving like a button. */
  -webkit-tap-highlight-color: transparent;
}

.map-listing-popup .popup-action-icon {
  display: block;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.map-listing-popup .popup-action:hover {
  background: #1557b0;
}

/* Green reads as "Google" at a glance, and keeps it distinguishable from the
   blue in-app Details action without relying on the icon alone. */
.map-listing-popup .popup-action-maps {
  background: #0f9d58;
}

.map-listing-popup .popup-action-maps:hover {
  background: #0b7a44;
}

@media (max-width: 680px) {
  .map-listing-popup .popup-actions {
    gap: 8px;
  }

  /* Icon only. These are secondary actions -- the popup already sits on top of
     a map the user can pan and zoom -- so they trade the full 44px tap
     guideline for a row that does not dominate the popup. 36x36 with a 17px
     glyph still reads clearly at 2x and is comfortably above the ~32px floor
     before targets start feeling unreliable. */
  .map-listing-popup .popup-action {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 10px;
  }

  .map-listing-popup .popup-action-icon {
    width: 17px;
    height: 17px;
  }

  .map-listing-popup .popup-action-label {
    display: none;
  }

  /* With the labels gone the 200px floor is just empty space around two small
     squares, so let the popup shrink to its content. */
  .map-listing-popup {
    min-width: 0;
  }
}

/* Map View button */
.map-view-btn {
  background: #10b981;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.map-view-btn:hover {
  background: #059669;
}

/* Category map pin. The emoji is the marker; the ring only groups pins by
   category. A filled disc of the category colour read heavier than the glyph
   inside it, so the fill is a translucent veil that keeps the emoji legible
   over dark tiles while letting the map show through. Ring colour and glyph
   come from the taxonomy (see categoryMapMarkerIcon in static/js/app.js). */
.category-pin {
  background: transparent !important;
  border: none !important;
}
.category-pin-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  /* Thin, not the 3px that turned each pin into a heavy badge. The colour is
     overridden per category by the inline border-color in app.js; this is only
     the fallback for a category with no colour. */
  border: 1.5px solid rgba(17, 24, 39, 0.55);
  /* Near-opaque white rather than the 0.55 veil. The 0.55 let the map show
     through, which looks light but left paler glyphs floating on whatever tile
     happened to sit underneath -- and OSM's own POI markers are drawn on that
     same surface, so a faint pin lost to them. The disc now claims its own
     patch of light, which is what makes any glyph readable on it. */
  background: rgba(255, 255, 255, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  transition: transform 0.15s ease;
}
.category-pin-emoji {
  font-size: 19px;
  line-height: 1;
  user-select: none;
  /* Dark halo, and this is the part that actually fixes visibility.
     Several taxonomy glyphs are drawn in pale ink on a light plate -- 🏥 and
     🍽️ are the clearest cases -- so on a pale disc they are light-on-light and
     effectively invisible. A whiter background makes that worse, not better;
     what a pale glyph needs is an edge. The halo is soft and tight, so it reads
     as definition rather than a second ring, and every glyph gets it, not just
     the pale ones. */
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.38), 0 1px 2px rgba(0, 0, 0, 0.3);
}
.category-pin-icon:hover {
  transform: scale(1.12);
}

/* User location marker on map */
.user-location-marker {
  background: transparent !important;
  border: none !important;
}
.user-location-marker div {
  animation: user-location-pulse 2s ease-in-out infinite;
}
@keyframes user-location-pulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
  50% { box-shadow: 0 2px 16px rgba(26,115,232,0.6); }
}
/* ── Mobile compact layout ─────────────────────────────────────────────── */
@media (max-width: 680px) {
  body { overflow-x: hidden; font-size: 14px; }
  header { min-height: 54px; padding: 7px 10px; gap: 7px; }
  .header-left img { height: 30px !important; width: auto; }
  .header-center { min-width: 0; }
  .header-search-box { min-width: 0; max-width: none; padding: 5px 9px; border-radius: 18px; }
  .header-search-box svg { width: 15px; height: 15px; margin-right: 5px; }
  .header-search-box input { min-width: 0; font-size: 12px; }
  .search-category-trigger { max-width: 100px; gap: 3px; padding-left: 2px; font-size: 11px; }
  .search-category-trigger svg { width: 13px; height: 13px; margin: 0; }
  .search-category-label { max-width: 62px; }
  .search-category-popup:not([hidden]) {
    position: fixed;
    right: auto;
    left: 10px;
    width: min(320px, calc(100vw - 20px));
  }
  .btn-google { padding: 7px 9px; gap: 4px; border-radius: 7px; font-size: 12px; }
  .btn-google svg { width: 16px; height: 16px; }
  .banner { padding: 7px 8px; font-size: 12px; line-height: 1.25; }
  .listing-page { width: 100%; max-width: 100%; overflow: hidden; padding: 8px 0 24px; }
  .listing-page .page-top,
  .my-listings-page .page-top,
  .add-business-page .page-top { margin: 0 12px 8px; gap: 6px; }
  .my-listings-page .page-top,
  .add-business-page .page-top {
    flex-direction: row;
    flex-wrap: nowrap;
  }
  .section-label { padding: 8px 12px 4px; font-size: 11px; letter-spacing: .6px; }
  .page-top .actions-row { display: none; }
  .my-listings-page .page-top .actions-row,
  .add-business-page .page-top .actions-row { display: flex; }
  .search-section { width: 100%; max-width: 100%; box-sizing: border-box; padding: 4px 0 8px; }
  .search-row { width: 100%; max-width: 100%; margin: 0; padding: 0 12px; gap: 8px; }
  .search-controls { width: 100%; gap: 7px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .search-controls::-webkit-scrollbar, .tab-bar::-webkit-scrollbar, .tab-list::-webkit-scrollbar { display: none; }
  .dropdown-trigger-btn, .nearby-menu-btn, .map-view-btn { min-height: 36px; padding: 7px 9px; font-size: 12px; border-radius: 9px; }
  .nearby-control { flex: 0 0 auto; gap: 5px; }
  .nearby-radio { font-size: 12px; gap: 5px; }
  .listings { grid-template-columns: 1fr; gap: 9px; padding: 0 10px 24px; }
  .card { border-radius: 10px; box-shadow: 0 1px 3px rgba(15,23,42,.08); }
  .card-accent { height: 3px; }
  .card-body { padding: 8px 9px 0; }
  .card-badge { margin: 1px 0 6px; padding: 3px 8px; font-size: 10px; }
  .card h3 { padding-left: 0; margin-bottom: 4px; font-size: 16px; line-height: 1.25; }
  .card p, .card-description { padding: 0; margin-bottom: 6px; min-height: 0; font-size: 13px; line-height: 1.4; }
  .card-footer { padding: 7px 9px; gap: 6px; }
  .location { min-width: 0; font-size: 12px; }
  .location span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .card-rating { right: 9px; gap: 4px; min-width: 0; padding: 3px 0; font-size: 11px; }
  .rating-stars span { font-size: 11px; }
  .listing-grid { display: flex; flex-direction: column; gap: 0; margin-bottom: 8px; }
  .listing-card, .listing-side-card { padding: 10px 12px; }
  .listing-card-header { gap: 8px; margin-bottom: 10px; }
  .listing-header-main { gap: 9px; }
  .listing-header-info { min-width: 0; gap: 2px; }
  .listing-header-info .page-title { font-size: 22px; line-height: 1.15; }
  .listing-header-info .listing-owner-row { margin-top: 2px; }
  .listing-rating-row { padding-top: 7px; gap: 5px; }
  #listingActions { gap: 5px !important; }
  #listingActions .icon-btn { width: 36px; height: 36px; }
  .listing-images { display: flex; overflow-x: auto; gap: 7px; margin: 0 -12px 12px; padding: 0 12px 2px; scrollbar-width: none; }
  .listing-images::-webkit-scrollbar { display: none; }
  .listing-images img { flex: 0 0 72vw; max-width: 300px; aspect-ratio: 16 / 9; border-radius: 10px; }
  .listing-description h2, .listing-side-card h2 { font-size: 17px; margin-bottom: 7px; }
  .listing-description div, .listing-description p { font-size: 14px; line-height: 1.55; }
  .listing-dates { margin-top: 10px; padding-top: 8px; gap: 8px 14px; }
  .contact-list { gap: 7px; }
  .contact-item { gap: 10px; padding: 8px 9px; border-radius: 10px; }
  .contact-icon-wrapper { width: 34px; height: 34px; border-radius: 9px; }
  .contact-label { font-size: 9px; }
  .contact-value-container { font-size: 13px; }
  .listing-social-tabs { margin-top: 8px; padding: 10px 12px; border-radius: 0; }
  .tab-bar { gap: 8px; margin-bottom: 10px; overflow-x: auto; scrollbar-width: none; }
  .tab-list { min-width: max-content; gap: 15px; overflow-x: auto; scrollbar-width: none; }
  .tab-btn { padding: 8px 2px; font-size: 14px; white-space: nowrap; }
  .tab-refresh-btn { flex: 0 0 32px; }
  .reviews-heading { gap: 8px; margin-bottom: 10px; }
  .review-summary-row { position: relative; gap: 5px; }
  .review-distribution-control { position: static; }
  .rating-distribution-popup {
    top: calc(100% + 6px);
    left: 0;
    margin-left: 0;
  }
  .rating-distribution-card {
    width: min(280px, calc(100vw - 32px));
    min-width: 0;
    max-width: calc(100vw - 32px);
  }
  .summary-avg-rating { font-size: 19px; }
  .review-controls, .review-sort { width: auto; gap: 6px; }
  .review-sort select { min-width: 112px; padding: 7px 5px; font-size: 12px; }
  .review-add-btn { width: 32px; height: 32px; }
  .review-list { gap: 0; }
  .review-card { padding: 10px 0; }
  .review-card p { margin-bottom: 8px; font-size: 14px; line-height: 1.5; }
  .review-title { font-size: 14px; }
  .review-date { font-size: 10px; }
  .review-reaction-btn { padding: 4px 8px; font-size: 12px; }
  .scroll-area { max-height: none; overflow: visible; }
  .page-card, .auth-container { margin: 0 10px 18px; padding: 14px 12px 20px; border-radius: 12px; }
  .field { margin-bottom: 11px; }
  .field label { margin-bottom: 4px; font-size: 11px; }
  .field input, .field textarea, .field select { padding: 9px 10px; font-size: 14px; border-radius: 7px; }
  .grid-2, .grid-3 { gap: 0; margin-bottom: 0; }
  .rich-editor-toolbar { gap: 0; padding: 5px; overflow: hidden; }
  .rich-editor-toolbar button { width: 22px; height: 28px; }
  .rich-editor-toolbar button svg { width: 15px; height: 15px; }
  .rich-editor-toolbar select { width: 72px; max-width: 72px; height: 28px; padding: 0 2px; font-size: 10px; }
  .rich-editor-toolbar select.rte-size-select { width: 42px; max-width: 42px; }
  .rich-editor-toolbar input[type="color"] { width: 20px; height: 28px; padding: 1px; }
  .rich-editor-toolbar .rte-color-tool { width: 22px; }
  .toolbar-sep { display: none; }
  .rte-popover { left: 4px; gap: 8px; padding: 10px; }
  .rte-emoji-popover { width: min(320px, 100%); }
  .rte-emoji-grid { max-height: min(250px, 45vh); }
  .rich-editor { min-height: 130px; }
  footer { padding: 14px 10px; font-size: 11px; line-height: 1.5; }
  .footer-container { gap: 7px; }
  .footer-links { gap: 5px; margin-bottom: 0; }
  .footer-link { font-size: 11px; }
  .footer-info { font-size: 10px; }
}
/* ── Compact card thumbnail (hidden on desktop, shown on mobile) ────────── */
.card-thumb {
  display: none;
}

/* ════════════════════════════════════════════════════════════════════════ *
 *  UNIFIED MOBILE LAYOUT  (supersedes the older 400/480/580/680 blocks)     *
 *  One card per line, compact spacing, near-identical styling from the       *
 *  smallest phone up to 680px tablets.                                        *
 * ════════════════════════════════════════════════════════════════════════ */
@media (max-width: 680px) {

  /* ---- Reset vertical rhythm: tighter, no wasted space ---- */
  body { font-size: 14px; line-height: 1.4; }
  .listing-page { padding: 0; }
  .listing-page { overflow: visible; }
  .page-top { margin: 0 0 4px !important; padding: 6px 10px 0; gap: 4px; }

  /* ---- Section label: one small line ---- */
  .section-label {
    padding: 2px 0 0 !important;
    font-size: 11px;
    letter-spacing: .5px;
    gap: 6px;
  }
  .follow-update-badge { font-size: 10px; }

  /* ---- Filter / search row: single compact strip ---- */
  .search-section { padding: 2px 0 4px; }
  .search-row { padding: 0 10px; gap: 6px; }
  .search-controls {
    gap: 6px;
    overflow: visible;
  }
  .dropdown-trigger-btn, .nearby-menu-btn, .map-view-btn {
    min-height: 32px; padding: 5px 8px; font-size: 11.5px; border-radius: 8px;
  }
  .nearby-radio { font-size: 11.5px; }

  /* ============================================================
   *  HOME / DASHBOARD CARDS — one per line, compact horizontal
   *  thumb(left) + tag/title/rating/location(right), no description
   * ============================================================ */
  .listings { grid-template-columns: 1fr; gap: 8px; padding: 4px 10px 24px; }

  .card {
    flex-direction: row;
    align-items: stretch;
    min-height: 84px;
    border-radius: 12px;
    border: 1px solid #ececec;
  }
  .card-accent { flex: 0 0 4px; height: auto; }

  .card-thumb {
    display: flex;
    flex: 0 0 78px;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: #fff;
    position: relative;
    overflow: hidden;
  }
  .card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  .card-thumb::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.12);
    border-radius: 0 0 0 0;
    pointer-events: none;
  }

  .card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 8px 10px 6px;
    position: relative;
  }
  .card-badge {
    margin: 0 0 4px;
    padding: 2px 7px;
    font-size: 9px;
    letter-spacing: .3px;
  }
  /* The category icon used to be hidden here to save width. It is back: the
     icon is what makes the badge readable at 9px, where "HOUSE & PROPERTY"
     alone is an indistinct grey smear. The badge is inline-flex with a 5px
     gap and the tile has room. */
  .card-badge .cat-icon {
    font-size: 11px;
    line-height: 1;
  }
  .card h3 {
    font-size: 15px;
    line-height: 1.3;
    margin-bottom: 2px;
    padding-left: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .card-description { display: none; }

  .card-rating {
    position: static;
    margin-top: 3px;
    min-width: 0;
    padding: 0;
    box-shadow: none;
    background: transparent;
    border: 0;
  }
  .card-rating .rating-stars span { font-size: 11px; }
  .card-rating .rating-value { font-size: 10.5px; color: #555; }

  .card-footer {
    border: 0;
    margin-top: auto;
    padding: 4px 0 0;
  }
  .location { font-size: 11.5px; }

  .load-more-btn { margin-top: 14px; }

  /* ============================================================
   *  LISTING DETAILS — compact header + icon-only contact
   * ============================================================ */
  .listing-page .page-top:has(#backNavBtn) { justify-content: flex-start; }
  .listing-page .page-top:has(#backNavBtn) .section-label { display: none; }
  /* Keep the back button visible even though the older 680 block hides
     .page-top .actions-row on small screens. */
  .listing-page .page-top:has(#backNavBtn) .actions-row { display: flex; }
  .help-page .page-top:has(.page-back-btn),
  .admin-page .page-top:has(.page-back-btn),
  .edit-profile-page .page-top:has(.page-back-btn) {
    flex-direction: row;
    align-items: center;
  }
  .help-page .page-top .page-back-actions,
  .admin-page .page-top .page-back-actions,
  .edit-profile-page .page-top .page-back-actions {
    display: flex;
    flex: 0 0 auto;
  }
  .page-back-btn {
    font-size: 30px;
    width: 34px;
    height: 34px;
    font-weight: 700;
    color: #1a73e8;
  }

  /* Back nav: a circular chip made the lone chevron look like a floating
     bubble on a row that holds nothing else. Plain glyph, and the row above it
     tightened so the header starts sooner. */
  .listing-page .page-top:has(#backNavBtn) { margin-bottom: 0; padding: 2px 10px 0; }
  .listing-page .page-top:has(#backNavBtn) .page-back-btn {
    background: none;
    border: none;
    box-shadow: none;
    text-decoration: none;
  }

  .listing-card, .listing-side-card { padding: 10px; }
  .listing-card-header { gap: 5px; margin-bottom: 6px; }
  .listing-header-main { align-items: center; gap: 8px; }
  .listing-logo {
    width: 48px;
    height: 48px;
    font-size: 22px;
    border-radius: 12px;
    flex-shrink: 0;
  }
  .listing-header-info .page-title { font-size: 18px; line-height: 1.2; }
  .listing-rating-row { padding-top: 3px; gap: 4px; }
  #listingActions { gap: 4px !important; }
  #listingActions .icon-btn,
  #listingActions .icon-btn-sm { width: 32px; height: 32px; padding: 0; font-size: 14px; }
  .listing-rating-large { font-size: 16px; }
  .listing-rating-large .rating-stars span { font-size: 12px; }

  /* Contact on mobile: one row of action tiles, icon over label, matching the
     pattern consumers already know from local-search apps. Two deliberate
     differences from the previous version:
       - The LABEL is always shown. The old 68px tile layout hid it, so a
         listing whose phone and WhatsApp numbers matched rendered as two
         identical unlabelled numbers with nothing to tell them apart.
       - The VALUE is hidden. With the label visible ("Phone", "WhatsApp") the
         raw number is redundant here and would not fit five across; it is
         still one tap away via tel:/wa.me, and stays visible on desktop. */
  .contact-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 4px;
  }
  .contact-item {
    /* Share the row evenly, but cap the width so a listing with only one or two
       contact types does not stretch a single tile across the full width.
       Five tiles still fit (5 x ~70px) and read as one row. */
    flex: 1 1 0;
    min-width: 0;
    max-width: 120px;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    gap: 5px;
    padding: 0 2px;
    border: none;
    background: none;
    border-radius: 0;
    min-height: 0;
  }
  /* No grey card chrome: the coloured icon already carries the affordance,
     and a box around each one made the row look like a stack of inputs. */
  .contact-icon-wrapper {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    flex-shrink: 0;
  }
  .contact-icon-wrapper svg { width: 20px; height: 20px; }
  .contact-label { display: none; }
  .contact-label-sm {
    display: block;
    font-size: 10px;
    font-weight: 600;
    color: #475569;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .contact-info { width: 100%; min-width: 0; }
  .contact-value-container { display: none; }

  /* Phone and WhatsApp are the two tiles people actually read, so on mobile
     they show the number itself instead of a word. A label here told you
     nothing the coloured icon had not already said, while the number is the
     one value worth having on screen before you tap through to a dialer.

     Those two get a wider share of the row than the icon-only social tiles:
     a 12-digit WhatsApp number needs ~66px at 11px, which an even five-way
     split of a 375px screen (~66px, before gutters) cannot guarantee. Weight
     1.6 vs 1 buys the headroom while "Website"/"Facebook"/"LinkedIn" stay
     comfortably inside their share at 10px. */
  .contact-item#contactPhone,
  .contact-item#contactWhatsapp {
    flex: 1.6 1 0;
    max-width: 132px;
  }
  .contact-item#contactPhone .contact-label-sm,
  .contact-item#contactWhatsapp .contact-label-sm { display: none; }
  .contact-item#contactPhone .contact-value-container,
  .contact-item#contactWhatsapp .contact-value-container {
    display: block;
    width: 100%;
    font-size: 11px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.25;
    letter-spacing: -0.01em;
    /* Never clip a number. Wrapping beats an ellipsis that hides the last
       digit, and fitContactNumbers() shrinks the font first anyway. */
    word-break: break-word;
    white-space: nowrap;
    overflow: hidden;
  }
  .contact-item#contactPhone .contact-value-container a,
  .contact-item#contactWhatsapp .contact-value-container a {
    display: block;
    padding: 2px 0;
  }

  /* Address is not an action tile -- it is the one piece of contact detail
     worth reading. It gets its own full-width block with a hairline border so
     it is visually distinct from the tiles above it. */
  .contact-item#contactAddress {
    flex: 1 0 100%;
    max-width: none;
    flex-direction: row;
    justify-content: flex-start;
    align-items: flex-start;
    text-align: left;
    gap: 9px;
    margin-top: 10px;
    padding: 10px 11px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
  }
  .contact-item#contactAddress .contact-icon-wrapper {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    margin-top: 1px;
  }
  .contact-item#contactAddress .contact-icon-wrapper svg { width: 17px; height: 17px; }
  .contact-item#contactAddress .contact-label { display: block; }
  .contact-item#contactAddress .contact-label-sm { display: none; }
  .contact-item#contactAddress .contact-info { width: auto; flex: 1; }
  .contact-item#contactAddress .contact-value-container {
    display: block;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
    word-break: break-word;
  }

  /* Map button: icon-only + first in the filter strip */
  .map-view-btn { padding: 0; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; }
  .map-view-label { display: none; }

  /* Listing details header: logo (left) + title (centered) on one line,
     then actions (left) + rating (right) on a second full-width line.
     !important beats the base rules (min-width:240px, flex-direction:column,
     margin-left:auto) and any earlier 580/680 blocks. */
  .listing-header-main {
    flex-direction: row !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }
  .listing-header-info {
    flex: 1 1 0% !important;
    min-width: 0 !important;
    text-align: left;
  }
  .listing-header-info .page-title { font-size: 17px; line-height: 1.25; }
  .listing-owner-row {
    justify-content: flex-start;
    text-align: left;
  }
  .listing-rating-row {
    flex: 0 0 100% !important;
    width: 100% !important;
    flex-direction: row !important;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-left: 0;
    padding-top: 6px;
  }
  #listingActions { flex-wrap: nowrap; }
  .listing-rating-large { margin-left: auto !important; white-space: nowrap; }

  /* ---- Reviews / tabs compact ---- */
  .listing-side-card h2, .listing-description h2 { font-size: 15px; }
  .tab-btn { font-size: 13px; padding: 7px 2px; }
  .page-card, .auth-container { margin: 0 8px 14px; padding: 12px 10px 16px; border-radius: 12px; }
}

.blocked-account-overlay {
  position: fixed;
  inset: 0;
  z-index: 15000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(12, 24, 40, .72);
}

.blocked-account-dialog {
  width: min(100%, 480px);
  padding: 30px;
  border: 1px solid #f0c7c4;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .3);
  color: #263445;
  text-align: center;
}

.blocked-account-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  place-items: center;
  border-radius: 50%;
  background: #fff0ee;
  color: #b8322b;
  font-size: 28px;
  font-weight: 800;
}

.blocked-account-dialog h2 {
  margin-bottom: 12px;
  color: #9f2924;
  font-size: 22px;
}

.blocked-account-dialog p {
  color: #49566a;
  font-size: 14px;
  line-height: 1.65;
}

.blocked-account-dialog a {
  color: #1a73e8;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.blocked-account-close {
  min-width: 110px;
  min-height: 42px;
  margin-top: 22px;
  padding: 8px 18px;
  border: 0;
  border-radius: 8px;
  background: #a92f29;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.blocked-account-close:hover {
  background: #87231f;
}

@media (max-width: 480px) {
  .blocked-account-dialog {
    padding: 24px 20px;
  }

  .blocked-account-dialog h2 {
    font-size: 19px;
  }
}
