/* ============================================
   Community - Base & Reset
   ============================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

/* Primary teal CTAs — same as groups list .group-view-btn / .group-join-btn */
:root {
  --btn-teal-bg: linear-gradient(165deg, rgba(0, 168, 168, 0.55), rgba(0, 120, 120, 0.88));
  --btn-teal-border: rgba(127, 212, 212, 0.5);
  --btn-teal-border-hover: rgba(127, 212, 212, 0.65);
  --btn-teal-shadow: 0 3px 12px rgba(0, 90, 90, 0.25);
}

body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  color: #1a1a1a;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #1a1a1a;
  position: relative;
}

/* Background on a fixed viewport-sized layer to avoid iOS Safari stretch (background-attachment: fixed is buggy there) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--community-bg-image, url('images/community_backgrounds/penderharbour.jpg')) center / cover no-repeat;
  pointer-events: none;
}

.hero-overlay {
  display: block;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  padding: 1.5rem 2.5rem;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

/* Hero overlay with title + controls (events, businesses, groups, marketplace) */
.hero-overlay.hero-overlay-events,
.hero-overlay.hero-overlay-businesses,
.hero-overlay.hero-overlay-groups,
.hero-overlay.hero-overlay-marketplace,
.hero-overlay.hero-overlay-notifications,
.hero-overlay.hero-overlay-messages2 {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hero-overlay.hero-overlay-events .events-heading-row,
.hero-overlay.hero-overlay-businesses .businesses-heading-row,
.hero-overlay.hero-overlay-groups .groups-heading-row,
.hero-overlay.hero-overlay-marketplace .marketplace-heading-row,
.hero-overlay.hero-overlay-notifications .notifications-heading-row,
.hero-overlay.hero-overlay-messages2 .messages2-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  width: 100%;
}

.hero-overlay.hero-overlay-events .events-heading-row h1,
.hero-overlay.hero-overlay-businesses .businesses-heading-row h1,
.hero-overlay.hero-overlay-groups .groups-heading-row h1,
.hero-overlay.hero-overlay-marketplace .marketplace-heading-row h1,
.hero-overlay.hero-overlay-notifications .notifications-heading-row h1,
.hero-overlay.hero-overlay-messages2 .messages2-heading-row h1 {
  margin: 0;
  text-align: left;
}

.hero-overlay.hero-overlay-events .events-hero-controls,
.hero-overlay.hero-overlay-businesses .businesses-hero-controls,
.hero-overlay.hero-overlay-groups .groups-hero-controls,
.hero-overlay.hero-overlay-marketplace .marketplace-controls-row,
.hero-overlay.hero-overlay-notifications .notifications-hero-controls {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 1.5rem;
  flex-wrap: wrap;
  text-align: left;
}

.hero-overlay h1 {
  color: #fff;
  margin: 0 0 0.5rem;
}

.hero-overlay h1:last-child {
  margin-bottom: 0;
}

.hero-overlay .lead {
  color: rgba(255, 255, 255, 0.95);
  margin: 0;
}

.hero-choose-community-msg {
  color: rgba(255, 255, 255);
  font-size: 1.1rem;
}

/* Dark hero search: stop Chrome/Safari autofill from forcing a white/yellow background */
.hero-overlay .hero-search-input:-webkit-autofill,
.hero-overlay .hero-search-input:-webkit-autofill:hover,
.hero-overlay .hero-search-input:-webkit-autofill:active {
  -webkit-text-fill-color: #f1f5f9;
  caret-color: #f1f5f9;
  -webkit-box-shadow: 0 0 0 1000px rgba(8, 12, 20, 0.92) inset;
  box-shadow: 0 0 0 1000px rgba(8, 12, 20, 0.92) inset;
  transition: background-color 9999s ease-out 0s;
}

.hero-overlay .hero-search-input:-webkit-autofill:focus {
  -webkit-box-shadow:
    0 0 0 1000px rgba(8, 12, 20, 0.92) inset,
    0 0 0 3px rgba(0, 148, 148, 0.25);
  box-shadow:
    0 0 0 1000px rgba(8, 12, 20, 0.92) inset,
    0 0 0 3px rgba(0, 148, 148, 0.25);
}

body.page-marketplace .hero-overlay,
body.page-events .hero-overlay,
body.page-businesses .hero-overlay,
body.page-group .hero-overlay,
body.page-notifications .hero-overlay,
body.page-messages2 .hero-overlay {
  text-align: left;
}

body.page-group .hero-overlay .lead {
  max-width: none;
  width: 100%;
}

body.page-login .hero-overlay {
  width: 100%;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  background: rgba(0, 0, 0, 0.9);
}

.hero-signup-cta {
  text-align: center;
}

.hero-cta-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  align-items: center;
}

.hero-signup-text {
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.1rem;
  line-height: 1.5;
  margin: 0 0 1rem;
  max-width: 32ch;
  margin-left: auto;
  margin-right: auto;
}

.hero-signup-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.65rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  background: var(--btn-teal-bg);
  color: #fff !important;
  border: 1px solid var(--btn-teal-border);
  border-radius: 8px;
  text-decoration: none;
  transition: filter 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  box-shadow: var(--btn-teal-shadow);
}

.hero-signup-btn:hover {
  filter: brightness(1.08);
  border-color: var(--btn-teal-border-hover);
  transform: translateY(-1px);
  background: var(--btn-teal-bg);
}

.hero-login-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.65rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  background: transparent;
  color: #fff !important;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}

.hero-login-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #fff;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

/* Site-wide single <select>: custom chevron + right padding. Use background-color (not background:) on selects so this background-image isn’t wiped. */
select:not([multiple]) {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23bbbbbb' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  background-size: 1rem 1rem;
  padding-inline-end: max(2.25rem, 2em);
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

/* ============================================
   Layout
   ============================================ */
.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.main-content {
  flex: 1;
}

/* ============================================
   Header (Dark mode)
   ============================================ */
.site-header {
  background: #1a1a1a;
  border-bottom: 1px solid #333;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.header-top-row {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.header-user-actions {
  display: none;
  align-items: center;
  gap: 0;
}
.nav-icons-group {
  display: inline-flex;
  align-items: center;
  align-self: center;
  margin-left: 0.25rem;
}
.nav-icons-group .nav-messages {
  margin-left: 0.25rem;
}

.logo {
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  color: #fff;
}

.logo-top {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.85);
}

.logo-bottom {
  font-size: 1.35rem;
  color: #fff;
}

.nav-home-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
  color: #fff;
  flex-shrink: 0;
  margin-right: 0.5rem;
  transition: opacity 0.2s;
}

.nav-home-icon:hover {
  opacity: 0.9;
}

.nav-home-icon svg {
  display: block;
  width: 22px;
  height: 22px;
}

/* Community switcher dropdown */
.logo-community-wrap {
  position: relative;
}

.logo-community-wrap .logo {
  display: inline-flex;
  flex-direction: column;
  cursor: pointer;
  padding-right: 1.5rem;
}

.logo-chevron {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.5rem;
  color: rgba(255, 255, 255, 0.6);
  transition: transform 0.2s;
}

.logo-community-wrap.community-dropdown-open .logo-chevron {
  transform: translateY(-50%) rotate(180deg);
}

.community-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.25rem;
  min-width: 220px;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  padding: 0.5rem 0;
  z-index: 200;
}

.community-dropdown.open {
  display: block;
}

.community-dropdown-error {
  margin: 0;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  color: #fca5a5;
  line-height: 1.35;
}

.community-option {
  display: block;
  width: 100%;
  padding: 0.6rem 1rem;
  text-align: left;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: #e0e0e0;
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}

.community-option:hover {
  background: #333;
}

.community-region-group {
  padding: 0;
}

.community-region-group:not(:first-child) {
  border-top: 1px solid #444;
  margin-top: 0.25rem;
  padding-top: 0.25rem;
}

.community-region-header {
  padding: 0.4rem 1rem 0.2rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
}

.main-nav {
  display: flex;
  align-items: center;
}

.main-nav ul {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.main-nav a {
  display: inline-flex;
  align-items: center;
  font-weight: 500;
  line-height: 1;
  color: rgba(255, 255, 255, 0.85);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: color 0.2s, background-color 0.2s;
}

.main-nav a:hover,
.main-nav a.active {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.12);
}

.main-nav a.login-btn:hover {
  filter: brightness(1.08);
  border-color: var(--btn-teal-border-hover);
  background: var(--btn-teal-bg);
  color: #fff !important;
}

.login-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  font-weight: 600;
  font-size: 0.95rem;
  background: var(--btn-teal-bg);
  color: #fff !important;
  border: 1px solid var(--btn-teal-border);
  border-radius: 8px;
  text-decoration: none;
  transition: filter 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  box-shadow: var(--btn-teal-shadow);
}

.login-btn:hover {
  filter: brightness(1.08);
  border-color: var(--btn-teal-border-hover);
  transform: translateY(-1px);
  background: var(--btn-teal-bg);
  color: #fff !important;
}

.auth-user {
  color: rgba(255, 255, 255, 0.85);
  margin-right: 0.5rem;
}

.avatar-dropdown-wrap {
  position: relative;
  display: inline-flex;
}

.nav-avatar,
.avatar-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-right: 0.5rem;
  border-radius: 50%;
  background: #00aaaa;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.avatar-trigger:hover {
  background: #00bbbb;
}
.avatar-trigger[style*="--avatar-bg"]:hover {
  background: var(--avatar-bg);
  filter: brightness(0.9);
}

.nav-avatar:hover {
  background: #00bbbb;
}
.nav-avatar[style*="--avatar-bg"]:hover {
  background: var(--avatar-bg);
  filter: brightness(0.9);
}

.avatar-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.35rem;
  min-width: 160px;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  padding: 0.35rem 0;
  z-index: 200;
}

.avatar-dropdown.open {
  display: block;
}

.avatar-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 1rem;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 500;
  color: #e0e0e0;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: background 0.15s;
}

.avatar-dropdown-item .avatar-dropdown-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.avatar-dropdown-item .avatar-dropdown-icon svg {
  width: 18px;
  height: 18px;
}

.avatar-dropdown-item:hover {
  background: #333;
}

/* Stacked header + avatar menu: long labels (e.g. My Businesses) stay on one line */
@media (max-width: 1023px) {
  .avatar-dropdown {
    min-width: 170px;
    max-width: calc(100vw - 1rem);
    box-sizing: border-box;
  }
}

.header-user-actions .avatar-dropdown-wrap {
  margin-right: 0;
  display: inline-flex;
  align-items: center;
}

.header-user-actions .avatar-trigger {
  margin-right: 0;
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
  position: relative;
  flex-shrink: 0;
}
.nav-icon .icon-bell {
  display: block;
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  flex-shrink: 0;
}

/* Ensure notification icon is visible in dark header (mobile + desktop) */
.site-header .nav-icon,
.site-header .nav-icon.nav-notifications,
.site-header .nav-icon.nav-messages {
  color: rgba(255, 255, 255, 0.9);
}
.site-header .nav-icon .icon-message {
  display: block;
  width: 22px;
  height: 22px;
}

/* Desktop header: align messages/notifications icons with avatar (same row height and vertical center) */
/* When icons are in .header-user-actions (mobile / narrow) */
.site-header .header-user-actions .nav-icons-group {
  display: inline-flex;
  align-items: center;
  align-self: stretch;
  min-height: 36px;
}
.site-header .header-user-actions .nav-icons-group .nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  box-sizing: border-box;
  padding-top: 0;
  padding-bottom: 0;
}

/* When icons are in .main-nav #auth-nav-item (desktop): centered with nav links and avatar */
.site-header .main-nav .nav-icons-group {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
}
.site-header .main-nav .nav-icons-group .nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  box-sizing: border-box;
  padding-top: 0;
  padding-bottom: 0;
}

/* Remove dashed default focus outline on mobile tap; keep visible focus for keyboard */
.site-header .nav-icon:focus {
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.site-header .nav-icon:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 2px;
}

.notif-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1;
  background: #dc2626;
  color: #fff;
  border-radius: 50%;
  border: 2px solid #1a1a1a;
}

/* ============================================
   Hero
   ============================================ */
.hero {
  padding: 2rem 0 1rem;
  text-align: center;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}

.lead {
  font-size: 1.125rem;
  color: #555;
  max-width: 36ch;
}

/* ============================================
   Content
   ============================================ */
.content-section {
  padding: 0 0 2rem;
  color: #dddddd;
}

.content-section h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  margin-top: 1.5rem;
  color: #ffffff;
}

.content-section h2:first-child {
  margin-top: 0;
}

.content-section p {
  color: #dddddd;
  margin-bottom: 1rem;
}

/* Override for card descriptions on dark backgrounds */
.content-section .event-card p,
.content-section .business-card p {
  color: #dddddd;
}

/* ============================================
   Home Below Hero (Weather + Featured)
   ============================================ */
.home-below-hero {
  padding: 0 0 3rem;
  overflow-x: hidden;
  max-width: 100%;
}

/* Same max-width as hero (.container = 1140px) — do not override with max-width:100% or the home column goes edge-to-edge on wide screens */
.home-below-hero-inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.home-below-hero .container {
  min-width: 0;
  box-sizing: border-box;
}

/*
 * Home layout:
 * - Desktop: flex row — sidebar and main are independent columns. Sidebar height (expand/collapse weather, outages, etc.)
 *   must NOT change main column layout (grid row coupling caused Local News to jump when the side panel grew).
 * - Mobile: Events → Weather → Local News → Featured (grid + display:contents).
 *
 * MAINTAINER NOTE — do not regress: Never use CSS Grid for desktop home with a sidebar that spans rows beside
 * “Events” + “Local News” in the same grid. Row heights stay coupled; growing the side panel shifts Local News.
 * Use flex (row, align-items: flex-start) so left and right columns size independently.
 * If DOM keeps main before sidebar (focus order), set .home-sidebar { order: 1 } and .home-main-column { order: 2 }
 * so the side panel stays on the left.
 */
.home-main-column {
  min-width: 0;
}

.home-sidebar {
  min-width: 0;
}

/* Desktop: two flex columns — no shared grid rows */
@media (min-width: 641px) {
  .home-below-hero-inner {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 1rem;
  }

  /* DOM order is main → sidebar (better focus order); flex order keeps the narrow panel on the left */
  .home-sidebar {
    order: 1;
    flex: 0 0 auto;
    width: min(17.5rem, 100%);
    max-width: 17.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-self: flex-start;
    min-width: 0;
  }

  .home-main-column {
    order: 2;
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .home-below-hero-inner .home-happening-today-section {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  .home-below-hero-inner .local-news-section {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  .home-below-hero-inner .weather-widget-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .home-below-hero-inner .home-featured-business-section {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  .home-below-hero-inner .weather-widget-wrap .power-outage-card,
  .home-below-hero-inner .weather-widget-wrap .power-outage-title,
  .home-below-hero-inner .weather-widget-wrap .power-outage-description {
    word-break: break-word;
    overflow-wrap: anywhere;
  }
}

/* Home: override global .featured-section (min-width + flex:1) so grid/column layout doesn’t overflow or stretch sections */
.home-below-hero-inner .featured-section,
.home-below-hero-inner .home-featured-business-section {
  min-width: 0;
  flex: 0 0 auto;
}

/* Featured Business in the narrow left column: shrink/wrap so it matches the outages/weather width */
@media (min-width: 641px) {
  .home-below-hero-inner .home-featured-business-section {
    padding: 1.1rem 0.85rem 1.35rem;
  }

  .home-below-hero-inner .home-featured-business-section .featured-business-body {
    padding: 0.75rem 0.65rem 0.9rem;
  }

  .home-below-hero-inner .home-featured-business-section .featured-business-image {
    justify-content: center;
    width: 100%;
  }

  .home-below-hero-inner .home-featured-business-section .featured-business-image img {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 2 / 1;
    object-fit: cover;
  }

  .home-below-hero-inner .home-featured-business-section .featured-content .featured-business-name,
  .home-below-hero-inner .home-featured-business-section .featured-content .featured-business-desc,
  .home-below-hero-inner .home-featured-business-section .featured-content .featured-business-meta {
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .home-below-hero-inner .home-featured-business-section .featured-content .featured-business-link {
    display: inline-block;
    max-width: 100%;
    text-align: center;
    box-sizing: border-box;
    word-break: break-word;
  }
}

.home-happening-empty {
  margin: 0;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.75);
}

.home-happening-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.home-happening-section-title {
  margin-bottom: 0 !important;
  flex: 1 1 auto;
  min-width: 0;
}

.home-happening-view-all-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: var(--btn-teal-bg);
  border: 1px solid var(--btn-teal-border);
  border-radius: 8px;
  text-decoration: none;
  transition: filter 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  box-shadow: var(--btn-teal-shadow);
  white-space: nowrap;
}

.home-happening-view-all-btn:hover {
  filter: brightness(1.08);
  border-color: var(--btn-teal-border-hover);
  transform: translateY(-1px);
  background: var(--btn-teal-bg);
  color: #fff;
}

/* Home: Events Today — compact cards; optional “More events” expand */
.home-today-events-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.home-today-events-wrap.hidden {
  display: none !important;
}

.home-today-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Desktop home: two event cards per row (Events Today) */
@media (min-width: 641px) {
  .home-today-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 0.75rem;
  }
}

.home-today-list.hidden {
  display: none !important;
}

.home-today-list--extra[hidden],
.home-today-list--extra.hidden {
  display: none !important;
}

.home-today-card {
  background: rgba(30, 30, 30, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 0.85rem 1rem 0.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.home-today-card-title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.home-today-card-meta {
  margin: 0;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.4;
}

.home-today-card-desc {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.4;
  word-break: break-word;
}

.home-today-card-where {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.35;
}

.home-today-card-where-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 100%;
  color: #93c5fd;
  text-decoration: none;
}

.home-today-card-where-link:hover {
  text-decoration: underline;
}

.home-today-card-map-icon {
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.95);
}

.home-today-card-where-text {
  min-width: 0;
  word-break: break-word;
}

.home-today-card-footer {
  margin-top: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.home-today-card-event-page-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 100%;
  font-size: 0.9rem;
  font-weight: 500;
  color: #93c5fd;
  text-decoration: none;
}

.home-today-card-event-page-link:hover {
  text-decoration: underline;
  color: #bfdbfe;
}

.home-today-card-web-icon {
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.95);
}

.home-today-card-event-page-text {
  min-width: 0;
  word-break: break-word;
}

.weather-widget-wrap {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
  width: max-content;
  max-width: 100%;
  min-width: 0;
}

/* Home grid: stay within the left column — do not use max-content width (prevents horizontal page overflow) */
.home-below-hero-inner .weather-widget-wrap {
  width: 100%;
}

.featured-column {
  flex: 1;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.featured-section {
  flex: 1;
  min-width: 280px;
  background: rgba(0, 0, 0, 0.65);
  border-radius: 12px;
  padding: 1.5rem 1.25rem 2rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.featured-section h2,
.featured-section .featured-section-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  margin-top: 0;
  color: #fff;
}

/* Home: Local News — two equal columns (Harbour Spiel | Coast Reporter) */
.local-news-section .local-news-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.25rem 1.5rem;
  align-items: start;
  min-width: 0;
}

.local-news-col {
  min-width: 0;
}

/* Right column: PHARA stacked above Coast Reporter */
.local-news-col-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
  width: 100%;
}

/* Inner card: same layered feel as featured business / home panels */
.local-news-panel {
  background: rgba(30, 30, 30, 0.8);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  padding: 1rem 1.25rem 1.25rem;
  min-width: 0;
}

.local-news-subheading {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  padding: 0;
  color: #e0f2fe;
  letter-spacing: 0.02em;
}

.local-news-panel--harbour .local-news-subheading,
.local-news-panel--phara .local-news-subheading,
.local-news-panel--coast .local-news-subheading {
  margin-bottom: 0.25rem;
}

.local-news-edition {
  margin: 0 0 0.65rem;
  padding: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: 0.02em;
}

.local-news-body {
  min-height: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.88);
}

.local-news-cover-link {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  line-height: 0;
  outline: none;
  transition: box-shadow 0.2s ease, opacity 0.2s ease;
}

.local-news-cover-link:hover,
.local-news-cover-link:focus-visible {
  box-shadow: 0 0 0 2px rgba(127, 212, 212, 0.45);
}

.local-news-cover-link:focus-visible {
  opacity: 0.95;
}

.local-news-cover-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(70vh, 520px);
  object-fit: contain;
  object-position: top center;
  background: rgba(0, 0, 0, 0.25);
}

/* Harbour Spiel: flex parent stops the <a> stretching full column; img uses px max-width only (no % — % was ½ of wide <a> in Edge) */
.local-news-body--harbour {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  width: 100%;
  min-width: 0;
}

.local-news-body--harbour .local-news-harbour-link.local-news-cover-link {
  display: block;
  flex: 0 0 auto;
  align-self: flex-start;
  width: fit-content;
  width: -moz-fit-content;
  max-width: 100%;
  box-sizing: border-box;
}

.local-news-body--harbour .local-news-harbour-img.local-news-cover-img {
  display: block;
  box-sizing: border-box;
  width: auto !important;
  max-width: 220px;
  height: auto;
  max-height: min(35vh, 260px);
  margin: 0;
}

.local-news-panel--coast .local-news-body {
  text-align: center;
}

/* PHARA logo: full width of panel; link matches image (block, no extra padding) */
.local-news-body--phara {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
  width: 100%;
  min-width: 0;
}

.local-news-body--phara .local-news-phara-link.local-news-cover-link {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0;
  line-height: 0;
}

.local-news-body--phara .local-news-phara-img.local-news-cover-img {
  display: block;
  width: 100% !important;
  max-width: 100%;
  height: auto;
  max-height: min(40vh, 280px);
  object-fit: contain;
  margin: 0;
  background: transparent;
}

.local-news-logo-link.local-news-cover-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 0.65rem 1rem;
  background: #fff;
  border-radius: 10px;
  box-sizing: border-box;
  max-width: 100%;
}

.local-news-logo-img {
  width: auto;
  max-width: 100%;
  max-height: 100px;
  height: auto;
  object-fit: contain;
  background: #fff;
  border-radius: 4px;
}

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

.featured-business-box {
  background: rgba(30, 30, 30, 0.8);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 0;
}

.featured-business-image {
  flex: 0 0 auto;
  min-height: 0;
  background: rgba(30, 30, 30, 0.8);
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}

.featured-business-image img {
  width: 200px;
  height: 100px;
  object-fit: cover;
  display: block;
}

.featured-business-body {
  flex: 1;
  min-width: 0;
  padding: 1rem 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.featured-content .featured-business-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0;
  color: #fff;
}

.featured-content .featured-business-category {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 0;
}

.featured-content .featured-business-desc {
  font-size: 0.9rem;
  line-height: 1.4;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.9);
}

.featured-content .featured-business-meta {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
}

.featured-content .featured-business-link {
  display: inline-block;
  margin-top: 0.25rem;
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  background: var(--btn-teal-bg);
  border: 1px solid var(--btn-teal-border);
  border-radius: 6px;
  text-decoration: none;
  transition: filter 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  box-shadow: var(--btn-teal-shadow);
}

.featured-content .featured-business-link:hover {
  filter: brightness(1.08);
  border-color: var(--btn-teal-border-hover);
  transform: translateY(-1px);
  background: var(--btn-teal-bg);
  color: #fff;
}

.featured-content .featured-business-links {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

@media (max-width: 480px) {
  .featured-business-image {
    align-items: flex-start;
    justify-content: flex-start;
  }
  .featured-business-image img {
    width: 250px;
    height: 150px;
  }
}

.featured-loading,
.featured-error {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
}

.featured-error {
  color: #f5a9a9;
}

/* ============================================
   Weather Section
   ============================================ */
.weather-section {
  background: rgba(0, 0, 0, 0.65);
  border-radius: 12px;
  padding: 1.5rem 1.25rem 2rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.weather-section h2,
.weather-section .weather-section-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  margin-top: 0;
  color: #fff;
}

.weather-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  width: 100%;
  min-width: 0;
}

/* Home: primary location + expandable “More locations” */
.weather-home-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  min-width: 0;
}

.weather-home-primary {
  min-width: 0;
}

.weather-home-more {
  width: 100%;
  min-width: 0;
}

.weather-home-more[hidden],
.weather-home-more.hidden {
  display: none !important;
}

.weather-grid.weather-grid--extra {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.weather-card {
  background: rgba(30, 30, 30, 0.8);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.weather-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #fff;
}

.weather-card .weather-temp {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}

.weather-card .weather-desc {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.9);
  margin: 0.25rem 0;
}

.weather-card .weather-details {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.75);
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.weather-section .weather-loading {
  text-align: center;
  padding: 1.5rem;
  color: rgba(255, 255, 255, 0.9);
}

.weather-section .weather-error {
  text-align: center;
  padding: 1.5rem;
  color: #f5a9a9;
}

/* ============================================
   Power Outages (BC Hydro RSS)
   ============================================ */
.power-outages-widget-wrap {
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.power-outages-section {
  background: rgba(0, 0, 0, 0.65);
  border-radius: 12px;
  padding: 1.5rem 1.25rem 1.25rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.power-outages-section-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  margin-top: 0;
  color: #fff;
}

.power-outages-loading,
.power-outages-error {
  text-align: center;
  padding: 1rem 0.5rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
}

.power-outages-error {
  color: #f5a9a9;
}

.power-outages-source .power-outages-feed-msg {
  color: #f5a9a9;
  font-size: 0.9rem;
}

.power-outages-empty {
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
}

.power-outages-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.power-outages-active-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.power-outages-restored-block {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-width: 0;
}

.power-outages-restored-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.power-outages-restored-panel[hidden],
.power-outages-restored-panel.hidden {
  display: none !important;
}

.home-widget-expand-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  width: 100%;
  margin: 0;
  padding: 0.55rem 1rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: #e0f2fe;
  background: rgba(125, 211, 252, 0.1);
  border: 1px solid rgba(125, 211, 252, 0.35);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.home-widget-expand-btn:hover {
  background: rgba(125, 211, 252, 0.18);
  border-color: rgba(125, 211, 252, 0.5);
}

.home-widget-expand-count {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

.power-outage-card {
  background: rgba(30, 30, 30, 0.8);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  min-width: 0;
}

.power-outage-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: #fff;
  line-height: 1.35;
}

.power-outage-pubdate {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.75);
  margin: 0 0 0.75rem;
}

.power-outage-description {
  font-size: 0.875rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
  word-break: break-word;
}

.power-outage-details {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.power-outage-detail-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.2rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.power-outage-detail-row:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.power-outage-details .power-outage-detail-label,
.power-outage-details dt.power-outage-detail-label {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.35;
}

.power-outage-details .power-outage-detail-value,
.power-outage-details dd.power-outage-detail-value {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.95);
  word-break: break-word;
}

.power-outages-source {
  margin: 1rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.8rem;
}

.power-outages-source a {
  color: #7fd4d4;
  text-decoration: none;
  font-weight: 600;
}

.power-outages-source a:hover {
  text-decoration: underline;
  color: #9ee8e8;
}

/* ============================================
   Event Cards
   ============================================ */
.sort-bar-overlay {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  background: rgba(0, 0, 0, 0.65);
  border-radius: 12px;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

body.page-notifications .sort-bar-overlay {
  display: block;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 767px) {
  body.page-events .sort-bar-overlay,
  body.page-businesses .sort-bar-overlay,
  body.page-marketplace .sort-bar-overlay,
  body.page-notifications .sort-bar-overlay {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }
}

.sort-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

.sort-bar label {
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.95);
}

.sort-bar select {
  padding: 0.4rem 2.1rem 0.4rem 0.75rem;
  font-size: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 6px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.55rem center / 1rem 1rem,
    rgba(255, 255, 255, 0.15);
  color: #fff;
}

.sort-bar select option {
  background: #333;
  color: #fff;
}

.event-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.event-card-wrapper {
  flex: 1 1 100%;
}

@media (min-width: 768px) {
  .event-card-wrapper {
    flex: 1 1 calc(50% - 0.625rem);
    max-width: calc(50% - 0.625rem);
  }
}

.event-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid #111111;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.event-title-wrap {
  flex: 0 0 auto;
  padding: 1.25rem 1.5rem;
  background: rgba(30, 30, 30, 0.8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 3.5rem;
}

.event-title-wrap .event-title {
  color: #ffffff;
  margin: 0;
  flex: 1;
  min-width: 0;
}

.event-edit-link {
  flex-shrink: 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
}

.event-edit-link:hover {
  text-decoration: underline;
}

.event-description-wrap {
  flex: 0 0 auto;
  min-height: 6.5rem;
  padding: 1rem 1.5rem;
  background: #444444;
}

.event-description-wrap .event-description {
  color: #dddddd;
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.event-image {
  flex: 0 0 auto;
  height: 200px;
  background: #e8e8e8;
}

.event-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.event-body {
  flex: 1;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 0;
  background: #444444;
}

.event-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.event-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: #dddddd;
}

.event-description {
  font-size: 0.95rem;
  color: #dddddd;
  margin: 0;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================
   Business Cards
   ============================================ */
.business-category {
  margin-bottom: 1rem;
  display: grid;
  grid-template-columns: 1fr;
}

.business-category:last-child {
  margin-bottom: 0;
}

.business-category-heading {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, rgba(0, 148, 148, 0.85) 0%, rgba(2, 128, 132, 0.75) 100%);
  border-radius: 12px 12px 0 0;
  color: #fff;
  margin-bottom: 0;
  grid-column: 1 / -1;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Section heading wrap (expand/collapse for months/categories): wrap owns background when it contains the h2 */
.event-section-heading-wrap,
.business-section-heading-wrap {
  display: flex;
  align-items: center;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, rgba(0, 148, 148, 0.85) 0%, rgba(2, 128, 132, 0.75) 100%);
  border-radius: 12px 12px 0 0;
  color: #fff;
  cursor: pointer;
  grid-column: 1 / -1;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

.event-section-heading-wrap .business-category-heading,
.business-section-heading-wrap .business-category-heading {
  margin: 0;
  padding: 0;
  background: none;
  border-radius: 0;
  box-shadow: none;
  flex: 1;
  min-width: 0;
}

.event-section-chevron-wrap,
.business-section-chevron-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  margin-right: 0.5rem;
  color: rgba(255, 255, 255, 0.9);
}

.event-section-chevron,
.business-section-chevron {
  transition: transform 0.2s ease;
}

.event-list-section--collapsed .event-section-chevron,
.business-category.business-category--collapsed .business-section-chevron {
  transform: rotate(-90deg);
}

.event-list-section--collapsed .event-section-heading-wrap,
.business-category.business-category--collapsed .business-section-heading-wrap {
  border-radius: 12px;
}

.event-list-section--collapsed .business-list.event-rows-list,
.business-category.business-category--collapsed .business-list {
  display: none !important;
}

/* Today section: static heading, no expand/collapse */
.event-list-section--today .event-today-heading {
  margin: 0;
  grid-column: 1 / -1;
}

.content-section .business-category-heading {
  margin-bottom: 0;
}

.business-category .business-list {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  grid-column: 1 / -1;
}

/* Last row rounded corners (mobile: single column, last card gets both) */
.business-category .business-list .business-card:last-child {
  border-radius: 0 0 12px 12px;
}

#business-list.business-list-visible,
.page-events #event-list.business-list-visible {
  display: block;
}

/* Events page: one event per row, no grid */
.page-events #event-list.business-list-visible {
  display: block;
}

.page-events .event-rows-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  grid-template-columns: 1fr;
}

.page-events .event-list-section .business-list.event-rows-list {
  border-radius: 0 0 12px 12px;
  overflow: hidden;
}

/* Desktop: event-list-section gets same 2-column grid as businesses */
@media (min-width: 768px) {
  .page-events .event-list-section .business-list.event-rows-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    align-items: stretch;
  }

  .page-events .event-list-section.business-category--single .business-list.event-rows-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .page-events .event-list-section .business-list.event-rows-list .event-row {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    min-height: 0;
  }

  /* Last row: left card bottom-left, right card bottom-right */
  .page-events .event-list-section .business-list.event-rows-list .event-row:last-child {
    border-radius: 0 0 12px 0;
  }

  .page-events .event-list-section .business-list.event-rows-list:not(.business-list--odd-fill) .event-row:nth-last-child(2) {
    border-bottom-left-radius: 12px;
  }

  .page-events .event-list-section .business-list.event-rows-list .event-row:only-child {
    border-radius: 0 0 12px 12px;
  }

  .page-events .event-list-section .business-list.event-rows-list.business-list--odd-fill .event-row:last-child {
    border-radius: 0 0 0 12px;
  }
}

.event-row {
  display: flex;
  flex-direction: column;
  background: rgba(28, 32, 40, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: none;
  padding: 0;
  margin: 0;
}

/* Event row collapsible: collapsed = title + meta, expanded = body below (like business-card) */
.event-row-title-wrap {
  flex: 0 0 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.5rem;
  background: rgba(18, 22, 32, 0.68);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  user-select: none;
}

.event-row-title-wrap:hover {
  background: rgba(22, 26, 36, 0.8);
}

.event-row--collapsed .event-row-title-wrap {
  border-bottom: none;
}

.event-row-chevron-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.7);
}

.event-row-chevron {
  transition: transform 0.2s ease;
}

.event-row--collapsed .event-row-chevron {
  transform: rotate(-90deg);
}

.event-row-body {
  display: flex;
  flex-direction: row;
  flex: 1 1 auto;
  min-width: 0;
  align-items: flex-start;
  padding: 0.75rem 0.5rem 0.75rem calc(0.5rem + 20px + 0.75rem);
  box-sizing: border-box;
}

.event-row-body-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.event-row-body-bottom {
  display: flex;
  align-items: center;
  min-width: 0;
}

.event-row-body .event-row-description + .event-row-body-bottom {
  margin-top: 0.5rem;
}

.event-row-edit-wrap {
  align-self: center;
  margin-left: 0.75rem;
  margin-right: 0.75rem;
  flex-shrink: 0;
}

.event-row--collapsed .event-row-body {
  display: none;
}

.event-row-title-wrap .event-row-main {
  flex: 1;
  min-width: 0;
}

.event-row-title-wrap .event-row-header {
  padding: 0.75rem 0 0.25rem 0;
}

.event-row-title-wrap .event-row-meta {
  padding: 0 0 0.75rem 0;
}

/* Mobile: single column, 4 rows (title, date, location, address) */
@media (max-width: 767px) {
  .page-events .event-row {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0;
  }
  .page-events .event-row-main {
    width: 100%;
    min-width: 0;
  }
  .page-events .event-row-title-wrap .event-row-header {
    padding: 0.75rem 0 0.25rem;
  }
  .page-events .event-row-title-wrap .event-row-meta {
    padding: 0 0 0.75rem;
  }
  .page-events .event-row-body {
    width: 100%;
  }
  .page-events .event-row-location-col {
    max-width: none;
    padding-left: 0;
    text-align: left;
  }
  .page-events .event-row-location {
    margin: 0 0 0.15rem;
  }
  .page-events .event-row-address {
    margin: 0;
  }
}

.event-row:first-child {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.event-rows-list .event-row:last-child {
  border-radius: 0 0 12px 12px;
}

.event-row-description {
  font-size: 0.9rem;
  color: rgba(255, 255, 255);
  line-height: 1.45;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.event-row-body .event-row-location-col {
  padding-left: 0;
}

.event-row-location-col {
  flex: 0 0 auto;
  min-width: 0;
  max-width: 280px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
}

.event-row-location {
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 0.15rem;
}

.event-row-cost {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 1rem;
}

.event-row-address {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}

.event-row-link {
  margin-top: 1.5rem;
}

.event-row-address a {
  color: #93c5fd;
}

.event-row-address a:hover {
  text-decoration: underline;
}

.event-row-main {
  flex: 1;
  min-width: 0;
}

.event-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0 0.25rem 1.5rem;
  min-height: 2.25rem;
}

.event-row-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  flex: 1;
  min-width: 0;
}

.event-row-meta {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  padding: 0 0 0.75rem 1.5rem;
  margin: 0;
}

.event-row-edit {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  flex-shrink: 0;
}

.event-row-approve-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: rgba(0, 170, 170, 0.25);
  color: #00cccc;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.event-row-approve-btn:hover:not(:disabled) {
  background: rgba(0, 170, 170, 0.4);
  color: #00eeee;
}
.event-row-approve-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.event-row-edit:hover {
  text-decoration: underline;
}

.event-row-event-link--btn {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--btn-teal-bg);
  color: #fff;
  border: 1px solid var(--btn-teal-border);
  border-radius: 8px;
  text-decoration: none;
  box-shadow: var(--btn-teal-shadow);
  transition: filter 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.event-row-event-link--btn:hover {
  filter: brightness(1.08);
  border-color: var(--btn-teal-border-hover);
  transform: translateY(-1px);
  background: var(--btn-teal-bg);
}

@media (min-width: 768px) {
  #business-list.business-list-visible {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0 2rem;
    align-items: start;
  }

  .page-events #event-list.business-list-visible {
    display: block;
  }

  .business-category:not(.business-category--single):not(.event-list-section) {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, 1fr);
  }

  .business-category .business-list:not(.event-rows-list) {
    grid-template-columns: repeat(2, 1fr);
  }

  .business-category--single {
    grid-column: 1 / -1;
  }

  .business-category--single .business-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .business-list--odd-fill::after {
    content: '';
    background: rgba(38, 42, 52, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    min-height: 0;
    border-radius: 0 0 12px 0;
  }

  /* Desktop: last row – left card bottom-left, right card bottom-right (only when even count; odd-fill handles odd count) */
  .business-category .business-list .business-card:last-child {
    border-radius: 0 0 12px 0;
  }

  .business-category .business-list:not(.business-list--odd-fill) .business-card:nth-last-child(2) {
    border-bottom-left-radius: 12px;
  }

  .business-category .business-list .business-card:only-child {
    border-radius: 0 0 12px 12px;
  }

  .business-category .business-list--odd-fill .business-card:last-child {
    border-radius: 0 0 0 12px;
  }
}

.business-card {
  background: rgba(28, 32, 40, 0.65);
  border-radius: 0px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 1);
  display: flex;
  flex-direction: column;
  min-height: 180px;
  height: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.business-title-wrap {
  flex: 0 0 auto;
  padding: 1.25rem 1.5rem;
  background: rgba(18, 22, 32, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 3.5rem;
  cursor: pointer;
  user-select: none;
}

.business-title-wrap:hover {
  background: rgba(22, 26, 36, 0.68);
}

.business-card-chevron-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.7);
}

.business-card-chevron {
  transition: transform 0.2s ease;
}

.business-card--collapsed .business-card-chevron {
  transform: rotate(-90deg);
}

.business-card--collapsed .business-title-wrap {
  border-bottom: none;
}

.business-card--collapsed {
  min-height: 0;
}

.business-card--collapsed .business-body {
  display: none;
}

.business-title-wrap .business-title {
  color: #fff;
  margin: 0;
  flex: 1;
  min-width: 0;
  font-weight: 700;
}

.event-title-block {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.event-card-date {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
  font-weight: 400;
}

.business-edit-link {
  flex-shrink: 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
}

.business-edit-link:hover {
  text-decoration: underline;
}

.business-body {
  flex: 1;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: rgba(38, 42, 52, 0.6);
}

.business-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.business-location,
.business-address {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
}

.business-location a,
.business-address a {
  color: #93c5fd;
}

.business-location a:hover,
.business-address a:hover {
  text-decoration: underline;
}

.business-contact {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
}

.event-card-image-wrap {
  margin-top: 0.5rem;
  height: 200px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  overflow: hidden;
}

.event-card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.business-contact a {
  color: #93c5fd;
}

.business-contact a:hover {
  text-decoration: underline;
}

.business-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.business-ext-btn {
  display: inline-block;
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  background: var(--btn-teal-bg);
  border: 1px solid var(--btn-teal-border);
  border-radius: 6px;
  text-decoration: none;
  box-shadow: var(--btn-teal-shadow);
  transition: filter 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.business-ext-btn:hover {
  filter: brightness(1.08);
  border-color: var(--btn-teal-border-hover);
  transform: translateY(-1px);
  background: var(--btn-teal-bg);
}

.business-description {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.88);
  margin: 0 0 0.5rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Businesses listing page: glass results + clearer section UX (collapsed headings) --- */
body.page-businesses #businesses-content-section {
  padding-top: 0.35rem;
  background: transparent;
}

body.page-businesses #business-loading.event-loading {
  margin-top: 0.35rem;
  margin-bottom: 0.35rem;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.95rem;
}

body.page-businesses #business-list.business-list-visible {
  display: block;
}

/* Flat panel: same idea as featured-section / empty overlays — uniform alpha, no gradient */
body.page-businesses #business-list .businesses-results-wrap {
  width: 100%;
  margin: 0;
  padding: 1.5rem 1.35rem 1.75rem;
  box-sizing: border-box;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.65);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
  body.page-businesses #business-list .businesses-results-wrap {
    padding: 1.5rem 1.1rem 1.5rem;
  }
}

body.page-businesses #business-list .businesses-results-wrap--empty {
  padding: 2rem 1.25rem;
  text-align: center;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.85);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

body.page-businesses #business-list .businesses-empty-msg {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.95rem;
  line-height: 1.55;
}

body.page-businesses #business-list .business-category.business-category--page {
  margin-bottom: 0.9rem;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(127, 212, 212, 0.14);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.24);
  background: rgba(6, 8, 14, 0.4);
}

body.page-businesses #business-list .business-category.business-category--page:last-child {
  margin-bottom: 0;
}

body.page-businesses #business-list .business-section-heading-wrap {
  align-items: center;
  gap: 0.65rem;
  padding: 1rem 1.15rem;
  /* Slightly lighter than listing rows + hairline top highlight */
  background: linear-gradient(135deg, rgba(0, 148, 148, 0.85) 0%, rgba(2, 128, 132, 0.75) 100%);
  border-radius: 0;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.045);
  border-bottom: 1px solid rgba(127, 212, 212, 0.1);
  transition: background 0.2s ease, border-color 0.2s ease;
}

body.page-businesses #business-list .business-section-heading-wrap:hover {
  background: linear-gradient(135deg, rgba(10, 158, 158, 0.85) 0%, rgba(12, 138, 142, 0.75) 100%);
}

body.page-businesses #business-list .business-category.business-category--collapsed .business-section-heading-wrap {
  border-bottom: none;
  border-radius: 0;
}

body.page-businesses #business-list .business-section-heading-wrap:focus {
  outline: none;
}

body.page-businesses #business-list .business-section-heading-wrap:focus-visible {
  outline: 2px solid rgba(127, 212, 212, 0.55);
  outline-offset: 2px;
  z-index: 1;
}

body.page-businesses #business-list .business-section-heading-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  align-self: center;
  gap: 0.2rem;
  text-align: left;
}

body.page-businesses #business-list .business-section-hint {
  display: none;
  font-size: 0.74rem;
  font-weight: 500;
  color: rgba(0, 252, 252, 0.58);
  letter-spacing: 0.02em;
}

body.page-businesses #business-list .business-category.business-category--collapsed .business-section-hint {
  display: block;
}

body.page-businesses #business-list .business-section-count {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.12rem;
  text-align: right;
  padding-left: 0.35rem;
}

body.page-businesses #business-list .business-section-count-badge {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  padding: 0.38rem 0.62rem;
  border-radius: 10px;
  background: rgba(0, 70, 70, 0.42);
  border: 1px solid rgba(127, 212, 212, 0.35);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

body.page-businesses #business-list .business-section-count-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(0, 255, 255, 0.82);
}

body.page-businesses #business-list .business-category-heading {
  padding: 0;
  margin: 0;
  background: none;
  border-radius: 0;
  box-shadow: none;
  font-size: 1.06rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
  color: #f8fafc;
}

/* Category tag: desktop only (still searched on all viewports) */
body.page-businesses #business-list .business-category-heading-tag {
  display: none;
}

@media (min-width: 769px) {
  body.page-businesses #business-list .business-category-heading-tag {
    display: inline;
    font-size: 0.88rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: rgba(248, 250, 252, 0.58);
    margin-left: 0.45rem;
  }
}

body.page-businesses #business-list .business-section-chevron-wrap {
  color: rgba(127, 212, 212, 0.88);
  margin-right: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  line-height: 0;
}

body.page-businesses #business-list .business-section-chevron {
  display: block;
}

@media (max-width: 480px) {
  /* Keep count (number + label) on the right of the category — not on a new row below */
  body.page-businesses #business-list .business-section-heading-wrap {
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.5rem;
  }

  body.page-businesses #business-list .business-section-heading-text {
    min-width: 0;
    flex: 1 1 auto;
  }

  body.page-businesses #business-list .business-category-heading {
    font-size: 1rem;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  body.page-businesses #business-list .business-section-count {
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    align-self: center;
    width: auto;
    flex-shrink: 0;
    padding-left: 0.25rem;
    gap: 0.1rem;
  }

  body.page-businesses #business-list .business-section-count-badge {
    font-size: 0.88rem;
    padding: 0.3rem 0.48rem;
  }

  body.page-businesses #business-list .business-section-count-label {
    font-size: 0.58rem;
    text-align: right;
    max-width: 100%;
  }
}

/* Listing: faintly darker “well” under the header + existing hairline (depth is very soft) */
body.page-businesses #business-list .business-category--page .business-list {
  background: rgba(0, 0, 0, 0.1);
  box-shadow:
    inset 0 1px 0 0 rgba(127, 212, 212, 0.07),
    inset 0 10px 16px -12px rgba(0, 0, 0, 0.22);
}

body.page-businesses #business-list .business-card {
  background: linear-gradient(165deg, rgba(30, 36, 48, 0.78) 0%, rgba(18, 22, 32, 0.92) 100%);
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: none;
  min-height: 0;
}

body.page-businesses #business-list .business-list .business-card:first-child {
  border-top: none;
}

body.page-businesses #business-list .business-title-wrap {
  background: transparent;
  border-bottom-color: rgba(255, 255, 255, 0.07);
}

/* Softer than section h2 (#f8fafc) so category titles stay the clear “header” */
body.page-businesses #business-list .business-title-wrap .business-title,
body.page-businesses #business-list .business-title {
  color: rgba(203, 213, 225, 0.96);
}

body.page-businesses #business-list .business-title-wrap:hover .business-title {
  color: rgba(226, 232, 240, 0.98);
}

body.page-businesses #business-list .business-title-wrap:hover {
  background: rgba(255, 255, 255, 0.035);
}

body.page-businesses #business-list .business-card--collapsed .business-title-wrap {
  border-bottom: none;
}

body.page-businesses #business-list .business-card-chevron-wrap {
  color: rgba(127, 212, 212, 0.72);
}

body.page-businesses #business-list .business-body {
  background: rgba(4, 6, 12, 0.42);
}

body.page-businesses #business-list .business-edit-link {
  padding: 0.22rem 0.5rem;
  border-radius: 8px;
  border: 1px solid rgba(125, 211, 252, 0.28);
  background: rgba(125, 211, 252, 0.08);
  color: #7dd3fc;
  font-weight: 600;
  font-size: 0.8rem;
  text-decoration: none;
}

body.page-businesses #business-list .business-edit-link:hover {
  background: rgba(125, 211, 252, 0.14);
  color: #e0f2fe;
  text-decoration: none;
}

body.page-businesses #business-list .business-ext-btn {
  border-radius: 10px;
  border: 1px solid var(--btn-teal-border);
  background: var(--btn-teal-bg);
  box-shadow: var(--btn-teal-shadow);
  transition: filter 0.15s ease, border-color 0.15s ease;
}

body.page-businesses #business-list .business-ext-btn:hover {
  filter: brightness(1.08);
  border-color: var(--btn-teal-border-hover);
}

/* Business page: "Don't see a business?" CTA */
.business-request-cta {
  padding: 0em 0 2rem;
}

.business-request-overlay {
  max-width: 560px;
  margin: 0 auto;
  background: rgba(0, 0, 0, 0.75);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  padding: 1.75rem 2rem;
  text-align: center;
}

.business-request-heading {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.5rem;
}

.business-request-text {
  color: rgba(255, 255, 255, 0.9);
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
}

.business-request-btn {
  display: inline-block;
}

/* ============================================
   Event Detail Page
   ============================================ */
.event-page-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.event-edit-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--btn-teal-bg);
  color: #fff !important;
  border: 1px solid var(--btn-teal-border);
  border-radius: 8px;
  text-decoration: none;
  box-shadow: var(--btn-teal-shadow);
  transition: filter 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.event-edit-btn:hover {
  filter: brightness(1.08);
  border-color: var(--btn-teal-border-hover);
  transform: translateY(-1px);
  background: var(--btn-teal-bg);
}

.back-link {
  display: inline-block;
  font-size: 0.9rem;
  color: #93c5fd;
  margin-bottom: 0;
  transition: color 0.2s;
}

.event-page-actions .back-link {
  margin-bottom: 0;
}

.back-link:hover {
  color: #bfdbfe;
}

.event-loading,
.event-error {
  text-align: center;
  padding: 3rem;
  color: #dddddd;
}

.event-error p {
  margin-bottom: 1rem;
}

.event-detail {
  max-width: 800px;
  margin: 0 auto;
  background: rgba(30, 30, 30, 0.8);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid #111111;
}

.event-detail-title-wrap {
  padding: 1.25rem 1.5rem;
  background: rgba(30, 30, 30, 0.8);
  display: flex;
  align-items: center;
  min-height: 3.5rem;
}

.event-detail-title-wrap .event-detail-title {
  color: #ffffff;
  margin: 0;
}

.event-detail-image {
  aspect-ratio: 16 / 9;
  background: #444444;
}

.event-detail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.event-detail-body {
  padding: 2rem 2.25rem;
  text-align: left;
  background: #444444;
}

.event-detail-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.event-detail-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 1rem;
  color: #dddddd;
}

.event-meta-item {
  display: block;
}

.event-meta-row {
  display: block;
}

.event-detail-description {
  font-size: 1.0625rem;
  color: #dddddd;
  line-height: 1.6;
  margin: 0;
}

/* ============================================
   Form Pages (add/edit event, business, listing, group)
   ============================================ */
.add-event-page,
.add-business-page,
.add-group-page,
.edit-listing-page {
  background: #444444;
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid #333333;
}

.add-listing-page {
  background: rgba(0, 0, 0, 0.8);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid #333333;
}

.add-listing-page .back-link {
  display: block;
  color: #93c5fd;
}

.add-listing-page .form-group {
  min-width: 0;
}

.add-event-page h1,
.add-business-page h1,
.add-listing-page h1,
.add-group-page h1,
.edit-listing-page h1 {
  color: #ffffff;
}

.add-event-page .lead,
.add-business-page .lead,
.add-listing-page .lead,
.add-group-page .lead,
.edit-listing-page .lead {
  color: #dddddd;
}

.add-event-page .form-group label,
.add-business-page .form-group label,
.add-listing-page .form-group label,
.add-group-page .form-group label,
.edit-listing-page .form-group label {
  color: #dddddd;
}

.category-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  font-weight: normal;
  color: #dddddd;
}

.checkbox-label input {
  margin: 0;
}

/* Add-business: categories left-aligned only (no center) */
.add-business-page .category-checkboxes {
  align-items: flex-start;
  justify-content: flex-start;
}
.add-business-page .category-checkboxes .checkbox-label {
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
}

.label-block {
  display: block;
  font-weight: 500;
  color: #dddddd;
  margin-bottom: 0.25rem;
}

.add-event-page .form-group input,
.add-event-page .form-group textarea,
.add-business-page .form-group input,
.add-business-page .form-group textarea,
.add-listing-page .form-group input,
.add-listing-page .form-group textarea,
.add-group-page .form-group input,
.add-group-page .form-group textarea,
.edit-listing-page .form-group input,
.edit-listing-page .form-group textarea {
  background: rgba(30, 30, 30, 0.8);
  color: #dddddd;
  border-color: #555;
}

/* Add/edit forms: <select> layout + background-color only (no background shorthand — keeps site-wide chevron) */
.add-event-page .form-group select,
.add-business-page .form-group select,
.add-listing-page .form-group select,
.add-group-page .form-group select,
.edit-listing-page .form-group select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.625rem max(2.35rem, 2em) 0.625rem 0.75rem;
  font-size: 1rem;
  border: 1px solid #555;
  border-radius: 6px;
  font-family: inherit;
  background-color: rgba(30, 30, 30, 0.8);
  color: #dddddd;
}

.add-event-page .form-group select option,
.add-business-page .form-group select option,
.add-listing-page .form-group select option,
.add-group-page .form-group select option,
.edit-listing-page .form-group select option {
  background: rgba(30, 30, 30, 0.8);
  color: #dddddd;
}

.add-new-location-section {
  margin-top: 0.75rem;
  margin-bottom: 1.5rem;
  margin-left: 0.5rem;
  padding: 1rem 1rem 1rem 1.25rem;
  border-left: 4px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0 6px 6px 0;
}
.add-new-location-section .add-new-location-heading {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.75rem 0;
}

.add-event-page .form-group .hint,
.add-business-page .form-group .hint,
.add-business-page .form-group span.hint,
.add-listing-page .form-group .hint,
.add-group-page .form-group .hint,
.edit-listing-page .form-group .hint {
  color: #aaaaaa;
}

/* Spacing between site header and back-link overlay on add/edit/view pages */
#add-listing-content-wrap,
#edit-listing-content-wrap,
#add-event-content-wrap,
#add-business-content-wrap,
#add-group-content-wrap,
#edit-event-content-wrap,
#edit-business-content-wrap,
#view-listing-content-wrap {
  margin-top: 1.5rem;
}

/* Wrapper so back-link overlay and auth/not-found overlay share the same width */
.main-content .content-overlays-wrap {
  display: block;
  /* 100% + min-width:0 — fit-content followed child intrinsic widths (e.g. iOS date inputs) and caused horizontal overflow */
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

/* Admin: use full container width like events / other main pages */
.page-admin .main-content .content-overlays-wrap {
  width: 100%;
  max-width: 100%;
}

/* Admin: title case on buttons (incl. table/pagination + scraper message modals on this page) */
.page-admin .main-content .admin-action-btn,
.page-admin .main-content .admin-table-btn,
.page-admin .main-content .admin-page-link,
.page-admin .main-content .admin-links a {
  text-transform: capitalize;
}

.page-admin .confirm-modal-overlay .confirm-modal-actions .btn {
  text-transform: capitalize;
}

.main-content .content-overlays-wrap .back-link-overlay {
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}

.main-content .content-overlays-wrap .auth-required,
.main-content .content-overlays-wrap .not-found {
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}

/* Spacing between back-link overlay and the content below (header or auth message) */
.main-content .content-overlays-wrap .back-link-overlay + * {
  margin-top: 1.5rem;
}

/* First overlay: back link */
.main-content .back-link-overlay {
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1.5rem;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  padding: 1rem 2.5rem;
}

.main-content .back-link-overlay .back-link {
  display: block;
  text-align: left;
  color: #93c5fd;
}

/* Auth-required / not-found / profile-unauth / preferences-unauth – opaque overlay so sign-in text is readable on background */
.main-content .auth-required,
.main-content .not-found,
.main-content .profile-unauth,
.main-content .preferences-unauth {
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  margin-top: 2rem;
  background: rgba(0, 0, 0, 0.85);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  padding: 1.5rem 2.5rem;
  color: rgba(255, 255, 255, 0.95);
}

/* Admin overlays: span standard page width (.container max-width 1140px) */
.main-content .admin-page,
.main-content .admin-unauth {
  width: 100%;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  margin-top: 2rem;
  background: rgba(0, 0, 0, 0.85);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  padding: 1.5rem 2.5rem;
  color: rgba(255, 255, 255, 0.95);
  box-sizing: border-box;
}

.main-content .auth-required,
.main-content .not-found,
.main-content .admin-unauth,
.main-content .profile-unauth,
.main-content .preferences-unauth {
  text-align: center;
}

.main-content .admin-unauth {
  margin-top: 2rem;
}

/* Sign-in / CTA links in overlay as teal button */
.main-content .auth-required a,
.main-content .not-found a,
.main-content .admin-unauth a,
.main-content .profile-unauth a,
.main-content .preferences-unauth a {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.6rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--btn-teal-bg);
  border: 1px solid var(--btn-teal-border);
  border-radius: 8px;
  text-decoration: none;
  box-shadow: var(--btn-teal-shadow);
  transition: filter 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.main-content .auth-required a:hover,
.main-content .not-found a:hover,
.main-content .admin-unauth a:hover,
.main-content .profile-unauth a:hover,
.main-content .preferences-unauth a:hover {
  filter: brightness(1.08);
  border-color: var(--btn-teal-border-hover);
  transform: translateY(-1px);
  background: var(--btn-teal-bg);
  color: #fff;
}

.main-content .admin-page h1 {
  margin: 0 0 0.5rem;
  color: #fff;
  font-size: 1.5rem;
}

.main-content .admin-page .lead {
  margin: 0 0 1.75rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
}

/* Admin: three dashboard cards (top row) */
.main-content .admin-top-sections {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 0 0 2rem;
  padding: 0;
}

.main-content .admin-top-section-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 1.25rem 1.15rem;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(145deg, rgba(35, 45, 58, 0.95), rgba(22, 28, 36, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  min-height: 0;
  min-width: 0;
}

.main-content .admin-top-section-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.45);
}

.main-content .admin-top-section-card:focus-visible {
  outline: 2px solid #7fd4d4;
  outline-offset: 3px;
}

.main-content .admin-top-section-card--users {
  border-top: 3px solid #6366f1;
}

.main-content .admin-top-section-card--events {
  border-top: 3px solid #14b8a6;
}

.main-content .admin-top-section-card--content {
  border-top: 3px solid #f59e0b;
}

.main-content .admin-top-section-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.92);
}

.main-content .admin-top-section-card--users .admin-top-section-icon {
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.2);
}

.main-content .admin-top-section-card--events .admin-top-section-icon {
  color: #5eead4;
  background: rgba(20, 184, 166, 0.2);
}

.main-content .admin-top-section-card--content .admin-top-section-icon {
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.18);
}

.main-content .admin-top-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.main-content .admin-top-section-desc {
  font-size: 0.82rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.65);
  margin: 0;
}

/* Admin: panels below cards */
.main-content .admin-mgmt-panel {
  margin-top: 1.5rem;
  padding: 1.35rem 1.5rem 1.5rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  scroll-margin-top: 5rem;
}

.main-content .admin-mgmt-panel:first-of-type {
  margin-top: 0.25rem;
}

.main-content .admin-mgmt-panel-heading {
  margin: 0 0 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 1.15rem;
  font-weight: 600;
  color: #fff;
}

.main-content .admin-mgmt-panel-lead {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.78);
  max-width: 100%;
}

.main-content .admin-mgmt-panel .admin-links {
  align-items: flex-start;
}

.main-content .admin-mgmt-panel .admin-harbourspiel-wrap {
  margin-top: 1.25rem;
}

.main-content .admin-mgmt-panel .admin-bchydro-wrap {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

/* Admin: user & role subsections */
.main-content .admin-subsection {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.main-content .admin-subsection:first-of-type {
  margin-top: 1rem;
  padding-top: 0;
  border-top: none;
}

.main-content .admin-subsection-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
}

.main-content .admin-subsection-lead {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.72);
  max-width: 48rem;
}

.main-content .admin-users-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.main-content .admin-users-search {
  flex: 1 1 14rem;
  min-width: 0;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
}

.main-content .admin-users-add-btn {
  flex-shrink: 0;
}

/* Toolbar + roles + business categories: primary buttons match modal (solid teal, padding) */
.page-admin .main-content .admin-users-toolbar .admin-action-btn--solid,
.page-admin .main-content #admin-roles-add-btn.admin-action-btn--solid,
.page-admin .main-content #admin-subsection-roles > .admin-action-btn--solid.admin-roles-add-btn,
.page-admin .main-content #admin-bcat-add-btn.admin-action-btn--solid,
.page-admin .main-content #admin-subsection-business-categories > .admin-action-btn--solid.admin-bcat-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.7rem 1.45rem;
  min-height: 2.75rem;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
  border-radius: 11px;
  border-width: 1px;
  border-style: solid;
  cursor: pointer;
  color: #fff;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
}

.page-admin .main-content .admin-users-toolbar .admin-action-btn--solid:hover:not(:disabled),
.page-admin .main-content #admin-roles-add-btn.admin-action-btn--solid:hover:not(:disabled),
.page-admin .main-content #admin-subsection-roles > .admin-action-btn--solid.admin-roles-add-btn:hover:not(:disabled),
.page-admin .main-content #admin-bcat-add-btn.admin-action-btn--solid:hover:not(:disabled),
.page-admin .main-content #admin-subsection-business-categories > .admin-action-btn--solid.admin-bcat-add-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.page-admin .main-content #admin-roles-add-btn.admin-action-btn--solid,
.page-admin .main-content #admin-subsection-roles > .admin-action-btn--solid.admin-roles-add-btn,
.page-admin .main-content #admin-bcat-add-btn.admin-action-btn--solid,
.page-admin .main-content #admin-subsection-business-categories > .admin-action-btn--solid.admin-bcat-add-btn {
  margin-bottom: 1rem;
}

@media (prefers-reduced-motion: reduce) {
  .page-admin .main-content .admin-users-toolbar .admin-action-btn--solid:hover:not(:disabled),
  .page-admin .main-content #admin-roles-add-btn.admin-action-btn--solid:hover:not(:disabled),
  .page-admin .main-content #admin-subsection-roles > .admin-action-btn--solid.admin-roles-add-btn:hover:not(:disabled),
  .page-admin .main-content #admin-bcat-add-btn.admin-action-btn--solid:hover:not(:disabled),
  .page-admin .main-content #admin-subsection-business-categories > .admin-action-btn--solid.admin-bcat-add-btn:hover:not(:disabled) {
    transform: none;
  }
}

.main-content .admin-user-status {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 6px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.main-content .admin-user-status--active {
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(52, 211, 153, 0.35);
}

.main-content .admin-user-status--pending {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(251, 191, 36, 0.4);
}

.main-content .admin-user-status--disabled {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(248, 113, 113, 0.35);
}

.main-content .admin-table-scroll {
  overflow-x: auto;
  margin-bottom: 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.main-content .admin-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.92);
}

.main-content .admin-data-table th,
.main-content .admin-data-table td {
  padding: 0.55rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.main-content .admin-data-table th {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(0, 0, 0, 0.35);
}

.main-content .admin-data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

.main-content .admin-table-actions {
  white-space: nowrap;
}

.main-content .admin-table-btn {
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
  border-radius: 6px;
  border: 1px solid var(--btn-teal-border);
  background: var(--btn-teal-bg);
  box-shadow: var(--btn-teal-shadow);
  color: #fff;
  cursor: pointer;
  margin-right: 0.35rem;
  transition: filter 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.main-content .admin-table-btn:hover:not(:disabled) {
  filter: brightness(1.08);
  border-color: var(--btn-teal-border-hover);
  transform: translateY(-1px);
  background: var(--btn-teal-bg);
}

.main-content .admin-table-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.main-content .admin-table-btn.danger {
  border-color: rgba(220, 80, 80, 0.6);
  background: rgba(120, 30, 30, 0.35);
}

.main-content .admin-table-btn.danger:hover:not(:disabled) {
  background: rgba(160, 40, 40, 0.5);
}

.main-content .admin-inline-status {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.75);
  margin: 0.5rem 0 0;
}

.main-content .admin-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 0.75rem;
}

.main-content .admin-page-info {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  margin-right: 0.5rem;
}

.main-content .admin-page-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.main-content .admin-page-link {
  padding: 0.35rem 0.6rem;
  font-size: 0.82rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  cursor: pointer;
}

.main-content .admin-page-link:hover:not(:disabled) {
  border-color: rgba(127, 212, 212, 0.6);
}

.main-content .admin-page-link:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.main-content .admin-page-current {
  padding: 0.35rem 0.55rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #7fd4d4;
}

.main-content .admin-pill {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.12rem 0.4rem;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.35);
  color: #c7d2fe;
}

.main-content .admin-pill--muted {
  margin-left: 0;
  background: rgba(100, 116, 139, 0.4);
  color: #cbd5e1;
}

/* Admin modals — dark glass, teal accent */
.main-content .admin-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.5rem 1rem 2rem;
  overflow-y: auto;
  box-sizing: border-box;
  animation: admin-modal-root-in 0.22s ease-out;
}

@keyframes admin-modal-root-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.main-content .admin-modal.hidden {
  display: none !important;
}

.main-content .admin-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 18, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
}

.main-content .admin-modal-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 28rem;
  margin-top: min(4vh, 2.5rem);
  border-radius: 18px;
  background: linear-gradient(155deg, rgba(32, 40, 54, 0.98) 0%, rgba(18, 22, 32, 0.99) 55%, rgba(14, 18, 28, 1) 100%);
  border: 1px solid rgba(127, 212, 212, 0.18);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35) inset,
    0 28px 64px rgba(0, 0, 0, 0.55),
    0 0 80px rgba(0, 148, 148, 0.08);
  color: rgba(255, 255, 255, 0.94);
  overflow: hidden;
  animation: admin-modal-panel-in 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes admin-modal-panel-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.main-content .admin-modal-panel--compact {
  max-width: 24rem;
}

.main-content .admin-modal-panel--edit-user {
  max-width: 26.5rem;
}

.main-content .admin-modal-panel--confirm {
  max-width: 22rem;
}

.main-content .admin-modal-accent {
  display: block;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, rgba(0, 120, 120, 0.2), rgba(127, 212, 212, 0.95), rgba(0, 148, 148, 0.5));
  box-shadow: 0 0 24px rgba(127, 212, 212, 0.35);
}

.main-content .admin-modal-accent--warn {
  background: linear-gradient(90deg, rgba(180, 80, 60, 0.35), rgba(248, 180, 100, 0.85), rgba(200, 90, 70, 0.45));
  box-shadow: 0 0 20px rgba(248, 180, 100, 0.2);
}

.main-content .admin-modal-close {
  position: absolute;
  top: 0.85rem;
  right: 0.75rem;
  z-index: 2;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.65);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.main-content .admin-modal-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.main-content .admin-modal-header {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.25rem 2.75rem 0 1.35rem;
}

.main-content .admin-modal-header--stack {
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-right: 1.35rem;
}

.main-content .admin-modal-header--stack .admin-modal-icon {
  margin-bottom: 0.25rem;
}

.main-content .admin-modal-icon {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(0, 148, 148, 0.35), rgba(0, 100, 110, 0.2));
  border: 1px solid rgba(127, 212, 212, 0.35);
  color: #b8f0f0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.main-content .admin-modal-icon--add-user {
  background: linear-gradient(145deg, rgba(80, 160, 160, 0.4), rgba(0, 120, 120, 0.22));
}

.main-content .admin-modal-icon--role {
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.35), rgba(60, 70, 120, 0.25));
  border-color: rgba(165, 180, 252, 0.4);
  color: #c7d2fe;
}

.main-content .admin-modal-icon--warn {
  background: linear-gradient(145deg, rgba(180, 90, 50, 0.45), rgba(100, 40, 30, 0.35));
  border-color: rgba(251, 191, 36, 0.35);
  color: #fde68a;
}

.main-content .admin-modal-heading-text {
  min-width: 0;
  padding-top: 0.15rem;
}

.main-content .admin-modal-title {
  margin: 0;
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.25;
}

.main-content .admin-modal-subtitle {
  margin: 0.4rem 0 0;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.58);
}

.main-content .admin-modal-body {
  padding: 1.1rem 1.35rem 1.5rem;
}

.main-content .admin-modal-body--tight {
  padding-top: 0.25rem;
}

.main-content .admin-modal-divider {
  height: 1px;
  margin: 0.25rem 0 0.5rem;
  background: linear-gradient(90deg, transparent, rgba(127, 212, 212, 0.2), transparent);
}

.main-content .admin-modal-fieldset {
  margin-bottom: 1.15rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.main-content .admin-modal-fieldset .admin-form-label:last-child {
  margin-bottom: 0;
}

.main-content .admin-modal-fieldset-label {
  display: block;
  margin: 0 0 0.65rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(127, 212, 212, 0.75);
}

.main-content .admin-form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

@media (max-width: 480px) {
  .main-content .admin-form-row-2 {
    grid-template-columns: 1fr;
  }
}

.main-content .admin-form-label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
}

.main-content .admin-modal-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.58rem 0.75rem;
  font-size: 0.95rem;
  font-family: inherit;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 12, 20, 0.75);
  color: #f1f5f9;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

/* Select: background-color only so `background:` doesn’t wipe the chevron (see .admin-modal-select below) */
.main-content .admin-modal-select {
  width: 100%;
  box-sizing: border-box;
  padding: 0.58rem 0.75rem;
  font-size: 0.95rem;
  font-family: inherit;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background-color: rgba(8, 12, 20, 0.75);
  color: #f1f5f9;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.main-content .admin-modal-input::placeholder {
  color: rgba(255, 255, 255, 0.32);
}

.main-content .admin-modal-input:hover,
.main-content .admin-modal-select:hover {
  border-color: rgba(127, 212, 212, 0.35);
}

.main-content .admin-modal-input:focus {
  outline: none;
  border-color: rgba(127, 212, 212, 0.65);
  box-shadow: 0 0 0 3px rgba(0, 148, 148, 0.22);
  background: rgba(10, 16, 26, 0.9);
}

/* Keep layered background so :focus doesn’t wipe the custom chevron */
.main-content .admin-modal-select:focus {
  outline: none;
  border-color: rgba(127, 212, 212, 0.65);
  box-shadow: 0 0 0 3px rgba(0, 148, 148, 0.22);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237fd4d4' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.65rem center / 1rem 1rem,
    rgba(10, 16, 26, 0.9);
}

.main-content .admin-modal-textarea {
  min-height: 3.1rem;
  resize: vertical;
  line-height: 1.45;
}

.main-content .admin-form-optional {
  font-weight: 500;
  color: rgba(255, 255, 255, 0.42);
}

.main-content .admin-modal-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237fd4d4' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  padding-right: 2rem;
}

.main-content .admin-modal-hint {
  margin: -0.35rem 0 1rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.48);
  font-weight: 400;
}

.main-content .admin-modal-hint strong {
  color: rgba(186, 230, 253, 0.9);
  font-weight: 600;
}

.main-content .admin-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 0.75rem;
  margin-top: 1rem;
}

.main-content .admin-form-actions--primary {
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.main-content .admin-form-actions--end {
  justify-content: flex-end;
  border-top: none;
  margin-top: 0.5rem;
}

/* Modal dialogs: full button chrome (not under .admin-links, so needs explicit padding) */
.main-content .admin-modal-panel .admin-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.7rem 1.45rem;
  min-height: 2.75rem;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
  border-radius: 11px;
  border-width: 1px;
  border-style: solid;
  cursor: pointer;
  color: #fff;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
}

.main-content .admin-modal-panel .admin-action-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.main-content .admin-modal-panel .admin-action-btn:active:not(:disabled) {
  transform: translateY(0);
}

.main-content .admin-modal-panel .admin-action-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .main-content .admin-modal-panel .admin-action-btn:hover:not(:disabled),
  .main-content .admin-modal-panel .admin-action-btn:active:not(:disabled) {
    transform: none;
  }
}

.main-content .admin-action-btn--solid {
  background: var(--btn-teal-bg) !important;
  border-color: var(--btn-teal-border) !important;
  box-shadow: var(--btn-teal-shadow) !important;
}

.main-content .admin-action-btn--solid:hover:not(:disabled) {
  filter: brightness(1.08);
  border-color: var(--btn-teal-border-hover) !important;
  background: var(--btn-teal-bg) !important;
}

.main-content .admin-action-btn--danger {
  background: linear-gradient(165deg, rgba(180, 60, 50, 0.75), rgba(130, 35, 35, 0.9)) !important;
  border-color: rgba(252, 165, 165, 0.45) !important;
  box-shadow: 0 4px 14px rgba(100, 20, 20, 0.35);
}

.main-content .admin-action-btn--danger:hover:not(:disabled) {
  background: linear-gradient(165deg, rgba(200, 75, 65, 0.85), rgba(150, 45, 40, 0.95)) !important;
}

.main-content .admin-action-btn-secondary {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
  color: rgba(255, 255, 255, 0.88) !important;
}

.main-content .admin-action-btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.11) !important;
  border-color: rgba(255, 255, 255, 0.28) !important;
}

.main-content .admin-assign-block {
  margin-top: 0;
  padding-top: 1rem;
}

.main-content .admin-assign-block + .admin-assign-block {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 1rem;
}

.main-content .admin-assign-heading {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
}

.main-content .admin-assign-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
}

.main-content .admin-assign-row .admin-modal-input,
.main-content .admin-assign-row .admin-modal-select {
  flex: 1 1 12rem;
  min-width: 0;
}

.main-content .admin-user-owned {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: rgba(0, 40, 45, 0.35);
  border: 1px solid rgba(127, 212, 212, 0.15);
  font-size: 0.85rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.88);
}

.main-content .admin-user-owned-inner strong {
  color: #7fd4d4;
}

@media (prefers-reduced-motion: reduce) {
  .main-content .admin-modal,
  .main-content .admin-modal-panel {
    animation: none;
  }
}

@media (max-width: 720px) {
  .main-content .admin-top-sections {
    grid-template-columns: 1fr;
  }
}

.main-content .admin-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.main-content .admin-links a {
  display: inline-block;
  padding: 0.6rem 1rem;
  background: rgba(0, 148, 148, 0.25);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  border: 1px solid rgba(0, 148, 148, 0.5);
  font-weight: 500;
  transition: background 0.2s, border-color 0.2s;
}

.main-content .admin-links a:hover {
  background: rgba(0, 148, 148, 0.4);
  border-color: rgba(0, 148, 148, 0.8);
}

.main-content .admin-links .admin-action-btn {
  display: inline-block;
  padding: 0.6rem 1rem;
  background: rgba(0, 148, 148, 0.25);
  color: #fff;
  border-radius: 8px;
  border: 1px solid rgba(0, 148, 148, 0.5);
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.main-content .admin-links .admin-action-btn:hover {
  background: rgba(0, 148, 148, 0.4);
  border-color: rgba(0, 148, 148, 0.8);
}

.main-content .admin-links .admin-action-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.main-content .admin-harbourspiel-wrap {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 100%;
}

.main-content .admin-harbourspiel-wrap label {
  font-weight: 600;
}

.main-content .admin-harbourspiel-wrap input.admin-url-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.2);
  color: inherit;
}

.main-content .admin-bchydro-wrap select.admin-url-input {
  width: 100%;
  max-width: 100%;
  padding: 0.5rem 2.35rem 0.5rem 0.75rem;
  font-size: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  box-sizing: border-box;
  color: inherit;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.65rem center / 1rem 1rem,
    rgba(0, 0, 0, 0.2);
}

.main-content .admin-harbourspiel-wrap .admin-action-btn {
  align-self: flex-start;
  display: inline-block;
  padding: 0.6rem 1rem;
  background: rgba(0, 148, 148, 0.25);
  color: #fff;
  border-radius: 8px;
  border: 1px solid rgba(0, 148, 148, 0.5);
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.main-content .admin-harbourspiel-wrap .admin-action-btn:hover {
  background: rgba(0, 148, 148, 0.4);
  border-color: rgba(0, 148, 148, 0.8);
}

.main-content .admin-harbourspiel-wrap .admin-action-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.main-content .admin-bchydro-wrap {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 100%;
}

.main-content .admin-bchydro-wrap .admin-hint {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.9;
  line-height: 1.4;
}

.main-content .admin-bchydro-wrap .admin-hint a {
  color: #7fd4d4;
}

.add-event-page .form-error,
.add-business-page .form-error,
.add-listing-page .form-error,
.add-group-page .form-error,
.edit-listing-page .form-error {
  background: #7f1d1d;
  color: #fca5a5;
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
  background: #1a1a1a;
  color: #aaa;
  padding: 1.5rem 0;
  margin-top: auto;
}

.site-footer p {
  font-size: 0.875rem;
  text-align: center;
}

.site-footer-links {
  margin-bottom: 0.5rem;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.footer-attribution {
  font-size: 0.7rem;
  margin-top: 0.5rem;
  opacity: 0.8;
}

.footer-attribution a {
  color: #8cb3d9;
}

.footer-attribution a:hover {
  text-decoration: underline;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 480px) {
  html, body {
    overflow-x: hidden;
    min-width: 0;
  }

  .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .site-header .container,
  .header-top-row,
  .logo-community-wrap,
  .main-nav ul {
    min-width: 0;
  }

  .logo-top { font-size: 0.7rem; }
  .logo-bottom { font-size: 1.15rem; }

  .main-nav ul {
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .main-nav a {
    font-size: 0.9rem;
    padding: 0.2rem 0.4rem;
  }

  .hero-overlay {
    display: block;
    width: 100%;
    max-width: 100%;
    padding: 1rem 1.25rem;
    box-sizing: border-box;
  }

  .hero-overlay h1 {
    font-size: clamp(2rem, 6vw, 2rem);
  }
}

/* Phone + small tablet (e.g. iPad mini): stack logo row, then main nav — avoids cramped Events…Groups row */
@media (max-width: 1023px) {
  .site-header .container {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .header-user-actions {
    display: flex;
    align-items: center;
  }
  .header-user-actions .nav-icons-group {
    margin-left: 0.25rem;
  }

  .header-user-actions .login-btn {
    font-weight: 600;
    padding: 0.5rem 1rem;
    background: var(--btn-teal-bg);
    color: #fff !important;
    border: 1px solid var(--btn-teal-border);
    border-radius: 8px;
    box-shadow: var(--btn-teal-shadow);
    transition: filter 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  }

  .header-user-actions .login-btn:hover {
    filter: brightness(1.08);
    border-color: var(--btn-teal-border-hover);
    transform: translateY(-1px);
    background: var(--btn-teal-bg);
    color: #fff !important;
  }

  .main-nav #auth-nav-item {
    display: none !important;
  }

  .main-nav {
    width: 100%;
    justify-content: center;
  }

  .main-nav ul {
    width: 100%;
    max-width: 100%;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
  }
}

/* iPad mini / small tablets only: true center for logo; phones use flex row above to avoid overflow */
@media (min-width: 641px) and (max-width: 1023px) {
  .header-top-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 0.35rem;
    width: 100%;
    max-width: 100%;
    flex: none;
    min-width: 0;
  }

  .header-top-row .nav-home-icon {
    justify-self: start;
    margin-right: 0;
  }

  .header-top-row .logo-community-wrap {
    justify-self: center;
    min-width: 0;
  }

  .header-top-row .logo-community-wrap .logo {
    align-items: center;
    text-align: center;
  }

  .header-top-row .header-user-actions {
    justify-self: end;
  }
}

@media (max-width: 640px) {
  .hero {
    padding: 2rem 0 1rem;
  }

  /* Home: grid + display:contents so order is Events → Weather → Local News → Featured (not 2×2 row-sync with desktop) */
  .home-below-hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto auto;
    grid-template-areas:
      "home-eve"
      "home-wea"
      "home-new"
      "home-fea";
    gap: 1rem;
    align-items: stretch;
  }

  .home-main-column,
  .home-sidebar {
    display: contents;
  }

  .home-below-hero-inner .home-happening-today-section {
    grid-area: home-eve;
  }

  .home-below-hero-inner .weather-widget-wrap {
    grid-area: home-wea;
  }

  .home-below-hero-inner .local-news-section {
    grid-area: home-new;
  }

  .home-below-hero-inner .home-featured-business-section {
    grid-area: home-fea;
  }

  .home-below-hero-inner .weather-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .home-below-hero-inner .weather-widget-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
}

@media (min-width: 1024px) {
  .header-user-actions {
    display: none !important;
  }

  .main-nav #auth-nav-item {
    display: flex !important;
    align-items: center;
    gap: 0.25rem;
  }

  .main-nav #auth-nav-item .avatar-dropdown-wrap {
    display: inline-flex;
    align-items: center;
  }
}

/* ============================================
   Toast & Confirm Modal (site-themed)
   Above admin dialogs (.admin-modal is 10000)
   ============================================ */
.toast {
  position: fixed;
  top: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  max-width: min(90vw, 420px);
  padding: 1rem 1.25rem;
  background: #222222;
  border: 1px solid #333333;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  color: #dddddd;
  font-size: 0.95rem;
  z-index: 11000;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
}
.toast.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}
@media (max-width: 768px) {
  .toast {
    top: 1rem;
    max-width: calc(100vw - 2rem);
  }
}
.toast.toast-error {
  border-color: #b91c1c;
  background: rgba(30, 20, 20, 0.95);
}
.confirm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 11000;
  padding: 1rem;
  box-sizing: border-box;
}
.confirm-modal {
  background: #222222;
  border-radius: 12px;
  border: 1px solid #333333;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  max-width: min(90vw, 400px);
  width: 100%;
  padding: 1.5rem 1.25rem;
  color: #dddddd;
}
.confirm-modal p {
  margin: 0 0 1.25rem;
  font-size: 1rem;
  line-height: 1.5;
}
.confirm-modal .message-modal-value {
  color: #aaaaaa;
}
.confirm-modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.confirm-modal-actions .btn {
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  border: none;
  min-height: 44px;
  min-width: 80px;
}
.confirm-modal-actions .btn-cancel {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
}
.confirm-modal-actions .btn-cancel:hover {
  background: rgba(255, 255, 255, 0.3);
}
.confirm-modal-actions .btn-confirm {
  background: #dc2626;
  color: #fff;
  border: 1px solid #b91c1c;
}
.confirm-modal-actions .btn-confirm:hover {
  background: #ef4444;
  border-color: #dc2626;
}
.confirm-modal-actions .btn-primary {
  background: var(--btn-teal-bg);
  color: #fff;
  border: 1px solid var(--btn-teal-border);
  box-shadow: var(--btn-teal-shadow);
  transition: filter 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.confirm-modal-actions .btn-primary:hover {
  filter: brightness(1.08);
  border-color: var(--btn-teal-border-hover);
  transform: translateY(-1px);
  background: var(--btn-teal-bg);
}

.confirm-modal--prompt {
  max-width: min(92vw, 520px);
}

.prompt-modal-label {
  display: block;
  margin: 0 0 0.65rem;
  font-size: 1rem;
  font-weight: 600;
  color: #e5e5e5;
}

.prompt-modal-textarea {
  display: block;
  width: 100%;
  min-height: 8rem;
  margin: 0 0 1.25rem;
  padding: 0.65rem 0.75rem;
  box-sizing: border-box;
  font-size: 0.95rem;
  line-height: 1.45;
  font-family: inherit;
  color: #e2e8f0;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  resize: vertical;
}

.prompt-modal-textarea:focus {
  outline: 2px solid rgba(0, 170, 170, 0.45);
  outline-offset: 1px;
}

/* Prompt modal: match messages2 primary / secondary buttons when those classes are used */
.confirm-modal--prompt .confirm-modal-actions .messages2-btn {
  min-height: auto;
  min-width: 5rem;
}

/* ============================================
   Legal pages (Terms of Service, Privacy Policy)
   ============================================ */
.legal-page { padding: 2rem 0 2rem; }
.legal-overlay {
  max-width: 720px;
  margin: 0 auto;
  background: rgba(0, 0, 0, 0.75);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  padding: 2rem 2.5rem;
}
.legal-overlay h1 { font-size: 1.75rem; margin-bottom: 1rem; color: #fff; }
.legal-overlay h2 { font-size: 1.2rem; margin-top: 2rem; margin-bottom: 0.5rem; color: rgba(255,255,255,0.95); }
.legal-overlay p, .legal-overlay ul { margin-bottom: 1rem; line-height: 1.6; color: rgba(255,255,255,0.9); }
.legal-overlay ul { padding-left: 1.5rem; }
.legal-overlay li { margin-bottom: 0.35rem; }
.legal-overlay .updated { font-size: 0.875rem; color: rgba(255,255,255,0.6); margin-bottom: 1.5rem; }

/* ============================================
   Page-specific overrides (from former inline <style>)
   ============================================ */

/* --- index (home) --- */
.home-no-community-wrap { margin-bottom: 1.5rem; }
.home-no-community-wrap .hero-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.hero-overlay .hero-overlay-heading { color: #fff; margin: 0 0 0.5rem; font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 700; }
.hero-overlay .hero-overlay-heading + .lead { margin-top: 0; }

/* --- contact --- */
.contact-page { padding: 2rem 0 2rem; }
.contact-overlay {
  max-width: 520px;
  margin: 0 auto;
  background: rgba(0, 0, 0, 0.75);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  padding: 2rem 2.5rem;
}
.contact-overlay h1 { font-size: 1.75rem; margin-bottom: 0.5rem; color: #fff; }
.contact-overlay .lead { color: rgba(255,255,255,0.85); margin: 0 0 1.5rem; font-size: 0.95rem; }
.contact-form label { display: block; font-weight: 500; margin-bottom: 0.35rem; font-size: 0.9rem; color: rgba(255,255,255,0.95); }
.contact-form input,
.contact-form textarea {
  width: 100%; padding: 0.6rem 0.75rem; font-size: 1rem; border: 1px solid #555;
  border-radius: 6px; margin-bottom: 1rem; box-sizing: border-box;
  background: rgba(30, 30, 30, 0.9); color: #dddddd; font-family: inherit;
}
.contact-form select {
  width: 100%; padding: 0.6rem 2.25rem 0.6rem 0.75rem; font-size: 1rem; border: 1px solid #555;
  border-radius: 6px; margin-bottom: 1rem; box-sizing: border-box;
  color: #dddddd; font-family: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23bbbbbb' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.65rem center / 1rem 1rem,
    rgba(30, 30, 30, 0.9);
}
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus { outline: none; border-color: #2563eb; }
.contact-form input::placeholder,
.contact-form textarea::placeholder { color: #888; }
.contact-form textarea { min-height: 120px; resize: vertical; }
.contact-form button[type="submit"] {
  padding: 0.75rem 1.5rem; font-size: 1rem; font-weight: 600;
  background: var(--btn-teal-bg); color: #fff; border: 1px solid var(--btn-teal-border); border-radius: 8px;
  cursor: pointer; font-family: inherit;
  box-shadow: var(--btn-teal-shadow);
  transition: filter 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.contact-form button[type="submit"]:hover {
  filter: brightness(1.08);
  border-color: var(--btn-teal-border-hover);
  transform: translateY(-1px);
  background: var(--btn-teal-bg);
}
.contact-form button[type="submit"]:disabled { opacity: 0.6; cursor: not-allowed; }
.contact-success { color: #86efac; margin-top: 1rem; }
.contact-success.hidden { display: none !important; }
.contact-success:not(.hidden) { display: block; }
.contact-error { background: #7f1d1d; color: #fca5a5; padding: 0.5rem 0.75rem; border-radius: 8px; margin-top: 1rem; font-size: 0.9rem; }
.contact-error.hidden { display: none !important; }
.contact-error:not(.hidden) { display: block; }

/* --- add-group --- */
.add-group-page { max-width: 560px; margin: 2rem auto 4rem; background: rgba(0, 0, 0, 0.8); padding: 2rem; border-radius: 12px; border: 1px solid #333333; }
.add-group-page .back-link { display: block; color: #93c5fd; margin-bottom: 0; }
.add-group-page h1 { margin-bottom: 0.5rem; }
.add-group-page .lead { color: #dddddd; margin-bottom: 2rem; }
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-weight: 500; margin-bottom: 0.35rem; font-size: 0.95rem; }
.form-group input, .form-group textarea { width: 100%; padding: 0.625rem 0.75rem; font-size: 1rem; border: 1px solid #ddd; border-radius: 6px; box-sizing: border-box; font-family: inherit; }
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: #2563eb; }
.form-group textarea { min-height: 120px; resize: vertical; }
.submit-btn {
  padding: 0.75rem 1.5rem; font-size: 1rem; font-weight: 600;
  background: var(--btn-teal-bg); color: #fff; border: 1px solid var(--btn-teal-border); border-radius: 8px;
  cursor: pointer; font-family: inherit;
  box-shadow: var(--btn-teal-shadow);
  transition: filter 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.submit-btn:hover {
  filter: brightness(1.08);
  border-color: var(--btn-teal-border-hover);
  transform: translateY(-1px);
  background: var(--btn-teal-bg);
}
.submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.add-business-form-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 0.5rem; }
.add-business-delete-btn { padding: 0.75rem 1.5rem; font-size: 1rem; font-weight: 600; background: #b91c1c; color: #fff; border: 1px solid #991b1b; border-radius: 8px; cursor: pointer; font-family: inherit; margin-left: auto; }
.add-business-delete-btn:hover { background: #dc2626; border-color: #b91c1c; }
.add-business-delete-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.form-error { background: #fef2f2; color: #b91c1c; padding: 0.75rem; border-radius: 8px; margin-bottom: 1.5rem; font-size: 0.9rem; }

/* --- add-listing --- */
.add-listing-page { max-width: 560px; margin: 2rem auto 0; }
.add-listing-page h1 { margin-bottom: 0.5rem; }
.add-listing-page .lead {
  color: #dddddd;
  margin-bottom: 2rem;
  margin-left: 0;
  margin-right: 0;
  max-width: none;
  text-align: left;
}
.add-listing-page .form-group label { display: block; font-weight: 500; margin-bottom: 0.35rem; font-size: 0.95rem; }
.add-listing-page .form-group input,
.add-listing-page .form-group textarea {
  width: 100%; padding: 0.625rem 0.75rem; font-size: 1rem; border: 1px solid #ddd;
  border-radius: 6px; box-sizing: border-box; font-family: inherit;
}
/* Lighter border on add-listing vs shared add-* select block */
.add-listing-page .form-group select {
  border-color: #ddd;
}
.add-listing-page .form-group input:focus,
.add-listing-page .form-group select:focus,
.add-listing-page .form-group textarea:focus {
  outline: none; border-color: #2563eb;
}
.add-listing-page .form-group textarea { min-height: 120px; resize: vertical; }
.add-listing-page .form-group .hint { font-size: 0.85rem; color: #aaaaaa; margin-top: 0.25rem; }
.add-listing-page .form-group input[type="file"] { padding: 0.5rem; }
.add-listing-page .image-preview { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.add-listing-page .image-preview img { width: 80px; height: 80px; object-fit: cover; border-radius: 6px; border: 1px solid #ddd; }

/* --- add-event --- */
.add-event-page { max-width: 560px; margin: 2rem auto 0rem; background: rgba(0, 0, 0, 0.8); border: 1px solid #333333; }
.add-event-page h1 { margin-bottom: 0.5rem; }
.add-event-page .lead { color: #dddddd; }
.add-event-page .back-link { display: block; color: #93c5fd; margin-bottom: 0; }
.add-event-page .form-group {
  margin-bottom: 1.25rem;
  /* Allow date inputs (large intrinsic min-width on iOS) to shrink within the column */
  min-width: 0;
}
.add-event-page .form-group label { display: block; font-weight: 500; margin-bottom: 0.35rem; font-size: 0.95rem; }
.add-event-page .form-group input,
.add-event-page .form-group textarea {
  width: 100%; padding: 0.625rem 0.75rem; font-size: 1rem; border: 1px solid #ddd;
  border-radius: 6px; box-sizing: border-box; font-family: inherit;
  background: #333; color: #dddddd;
}
/* add-event: match inputs (#333 / #ddd border) */
.add-event-page .form-group select {
  border-color: #ddd;
  background-color: #333;
}
.add-event-page .form-group input:focus,
.add-event-page .form-group select:focus,
.add-event-page .form-group textarea:focus {
  outline: none; border-color: #2563eb;
}
.add-event-page .form-group input:-webkit-autofill,
.add-event-page .form-group input:-webkit-autofill:hover,
.add-event-page .form-group input:-webkit-autofill:focus {
  -webkit-text-fill-color: #dddddd;
  -webkit-box-shadow: 0 0 0 1000px #333 inset;
  caret-color: #dddddd;
}
.add-event-page .form-group textarea { min-height: 120px; resize: vertical; }
.add-event-page .form-group .hint { font-size: 0.85rem; color: #aaaaaa; margin-top: 0.25rem; }
.add-event-page .form-group input[type="file"] { padding: 0.5rem; }
.add-event-page .image-preview { margin-top: 0.5rem; }
.add-event-page .image-preview img { max-width: 200px; max-height: 120px; object-fit: cover; border-radius: 6px; border: 1px solid #ddd; }
/* type=text + Flatpickr (desktop). On narrow viewports, JS uses native type=date — hide extra calendar button. */
.add-event-page.native-date-pickers .date-input-icon {
  display: none;
}
.add-event-page.native-date-pickers .date-input-wrap input.add-event-date-field,
.add-event-page.native-date-pickers .date-input-wrap input[type="date"] {
  padding-right: 0.75rem;
}
.add-event-page .date-input-wrap {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.add-event-page .date-input-wrap input.add-event-date-field,
.add-event-page .date-input-wrap input.flatpickr-input {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  text-align: left;
  direction: ltr;
  color: #fff;
  background: #333;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
  padding: 0.625rem 3rem 0.625rem 0.75rem;
}
.add-event-page .date-input-wrap input.add-event-date-field:focus,
.add-event-page .date-input-wrap input.flatpickr-input:focus {
  outline: none;
  border-color: #2563eb;
}
.add-event-page .date-input-icon {
  position: absolute;
  z-index: 2;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.add-event-page .date-input-icon:hover { background: rgba(255,255,255,0.1); color: #fff; }
.add-event-page .date-input-icon:focus { outline: none; box-shadow: 0 0 0 2px #2563eb; }
.add-event-page .form-group label.checkbox-label {
  display: inline-flex; align-items: center; justify-content: flex-start; gap: 0.35rem; width: auto; margin-bottom: 0; white-space: nowrap;
}
.add-event-page .form-group .checkbox-label span { white-space: nowrap; }
.add-event-page .form-group .checkbox-label input[type="checkbox"] { margin: 0 0.5rem 0 0; }

/* Multiday end date: hidden until checkbox (Safari/iOS respects [hidden] better than inline display:none with Flatpickr) */
.add-event-page #end-date-group[hidden] {
  display: none !important;
}

/* iPhone: native date field can paint wider than the column — clip the row, hide page horizontal scroll (does not affect the date picker overlay). */
@media (max-width: 640px) {
  .add-event-page {
    overflow-x: hidden;
    max-width: 100%;
  }
  .add-event-page .date-input-wrap {
    overflow: hidden;
    border-radius: 6px;
  }
}

/* Desktop Flatpickr (when used): above sticky header */
.flatpickr-calendar {
  z-index: 12000;
}

/* --- add-business --- */
.add-business-page { max-width: 560px; margin: 2rem auto 0; background: rgba(0, 0, 0, 0.8); border: 1px solid #333333; }
.add-business-page h1 { margin-bottom: 0.5rem; }
.add-business-page .lead { color: #dddddd; margin-bottom: 2rem; }
.add-business-page .back-link { display: block; color: #93c5fd; }
.add-business-page .form-group .category-checkboxes { text-align: left; }
.add-business-page .category-checkboxes {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem;
  align-items: flex-start; justify-content: flex-start;
}
.add-business-page .category-checkboxes .checkbox-label {
  display: inline-flex; align-items: flex-start; justify-content: flex-start;
  gap: 0.4rem; text-align: left; cursor: pointer; width: auto;
}
.add-business-page .category-checkboxes .checkbox-label input[type="checkbox"] {
  width: 1.25rem; height: 1.25rem; min-width: 1.25rem; flex-shrink: 0; margin: 0;
  padding: 0; box-sizing: border-box;
}
@media (max-width: 768px) {
  .add-business-page .category-checkboxes {
    flex-direction: column; flex-wrap: nowrap; gap: 0.5rem;
    align-items: flex-start; justify-content: flex-start;
  }
  .add-business-page .category-checkboxes .checkbox-label {
    display: inline-flex; flex-direction: row; align-items: flex-start; justify-content: flex-start;
    gap: 0.5rem; width: auto; text-align: left;
  }
  .add-business-page .category-checkboxes .checkbox-label input[type="checkbox"] {
    width: 1.25rem; height: 1.25rem; min-width: 1.25rem; flex-shrink: 0;
  }
}
#menu-url-group { display: none; }

/* --- preferences --- */
.preferences-page { max-width: 480px; margin: 2rem auto 0; padding: 2rem; background: #444444; border-radius: 12px; border: 1px solid #333333; }
.preferences-page h1 {
  margin: -2rem -2rem 1.5rem -2rem; padding: 1rem 2rem;
  color: #fff; font-size: 1.25rem; font-weight: 700;
  background: rgba(0,0,0,0.35); border-bottom: 1px solid rgba(255,255,255,0.25);
  border-radius: 12px 12px 0 0;
}
.preferences-form label { display: flex; align-items: flex-start; gap: 0.75rem; font-size: 1rem; color: #dddddd; margin-bottom: 1rem; cursor: pointer; }
.preferences-form input[type="checkbox"] { width: 1.25rem; height: 1.25rem; accent-color: #2563eb; flex-shrink: 0; margin-top: 0.2em; }
.preferences-form .pref-label-text { flex: 1; }
.preferences-form .pref-hint { font-size: 0.85rem; color: #aaaaaa; margin-top: 0.15rem; }
.preferences-save-strip {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  margin: 2rem -2rem -2rem -2rem; padding: 1.25rem 2rem;
  background: rgba(0,0,0,0.35); border-top: 1px solid rgba(255,255,255,0.25);
  border-radius: 0 0 12px 12px;
}
.preferences-form button[type="submit"] {
  padding: 0.75rem 1.5rem; font-size: 1rem; font-weight: 600;
  background: var(--btn-teal-bg); color: #fff; border: 1px solid var(--btn-teal-border); border-radius: 8px;
  cursor: pointer; font-family: inherit; margin: 0;
  box-shadow: var(--btn-teal-shadow);
  transition: filter 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.preferences-form button[type="submit"]:hover {
  filter: brightness(1.08);
  border-color: var(--btn-teal-border-hover);
  transform: translateY(-1px);
  background: var(--btn-teal-bg);
}
.preferences-form button[type="submit"]:disabled { opacity: 0.6; cursor: not-allowed; }
.preferences-message { padding: 0.5rem 0.75rem; border-radius: 8px; margin: 0; font-size: 0.9rem; }
.preferences-message.hidden { display: none !important; }
.preferences-message:not(.hidden) { display: block; }
.preferences-message.success { background: #064e3b; color: #6ee7b7; }
.preferences-message.error { background: #7f1d1d; color: #fca5a5; }
.preferences-loading { color: #dddddd; padding: 2rem; text-align: center; }
.preferences-unauth { text-align: center; padding: 3rem 2rem; color: #dddddd; }
.preferences-unauth a { color: #93c5fd; }
.preferences-unauth a:hover { text-decoration: underline; }
.preferences-section { margin-bottom: 1.5rem; }
.preferences-section h2 { font-size: 1rem; font-weight: 600; color: #ffffff; margin: 0 0 0.75rem; }

/* --- profile --- */
.profile-page { max-width: 480px; margin: 2rem auto 0; padding: 2rem; background: #444444; border-radius: 12px; border: 1px solid #333333; }
.profile-page-header {
  display: flex; align-items: center; gap: 1rem;
  margin: -2rem -2rem 1.5rem -2rem; padding: 1rem 2rem;
  background: rgba(0,0,0,0.35); border-bottom: 1px solid rgba(255,255,255,0.25);
  border-radius: 12px 12px 0 0;
}
.profile-page-header .profile-avatar-preview {
  width: 40px; height: 40px; font-size: 1rem; flex-shrink: 0;
}
.profile-page-header h1 {
  margin: 0; padding: 0;
  color: #fff; font-size: 1.25rem; font-weight: 700;
}
.profile-form label { display: block; font-weight: 500; margin-bottom: 0.25rem; font-size: 0.9rem; color: #dddddd; }
.profile-form input {
  width: 100%; padding: 0.625rem 0.75rem; font-size: 1rem; border: 1px solid #555;
  border-radius: 6px; margin-bottom: 1.25rem; box-sizing: border-box;
  background: rgba(30, 30, 30, 0.8); color: #dddddd;
}
.profile-form input:focus { outline: none; border-color: #2563eb; }
.profile-form input:disabled { background: #2a2a2a; color: #999; cursor: not-allowed; }
.profile-form select {
  width: 100%; padding: 0.625rem 2.25rem 0.625rem 0.75rem; font-size: 1rem; border: 1px solid #555;
  border-radius: 6px; margin-bottom: 0.5rem; box-sizing: border-box; color: #dddddd;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23bbbbbb' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.65rem center / 1rem 1rem,
    rgba(30, 30, 30, 0.8);
}
.profile-form select:focus { outline: none; border-color: #2563eb; }
.profile-form-hint { font-size: 0.85rem; color: #aaaaaa; margin: 1rem 0 0; }
.profile-save-strip {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  margin: 2rem -2rem -2rem -2rem; padding: 1.25rem 2rem;
  background: rgba(0,0,0,0.35); border-top: 1px solid rgba(255,255,255,0.25);
  border-radius: 0 0 12px 12px;
}
.profile-form button[type="submit"] {
  padding: 0.75rem 1.5rem; font-size: 1rem; font-weight: 600;
  background: var(--btn-teal-bg); color: #fff; border: 1px solid var(--btn-teal-border); border-radius: 8px;
  cursor: pointer; font-family: inherit; margin: 0;
  box-shadow: var(--btn-teal-shadow);
  transition: filter 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.profile-form button[type="submit"]:hover {
  filter: brightness(1.08);
  border-color: var(--btn-teal-border-hover);
  transform: translateY(-1px);
  background: var(--btn-teal-bg);
}
.profile-form button[type="submit"]:disabled { opacity: 0.6; cursor: not-allowed; }
.profile-message { padding: 0.5rem 0.75rem; border-radius: 8px; margin: 0; font-size: 0.9rem; }
.profile-message.hidden { display: none !important; }
.profile-message:not(.hidden) { display: block; }
.profile-message.success { background: #064e3b; color: #6ee7b7; }
.profile-message.error { background: #7f1d1d; color: #fca5a5; }
.profile-loading { color: #dddddd; padding: 2rem; text-align: center; }
.profile-unauth { text-align: center; padding: 3rem 2rem; color: #dddddd; }
.profile-unauth a { color: #93c5fd; }
.profile-unauth a:hover { text-decoration: underline; }
.profile-avatar-section { margin-bottom: 1.5rem; }
.profile-avatar-label { display: block; font-weight: 500; margin-bottom: 0.5rem; font-size: 0.9rem; color: #dddddd; }
.profile-avatar-row { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.profile-avatar-preview {
  width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 600; color: #fff; flex-shrink: 0; background: #00aaaa;
}
.profile-avatar-colors { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.profile-avatar-color {
  width: 36px; height: 36px; border-radius: 50%; border: 3px solid transparent; cursor: pointer;
  flex-shrink: 0; transition: transform 0.15s ease, border-color 0.15s ease;
}
.profile-avatar-color:hover { transform: scale(1.1); }
.profile-avatar-color.selected { border-color: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,0.3); }

/* --- view-listing (aligned with marketplace dark glass UI) --- */
.page-view-listing .view-listing-section {
  padding-top: 0.25rem;
  padding-bottom: 2.5rem;
  /* No section overlay — let body background image show through behind the listing card */
  background: transparent;
}

.page-view-listing .view-listing-container {
  max-width: 960px;
}

.page-view-listing .view-listing-overlays {
  width: 100%;
  max-width: 56rem;
  margin-left: auto;
  margin-right: auto;
}

.page-view-listing .view-listing-not-found {
  text-align: center;
  padding: 2.5rem 1.5rem;
  border-radius: 16px;
  background: linear-gradient(165deg, rgba(34, 40, 54, 0.92) 0%, rgba(18, 22, 32, 0.98) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.page-view-listing .view-listing-not-found-title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.page-view-listing .view-listing-not-found-text {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.55);
}

.page-view-listing .view-listing-not-found-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 1.15rem;
  font-weight: 600;
  font-size: 0.92rem;
  color: #fff;
  text-decoration: none;
  border-radius: 10px;
  background: var(--btn-teal-bg);
  border: 1px solid var(--btn-teal-border);
  box-shadow: var(--btn-teal-shadow);
  transition: filter 0.15s ease, transform 0.15s ease;
}

.page-view-listing .view-listing-not-found-link:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.page-view-listing .view-listing-page {
  margin: 0 auto;
  padding: 0;
  max-width: none;
  background: transparent;
  border: none;
}

.page-view-listing .view-listing-more-section {
  margin-top: 2rem;
  width: 100%;
}

/* Frosted panel so heading + grid stay readable on any photo behind the page */
.page-view-listing .marketplace-cards-host {
  width: 100%;
  padding: 1.35rem 1.15rem 1.5rem;
  border-radius: 18px;
  border: 1px solid rgba(127, 212, 212, 0.18);
  background: linear-gradient(
    165deg,
    rgba(18, 22, 32, 0.88) 0%,
    rgba(12, 16, 26, 0.82) 100%
  );
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.25) inset,
    0 16px 48px rgba(0, 0, 0, 0.35);
}

@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .page-view-listing .marketplace-cards-host {
    background: linear-gradient(
      165deg,
      rgba(22, 28, 40, 0.62) 0%,
      rgba(14, 18, 28, 0.55) 100%
    );
    backdrop-filter: blur(14px) saturate(1.15);
    -webkit-backdrop-filter: blur(14px) saturate(1.15);
  }
}

@media (min-width: 640px) {
  .page-view-listing .marketplace-cards-host {
    padding: 1.5rem 1.35rem 1.65rem;
  }
}

.page-view-listing .view-listing-more-heading {
  margin: 0 0 1.2rem;
  font-size: clamp(1.1rem, 2.2vw, 1.3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.3;
  /* Extra legibility on busy photos (works even if backdrop-filter is off) */
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.9),
    0 0 20px rgba(0, 0, 0, 0.5);
}

.page-view-listing .view-listing-shell {
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(165deg, rgba(34, 40, 54, 0.95) 0%, rgba(20, 24, 34, 0.98) 45%, rgba(14, 18, 28, 1) 100%);
  border: 1px solid rgba(127, 212, 212, 0.15);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35) inset,
    0 20px 56px rgba(0, 0, 0, 0.5);
}

.page-view-listing .view-listing-back-nav {
  padding: 0.85rem 1rem 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.2);
}

@media (min-width: 640px) {
  .page-view-listing .view-listing-back-nav {
    padding: 1rem 1.35rem 0.85rem;
  }
}

.page-view-listing .view-listing-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(186, 230, 253, 0.95);
  text-decoration: none;
  padding: 0.35rem 0.5rem;
  margin: -0.35rem;
  border-radius: 8px;
  transition: color 0.15s ease, background 0.15s ease;
}

.page-view-listing .view-listing-back-link:hover {
  color: #e0f2fe;
  background: rgba(127, 212, 212, 0.1);
}

.page-view-listing .view-listing-back-icon {
  flex-shrink: 0;
  opacity: 0.9;
}

.page-view-listing .view-listing-layout {
  display: flex;
  flex-direction: column;
  gap: 0;
}

@media (min-width: 880px) {
  .page-view-listing .view-listing-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 0;
    align-items: stretch;
  }
}

.page-view-listing .view-listing-media {
  position: relative;
  background: rgba(0, 0, 0, 0.4);
  min-height: 0;
}

@media (min-width: 880px) {
  .page-view-listing .view-listing-media {
    border-right: 1px solid rgba(255, 255, 255, 0.06);
  }
}

.page-view-listing .view-listing-media .listing-carousel {
  position: relative;
  margin: 0;
  border-radius: 0;
  overflow: hidden;
  background: #0d1118;
  aspect-ratio: 4 / 3;
  max-height: none;
}

@media (min-width: 880px) {
  .page-view-listing .view-listing-media .listing-carousel {
    min-height: 100%;
    aspect-ratio: auto;
    height: 100%;
    min-height: 22rem;
  }
}

.page-view-listing .listing-carousel .carousel-slides {
  display: flex;
  height: 100%;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.page-view-listing .listing-carousel .carousel-slides img {
  width: 100%;
  flex: 0 0 100%;
  height: 100%;
  min-height: 14rem;
  max-height: none;
  object-fit: cover;
  display: block;
}

@media (min-width: 880px) {
  .page-view-listing .listing-carousel .carousel-slides img {
    min-height: 22rem;
  }
}

.page-view-listing .listing-carousel .carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.65rem;
  height: 2.65rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(8, 12, 20, 0.75);
  color: #e0f2fe;
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.page-view-listing .listing-carousel .carousel-btn:hover {
  background: rgba(0, 100, 100, 0.45);
  border-color: rgba(127, 212, 212, 0.45);
  color: #fff;
}

.page-view-listing .listing-carousel .carousel-prev {
  left: 0.75rem;
}

.page-view-listing .listing-carousel .carousel-next {
  right: 0.75rem;
}

.page-view-listing .listing-carousel .carousel-dots {
  position: absolute;
  bottom: 0.85rem;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  padding: 0 0.5rem;
}

.page-view-listing .listing-carousel .carousel-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 0;
  background: rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.page-view-listing .listing-carousel .carousel-dot:hover {
  transform: scale(1.15);
}

.page-view-listing .listing-carousel .carousel-dot.active {
  background: rgba(127, 212, 212, 0.95);
  border-color: rgba(186, 250, 250, 0.6);
}

.page-view-listing .listing-image-placeholder.view-listing-media-placeholder,
.page-view-listing .view-listing-media-placeholder {
  margin: 0;
  min-height: 14rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, rgba(26, 32, 44, 0.95), rgba(12, 16, 24, 1));
  border-radius: 0;
  color: rgba(255, 255, 255, 0.35);
}

@media (min-width: 880px) {
  .page-view-listing .listing-image-placeholder.view-listing-media-placeholder {
    min-height: 22rem;
  }
}

.page-view-listing .view-listing-media-placeholder-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}

.page-view-listing .view-listing-media-placeholder-text {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.4);
}

.page-view-listing .view-listing-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.page-view-listing .view-listing-main-inner {
  padding: 1.15rem 1.15rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex: 1;
}

@media (min-width: 640px) {
  .page-view-listing .view-listing-main-inner {
    padding: 1.35rem 1.5rem 1.75rem;
  }
}

.page-view-listing .view-listing-category {
  display: inline-block;
  align-self: flex-start;
  padding: 0.22rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #a5f3fc;
  background: rgba(0, 120, 120, 0.28);
  border: 1px solid rgba(127, 212, 212, 0.28);
  border-radius: 6px;
}

.page-view-listing .view-listing-title {
  margin: 0.15rem 0 0;
  font-size: clamp(1.35rem, 3.5vw, 1.75rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #fff;
}

.page-view-listing .view-listing-price-row {
  margin-top: 0.35rem;
}

.page-view-listing .view-listing-price {
  font-size: clamp(1.2rem, 2.8vw, 1.45rem);
  font-weight: 700;
  color: #7fd4d4;
  letter-spacing: -0.02em;
}

.page-view-listing .view-listing-price-ask {
  font-weight: 600;
  font-style: italic;
  color: rgba(127, 212, 212, 0.75);
}

.page-view-listing .view-listing-meta-line {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.48);
}

.page-view-listing .view-listing-description-wrap {
  margin-top: 0.85rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex: 1;
}

.page-view-listing .view-listing-desc-heading {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(127, 212, 212, 0.75);
}

.page-view-listing .view-listing-description {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.78);
  white-space: pre-line;
}

.page-view-listing .view-listing-actions.listing-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 1.5rem;
  padding-top: 1.15rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  gap: 0.75rem 1rem;
}

.page-view-listing .view-listing-btn {
  padding: 0.62rem 1.2rem;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: filter 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
  border-width: 1px;
  border-style: solid;
}

.page-view-listing .view-listing-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.page-view-listing .view-listing-btn--primary {
  background: var(--btn-teal-bg);
  color: #fff;
  border-color: var(--btn-teal-border);
  box-shadow: var(--btn-teal-shadow);
}

.page-view-listing .view-listing-btn--secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
  border-color: rgba(255, 255, 255, 0.18);
}

.page-view-listing .view-listing-btn--danger {
  background: linear-gradient(165deg, rgba(180, 60, 50, 0.8), rgba(130, 35, 35, 0.92));
  color: #fff;
  border-color: rgba(252, 165, 165, 0.4);
}

/* Message modal on view-listing (above main chrome) */
body.page-view-listing #message-modal.modal-overlay {
  z-index: 10900;
  background: rgba(6, 10, 18, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

body.page-view-listing #message-modal .modal {
  background: linear-gradient(165deg, rgba(40, 46, 58, 0.98), rgba(22, 26, 36, 0.99));
  border: 1px solid rgba(127, 212, 212, 0.2);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  color: rgba(255, 255, 255, 0.9);
}

body.page-view-listing #message-modal .modal h3 {
  color: #fff;
  font-size: 1.15rem;
}

body.page-view-listing #message-modal .modal textarea {
  background: rgba(8, 12, 20, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #f1f5f9;
}

body.page-view-listing #message-modal .modal textarea:focus {
  outline: none;
  border-color: rgba(127, 212, 212, 0.45);
  box-shadow: 0 0 0 3px rgba(0, 148, 148, 0.2);
}

body.page-view-listing #message-modal .modal-cancel {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
}

body.page-view-listing #message-modal .modal-send {
  background: var(--btn-teal-bg);
  border: 1px solid var(--btn-teal-border);
  box-shadow: var(--btn-teal-shadow);
  color: #fff;
}

/* Generic modals (other pages) */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 1rem; }
.modal { background: #444444; border-radius: 12px; padding: 1.5rem; max-width: 400px; width: 100%; color: #dddddd; border: 1px solid #333333; }
.modal h3 { margin-bottom: 1rem; color: #fff; }
.modal .lead { color: #fff; }
.modal textarea { width: 100%; min-height: 100px; padding: 0.75rem; border: 1px solid #555; border-radius: 6px; font-family: inherit; font-size: 1rem; box-sizing: border-box; resize: vertical; background: #333; color: #dddddd; }
.modal-actions { display: flex; gap: 0.75rem; margin-top: 1rem; justify-content: flex-end; }
.modal-actions button { padding: 0.5rem 1rem; border-radius: 6px; font-weight: 500; cursor: pointer; font-family: inherit; }
.modal-cancel { background: rgba(255,255,255,0.2); color: #fff; border: 1px solid rgba(255,255,255,0.4); }
.modal-send {
  background: var(--btn-teal-bg);
  color: #fff;
  border: 1px solid var(--btn-teal-border);
  box-shadow: var(--btn-teal-shadow);
  transition: filter 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.modal-send:hover {
  filter: brightness(1.08);
  border-color: var(--btn-teal-border-hover);
  transform: translateY(-1px);
  background: var(--btn-teal-bg);
}

/* --- login --- */
.login-page { max-width: 380px; margin: 2rem auto 0; padding: 2rem; text-align: left; background: #444444; border-radius: 12px; border: 1px solid #333333; box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.login-page-header {
  margin: -2rem -2rem 1.5rem -2rem; padding: 1rem 2rem;
  background: rgba(0,0,0,0.35); border-bottom: 1px solid rgba(255,255,255,0.25);
  border-radius: 12px 12px 0 0;
}
.login-page-header h1 { margin: 0; padding: 0; color: #fff; font-size: 2rem; font-weight: 700; }
.login-page-header .lead { margin: 0.25rem 0 0; color: rgba(255,255,255,0.9); font-size: 0.95rem; }
.login-divider { display: flex; align-items: center; margin: 1.5rem 0; color: #aaaaaa; font-size: 0.9rem; }
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: #555; }
.login-divider span { padding: 0 1rem; }
.login-form-divider { height: 1px; background: rgba(255,255,255,0.2); margin: 1.5rem 0; }
.social-signin-row {
  display: flex; align-items: center; justify-content: center; gap: 0.75rem; flex-wrap: wrap;
  margin-bottom: 0.25rem;
}
.social-signin-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; padding: 0;
  background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.22);
  border-radius: 10px; color: rgba(255,255,255,0.9);
  cursor: pointer; font-family: inherit; transition: background 0.2s, border-color 0.2s;
}
.social-signin-btn:hover:not(:disabled) { background: rgba(255,255,255,0.22); border-color: rgba(255,255,255,0.35); }
.social-signin-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.social-signin-btn svg { width: 24px; height: 24px; flex-shrink: 0; }
.login-form { text-align: left; margin-top: 0; }
.login-form label { display: block; font-weight: 500; margin-bottom: 0.25rem; font-size: 0.9rem; color: #dddddd; }
.login-form input {
  width: 100%; padding: 0.625rem 0.75rem; font-size: 1rem; border: 1px solid #555;
  border-radius: 6px; margin-bottom: 0.5rem; box-sizing: border-box;
  background: rgba(30, 30, 30, 0.8); color: #dddddd;
}
.login-form input:focus { outline: none; border-color: #2563eb; }
.login-form input::placeholder { color: #888; }
.login-page .login-form input[type="email"],
.login-page .login-form input[type="password"] {
  background-color: #2a2a2a !important;
  color: #dddddd !important;
  border: 1px solid #555;
}
.login-page .login-form input[type="email"]:-webkit-autofill,
.login-page .login-form input[type="email"]:-webkit-autofill:hover,
.login-page .login-form input[type="email"]:-webkit-autofill:focus,
.login-page .login-form input[type="password"]:-webkit-autofill,
.login-page .login-form input[type="password"]:-webkit-autofill:hover,
.login-page .login-form input[type="password"]:-webkit-autofill:focus {
  -webkit-text-fill-color: #dddddd;
  -webkit-box-shadow: 0 0 0 1000px #2a2a2a inset;
  box-shadow: 0 0 0 1000px #2a2a2a inset;
  transition: background-color 5000s ease-in-out 0s;
}
.login-form select {
  width: 100%; padding: 0.625rem 2.25rem 0.625rem 0.75rem; font-size: 1rem; border: 1px solid #555;
  border-radius: 6px; margin-bottom: 0.5rem; box-sizing: border-box;
  color: #dddddd;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23bbbbbb' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.65rem center / 1rem 1rem,
    rgba(30, 30, 30, 0.8);
}
.login-form select:focus { outline: none; border-color: #2563eb; }
.login-action-strip {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  margin: 1rem -2rem -2rem -2rem; padding: 1.25rem 2rem;
  background: rgba(0,0,0,0.35); border-top: 1px solid rgba(255,255,255,0.25);
  border-radius: 0 0 12px 12px;
}
.login-form button[type="submit"] {
  padding: 0.75rem 1.5rem; font-size: 1rem; font-weight: 600;
  background: var(--btn-teal-bg); color: #fff; border: 1px solid var(--btn-teal-border); border-radius: 8px;
  cursor: pointer; font-family: inherit; margin: 0;
  box-shadow: var(--btn-teal-shadow);
  transition: filter 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.login-form button[type="submit"]:hover {
  filter: brightness(1.08);
  border-color: var(--btn-teal-border-hover);
  transform: translateY(-1px);
  background: var(--btn-teal-bg);
}
.login-form button[type="submit"]:disabled { opacity: 0.6; cursor: not-allowed; }
.login-btn-teal {
  padding: 0.75rem 1.5rem; font-size: 1rem; font-weight: 600;
  background: var(--btn-teal-bg); color: #fff; border: 1px solid var(--btn-teal-border); border-radius: 8px;
  cursor: pointer; font-family: inherit; margin: 0;
  box-shadow: var(--btn-teal-shadow);
  transition: filter 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.login-btn-teal:hover {
  filter: brightness(1.08);
  border-color: var(--btn-teal-border-hover);
  transform: translateY(-1px);
  background: var(--btn-teal-bg);
}
.login-btn-teal:disabled { opacity: 0.6; cursor: not-allowed; }
.login-toggle { margin: 0.25rem 0 0; font-size: 0.9rem; color: #dddddd; }
.login-toggle a { color: #93c5fd; }
.login-toggle a:hover { text-decoration: underline; }
.login-error { background: #7f1d1d; color: #fca5a5; padding: 0.5rem 0.75rem; border-radius: 8px; margin: 0; font-size: 0.9rem; }
.login-error.hidden { display: none !important; }
.login-error:not(.hidden) { display: block; }

.login-success { background: #14532d; color: #bbf7d0; padding: 0.5rem 0.75rem; border-radius: 8px; margin: 0 0 1rem; font-size: 0.9rem; }
.login-success.hidden { display: none !important; }
.login-success:not(.hidden) { display: block; }

.login-resend-row { margin-top: 0.75rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.login-resend-row.hidden { display: none !important; }
.login-btn-secondary { font-size: 0.9rem; padding: 0.4rem 0.75rem; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.08); color: inherit; cursor: pointer; }
.login-btn-secondary:hover { background: rgba(255, 255, 255, 0.14); }
.login-resend-status { font-size: 0.85rem; opacity: 0.9; }
.page-verify-email .verify-email-lead {
  color: #cccccc;
  font-size: 0.95rem;
  line-height: 1.45;
  margin: 0 0 1.25rem;
  max-width: 28rem;
}
.page-verify-email .verify-email-actions { margin-bottom: 1rem; }
.page-verify-email .verify-email-footnote { font-size: 0.9rem; margin: 0; }
.page-verify-email .verify-email-footnote a { color: #93c5fd; }
.page-verify-email .verify-email-footnote a:hover { text-decoration: underline; }
.login-unconfigured { color: #aaaaaa; padding: 0.5rem 0 1rem; font-size: 0.9rem; }
.social-signin-section { margin-bottom: 0.5rem; }
.social-signin-section .social-signin-label { font-size: 0.8rem; color: rgba(255,255,255,0.6); margin-bottom: 0.5rem; text-align: center; }
.login-page .profile-avatar-section { margin-bottom: 1.5rem; }
.login-page .profile-avatar-label { display: block; font-weight: 500; margin-bottom: 0.5rem; font-size: 0.9rem; color: #dddddd; }
.login-page .profile-avatar-colors { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.login-page .profile-avatar-color {
  width: 36px; height: 36px; border-radius: 50%; border: 3px solid transparent; cursor: pointer;
  flex-shrink: 0; transition: transform 0.15s ease, border-color 0.15s ease;
}
.login-page .profile-avatar-color:hover { transform: scale(1.1); }
.login-page .profile-avatar-color.selected { border-color: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,0.3); }

/* --- events --- */
.hero-overlay-events .hero-overlay-btn {
  padding: 0.4rem 1rem; font-size: 0.9rem; font-weight: 600;
  background: var(--btn-teal-bg); color: #fff; border: 1px solid var(--btn-teal-border);
  border-radius: 6px;
  cursor: pointer; font-family: inherit; text-decoration: none; flex-shrink: 0;
  box-shadow: var(--btn-teal-shadow);
  transition: filter 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  box-sizing: border-box;
  display: inline-flex; align-items: center;
}
.hero-overlay-events .hero-overlay-btn:hover {
  filter: brightness(1.08);
  border-color: var(--btn-teal-border-hover);
  transform: translateY(-1px);
  background: var(--btn-teal-bg);
}
.hero-events-sort { display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem; }
.hero-sort-label { font-size: 0.75rem; color: rgba(255,255,255,0.9); margin: 0; font-weight: 500; }
.hero-sort-select {
  padding: 0.4rem 2.25rem 0.4rem 0.6rem;
  font-size: 0.9rem;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 6px;
  font-family: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.65rem center / 1rem 1rem,
    rgba(255, 255, 255, 0.2);
}
.hero-sort-select option { background: #1a1a1a; color: #fff; }
.hero-events-search { display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem; }
.hero-events-search .hero-sort-label { font-size: 0.75rem; color: rgba(255,255,255,0.9); margin: 0; font-weight: 500; }
.hero-events-search .hero-search-input {
  padding: 0.4rem 0.6rem; font-size: 0.9rem; background: rgba(255,255,255,0.2);
  color: #fff; border: 1px solid rgba(255,255,255,0.4); border-radius: 6px;
  font-family: inherit; width: 10rem;
}
.hero-events-search .hero-search-input::placeholder { color: rgba(255,255,255,0.6); }
@media (max-width: 480px) {
  /* Match .hero-overlay.hero-overlay-events specificity so these override base gap (1.5rem) */
  .hero-overlay.hero-overlay-events .events-hero-controls {
    row-gap: 0.35rem;
    column-gap: 0.75rem;
  }
  /* Full-width row so Search sits below Filter By + Group By */
  .hero-overlay.hero-overlay-events .hero-events-search {
    flex: 1 1 100%;
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }
  .hero-events-search .hero-search-input { width: 100%; min-width: 0; font-size: 0.85rem; padding: 0.35rem 0.5rem; box-sizing: border-box; }
}

/* --- groups --- */
.hero-overlay-groups .hero-overlay-btn {
  padding: 0.4rem 1rem; font-size: 0.9rem; font-weight: 600;
  background: var(--btn-teal-bg); color: #fff; border: 1px solid var(--btn-teal-border);
  border-radius: 6px;
  cursor: pointer; font-family: inherit; text-decoration: none; flex-shrink: 0;
  box-shadow: var(--btn-teal-shadow);
  transition: filter 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  box-sizing: border-box;
  display: inline-flex; align-items: center;
}
.hero-overlay-groups .hero-overlay-btn:hover {
  filter: brightness(1.08);
  border-color: var(--btn-teal-border-hover);
  transform: translateY(-1px);
  background: var(--btn-teal-bg);
}
.hero-groups-sort { display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem; }
.hero-groups-sort .hero-sort-label { font-size: 0.75rem; color: rgba(255,255,255,0.9); margin: 0; font-weight: 500; }
.hero-groups-sort .hero-sort-select {
  padding: 0.4rem 2.25rem 0.4rem 0.6rem;
  font-size: 0.9rem;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 6px;
  font-family: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.65rem center / 1rem 1rem,
    rgba(255, 255, 255, 0.2);
}
.hero-groups-sort .hero-sort-select option { background: #1a1a1a; color: #fff; }
.hero-groups-search { display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem; }
.hero-groups-search .hero-sort-label { font-size: 0.75rem; color: rgba(255,255,255,0.9); margin: 0; font-weight: 500; }
.hero-groups-search .hero-search-input {
  padding: 0.4rem 0.6rem; font-size: 0.9rem; background: rgba(255,255,255,0.2);
  color: #fff; border: 1px solid rgba(255,255,255,0.4); border-radius: 6px;
  font-family: inherit; min-width: 10rem;
}
.hero-groups-search .hero-search-input { width: 12rem; }
.hero-groups-search .hero-search-input::placeholder { color: rgba(255,255,255,0.6); }
@media (max-width: 768px) {
  /* Keep filter + search on one row; search grows to the right, filter stays intrinsic width */
  .hero-overlay-groups .groups-hero-controls {
    flex-wrap: nowrap;
    gap: 0.65rem;
    align-items: flex-start;
  }
  .hero-overlay-groups .hero-groups-sort {
    flex-shrink: 0;
  }
  .hero-overlay-groups .hero-groups-search {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    max-width: none;
  }

  /* Beat body.page-group fixed 12rem width so filter stays left and search fills the right */
  body.page-group .hero-overlay-groups .hero-groups-search .hero-search-input {
    width: 100%;
    min-width: 0;
    font-size: 0.85rem;
    padding: 0.35rem 0.5rem;
    box-sizing: border-box;
  }
}
/* --- Groups page: results panel + cards (aligned with marketplace listing vibe) --- */
body.page-group #groups-content-section {
  padding-top: 0.35rem;
  padding-bottom: 2rem;
  background: transparent;
}

body.page-group #groups-loading.event-loading {
  margin-top: 0.35rem;
  margin-bottom: 0.5rem;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.95rem;
}

body.page-group .groups-auth-gate.hero-overlay {
  width: 100%;
  box-sizing: border-box;
  margin-top: 0.35rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

body.page-group .groups-auth-gate.hero-overlay .lead {
  margin-bottom: 1.25rem;
}

body.page-group .groups-results-wrap {
  width: 100%;
  margin: 0;
  padding: 1rem 1.35rem 2rem;
  box-sizing: border-box;
  border-radius: 16px;
  border: 1px solid rgba(127, 212, 212, 0.12);
  background: linear-gradient(180deg, rgba(10, 14, 22, 0.5) 0%, rgba(18, 22, 30, 0.96) 14%, rgba(14, 16, 22, 1) 100%);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.3) inset,
    0 14px 44px rgba(0, 0, 0, 0.38);
}

@media (max-width: 768px) {
  body.page-group .groups-results-wrap {
    padding: 0.85rem 1.15rem 1.65rem;
  }
}

body.page-group .groups-empty-card {
  padding: 2rem 1.25rem;
  text-align: center;
  border-radius: 12px;
  border: 1px dashed rgba(127, 212, 212, 0.2);
  background: rgba(8, 12, 18, 0.45);
}

body.page-group .groups-empty-card .groups-empty {
  margin: 0;
  padding: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.95rem;
  line-height: 1.55;
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
}

.groups-list-overlay {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

/* One column on phones; two from tablet up (same breakpoint as marketplace grid). */
.groups-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  align-items: stretch;
}

@media (min-width: 640px) {
  .groups-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }
}

.groups-list-item {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  background: linear-gradient(165deg, rgba(34, 40, 54, 0.72) 0%, rgba(20, 24, 34, 0.9) 100%);
  border: 1px solid rgba(127, 212, 212, 0.14);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.groups-list-item:hover {
  border-color: rgba(127, 212, 212, 0.22);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.34);
}

.groups-list-item .group-list-card {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.1rem 1.25rem 1.2rem;
  text-align: left;
  min-height: 0;
  height: 100%;
}

.groups-list-item .group-list-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.groups-list-item .group-list-heading {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.groups-list-item .group-list-edit-wrap {
  flex-shrink: 0;
  margin: 0;
  align-self: flex-start;
}

.groups-list-item .group-row-edit {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #7dd3fc;
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  border: 1px solid rgba(125, 211, 252, 0.25);
  background: rgba(125, 211, 252, 0.08);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.groups-list-item .group-row-edit:hover {
  color: #e0f2fe;
  background: rgba(125, 211, 252, 0.14);
  border-color: rgba(125, 211, 252, 0.4);
  text-decoration: none;
}

.groups-list-item .group-list-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.25;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

.groups-list-item .group-list-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.groups-list-item .group-meta-pill {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(8, 12, 20, 0.55);
  color: rgba(226, 232, 240, 0.88);
}

.groups-list-item .group-meta-pill--members {
  border-color: rgba(127, 212, 212, 0.25);
  color: rgba(165, 243, 252, 0.95);
}

.groups-list-item .group-meta-pill--posts {
  border-color: rgba(148, 163, 184, 0.2);
  color: rgba(203, 213, 225, 0.9);
}

/* Only rendered when a description exists — divider + muted body so title vs body don’t blend. */
.groups-list-item .group-list-desc {
  margin: 0;
  margin-top: 0.25rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(127, 212, 212, 0.12);
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.6;
  color: rgba(163, 180, 198, 0.95);
  white-space: pre-wrap;
  word-break: break-word;
}

.groups-list-item .group-list-footer {
  display: flex;
  padding-top: 0.85rem;
  margin-top: auto;
  justify-content: space-between;
  flex-wrap: wrap;
  align-items: center;
  align-content: center;
  gap: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Pills live in the footer (same styling as before; placement matches old text row). */
.groups-list-item .group-list-footer .group-list-meta-bar {
  flex: 1 1 auto;
  min-width: 0;
  align-self: center;
}

.groups-list-item .group-list-action {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  align-self: center;
  /* Small optical nudge so pills + teal buttons share a baseline */
  margin-top: 0.12rem;
}

.groups-list-item .group-join-btn,
.groups-list-item .group-view-btn,
.groups-list-item .group-leave-btn {
  padding: 0.42rem 0.95rem;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border-radius: 10px;
  border: 1px solid transparent;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  box-sizing: border-box;
  transition: filter 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.groups-list-item .group-join-btn,
.groups-list-item .group-view-btn {
  color: #fff;
  border: 1px solid var(--btn-teal-border);
  background: var(--btn-teal-bg);
  box-shadow: var(--btn-teal-shadow);
}

.groups-list-item .group-join-btn:hover,
.groups-list-item .group-view-btn:hover {
  filter: brightness(1.08);
  border-color: var(--btn-teal-border-hover);
  transform: translateY(-1px);
  color: #fff;
  background: var(--btn-teal-bg);
}

.groups-list-item .group-leave-btn {
  background: rgba(71, 85, 105, 0.65);
  color: #f1f5f9;
  border-color: rgba(148, 163, 184, 0.35);
}

.groups-list-item .group-leave-btn:hover {
  background: rgba(100, 116, 139, 0.85);
  color: #fff;
  border-color: rgba(148, 163, 184, 0.5);
  transform: translateY(-1px);
}

.groups-list-item .group-join-btn:disabled,
.groups-list-item .group-leave-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .groups-list-item .group-join-btn:hover,
  .groups-list-item .group-view-btn:hover,
  .groups-list-item .group-leave-btn:hover {
    transform: none;
  }
}

/* Groups list: Leave is desktop-only (narrow layouts stay View + Join only) */
@media (max-width: 1023px) {
  .groups-list-item .group-leave-btn {
    display: none;
  }
}

.groups-community-section { border-bottom: 1px solid rgba(255,255,255,0.12); }
.groups-community-section:last-child { border-bottom: none; }
.groups-community-section .groups-community-heading {
  font-size: 1.1rem !important; font-weight: 700 !important; color: #fff !important;
  margin: 0 !important; margin-bottom: 0 !important; margin-top: 0 !important;
  padding: 1rem 0 0.6rem !important;
  letter-spacing: 0.02em; background: rgba(0,0,0,0.35);
  border-bottom: 1px solid rgba(255,255,255,0.25);
}
.groups-community-section:first-child .groups-community-heading { padding-top: 0 !important; }
.groups-community-section .groups-list { border-top: none; }
.groups-community-section .groups-list-item:first-child { border-top: none; }
.groups-grid { display: block; width: 100%; }
.groups-empty { color: #dddddd; padding: 2rem; text-align: center; }
/* Events empty state: same transparent dark overlay as marketplace-empty / notifications */
.events-empty-overlay {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  padding: 2rem;
  background: rgba(0, 0, 0, 0.65);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  color: #dddddd;
  text-align: center;
}
.events-empty-overlay .groups-empty { margin: 0; padding: 0; }

/* --- businesses --- */
.hero-overlay-businesses .hero-overlay-btn {
  padding: 0.4rem 1rem; font-size: 0.9rem; font-weight: 600;
  background: var(--btn-teal-bg); color: #fff; border: 1px solid var(--btn-teal-border);
  border-radius: 6px;
  cursor: pointer; font-family: inherit; text-decoration: none; flex-shrink: 0;
  box-shadow: var(--btn-teal-shadow);
  transition: filter 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  box-sizing: border-box;
  display: inline-flex; align-items: center;
}
.hero-overlay-businesses .hero-overlay-btn:hover {
  filter: brightness(1.08);
  border-color: var(--btn-teal-border-hover);
  transform: translateY(-1px);
  background: var(--btn-teal-bg);
}
.hero-businesses-sort { display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem; }
.hero-sort-label { font-size: 0.75rem; color: rgba(255,255,255,0.9); margin: 0; font-weight: 500; }
.hero-sort-select {
  padding: 0.4rem 2.25rem 0.4rem 0.6rem;
  font-size: 0.9rem;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 6px;
  font-family: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.65rem center / 1rem 1rem,
    rgba(255, 255, 255, 0.2);
}
.hero-sort-select option { background: #1a1a1a; color: #fff; }
.hero-businesses-search { display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem; }
.hero-businesses-search .hero-sort-label { font-size: 0.75rem; color: rgba(255,255,255,0.9); margin: 0; font-weight: 500; }
.hero-businesses-search .hero-search-input {
  padding: 0.4rem 0.6rem; font-size: 0.9rem; background: rgba(255,255,255,0.2);
  color: #fff; border: 1px solid rgba(255,255,255,0.4); border-radius: 6px;
  font-family: inherit; width: 10rem;
}
.hero-businesses-search .hero-search-input::placeholder { color: rgba(255,255,255,0.6); }
@media (max-width: 480px) {
  /* Keep filter + search on one row; search grows, filter stays intrinsic width */
  .hero-overlay-businesses .businesses-hero-controls {
    flex-wrap: nowrap;
    gap: 0.65rem;
    align-items: flex-start;
  }
  .hero-overlay-businesses .hero-businesses-sort {
    flex-shrink: 0;
  }
  .hero-overlay-businesses .hero-businesses-search {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    max-width: none;
  }
  .hero-overlay-businesses .hero-businesses-search .hero-search-input {
    width: 100%;
    min-width: 0;
    font-size: 0.85rem;
    padding: 0.35rem 0.5rem;
    box-sizing: border-box;
  }
}

/* --- listing pages hero: glass panel (marketplace + events + businesses + groups + notifications + messages) --- */
body.page-marketplace .hero,
body.page-events .hero,
body.page-businesses .hero,
body.page-group .hero,
body.page-notifications .hero,
body.page-messages2 .hero {
  padding-top: 1.75rem;
  padding-bottom: 0.65rem;
}

body.page-marketplace .hero .container,
body.page-marketplace .marketplace-results-section > .container,
body.page-events .hero .container,
body.page-events #events-content-section > .container,
body.page-businesses .hero .container,
body.page-businesses #businesses-content-section > .container,
body.page-businesses #business-request-cta > .container,
body.page-group .hero .container,
body.page-group #groups-content-section > .container,
body.page-notifications .hero .container,
body.page-notifications .content-section > .container,
body.page-messages2 .hero .container,
body.page-messages2 .messages2-body-section > .container {
  max-width: 1200px;
}

body.page-marketplace .hero-overlay.hero-overlay-marketplace,
body.page-events .hero-overlay.hero-overlay-events,
body.page-businesses .hero-overlay.hero-overlay-businesses,
body.page-group .hero-overlay.hero-overlay-groups,
body.page-notifications .hero-overlay.hero-overlay-notifications,
body.page-messages2 .hero-overlay.hero-overlay-messages2 {
  padding: 1.25rem 1.35rem 1.35rem;
  border-radius: 16px;
  border: 1px solid rgba(127, 212, 212, 0.15);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35) inset,
    0 12px 40px rgba(0, 0, 0, 0.42);
  gap: 1rem;
}

@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  body.page-marketplace .hero-overlay.hero-overlay-marketplace,
  body.page-events .hero-overlay.hero-overlay-events,
  body.page-businesses .hero-overlay.hero-overlay-businesses,
  body.page-group .hero-overlay.hero-overlay-groups,
  body.page-notifications .hero-overlay.hero-overlay-notifications,
  body.page-messages2 .hero-overlay.hero-overlay-messages2 {
    backdrop-filter: blur(14px) saturate(1.12);
    -webkit-backdrop-filter: blur(14px) saturate(1.12);
  }
}

body.page-marketplace .hero-overlay-marketplace .marketplace-heading-row,
body.page-events .hero-overlay-events .events-heading-row,
body.page-businesses .hero-overlay-businesses .businesses-heading-row,
body.page-group .hero-overlay-groups .groups-heading-row,
body.page-notifications .hero-overlay-notifications .notifications-heading-row,
body.page-messages2 .hero-overlay-messages2 .messages2-heading-row {
  padding-bottom: 1rem;
  margin-bottom: 0;
  border-bottom: 1px solid rgba(127, 212, 212, 0.12);
}

body.page-marketplace .hero-overlay-marketplace .marketplace-heading-row h1,
body.page-events .hero-overlay-events .events-heading-row h1,
body.page-businesses .hero-overlay-businesses .businesses-heading-row h1,
body.page-group .hero-overlay-groups .groups-heading-row h1,
body.page-notifications .hero-overlay-notifications .notifications-heading-row h1,
body.page-messages2 .hero-overlay-messages2 .messages2-heading-row h1 {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #fff;
}

body.page-marketplace .hero-overlay-marketplace .hero-choose-community-msg,
body.page-events .hero-overlay-events .hero-choose-community-msg,
body.page-businesses .hero-overlay-businesses .hero-choose-community-msg,
body.page-group .hero-overlay-groups .hero-choose-community-msg {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.58);
}

body.page-marketplace .hero-overlay-marketplace .marketplace-controls-row,
body.page-events .hero-overlay-events .events-hero-controls,
body.page-businesses .hero-overlay-businesses .businesses-hero-controls,
body.page-group .hero-overlay-groups .groups-hero-controls,
body.page-notifications .hero-overlay-notifications .notifications-hero-controls {
  margin-top: 0.15rem;
  padding-top: 0.1rem;
}

body.page-marketplace .hero-overlay-marketplace .hero-listings-sort .hero-sort-label,
body.page-marketplace .hero-overlay-marketplace .hero-listings-search .hero-sort-label,
body.page-events .hero-overlay-events .hero-events-sort .hero-sort-label,
body.page-events .hero-overlay-events .hero-events-search .hero-sort-label,
body.page-businesses .hero-overlay-businesses .hero-businesses-sort .hero-sort-label,
body.page-businesses .hero-overlay-businesses .hero-businesses-search .hero-sort-label,
body.page-group .hero-overlay-groups .hero-groups-sort .hero-sort-label,
body.page-group .hero-overlay-groups .hero-groups-search .hero-sort-label,
body.page-notifications .hero-overlay-notifications .notifications-filter-wrap .hero-sort-label,
body.page-notifications .hero-overlay-notifications .notifications-sort-wrap .hero-sort-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(127, 212, 212, 0.78);
}

/* Search inputs only — glass panel (don’t bundle with <select>: background shorthand wipes custom chevron) */
body.page-marketplace .hero-overlay-marketplace .hero-listings-search .hero-search-input,
body.page-events .hero-overlay-events .hero-events-search .hero-search-input,
body.page-businesses .hero-overlay-businesses .hero-businesses-search .hero-search-input,
body.page-group .hero-overlay-groups .hero-groups-search .hero-search-input {
  padding: 0.5rem 0.7rem;
  font-size: 0.9rem;
  color: #f1f5f9;
  background: rgba(8, 12, 20, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body.page-marketplace .hero-overlay-marketplace .hero-listings-sort .hero-sort-select,
body.page-events .hero-overlay-events .hero-events-sort .hero-sort-select,
body.page-businesses .hero-overlay-businesses .hero-businesses-sort .hero-sort-select,
body.page-group .hero-overlay-groups .hero-groups-sort .hero-sort-select,
body.page-notifications .hero-overlay-notifications .notifications-filter-wrap .hero-sort-select,
body.page-notifications .hero-overlay-notifications .notifications-sort-wrap .hero-sort-select {
  padding: 0.5rem 2.35rem 0.5rem 0.7rem;
  font-size: 0.9rem;
  color: #f1f5f9;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.65rem center / 1rem 1rem,
    rgba(8, 12, 20, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body.page-marketplace .hero-overlay-marketplace .hero-listings-search .hero-search-input,
body.page-events .hero-overlay-events .hero-events-search .hero-search-input,
body.page-businesses .hero-overlay-businesses .hero-businesses-search .hero-search-input {
  min-width: 10rem;
  width: 10rem;
}

body.page-group .hero-overlay-groups .hero-groups-search .hero-search-input {
  min-width: 10rem;
  width: 12rem;
}

body.page-marketplace .hero-overlay-marketplace .hero-listings-sort .hero-sort-select option,
body.page-events .hero-overlay-events .hero-events-sort .hero-sort-select option,
body.page-businesses .hero-overlay-businesses .hero-businesses-sort .hero-sort-select option,
body.page-group .hero-overlay-groups .hero-groups-sort .hero-sort-select option,
body.page-notifications .hero-overlay-notifications .notifications-filter-wrap .hero-sort-select option,
body.page-notifications .hero-overlay-notifications .notifications-sort-wrap .hero-sort-select option {
  background: #1e2430;
  color: #f1f5f9;
}

body.page-marketplace .hero-overlay-marketplace .hero-listings-search .hero-search-input::placeholder,
body.page-events .hero-overlay-events .hero-events-search .hero-search-input::placeholder,
body.page-businesses .hero-overlay-businesses .hero-businesses-search .hero-search-input::placeholder,
body.page-group .hero-overlay-groups .hero-groups-search .hero-search-input::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

body.page-marketplace .hero-overlay-marketplace .hero-listings-sort .hero-sort-select:focus,
body.page-marketplace .hero-overlay-marketplace .hero-listings-search .hero-search-input:focus,
body.page-events .hero-overlay-events .hero-events-sort .hero-sort-select:focus,
body.page-events .hero-overlay-events .hero-events-search .hero-search-input:focus,
body.page-businesses .hero-overlay-businesses .hero-businesses-sort .hero-sort-select:focus,
body.page-businesses .hero-overlay-businesses .hero-businesses-search .hero-search-input:focus,
body.page-group .hero-overlay-groups .hero-groups-sort .hero-sort-select:focus,
body.page-group .hero-overlay-groups .hero-groups-search .hero-search-input:focus,
body.page-notifications .hero-overlay-notifications .notifications-filter-wrap .hero-sort-select:focus,
body.page-notifications .hero-overlay-notifications .notifications-sort-wrap .hero-sort-select:focus {
  outline: none;
  border-color: rgba(127, 212, 212, 0.45);
  box-shadow: 0 0 0 3px rgba(0, 148, 148, 0.2);
}

/* Override :focus box-shadow when autofill is active (needs higher specificity) */
body.page-marketplace .hero-overlay-marketplace .hero-listings-search .hero-search-input:-webkit-autofill,
body.page-marketplace .hero-overlay-marketplace .hero-listings-search .hero-search-input:-webkit-autofill:hover,
body.page-marketplace .hero-overlay-marketplace .hero-listings-search .hero-search-input:-webkit-autofill:active,
body.page-events .hero-overlay-events .hero-events-search .hero-search-input:-webkit-autofill,
body.page-events .hero-overlay-events .hero-events-search .hero-search-input:-webkit-autofill:hover,
body.page-events .hero-overlay-events .hero-events-search .hero-search-input:-webkit-autofill:active,
body.page-businesses .hero-overlay-businesses .hero-businesses-search .hero-search-input:-webkit-autofill,
body.page-businesses .hero-overlay-businesses .hero-businesses-search .hero-search-input:-webkit-autofill:hover,
body.page-businesses .hero-overlay-businesses .hero-businesses-search .hero-search-input:-webkit-autofill:active,
body.page-group .hero-overlay-groups .hero-groups-search .hero-search-input:-webkit-autofill,
body.page-group .hero-overlay-groups .hero-groups-search .hero-search-input:-webkit-autofill:hover,
body.page-group .hero-overlay-groups .hero-groups-search .hero-search-input:-webkit-autofill:active {
  -webkit-text-fill-color: #f1f5f9;
  caret-color: #f1f5f9;
  -webkit-box-shadow: 0 0 0 1000px rgba(8, 12, 20, 0.92) inset;
  box-shadow: 0 0 0 1000px rgba(8, 12, 20, 0.92) inset;
  transition: background-color 9999s ease-out 0s;
}

body.page-marketplace .hero-overlay-marketplace .hero-listings-search .hero-search-input:-webkit-autofill:focus,
body.page-events .hero-overlay-events .hero-events-search .hero-search-input:-webkit-autofill:focus,
body.page-businesses .hero-overlay-businesses .hero-businesses-search .hero-search-input:-webkit-autofill:focus,
body.page-group .hero-overlay-groups .hero-groups-search .hero-search-input:-webkit-autofill:focus {
  -webkit-box-shadow:
    0 0 0 1000px rgba(8, 12, 20, 0.92) inset,
    0 0 0 3px rgba(0, 148, 148, 0.2);
  box-shadow:
    0 0 0 1000px rgba(8, 12, 20, 0.92) inset,
    0 0 0 3px rgba(0, 148, 148, 0.2);
}

body.page-marketplace .hero-overlay-marketplace .hero-overlay-btn,
body.page-events .hero-overlay-events .hero-overlay-btn,
body.page-businesses .hero-overlay-businesses .hero-overlay-btn,
body.page-group .hero-overlay-groups .hero-overlay-btn {
  padding: 0.52rem 1.15rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  border-radius: 10px;
  background: var(--btn-teal-bg);
  border: 1px solid var(--btn-teal-border);
  box-shadow: var(--btn-teal-shadow);
  transition: filter 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

body.page-marketplace .hero-overlay-marketplace .hero-overlay-btn:hover,
body.page-events .hero-overlay-events .hero-overlay-btn:hover,
body.page-businesses .hero-overlay-businesses .hero-overlay-btn:hover,
body.page-group .hero-overlay-groups .hero-overlay-btn:hover {
  background: var(--btn-teal-bg);
  filter: brightness(1.08);
  border-color: var(--btn-teal-border-hover);
  transform: translateY(-1px);
}

@media (prefers-reduced-motion: reduce) {
  body.page-marketplace .hero-overlay-marketplace .hero-overlay-btn:hover,
  body.page-events .hero-overlay-events .hero-overlay-btn:hover,
  body.page-businesses .hero-overlay-businesses .hero-overlay-btn:hover,
  body.page-group .hero-overlay-groups .hero-overlay-btn:hover {
    transform: none;
  }
}

@media (max-width: 768px) {
  body.page-marketplace .hero-overlay.hero-overlay-marketplace,
  body.page-events .hero-overlay.hero-overlay-events,
  body.page-businesses .hero-overlay.hero-overlay-businesses,
  body.page-group .hero-overlay.hero-overlay-groups,
  body.page-notifications .hero-overlay.hero-overlay-notifications,
  body.page-messages2 .hero-overlay.hero-overlay-messages2 {
    padding: 1.1rem 1.15rem 1.2rem;
  }
}

/* Full-width search row on small screens (overrides fixed widths above) */
@media (max-width: 480px) {
  body.page-events .hero-overlay-events .hero-events-search {
    flex: 1 1 100%;
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  /* Marketplace + businesses + groups: search beside filter (see .hero-overlay-marketplace / .hero-overlay-businesses / .hero-overlay-groups blocks) */

  body.page-marketplace .hero-overlay-marketplace .hero-listings-search .hero-search-input,
  body.page-events .hero-overlay-events .hero-events-search .hero-search-input,
  body.page-businesses .hero-overlay-businesses .hero-businesses-search .hero-search-input,
  body.page-group .hero-overlay-groups .hero-groups-search .hero-search-input {
    width: 100%;
    min-width: 0;
    font-size: 0.85rem;
    padding: 0.35rem 0.5rem;
    box-sizing: border-box;
  }
}

/* --- marketplace results (dark theme, responsive grid) --- */
/*
 * Same structure as hero: section > .container (max 1200px + page gutters) > glass panel.
 * Fixes: (1) mobile was full-bleed vs hero; (2) listings were wider than hero because overlay
 * uses 1.35rem horizontal padding but wrap used 1.25rem.
 */
.page-marketplace .marketplace-results-section {
  padding-top: 0.35rem;
  padding-bottom: 1.75rem; /* space below the card to footer */
  background: transparent;
}

.page-marketplace .marketplace-results-wrap {
  width: 100%;
  margin: 0;
  padding: 1rem 1.35rem 2.25rem; /* horizontal matches .hero-overlay-marketplace */
  box-sizing: border-box;
  border-radius: 16px;
  border: 1px solid rgba(127, 212, 212, 0.12);
  background: linear-gradient(180deg, rgba(10, 14, 22, 0.5) 0%, rgba(18, 22, 30, 0.96) 14%, rgba(14, 16, 22, 1) 100%);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.3) inset,
    0 14px 44px rgba(0, 0, 0, 0.38);
}

@media (max-width: 768px) {
  .page-marketplace .marketplace-results-wrap {
    padding: 0.85rem 1.15rem 1.85rem; /* match .hero-overlay-marketplace mobile */
  }
}

.page-marketplace .marketplace-results-loading {
  margin-top: 1rem;
}

.page-marketplace .marketplace-auth-gate.hero-overlay {
  width: 100%;
  box-sizing: border-box;
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.page-marketplace .marketplace-auth-gate.hero-overlay .lead {
  margin-bottom: 1.25rem;
}

.page-marketplace .marketplace-results-panel {
  margin-top: 0.25rem;
}

.page-marketplace .marketplace-results-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1.35rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(127, 212, 212, 0.12);
}

.page-marketplace .marketplace-results-title {
  margin: 0;
  font-size: clamp(1.15rem, 2.5vw, 1.35rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.page-marketplace .marketplace-results-summary {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.55);
  max-width: 36rem;
}

.page-marketplace .listings-grid--marketplace,
.page-view-listing .marketplace-cards-host .listings-grid--marketplace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  align-items: stretch;
}

@media (min-width: 640px) {
  .page-marketplace .listings-grid--marketplace,
  .page-view-listing .marketplace-cards-host .listings-grid--marketplace {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.35rem;
  }
}

@media (min-width: 1024px) {
  .page-marketplace .listings-grid--marketplace,
  .page-view-listing .marketplace-cards-host .listings-grid--marketplace {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
  }
}

.page-marketplace .listings-grid--marketplace .listing-card-link,
.page-view-listing .marketplace-cards-host .listings-grid--marketplace .listing-card-link {
  display: block;
  min-width: 0;
  height: 100%;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  border-radius: 16px;
  -webkit-tap-highlight-color: rgba(0, 180, 180, 0.15);
}

.page-marketplace .listing-card-link:focus-visible,
.page-view-listing .marketplace-cards-host .listing-card-link:focus-visible {
  outline: 2px solid rgba(127, 212, 212, 0.85);
  outline-offset: 3px;
}

.page-marketplace .listing-card--marketplace,
.page-view-listing .marketplace-cards-host .listing-card--marketplace {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: linear-gradient(165deg, rgba(34, 40, 54, 0.92) 0%, rgba(20, 24, 34, 0.98) 45%, rgba(14, 18, 28, 1) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35) inset,
    0 12px 40px rgba(0, 0, 0, 0.45);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.page-marketplace .listing-card-link:hover .listing-card--marketplace,
.page-view-listing .marketplace-cards-host .listing-card-link:hover .listing-card--marketplace {
  border-color: rgba(127, 212, 212, 0.35);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35) inset,
    0 16px 48px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(127, 212, 212, 0.08);
  transform: translateY(-3px);
}

.page-marketplace .listing-card-link:active .listing-card--marketplace,
.page-view-listing .marketplace-cards-host .listing-card-link:active .listing-card--marketplace {
  transform: translateY(-1px);
}

@media (prefers-reduced-motion: reduce) {
  .page-marketplace .listing-card--marketplace,
  .page-marketplace .listing-card-link:hover .listing-card--marketplace,
  .page-marketplace .listing-card-link:active .listing-card--marketplace,
  .page-view-listing .marketplace-cards-host .listing-card--marketplace,
  .page-view-listing .marketplace-cards-host .listing-card-link:hover .listing-card--marketplace,
  .page-view-listing .marketplace-cards-host .listing-card-link:active .listing-card--marketplace {
    transition: none;
    transform: none;
  }
}

.page-marketplace .listing-card-media,
.page-view-listing .marketplace-cards-host .listing-card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.page-marketplace .listing-card-cover-img,
.page-view-listing .marketplace-cards-host .listing-card-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.page-marketplace .listing-card-link:hover .listing-card-cover-img,
.page-view-listing .marketplace-cards-host .listing-card-link:hover .listing-card-cover-img {
  transform: scale(1.04);
}

@media (prefers-reduced-motion: reduce) {
  .page-marketplace .listing-card-link:hover .listing-card-cover-img,
  .page-view-listing .marketplace-cards-host .listing-card-link:hover .listing-card-cover-img {
    transform: none;
  }
}

.page-marketplace .listing-card-photo-badge,
.page-view-listing .marketplace-cards-host .listing-card-photo-badge {
  position: absolute;
  bottom: 0.65rem;
  right: 0.65rem;
  padding: 0.2rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.page-marketplace .listing-card-cover-placeholder,
.page-view-listing .marketplace-cards-host .listing-card-cover-placeholder {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.35);
  background: linear-gradient(145deg, rgba(30, 36, 48, 0.9), rgba(18, 22, 32, 1));
}

.page-marketplace .listing-card-cover-placeholder-icon svg,
.page-view-listing .marketplace-cards-host .listing-card-cover-placeholder-icon svg {
  display: block;
  opacity: 0.55;
}

.page-marketplace .listing-card-cover-placeholder-text,
.page-view-listing .marketplace-cards-host .listing-card-cover-placeholder-text {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.4);
}

.page-marketplace .listing-card-content,
.page-view-listing .marketplace-cards-host .listing-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem 1.15rem 1.15rem;
  gap: 0.5rem;
  min-height: 0;
}

@media (min-width: 640px) {
  .page-marketplace .listing-card-content,
  .page-view-listing .marketplace-cards-host .listing-card-content {
    padding: 1.1rem 1.25rem 1.25rem;
  }
}

.page-marketplace .listing-card-top,
.page-view-listing .marketplace-cards-host .listing-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.page-marketplace .listing-card-category,
.page-view-listing .marketplace-cards-host .listing-card-category {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #a5f3fc;
  background: rgba(0, 120, 120, 0.28);
  border: 1px solid rgba(127, 212, 212, 0.25);
  border-radius: 6px;
}

.page-marketplace .listing-card-title,
.page-view-listing .marketplace-cards-host .listing-card-title {
  margin: 0;
  font-size: clamp(1rem, 2.2vw, 1.12rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.page-marketplace .listing-card-excerpt,
.page-view-listing .marketplace-cards-host .listing-card-excerpt {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.52);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-shrink: 0;
}

.page-marketplace .listing-card-meta-row,
.page-view-listing .marketplace-cards-host .listing-card-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  margin-top: auto;
  padding-top: 0.35rem;
}

.page-marketplace .listing-card-price,
.page-view-listing .marketplace-cards-host .listing-card-price {
  font-size: 1.05rem;
  font-weight: 700;
  color: #7fd4d4;
  letter-spacing: -0.01em;
}

.page-marketplace .listing-card-submeta,
.page-view-listing .marketplace-cards-host .listing-card-submeta {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.42);
}

.page-marketplace .listing-card-seller-row,
.page-view-listing .marketplace-cards-host .listing-card-seller-row {
  margin-top: -0.15rem;
}

.page-marketplace .listing-card-seller,
.page-view-listing .marketplace-cards-host .listing-card-seller {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.38);
}

.page-marketplace .listing-card-cta,
.page-view-listing .marketplace-cards-host .listing-card-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.65rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(127, 212, 212, 0.95);
}

.page-marketplace .listing-card-cta-icon,
.page-view-listing .marketplace-cards-host .listing-card-cta-icon {
  flex-shrink: 0;
  opacity: 0.85;
  transition: transform 0.2s ease;
}

.page-marketplace .listing-card-link:hover .listing-card-cta-icon,
.page-view-listing .marketplace-cards-host .listing-card-link:hover .listing-card-cta-icon {
  transform: translateX(4px);
}

@media (prefers-reduced-motion: reduce) {
  .page-marketplace .listing-card-link:hover .listing-card-cta-icon,
  .page-view-listing .marketplace-cards-host .listing-card-link:hover .listing-card-cta-icon {
    transform: none;
  }
}

.page-marketplace .marketplace-empty-card {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2.5rem 1.5rem;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px dashed rgba(127, 212, 212, 0.22);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.page-marketplace .marketplace-empty-card-title {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.page-marketplace .marketplace-empty-card-text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.55);
  max-width: 22rem;
  margin-left: auto;
  margin-right: auto;
}

/* Legacy class name: kept for any other pages referencing marketplace empty */
.marketplace-empty { width: 100%; box-sizing: border-box; color: #dddddd; padding: 2rem; text-align: center; background: rgba(0, 0, 0, 0.65); border-radius: 12px; box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3); }
.hero-overlay-marketplace .marketplace-controls-row,
.hero-overlay-notifications .notifications-hero-controls {
  align-items: flex-end;
}
.hero-listings-sort { display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem; }
.hero-listings-sort .hero-sort-label { font-size: 0.75rem; color: rgba(255,255,255,0.9); margin: 0; font-weight: 500; }
.hero-listings-sort .hero-sort-select {
  padding: 0.4rem 2.25rem 0.4rem 0.6rem;
  font-size: 0.9rem;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 6px;
  font-family: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.65rem center / 1rem 1rem,
    rgba(255, 255, 255, 0.2);
}
.hero-listings-sort .hero-sort-select option { background: #1a1a1a; color: #fff; }
.hero-listings-search { display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem; }
.hero-listings-search .hero-sort-label { font-size: 0.75rem; color: rgba(255,255,255,0.9); margin: 0; font-weight: 500; }
.hero-listings-search .hero-search-input {
  padding: 0.4rem 0.6rem; font-size: 0.9rem; background: rgba(255,255,255,0.2);
  color: #fff; border: 1px solid rgba(255,255,255,0.4); border-radius: 6px;
  min-width: 10rem; font-family: inherit;
}
.hero-listings-search .hero-search-input::placeholder { color: rgba(255,255,255,0.6); }
@media (max-width: 480px) {
  /* Keep filter + search on one row; search grows, filter stays intrinsic width */
  .hero-overlay-marketplace .marketplace-controls-row {
    flex-wrap: nowrap;
    gap: 0.65rem;
    align-items: flex-start;
  }
  .hero-overlay-marketplace .hero-listings-sort {
    flex-shrink: 0;
  }
  .hero-overlay-marketplace .hero-listings-search {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    max-width: none;
  }
  .hero-overlay-marketplace .hero-listings-search .hero-search-input {
    width: 100%;
    min-width: 0;
    font-size: 0.85rem;
    padding: 0.35rem 0.5rem;
    box-sizing: border-box;
  }
}
.hero-overlay-marketplace .hero-overlay-btn {
  padding: 0.4rem 1rem; font-size: 0.9rem; font-weight: 600;
  background: var(--btn-teal-bg); color: #fff;
  border: 1px solid var(--btn-teal-border); border-radius: 6px;
  cursor: pointer; font-family: inherit; text-decoration: none; flex-shrink: 0;
  box-shadow: var(--btn-teal-shadow);
  transition: filter 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  box-sizing: border-box;
  display: inline-flex; align-items: center;
}
.hero-overlay-marketplace .hero-overlay-btn:hover {
  filter: brightness(1.08);
  border-color: var(--btn-teal-border-hover);
  transform: translateY(-1px);
  background: var(--btn-teal-bg);
}
.hero-overlay-marketplace #add-listing-btn.add-listing-btn-hidden { display: none !important; }

/* --- notifications --- */
.mark-all-read-btn.sort-bar-btn {
  padding: 0.4rem 0.75rem; font-size: 0.9rem; font-weight: 500;
  background: rgba(255, 255, 255, 0.15); color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4); border-radius: 6px;
  cursor: pointer; font-family: inherit;
}
.mark-all-read-btn.sort-bar-btn:hover { background: rgba(255, 255, 255, 0.25); }
.notifications-filter-wrap,
.notifications-sort-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}

.notifications-list-overlay {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  padding: 1rem;
  background: rgba(68, 68, 68, 0.92);
  border-radius: 12px;
  border: 1px solid rgba(51, 51, 51, 0.9);
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  overflow: hidden;
}
.notifications-list { list-style: none; margin: 0; padding: 0; display: block; overflow: hidden; border-radius: 12px; }
.notification-item {
  position: relative;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 1rem 2.25rem 1rem 1rem;
  border-left: 4px solid #00aaaa;
}
.notification-item:first-child { border-radius: 12px 12px 0 0; }
.notification-item:last-child { border-bottom: none; border-radius: 0 0 12px 12px; }
.notification-item:only-child { border-radius: 12px; }
.notification-item:nth-child(odd) { background: rgba(0, 0, 0, 0.85); }
.notification-item:nth-child(even) { background: rgba(30, 30, 30, 0.85); }
.notification-item.read { border-left-color: #555; }
.notification-meta-line {
  font-size: 0.85rem;
  color: #aaaaaa;
  margin-bottom: 0.35rem;
}
.notification-delete {
  position: absolute;
  top: 0.75rem;
  right: 0.5rem;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  color: #aaaaaa;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.notification-delete:hover { color: #f87171; background: rgba(248, 113, 113, 0.15); }
.notification-delete:focus { outline: none; }
.notification-title { font-weight: 600; font-size: 1rem; margin: 0 0 0.2rem; color: #ffffff; }
.notification-message { font-size: 0.95rem; color: #dddddd; line-height: 1.5; margin: 0 !important; margin-bottom: 0 !important; }
.notification-link { color: #93c5fd; font-size: 0.9rem; margin-top: 0.5rem; display: inline-block; }
.notification-link:hover { text-decoration: underline; }
.notification-link.notification-link-btn {
  margin-top: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--btn-teal-bg);
  color: #fff;
  border: 1px solid var(--btn-teal-border);
  border-radius: 8px;
  text-decoration: none;
  display: inline-block;
  box-shadow: var(--btn-teal-shadow);
  transition: filter 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.notification-link.notification-link-btn:hover {
  filter: brightness(1.08);
  border-color: var(--btn-teal-border-hover);
  transform: translateY(-1px);
  background: var(--btn-teal-bg);
  text-decoration: none;
  color: #fff;
}
/* Empty/error state: same transparent dark overlay as sort-bar and marketplace-empty */
.notifications-empty-overlay {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  padding: 2rem;
  background: rgba(0, 0, 0, 0.65);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  color: #dddddd;
  text-align: center;
}
.notifications-empty-overlay .notifications-empty { margin: 0; padding: 0; }
.notifications-empty { color: #dddddd; padding: 3rem 2rem; text-align: center; }
.auth-required { text-align: center; padding: 3rem 2rem; color: #dddddd; }
.auth-required a { color: #00aaaa; }

/* --- group --- */
.group-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.btn { padding: 0.5rem 1rem; font-size: 0.95rem; font-weight: 600; border-radius: 8px; cursor: pointer; font-family: inherit; text-decoration: none; border: none; }
.btn-primary {
  background: var(--btn-teal-bg);
  color: #fff;
  border: 1px solid var(--btn-teal-border);
  box-shadow: var(--btn-teal-shadow);
  transition: filter 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
  border-color: var(--btn-teal-border-hover);
  transform: translateY(-1px);
  background: var(--btn-teal-bg);
}
.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.btn-secondary { background: rgba(255,255,255,0.2); color: #fff; border: 1px solid rgba(255,255,255,0.4); }
.btn-secondary:hover { background: rgba(255,255,255,0.3); }
.post-form-overlay {
  width: 100%; max-width: none; box-sizing: border-box;
  padding: 1rem;
  background: #3d3d3d; border-radius: 12px; border: 1px solid #333333;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08); overflow: hidden;
  margin-bottom: 2rem;
}
.post-form { margin: 0; }
.post-form textarea { width: 100%; padding: 0.75rem; font-size: 1rem; border: 1px solid #555; border-radius: 8px; min-height: 100px; resize: vertical; font-family: inherit; box-sizing: border-box; background: #333; color: #ddd; }
.post-form textarea:focus { outline: none; border-color: #2563eb; }
.post-form textarea::placeholder { color: #888; }
.post-form-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; flex-wrap: wrap; }
.post-form-actions .btn { margin-top: 0; }
.posts-list { display: flex; flex-direction: column; gap: 1rem; }
.posts-empty-overlay {
  width: 100%; max-width: none; box-sizing: border-box;
  padding: 1.25rem;
  background: #3d3d3d; border-radius: 12px; border: 1px solid #333333;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08); overflow: hidden;
  color: #dddddd; margin: 0;
}
.post-card { background: rgba(20, 20, 20, 0.85); border-radius: 12px; padding: 1.25rem; box-shadow: 0 2px 12px rgba(0,0,0,0.08); border: 1px solid #333333; }
.post-card .post-header { display: flex; align-items: flex-start; gap: 1rem; }
.post-avatar { flex-shrink: 0; width: 48px; height: 48px; border-radius: 50%; background: #2563eb; color: #fff; font-size: 1.1rem; font-weight: 600; display: flex; align-items: center; justify-content: center; cursor: default; position: relative; }
.post-avatar[title] { cursor: help; }
.post-avatar-clickable { cursor: pointer; }
.post-body { flex: 1; min-width: 0; }
.post-card .post-content { font-size: 1rem; color: #dddddd; line-height: 1.5; white-space: pre-wrap; }
.post-like-row { margin-top: 0.5rem; }
.like-btn { display: inline-flex; align-items: center; gap: 0.35rem; background: none; border: none; padding: 0.25rem 0; font-size: 0.9rem; color: #93c5fd; cursor: pointer; font-family: inherit; font-weight: 500; }
.like-btn:hover { opacity: 0.9; }
.like-btn .like-icon { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.like-btn.liked { color: #f472b6; }
.like-btn.liked .like-icon { fill: currentColor; stroke: currentColor; }
.like-count-only { font-size: 0.85rem; color: #94a3b8; }
.post-comments { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid #555; margin-left: 64px; }
.post-comments-title { font-size: 0.9rem; font-weight: 600; color: #dddddd; margin-bottom: 0.75rem; }
.post-comments-title-with-margin { margin-top: 1rem; }
.members-modal-msg { color: #94a3b8; margin: 0; }
.members-modal-err { color: #ef4444; margin: 0; }
.comment-item { display: flex; align-items: flex-start; gap: 0.75rem; margin-bottom: 0.75rem; }
.comment-item .post-avatar { width: 36px; height: 36px; font-size: 0.85rem; }
.comment-item .comment-body { flex: 1; }
.comment-item .comment-meta { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; font-size: 0.8rem; color: #aaaaaa; margin-bottom: 0.25rem; }
.comment-delete-btn { background: none; border: none; padding: 0.2rem; cursor: pointer; color: #888; display: flex; align-items: center; line-height: 1; }
.comment-delete-btn:hover { color: #e11d48; }
.comment-delete-btn.disabled { cursor: default; opacity: 0.5; }
.comment-delete-btn.disabled:hover { color: #888; }
.post-delete-btn { background: none; border: none; padding: 0.2rem; cursor: pointer; color: #888; display: flex; align-items: center; line-height: 1; }
.post-delete-btn:hover { color: #e11d48; }
.report-btn { background: none; border: none; padding: 0.2rem; cursor: pointer; color: #888; display: flex; align-items: center; line-height: 1; }
.report-btn:hover { color: #f59e0b; }
.post-delete-btn.disabled { cursor: not-allowed; opacity: 0.5; color: #666; }
.post-delete-btn.disabled:hover { color: #666; }
.post-meta { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; font-size: 0.85rem; color: #dddddd; margin-bottom: 0.25rem; }
.comment-item .comment-content { font-size: 0.95rem; color: #dddddd; line-height: 1.45; white-space: pre-wrap; }
.comment-item .comment-like-row { margin-top: 0.35rem; }
.add-comment-link { display: inline-block; text-decoration: none; font-size: 0.9rem; font-weight: 600; cursor: pointer; margin-bottom: 0.5rem; }
.add-comment-link:hover { text-decoration: none; }
.add-comment-link.btn { color: #fff; border: none; padding: 0.4rem 0.85rem; border-radius: 6px; }
.add-comment-link.btn.btn-primary { border: 1px solid var(--btn-teal-border); }
.comment-form { margin-top: 0.75rem; display: none; gap: 0.75rem; align-items: flex-start; }
.comment-form.visible { display: flex; }
.comment-form textarea { flex: 1; min-width: 0; max-width: 740px; padding: 0.5rem 0.75rem; font-size: 0.95rem; border: 1px solid #555; border-radius: 8px; min-height: 60px; resize: vertical; font-family: inherit; box-sizing: border-box; background: #333; color: #ddd; }
.comment-form textarea:focus { outline: none; border-color: #2563eb; }
.comment-form textarea::placeholder { color: #888; }
.comment-form .comment-form-actions { display: flex; gap: 0.75rem; flex-shrink: 0; }
.comment-form .btn { flex-shrink: 0; }
@media (max-width: 600px) {
  .comment-form.visible { flex-direction: column; }
  .comment-form textarea { max-width: none; width: 100%; }
  .comment-form .comment-form-actions { width: 100%; }
}
.login-prompt { background: #444444; padding: 1rem; border-radius: 8px; margin-bottom: 2rem; color: #dddddd; border: 1px solid #333333; }
.login-prompt a { color: #00aaaa; }
.join-prompt {
  background: rgba(0, 0, 0, 0.8);
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #dddddd;
  margin-bottom: 2rem;
}
.join-to-see-posts-msg { color: rgba(255, 255, 255, 0.9); margin: 0; }
.member-badge { font-size: 0.8rem; color: #34d399; font-weight: 500; }
.member-badge.member-badge-clickable { cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.member-badge.member-badge-clickable:hover { color: #6ee7b7; }
.members-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 1rem; box-sizing: border-box; }
.members-modal { background: rgba(33, 33, 33, 1); border-radius: 12px; border: 1px solid #333333; box-shadow: 0 4px 24px rgba(0,0,0,0.3); max-width: 400px; width: 100%; max-height: 80vh; overflow: hidden; display: flex; flex-direction: column; }
.members-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid #555; }
.members-modal-title { margin: 0; font-size: 1.1rem; font-weight: 600; color: #fff; }
.members-modal-close { background: none; border: none; color: #94a3b8; cursor: pointer; padding: 0.25rem; font-size: 1.5rem; line-height: 1; }
.members-modal-close:hover { color: #fff; }
.members-modal-list { overflow: auto; padding: 0.75rem 1.25rem; }
.members-modal-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.members-modal-item:last-child { border-bottom: none; }
.members-modal-item .post-avatar { width: 40px; height: 40px; font-size: 0.9rem; flex-shrink: 0; }
.members-modal-item .member-name { font-size: 1rem; color: #dddddd; margin: 0; }
.profile-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 1rem; box-sizing: border-box; }
.profile-modal { background: rgba(33, 33, 33, 1); border-radius: 12px; border: 1px solid #333333; box-shadow: 0 4px 24px rgba(0,0,0,0.3); max-width: 400px; width: 100%; overflow: hidden; display: flex; flex-direction: column; }
.profile-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid #555; gap: 0.75rem; }
.profile-modal-title-row { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.profile-modal-title-row .post-avatar { width: 40px; height: 40px; font-size: 0.9rem; flex-shrink: 0; }
.profile-modal-name { margin: 0; font-size: 1.1rem; font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-modal-close { background: none; border: none; color: #94a3b8; cursor: pointer; padding: 0.25rem; font-size: 1.5rem; line-height: 1; flex-shrink: 0; }
.profile-modal-close:hover { color: #fff; }
.profile-modal-body { padding: 1rem 1.25rem; }
.profile-modal-line { margin: 0; font-size: 1rem; color: #fff; }
.profile-modal-line + .profile-modal-line { margin-top: 0.5rem; }
.profile-modal-value { color: #aaaaaa; }
.hero-overlay-group { text-align: left; display: flex; flex-direction: column; gap: 0.75rem; }
.hero-overlay-group-nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.hero-overlay-group-nav .back-link { margin: 0; }
.hero-overlay-group-nav .group-actions { margin: 0; flex-shrink: 0; }
#create-post-hero-wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; width: 100%; }
#create-post-hero-wrap .hero-actions-right { margin-left: auto; }
.hero-overlay-group h1 { margin: 0; }
.hero-overlay-group .lead { margin: 0; color: rgba(255,255,255,0.95); width: 100%; max-width: none; margin-left: 0; margin-right: 0; }
.hero-overlay-group .member-badge { display: inline-block; }
#create-post-hero-wrap { margin-top: 0.5rem; }

/* --- messages --- */
body.page-messages .hero-overlay h1 { text-align: left; }
.messages-layout {
  display: flex;
  gap: 1rem;
  min-height: 420px;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 12px;
  border: 1px solid #333333;
  overflow: hidden;
}
@media (max-width: 768px) {
  .messages-layout { flex-direction: column; min-height: 0; }
}
.messages-conversations {
  width: 280px;
  min-width: 280px;
  border-right: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
}
@media (max-width: 768px) {
  .messages-conversations { width: 100%; min-width: 0; border-right: none; border-bottom: 1px solid rgba(255,255,255,0.1); max-height: 240px; }
}
.messages-conversations-list { flex: 1; overflow-y: auto; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.conversation-row { flex-shrink: 0; }
.conversation-title-wrap {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
  color: #dddddd;
  transition: background 0.15s;
}
.conversation-title-wrap:hover { background: rgba(255,255,255,0.06); }
.conversation-row.conversation-row--expanded .conversation-title-wrap { border-bottom: 1px solid rgba(255,255,255,0.08); background: rgba(0, 170, 170, 0.15); }
.conversation-row:not(.conversation-row--expanded) .conversation-title-wrap { border-bottom: 1px solid rgba(255,255,255,0.06); }
.conversation-chevron-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.7);
}
.conversation-chevron { transition: transform 0.2s ease; }
.conversation-row.conversation-row--collapsed .conversation-chevron { transform: rotate(-90deg); }
.conversation-row.conversation-row--collapsed .conversation-title-wrap { border-bottom: none; }
.conversation-item-content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.conversation-item-content.unread { font-weight: 600; }
.conversation-row.conversation-row--expanded .conversation-title-wrap { border-left: 3px solid #00aaaa; }
@media (max-width: 768px) {
  .messages-thread.in-conversations-list { flex: 1 1 auto; min-height: 280px; }
  .messages-conversations:has(.messages-thread.in-conversations-list) { max-height: none; flex: 1; min-height: 0; }
}
.conversation-name { font-size: 0.95rem; color: #fff; margin-bottom: 0.2rem; }
.conversation-preview { font-size: 0.85rem; color: #aaaaaa; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conversation-meta { font-size: 0.75rem; color: #888; margin-top: 0.25rem; display: flex; justify-content: space-between; align-items: center; }
.conversation-unread { background: #00aaaa; color: #fff; font-size: 0.7rem; padding: 0.1rem 0.4rem; border-radius: 10px; }
.messages-thread {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: rgba(0, 0, 0, 0.4);
}
#thread-active { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.messages-thread-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  font-weight: 600;
  background: rgba(0,0,0,0.2);
}
.messages-thread-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.message-bubble {
  max-width: 85%;
  padding: 0.6rem 0.9rem;
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.4;
  position: relative;
}
.message-bubble.sent { align-self: flex-end; background: #00aaaa; color: #fff; border-bottom-right-radius: 4px; }
.message-bubble.received { align-self: flex-start; background: rgba(68, 68, 68, 0.9); color: #ddd; border: 1px solid rgba(255,255,255,0.1); border-bottom-left-radius: 4px; }
.message-bubble .message-listing-ref { font-size: 0.8rem; margin-top: 0.35rem; }
.message-bubble .message-listing-ref a { color: #93c5fd; }
.message-meta { font-size: 0.75rem; color: rgba(255,255,255,0.7); margin-top: 0.25rem; }
.message-delete {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  background: rgba(0,0,0,0.2);
  color: #fff;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
}
.message-delete:hover { opacity: 1; background: rgba(248, 113, 113, 0.4); }
.messages-thread-input-wrap {
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.2);
}
.messages-thread-input-wrap form { display: flex; gap: 0.5rem; }
.messages-thread-input-wrap input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid #555;
  border-radius: 8px;
  background: #333;
  color: #fff;
  font-size: 1rem;
}
.messages-thread-input-wrap button {
  padding: 0.5rem 1rem;
  background: var(--btn-teal-bg);
  color: #fff;
  border: 1px solid var(--btn-teal-border);
  box-shadow: var(--btn-teal-shadow);
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: filter 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.messages-thread-input-wrap button:hover {
  filter: brightness(1.08);
  border-color: var(--btn-teal-border-hover);
  transform: translateY(-1px);
  background: var(--btn-teal-bg);
}
.messages-loading { color: #dddddd; padding: 2rem; text-align: center; }
.messages-empty-conversations { color: #888; padding: 1.5rem; text-align: center; }
.auth-required { text-align: center; padding: 3rem 2rem; color: #dddddd; }
.auth-required a { color: #00aaaa; }

/* ============================================
   Utility: visibility (no inline style for CSP)
   ============================================ */
.hidden { display: none !important; }

/* Profile role line when visible */
.profile-role { margin: 0 0 1.25rem; font-size: 0.9rem; color: #ffffff; }

/* Hint that should be block with spacing (e.g. add-business categories) */
.hint-block { display: block; margin-bottom: 0.5rem; }
.image-preview:not(.hidden) { display: flex; }
.sort-bar-overlay:not(.hidden) { display: inline-block; }
#create-post-hero-wrap:not(.hidden) { display: flex; }
.member-badge:not(.hidden) { display: inline; }
.hero-overlay-btn:not(.hidden) { display: inline-flex; }
.groups-grid:not(.hidden) { display: flex; }
.marketplace-controls-row:not(.hidden) { display: flex; }
/* listings-grid: do not force display here — marketplace uses .listings-grid--marketplace { display: grid } */

/* Login: complete-oauth section (no inline styles) */
#complete-oauth-lead { margin: 0 0 1rem; color: rgba(255,255,255,0.9); }
.login-oauth-email { margin-bottom: 0.75rem; font-size: 0.9rem; color: #aaa; }
#complete-oauth-section .profile-avatar-label { margin-top: 0.5rem; }
#complete-oauth-section .login-action-strip { margin-top: 1rem; }

/* ============================================
   Messages (messages.html) — dark glass UI
   ============================================ */
body.page-messages2 {
  background: #0f1218;
}

.page-messages2 .messages2-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Hero uses shared .hero + .hero-overlay-messages2 glass panel (see listing pages hero block above) */
body.page-messages2 .messages2-heading-text {
  flex: 1;
  min-width: min(100%, 14rem);
}

body.page-messages2 .hero-overlay-messages2 .messages2-title {
  margin: 0;
}

body.page-messages2 .hero-overlay-messages2 .messages2-sub.lead {
  margin: 0.4rem 0 0;
  font-size: 0.95rem;
  color: rgba(226, 232, 240, 0.78);
  max-width: 40ch;
}

.messages2-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  color: #f1f5f9;
  background: var(--btn-teal-bg);
  border: 1px solid var(--btn-teal-border);
  box-shadow: var(--btn-teal-shadow);
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.15s ease, transform 0.15s ease;
}

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

.messages2-btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
}

.messages2-btn-small {
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
}

.messages2-body-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0 0 2rem;
}

@media (min-width: 901px) {
  body.page-messages2 .messages2-body-section {
    padding-bottom: 1rem;
  }
}

.messages2-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-width: 1200px;
}

.messages2-hint {
  color: #fbbf24;
  padding: 1rem 0;
  font-size: 0.95rem;
}

.messages2-gate {
  text-align: center;
  padding: 3rem 1.5rem;
  color: #cbd5e1;
}

.messages2-gate a {
  margin-top: 1rem;
}

.messages2-app {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.messages2-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  gap: 0;
  align-items: stretch;
  flex: 1;
  /* Shorter than before so desktop/tablet can see footer without scrolling */
  min-height: min(52vh, 520px);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(127, 212, 212, 0.14);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  background: rgba(15, 18, 24, 0.92);
}

@supports (backdrop-filter: blur(1px)) {
  .messages2-layout {
    backdrop-filter: blur(12px) saturate(1.1);
  }
}

.messages2-sidebar {
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.25);
  min-height: 0;
}

.messages2-sidebar-head {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.messages2-sidebar-head-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.messages2-sidebar-head-tools {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
  justify-content: flex-end;
}

.messages2-icon-btn.messages2-icon-btn--plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}

.messages2-icon-btn--plus .messages2-icon-plus {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1;
  transform: translate(0.5px, -0.5px);
}

.messages2-sidebar-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(127, 212, 212, 0.75);
  flex-shrink: 0;
}

.messages2-conv-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.35rem;
}

.messages2-conv-empty {
  padding: 1rem;
  font-size: 0.88rem;
  color: #94a3b8;
  line-height: 1.45;
}

.messages2-conv-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.15rem;
  width: 100%;
  margin-bottom: 0.25rem;
  border-radius: 10px;
  transition: background 0.12s ease;
}

.messages2-conv-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

.messages2-conv-row.is-active {
  background: rgba(0, 168, 168, 0.18);
  outline: 1px solid rgba(127, 212, 212, 0.25);
}

.messages2-conv-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  flex: 1;
  min-width: 0;
  text-align: left;
  padding: 0.65rem 0.35rem 0.65rem 0.75rem;
  margin: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #e2e8f0;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s ease;
}

.messages2-conv-more-wrap {
  flex-shrink: 0;
  padding: 0.45rem 0.35rem 0 0;
}

.messages2-conv-more-btn.messages2-icon-btn {
  width: 2rem;
  height: 2rem;
  font-size: 1.15rem;
  line-height: 1;
  padding: 0;
}

.messages2-conv-name-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  width: 100%;
}

.messages2-conv-name {
  font-weight: 600;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.messages2-unread-badge {
  font-size: 0.68rem;
  font-weight: 700;
  background: #0ea5e9;
  color: #fff;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
}

.messages2-conv-blocked {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  flex-shrink: 0;
  margin-left: 0.1rem;
  padding: 0.1rem 0.45rem 0.1rem 0.35rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.14);
  border: 1px solid rgba(248, 113, 113, 0.4);
}

.messages2-conv-blocked-icon {
  flex-shrink: 0;
  display: block;
  opacity: 0.95;
}

.messages2-conv-blocked-text {
  line-height: 1;
}

.messages2-conv-preview {
  font-size: 0.78rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.messages2-thread {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  flex: 1;
}

.messages2-thread-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.messages2-empty-card {
  text-align: center;
  max-width: 22rem;
  color: #94a3b8;
}

.messages2-empty-title {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  color: #e2e8f0;
}

.messages2-empty-text {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: #94a3b8;
}

.messages2-thread-active {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.messages2-thread-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.messages2-back-mobile {
  display: none;
  flex-shrink: 0;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 8px;
  font-size: 1.1rem;
  cursor: pointer;
  align-self: center;
}

.messages2-thread-header-text {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
}

.messages2-thread-title {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.35;
  color: #f8fafc;
}

.messages2-thread-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.messages2-icon-btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 12, 20, 0.5);
  color: #e2e8f0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.messages2-more-wrap {
  position: relative;
}

.messages2-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.35rem;
  min-width: 11rem;
  background: #1a2230;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 20;
  padding: 0.35rem;
}

.messages2-dropdown--floating {
  position: fixed;
  top: 0;
  left: 0;
  right: auto;
  margin-top: 0;
  z-index: 12050;
}

.messages2-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.65rem;
  border: none;
  background: transparent;
  color: #e2e8f0;
  font-family: inherit;
  font-size: 0.88rem;
  border-radius: 6px;
  cursor: pointer;
}

.messages2-dropdown button:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Conversation list ⋯ menu — title case in HTML */
.messages2-conv-more-menu.messages2-dropdown button.messages2-conv-more-link {
  font-weight: 500;
}

@media (max-width: 900px) {
  .messages2-conv-more-menu.messages2-dropdown {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0.5rem;
    min-width: 12.5rem;
  }

  .messages2-conv-more-menu.messages2-dropdown button.messages2-conv-more-link {
    text-decoration: none;
    text-align: center;
    width: 100%;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #f1f5f9;
    border: 1px solid var(--btn-teal-border);
    background: var(--btn-teal-bg);
    box-shadow: var(--btn-teal-shadow);
  }

  .messages2-conv-more-menu.messages2-dropdown button.messages2-conv-more-link:hover {
    color: #fff;
    filter: brightness(1.08);
    border-color: var(--btn-teal-border-hover);
    background: var(--btn-teal-bg);
  }

  .messages2-conv-more-menu.messages2-dropdown button.messages2-conv-more-link:active {
    transform: scale(0.98);
  }
}

.messages2-banner {
  padding: 0.55rem 0.85rem;
  font-size: 0.86rem;
}

.messages2-banner--warn {
  background: rgba(180, 83, 9, 0.25);
  color: #fde68a;
  border-bottom: 1px solid rgba(251, 191, 36, 0.2);
}

.messages2-banner--info {
  background: rgba(14, 165, 233, 0.12);
  color: #bae6fd;
}

.messages2-inthread-search {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  align-items: center;
}

.messages2-search-input {
  flex: 1;
  min-width: 140px;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 12, 20, 0.72);
  color: #f1f5f9;
  font-family: inherit;
  font-size: 0.88rem;
}

.messages2-search-input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.messages2-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0.85rem;
  min-height: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.15), transparent 120px);
}

.messages2-bubbles {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-width: 760px;
  margin: 0 auto;
}

/* Anchor for scroll-to-bottom (mobile / delayed layout) */
.messages2-scroll-end {
  flex-shrink: 0;
  height: 1px;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  pointer-events: none;
  visibility: hidden;
}

.messages2-msg {
  display: flex;
  flex-direction: column;
  max-width: 85%;
  transition: box-shadow 0.3s ease;
}

.messages2-msg-stack {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 100%;
}

.messages2-msg--mine .messages2-msg-stack {
  align-items: flex-end;
}

.messages2-msg--mine {
  align-self: flex-end;
  align-items: flex-end;
}

.messages2-msg--theirs {
  align-self: flex-start;
  align-items: flex-start;
}

.messages2-msg--highlight {
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.55);
  border-radius: 12px;
}

.messages2-bubble {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0.65rem 0.85rem;
  border-radius: 14px;
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
}

.messages2-msg--mine .messages2-bubble {
  background: linear-gradient(165deg, rgba(0, 148, 148, 0.35), rgba(0, 100, 100, 0.55));
  border-color: rgba(127, 212, 212, 0.25);
}

.messages2-bubble--deleted {
  font-style: italic;
  color: #94a3b8;
  font-size: 0.88rem;
}

.messages2-text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
  word-break: break-word;
}

/* Listing context: first line inside bubble, top-left, links to view-listing */
.messages2-bubble-listing {
  font-size: 0.75rem;
  line-height: 1.25;
  text-align: left;
  align-self: flex-start;
  width: 100%;
  margin: 0 0 0.4rem;
  padding: 0;
}

.messages2-listing-link {
  color: #7dd3fc;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.messages2-listing-link:hover,
.messages2-listing-link:focus-visible {
  color: #bae6fd;
  outline: none;
}

.messages2-listing-nolink {
  color: rgba(125, 211, 252, 0.85);
}

.messages2-img-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
  margin-bottom: 0.35rem;
  overflow: visible;
}

.messages2-img-wrap .messages2-msg-img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

.messages2-bubble-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
  margin-bottom: 0.25rem;
  overflow: visible;
}

/* Room for reaction controls that hang past the bottom edge */
.messages2-img-wrap--has-overlays,
.messages2-bubble-wrap.messages2-bubble-wrap--has-overlays {
  margin-bottom: 0.65rem;
  padding-bottom: 0.35rem;
}

.messages2-bubble-wrap .messages2-bubble {
  margin-bottom: 0;
}

.messages2-msg-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: #64748b;
}

.messages2-msg-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.35rem;
}

.messages2-msg--mine .messages2-msg-meta {
  flex-direction: row-reverse;
}

.messages2-msg--mine .messages2-msg-actions {
  align-items: center;
}

.messages2-msg-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 12, 20, 0.4);
  color: #94a3b8;
  border-radius: 6px;
  cursor: pointer;
  transition:
    color 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease;
}

.messages2-msg-action-btn:hover {
  color: #e2e8f0;
  background: rgba(0, 168, 168, 0.12);
  border-color: rgba(127, 212, 212, 0.35);
}

.messages2-msg-action-btn:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.65);
  outline-offset: 1px;
}

.messages2-msg-action-btn .messages2-msg-action-icon {
  display: block;
  flex-shrink: 0;
  pointer-events: none;
}

.messages2-linkish {
  border: none;
  background: none;
  color: #38bdf8;
  cursor: pointer;
  font-size: 0.72rem;
  text-decoration: underline;
  padding: 0;
  font-family: inherit;
}

/* Reaction chips — others’ reactions, bottom-right */
.messages2-reaction-summary--overlap {
  position: absolute;
  bottom: -10px;
  z-index: 2;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: 3px 8px;
  max-width: calc(100% + 12px);
  font-size: 0.68rem;
  line-height: 1.2;
  background: rgba(15, 18, 24, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.messages2-reaction-summary--overlap-right {
  right: -6px;
  left: auto;
}

.messages2-reaction-chip {
  display: inline-block;
  opacity: 0.95;
}

/* Bottom-left: + opens popover; your reaction replaces + */
.messages2-react-anchor {
  position: absolute;
  left: -6px;
  right: auto;
  bottom: -10px;
  z-index: 4;
}

.messages2-react-anchor-inner {
  position: relative;
  display: inline-block;
}

.messages2-react-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  margin: 0;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.88);
  background: rgba(8, 12, 18, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.95);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  transition: transform 0.12s ease, background 0.15s ease;
}

.messages2-react-open:hover,
.messages2-react-open:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

.messages2-react-open:active {
  transform: scale(0.96);
}

.messages2-react-plus-svg {
  display: block;
  flex-shrink: 0;
  pointer-events: none;
}

/* Selected reaction + popover picks: same pill — frosted ring, emoji only (no coloured fill behind) */
.messages2-react-mine,
.messages2-react-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 1.75rem;
  height: 1.75rem;
  padding: 0 0.25rem;
  margin: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(15, 18, 24, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  transition: transform 0.12s ease, filter 0.15s ease;
}

.messages2-react-mine:hover,
.messages2-react-mine:focus-visible,
.messages2-react-option:hover,
.messages2-react-option:focus-visible {
  filter: brightness(1.08);
  outline: none;
}

.messages2-react-mine:active,
.messages2-react-option:active {
  transform: scale(0.96);
}

.messages2-react-option-emoji {
  pointer-events: none;
  line-height: 1;
}

/* Popover with 3 choices — same emoji-in-pill look as the overlay */
.messages2-react-popover {
  position: absolute;
  left: 0;
  bottom: calc(100% + 6px);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border-radius: 12px;
  background: rgba(12, 16, 24, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
  z-index: 30;
}

.messages2-react-popover--hidden {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .messages2-react-open:active,
  .messages2-react-mine:active,
  .messages2-react-option:active {
    transform: none;
  }
}

.messages2-composer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.65rem 0.85rem;
  background: rgba(0, 0, 0, 0.35);
}

.messages2-composer-disabled {
  font-size: 0.88rem;
  color: #fbbf24;
  padding: 0.35rem 0;
}

.messages2-composer-bottom {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 0.5rem;
  width: 100%;
}

.messages2-composer-form-wrap {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.messages2-composer-icon-btn {
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.messages2-attach-label {
  cursor: pointer;
  flex-shrink: 0;
}

.messages2-attach-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 12, 20, 0.5);
  color: #e2e8f0;
  line-height: 0;
  box-sizing: border-box;
}

.messages2-attach-emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 1.12rem;
  line-height: 1;
  /* Camera emoji sits low/left in most fonts — nudge for optical center */
  transform: translate(1px, -2px);
}

.messages2-input {
  flex: 1;
  min-height: 2.5rem;
  max-height: 8rem;
  resize: vertical;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 12, 20, 0.85);
  color: #f1f5f9;
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.4;
}

.messages2-send-btn {
  flex-shrink: 0;
  box-sizing: border-box;
  height: 2.5rem;
  padding: 0 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 0.88rem;
  border-radius: 12px;
  border: 1px solid var(--btn-teal-border);
  background: var(--btn-teal-bg);
  box-shadow: var(--btn-teal-shadow);
  color: #fff;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: filter 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.messages2-send-btn:hover:not(:disabled) {
  filter: brightness(1.08);
  border-color: var(--btn-teal-border-hover);
  transform: translateY(-1px);
  background: var(--btn-teal-bg);
}

/* Modals */
.messages2-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.messages2-modal.hidden {
  display: none !important;
}

.messages2-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}

.messages2-modal-panel {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow: auto;
  background: #151b26;
  border: 1px solid rgba(127, 212, 212, 0.2);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.messages2-modal-panel--narrow {
  max-width: 380px;
}

.messages2-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.messages2-modal-head h2 {
  margin: 0;
  font-size: 1.15rem;
  color: #f1f5f9;
}

.messages2-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  font-size: 1.35rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.messages2-modal-lead {
  font-size: 0.88rem;
  color: #94a3b8;
  margin: 0 0 1rem;
  line-height: 1.45;
}

.messages2-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(127, 212, 212, 0.8);
  margin-bottom: 0.35rem;
}

.messages2-modal-input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 12, 20, 0.9);
  color: #f1f5f9;
  font-family: inherit;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.messages2-user-results {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 240px;
  overflow-y: auto;
}

.messages2-user-pick {
  width: 100%;
  text-align: left;
  padding: 0.6rem 0.75rem;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  margin-bottom: 0.35rem;
}

.messages2-user-pick:hover {
  background: rgba(0, 168, 168, 0.2);
}

.messages2-user-empty {
  font-size: 0.85rem;
  color: #94a3b8;
  padding: 0.5rem 0;
}

.messages2-modal-textarea {
  width: 100%;
  min-height: 6rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 12, 20, 0.9);
  color: #f1f5f9;
  font-family: inherit;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  resize: vertical;
}

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

.messages2-btn.messages2-btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-weight: 600;
}

.messages2-btn.messages2-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #f1f5f9;
  filter: none;
}

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

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

  /* Conversation list only: no forced tall panel — removes black void below listings */
  .messages2-layout:not(.messages2-layout--thread-open) {
    min-height: 0;
    align-items: start;
  }

  .messages2-layout:not(.messages2-layout--thread-open) .messages2-sidebar {
    align-self: start;
    min-height: 0;
    width: 100%;
  }

  .messages2-layout:not(.messages2-layout--thread-open) .messages2-conv-list {
    flex: 0 1 auto;
    max-height: min(45vh, 360px);
    overflow-y: auto;
  }

  .messages2-layout:not(.messages2-layout--thread-open) .messages2-thread {
    align-self: start;
    min-height: 0;
    width: 100%;
  }

  /* Compact “Select a conversation” — not a huge grey slab */
  .messages2-layout:not(.messages2-layout--thread-open) .messages2-thread-empty {
    flex: 0 0 auto;
    padding: 0.75rem 0.85rem 1rem;
    align-items: center;
    justify-content: center;
  }

  .messages2-layout:not(.messages2-layout--thread-open) .messages2-empty-card {
    max-width: 100%;
  }

  .messages2-layout:not(.messages2-layout--thread-open) .messages2-empty-title {
    font-size: 0.9rem;
    margin: 0 0 0.35rem;
  }

  .messages2-layout:not(.messages2-layout--thread-open) .messages2-empty-text {
    font-size: 0.78rem;
    line-height: 1.35;
  }

  /* Thread open: height follows content (short threads stay compact); cap scroll area for long threads */
  .messages2-layout.messages2-layout--thread-open {
    min-height: 0;
    flex: 0 1 auto;
    align-items: stretch;
  }

  .messages2-layout--thread-open .messages2-sidebar {
    display: none;
  }

  .messages2-layout--thread-open .messages2-thread {
    align-self: stretch;
    width: 100%;
    min-height: 0;
  }

  .messages2-layout--thread-open .messages2-thread-active {
    flex: 0 1 auto;
    min-height: 0;
  }

  .messages2-layout--thread-open .messages2-scroll {
    flex: 0 1 auto;
    min-height: 0;
    /* Grow with messages until this cap, then scroll inside */
    max-height: min(72vh, calc(100dvh - 200px));
  }

  @supports not (height: 100dvh) {
    .messages2-layout--thread-open .messages2-scroll {
      max-height: min(72vh, calc(100vh - 200px));
    }
  }

  .messages2-layout--thread-open .messages2-composer {
    flex: 0 0 auto;
  }

  .messages2-back-mobile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  body.page-messages2 .messages2-heading-row {
    flex-direction: column;
    align-items: stretch;
  }

  .messages2-msg {
    max-width: 92%;
  }
}

/* <select> chevrons: base rule near top (`select:not([multiple])`). Hero / glass / contact / admin-modal use full `background` layers; other selects use `background-color` so the base chevron shows. */
