:root {
  --surface: rgba(12, 21, 34, 0.92);
  --surface-solid: #0c1522;
  --text: #f5f8ff;
  --muted: #9fb1c7;
  --border: rgba(159, 177, 199, 0.16);
  --accent: #20c997;
  --accent-dark: #17b486;
  --shadow: 0 24px 54px rgba(0, 0, 0, 0.34);
  --strip-h: 72px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  /* Shared UI blue — used by map controls, card toggle, header, strip */
  --ui-blue: #2d5c8c;
  --ui-blue-solid: rgb(30, 60, 96);
  --ui-blue-border: #1a4a72;
  --ui-blue-hover: #264f78;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: #07101b;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

/* ─── App shell ─────────────────────────────────────────── */

.app-shell {
  width: min(100%, 1360px);
  margin: 0 auto;
  padding: 0.75rem;
}

/* ─── Topbar ─────────────────────────────────────────────── */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0 0.25rem;
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.topbar__icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
}

.topbar__title {
  margin: 0;
  font-size: clamp(1.4rem, 4vw, 2.4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.topbar__sub {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
  line-height: 1;
}

.topbar__tagline {
  margin: 3px 0 0;
  font-size: 0.72rem;
  color: var(--muted);
  font-style: italic;
  line-height: 1;
}

.topbar__status {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
  text-align: right;
  min-height: 1em;
  flex-shrink: 0;
}

/* ─── Map layout ─────────────────────────────────────────── */

.page {
}

.map-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  padding: 0.75rem;
}

/* ─── Desktop side panel ──────────────────────────────────── */

.side-panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  width: 0;
  overflow: hidden;
  background: #fff;
  /* match the map canvas corner radius */
  border-radius: 20px 12px 12px 20px;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  transition: width 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

.side-panel--open {
  width: 380px;
}

/* Shift nearest-strip right so it stays visible when the panel is open */
.side-panel--open ~ .nearest-strip {
  left: 380px;
}

.side-panel__close {
  align-self: flex-end;
  flex-shrink: 0;
  margin: 10px 10px 0;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: none;
  border-radius: 50%;
  color: #64748b;
  transition: background 0.15s, color 0.15s;
}

.side-panel__close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.side-panel__close svg {
  width: 18px;
  height: 18px;
}

.side-panel__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

@media (max-width: 720px) {
  .side-panel {
    display: none;
  }
}

.map-frame {
  position: relative;
  z-index: 0;
}

#map {
  position: relative;
  z-index: 1;
  height: min(72vh, 640px);
  min-height: 420px;
  border-radius: 20px;
  overflow: hidden;
  font-family: inherit;
}

#map * {
  font-family: inherit;
}

/* ─── Map overlay controls ───────────────────────────────── */

.map-controls {
  position: absolute;
  z-index: 2500;
  right: 0.65rem;
  bottom: 0.65rem;
  display: grid;
  gap: 0.35rem;
  pointer-events: auto;
  transition: bottom 0.25s ease;
}

.map-frame--strip-visible .map-controls {
  bottom: calc(var(--strip-h) + var(--safe-bottom) + 0.65rem);
}


/* ─── Map control buttons ────────────────────────────────── */

.map-control-button {
  display: grid;
  place-items: center;
  min-width: 38px;
  min-height: 38px;
  padding: 0.25rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  border: 0;
  border-radius: 10px;
  color: #e8f4fc;
  background: rgb(45 92 140 / 92%);
  border: 1px solid #1a4a72;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(6px);
  transition: transform 120ms ease, background-color 120ms ease;
}

.map-control-button:hover {
  background: #264f78;
  color: #fff;
}

.map-control-button:active {
  transform: scale(0.93);
}

.map-control-button--icon svg {
  width: 16px;
  height: 16px;
}

.map-control-button--mode {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

/* Locate-me button states */
.map-control-button--locate[data-state="loading"] {
  animation: locate-pulse 0.9s ease-in-out infinite alternate;
}

.map-control-button--locate[data-state="active"] {
  background: rgba(26, 115, 232, 0.9);
  border-color: rgba(26, 115, 232, 0.55);
  color: #fff;
}

@keyframes locate-pulse {
  from { opacity: 1; }
  to   { opacity: 0.45; }
}

/* ─── User location dot ──────────────────────────────────── */

.user-location-dot {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 3px solid #fff;
  background: #1a73e8;
  box-shadow: 0 0 0 6px rgba(26, 115, 232, 0.22);
}

/* ─── Toilet markers ─────────────────────────────────────── */

.toilet-marker-hit {
  display: block;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  cursor: pointer;
  line-height: 0;
}

.toilet-marker {
  display: block;
  line-height: 0;
}

.toilet-marker-svg {
  display: block;
  width: 28px;
  height: 32px;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.22));
  transition: transform 0.12s ease;
}

.toilet-marker-hit:hover .toilet-marker-svg,
.toilet-marker-hit:focus-visible .toilet-marker-svg {
  transform: translateY(-3px) scale(1.1);
}

/* ─── Nearest toilet strip ───────────────────────────────── */

.nearest-strip {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2000;
  transition: left 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  height: var(--strip-h);
  background: rgba(45, 92, 140, 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--ui-blue-border);
  border-radius: 0 0 20px 20px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  animation: strip-slide-up 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes strip-slide-up {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* Loading state — pulse the icon */
.nearest-strip[data-state="loading"] .nearest-strip__icon-wrap {
  animation: locate-pulse 0.9s ease-in-out infinite alternate;
}

/* Error state — dim the icon slightly */
.nearest-strip[data-state="error"] .nearest-strip__icon-wrap {
  opacity: 0.55;
}

.nearest-strip[hidden] {
  display: none;
}

.nearest-strip__inner {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.nearest-strip__icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(32, 201, 151, 0.12);
  border: 1px solid rgba(32, 201, 151, 0.22);
  display: grid;
  place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}

.nearest-strip__info {
  flex: 1;
  min-width: 0;
}

.nearest-strip__label {
  margin: 0;
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1;
  margin-bottom: 3px;
}

.nearest-strip__name {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #f5f8ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.nearest-strip__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex-shrink: 0;
}

.nearest-strip__dist {
  font-size: 12px;
  font-weight: 700;
  color: #f5f8ff;
  white-space: nowrap;
}

.nearest-strip__fee {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1.5px solid;
  white-space: nowrap;
}

.nearest-strip__fee--free {
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.35);
  background: rgba(74, 222, 128, 0.08);
}

.nearest-strip__fee--paid {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.08);
}

.nearest-strip__fee--donation {
  color: #93c5fd;
  border-color: rgba(147, 197, 253, 0.35);
  background: rgba(147, 197, 253, 0.08);
}

.nearest-strip__card {
  font-size: 10px;
  font-weight: 600;
  color: #93c5fd;
  border: 1.5px solid rgba(147, 197, 253, 0.35);
  background: rgba(147, 197, 253, 0.08);
  padding: 1px 6px;
  border-radius: 999px;
  white-space: nowrap;
}

.nearest-strip__nav {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 9px 14px;
  border-radius: 10px;
  background: var(--accent);
  color: #04251c;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, transform 0.12s ease;
  min-height: 40px;
}

.nearest-strip__nav:hover {
  background: var(--accent-dark);
}

.nearest-strip__nav:active {
  transform: scale(0.95);
}

/* ─── MapLibre attribution ───────────────────────────────── */

#map .maplibregl-ctrl-bottom-left {
  margin-left: 0.45rem;
  margin-bottom: 0.45rem;
  z-index: 1;
}

#map .maplibregl-ctrl-attrib,
#map .maplibregl-ctrl-attrib-inner,
#map .maplibregl-ctrl-attrib a {
  font-size: 10px !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
}

#map .maplibregl-ctrl-attrib.maplibregl-compact {
  max-width: min(80vw, 420px);
  border-radius: 8px;
  margin: 0 !important;
}

#map .maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner {
  max-width: min(75vw, 390px);
  padding: 2px 5px !important;
}

#map .maplibregl-ctrl-attrib:not(.maplibregl-compact) {
  margin: 0 !important;
}

#map .maplibregl-ctrl-attrib-button {
  width: 22px !important;
  height: 22px !important;
  background: #2d5c8c !important;
  background-image: none !important;
  border: 1px solid #1a4a72 !important;
  border-radius: 8px !important;
  color: #e8f4fc !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
  display: grid !important;
  place-items: center !important;
}

#map .maplibregl-ctrl-attrib-button::before {
  content: "i";
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

#map .maplibregl-ctrl-attrib-button:hover {
  background: #264f78 !important;
  color: #fff !important;
}

/* ─── Popups ─────────────────────────────────────────────── */

.toilet-ml-popup .maplibregl-popup-content {
  margin: 0;
  width: min(290px, calc(100vw - 2rem));
  padding: 0;
  background: #ffffff;
  color: #0f172a;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.toilet-ml-popup .maplibregl-popup-tip {
  border-top-color: #ffffff;
}

.toilet-ml-popup .maplibregl-popup-close-button {
  position: absolute;
  z-index: 2;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 50%;
  color: #374151;
  font-size: 18px;
  line-height: 1;
  border: none;
  cursor: pointer;
}

.toilet-ml-popup .maplibregl-popup-close-button:hover {
  background: #fff;
  color: #0f172a;
}

.popup-img-wrap {
  width: 100%;
  height: 140px;
  overflow: hidden;
  background: #e2e8f0;
  flex-shrink: 0;
}

.popup-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.popup-card {
  display: flex;
  flex-direction: column;
}

.popup-header {
  padding: 14px 16px 8px;
}

.popup-title-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}

.popup-title {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  color: #0f172a;
}

.popup-subtitle {
  margin: 0;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.4;
}

.popup-fee-tag {
  flex-shrink: 0;
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  border: 1.5px solid;
  white-space: nowrap;
}

.popup-fee-tag--free {
  background: #f0fdf4;
  color: #16a34a;
  border-color: #bbf7d0;
}

.popup-fee-tag--paid {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

.popup-fee-tag--donation {
  background: #eff6ff;
  color: #2563eb;
  border-color: #bfdbfe;
}

.popup-rating-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  padding: 0 16px 10px;
}

.popup-rating__score {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  min-width: 2ch;
}

.popup-rating__stars {
  display: flex;
  gap: 1px;
}

.popup-star {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: #d1d5db;
  transition: color 0.1s ease, transform 0.1s ease;
  min-width: 28px;
  min-height: 28px;
  display: grid;
  place-items: center;
}

.popup-star--on {
  color: #f59e0b;
}

.popup-star:active {
  transform: scale(0.88);
}

.popup-rating__count {
  font-size: 11px;
  color: #64748b;
  white-space: nowrap;
  width: 100%;
}

.popup-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 0 16px 10px;
}

.popup-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 11px;
  color: #374151;
  font-weight: 500;
}

.popup-actions {
  padding: 8px 16px 14px;
  border-top: 1px solid #f1f5f9;
}

.popup-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 40px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.popup-btn--maps {
  background: #0f172a;
  color: #ffffff;
}

.popup-btn--maps:hover {
  background: #1e293b;
  color: #ffffff;
}

.popup-btn--maps:active {
  background: #0a0f1a;
}

/* ─── Popup review form ──────────────────────────────────── */

.popup-review-form {
  padding: 10px 16px;
  border-top: 1px solid #f1f5f9;
}

.popup-review-form__textarea {
  width: 100%;
  resize: none;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  padding: 8px 10px;
  /* 16px prevents iOS Safari from zooming in on focus */
  font-size: 16px;
  color: #0f172a;
  line-height: 1.4;
  background: #fff;
}

.popup-review-form__textarea:focus {
  outline: none;
  border-color: #94a3b8;
}

.popup-review-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 6px;
}

.popup-review-form__btn {
  padding: 5px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  border: 0;
  cursor: pointer;
}

.popup-review-form__btn--skip {
  background: #f1f5f9;
  color: #6b7280;
}

.popup-review-form__btn--post {
  background: #0f172a;
  color: #fff;
}

/* ─── Popup reviews list ─────────────────────────────────── */

.popup-reviews {
  padding: 0 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid #f1f5f9;
}

.popup-reviews__empty {
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px; /* matches one review card height */
  padding: 0;
}

.popup-review-item {
  padding-top: 8px;
}

.popup-review-item + .popup-review-item {
  border-top: 1px solid #f1f5f9;
}

.popup-review-item__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3px;
}

.popup-review-item__stars {
  font-size: 11px;
  color: #f59e0b;
  letter-spacing: 1px;
}

.popup-review-item__time {
  font-size: 10px;
  color: #94a3b8;
}

.popup-review-item__text {
  margin: 0 0 5px;
  font-size: 12px;
  color: #374151;
  line-height: 1.4;
}

.popup-review-like {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11px;
  color: #6b7280;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.popup-review-like[data-liked="true"] {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #2563eb;
}

/* ─── Thank-you toast (post-review) ─────────────────────── */

@keyframes thankyou-in {
  from { opacity: 0; transform: scale(0.88) translateY(8px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);   }
}

@keyframes thankyou-out {
  from { opacity: 1; transform: scale(1)    translateY(0);   }
  to   { opacity: 0; transform: scale(0.92) translateY(-6px); }
}

@keyframes heart-beat {
  0%   { transform: scale(1);    }
  30%  { transform: scale(1.45); }
  60%  { transform: scale(1.15); }
  100% { transform: scale(1);    }
}

@keyframes reviews-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0);    }
}

.review-thankyou {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 22px 16px;
  text-align: center;
  animation: thankyou-in 0.42s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.review-thankyou--out {
  animation: thankyou-out 0.38s ease forwards;
}

.review-thankyou__heart {
  font-size: 32px;
  line-height: 1;
  display: inline-block;
  animation: heart-beat 0.65s ease 0.3s both;
}

.review-thankyou__text {
  margin: 6px 0 0;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.review-thankyou__sub {
  margin: 3px 0 0;
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.4;
  max-width: 220px;
}

.popup-reviews--animating-in {
  animation: reviews-in 0.38s ease forwards;
}

/* ─── Mobile — full-screen map layout ────────────────────── */

@media (max-width: 720px) {
  body {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    overflow: hidden;
    background: #07101b;
  }

  .app-shell {
    flex: 1;
    min-height: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  /* Compact header bar — same blue as map controls & card toggle */
  .topbar {
    flex-shrink: 0;
    margin: 0;
    padding: 10px 14px 8px;
    padding-top: max(10px, env(safe-area-inset-top));
    background: var(--ui-blue);
    border-bottom: 1px solid var(--ui-blue-border);
  }

  .topbar__icon {
    font-size: 1.25rem;
  }

  .topbar__title {
    font-size: 1.1rem;
    font-weight: 800;
  }

  .topbar__sub {
    font-size: 0.65rem;
  }

  .topbar__tagline {
    font-size: 0.6rem;
    margin-top: 2px;
  }

  .topbar__status {
    font-size: 0.7rem;
  }

  .page {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .map-card {
    flex: 1;
    min-height: 0;
    padding: 0;
    border-radius: 0;
    border: none;
    background: none;
    box-shadow: none;
    backdrop-filter: none;
    display: flex;
    flex-direction: column;
  }

  .map-frame {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  #map {
    flex: 1;
    height: auto;
    min-height: 200px;
    border-radius: 0;
  }

  /* Larger touch targets on mobile */
  .map-control-button {
    min-width: 46px;
    min-height: 46px;
    border-radius: 12px;
    font-size: 1.15rem;
  }

  .map-control-button--icon svg {
    width: 20px;
    height: 20px;
  }

  .map-control-button--mode {
    font-size: 0.72rem;
  }

  /* Strip sits at the very bottom of the map-frame flex column (not absolute) */
  .nearest-strip {
    position: static;
    border-radius: 0;
    height: auto;
    min-height: var(--strip-h);
    padding: 10px 14px;
    padding-bottom: max(10px, var(--safe-bottom));
    flex-shrink: 0;
    animation: none; /* no slide animation on mobile since it's in-flow */
  }

  /* map-controls stays above the strip via the shared .map-frame--strip-visible rule */

  /* Zoom ± not needed on touch — pinch-to-zoom works; hide to reduce clutter */
  #zoom-in-button,
  #zoom-out-button {
    display: none;
  }
}

/* ─── Desktop — extra widths ──────────────────────────────── */

@media (min-width: 1024px) {
  .app-shell {
    padding: 1rem 1.25rem;
  }

  .topbar {
    margin-bottom: 1rem;
  }
}

/* ─── Bottom sheet (mobile Google-Maps-style) ────────────── */

.bottom-sheet {
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
}

/* pointer-events handled per-element below so map stays pannable */

.bottom-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
}

.bottom-sheet__panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100dvh;
  background: #fff;
  color: #0f172a;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(100%);
  will-change: transform;
  pointer-events: auto;
}

.bottom-sheet__handle-bar {
  padding: 12px 0 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  touch-action: none;
  cursor: grab;
  background: #fff;
  position: relative;
}

.bottom-sheet__collapse,
.bottom-sheet__close {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: #ffffff;
  color: #0f172a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.12s ease, opacity 0.2s ease;
}

.bottom-sheet__collapse:hover,
.bottom-sheet__close:hover {
  background: #f1f5f9;
}

.bottom-sheet__collapse {
  left: 10px;
  opacity: 0;
  pointer-events: none;
}

.bottom-sheet__collapse svg {
  width: 24px;
  height: 24px;
}

.bottom-sheet--full .bottom-sheet__collapse {
  opacity: 1;
  pointer-events: auto;
}

.bottom-sheet__close {
  right: 10px;
  font-size: 26px;
  line-height: 1;
}

.bottom-sheet__close:hover {
  color: #0f172a;
}

.bottom-sheet__handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: #d1d5db;
  pointer-events: none;
}

.bottom-sheet__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: hidden; /* controlled by JS: auto in full, hidden in peek */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* ─── Sheet card — horizontal Google-Maps-style layout ───── */

.sheet-card {
  display: flex;
  flex-direction: column;
  color: #0f172a;
}

/* Hero: info on left, image on right.
   Sticky so it stays pinned at top when the user scrolls reviews — also
   serves as a drag handle for collapsing the sheet without scrolling back up. */
.sheet-card__hero {
  display: flex;
  gap: 12px;
  padding: 14px 16px 10px;
  align-items: stretch;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
  border-bottom: 1px solid #f1f5f9;
  touch-action: none;
}

/* No image variant — meta fills full width */
.sheet-card__hero--no-image {
  gap: 0;
}

.sheet-card__hero--no-image .sheet-card__meta {
  width: 100%;
}

.sheet-card__img-wrap {
  width: 90px;
  min-height: 90px;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #e2e8f0;
  cursor: pointer;
}

.sheet-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

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

.sheet-card__name-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.sheet-card__name {
  margin: 0;
  min-width: 0;
  flex-shrink: 1;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  color: #0f172a;
}

/* ISA wheelchair symbol — scaled to sit inline with the name text */
.sheet-card__access-isa {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border-radius: 2px;
}

.sheet-card__subtitle {
  margin: 0;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.4;
}

/* ─── Access type label (bold coloured text, no card border) */
.access-label {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.access-label--green  { color: #16a34a; }
.access-label--yellow { color: #b45309; }
.access-label--red    { color: #dc2626; }

/* Maps link in hero card — filled black button, sized to content */
.sheet-card__maps-link {
  width: auto;
  min-height: 32px;
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
  align-self: flex-start;
}

/* Rating row: single line, left-aligned (same edge as subtitle) */
.sheet-card__rating-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  align-self: flex-start;
  gap: 3px;
  min-width: 0;
  width: 100%;
}

.sheet-card__rating-row .popup-rating__score {
  font-size: 13px;
  font-weight: 700;
  color: #f59e0b;
  flex-shrink: 0;
}

.sheet-card__rating-row .popup-rating__count {
  font-size: 9px;
  color: #64748b;
  flex-shrink: 0;
}

.sheet-card__dist {
  font-size: 11px;
  color: #64748b;
  margin-left: auto;
  flex-shrink: 0;
  padding-left: 4px;
}

/* Slightly smaller stars to fit the compact card column */
.sheet-card__rating-row .popup-star {
  font-size: 14px;
  min-width: 18px;
  min-height: 24px;
}

/* ─── Amenities section ──────────────────────────────────── */
.amenities-section {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0 6px;
  border-top: 1px solid #f1f5f9;
}

.amenities-section__title {
  margin: 0;
  padding-top: 2px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
  flex-shrink: 0;
}

.amenities-section__cards {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.amenity-card {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  border: 1.5px solid;
  white-space: nowrap;
}

.amenity-card--yes {
  background: #f0fdf4;
  color: #16a34a;
  border-color: #bbf7d0;
}

.amenity-card--no {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

.amenity-card--neutral {
  background: #f8fafc;
  color: #475569;
  border-color: #e2e8f0;
}

.amenity-card--paid {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

/* Body: review form + reviews */
.sheet-card__body {
  padding: 0 16px;
}

.sheet-card__body .popup-chips {
  padding: 12px 0 4px;
  border: none;
}

.sheet-card__body .popup-review-form {
  padding-left: 0;
  padding-right: 0;
  border-top: 1px solid #f1f5f9;
  margin-top: 8px;
}

.sheet-card__body .popup-reviews {
  padding-left: 0;
  padding-right: 0;
  border-top: 1px solid #f1f5f9;
  margin-top: 8px;
}

/* "Open in Maps" lives in the panel footer (outside scroll) — always visible */
.bottom-sheet__footer {
  flex-shrink: 0;
  padding: 10px 16px;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
  border-top: 1px solid #f1f5f9;
  background: #fff;
}

/* ─── Image lightbox (full-screen tap-to-view) ───────────── */

.img-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.94);
  display: grid;
  place-items: center;
  padding: 24px;
  animation: lightbox-in 0.18s ease;
  cursor: zoom-out;
}

.img-lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}

.img-lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
}

.img-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.30);
}

@keyframes lightbox-in {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}
