/* ========== CSS Variables - Matte Black Theme ========== */
:root {
  --black: #000000;
  --black-bar: #0a0a0a;
  --matte-black: #171717;
  --matte-black-alt: #1a1a1a;
  --matte-black-light: #28282b;
  --surface: #222222;
  --surface-elevated: #2a2a2a;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f5f5f5;
  --text-muted: #a3a3a3;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --fillet: 8px;
  --fillet-sm: 6px;
  --fillet-lg: 12px;
  --shadow-morph: 0 2px 4px rgba(0, 0, 0, 0.3),
    0 8px 16px rgba(0, 0, 0, 0.45),
    0 16px 32px rgba(0, 2, 8, 0.5),
    0 32px 64px rgba(0, 5, 15, 0.55);
  --shadow-morph-hover: 0 4px 8px rgba(0, 0, 0, 0.35),
    0 12px 24px rgba(0, 0, 0, 0.5),
    0 24px 48px rgba(0, 2, 8, 0.55),
    0 48px 96px rgba(0, 5, 20, 0.6);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--matte-black);
  color: var(--text);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}

.top-bar {
  flex-shrink: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: var(--black-bar);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.logo span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text);
}

.auth-buttons {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.btn {
  padding: 0.5rem 1.25rem;
  border-radius: var(--fillet);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-block;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: var(--shadow-morph);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: var(--shadow-morph-hover);
  transform: translateY(-1px);
}

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
  box-shadow: var(--shadow-morph);
}

.btn-ghost:hover {
  background: var(--surface-elevated);
  box-shadow: var(--shadow-morph-hover);
  border-color: rgba(255, 255, 255, 0.12);
}

/* ========== Theme Toggle ========== */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--fillet-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  background: var(--surface-elevated);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.12);
}

.theme-toggle-label {
  transition: opacity 0.2s;
}

.theme-toggle-dark {
  display: inline;
}

.theme-toggle-light {
  display: none;
}

body.light-mode .theme-toggle-dark {
  display: none;
}

body.light-mode .theme-toggle-light {
  display: inline;
}

.auth-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ========== Light Mode ========== */
body.light-mode {
  background: #f5f5f5;
}

body.light-mode .top-bar {
  background: #ffffff;
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .logo {
  color: #171717;
}

body.light-mode .nav-links a {
  color: #737373;
}

body.light-mode .nav-links a:hover {
  color: #171717;
}

body.light-mode .theme-toggle {
  background: #f5f5f5;
  border-color: rgba(0, 0, 0, 0.08);
  color: #525252;
}

body.light-mode .theme-toggle:hover {
  background: #e5e5e5;
  color: #171717;
}

body.light-mode .map-container {
  background: #f5f5f5;
}

/* ========== Main Content ========== */
.main-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: row;
}

/* ========== Map Container ========== */
.map-container {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 70%;
  background: var(--matte-black);
  padding: 1% 0 1% 1%;
  display: flex;
  border-radius: 5%;
}

/* ========== Sidebar ========== */
.sidebar {
  width: 30%;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  background: var(--matte-black);
}

.sidebar-add-btn {
  width: 100%;
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
  border-radius: var(--fillet-lg);
  flex-shrink: 0;
}

.sidebar-panel {
  border-radius: var(--fillet-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sidebar-nearby {
  flex: 7;
  min-height: 0;
}

.sidebar-newest {
  flex: 3;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: flex 0.35s ease-out, height 0.35s ease-out;
}
.sidebar-newest.showing-bathroom-detail {
  flex: 0 0 60vh;
  min-height: 60vh;
  transition: flex 0.35s ease-out, height 0.35s ease-out;

}

.newest-feed-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.5rem;
}
.sidebar-newest.showing-bathroom-detail .newest-feed-list {
  display: none;
}

.bathroom-detail-list {
  display: none;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.5rem 1rem 1rem;
}
.bathroom-detail-list[aria-hidden="false"] {
  display: block;
}
.sidebar-newest.showing-bathroom-detail .bathroom-detail-list {
  display: block;
}

.bathroom-detail-list-inner {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.bathroom-detail-floor-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary, #94a3b8);
  margin: 0.5rem 0 0.25rem;
  padding: 0;
}
.bathroom-detail-floor-title:first-child {
  margin-top: 0;
}

.sidebar-dev {
  display: none;
}

.dev-mode-page {
  display: none;
  min-height: 100vh;
  background: var(--matte-black, #0f0f0f);
  padding: 1.5rem;
  overflow-y: auto;
}
body.dev-mode-active .main-content {
  display: none !important;
}
body.dev-mode-active .dev-mode-page {
  display: block;
}

/* ========== Mobile: single column, map on top ========== */
@media (max-width: 768px) {
  .main-content {
    flex-direction: column;
    overflow-y: auto;
    min-height: 0;
  }

  .map-container {
    width: 100%;
    flex: 0 0 auto;
    min-height: 45vh;
    max-height: 55vh;
    padding: 0.75rem 0.75rem 0 0.75rem;
    border-radius: 0;
  }

  .sidebar {
    width: 100%;
    min-width: unset;
    flex: 0 0 auto;
    padding: 0.75rem 1rem 1rem;
    border-radius: 0;
  }

  .sidebar-add-btn {
    flex-shrink: 0;
  }

  .sidebar-nearby,
  .sidebar-newest {
    flex: 0 0 auto;
    min-height: 0;
  }

  .sidebar-newest.showing-bathroom-detail {
    flex: 0 0 auto;
    min-height: 50vh;
  }

  .map-search-row {
    width: min(92%, 300px);
    transform: translateX(-50%);
  }

  .map-search-row:hover,
  .map-search-row:focus-within {
    transform: translateX(-50%);
  }

  .map-search {
    width: 100%;
    max-width: none;
    padding: 0.5rem 0.75rem 0.5rem 1rem;
  }

  .map-filter-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }
}

.dev-mode-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.dev-mode-section {
  background: var(--surface, #1a1a1a);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
}

.dev-mode-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.dev-mode-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}

.dev-mode-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 2rem;
}

.dev-mode-loading,
.dev-mode-empty {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0.5rem 0 0;
}

.dev-search-wrap {
  margin-bottom: 0.75rem;
  min-height: 42px;
}
.dev-search-wrap gmp-place-autocomplete {
  width: 100%;
  display: block;
}

.dev-mode-card-wrap {
  position: relative;
}

.dev-mode-trash {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 6px;
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.dev-mode-trash:hover {
  background: rgba(248, 113, 113, 0.3);
  color: #fca5a5;
}
.dev-mode-trash:focus-visible {
  outline: 2px solid #f87171;
  outline-offset: 2px;
}

body.dev-mode-active .sidebar-dev {
  display: none;
}
.sidebar-dev .sidebar-panel-title {
  margin: 0;
}
.sidebar-dev .btn {
  margin: 1rem 1.25rem;
  align-self: flex-start;
}

.sidebar-panel-title {
  padding: 1rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  margin: 0;
}

.nearby-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.5rem;
}

.nearby-loading {
  padding: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

.nearby-empty {
  padding: 1.25rem 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0;
  text-align: center;
}

.nearby-empty strong {
  color: var(--accent);
}

.nearby-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nearby-item {
  padding: 0.85rem 1rem;
  border-radius: var(--fillet);
  background: var(--matte-black);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: left;
  user-select: none;
}

.nearby-item:focus-visible {
  outline: 2px solid rgba(14, 165, 233, 0.55);
  outline-offset: 2px;
}

.nearby-item:hover {
  background: var(--surface-elevated);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateX(2px);
}

.nearby-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.nearby-item-gallery {
  position: relative;
  width: 100%;
  height: 140px;
  margin: 0.6rem 0;
  border-radius: var(--fillet-sm);
  overflow: hidden;
  background: var(--matte-black);
  flex-shrink: 0;
}

.nearby-item-gallery-inner {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 0;
  pointer-events: none;
}

.nearby-item-gallery-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  pointer-events: none;
}
.nearby-item-gallery-img[hidden] {
  display: none !important;
}

.nearby-item-gallery-placeholder {
  background: var(--matte-black);
  border: 1px dashed var(--border);
}

.nearby-item-gallery-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.2s;
  z-index: 2;
  pointer-events: auto;
}

.nearby-item-gallery-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

.nearby-item-gallery-prev {
  left: 0.5rem;
}

.nearby-item-gallery-next {
  right: 0.5rem;
}

.nearby-item-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin: 0;
  line-height: 1.2;
}

.nearby-item-address {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.nearby-item-meta {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.nearby-chip {
  display: inline-flex;
  align-items: center;
  height: 1.35rem;
  padding: 0 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.nearby-chip-type[data-type="male"] {
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.28);
  background: rgba(96, 165, 250, 0.12);
}
.nearby-chip-type[data-type="female"] {
  color: #f472b6;
  border-color: rgba(244, 114, 182, 0.28);
  background: rgba(244, 114, 182, 0.12);
}
.nearby-chip-type[data-type="unisex"] {
  color: var(--accent);
  border-color: rgba(14, 165, 233, 0.28);
  background: rgba(14, 165, 233, 0.12);
}
.nearby-chip-type[data-type="single"] {
  color: #a78bfa;
  border-color: rgba(167, 139, 250, 0.28);
  background: rgba(167, 139, 250, 0.12);
}

.nearby-item-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.4rem;
}

.nearby-stat {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 0.75rem;
  padding: 0.45rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
}

.nearby-stat-num {
  font-weight: 800;
  font-size: 0.9rem;
  line-height: 1;
  color: var(--text);
}

.nearby-stat-label {
  margin-top: 0.2rem;
  font-size: 0.68rem;
  line-height: 1;
  color: var(--text-muted);
}

.nearby-item-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.nearby-item-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.nearby-item-tag-label {
  font-weight: 500;
  color: inherit;
}

/* A small action button inside a clickable card */
.nearby-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 1.9rem;
  padding: 0 0.7rem;
  border-radius: 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  transition: transform 0.15s, background 0.2s, border-color 0.2s;
}

.nearby-action:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.nearby-action:active {
  transform: translateY(0);
}

body.light-mode .nearby-chip {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.65);
}

body.light-mode .nearby-stat {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .nearby-action {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.10);
  color: rgba(0, 0, 0, 0.82);
}

body.light-mode .sidebar {
  background: #f5f5f5;
}

body.light-mode .sidebar-panel {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .nearby-item {
  background: #f5f5f5;
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .nearby-item:hover {
  background: #eeeeee;
  border-color: rgba(0, 0, 0, 0.12);
}

body.light-mode .nearby-item-gallery,
body.light-mode .nearby-item-gallery-placeholder {
  background: #e5e5e5;
}

body.light-mode .nearby-item-gallery-placeholder {
  border-color: rgba(0, 0, 0, 0.15);
}

.map-wrapper {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.map-search-row {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%) scale(0.96);
  z-index: 10;
  display: flex;
  align-items: stretch;
  gap: 0;
  opacity: 0.75;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.map-search-row > * {
  pointer-events: auto;
}

.map-search-row:hover {
  opacity: 1;
  transform: translateX(-50%) scale(1.02);
}

.map-search-row:focus-within {
  opacity: 1;
  transform: translateX(-50%) scale(1.02);
}

.map-search {
  display: flex;
  align-items: center;
  width: min(90%, 420px);
  padding: 0.6rem 1rem 0.6rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--fillet-lg) 0 0 var(--fillet-lg);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.map-search-row:hover .map-search,
.map-search-row:focus-within .map-search {
  border-color: rgba(255, 255, 255, 0.12);
}

.map-search:focus-within {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4), 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.map-filter-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 var(--fillet-lg) var(--fillet-lg) 0;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.map-filter-btn:hover {
  background: var(--surface-hover, rgba(255, 255, 255, 0.06));
}

.map-filter-btn:focus-visible {
  outline: 2px solid var(--accent, #3b82f6);
  outline-offset: 2px;
}

.map-filter-btn.has-filters {
  border-color: var(--accent, #3b82f6);
  color: var(--accent, #3b82f6);
}

.map-filter-btn-icon {
  font-size: 0.85rem;
  opacity: 0.9;
}

.map-search-icon {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-right: 0.75rem;
  flex-shrink: 0;
}

/* Map search: gmp-place-autocomplete fills box, transparent, focus ring on parent only */
#mapSearchContainer gmp-place-autocomplete {
  flex: 1;
  min-width: 0;
  width: 100%;
  align-self: stretch;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  color-scheme: dark;
}

/* PlaceAutocompleteElement dropdown - dark theme to match app */
gmp-place-autocomplete::part(prediction-list) {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--fillet) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
  color: var(--text) !important;
}

gmp-place-autocomplete:focus,
gmp-basic-place-autocomplete:focus,
.place-autocomplete-card input:focus {
  outline: none !important;
  box-shadow: none !important; /* Optional: also removes any shadow */
}

input:focus {
  outline: none;
  box-shadow: none;
}

/* Address field: box styled like form inputs, PlaceAutocompleteElement inside */
.address-input-box {
  display: block;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.25);
}

#addAddressLabel gmp-place-autocomplete {
  background: transparent !important;
  border: none !important;
  color-scheme: dark;
}

.address-input-box:focus-within {
  outline: none;
}

body.light-mode .address-input-box {
  background: #f5f5f5;
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .address-input-box:focus-within {
  border-color: rgba(59, 130, 246, 0.4);
}

body.light-mode .map-search,
body.light-mode .map-filter-btn {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

body.light-mode .map-filter-btn {
  border-left: none;
}

body.light-mode .map-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 0 0 3px rgba(59, 130, 246, 0.15);
}

body.light-mode .map-filter-btn:hover {
  background: #f5f5f5;
}

body.light-mode .map-filter-btn.has-filters {
  border-color: var(--accent);
  color: var(--accent);
}

body.light-mode gmp-place-autocomplete {
  color-scheme: light;
}

body.light-mode gmp-place-autocomplete::part(prediction-list) {
  background: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12) !important;
  color: #171717 !important;
}

/* Nearby addresses dropdown (on focus) */
.nearby-addresses-dropdown {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 0.25rem;
  max-height: 220px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--fillet);
  box-shadow: var(--shadow-morph);
  z-index: 100;
}

.nearby-addresses-dropdown.visible {
  display: block;
}

#addAddressLabel {
  position: relative;
}

.nearby-address-item {
  display: block;
  width: 100%;
  padding: 0.6rem 0.85rem;
  text-align: left;
  font-size: 0.9rem;
  color: var(--text);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}

.nearby-address-item:last-child {
  border-bottom: none;
}

.nearby-address-item:hover {
  background: var(--surface-elevated);
}

.nearby-address-item:focus {
  outline: none;
  background: var(--surface-elevated);
}

.nearby-addresses-hint,
.nearby-addresses-loading {
  padding: 0.75rem 0.85rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

body.light-mode .nearby-addresses-dropdown {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .nearby-address-item {
  color: #171717;
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .nearby-address-item:hover,
body.light-mode .nearby-address-item:focus {
  background: #f5f5f5;
}

body.light-mode .nearby-addresses-hint,
body.light-mode .nearby-addresses-loading {
  color: #737373;
}

/* Places Autocomplete dropdown (legacy) */
.pac-container {
  z-index: 1100 !important;
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--fillet) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
  margin-top: 0.25rem !important;
}

.pac-item {
  color: var(--text) !important;
  padding: 0.75rem 1rem !important;
  border-top: 1px solid var(--border) !important;
}

.pac-item:first-child {
  border-top: none !important;
}

.pac-item:hover,
.pac-item-selected {
  background: var(--surface-elevated) !important;
}

.pac-item-query {
  color: var(--text) !important;
}

body.light-mode .pac-container {
  background: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12) !important;
}

body.light-mode .pac-item {
  color: #171717 !important;
  border-top-color: rgba(0, 0, 0, 0.08) !important;
}

body.light-mode .pac-item:hover,
body.light-mode .pac-item-selected {
  background: #f5f5f5 !important;
}

body.light-mode .pac-item-query {
  color: #171717 !important;
}

#map {
  width: 100%;
  flex: 1;
  min-height: 0;
  border-radius: 30px;
  pointer-events: auto;
}

/* Google Maps controls - subdued by default */
#map .gm-style-cc,
#map .gm-style-moc,
#map .gm-style-mtb,
#map .gm-style-sv,
#map .gm-style-ft,
#map .gm-style > div:not(:first-child) {
  opacity: 0.4;
  transition: opacity 0.2s;
}

#map .gm-style-cc:hover,
#map .gm-style-moc:hover,
#map .gm-style-mtb:hover,
#map .gm-style-sv:hover,
#map .gm-style-ft:hover,
#map .gm-style > div:not(:first-child):hover {
  opacity: 1;
}

/* ========== Modal ========== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal.open {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: 88vh;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  background: linear-gradient(180deg, #1c1c1e 0%, #161618 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03),
    0 32px 64px -12px rgba(0, 0, 0, 0.6),
    0 0 80px -24px rgba(59, 130, 246, 0.12);
  transform: scale(0.96);
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}

.modal-content::-webkit-scrollbar {
  display: none;
}

.modal.open .modal-content {
  transform: scale(1);
  opacity: 1;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1.5rem 1.25rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px 16px 0 0;
}

.modal-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text);
}

.modal-close {
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
  border: none;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.modal-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

/* Filter overlay – over map only, no full-screen blur */
.filter-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.filter-overlay.open {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

#devPasscodeOverlay {
  position: fixed;
  inset: 0;
  z-index: 1001;
}

#devPasscodeOverlay .filter-overlay-backdrop {
  background: rgba(0, 0, 0, 0.5);
}

.dev-passcode-hint {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.dev-passcode-label {
  display: block;
  margin-bottom: 0.5rem;
}

.dev-passcode-input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: var(--surface, #1e1e22);
  border: 1px solid var(--border, rgba(255,255,255,0.12));
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}

.dev-passcode-input:focus {
  outline: none;
  border-color: var(--accent, #3b82f6);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.dev-passcode-error {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: #f87171;
}

body.light-mode .dev-passcode-input {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.15);
}

.filter-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.filter-overlay .filter-modal-content {
  position: relative;
  width: 100%;
  max-width: 380px;
  max-height: 85vh;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  background: linear-gradient(180deg, #1c1c1e 0%, #161618 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  transform: scale(0.96);
  transition: transform 0.2s ease;
}

.filter-overlay.open .filter-modal-content {
  transform: scale(1);
}

.filter-overlay .filter-modal-content::-webkit-scrollbar {
  display: none;
}

.filter-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px 14px 0 0;
}

.filter-modal-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.filter-modal-close {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}

.filter-modal-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
}

.filter-modal-body {
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.filter-fieldset {
  border: none;
  margin: 0;
  padding: 0;
}

.filter-legend {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 0.5rem;
  padding: 0;
}

.filter-checkgroup {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.filter-check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: var(--text);
  cursor: pointer;
}

.filter-check input {
  position: absolute;
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.filter-checkbox {
  position: relative;
  flex-shrink: 0;
  width: 1.125rem;
  height: 1.125rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s, background 0.2s;
}

.filter-check:hover .filter-checkbox {
  border-color: rgba(255, 255, 255, 0.5);
}

.filter-check input:focus-visible + .filter-checkbox {
  outline: 2px solid var(--accent, #3b82f6);
  outline-offset: 2px;
}

.filter-check input:checked + .filter-checkbox {
  background: var(--accent, #3b82f6);
  border-color: var(--accent, #3b82f6);
}

.filter-check input:checked + .filter-checkbox::after {
  content: '';
  position: absolute;
  display: block;
  left: 0.28rem;
  top: 0.06rem;
  width: 0.35rem;
  height: 0.6rem;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

body.light-mode .filter-checkbox {
  border-color: rgba(0, 0, 0, 0.25);
  background: rgba(0, 0, 0, 0.04);
}

body.light-mode .filter-check:hover .filter-checkbox {
  border-color: rgba(0, 0, 0, 0.4);
}

body.light-mode .filter-check input:checked + .filter-checkbox {
  background: var(--accent);
  border-color: var(--accent);
}

body.light-mode .filter-overlay .filter-modal-content {
  background: linear-gradient(180deg, #fafafa 0%, #f5f5f5 100%);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

body.light-mode .filter-overlay-backdrop {
  background: rgba(0, 0, 0, 0.2);
}

body.light-mode .filter-modal-header {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .filter-modal-footer {
  border-top-color: rgba(0, 0, 0, 0.08);
}

.filter-mins {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.5rem;
}

.filter-mins label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.filter-mins input {
  padding: 0.4rem 0.5rem;
  background: var(--surface, #1e1e22);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 8px;
  color: var(--text);
  font: inherit;
}

.filter-mins input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.filter-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-form {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-form-compact {
  padding: 1.25rem 1.5rem 1.5rem;
  gap: 1rem;
}

.modal-form-compact .modal-hint {
  font-size: 0.8rem;
  color: rgba(59, 130, 246, 0.9);
  padding: 0.5rem 0.75rem;
  background: rgba(59, 130, 246, 0.08);
  border-radius: 8px;
  margin: 0 0 0.25rem;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.form-row-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
}

.form-row-4 label span {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.num-input::-webkit-outer-spin-button,
.num-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.num-input {
  appearance: textfield;
  -moz-appearance: textfield;
}

.form-section-compact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.75rem;
  padding: 1rem 0;
  margin: 0.25rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  max-width: 260px;
}

.form-section-compact .form-section-title {
  display: none;
}

.form-floor-hint {
  grid-column: 1 / -1;
  font-size: 0.5rem;
  color: var(--text-muted);
  margin: -0.35rem 0 0;
  line-height: 1.4;
}

.form-floor-hint strong {
  color: var(--text);
}

.photo-upload-area {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
}

.photo-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

#addImages {
  display: none;
}

.photo-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.photo-preview {
  position: relative;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-remove {
  position: absolute;
  top: 0;
  right: 0;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: rgba(0, 0, 0, 0.75);
  color: white;
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 0 0 0 8px;
  transition: all 0.2s ease;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}

.photo-remove:hover {
  background: #ef4444;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  align-self: flex-start;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-sm:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.12);
}

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

.checkbox-row .checkbox-custom {
  padding: 0.4rem 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.checkbox-row .checkbox-custom:hover {
  background: rgba(0, 0, 0, 0.3);
}

.checkbox-row .checkbox-custom .checkbox-label {
  font-size: 0.85rem;
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 0.75rem 1.25rem;
  border-radius: var(--fillet);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  color: var(--text);
  font-size: 0.9rem;
  z-index: 2000;
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
}

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

.toast.toast-success {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.15);
}

.toast.toast-error {
  border-color: #dc2626;
  background: rgba(220, 38, 38, 0.15);
}

.modal-hint {
  font-size: 0.9rem;
  color: var(--accent);
  margin: 0;
}

.modal-form label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.modal-form label span {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.modal-form-compact label span em {
  font-size: 0.65rem;
  opacity: 0.8;
}

.modal-form input[type="text"],
.modal-form input[type="number"],
.modal-form input[type="file"],
.modal-form select,
.modal-form textarea {
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-size: 0.9rem;
  transition: border-color 0.2s, background 0.2s;
}

.modal-form input[type="text"]:focus,
.modal-form input[type="number"]:focus,
.modal-form select:focus,
.modal-form textarea:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(0, 0, 0, 0.35);
}

.modal-form select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 7.5L2 3.5h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2rem;
}

.modal-form input[type="number"] {
  width: 100%;
}

.modal-form textarea {
  resize: vertical;
  min-height: 2.5rem;
}

.modal-form input::file-selector-button {
  padding: 0.35rem 0.75rem;
  margin-right: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
}

.modal-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.modal-form .form-section {
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-form .form-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 0.75rem;
}

.modal-form label span em {
  font-weight: 400;
  font-style: normal;
  color: var(--text-muted);
  font-size: 0.7rem;
}

/* Custom checkboxes */
.checkbox-custom {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
}

.checkbox-custom input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-custom .checkbox-box {
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 6px;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.checkbox-custom input:checked + .checkbox-box {
  background: var(--accent);
  border-color: var(--accent);
}

.checkbox-custom input:checked + .checkbox-box::after {
  content: '';
  width: 0.3rem;
  height: 0.5rem;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 0.08rem;
}

.modal-form .checkbox-custom .checkbox-label {
  font-size: 0.9rem;
  color: var(--text);
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-actions .btn {
  border-radius: 10px;
  padding: 0.65rem 1.35rem;
}

.modal-actions .btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border: none;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.modal-actions .btn-primary:hover {
  background: linear-gradient(135deg, #4f8ff7 0%, #3b82f6 100%);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.modal-actions .btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-actions .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

/* Bathroom detail modal – Zillow-style: hero image on top, details below */
.bathroom-detail-modal .modal-content {
  max-width: 440px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.bathroom-detail-modal .modal-header {
  padding: 1rem 1.25rem;
}

.bathroom-detail-modal-body {
  overflow-y: auto;
  padding: 0;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.bathroom-detail-hero {
  width: 100%;
  flex-shrink: 0;
  background: var(--matte-black);
}

.bathroom-detail-image-wrap {
  width: 100%;
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.bathroom-detail-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.bathroom-detail-image-placeholder {
  width: 100%;
  height: 320px;
  background: var(--matte-black);
  border-bottom: 1px dashed var(--border);
}

.bathroom-detail-info {
  padding: 1.25rem 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.bathroom-detail-name {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.bathroom-detail-address {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.bathroom-detail-info .nearby-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.bathroom-detail-info .nearby-item-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

.bathroom-detail-info .nearby-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.bathroom-detail-room {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.bathroom-detail-info .nearby-action-directions {
  align-self: flex-start;
  margin-top: 0.25rem;
}

body.light-mode .modal-content {
  background: linear-gradient(180deg, #fafafa 0%, #f5f5f5 100%);
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.03),
    0 32px 64px -12px rgba(0, 0, 0, 0.15);
}

body.light-mode .modal-header {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.02) 0%, transparent 100%);
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

body.light-mode .modal-form-compact .modal-hint {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
}

body.light-mode .form-floor-hint {
  color: #737373;
}

body.light-mode .form-floor-hint strong {
  color: #171717;
}

body.light-mode .num-stepper,
body.light-mode .modal-form input[type="text"],
body.light-mode .modal-form select,
body.light-mode .modal-form textarea {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .photo-upload-area {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .checkbox-row .checkbox-custom {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.06);
}

body.light-mode .checkbox-row .checkbox-custom:hover {
  background: rgba(0, 0, 0, 0.06);
}

body.light-mode .modal-form input[type="text"],
body.light-mode .modal-form input[type="number"],
body.light-mode .modal-form input[type="file"],
body.light-mode .modal-form select,
body.light-mode .modal-form textarea {
  background: #f5f5f5;
  border-color: rgba(0, 0, 0, 0.08);
  color: #171717;
}

body.light-mode .checkbox-custom .checkbox-box {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.15);
}


body.light-mode .photo-preview {
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .toast {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .toast.toast-success {
  background: rgba(34, 197, 94, 0.2);
  border-color: #22c55e;
}

body.light-mode .toast.toast-error {
  background: rgba(220, 38, 38, 0.2);
  border-color: #dc2626;
}

/* InfoWindow: hide close button and carat, match theme */
#map .gm-style-iw-t,
#map .gm-style-iw-tc,
#map .gm-style-iw button {
  display: none !important;
}

#map .gm-style-iw-t::after,
#map .gm-style-iw-tc::after {
  display: none !important;
}

#map .gm-style-iw-c,
#map .gm-style-iw-d {
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

#map .gm-style-iw {
  background: transparent !important;
}

#map .gm-style-iw-c .marker-popup,
#map .gm-style-iw-d .marker-popup {
  padding: 0;
  margin: 0;
}

/* Marker InfoWindow content */
.marker-info {
  padding: 0.5rem 0;
  min-width: 200px;
  font-size: 0.9rem;
}

.marker-info strong {
  display: block;
  margin-bottom: 0.35rem;
}

.marker-address,
.marker-notes {
  margin: 0.25rem 0;
  color: #666;
  font-size: 0.85rem;
}

.marker-tag {
  display: inline-block;
  margin: 0.25rem 0.25rem 0 0;
  padding: 0.2rem 0.5rem;
  background: rgba(59, 130, 246, 0.2);
  border-radius: 4px;
  font-size: 0.8rem;
}

.marker-thumb {
  display: block;
  margin-top: 0.5rem;
  max-width: 200px;
  max-height: 120px;
  object-fit: cover;
  border-radius: var(--fillet-sm);
}

/* Marker popup: address, floor, floors + bathroom cards */
.marker-popup {
  min-width: 280px;
  max-width: 320px;
  font-size: 0.9rem;
  background: var(--surface);
  border-radius: var(--fillet-lg);
  overflow: hidden;
  box-shadow: var(--shadow-morph);
}

.marker-popup-address-row {
  padding: 0.75rem 0.85rem 0.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}

.marker-popup-floor-subtitle {
  padding: 0 0.85rem 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.marker-popup-floors {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.75rem 0.85rem;
  background: var(--matte-black-alt);
  border-bottom: 1px solid var(--border);
}

.marker-popup-floor-tab {
  padding: 0.4rem 0.75rem;
  border: none;
  border-radius: var(--fillet-sm);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.marker-popup-floor-tab:hover {
  background: var(--surface-elevated);
  color: var(--text);
}

.marker-popup-floor-tab.active {
  background: var(--accent);
  color: #fff;
}

.marker-popup-panels {
  padding: 0.75rem 0.85rem;
  max-height: 320px;
  overflow-y: auto;
}

.marker-popup-panel {
  display: block;
}

.marker-popup-floor-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

.marker-popup-bathroom-card {
  display: flex;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  padding: 0;
  border: none;
  border-radius: var(--fillet);
  background: transparent;
  cursor: pointer;
  color: inherit;
  font: inherit;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}

.marker-popup-bathroom-card:last-child {
  border-bottom: none;
}

.marker-popup-bathroom-img {
  width: 72px;
  height: 72px;
  min-width: 72px;
  object-fit: cover;
  border-radius: var(--fillet-sm);
  background: var(--matte-black);
}

.marker-popup-bathroom-placeholder {
  width: 72px;
  height: 72px;
  min-width: 72px;
  border-radius: var(--fillet-sm);
  background: var(--matte-black);
  border: 1px dashed var(--border);
}

.marker-popup-bathroom-body {
  flex: 1;
  min-width: 0;
}

.marker-popup-bathroom-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.marker-popup-bathroom-room {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.marker-popup-bathroom-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.marker-popup-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent);
}

.marker-popup-tag .feat-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.9;
}

.nearby-item-tag .feat-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: -0.2em;
}

body.light-mode .marker-popup {
  background: #fff;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

body.light-mode .marker-popup-floors {
  background: #f5f5f5;
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .marker-popup-floor-tab {
  background: #fff;
  color: #737373;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

body.light-mode .marker-popup-floor-tab:hover {
  background: #eee;
  color: #171717;
}

body.light-mode .marker-popup-floor-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

body.light-mode .marker-popup-floor-label {
  color: #737373;
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .marker-popup-bathroom-card {
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .marker-popup-bathroom-img,
body.light-mode .marker-popup-bathroom-placeholder {
  background: #f0f0f0;
}

body.light-mode .marker-popup-bathroom-placeholder {
  border-color: rgba(0, 0, 0, 0.12);
}

body.light-mode .marker-popup-bathroom-name {
  color: #171717;
}

body.light-mode .marker-popup-bathroom-room {
  color: #737373;
}

body.light-mode .marker-popup-tag {
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent);
}
