/* ── Satoshi font (same family as the app) ──────────────── */
@font-face { font-family: "Satoshi"; src: url("assets/fonts/Satoshi-Regular.otf") format("opentype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Satoshi"; src: url("assets/fonts/Satoshi-Medium.otf") format("opentype"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Satoshi"; src: url("assets/fonts/Satoshi-Bold.otf") format("opentype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Satoshi"; src: url("assets/fonts/Satoshi-Black.otf") format("opentype"); font-weight: 900; font-style: normal; font-display: swap; }

/* ── Theme tokens — values map 1:1 to constants/themes.js ─── */
:root {
  /* LightTheme */
  --primary: #e91e63;       /* primary */
  --accent: #ff84a1;        /* primaryAccent */
  --gold: #ffb82c;          /* secondary */
  --gold-2: #ffdd9a;        /* secondaryAccent */
  --page-bg: #f8f7ef;       /* primaryBG */
  --surface: #ffffff;       /* secondaryBG (cards / header) */
  --surface-2: #fdf4f8;     /* derived: soft hover / image bg */
  --text: #1a0a32;          /* primaryText */
  --text-muted: #5f4c7b;    /* secondaryText */
  --line: #ece3ea;          /* derived hairline */
  --shadow: 0 6px 20px rgba(26, 10, 50, 0.10);
  --shadow-sm: 0 2px 8px rgba(26, 10, 50, 0.08);

  --dot: #e91e63;
  --dot-stroke: #ffffff;
  --logo-filter: none;

  --banner-h: 104px;
  --list-w: 40%;
  font-family: "Satoshi", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

[data-theme="dark"] {
  /* DarkTheme — 1:1 with constants/colors.js DarkTheme (app's COLORS) */
  --primary: #ff84a1;       /* primary */
  --accent: #e91e63;        /* primaryAccent */
  --gold: #ffdd9a;          /* secondary */
  --gold-2: #ffb82c;        /* secondaryAccent */
  --page-bg: #1a0a32;       /* primaryBG */
  --surface: #5f4c7b;       /* secondaryBG (cards / header) */
  --surface-2: #6e5a8e;     /* derived: soft hover / image bg / inputs */
  --text: #ffffff;          /* primaryText */
  --text-muted: #f8f7ef;    /* secondaryText */
  --line: #715d93;          /* derived hairline visible on purple */
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);

  --dot: #ff84a1;
  --dot-stroke: #1c1a18;
  --logo-filter: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  color: var(--text);
  background: var(--page-bg);
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

/* ── Banner ─────────────────────────────────────────────── */
.banner {
  height: var(--banner-h);
  flex: 0 0 auto;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  /* brand (left) · search (middle) · store logos (right) */
  display: grid;
  /* equal side columns → the middle (search) is page-centred */
  grid-template-columns: minmax(150px, 1fr) minmax(0, 560px) minmax(150px, 1fr);
  align-items: end;          /* bottom-align: store icons line up with the Ghosla wordmark */
  gap: 22px;
  padding: 14px 22px 14px;
  box-shadow: var(--shadow-sm);
  z-index: 30;
}
.brand {
  justify-self: start;
  display: flex; flex-direction: column; align-items: center;
  text-decoration: none;
}
.brand-logo { height: 56px; width: auto; object-fit: contain; display: block; }
.brand-name { font-size: 21px; font-weight: 800; letter-spacing: -0.3px; color: var(--text); }

/* Search + filters live in the banner middle */
.banner-search { justify-self: stretch; align-self: start; margin-top: 8px; width: 100%; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
/* City picker + search input read as one attached control. */
.search-row { position: relative; flex: 1 1 260px; min-width: 200px; display: flex; align-items: stretch; }
.search-row .search-wrap { flex: 1 1 auto; min-width: 0; }
.search-row #placeSearch { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.search-wrap { position: relative; flex: 1 1 200px; min-width: 160px; }

/* City dropdown — sits flush on the left edge of the search bar. */
.city-select { position: relative; flex: 0 0 auto; }
.city-btn {
  height: 48px; display: flex; align-items: center; gap: 6px;
  padding: 0 11px 0 13px;
  border: 1px solid var(--line); border-right: none;
  border-radius: 12px 0 0 12px;
  background: var(--surface-2); color: var(--text);
  font: inherit; font-size: 14.5px; font-weight: 600; line-height: 1;
  cursor: pointer; white-space: nowrap; max-width: 168px;
}
.city-btn:hover { background: var(--surface); }
.city-btn .ci-pin { color: var(--primary); flex: 0 0 auto; }
.city-btn #cityLabel { overflow: hidden; text-overflow: ellipsis; }
.city-btn .chev { flex: 0 0 auto; opacity: .65; transition: transform .15s ease; }
.city-select.open .city-btn .chev { transform: rotate(180deg); }
.city-menu {
  list-style: none; margin: 0; padding: 6px;
  position: absolute; top: calc(100% + 6px); left: 0;
  min-width: 210px; z-index: 50;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow);
  display: none;
}
.city-select.open .city-menu { display: block; }
.city-item {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 12px; border-radius: 9px; cursor: pointer;
  font-size: 14.5px; color: var(--text);
}
.city-item:hover { background: var(--surface-2); color: var(--primary); }
.city-item.is-on { color: var(--primary); font-weight: 700; }
.city-item .ci-count { font-size: 12px; color: var(--text-muted); font-weight: 600; flex: 0 0 auto; }
.city-item.is-on .ci-count { color: var(--primary); }
.search-ico {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  line-height: 0; color: var(--text-muted); opacity: .8; pointer-events: none;
}

/* Single filter icon → popover with age + type chips */
.filter-wrap { position: relative; flex: 0 0 auto; }
.filter-icon-btn {
  position: relative;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: pointer;
}
.filter-icon-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-icon-btn.has-sel { border-color: var(--primary); color: var(--primary); }
/* little dot badge when any filter is active */
.filter-icon-btn.has-sel::after {
  content: ""; position: absolute; top: 7px; right: 7px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--primary);
  border: 1.5px solid var(--surface);
}
.filter-panel {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 50;
  display: none;
  width: max-content; max-width: 300px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.filter-panel.open { display: block; }
.filter-group + .filter-group { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.filter-group-title {
  display: block; margin-bottom: 9px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-muted);
}
.filter-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.fchip {
  appearance: none; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600;
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  transition: background .12s, color .12s, border-color .12s;
}
.fchip:hover { border-color: var(--primary); }
.fchip.is-on { background: var(--primary); color: #fff; border-color: var(--primary); }
[data-theme="dark"] .fchip.is-on { color: #1a0a32; }
/* size chips keep their theme colour, dimmed until selected */
#sizeChips .tag {
  cursor: pointer; appearance: none; font: inherit; font-size: 13px; font-weight: 700;
  opacity: .42; filter: grayscale(.2);
  transition: opacity .12s, transform .12s, box-shadow .12s;
}
#sizeChips .tag.selected { opacity: 1; filter: none; box-shadow: 0 0 0 2px var(--text); transform: translateY(-1px); }

/* Right side: tagline + store logos */
.banner-right { justify-self: end; display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.banner-tagline {
  margin: 0;
  text-align: right;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;       /* single line */
  color: var(--text-muted);
}
.store-links { display: flex; align-items: center; gap: 9px; }
/* On narrower desktops drop the tagline so the centred search keeps its room */
@media (max-width: 1150px) { .banner-tagline { display: none; } }
.store-links a {
  display: grid; place-items: center;
  width: 42px; height: 42px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.store-links a:hover { border-color: var(--primary); }
.store-links svg { width: 22px; height: 22px; display: block; }
.store-links a:first-child svg { color: var(--text); } /* apple mark follows theme */

/* ── Disclaimer popup (shown on load) ───────────────────── */
.disc-modal {
  position: fixed; inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.disc-modal.is-closed { display: none; }
.disc-backdrop { position: absolute; inset: 0; background: rgba(20, 8, 28, .55); backdrop-filter: blur(2px); }
.disc-card {
  position: relative;
  width: min(480px, 100%);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
  padding: 30px 30px 26px;
  text-align: center;
}
.disc-icon { font-size: 44px; line-height: 1; }
.disc-title { margin: 14px 0 14px; font-size: 25px; font-weight: 800; color: var(--text); }
.disc-body { margin: 0 0 24px; text-align: left; }
.disc-body p { margin: 0 0 14px; font-size: 17px; line-height: 1.6; color: var(--text-muted); }
.disc-body p:last-child { margin-bottom: 0; }
.disc-body a { color: var(--primary); font-weight: 700; text-decoration: underline; }
.disc-body a:hover { text-decoration: none; }
.disc-btn {
  appearance: none;
  border: none;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 16.5px;
  padding: 13px 32px;
  border-radius: 999px;
  cursor: pointer;
}
[data-theme="dark"] .disc-btn { color: #1a0a32; }
.disc-btn:hover { filter: brightness(1.05); }

/* Primary buttons inside the contribute/comments/report modals follow the header-bar
   scheme: light pink + dark text in light mode, dark purple + white text in dark mode. */
.contrib-card .disc-btn, .comments-card .disc-btn, .report-card .disc-btn {
  background: #ff84a1; color: #1a0a32;
}
.contrib-card .disc-btn:hover, .comments-card .disc-btn:hover, .report-card .disc-btn:hover {
  filter: none; background: #ff6f92;
}
[data-theme="dark"] .contrib-card .disc-btn,
[data-theme="dark"] .comments-card .disc-btn,
[data-theme="dark"] .report-card .disc-btn {
  background: #1a0a32; color: #fff;
}
[data-theme="dark"] .contrib-card .disc-btn:hover,
[data-theme="dark"] .comments-card .disc-btn:hover,
[data-theme="dark"] .report-card .disc-btn:hover {
  filter: none; background: #2a1247;
}

/* ── Layout (list | gutter | map) ───────────────────────── */
.layout {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: var(--list-w) 8px 1fr;
  min-height: 0;
}

.gutter {
  background: var(--accent); /* accent-coloured divider — clearly visible in both modes */
  cursor: col-resize;
  position: relative;
  transition: background .15s;
}
.gutter::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 3px; height: 36px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .9);
}
.gutter:hover, .gutter.dragging { background: var(--primary); }

/* ── List pane ──────────────────────────────────────────── */
.list-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--page-bg);
}
.list-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 10px 16px;
  border-bottom: 1px solid var(--line);
}
.list-title { margin: 0; font-size: 16px; font-weight: 500; color: var(--text); }
.list-count { font-size: 13px; color: var(--text-muted); }
.list-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px;
  /* CSS multi-column → true masonry: each card keeps its own height (taller
     when it has more numbers) and cards pack tightly down each column. */
  column-width: 220px;
  column-gap: 12px;
  -webkit-overflow-scrolling: touch;
}

/* Custom themed scrollbars (default dark scrollbar looked white/odd) */
.list-scroll, .search-results, .sv-body, .disc-card { scrollbar-width: thin; scrollbar-color: var(--accent) transparent; }
.list-scroll::-webkit-scrollbar, .search-results::-webkit-scrollbar { width: 10px; }
.list-scroll::-webkit-scrollbar-track, .search-results::-webkit-scrollbar-track { background: transparent; }
.list-scroll::-webkit-scrollbar-thumb, .search-results::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 8px;
  border: 2px solid var(--page-bg);
}
.list-scroll::-webkit-scrollbar-thumb:hover, .search-results::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ── Board card (vertical, grid cell) ───────────────────── */
.card {
  display: inline-block; /* column flow: card sizes to its content */
  width: 100%;
  margin: 0 0 12px;      /* vertical gap; horizontal gap = column-gap */
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow .15s, border-color .15s, transform .15s;
}
.card:hover { box-shadow: var(--shadow); border-color: var(--accent); transform: translateY(-2px); }
.card.is-active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.card-img {
  width: 100%;
  height: 170px; /* fixed height — avoids aspect-ratio intrinsic-sizing collapse in grid cells */
  object-fit: cover;
  background: var(--surface-2);
  display: block;
}
.card-body { display: flex; flex-direction: column; gap: 9px; padding: 13px 14px 14px; }
.card-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid transparent;
  color: var(--text-muted);
  background: var(--surface-2);
}
/* Each room size → a solid pill in a Ghosla theme colour (same in both modes) */
.tag.s-rk   { background: #5f4c7b; color: #fff; }     /* purple  */
.tag.s-1bhk { background: #e91e63; color: #fff; }     /* pink    */
.tag.s-2bhk { background: #ffb82c; color: #1a0a32; }  /* gold    */
.tag.s-3bhk { background: #ff84a1; color: #1a0a32; }  /* light pink */
.tag.s-4bhk { background: #ffdd9a; color: #1a0a32; }  /* light gold */
.tag.s-5bhk { background: #5f4c7b; color: #fff; }
.tag.s-6bhk { background: #e91e63; color: #fff; }
.pop-body .card-tags { margin-bottom: 7px; }
.card-phones { display: flex; flex-direction: column; gap: 5px; }
.phone-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.phone {
  font-size: 19px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: .2px;
  white-space: nowrap;
  min-width: 0;
}
.phone .ic { margin-right: 5px; vertical-align: -2px; flex: 0 0 auto; }
.phone:hover { text-decoration: underline; }
.copy-btn {
  flex: 0 0 auto;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: none; background: transparent;
  color: var(--text-muted);
  border-radius: 8px; cursor: pointer;
  transition: background .12s, color .12s;
}
.copy-btn:hover { background: var(--surface-2); color: var(--primary); }
.copy-btn .ico-check { display: none; font-size: 17px; font-weight: 800; color: #1faf6a; }
.copy-btn.copied .ico-copy { display: none; }
.copy-btn.copied .ico-check { display: inline; }
.copy-btn.copied { background: transparent; }
.card-meta { font-size: 13px; color: var(--text-muted); }
.sv-btn {
  appearance: none;
  border: 1px solid var(--accent);
  background: var(--surface-2);
  color: var(--primary);
  font-weight: 700;
  font-size: 14.5px;
  padding: 9px 12px;
  border-radius: 999px;
  cursor: pointer;
  width: 100%;
}
.sv-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.sv-btn .ic { margin-right: 6px; vertical-align: -2px; }
[data-theme="dark"] .sv-btn:hover { color: #1a0a32; }

.list-empty, .list-more {
  column-span: all;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  padding: 24px 12px;
}
.list-more { font-weight: 700; color: var(--primary); }

/* Card address (lazy reverse-geocoded) + footer with street-view icon */
.card-address {
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--text-muted);
}
.card-address:empty { display: none; } /* hide until an address is present */
.card-address::before {
  content: "";
  display: inline-block;
  width: 12px; height: 12px;
  margin-right: 4px;
  vertical-align: -1px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a7 7 0 0 0-7 7c0 5 7 13 7 13s7-8 7-13a7 7 0 0 0-7-7zm0 9.5A2.5 2.5 0 1 1 12 6.5a2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a7 7 0 0 0-7 7c0 5 7 13 7 13s7-8 7-13a7 7 0 0 0-7-7zm0 9.5A2.5 2.5 0 1 1 12 6.5a2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.card-sv {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1px solid var(--accent);
  background: var(--surface-2);
  color: var(--primary);
  border-radius: 10px;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.card-sv:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Dark mode: dark top bar, pink cards with off-white text ── */
[data-theme="dark"] .banner { background: #1a0a32; }
[data-theme="dark"] .card { background: #1a0a32; border-color: #5f4c7b; border-width: 2px; } /* dark purple fill, thicker light-purple outline */
[data-theme="dark"] .card:hover { background: #1a0a32; border-color: #8a72ad; } /* stay dark purple on hover */
[data-theme="dark"] .card.is-active { border-color: #1a0a32; box-shadow: 0 0 0 2px #1a0a32; }
[data-theme="dark"] .card .phone,
[data-theme="dark"] .card .card-meta,
[data-theme="dark"] .card .card-address { color: #f8f7ef; }
[data-theme="dark"] .card .copy-btn { color: #f8f7ef; }
[data-theme="dark"] .card .copy-btn:hover { background: rgba(255,255,255,.2); color: #fff; }
[data-theme="dark"] .card-sv { border-color: rgba(255,255,255,.55); background: rgba(255,255,255,.16); color: #f8f7ef; }
[data-theme="dark"] .card-sv:hover { background: #1a0a32; border-color: #1a0a32; color: #fff; }

/* ── Map pane ───────────────────────────────────────────── */
.map-pane { position: relative; min-height: 0; }
#map { position: absolute; inset: 0; }

/* Place search input (in the banner) */
#placeSearch {
  width: 100%;
  height: 48px;
  padding: 0 18px 0 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 16px;
  outline: none;
}
#placeSearch::placeholder { color: var(--text-muted); }
#placeSearch:focus { border-color: var(--primary); background: var(--surface); }
.search-results {
  list-style: none;
  margin: 0;
  padding: 6px;
  position: absolute;
  top: calc(100% + 6px); left: 0; right: 0;
  z-index: 40;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  max-height: 320px;
  overflow-y: auto;
  display: none;
}
.search-results.open { display: block; }
.search-item {
  padding: 11px 12px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 15px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-item:hover { background: var(--surface-2); color: var(--primary); }

/* Top-right control cluster: sun/moon switch + expand/collapse */
.map-controls {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
}
.map-expand, .map-collapse {
  border: none;
  cursor: pointer;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.map-expand {
  width: 50px; height: 50px;
  border-radius: 12px;
  background: var(--surface);
  color: var(--primary);
  font-size: 25px;
  line-height: 1;
}
.map-expand:hover { background: var(--primary); color: #fff; }
.map-collapse {
  display: none;
  padding: 13px 18px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
}

/* Sun/moon sliding toggle */
.theme-switch {
  position: relative;
  flex: 0 0 auto;
  width: 84px; height: 50px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.ts-ico {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;            /* icons sit above the sliding knob */
  font-size: 18px;
  line-height: 1;
  pointer-events: none;
}
/* The icon over the pink knob is white; the one on the track is muted. */
.ts-sun { left: 13px; color: #fff; }
.ts-moon { right: 13px; color: var(--text-muted); }
[data-theme="dark"] .ts-sun { color: var(--text-muted); }
[data-theme="dark"] .ts-moon { color: #fff; }
.theme-switch-knob {
  position: absolute;
  top: 4px; left: 4px;
  z-index: 1;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  transition: transform .22s ease;
}
[data-theme="dark"] .theme-switch-knob { transform: translateX(34px); }
.map-hint {
  position: absolute;
  bottom: 16px; left: 50%;
  transform: translateX(-50%);
  background: rgba(26, 10, 50, .82);
  color: #fff;
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 999px;
  display: none;
  pointer-events: none;
  z-index: 10;
}

/* Fullscreen: map covers everything below the banner, list + gutter hidden */
.layout.is-fullscreen { grid-template-columns: 1fr; }
.layout.is-fullscreen .list-pane,
.layout.is-fullscreen .gutter { display: none; }
.layout.is-fullscreen .map-expand { display: none; }
.layout.is-fullscreen .map-collapse { display: block; }
.layout.is-fullscreen .map-hint { display: block; }

/* ── Map popup ──────────────────────────────────────────── */
.maplibregl-popup-content {
  padding: 0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  width: 220px;
  background: var(--surface);
}
.maplibregl-popup-tip { border-top-color: var(--surface) !important; border-bottom-color: var(--surface) !important; }
.pop-img { width: 100%; height: 130px; object-fit: cover; display: block; background: var(--surface-2); }
.pop-body { padding: 10px 12px; }
.pop-phones { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.pop-body .phone { font-size: 15px; }
.pop-body .sv-btn { text-align: center; }
.maplibregl-popup-close-button { font-size: 18px; padding: 2px 7px; color: var(--primary); }

/* Popup Street-View button uses the top-bar colour scheme: light pink + dark text */
.pop-body .sv-btn,
[data-theme="dark"] .pop-body .sv-btn {
  background: #ff84a1; color: #1a0a32; border-color: #ff84a1;
}
.pop-body .sv-btn:hover,
[data-theme="dark"] .pop-body .sv-btn:hover {
  background: #ff6f92; color: #1a0a32; border-color: #ff6f92;
}

/* Hover-card comment & report buttons: minimal (ghost) — quiet next to Street View */
.pop-actions .card-act,
[data-theme="dark"] .pop-actions .card-act {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-muted);
  font-weight: 600;
}
.pop-actions .card-act:hover { background: var(--surface-2); color: var(--primary); border-color: var(--line); }
[data-theme="dark"] .pop-actions .card-act { border-color: rgba(255,255,255,.25); color: #cdc3df; }
[data-theme="dark"] .pop-actions .card-act:hover { background: rgba(255,255,255,.12); color: #fff; }

/* Hover board (popup) matches the list cards — dark purple in dark mode */
[data-theme="dark"] .maplibregl-popup-content { background: #1a0a32; }
[data-theme="dark"] .maplibregl-popup-tip { border-top-color: #1a0a32 !important; border-bottom-color: #1a0a32 !important; }
[data-theme="dark"] .pop-body .phone { color: #f8f7ef; }
[data-theme="dark"] .maplibregl-popup-close-button { color: #f8f7ef; }

/* ── Street View modal ──────────────────────────────────── */
.sv-modal {
  position: fixed; inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.sv-modal.is-open { display: flex; }
.sv-backdrop { position: absolute; inset: 0; background: rgba(20, 8, 28, .72); backdrop-filter: blur(2px); }
.sv-frame {
  position: relative;
  width: 94vw;
  height: 90vh;
  background: #1a0a1f;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  display: flex;
  flex-direction: column;
}
.sv-bar {
  flex: 0 0 auto;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 0 16px;
  background: #ff84a1;  /* light pink */
  color: #1a0a32;       /* dark text */
}
.sv-bar-title { font-weight: 700; font-size: 15px; }
.sv-close {
  appearance: none;
  border: none;
  background: rgba(26,10,50,.14);
  color: #1a0a32;
  font-weight: 700;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.sv-close:hover { background: rgba(26,10,50,.24); }
.sv-body { flex: 1 1 auto; position: relative; }
.sv-body iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.sv-note {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; text-align: center; color: #f3d3e0; padding: 24px;
}
.sv-note code { background: rgba(255,255,255,.12); padding: 2px 6px; border-radius: 5px; }

/* ── Card action buttons (street view · comments · report) ── */
.card-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.card-act {
  height: 36px; min-width: 36px;
  padding: 0 9px;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  border: 1px solid var(--accent);
  background: var(--surface-2);
  color: var(--primary);
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px; font-weight: 700;
  transition: background .12s, color .12s, border-color .12s;
}
.card-act:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
[data-theme="dark"] .card-act { border-color: rgba(255,255,255,.55); background: rgba(255,255,255,.16); color: #f8f7ef; }
[data-theme="dark"] .card-act:hover { background: #1a0a32; border-color: #1a0a32; color: #fff; }
[data-theme="dark"] .card-act.has-count { color: #f8f7ef; }
.card-act .ic { vertical-align: -2px; }

/* Comments + report buttons inside the map popup */
.pop-actions { display: flex; gap: 6px; margin-top: 7px; }
.pop-actions .card-act { flex: 1 1 auto; }

/* ── Floating "Add a board" button ──────────────────────── */
.contrib-fab {
  position: absolute;
  left: 14px; bottom: 16px;
  z-index: 12;
  border: none;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  padding: 13px 18px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--shadow);
}
[data-theme="dark"] .contrib-fab { color: #1a0a32; }
.contrib-fab:hover { filter: brightness(1.05); }

/* ── Generic modal scaffold for contribute / comments / report ── */
.contrib-modal, .comments-modal, .report-modal {
  position: fixed; inset: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.contrib-modal.is-closed, .comments-modal.is-closed, .report-modal.is-closed { display: none; }
.contrib-backdrop, .comments-backdrop, .report-backdrop {
  position: absolute; inset: 0;
  background: rgba(20, 8, 28, .6);
  backdrop-filter: blur(2px);
}
.contrib-card, .comments-card, .report-card {
  position: relative;
  width: min(520px, 100%);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.report-card { width: min(420px, 100%); }
.contrib-bar, .comments-bar, .report-bar {
  flex: 0 0 auto;
  height: 50px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 8px 0 18px;
  background: #ff84a1;  /* light pink */
  color: #1a0a32;       /* dark text */
}
.contrib-bar-title, .comments-bar-title, .report-bar-title { font-weight: 800; font-size: 16px; }
.contrib-close, .comments-close, .report-close {
  appearance: none; border: none;
  background: rgba(26,10,50,.14); color: #1a0a32;
  font-weight: 700; font-size: 14px;
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
}
.contrib-close:hover, .comments-close:hover, .report-close:hover { background: rgba(26,10,50,.24); }

/* Dark mode: dark-purple header bars with white text (not light pink) */
[data-theme="dark"] .sv-bar,
[data-theme="dark"] .contrib-bar,
[data-theme="dark"] .comments-bar,
[data-theme="dark"] .report-bar { background: #1a0a32; color: #fff; }
[data-theme="dark"] .sv-close,
[data-theme="dark"] .contrib-close,
[data-theme="dark"] .comments-close,
[data-theme="dark"] .report-close { background: rgba(255,255,255,.18); color: #fff; }
[data-theme="dark"] .sv-close:hover,
[data-theme="dark"] .contrib-close:hover,
[data-theme="dark"] .comments-close:hover,
[data-theme="dark"] .report-close:hover { background: rgba(255,255,255,.32); }

/* ── Contribute form ────────────────────────────────────── */
.contrib-body { padding: 18px 20px 22px; display: flex; flex-direction: column; }
.contrib-label { font-size: 14px; font-weight: 700; color: var(--text); margin: 14px 0 8px; }
.contrib-body > .contrib-label:first-child { margin-top: 0; }
.contrib-geo { width: 100%; margin-bottom: 10px; }
.contrib-minimap { height: 220px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.contrib-addr { margin: 8px 0 0; font-size: 13px; color: var(--text-muted); line-height: 1.4; }
.contrib-geo-err { margin: 8px 0 0; }
#contribPhoto {
  font-size: 14px; color: var(--text);
}
#contribPhoto::file-selector-button {
  appearance: none; border: 1px solid var(--accent);
  background: var(--surface-2); color: var(--primary);
  font-weight: 700; font-size: 14px;
  padding: 9px 14px; border-radius: 999px; cursor: pointer; margin-right: 12px;
}
.contrib-preview { margin-top: 10px; max-height: 180px; border-radius: 12px; object-fit: cover; }
.contrib-preview:not([hidden]) { display: block; }  /* respect the [hidden] attr until a photo is picked */
.contrib-phone-input, .comment-name, .comment-body, .report-reason {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  outline: none;
}
.contrib-phone-input { margin-bottom: 8px; letter-spacing: .3px; }
.contrib-phone-input:focus, .comment-name:focus, .comment-body:focus, .report-reason:focus {
  border-color: var(--primary); background: var(--surface);
}
.contrib-addphone {
  appearance: none; border: none; background: transparent;
  color: var(--primary); font-weight: 700; font-size: 14px;
  padding: 4px 0; cursor: pointer; align-self: flex-start;
}
.contrib-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.contrib-chips .tag {
  cursor: pointer;
  appearance: none;
  font: inherit; font-size: 13px; font-weight: 700;
  opacity: .42;
  filter: grayscale(.2);
  transition: opacity .12s, transform .12s, box-shadow .12s;
}
.contrib-chips .tag.selected {
  opacity: 1;
  filter: none;
  box-shadow: 0 0 0 2px var(--text);
  transform: translateY(-1px);
}
.contrib-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.contrib-turnstile { margin: 16px 0 6px; min-height: 0; }
.contrib-turnstile:empty { margin: 0; }
.contrib-error {
  margin: 10px 0 0; font-size: 14px; font-weight: 600;
  color: #d83a5e; line-height: 1.4;
}
[data-theme="dark"] .contrib-error { color: #ffb3c6; }
.contrib-submit, .comment-form .disc-btn { margin-top: 16px; width: 100%; }
.contrib-success { padding: 30px 26px; text-align: center; }
.contrib-success.is-closed { display: none; }
.contrib-success-title { margin: 12px 0 12px; font-size: 22px; font-weight: 800; color: var(--text); }
.contrib-success p { margin: 0 0 22px; font-size: 15px; line-height: 1.6; color: var(--text-muted); }
.contrib-success a { color: var(--primary); font-weight: 700; }

/* Contribute modal scrolls as a whole (robust on mobile) with a pinned header.
   Overrides the shared flex-column card so the inner-scroll quirk can't bite. */
.contrib-card {
  display: block;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.contrib-bar { position: sticky; top: 0; z-index: 3; }
.contrib-success { display: block; }

/* ── Comments ───────────────────────────────────────────── */
.comments-head {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.comments-head img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: var(--surface-2); flex: 0 0 auto; }
.comments-head .ch-meta { min-width: 0; }
.comments-head .ch-phone { font-weight: 700; color: var(--primary); font-size: 15px; }
.comments-head .ch-addr { font-size: 13px; color: var(--text-muted); }
.comments-list { flex: 1 1 auto; overflow-y: auto; padding: 14px 18px; min-height: 120px; }
.comments-empty, .comments-loading { color: var(--text-muted); font-size: 14px; text-align: center; padding: 24px 8px; }
.comment {
  padding: 10px 12px;
  margin-bottom: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.comment-hd { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.comment-author { font-weight: 700; font-size: 14px; color: var(--text); }
.comment-date { font-size: 12px; color: var(--text-muted); flex: 0 0 auto; }
.comment-text { font-size: 14.5px; line-height: 1.45; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.comment-form { flex: 0 0 auto; padding: 14px 18px 18px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.comment-name { height: 42px; }
.comment-body { height: auto; min-height: 70px; padding: 10px 14px; line-height: 1.4; resize: vertical; }
.comment-formfoot { display: flex; justify-content: flex-end; }
.comment-count { font-size: 12px; color: var(--text-muted); }

/* ── Report dialog ──────────────────────────────────────── */
.report-body { padding: 18px 20px 20px; }
.report-reason { margin-bottom: 12px; cursor: pointer; }
.report-note { margin: 0 0 6px; font-size: 13px; color: var(--text-muted); line-height: 1.4; }
.report-actions { display: flex; gap: 10px; margin-top: 14px; }
.report-actions .sv-btn, .report-actions .disc-btn { width: auto; flex: 1 1 auto; }

/* ── Mobile ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .banner {
    /* Two rows: brand + stores on top, full-width search + filters below */
    grid-template-columns: 1fr auto;
    grid-template-areas: "brand stores" "search search";
    row-gap: 8px; column-gap: 10px;
    align-items: center; padding: 8px 12px; height: auto;
  }
  .brand { grid-area: brand; }
  .banner-right { grid-area: stores; }
  .banner-search { grid-area: search; margin-top: 0; }
  .brand-logo { height: 42px; }
  .brand-name { font-size: 15px; }
  .banner-tagline { display: none; } /* save space on narrow screens */
  .store-links { gap: 7px; }
  .store-links a { width: 38px; height: 38px; }
  .store-links svg { width: 20px; height: 20px; }
  #placeSearch { height: 44px; font-size: 15px; }
  .city-btn { height: 44px; font-size: 13.5px; max-width: 124px; padding: 0 9px 0 11px; }
  .filter-icon-btn { width: 44px; height: 44px; }
  .banner-search { gap: 6px; }

  .sv-frame { width: 96vw; height: 84vh; }

  .contrib-card, .comments-card, .report-card { width: 100%; max-height: 92dvh; }
  .contrib-minimap { height: 300px; }   /* bigger, easier to place the pin on phones */
  .contrib-fab { left: 10px; bottom: 12px; padding: 11px 15px; font-size: 14px; }

  .layout { grid-template-columns: 1fr; grid-template-rows: 40vh 1fr; }
  .gutter { display: none; }
  .list-pane { order: 2; border-top: 1px solid var(--line); min-height: 0; }
  .map-pane { order: 1; min-height: 220px; }

  /* CSS multi-column doesn't paginate vertically inside a scroll area (it grows
     sideways), which broke the mobile list. Use a 2-col grid that flows down and
     scrolls vertically instead. */
  .list-scroll {
    column-width: auto;
    columns: initial;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 10px;
    padding: 10px;
  }
  .card { display: flex; flex-direction: column; width: calc(50% - 5px); margin: 0; }
  .card-img { height: 120px; }
  .card-body { padding: 10px; gap: 7px; }
  .card-tags { gap: 4px; }
  .tag { font-size: 11px; padding: 2px 7px; }
  /* Keep the number + copy icon from overlapping in the narrower cards */
  .phone-row { gap: 4px; }
  .phone { font-size: 15.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .phone .ic { margin-right: 3px; }
  .copy-btn { width: 28px; height: 28px; }
  .card-foot { flex-wrap: wrap; gap: 6px; }
  .card-actions { gap: 5px; }
  .card-act { height: 32px; min-width: 32px; padding: 0 7px; font-size: 12px; }
  .list-empty, .list-more { width: 100%; }

  .layout.is-fullscreen { grid-template-rows: 1fr; }
}
