/* WO-357 / WO-357A / WO-360 / WO-372 / WO-375 / WO-384F / WO-384G / WO-384H Atlas Map
 * Pin card + map shell + Featured Adventures + category filters + progressive merch
 * WO-375: pin enter animation must not animate Leaflet icon transform
 * WO-384F: trackball controls · My Maps pin colors · attribution chrome (prefix off)
 * WO-384G: basemap shell contrast · pin halo · category chips bound to pin colors
 * WO-384H: Dude RV experience categories · pin shapes/badges/dance · discovery panel
 * WO-384J: Content Available inventory on location panel (places-only pins)
 */

/* Mount root must reserve height before/after JS (homepage title+empty box regression) */
[data-atlas-mount],
#atlas-map {
  min-height: 500px;
  width: 100%;
}

.atlas-map-root {
  --atlas-blue: #1e3a8a;
  --atlas-red: #dc2626;
  --atlas-ink: #0f172a;
  --atlas-muted: #64748b;
  --atlas-panel: #f8fafc;
  --atlas-border: #e2e8f0;
  --atlas-accent: #0369a1;
  /* WO-384G: map surface reads as a defined cartographic plate (no tile CSS filter) */
  --atlas-map-wash: #c5d0dc;
  --atlas-map-edge: #94a3b8;
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  min-height: 500px;
  border-radius: 0.75rem;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--atlas-border);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.04);
  z-index: 0;
}

.atlas-map-status { order: 1; }
.atlas-layer-filters { order: 2; }
.atlas-pin-panel { order: 3; }
.atlas-map-canvas { order: 4; }

@media (min-width: 900px) {
  .atlas-map-root {
    grid-template-columns: minmax(280px, 340px) 1fr;
    grid-template-rows: auto auto 1fr;
  }
  .atlas-map-status {
    grid-column: 1 / -1;
    order: 0;
  }
  .atlas-layer-filters {
    grid-column: 1 / -1;
    order: 0;
  }
  .atlas-pin-panel {
    grid-row: 3;
    grid-column: 1;
    order: 0;
  }
  .atlas-map-canvas {
    grid-row: 3;
    grid-column: 2;
    order: 0;
  }
}

.atlas-map-status {
  margin: 0;
  padding: 0.5rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--atlas-blue);
  background: #eff6ff;
  border-bottom: 1px solid #dbeafe;
}

/* WO-372 category layer filters (inside DudeRV — not a second map) */
/* WO-384G: chips bind to --atlas-cat-color from MYMAPS_PIN_COLORS via JS */
.atlas-layer-filters {
  background: #fff;
  border-bottom: 1px solid var(--atlas-border);
  padding: 0.55rem 0.75rem;
}

.atlas-layer-filters-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
}

.atlas-layer-filters-label {
  flex: 1 1 100%;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--atlas-ink);
  margin-bottom: 0.15rem;
}

/* —— WO-384K Contextual discovery flow —— */
.atlas-discovery-flow {
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
}

.atlas-disc-step {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.atlas-disc-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  margin-right: 0.25rem;
  border-radius: 0.25rem;
  background: #1e3a5f;
  color: #fff;
  font-size: 0.625rem;
  font-weight: 900;
  vertical-align: middle;
}

.atlas-disc-step-hint {
  margin: 0;
  font-size: 0.6875rem;
  color: var(--atlas-muted);
  line-height: 1.35;
}

.atlas-disc-flow-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.atlas-exp-chip--step1 {
  cursor: pointer;
}

.atlas-exp-chip--affinity {
  border-style: dashed;
  opacity: 0.9;
}

.atlas-refine-chip {
  border-left-width: 3px;
  border-left-color: #64748b;
  background: #f8fafc;
  font-weight: 600;
}

.atlas-refine-chip.is-on {
  border-left-color: #1e3a5f;
  background: #fff;
}

.atlas-disc-context {
  display: inline-block;
  margin-left: 0.45rem;
  padding: 0.1rem 0.4rem;
  border-radius: 0.25rem;
  background: #e2e8f0;
  color: #1e3a5f;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  vertical-align: middle;
}

.atlas-disc-card--playlist {
  border-left: 3px solid #1e3a5f;
  background: linear-gradient(90deg, rgba(30, 58, 95, 0.05), #fff);
}

.atlas-content-hub-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.625rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1e3a5f;
}

.atlas-playlist-membership {
  margin: 0 0 0.65rem;
}

.atlas-playlist-membership-label {
  margin: 0 0 0.3rem;
  font-size: 0.625rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--atlas-muted);
}

.atlas-playlist-membership-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.atlas-playlist-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border-radius: 0.3rem;
  background: #e8eef5;
  border: 1px solid #cbd5e1;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #1e3a5f;
}

.atlas-playlist-chip a {
  color: inherit;
  text-decoration: none;
}

.atlas-playlist-chip a:hover,
.atlas-playlist-chip a:focus-visible {
  text-decoration: underline;
}

.atlas-fa-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.atlas-layer-filters-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  flex: 1 1 auto;
  min-width: 0;
}

.atlas-layer-chip {
  --atlas-cat-color: var(--atlas-blue);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.4rem 0.65rem 0.4rem 0.5rem;
  min-height: 2rem;
  border: 1.5px solid #cbd5e1;
  border-left: 3.5px solid var(--atlas-cat-color);
  border-radius: 0.45rem;
  background: #f8fafc;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--atlas-ink);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease,
    opacity 0.15s ease;
}

.atlas-layer-chip input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.atlas-layer-chip-marker {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--atlas-cat-color);
  border: 1.5px solid #fff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.45), 0 1px 2px rgba(15, 23, 42, 0.2);
  flex-shrink: 0;
  pointer-events: none;
}

.atlas-layer-chip-text {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.atlas-layer-chip.is-on {
  background: #fff;
  border-color: var(--atlas-cat-color);
  border-left-width: 4px;
  color: var(--atlas-ink);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  opacity: 1;
}

.atlas-layer-chip.is-on .atlas-layer-chip-marker {
  box-shadow: 0 0 0 1.5px rgba(15, 23, 42, 0.5), 0 1px 3px rgba(15, 23, 42, 0.25);
}

.atlas-layer-chip.is-off {
  background: #f1f5f9;
  border-color: #cbd5e1;
  border-left-color: var(--atlas-cat-color);
  opacity: 0.72;
  color: #334155;
}

.atlas-layer-chip.is-off .atlas-layer-chip-marker {
  opacity: 0.55;
  filter: saturate(0.65);
}

.atlas-layer-chip.is-off .atlas-layer-chip-text {
  opacity: 0.92;
}

.atlas-layer-chip:hover {
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1);
  opacity: 1;
}

.atlas-layer-chip:focus-within {
  outline: 2px solid var(--atlas-cat-color);
  outline-offset: 2px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
  opacity: 1;
}

.atlas-layer-chip em {
  font-style: normal;
  font-weight: 800;
  color: var(--atlas-muted);
}

.atlas-layer-chip.is-on em {
  color: var(--atlas-ink);
}

.atlas-layer-all {
  border: 1.5px solid #cbd5e1;
  border-radius: 0.45rem;
  background: #fff;
  color: var(--atlas-blue);
  font-size: 0.6875rem;
  font-weight: 800;
  padding: 0.4rem 0.65rem;
  min-height: 2rem;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.atlas-layer-all:hover {
  background: #eff6ff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.atlas-layer-all:focus-visible {
  outline: 2px solid var(--atlas-blue);
  outline-offset: 2px;
}

/* WO-384G — My Maps folder pin guide (secondary; collapsed by default) */
.atlas-pin-legend {
  margin-top: 0.55rem;
  padding-top: 0.45rem;
  border-top: 1px solid #e2e8f0;
}

.atlas-pin-legend-summary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.625rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--atlas-muted);
  cursor: pointer;
  list-style: none;
  padding: 0.2rem 0;
  user-select: none;
}

.atlas-pin-legend-summary::-webkit-details-marker {
  display: none;
}

.atlas-pin-legend-summary::before {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid var(--atlas-muted);
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
  transition: transform 0.15s ease;
}

.atlas-pin-legend[open] .atlas-pin-legend-summary::before {
  transform: rotate(90deg);
}

.atlas-pin-legend-summary:hover,
.atlas-pin-legend-summary:focus-visible {
  color: var(--atlas-blue);
}

.atlas-pin-legend-summary:focus-visible {
  outline: 2px solid var(--atlas-blue);
  outline-offset: 2px;
  border-radius: 0.2rem;
}

.atlas-pin-legend-list {
  list-style: none;
  margin: 0.45rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
}

.atlas-pin-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--atlas-ink);
}

.atlas-pin-legend-swatch {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  border: 1.5px solid #fff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.4), 0 1px 2px rgba(15, 23, 42, 0.2);
  flex-shrink: 0;
}

.atlas-pin-legend-label {
  max-width: 14rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.atlas-pin-legend-item em {
  font-style: normal;
  font-weight: 800;
  color: var(--atlas-muted);
}

.atlas-pin-type {
  margin: 0 0 0.15rem;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--atlas-accent);
}

.atlas-nearby {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--atlas-border);
}

.atlas-nearby-list {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.atlas-nearby-link {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.35rem 0;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--atlas-blue);
  cursor: pointer;
}

.atlas-nearby-link:hover {
  text-decoration: underline;
}

.atlas-nearby-km {
  font-weight: 600;
  color: var(--atlas-muted);
  font-size: 0.75rem;
}

/* WO-399B: Leaflet scale — keep legible on Dude RV map wash */
.atlas-map-canvas .leaflet-control-scale {
  margin: 0 0 10px 10px;
  border: none;
  background: transparent;
}
.atlas-map-canvas .leaflet-control-scale-line {
  border: 2px solid rgba(15, 23, 42, 0.75);
  border-top: none;
  background: rgba(255, 255, 255, 0.88);
  color: #0f172a;
  font-weight: 700;
  font-size: 11px;
  line-height: 1.2;
  padding: 2px 4px 1px;
  text-shadow: none;
}

.atlas-map-canvas {
  min-height: 420px;
  height: 500px;
  width: 100%;
  background: var(--atlas-map-wash);
  position: relative;
  z-index: 0;
  /* WO-384G: subtle container contrast — pins stay dominant; no tile filter */
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.atlas-map-canvas.leaflet-container,
.atlas-map-root .leaflet-container {
  width: 100%;
  height: 100%;
  min-height: 420px;
  background: var(--atlas-map-wash);
  z-index: 0;
}

/*
 * Tailwind Preflight sets img { max-width: 100%; height: auto }.
 * WO-357A: restore Leaflet sizing inside Atlas only.
 */
.atlas-map-root .leaflet-container img,
.atlas-map-root .leaflet-tile,
.atlas-map-root .leaflet-marker-icon,
.atlas-map-root .leaflet-marker-shadow,
.atlas-map-root .leaflet-image-layer {
  max-width: none !important;
  max-height: none !important;
}

/* WO-384G: no blanket filter on tiles — keep CARTO Voyager clarity */

.atlas-pin-panel {
  background: var(--atlas-panel);
  border-bottom: 1px solid var(--atlas-border);
  max-height: 420px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 900px) {
  .atlas-pin-panel {
    border-bottom: 0;
    border-right: 1px solid var(--atlas-border);
    max-height: 500px;
  }
}

.atlas-pin-idle {
  padding: 1.25rem;
  color: var(--atlas-muted);
  font-size: 0.875rem;
  line-height: 1.5;
  font-weight: 500;
}

.atlas-pin-error {
  color: #991b1b;
}

/* —— Calm custom markers (no continuous bounce) —— */
/*
 * WO-375: NEVER animate `transform` on `.atlas-marker-wrap` / `.leaflet-marker-icon`.
 * Leaflet positions markers with inline transform; a CSS transform animation on the
 * same element overrides translate3d and makes pins vanish when clusters uncluster
 * on zoom-in. Animate only the inner .atlas-marker span.
 */
.atlas-marker-wrap {
  background: transparent !important;
  border: 0 !important;
}

.atlas-marker.atlas-marker-enter {
  animation: atlas-pin-in 0.45s ease-out both;
}

@keyframes atlas-pin-in {
  from {
    opacity: 0;
    transform: scale(0.55);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .atlas-marker.atlas-marker-enter {
    animation: none;
  }
}

.atlas-marker {
  display: block;
  width: 20px;
  height: 20px;
  margin: 4px;
  border-radius: 50%;
  background: var(--atlas-pin-fill, var(--atlas-blue));
  /* WO-384G: white halo + dark outer ring so pins win over pale Voyager wash */
  border: 2.5px solid #fff;
  box-shadow:
    0 0 0 2px rgba(15, 23, 42, 0.62),
    0 2px 6px rgba(15, 23, 42, 0.42);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.atlas-marker--selected {
  /* Keep folder color fill; selected ring uses DudeRV red for clarity */
  transform: scale(1.35);
  box-shadow:
    0 0 0 3px rgba(220, 38, 38, 0.6),
    0 0 0 5.5px rgba(255, 255, 255, 0.98),
    0 3px 9px rgba(15, 23, 42, 0.48);
  border-color: #fff;
}

/* WO-384F trackball surface + chrome hit targets */
.atlas-map-surface {
  outline: none;
  cursor: grab;
}

.atlas-map-surface:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(30, 58, 138, 0.45);
}

.atlas-map-surface.is-mid-panning,
.atlas-map-surface.is-space-grab,
.atlas-map-root .leaflet-drag-target {
  cursor: grabbing;
}

.atlas-map-root .leaflet-control-zoom a {
  width: 34px;
  height: 34px;
  line-height: 34px;
  font-size: 1.125rem;
  color: var(--atlas-blue);
  border-color: #cbd5e1 !important;
}

.atlas-map-root .leaflet-control-zoom a:hover {
  background: #eff6ff;
  color: var(--atlas-blue);
}

/*
 * WO-384F attribution chrome — required OSM + CARTO credits stay visible & readable.
 * Leaflet prefix is removed in JS (setPrefix(false)); do NOT hide this control.
 */
.atlas-map-root .leaflet-control-attribution {
  background: rgba(248, 250, 252, 0.92) !important;
  color: #475569;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.6875rem;
  line-height: 1.35;
  padding: 0.2rem 0.45rem;
  border-radius: 0.35rem 0 0 0;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-right: 0;
  border-bottom: 0;
  max-width: min(100%, 22rem);
  box-shadow: 0 -1px 4px rgba(15, 23, 42, 0.06);
}

.atlas-map-root .leaflet-control-attribution a {
  color: #1e3a8a;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}

.atlas-map-root .leaflet-control-attribution a:hover {
  color: #0369a1;
}

/* —— Compact Featured Adventures (replaces idle instructional copy) —— */
.atlas-fa {
  padding: 0.75rem 0.85rem 1rem;
}

.atlas-fa-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.atlas-fa-head h3 {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--atlas-blue);
}

.atlas-fa-nav {
  display: flex;
  gap: 0.25rem;
}

.atlas-fa-btn {
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.4rem;
  background: #fff;
  color: var(--atlas-blue);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  font-weight: 700;
}

.atlas-fa-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.atlas-fa-btn:not(:disabled):hover {
  background: #eff6ff;
}

.atlas-fa-viewport {
  overflow: hidden;
  outline: none;
}

.atlas-fa-viewport:focus-visible {
  box-shadow: 0 0 0 2px #93c5fd;
  border-radius: 0.5rem;
}

.atlas-fa-track {
  display: flex;
  transition: transform 0.28s ease;
  will-change: transform;
}

.atlas-fa-card {
  flex: 0 0 100%;
  display: flex;
  gap: 0.65rem;
  align-items: center;
  text-align: left;
  padding: 0.5rem;
  margin: 0;
  border: 1px solid var(--atlas-border);
  border-radius: 0.65rem;
  background: #fff;
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.atlas-fa-card:hover,
.atlas-fa-card:focus-visible {
  border-color: #93c5fd;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
  outline: none;
}

.atlas-fa-card.is-selected {
  border-color: var(--atlas-red);
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
}

.atlas-fa-thumb {
  flex: 0 0 88px;
  width: 88px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 0.4rem;
  background: #0f172a;
}

.atlas-fa-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.atlas-fa-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.atlas-fa-name {
  font-size: 0.8125rem;
  font-weight: 800;
  color: var(--atlas-ink);
  line-height: 1.25;
}

.atlas-fa-where {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--atlas-muted);
}

.atlas-fa-hint {
  margin: 0.55rem 0 0;
  font-size: 0.6875rem;
  color: var(--atlas-muted);
  font-weight: 500;
}

.atlas-fa-empty {
  color: var(--atlas-muted);
  font-size: 0.875rem;
}

/* —— Place panel —— */
.atlas-pin-card {
  position: relative;
  display: flex;
  flex-direction: column;
}

.atlas-pin-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.atlas-pin-close:hover {
  background: rgba(15, 23, 42, 0.9);
}

.atlas-pin-hero {
  aspect-ratio: 16 / 9;
  background: #0f172a;
  overflow: hidden;
}

.atlas-pin-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.atlas-pin-body {
  padding: 0.85rem 1rem 1.15rem;
}

.atlas-pin-where {
  margin: 0 0 0.2rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--atlas-muted);
}

.atlas-pin-name {
  margin: 0 0 0.45rem;
  font-size: 1.125rem;
  font-weight: 900;
  color: var(--atlas-blue);
  line-height: 1.25;
}

.atlas-pin-summary {
  margin: 0 0 0.85rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #334155;
  font-weight: 500;
}

.atlas-pin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.atlas-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 800;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.atlas-btn-primary {
  background: var(--atlas-red);
  color: #fff;
}

.atlas-btn-primary:hover {
  background: #b91c1c;
  color: #fff;
}

.atlas-btn-secondary {
  background: var(--atlas-blue);
  color: #fff;
}

.atlas-btn-secondary:hover {
  background: #1e40af;
  color: #fff;
}

.atlas-btn-ghost {
  background: #fff;
  color: var(--atlas-blue);
  border: 1px solid #cbd5e1;
}

.atlas-btn-ghost:hover {
  background: #f1f5f9;
}

.atlas-meta-line {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  color: #334155;
}

.atlas-video-hub {
  margin-top: 0.35rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--atlas-border);
}

.atlas-featured-video {
  display: block;
  position: relative;
  border-radius: 0.5rem;
  overflow: hidden;
  margin-bottom: 0.5rem;
  text-decoration: none;
  color: #fff;
}

.atlas-featured-video img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.atlas-featured-video span {
  position: absolute;
  left: 0.5rem;
  bottom: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 800;
  background: rgba(15, 23, 42, 0.75);
  padding: 0.25rem 0.45rem;
  border-radius: 0.35rem;
}

.atlas-disclose {
  margin: 0.4rem 0;
  font-size: 0.75rem;
}

.atlas-disclose summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--atlas-accent);
  list-style: none;
}

.atlas-disclose summary::-webkit-details-marker {
  display: none;
}

.atlas-video-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.atlas-video-list a {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  text-decoration: none;
  color: var(--atlas-ink);
  font-weight: 600;
  font-size: 0.75rem;
}

.atlas-video-list img {
  width: 72px;
  height: 40px;
  object-fit: cover;
  border-radius: 0.3rem;
  background: #0f172a;
}

.atlas-playlist {
  margin: 0.45rem 0 0;
  font-size: 0.75rem;
}

.atlas-playlist a {
  font-weight: 800;
  color: var(--atlas-accent);
}

/* —— Progressive merchandising —— */
.atlas-merch {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--atlas-border);
}

.atlas-merch-label {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 900;
  color: var(--atlas-blue);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.atlas-merch-list {
  list-style: none;
  margin: 0 0 0.5rem;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.atlas-merch-item {
  display: flex;
  gap: 0.55rem;
  align-items: center;
}

.atlas-merch-item img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 0.4rem;
  border: 1px solid var(--atlas-border);
  background: #fff;
  flex: 0 0 52px;
}

.atlas-merch-name {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--atlas-ink);
  line-height: 1.3;
  margin-bottom: 0.2rem;
}

.atlas-merch-link {
  font-size: 0.6875rem;
  font-weight: 800;
  color: var(--atlas-accent);
  text-decoration: none;
}

.atlas-merch-link:hover {
  text-decoration: underline;
}

.atlas-merch-more,
.atlas-merch-rotate {
  margin: 0.25rem 0.35rem 0 0;
}

.atlas-merch-note {
  margin: 0.55rem 0 0;
  font-size: 0.625rem;
  color: var(--atlas-muted);
  line-height: 1.4;
}

.atlas-map-root .leaflet-popup-content-wrapper {
  border-radius: 12px;
  border: 2px solid var(--atlas-blue);
}

/* MarkerCluster (when loaded) — keep subtle */
.atlas-map-root .marker-cluster-small,
.atlas-map-root .marker-cluster-medium,
.atlas-map-root .marker-cluster-large {
  background-color: rgba(30, 58, 138, 0.22);
}

.atlas-map-root .marker-cluster-small div,
.atlas-map-root .marker-cluster-medium div,
.atlas-map-root .marker-cluster-large div {
  background-color: rgba(30, 58, 138, 0.85);
  color: #fff;
  font-weight: 800;
}

/* —— WO-384H Dude RV pin experience —— */
.atlas-exp-chip {
  min-height: 2.5rem;
  padding: 0.45rem 0.7rem 0.45rem 0.45rem;
  gap: 0.35rem;
  touch-action: manipulation;
}

.atlas-layer-chip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--atlas-cat-color);
  flex-shrink: 0;
}

.atlas-exp-chip.is-empty {
  opacity: 0.55;
  cursor: not-allowed;
  border-style: dashed;
}

.atlas-exp-chip.is-empty input:disabled {
  cursor: not-allowed;
}

.atlas-marker-hit {
  position: relative;
  display: block;
  width: 32px;
  height: 32px;
}

.atlas-marker-label {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%) translateY(4px);
  white-space: nowrap;
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0.15rem 0.4rem;
  border-radius: 0.3rem;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 3;
}

.atlas-marker-hit:hover .atlas-marker-label,
.atlas-marker-hit:has(.atlas-marker--hover) .atlas-marker-label,
.atlas-marker-hit:has(.atlas-marker--selected) .atlas-marker-label {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.atlas-marker-badges {
  position: absolute;
  right: -4px;
  top: -6px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  z-index: 2;
  pointer-events: none;
}

.atlas-marker-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 0.2rem;
  background: #0f172a;
  color: #fff;
  font-size: 0.5rem;
  font-weight: 800;
  line-height: 1;
  border: 1px solid #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.35);
}

.atlas-marker-badge--video { background: #1e3a5f; }
.atlas-marker-badge--journal { background: #334155; }
.atlas-marker-badge--scooter { background: #0f766e; }
.atlas-marker-badge--kayak { background: #1b6ca8; }
.atlas-marker-badge--train { background: #c45c12; }
.atlas-marker-badge--atlas { background: #475569; }

.atlas-marker {
  position: relative;
  z-index: 1;
}

.atlas-marker-shape--campground,
.atlas-marker-shape--unknown {
  border-radius: 50%;
}

.atlas-marker-shape--park {
  border-radius: 0.35rem;
}

.atlas-marker-shape--water {
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
}

.atlas-marker-shape--water.atlas-marker--selected,
.atlas-marker-shape--water.atlas-marker--hover {
  transform: rotate(-45deg) scale(1.2) translateY(-2px);
}

.atlas-marker-shape--rail {
  border-radius: 0.15rem;
  transform: rotate(45deg) scale(0.86);
}

.atlas-marker-shape--rail.atlas-marker--selected,
.atlas-marker-shape--rail.atlas-marker--hover {
  transform: rotate(45deg) scale(1.05) translateY(-2px);
}

.atlas-marker-shape--attraction {
  clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  border-radius: 0;
}

.atlas-marker-shape--homestead {
  border-radius: 0.2rem 0.2rem 0.15rem 0.15rem;
  clip-path: polygon(50% 0%, 100% 35%, 100% 100%, 0 100%, 0 35%);
}

.atlas-marker--hover {
  transform: translateY(-3px) scale(1.18);
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.95),
    0 0 0 5px rgba(15, 23, 42, 0.35),
    0 6px 14px rgba(15, 23, 42, 0.35);
  z-index: 4;
}

.atlas-marker--related {
  opacity: 1;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.95),
    0 0 0 4px rgba(30, 58, 138, 0.35),
    0 2px 6px rgba(15, 23, 42, 0.3);
}

.atlas-marker--dimmed {
  opacity: 0.38;
  filter: saturate(0.55);
}

.atlas-marker--halo-featured,
.atlas-marker--halo-recent,
.atlas-marker--halo-current {
  box-shadow:
    0 0 0 2.5px #fff,
    0 0 0 5px rgba(184, 134, 11, 0.55),
    0 2px 8px rgba(15, 23, 42, 0.4);
}

.atlas-marker--halo-recommended,
.atlas-marker--halo-rich {
  box-shadow:
    0 0 0 2.5px #fff,
    0 0 0 5px rgba(47, 107, 58, 0.45),
    0 2px 8px rgba(15, 23, 42, 0.4);
}

.atlas-marker--pulse {
  animation: atlas-halo-pulse 2.8s ease-in-out infinite;
}

@keyframes atlas-halo-pulse {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  .atlas-marker--pulse {
    animation: none;
  }
  .atlas-marker--hover,
  .atlas-marker-shape--water.atlas-marker--hover,
  .atlas-marker-shape--rail.atlas-marker--hover {
    transform: none;
  }
  .atlas-marker-label {
    transition: none;
  }
}

.atlas-disc-invite {
  margin: 0 0 0.65rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--atlas-ink);
}

.atlas-disc-grid {
  display: grid;
  gap: 0.5rem;
}

.atlas-disc-card {
  display: block;
  width: 100%;
  text-align: left;
  margin: 0;
  padding: 0.55rem 0.6rem;
  border: 1px solid var(--atlas-border);
  border-radius: 0.55rem;
  background: #fff;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.atlas-disc-card:hover,
.atlas-disc-card:focus-visible {
  border-color: #93c5fd;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.18);
  outline: none;
}

.atlas-disc-card--empty,
.atlas-disc-card--note {
  cursor: default;
  background: #f8fafc;
}

.atlas-disc-card--empty p,
.atlas-disc-card--note p {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: var(--atlas-muted);
  line-height: 1.35;
}

.atlas-disc-kicker {
  display: block;
  font-size: 0.625rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--atlas-blue);
  margin-bottom: 0.35rem;
}

.atlas-disc-row {
  display: flex;
  gap: 0.55rem;
  align-items: center;
}

.atlas-disc-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.atlas-pin-did {
  margin: 0 0 0.55rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--atlas-ink);
}

.atlas-pin-did-label {
  display: block;
  font-size: 0.625rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--atlas-muted);
  margin-bottom: 0.2rem;
}

.atlas-pin-hook {
  margin: 0 0 0.65rem;
  font-size: 0.8125rem;
  font-style: italic;
  color: #334155;
  line-height: 1.4;
}

.atlas-content-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
}

.atlas-content-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.45rem;
  border-radius: 0.3rem;
  background: #e2e8f0;
  color: #0f172a;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.atlas-content-badge--video { background: #dbeafe; color: #1e3a5f; }
.atlas-content-badge--journal { background: #e2e8f0; color: #334155; }
.atlas-content-badge--scooter { background: #ccfbf1; color: #115e59; }
.atlas-content-badge--kayak { background: #e0f2fe; color: #075985; }
.atlas-content-badge--train { background: #ffedd5; color: #9a3412; }
.atlas-content-badge--atlas { background: #f1f5f9; color: #475569; }

/* —— WO-384J Content Available inventory (location panel only) —— */
.atlas-content-available {
  margin: 0.65rem 0 0.85rem;
  padding: 0.55rem 0.65rem;
  border-left: 3px solid #1e3a5f;
  background: linear-gradient(90deg, rgba(30, 58, 95, 0.06), transparent);
}

.atlas-content-available-label {
  margin: 0 0 0.35rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1e3a5f;
}

.atlas-content-available-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
}

.atlas-content-available-item {
  font-size: 0.75rem;
  font-weight: 600;
  color: #334155;
}

.atlas-content-available-item a {
  color: #1e3a5f;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.atlas-content-available-item a:hover,
.atlas-content-available-item a:focus-visible {
  color: #0f172a;
}

.atlas-btn-atlas {
  border-color: #cbd5e1;
  color: #334155;
}

@media (max-width: 640px) {
  .atlas-exp-chip {
    min-height: 2.75rem;
    font-size: 0.75rem;
  }
  .atlas-layer-filters-list {
    gap: 0.5rem;
  }
  .atlas-marker-label {
    max-width: 8.5rem;
  }
}

/* —— WO-399A iPhone / Safari map surface ——
 * Adaptive heights (svh/dvh), safe-area chrome, touch tap targets.
 * Desktop trackball chrome unchanged above 900px.
 */
.atlas-map-surface.is-touch-primary {
  cursor: default;
  -webkit-tap-highlight-color: transparent;
}

.atlas-map-surface.is-touch-primary.is-mid-panning,
.atlas-map-surface.is-touch-primary.is-space-grab {
  cursor: default;
}

@media (max-width: 899px) {
  [data-atlas-mount],
  #atlas-map {
    min-height: 0;
    width: 100%;
    max-width: 100%;
  }

  .atlas-map-root {
    min-height: 0;
    max-width: 100%;
    border-radius: 0.65rem;
  }

  .atlas-map-canvas,
  .map-page-atlas .atlas-map-canvas {
    height: min(52svh, 420px);
    min-height: min(42svh, 300px);
    max-height: 68dvh;
  }

  .atlas-map-canvas.leaflet-container,
  .atlas-map-root .leaflet-container {
    min-height: 0;
  }

  .atlas-pin-panel {
    max-height: min(40svh, 340px);
    overscroll-behavior: contain;
  }

  .atlas-layer-chip,
  .atlas-exp-chip,
  .atlas-refine-chip {
    min-height: 44px;
    touch-action: manipulation;
  }

  .atlas-map-root .leaflet-control-zoom {
    margin: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px)) 0;
  }

  .atlas-map-root .leaflet-control-zoom a {
    width: 44px;
    height: 44px;
    line-height: 44px;
    font-size: 1.25rem;
  }

  .atlas-map-root .leaflet-control-attribution {
    margin: 0;
    padding: 0.25rem 0.5rem calc(0.25rem + env(safe-area-inset-bottom, 0px));
    max-width: min(100%, calc(100vw - 5.5rem));
    font-size: 0.625rem;
  }

  .atlas-marker-hit {
    width: 44px;
    height: 44px;
  }

  .atlas-fa-nav button,
  .atlas-btn,
  [data-atlas-close] {
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
  }

  .atlas-disc-flow-actions,
  .atlas-layer-filters-inner {
    min-width: 0;
  }
}

@media (max-width: 899px) and (orientation: landscape) {
  .atlas-map-canvas,
  .map-page-atlas .atlas-map-canvas {
    height: min(58svh, 260px);
    min-height: 180px;
    max-height: 62dvh;
  }

  .atlas-pin-panel {
    max-height: min(48svh, 200px);
  }

  .atlas-layer-filters {
    padding: 0.4rem 0.55rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .atlas-map-root .leaflet-fade-anim .leaflet-tile,
  .atlas-map-root .leaflet-fade-anim .leaflet-popup {
    transition: none !important;
  }
}
