/* ── Leaflet tile rendering fix ──
   base.css contains `img { max-width: 100%; height: auto; }` which constrains
   Leaflet tile <img> elements to their container width, causing tiles to render
   at the wrong size and produce visible seam/misalignment between tiles (TOU-3201). */
.leaflet-container .leaflet-tile,
.leaflet-container .leaflet-tile-container img {
  max-width: none;
  max-height: none;
  box-sizing: content-box;
}

/* ── 十六番式卡片大头针（TOU-3574，card-declutter.js）──
   浅色卡片 + 锚点圆点 + 引导连接线，配合浅色 OSM 底图。
   .card-declutter-icon 整体不接收指针事件（其包围盒大多是透明区域），
   只有圆点和卡片本身可点击。位置类样式（left/top/width）由组件内联计算。 */
.card-declutter-icon {
  position: relative;
  pointer-events: none;
}
.card-declutter-leader {
  position: absolute;
  left: 0;
  top: 0;
  overflow: visible;
  pointer-events: none;
}
.card-declutter-leader-line {
  stroke: rgba(70, 70, 80, 0.6);
  stroke-width: 1.5;
}
/* 气泡尾巴：与卡片同色，看起来像卡片伸出的指针。 */
.card-declutter-tail {
  fill: #1a1a2e;
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 1;
  stroke-linejoin: round;
}
.card-declutter-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--primary, #d32f2f);
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
  cursor: pointer;
}
.card-declutter-dot--solo {
  position: static;
  display: block;
  margin: 0;
}
/* 卡片采用目的地卡片风格：深色底、封面图在上方占整宽（更大）、标题与城市在下方。 */
.card-declutter-card {
  position: absolute;
  background: #1a1a2e;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 9px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  cursor: pointer;
  text-decoration: none;
  color: #fff;
  transition: box-shadow 0.15s, transform 0.15s;
}
a.card-declutter-card:hover { text-decoration: none; }
.card-declutter-card:hover {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
  transform: translateY(-1px);
  z-index: 2;
}
.card-declutter-thumb {
  width: 100%;
  height: 84px;
  object-fit: cover;
  display: block;
  background: #222;
}
.card-declutter-thumb--empty {
  background: linear-gradient(135deg, #bf360c, #d84315);
}
.card-declutter-body {
  padding: 5px 8px 7px;
}
.card-declutter-title {
  font-size: 0.74rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-declutter-sub {
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 600;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Explore page layout ── */
.explore-layout {
  display: flex;
  height: calc(100vh - 4.5rem);
  overflow: hidden;
  margin-top: -1.5rem;
}

/* TOU-3574: /map 改为全屏地图——地图占满整页，移除右侧内容面板与移动端底部抽屉，
   内容改由地图上的十六番式文章卡片承载，点击卡片直接进入文章详情页。 */
.explore-map-panel {
  flex: 1 1 auto;
  position: relative;
}
#explore-map {
  width: 100%;
  height: 100%;
  background: #e8e8e8;
}

/* 右侧内容面板、移动端底部抽屉、以及搜索/筛选浮动按钮整体隐藏，
   全平台呈现纯地图（TOU-3574）。 */
.explore-content-panel {
  display: none;
}
.explore-bottom-sheet,
.explore-search-toggle {
  display: none !important;
}

/* TOU-3656: Quick entry overlay — search + hot cities + collapsible theme/duration chips.
   Positioned at the bottom of .explore-map-panel (position:relative).
   Lightweight: max 15 elements, does not cover most of the map. */
.map-quick-entry {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 800;
  background: rgba(15, 15, 25, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.5rem 0.75rem 0.6rem;
}
@media (max-width: 768px) {
  .explore-layout {
    --explore-mobile-bottom-ui: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  }
  .map-quick-entry {
    bottom: env(safe-area-inset-bottom, 0px);
    max-width: calc(100vw - 1.5rem);
    margin: 0 auto;
    border-radius: 12px 12px 0 0;
    box-sizing: border-box;
  }
  #pwa-install-banner.visible ~ #main-content .explore-layout .map-quick-entry {
    bottom: calc(6.75rem + env(safe-area-inset-bottom, 0px));
  }
}
.map-quick-entry-search {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 0.45rem;
}
.mqe-search-icon {
  position: absolute;
  left: 0.65rem;
  color: rgba(255, 255, 255, 0.4);
  pointer-events: none;
  flex-shrink: 0;
}
.mqe-search-input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2.1rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  font-size: 0.82rem;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.mqe-search-input::placeholder { color: rgba(255, 255, 255, 0.35); }
.mqe-search-input:focus { border-color: var(--primary, #d32f2f); }
.map-quick-entry-cities {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.map-quick-entry-cities::-webkit-scrollbar { display: none; }
.mqe-city-link {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.6rem;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.mqe-city-link:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.35);
  text-decoration: none;
}
.mqe-expand-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.28rem 0.55rem;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.75rem;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: auto;
  transition: background 0.15s;
}
.mqe-expand-btn:hover { background: rgba(255, 255, 255, 0.18); }
.mqe-expand-arrow { font-size: 0.65rem; }
.map-quick-entry-drawer {
  margin-top: 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.45rem;
}
.mqe-chip-row {
  display: flex;
  gap: 0.35rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  margin-bottom: 0.35rem;
}
.mqe-chip-row:last-child { margin-bottom: 0; }
.mqe-chip-row::-webkit-scrollbar { display: none; }
.mqe-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.65rem;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.mqe-chip:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.35);
}
/* On larger screens, show the quick entry inline at bottom-left, not full-width */
@media (min-width: 769px) {
  .explore-map-panel {
    flex: 0 0 60%;
    min-width: 0;
  }
  .explore-content-panel {
    display: flex;
    flex: 1 1 40%;
    min-width: 320px;
    flex-direction: column;
    overflow-y: auto;
    background: #0f0f0f;
    border-left: 1px solid rgba(255,255,255,0.08);
  }
  .map-quick-entry {
    right: auto;
    max-width: 420px;
  }
  .explore-filter-toggle {
    max-width: none;
  }
  .map-quick-entry {
    max-width: 420px;
  }
  .explore-filter-toggle,
  .explore-filter-toggle--desktop {
    position: fixed;
    top: 5.25rem;
    right: 1rem;
    z-index: 1050;
    display: flex !important;
    margin: 0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  }
}

/* Search bar */
.explore-search-bar {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: #111;
  flex-shrink: 0;
  position: relative;
}
.explore-search-input {
  width: 100%;
  padding: 0.6rem 2.2rem 0.6rem 0.85rem;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
  color: #fff;
  font-size: 0.8rem;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.explore-search-input::placeholder { color: rgba(255,255,255,0.35); }
.explore-search-input:focus { border-color: var(--primary); }
.explore-search-icon {
  position: absolute;
  right: 1.6rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.35);
  pointer-events: none;
}
.explore-search-results {
  position: absolute;
  top: 100%;
  left: 1rem;
  right: 1rem;
  background: #1e1e1e;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  max-height: 320px;
  overflow-y: auto;
  z-index: 1001;
  display: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.explore-search-results.visible { display: block; }
.explore-search-section-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.35);
  padding: 0.5rem 0.85rem 0.25rem;
  font-weight: 600;
}
.explore-search-result-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.85rem;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  color: #fff;
  font-size: 0.82rem;
}
.explore-search-result-item:hover { background: rgba(255,255,255,0.08); }

/* Tab bar */
.explore-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding: 0 1rem;
  background: #111;
  flex-shrink: 0;
  overflow-x: auto;
}
.explore-tab {
  padding: 0.9rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
  font-family: var(--font-body);
}
.explore-tab.active {
  color: #fff;
  border-bottom-color: var(--primary);
}
.explore-tab:hover { color: rgba(255,255,255,0.8); }

/* Content header */
.explore-content-header {
  padding: 1.25rem 1.5rem 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.explore-content-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.25rem;
}
.explore-content-subtitle {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
}

/* Content list */
.explore-content-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0;
}
.explore-content-list::-webkit-scrollbar { width: 4px; }
.explore-content-list::-webkit-scrollbar-track { background: transparent; }
.explore-content-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

.explore-empty {
  padding: 3rem 1.5rem;
  text-align: center;
  color: rgba(255,255,255,0.3);
  font-size: 0.875rem;
}

.explore-dest-item {
  display: flex;
  align-items: center;
  padding: 0 1.5rem 0 0;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.15s;
}
.explore-dest-item:hover { background: rgba(255,255,255,0.05); }
.explore-dest-item.active { background: rgba(var(--primary-rgb, 211,47,47), 0.12); }
.explore-dest-link {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 0.5rem 0.85rem 1.5rem;
  text-decoration: none;
  min-width: 0;
  color: inherit;
}

.explore-dest-marker {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.explore-dest-info { flex: 1; min-width: 0; }
.explore-dest-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.explore-dest-count { font-size: 0.75rem; color: rgba(255,255,255,0.4); }
.explore-dest-arrow { color: rgba(255,255,255,0.25); font-size: 1rem; flex-shrink: 0; }
.explore-locate-on-map {
  background: none;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  padding: 0.3rem;
  cursor: pointer;
  color: rgba(255,255,255,0.4);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.explore-locate-on-map:hover {
  color: #fff;
  border-color: var(--primary);
  background: rgba(var(--primary-rgb, 211,47,47), 0.15);
}

/* Article item in content list */
.explore-article-item {
  display: flex;
  align-items: center;
  padding: 0 1.5rem 0 0;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.15s;
}
.explore-article-item:hover { background: rgba(255,255,255,0.05); }
.explore-article-item.active { background: rgba(var(--primary-rgb, 211,47,47), 0.12); }
.explore-article-link {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 0.5rem 0.75rem 1.5rem;
  text-decoration: none;
  min-width: 0;
  color: inherit;
}
.explore-article-thumb {
  width: 3.5rem;
  height: 2.5rem;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  background: #222;
}
.explore-article-info { flex: 1; min-width: 0; }
.explore-article-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.explore-article-city {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.4);
}
.explore-article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.15rem;
}
.explore-article-dest,
.explore-article-days,
.explore-article-category {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.45);
  white-space: nowrap;
}
.explore-article-dest::after,
.explore-article-days::after {
  content: '·';
  margin-left: 0.25rem;
  color: rgba(255,255,255,0.25);
}
.explore-article-category:last-child::after,
.explore-article-days:last-child::after,
.explore-article-dest:last-child::after {
  content: '';
  margin-left: 0;
}
.explore-distance-badge {
  font-size: 0.65rem;
  color: var(--primary);
  font-weight: 600;
}

/* Collection item in content list */
.explore-collection-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  text-decoration: none;
  transition: background 0.15s;
}
.explore-collection-item:hover { background: rgba(255,255,255,0.05); }
.explore-collection-thumb {
  width: 3.5rem;
  height: 2.5rem;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  background: #222;
}
.explore-collection-info { flex: 1; min-width: 0; }
.explore-collection-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.explore-collection-count {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.4);
}

/* Map controls */
.explore-map-controls {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.explore-locate-btn {
  background: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #333;
  white-space: nowrap;
}
.explore-locate-btn:hover { background: #f0f0f0; }

.explore-decision-layers {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 1000;
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(15, 15, 25, 0.88);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.explore-decision-layer {
  min-width: 4.75rem;
  height: 2rem;
  padding: 0 0.65rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
}
.explore-decision-layer:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}
.explore-decision-layer.active {
  background: #fff;
  color: #171717;
}

.explore-primary-panel {
  position: absolute;
  left: 1rem;
  bottom: 6rem;
  z-index: 850;
  width: min(34rem, calc(100vw - 2rem));
  max-height: min(44vh, 21rem);
  overflow: auto;
  pointer-events: none;
  display: grid;
  gap: 0.6rem;
}
.explore-primary-panel > * {
  pointer-events: auto;
}
.explore-primary-entry-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}
.explore-primary-entry {
  min-width: 0;
  height: auto;
  padding: 0.65rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(15, 15, 25, 0.9);
  color: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.explore-primary-entry.active {
  background: #fff;
  color: #171717;
}
.explore-primary-entry-icon {
  display: inline-flex;
  width: 1.35rem;
  height: 1.35rem;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(245, 124, 0, 0.18);
  color: #f57c00;
  font-size: 0.78rem;
  font-weight: 800;
}
.explore-primary-entry-copy {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}
.explore-primary-entry-title {
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: normal;
}
.explore-primary-entry-desc {
  font-size: 0.68rem;
  line-height: 1.25;
  opacity: 0.72;
}
.explore-mixed-results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}
.explore-mixed-result {
  min-width: 0;
  min-height: 5rem;
  padding: 0.65rem;
  display: grid;
  align-content: start;
  gap: 0.2rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(15, 15, 25, 0.84);
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
  font-family: var(--font-body);
}
.explore-mixed-result:hover {
  background: rgba(30, 30, 42, 0.92);
  text-decoration: none;
}
.explore-mixed-result--poi { border-top: 3px solid #f57c00; }
.explore-mixed-result--route { border-top: 3px solid #22c55e; }
.explore-mixed-result--guide { border-top: 3px solid #2563eb; }
.explore-mixed-type {
  font-size: 0.66rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.58);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.explore-mixed-title {
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.25;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.explore-mixed-meta {
  font-size: 0.68rem;
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.58);
}
.explore-mixed-results--panel {
  padding: 0 0.75rem 0.5rem;
  grid-template-columns: 1fr;
}
.explore-mixed-results--panel .explore-mixed-result {
  min-height: 0;
}

/* Fullscreen toggle button (TOU-1698) */
.explore-fullscreen-btn {
  padding: 0.5rem;
  width: 32px;
  height: 32px;
  justify-content: center;
  color: #333;
}
.explore-fullscreen-btn .explore-fullscreen-icon-collapse { display: none; }
/* When the panel is in CSS-fallback fullscreen, swap to the collapse icon */
.explore-fullscreen-active .explore-fullscreen-btn .explore-fullscreen-icon-expand { display: none; }
.explore-fullscreen-active .explore-fullscreen-btn .explore-fullscreen-icon-collapse { display: block; }
/* When the panel is in native Fullscreen API mode, also swap the icon */
.explore-map-panel:fullscreen .explore-fullscreen-btn .explore-fullscreen-icon-expand { display: none; }
.explore-map-panel:fullscreen .explore-fullscreen-btn .explore-fullscreen-icon-collapse { display: block; }
.explore-map-panel:-webkit-full-screen .explore-fullscreen-btn .explore-fullscreen-icon-expand { display: none; }
.explore-map-panel:-webkit-full-screen .explore-fullscreen-btn .explore-fullscreen-icon-collapse { display: block; }

/* CSS fallback fullscreen state (iOS Safari has no element Fullscreen API) */
.explore-map-panel.explore-fullscreen-active {
  position: fixed;
  inset: 0;
  z-index: 3000;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
}
.explore-map-panel.explore-fullscreen-active #explore-map {
  width: 100%;
  height: 100%;
}
.explore-location-status {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Location status hidden by default */
#explore-location-status { display: none; }

/* Location denied banner */
.explore-location-denied {
  display: none;
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  z-index: 1000;
  background: rgba(30,30,30,0.95);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  color: #fff;
  font-size: 0.8rem;
}
.explore-denied-msg { margin-bottom: 0.5rem; }
.explore-reauth-btn-sm { font-size: 0.75rem; padding: 0.35rem 0.65rem; }

/* Location found toast */
.explore-location-toast {
  display: none;
  position: absolute;
  top: 4rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1001;
  background: rgba(33,150,243,0.92);
  color: #fff;
  border-radius: 4px;
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  white-space: nowrap;
  pointer-events: none;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .explore-layout {
    flex-direction: column;
    height: auto;
    min-height: calc(100vh - 4.5rem);
  }
  .explore-map-panel {
    flex: 0 0 auto;
    height: 45vh;
    min-height: 320px;
  }
  .explore-content-panel {
    flex: 1;
    border-left: none;
    border-top: 1px solid rgba(255,255,255,0.08);
    min-height: 360px;
    max-height: 60vh;
  }
  /* Mobile: full-screen map with bottom sheet */
  .explore-layout.mobile-mode {
    height: calc(100vh - 4.5rem);
    position: relative;
    overflow: hidden;
  }
  .explore-layout.mobile-mode .explore-map-panel {
    flex: 1 1 auto;
    height: 100%;
    min-height: unset;
  }
  .explore-layout.mobile-mode .explore-content-panel {
    display: none;
  }
  .explore-bottom-sheet {
    display: flex;
    flex-direction: column;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #0f0f0f;
    border-top: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px 14px 0 0;
    z-index: 1100;
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: height;
    overflow: hidden;
  }
  .explore-bottom-sheet.sheet-collapsed {
    height: 3.5rem;
  }
  .explore-bottom-sheet.sheet-half {
    height: 50vh;
  }
  .explore-bottom-sheet.sheet-full {
    height: 90vh;
  }
  .explore-sheet-handle-area {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0 0.25rem;
    cursor: grab;
    touch-action: none;
  }
  .explore-sheet-handle {
    width: 2.5rem;
    height: 4px;
    background: rgba(255,255,255,0.25);
    border-radius: 2px;
  }
  .explore-sheet-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .explore-map-fullscreen {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }
  .explore-map-controls-mobile {
    position: absolute;
    bottom: calc(var(--explore-mobile-bottom-ui) + 0.75rem);
    right: 1rem;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }
  .explore-map-panel .leaflet-bottom.leaflet-left,
  .explore-map-panel .leaflet-bottom.leaflet-right {
    bottom: var(--explore-mobile-bottom-ui);
  }
  .explore-layout:has(~ .map-popup-card.open) .explore-map-controls-mobile {
    bottom: calc(min(60vh, 24rem) + 1rem + env(safe-area-inset-bottom, 0px));
  }
  .explore-search-toggle {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 1050;
    background: #1e1e1e;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-family: var(--font-body);
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    max-width: calc(100% - 1.5rem);
  }
  .explore-map-controls { display: none; }
  .explore-search-overlay {
    position: fixed;
    inset: 0;
    background: #111;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    transform: translateY(-100%);
    transition: transform 0.25s ease;
  }
  .explore-search-overlay.visible {
    transform: translateY(0);
  }
  .explore-search-overlay-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  .explore-search-overlay-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.2rem;
    line-height: 1;
    flex-shrink: 0;
  }
  .explore-search-overlay-input {
    flex: 1;
    padding: 0.6rem 0.85rem;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    background: rgba(255,255,255,0.07);
    color: #fff;
    font-size: 0.9rem;
    font-family: var(--font-body);
    outline: none;
  }
  .explore-search-overlay-results {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
  }
  /* TOU-1698: Mobile filter toggle button (beside search toggle) */
  .explore-filter-toggle {
    position: absolute;
    top: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1050;
    background: #1e1e1e;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-family: var(--font-body);
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  }
  .explore-primary-panel {
    left: 0.75rem;
    right: 0.75rem;
    bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px));
    width: auto;
  }
  .explore-primary-entry-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
  }
  .explore-primary-entry {
    padding: 0.5rem;
    gap: 0.35rem;
  }
  .explore-primary-entry-icon {
    width: 1.1rem;
    height: 1.1rem;
    font-size: 0.65rem;
  }
  .explore-primary-entry-title {
    font-size: 0.72rem;
  }
  .explore-primary-entry-desc {
    display: none;
  }
  .explore-mixed-results {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
  .explore-primary-panel > .explore-mixed-results {
    display: none;
  }
  /* Mobile filter drawer: reserve a small top gutter and let the body scroll. */
  .explore-filter-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1990;
    opacity: 0;
    visibility: hidden;
    transition: none;
  }
  .explore-filter-backdrop.open {
    opacity: 1;
    visibility: visible;
  }
  .explore-filter-drawer {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: env(safe-area-inset-bottom, 0px);
    height: 60vh;
    height: 60dvh;
    max-height: calc(100vh - 1rem);
    max-height: calc(100dvh - 1rem);
    display: flex;
    flex-direction: column;
    background: #0f0f0f;
    border-top: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px 14px 0 0;
    z-index: 2000;
    transform: translate3d(0, 100%, 0);
    transition: transform 0.25s ease;
    will-change: transform;
  }
  .explore-filter-drawer.open {
    transform: translate3d(0, 0, 0);
  }
  .explore-filter-drawer-handle-area {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0 0.25rem;
    cursor: grab;
    touch-action: none;
  }
  .explore-filter-drawer-handle {
    width: 2.5rem;
    height: 4px;
    background: rgba(255,255,255,0.25);
    border-radius: 2px;
  }
  .explore-filter-drawer-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.25rem 1.25rem 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .explore-filter-drawer-title {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
  }
  .explore-filter-drawer-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.2rem;
    line-height: 1;
  }
  .explore-filter-drawer-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 1rem 1.25rem;
  }
  .explore-filter-drawer-select {
    width: 100%;
  }
  .explore-filter-drawer-count {
    margin-top: 0.85rem;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
  }
  .explore-filter-drawer-footer {
    flex-shrink: 0;
    display: flex;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(255,255,255,0.08);
  }
  .explore-filter-drawer-reset {
    flex: 0 0 auto;
    padding: 0.65rem 1.1rem;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    color: #fff;
    font-size: 0.85rem;
    font-family: var(--font-body);
    cursor: pointer;
  }
  .explore-filter-drawer-apply {
    flex: 1;
    padding: 0.65rem 1.1rem;
    background: #2563eb;
    border: 1px solid #2563eb;
    border-radius: 8px;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
  }
}
@media (min-width: 769px) {
  .explore-bottom-sheet,
  .explore-map-controls-mobile,
  .explore-search-toggle,
  .explore-filter-backdrop,
  .explore-filter-drawer,
  .explore-search-overlay {
    display: none !important;
  }
}
.explore-map-controls-mobile { bottom: calc(var(--explore-mobile-bottom-ui, 5.5rem) + 0.75rem); }

/* Itinerary item in content list */
.explore-itinerary-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  text-decoration: none;
  transition: background 0.15s;
}
.explore-itinerary-item:hover { background: rgba(255,255,255,0.05); }
.explore-itinerary-item.active { background: rgba(59,130,246,0.12); }
.explore-itinerary-thumb {
  width: 3.5rem;
  height: 2.5rem;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  background: #222;
}
.explore-itinerary-info { flex: 1; min-width: 0; }
.explore-itinerary-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.explore-itinerary-meta {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.4);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.explore-itinerary-similar {
  margin-top: 0.25rem;
  font-size: 0.68rem;
  color: rgba(255,255,255,0.55);
}
.explore-itinerary-similar-list {
  margin-top: 0.2rem;
  display: grid;
  gap: 0.15rem;
}
.explore-itinerary-similar-item {
  display: grid;
  gap: 0.05rem;
}
.explore-itinerary-similar-item span,
.explore-itinerary-similar-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.explore-itinerary-similar-item small {
  color: rgba(255,255,255,0.38);
}
.explore-itinerary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
}
.explore-itinerary-actions a,
.explore-itinerary-actions span {
  color: #93c5fd;
  text-decoration: none;
  cursor: pointer;
}

/* Route item in content list */
.explore-route-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  text-decoration: none;
  transition: background 0.15s;
}
.explore-route-item:hover { background: rgba(255,255,255,0.05); }
.explore-route-item.active { background: rgba(34,197,94,0.12); }
.explore-route-thumb {
  width: 3.5rem;
  height: 2.5rem;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  background: #222;
}
.explore-route-info { flex: 1; min-width: 0; }
.explore-route-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.explore-route-meta {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.4);
}
.explore-route-path {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.explore-route-arrow-icon {
  color: rgba(255,255,255,0.3);
  font-size: 0.65rem;
}

/* Leaflet dark map overrides */
.leaflet-container { background: #1a1a1a; }
.leaflet-tile { filter: brightness(0.85) saturate(0.9); }
.leaflet-popup-content-wrapper {
  background: #1e1e1e;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
}
.leaflet-popup-tip { background: #1e1e1e; }
.leaflet-popup-content { margin: 0.75rem 1rem; }
.leaflet-popup-content a { color: var(--primary); text-decoration: none; }
.leaflet-popup-content a:hover { text-decoration: underline; }

/* ── Default content (cold start) ── */
.explore-default-content { padding: 0.25rem 0; }
.explore-default-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  padding: 0.5rem 0.75rem 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.explore-featured-dest-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: background 0.15s;
}
.explore-featured-dest-card:hover { background: rgba(255,255,255,0.05); }
.explore-featured-dest-img {
  width: 3.5rem;
  height: 2.5rem;
  border-radius: 4px;
  object-fit: cover;
  background: rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.explore-featured-dest-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}
.explore-featured-dest-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
}
.explore-default-hint {
  padding: 1rem 0.75rem 0.75rem;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.35);
  text-align: center;
  line-height: 1.4;
}
.explore-section-title-mt { margin-top: 1rem; }

/* Mobile default content hidden */
#explore-default-content-mobile { display: none; }

/* ── Mobile map popup card ── */
/* Replaces Leaflet floating popups on mobile (<768px) with a bottom card */
.map-popup-card {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--background, #1a1a1a);
  border-radius: 1rem 1rem 0 0;
  padding: 0.75rem 1rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
  z-index: 10001;
  max-height: 60vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  color: rgba(255,255,255,0.9);
}
.map-popup-card.open {
  display: block;
  transform: translateY(0);
}
.map-popup-card-handle {
  width: 2.5rem;
  height: 4px;
  background: rgba(255,255,255,0.25);
  border-radius: 100rem;
  margin: 0 auto 1rem;
  cursor: grab;
  touch-action: pan-y;
}
.map-popup-card-content {
  font-size: 0.9375rem;
  line-height: 1.5;
}
/* Touch-friendly links/buttons inside popup card */
.map-popup-card-content a,
.map-popup-card-content button {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--primary, #e8341c);
}
.map-popup-card-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 10000;
}
.map-popup-card-overlay.open {
  display: block;
}

/* ===== Map Mobile Interaction Improvements ===== */

/* Pinch zoom gesture hint overlay */
.map-pinch-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  pointer-events: none;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.3s ease;
  white-space: nowrap;
}

.map-pinch-hint.visible {
  opacity: 1;
}

.map-pinch-hint svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* POI Bottom Drawer for mobile */
.poi-bottom-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.15);
  z-index: 2000;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  max-height: 70vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.poi-bottom-drawer.open {
  transform: translateY(0);
}

.poi-bottom-drawer__handle {
  width: 36px;
  height: 4px;
  background: #d1d5db;
  border-radius: 2px;
  margin: 12px auto 8px;
  flex-shrink: 0;
}

.poi-bottom-drawer__header {
  display: flex;
  align-items: flex-start;
  padding: 0 16px 12px;
  gap: 12px;
}

.poi-bottom-drawer__close {
  margin-left: auto;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: #6b7280;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  flex-shrink: 0;
}

.poi-bottom-drawer__image {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.poi-bottom-drawer__info {
  flex: 1;
  min-width: 0;
}

.poi-bottom-drawer__name {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 4px;
  line-height: 1.3;
}

.poi-bottom-drawer__category {
  font-size: 12px;
  color: #6b7280;
  margin: 0 0 6px;
}

.poi-bottom-drawer__rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: #f59e0b;
}

.poi-bottom-drawer__body {
  padding: 0 16px 16px;
}

.poi-bottom-drawer__description {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.5;
  margin: 0 0 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.poi-bottom-drawer__actions {
  display: flex;
  gap: 8px;
}

.poi-bottom-drawer__btn {
  flex: 1;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  border: none;
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s;
}

.poi-bottom-drawer__btn--primary {
  background: #2563eb;
  color: #fff;
}

.poi-bottom-drawer__btn--secondary {
  background: #f3f4f6;
  color: #374151;
}

.poi-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 1999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.poi-drawer-backdrop.open {
  display: block;
  opacity: 1;
}

@media (min-width: 768px) {
  .poi-bottom-drawer,
  .poi-drawer-backdrop {
    display: none !important;
  }
}

/* ── Filter Toggle Button (TOU-1527) ── */
.explore-filter-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  margin: 0.5rem 1rem;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  font-size: 0.75rem;
  font-family: var(--font-body);
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
  align-self: flex-start;
}
.explore-filter-toggle:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

/* ── Filter Panel (TOU-1527) ── */
.explore-filter-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 260px;
  max-width: calc(100vw - 2rem);
  height: 100vh;
  background: #161616;
  border-left: 1px solid rgba(255,255,255,0.1);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  opacity: 0;
  visibility: visible;
  pointer-events: none;
  transition: none;
  overflow: hidden;
}
.explore-filter-panel.open {
  right: 0;
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.explore-filter-panel[aria-hidden="false"] {
  right: 0;
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.explore-filter-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1199;
}
.explore-filter-overlay.open {
  display: block;
}
.explore-filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.explore-filter-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  font-size: 0.8rem;
  font-family: var(--font-body);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}
.explore-filter-close:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}
.explore-filter-body {
  padding: 1rem 1.25rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.explore-filter-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.4);
  margin-bottom: 0.6rem;
  font-weight: 600;
}
.explore-filter-checkbox {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0;
  cursor: pointer;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.8);
  user-select: none;
}
.explore-filter-checkbox input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
  cursor: pointer;
}
.explore-filter-reset {
  margin-top: 1.25rem;
  width: 100%;
  padding: 0.5rem;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  font-size: 0.78rem;
  font-family: var(--font-body);
  transition: background 0.2s;
  position: sticky;
  bottom: 0;
}
.explore-filter-reset:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

/* ── POI List Items (TOU-1527) ── */
.explore-poi-list-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.15s;
  cursor: pointer;
}
.explore-poi-list-item:hover { background: rgba(255,255,255,0.05); }
.explore-poi-type-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f57c00;
  flex-shrink: 0;
}
.explore-poi-info { flex: 1; min-width: 0; }
.explore-poi-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.explore-poi-type {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.4);
  text-transform: capitalize;
}
.explore-poi-navigate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: rgba(245,124,0,0.15);
  border: 1px solid rgba(245,124,0,0.3);
  color: #f57c00;
  text-decoration: none;
  flex-shrink: 0;
  transition: background 0.2s;
}
.explore-poi-navigate-btn:hover {
  background: rgba(245,124,0,0.3);
}

/* ── Popup Action Buttons (TOU-1527) ── */
.explore-popup-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}
.explore-popup-action-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.65rem;
  border-radius: 4px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.85);
  font-size: 0.72rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.explore-popup-action-btn:hover {
  background: rgba(255,255,255,0.18);
  color: #fff;
  text-decoration: none;
}
.explore-popup-navigate {
  color: #f57c00;
  border-color: rgba(245,124,0,0.3);
  background: rgba(245,124,0,0.1);
}
.explore-popup-navigate:hover {
  background: rgba(245,124,0,0.2);
  color: #f57c00;
}

/* ── Distance Band Headers (TOU-1527) ── */
.explore-distance-band-header {
  padding: 0.4rem 1.5rem 0.25rem;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.35);
  font-weight: 600;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* ── POI Cluster/Pin Marker Styles (TOU-1527) ── */
.explore-poi-cluster-icon {
  background: #f57c00;
  color: #fff;
  border-radius: 50%;
  text-align: center;
  font-weight: 700;
  font-size: 0.7rem;
  border: 2px solid rgba(255,255,255,0.8);
}

/* Hidden-by-default elements (replaces inline style="display:none") */
.explore-sort-distance-btn { display: none; }
.explore-filter-select--hidden { display: none; }

/* ── TOU-3480: Compact filter row (sort dropdown + more-filters button) ── */
.explore-compact-filter-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem 0;
  flex-shrink: 0;
}

.explore-sort-select {
  flex: 1;
  min-width: 0;
  padding: 0.35rem 0.6rem;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  color: rgba(255,255,255,0.8);
  font-size: 0.75rem;
  font-family: var(--font-body);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  padding-right: 1.6rem;
}
.explore-sort-select:focus {
  outline: none;
  border-color: rgba(255,255,255,0.3);
}
.explore-sort-select option {
  background: #1a1a2e;
  color: #fff;
}

.explore-more-filters-btn {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.65rem;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  font-size: 0.75rem;
  font-family: var(--font-body);
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.explore-more-filters-btn:hover,
.explore-more-filters-btn.active {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border-color: rgba(255,255,255,0.25);
}
.explore-more-filters-btn.has-active-filter {
  border-color: #f57c00;
  color: #f57c00;
}
.explore-more-filters-arrow {
  font-size: 0.65rem;
  transition: transform 0.2s;
}
.explore-more-filters-btn.active .explore-more-filters-arrow {
  transform: rotate(180deg);
}

/* ── TOU-3480: Advanced filters panel (collapsed by default) ── */
.explore-advanced-filters {
  padding: 0.75rem 1rem 0.5rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  overflow-y: auto;
  max-height: 40vh;
}
.explore-advanced-filters[hidden] { display: none; }

.explore-filter-group {
  margin-bottom: 0.85rem;
}
.explore-filter-group-label {
  display: block;
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.38);
  margin-bottom: 0.45rem;
  font-weight: 600;
}
.explore-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.explore-chip {
  padding: 0.3rem 0.65rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  color: rgba(255,255,255,0.65);
  font-size: 0.73rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.explore-chip:hover {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.9);
}
.explore-chip.active {
  background: rgba(245,124,0,0.18);
  border-color: #f57c00;
  color: #f57c00;
  font-weight: 600;
}

/* ── TOU-3402: POI category Tab filter bar ── */
.explore-poi-cat-tabs {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 410;
  display: flex;
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: rgba(15, 15, 15, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0 0.25rem;
  box-sizing: border-box;
}
.explore-poi-cat-tabs::-webkit-scrollbar { display: none; }

.explore-poi-cat-tab {
  flex-shrink: 0;
  padding: 0.5rem 0.9rem;
  font-size: 0.78rem;
  font-weight: 500;
  border: none;
  background: none;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.55);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.explore-poi-cat-tab:hover { color: rgba(255, 255, 255, 0.85); }
.explore-poi-cat-tab.active {
  color: #fff;
  border-bottom-color: #f57c00;
}

/* On mobile, place below the search/filter toggles */
@media (max-width: 768px) {
  .explore-poi-cat-tabs {
    top: auto;
    bottom: 0;
    right: 0;
    left: 0;
    border-bottom: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
}
